From 85a7e561da0eea76ce59244040f1b7d7da86c4a9 Mon Sep 17 00:00:00 2001 From: ye1023 <12588209+ye1023@user.noreply.gitee.com> Date: Thu, 30 Jul 2026 16:13:51 +0800 Subject: [PATCH] =?UTF-8?q?yxk-20260730=20=E6=94=B9=E5=96=84=E6=8F=90?= =?UTF-8?q?=E6=A1=88=20=E4=BF=AE=E5=A4=8D=E6=B5=81=E7=A8=8B=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E4=B8=AD=E6=8F=90=E6=A1=88=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=AD=A3=E5=B8=B8=E7=BF=BB=E8=AF=91=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ImprovementProposalBPMForm.vue | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue b/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue index 2ff8be8..967da2e 100644 --- a/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue +++ b/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue @@ -14,7 +14,7 @@ {{ proposal.proposalNo || '-' }} {{ proposal.proposalName || '-' }} {{ formatDate(proposal.proposalDate) }} - {{ proposal.proposalCategory_dictText || proposal.proposalCategory || '-' }} + {{ proposalCategoryText }} {{ proposal.proposalDeptName || '-' }} {{ proposal.applicantName || '-' }} {{ proposal.teamName || '-' }} @@ -258,6 +258,7 @@ import Icon from '/@/components/Icon/index'; import { useMessage } from '/@/hooks/web/useMessage'; import { useUserStore } from '/@/store/modules/user'; + import { initDictOptions } from '/@/utils/dict/index'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue'; import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue'; @@ -290,6 +291,7 @@ const savingVote = ref(false); const scoreModalVisible = ref(false); const proposal = ref({}); + const proposalCategoryText = ref('-'); const currentScore = ref(null); const voteRows = ref([]); const instituteVoteCandidates = ref([]); @@ -363,6 +365,7 @@ const mainId = processInfo.value.mainId; if (!mainId) { proposal.value = {}; + proposalCategoryText.value = '-'; currentScore.value = null; voteRows.value = []; instituteVoteCandidates.value = []; @@ -379,6 +382,7 @@ : Promise.resolve(null), ]); proposal.value = main || {}; + proposalCategoryText.value = await resolveProposalCategoryText(proposal.value); currentScore.value = myScore || null; voteRows.value = votes || []; initialAward.value = proposal.value.initialAward || ''; @@ -406,6 +410,28 @@ return processInfo.value.taskDefKey === taskDefKey; } + /** + * BPM 详情接口未必携带 JEECG 自动追加的 _dictText 字段,因此此处以字典接口兜底, + * 保证基本信息中的提案类别始终展示 proposal_category 的文本。 + */ + async function resolveProposalCategoryText(data: Recordable) { + const dictText = data.proposalCategory_dictText || data.proposalCategoryDictText; + if (dictText) return String(dictText); + + const categoryValue = data.proposalCategory; + if (categoryValue === undefined || categoryValue === null || categoryValue === '') return '-'; + + try { + const options = await initDictOptions('proposal_category'); + const matched = Array.isArray(options) + ? options.find((item) => String(item.value) === String(categoryValue)) + : undefined; + return matched?.text || matched?.label || String(categoryValue); + } catch (error) { + return String(categoryValue); + } + } + function actionPayload(extra: Recordable = {}) { return { ...processInfo.value, ...extra }; }