yxk-20260730

改善提案
修复流程表单中提案类型不能正常翻译的bug
This commit is contained in:
ye1023
2026-07-30 16:13:51 +08:00
parent 5a0cd96e4e
commit 85a7e561da
@@ -14,7 +14,7 @@
<a-descriptions-item label="提案编号">{{ proposal.proposalNo || '-' }}</a-descriptions-item>
<a-descriptions-item label="提案名称">{{ proposal.proposalName || '-' }}</a-descriptions-item>
<a-descriptions-item label="提出日期">{{ formatDate(proposal.proposalDate) }}</a-descriptions-item>
<a-descriptions-item label="提案类别">{{ proposal.proposalCategory_dictText || proposal.proposalCategory || '-' }}</a-descriptions-item>
<a-descriptions-item label="提案类别">{{ proposalCategoryText }}</a-descriptions-item>
<a-descriptions-item label="提案部门">{{ proposal.proposalDeptName || '-' }}</a-descriptions-item>
<a-descriptions-item label="申请人">{{ proposal.applicantName || '-' }}</a-descriptions-item>
<a-descriptions-item label="团队名称" :span="2">{{ proposal.teamName || '-' }}</a-descriptions-item>
@@ -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<Recordable>({});
const proposalCategoryText = ref('-');
const currentScore = ref<Recordable | null>(null);
const voteRows = ref<Recordable[]>([]);
const instituteVoteCandidates = ref<Recordable[]>([]);
@@ -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 };
}