yxk-20260727
改善提案 编辑的时候,去掉子表
This commit is contained in:
@@ -230,8 +230,8 @@
|
|||||||
return props.formDisabled;
|
return props.formDisabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 普通新增没有业务 ID,不展示评分和投票子表;已有数据及流程表单正常展示。
|
// 子表由流程节点维护,普通新增、编辑和详情弹窗均不展示,避免误改评分或投票数据。
|
||||||
const showSubTables = computed(() => Boolean(formData.id || props.formData?.dataId));
|
const showSubTables = computed(() => props.formBpm === true && Boolean(formData.id || props.formData?.dataId));
|
||||||
|
|
||||||
function getCurrentDate() {
|
function getCurrentDate() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@@ -354,11 +354,9 @@
|
|||||||
async function edit(row) {
|
async function edit(row) {
|
||||||
//主表数据
|
//主表数据
|
||||||
await queryMainData(row.id);
|
await queryMainData(row.id);
|
||||||
//子表数据
|
// 普通编辑不加载子表,并清理弹窗复用时可能残留的表格数据。
|
||||||
const improvementDeptScoreDataList = await queryImprovementDeptScoreListByMainId(row['id']);
|
improvementDeptScoreTable.dataSource = [];
|
||||||
improvementDeptScoreTable.dataSource = [...improvementDeptScoreDataList];
|
improvementInstituteVoteTable.dataSource = [];
|
||||||
const improvementInstituteVoteDataList = await queryImprovementInstituteVoteListByMainId(row['id']);
|
|
||||||
improvementInstituteVoteTable.dataSource = [...improvementInstituteVoteDataList];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function queryMainData(id) {
|
async function queryMainData(id) {
|
||||||
@@ -399,8 +397,8 @@
|
|||||||
const mainData = await getFormData();
|
const mainData = await getFormData();
|
||||||
const isUpdate = Boolean(mainData.id);
|
const isUpdate = Boolean(mainData.id);
|
||||||
const values = Object.assign({}, dbData, mainData);
|
const values = Object.assign({}, dbData, mainData);
|
||||||
// 新增提案只保存主表;已有提案编辑或流程提交时才采集子表数据。
|
// 仅流程表单提交子表,普通编辑不能覆盖后续流程维护的评分和投票记录。
|
||||||
if (isUpdate) {
|
if (isUpdate && showSubTables.value) {
|
||||||
const subData = await getSubFormAndTableData();
|
const subData = await getSubFormAndTableData();
|
||||||
Object.assign(values, subData);
|
Object.assign(values, subData);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user