yxk-20260730
改善提案
普通新增页面不再预生成流水号。提案编号在点击保存时由后端生成,前端仅展示“保存后自动生成”,避免并发重复。
Implementation Changes
新增页面初始化时不再调用年度流水号接口,也不再拼接提案编号。
提案编号输入框继续只读;新增状态显示“保存后自动生成”占位提示。
后端新增专用创建方法,在保存事务内:原子递增年度序列表。
按 提案部门名称-YYYY年-四位流水号 生成编号。
覆盖前端传入的 proposalNo 后保存主表。
新增接口返回 { id, proposalNo };前端附件仍使用返回的 id 关联。
新增年度序列表及历史编号初始化 SQL,保证首次上线从当前最大流水号继续递增。
This commit is contained in:
@@ -80,17 +80,10 @@ export const columns: BasicColumn[] = [
|
||||
align:"center",
|
||||
dataIndex: 'improvementMethod'
|
||||
},
|
||||
{
|
||||
title: '业务状态',
|
||||
align:"center",
|
||||
dataIndex: 'bpmStatus_dictText',
|
||||
width:90
|
||||
|
||||
dataIndex: 'finalAward_dictText'
|
||||
},
|
||||
{
|
||||
title: '流程状态',
|
||||
align:"center",
|
||||
width:90,
|
||||
dataIndex: 'bpmStatus_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
<a-form-item name="bpmStatus">
|
||||
<template #label><span title="业务状态">业务状态</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.bpmStatus" dictCode="super_status" placeholder="请选择业务状态" allow-clear />
|
||||
<template #label><span title="流程状态">流程状态</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.bpmStatus" dictCode="super_status" placeholder="请选择流程状态" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="toggleSearchStatus" :lg="6">
|
||||
|
||||
@@ -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`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user