From 3246a8a717cdff433dfa5327aab071351c3624a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=9F=B9=E5=8F=8B?= <17852335869@163.com> Date: Wed, 22 Feb 2023 17:46:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=87=8D=E5=A4=8D=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plugin/workflow/mixins/ex-form.js | 59 +++++++++++++++------ 1 file changed, 42 insertions(+), 17 deletions(-) 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();