fix: 修复新建流程页面,用户取消后无法再次提交的bug

This commit is contained in:
gaoyunqi
2024-05-15 18:11:08 +08:00
parent b5a41d62b1
commit 2e07279924
4 changed files with 294 additions and 286 deletions

View File

@ -169,13 +169,13 @@
async function setFieldsValue(record) {
flowConfig.draftsFormData = record;
}
async function workflowSubmit() {
async function workflowSubmit(saveRowKey) {
let values = {};
try {
values = await SystemFormRef.value.validate();
// 提交表单
if (visible.value) {
let id = await submit();
let id = await submit(saveRowKey);
let rowKey = getRowKey();
values[rowKey] = id;
values['_id'] = id
@ -184,7 +184,7 @@
return values;
} catch (error) {}
}
async function submit() {
async function submit(saveRowKey) {
let saveValId = '';
let values = await SystemFormRef.value.validate();
let rowKey = getRowKey();
@ -198,6 +198,10 @@
} else {
// 新增
saveValId = await SystemFormRef.value.add(values);
if (saveRowKey) {
// 把rowKey写回去新建流程的时候防止取消了重复提交
props.workflowConfig.formModel[rowKey] = saveValId;
}
}
return saveValId;
}