yxk-20260727
改善提案 编辑的时候,去掉子表
This commit is contained in:
@@ -230,8 +230,8 @@
|
||||
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() {
|
||||
const now = new Date();
|
||||
@@ -354,11 +354,9 @@
|
||||
async function edit(row) {
|
||||
//主表数据
|
||||
await queryMainData(row.id);
|
||||
//子表数据
|
||||
const improvementDeptScoreDataList = await queryImprovementDeptScoreListByMainId(row['id']);
|
||||
improvementDeptScoreTable.dataSource = [...improvementDeptScoreDataList];
|
||||
const improvementInstituteVoteDataList = await queryImprovementInstituteVoteListByMainId(row['id']);
|
||||
improvementInstituteVoteTable.dataSource = [...improvementInstituteVoteDataList];
|
||||
// 普通编辑不加载子表,并清理弹窗复用时可能残留的表格数据。
|
||||
improvementDeptScoreTable.dataSource = [];
|
||||
improvementInstituteVoteTable.dataSource = [];
|
||||
}
|
||||
|
||||
async function queryMainData(id) {
|
||||
@@ -399,8 +397,8 @@
|
||||
const mainData = await getFormData();
|
||||
const isUpdate = Boolean(mainData.id);
|
||||
const values = Object.assign({}, dbData, mainData);
|
||||
// 新增提案只保存主表;已有提案编辑或流程提交时才采集子表数据。
|
||||
if (isUpdate) {
|
||||
// 仅流程表单提交子表,普通编辑不能覆盖后续流程维护的评分和投票记录。
|
||||
if (isUpdate && showSubTables.value) {
|
||||
const subData = await getSubFormAndTableData();
|
||||
Object.assign(values, subData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user