diff --git a/src/views/plugin/workflow/mixins/ex-form.js b/src/views/plugin/workflow/mixins/ex-form.js index f79180a..a45a13c 100644 --- a/src/views/plugin/workflow/mixins/ex-form.js +++ b/src/views/plugin/workflow/mixins/ex-form.js @@ -245,22 +245,46 @@ export default { } startProcess(form) .then((res) => { - console.log(res) - // let item = 1; - // if (item === 1) { - // this.visible = true; - // done(); - // this.loading = false; - // } else { - - // } - if (isExForm === true) { - resolve(done); + if (res.data.data === "类似任务已经发起过,是否要强制发起") { + this.$confirm(res.data.data + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + // 强制发起重复任务 + startProcess({ ...form, forcestart: true }) + .then((res) => { + if (isExForm === true) { + resolve(done); + } else { + this.$message.success("发起成功"); + this.handleCloseTag( + "/plugin/workflow/process/workorder" + ); + done(); + this.loading = false; + } + }) + .catch(() => { + done(); + this.loading = false; + }); + }) + .catch(() => { + done(); + this.loading = false; + return; + }); } else { - this.$message.success("发起成功"); - this.handleCloseTag("/plugin/workflow/process/workorder"); - done(); - this.loading = false; + if (isExForm === true) { + resolve(done); + } else { + this.$message.success("发起成功"); + this.handleCloseTag("/plugin/workflow/process/workorder"); + done(); + this.loading = false; + } } }) .catch(() => { @@ -315,9 +339,10 @@ export default { */ handleCompleteTask(pass, variables) { return new Promise((resolve, reject) => { - const { comment, copyUser, assignee, attachment } = this.$refs.examineForm.examineForm; + const { comment, copyUser, assignee, attachment } = + this.$refs.examineForm.examineForm; // false隐藏 判断是否需要选择审批人 - let flag = this.$refs.examineForm.flag + let flag = this.$refs.examineForm.flag; if (flag && assignee === undefined) { this.$message.error("请指定审批人!"); reject();