From 3e5fd5805c5192740cb240b3d698dbfc1124e1c2 Mon Sep 17 00:00:00 2001 From: ssc <273702440@qq.com> Date: Fri, 11 Mar 2022 09:52:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=8A=82=E7=82=B9=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=94=AF=E6=8C=81=E5=90=8C=E6=97=B6=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E4=B8=8E=E5=A1=AB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plugin/workflow/mixins/ex-form.js | 14 +++++ .../workflow/process/components/detail.vue | 63 ++++++++++++------- 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/src/views/plugin/workflow/mixins/ex-form.js b/src/views/plugin/workflow/mixins/ex-form.js index d67faec..2c7d416 100644 --- a/src/views/plugin/workflow/mixins/ex-form.js +++ b/src/views/plugin/workflow/mixins/ex-form.js @@ -343,12 +343,26 @@ export default { }) }) } + // 汇总表单打印 + const summaryOption = this.deepClone(this.summaryOption) + if (this.summaryOption.group) { + this.summaryOption.group.forEach(g => { + g.collapse = false + g.column.forEach(col => { + this.handleTemporaryPrintOption(col) + }) + setTimeout(() => { + g.collapse = true + }) + }) + } setTimeout(() => { loading.close() // const watermarkText = this.userInfo.user_name + " " + this.userInfo.dept_name // Watermark.set({ watermark_txt: watermarkText }) // 添加水印 Print('#printBody') this.option = option + this.summaryOption = summaryOption Watermark.remove() // 删除水印 }, 500) }, diff --git a/src/views/plugin/workflow/process/components/detail.vue b/src/views/plugin/workflow/process/components/detail.vue index c4068e4..ef84e4e 100644 --- a/src/views/plugin/workflow/process/components/detail.vue +++ b/src/views/plugin/workflow/process/components/detail.vue @@ -21,6 +21,12 @@
+ { - if (valid) { - const variables = {} - this.vars.forEach(v => { - if (v != 'comment' && this.form[v]) variables[v] = this.form[v] - }) + const { form, summaryForm } = this.$refs + if (form) { + this.$refs.form.validate((valid, done, msg) => { + if (valid) { + const variables = {} + this.vars.forEach(v => { + if (v != 'comment' && this.form[v]) variables[v] = this.form[v] + }) - this.handleCompleteTask(pass, variables).then(() => { - this.$message.success("处理成功") - this.handleCloseTag('/plugin/workflow/process/todo') - }).catch(() => { + this.handleCompleteTask(pass, variables).then(() => { + this.$message.success("处理成功") + this.handleCloseTag('/plugin/workflow/process/todo') + }).catch(() => { + if (typeof done == 'function') done() + this.submitLoading = false + }) + } else { done() this.submitLoading = false - }) - } else { - done() - this.submitLoading = false - if (msg) { - const key = Object.keys(msg)[0] - const rules = msg[key] - this.$message.error(rules.map(r => r.message).join(' | ')) + if (msg) { + const key = Object.keys(msg)[0] + const rules = msg[key] + this.$message.error(rules.map(r => r.message).join(' | ')) + } } - } - }) + }) + } else if (summaryForm) { + this.handleCompleteTask(pass, {}).then(() => { + this.$message.success("处理成功") + this.handleCloseTag('/plugin/workflow/process/todo') + }).catch(() => { + this.submitLoading = false + }) + } else this.$message.error('找不到需要提交的表单') }, } }