Merge branch 'master' of gitee.com:sz_30/supervision-vue into wsq-20260727

Signed-off-by: ye1023 <12588209+ye1023@user.noreply.gitee.com>
This commit is contained in:
ye1023
2026-07-30 08:58:11 +00:00
committed by Gitee
3 changed files with 42 additions and 28 deletions
@@ -16,7 +16,15 @@ export const columns: BasicColumn[] = [
{
title: '提案名称',
align:"center",
dataIndex: 'proposalName'
dataIndex: 'proposalName',
width:250
},
{
title: '提案类别',
align:"center",
dataIndex: 'proposalCategory_dictText',
width:110
},
{
title: '最终奖项',
@@ -63,13 +71,7 @@ export const columns: BasicColumn[] = [
width:110
},
{
title: '提案类别',
align:"center",
dataIndex: 'proposalCategory_dictText',
width:110
},
{
title: '问题描述',
align:"center",
@@ -83,9 +85,8 @@ export const columns: BasicColumn[] = [
{
title: '流程状态',
align:"center",
dataIndex: 'bpmStatus_dictText',
width:90
width:90,
dataIndex: 'bpmStatus_dictText'
},
];
@@ -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 };
}
@@ -6,7 +6,7 @@
<a-row>
<a-col :span="12">
<a-form-item label="提案编号" :required="false" id="ImprovementProposalForm-proposalNo" name="proposalNo">
<a-input v-model:value="formData.proposalNo" :disabled="true" allow-clear></a-input>
<a-input v-model:value="formData.proposalNo" placeholder="保存后自动生成" :disabled="true" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
@@ -126,7 +126,7 @@
import { defineComponent, ref, reactive, computed, toRaw, onMounted, nextTick } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
import { queryImprovementDeptScoreListByMainId, queryImprovementInstituteVoteListByMainId, queryDataById, saveOrUpdate, getLatestProposalSequence } from '../ImprovementProposal.api';
import { queryImprovementDeptScoreListByMainId, queryImprovementInstituteVoteListByMainId, queryDataById, saveOrUpdate } from '../ImprovementProposal.api';
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
import {improvementDeptScoreColumns, improvementInstituteVoteColumns} from '../ImprovementProposal.data';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
@@ -308,20 +308,6 @@
formData.proposalDeptCode = departInfo.orgCode;
}
async function getProposalSequence() {
const year = new Date().getFullYear();
const latestSequence = await getLatestProposalSequence(year);
// return Number(latestSequence) + 1;
return String(Number(latestSequence) + 1).padStart(4, '0');
}
async function generateProposalNo() {
const deptCode = formData.proposalDeptName || '';
const year = new Date().getFullYear();
const proposalSequence = await getProposalSequence();
return `${deptCode}-${year}年-${proposalSequence}`;
}
onMounted(()=>{
initFormData();
});
@@ -355,7 +341,6 @@
improvementInstituteVoteTable.dataSource = [];
formData.proposalDate = getCurrentDate();
await applyCurrentUserDeptInfo();
formData.proposalNo = await generateProposalNo();
}
async function edit(row) {
@@ -420,12 +405,14 @@
// 新增阶段附件暂不绑定;主表生成 ID 后统一关联,保证普通表单和 BPM 使用同一查询键。
if (!isUpdate) {
const newId = typeof result?.id === 'string' ? result.id.trim() : '';
const proposalNo = typeof result?.proposalNo === 'string' ? result.proposalNo.trim() : '';
if (!newId) {
// 阻断成功文案等非业务 ID 写入附件表,避免后续 BPM 无法按主表 ID 查询附件。
createMessage.error('新增成功但未返回提案ID,附件未关联,请刷新后重试');
return;
}
formData.id = newId;
formData.proposalNo = proposalNo;
await beforeFileRef.value?.bindBussinessId(`${formData.id}:before`);
await afterFileRef.value?.bindBussinessId(`${formData.id}:after`);
}