fix(前端流程审批): 修复无用户任务表单时,审批通过前端报错导致无法提交问题。

This commit is contained in:
konbai
2022-08-19 00:34:35 +08:00
parent cf81741a73
commit d10ba055cb

View File

@@ -447,7 +447,8 @@ export default {
handleComplete() { handleComplete() {
// 校验表单 // 校验表单
const taskFormRef = this.$refs.taskFormParser; const taskFormRef = this.$refs.taskFormParser;
const taskFormPromise = new Promise((resolve, reject) => { // 若无任务表单,则 taskFormPromise 为 true即不需要校验
const taskFormPromise = taskFormRef === undefined ? true : new Promise((resolve, reject) => {
taskFormRef.$refs[taskFormRef.formConfCopy.formRef].validate(valid => { taskFormRef.$refs[taskFormRef.formConfCopy.formRef].validate(valid => {
valid ? resolve() : reject() valid ? resolve() : reject()
}) })
@@ -458,7 +459,7 @@ export default {
}) })
}); });
Promise.all([taskFormPromise, approvalPromise]).then(() => { Promise.all([taskFormPromise, approvalPromise]).then(() => {
this.taskForm.variables = this.$refs.taskFormParser.formData; this.taskForm.variables = taskFormRef?.formData;
complete(this.taskForm).then(response => { complete(this.taskForm).then(response => {
this.$modal.msgSuccess(response.msg); this.$modal.msgSuccess(response.msg);
this.goBack(); this.goBack();