|
|
|
@ -180,7 +180,6 @@
|
|
|
|
|
schemeId: designerData.formCurrentNode.formVerison,
|
|
|
|
|
isUpdate: props.isUpdate,
|
|
|
|
|
pkey: keyValue.value,
|
|
|
|
|
pkeyValue: processId,
|
|
|
|
|
};
|
|
|
|
|
// 有表单内容,先存表单信息
|
|
|
|
|
if (formVisble.value) {
|
|
|
|
@ -190,19 +189,31 @@
|
|
|
|
|
formBoxRef.value
|
|
|
|
|
.getForm()
|
|
|
|
|
.then(async (res) => {
|
|
|
|
|
res[designerData.formCurrentNode.formRelationId] = processId;
|
|
|
|
|
if (!props.isUpdate) {
|
|
|
|
|
res[designerData.formCurrentNode.formRelationId] = processId;
|
|
|
|
|
querys.pkeyValue = processId;
|
|
|
|
|
}
|
|
|
|
|
for (var item in res) {
|
|
|
|
|
console.log(res[item]);
|
|
|
|
|
if (res[item] == undefined) {
|
|
|
|
|
res[item] = '';
|
|
|
|
|
if (item.search('_input_guid') != -1) {
|
|
|
|
|
if (item.search('_input_guid') != -1 && !props.isUpdate) {
|
|
|
|
|
res[item] = buildGUID();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (props.isUpdate) {
|
|
|
|
|
if (item.search('_input_guid') != -1) {
|
|
|
|
|
console.log(res[item]);
|
|
|
|
|
querys.pkeyValue = res[item];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
querys.data = JSON.stringify(res);
|
|
|
|
|
console.log(querys);
|
|
|
|
|
const formValue = await functionsaveForm(querys);
|
|
|
|
|
if (formValue) {
|
|
|
|
|
handleCreateFlow(processId);
|
|
|
|
|
handleCreateFlow(processId, querys.pkeyValue);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
@ -214,12 +225,18 @@
|
|
|
|
|
handleCreateFlow(processId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async function handleCreateFlow(processId) {
|
|
|
|
|
async function handleCreateFlow(processId, pkeyValue) {
|
|
|
|
|
var commit = {
|
|
|
|
|
schemeId: designerData.formCurrentNode.formVerison,
|
|
|
|
|
pkey: keyValue.value,
|
|
|
|
|
pkeyValue: pkeyValue ? pkeyValue : processId,
|
|
|
|
|
};
|
|
|
|
|
var querys = {
|
|
|
|
|
schemeCode: designerData.isDraft ? '' : props.code,
|
|
|
|
|
userId: formData.userId,
|
|
|
|
|
title: formData.title,
|
|
|
|
|
processId: processId,
|
|
|
|
|
InstanceInfo: JSON.stringify(commit),
|
|
|
|
|
};
|
|
|
|
|
if (!designerData.isDraft) {
|
|
|
|
|
await saveDraft(querys);
|
|
|
|
|