From 5d0e48ea6b7a6d45a690b897c672972846bc3cd4 Mon Sep 17 00:00:00 2001 From: Harry Yang Date: Tue, 27 Dec 2022 16:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=90=88=E5=90=8C=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=20=E4=BC=98=E5=8C=96=20=E7=94=B3=E8=AF=B7=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E9=AA=8C=E8=AF=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/admin/business/process-edit.ftl | 21 +++++-------- .../templates/admin/business/process-new.ftl | 30 +++++++------------ 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/main/resources/templates/admin/business/process-edit.ftl b/src/main/resources/templates/admin/business/process-edit.ftl index e8e1864..887716f 100644 --- a/src/main/resources/templates/admin/business/process-edit.ftl +++ b/src/main/resources/templates/admin/business/process-edit.ftl @@ -91,7 +91,7 @@
- @@ -512,7 +512,7 @@ } } - if (!processForm.applyDeptLeaderId) { + if (!processForm.applyDeptId) { this.$message.error("申请部门还未选择"); return false } @@ -524,8 +524,11 @@ background: 'rgba(0, 0, 0, 0.7)' }) + const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割) + const form = { ...this.processForm, + applyDeptId, attachments: fileList.map(file => { if (file.url) { return { @@ -612,7 +615,6 @@ const level1Value = value[0] const level2Value = value.length >= 2 && value[1] const level3Value = value.length === 3 && value[2] - let opt; const find = (options, value) => { return options.find(option => option.id === value) @@ -623,27 +625,20 @@ leveled.push(selected) if (selected && level2Value) { selected = find(selected.children, level2Value) + leveled.push(selected) if (selected && level3Value) { - leveled.push(selected) selected = find(selected.children, level3Value) if (selected) { leveled.push(selected) - opt = selected } } - else { - opt = selected - } - } - else { - opt = selected } this.selectedDepts = leveled.map(level => level.id) this.processForm['applyDept'] = leveled.map(level => level.name).join(',') // (逗号分割) this.processForm['applyDeptId'] = leveled.map(level => level.id).join(',') // (逗号分割) - this.processForm['applyDeptLeaderId'] = opt.leaderId - this.processForm['applyDeptLeaderName'] = opt.leaderName + this.processForm['applyDeptLeaderId'] = selected.leaderId + this.processForm['applyDeptLeaderName'] = selected.leaderName }, } diff --git a/src/main/resources/templates/admin/business/process-new.ftl b/src/main/resources/templates/admin/business/process-new.ftl index 1ffd125..28bc026 100644 --- a/src/main/resources/templates/admin/business/process-new.ftl +++ b/src/main/resources/templates/admin/business/process-new.ftl @@ -95,7 +95,7 @@ <#-- 新增销售合同流程 -->
- +
@@ -142,8 +142,8 @@
- - + @@ -479,7 +479,6 @@ // 销售合同收入明细 incomeDetails: [], processType: "", - selectedDepts: [] } } @@ -602,7 +601,7 @@ }, submit() { - this.$refs["saleContractProcessForm"].validate((valid) => { + this.$refs["contractProcessForm"].validate((valid) => { if (valid) { const fileList = this.fileList if (fileList.length === 0) { @@ -646,7 +645,7 @@ } } - if (!processForm.applyDeptLeaderId) { + if (!processForm.applyDeptId) { this.$message.error("申请部门还未选择"); return false } @@ -659,9 +658,11 @@ background: 'rgba(0, 0, 0, 0.7)' }) + const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割) const form = { ...processForm, processType, + applyDeptId, projectTitle: this.projectTitle, attachments: fileList.map(file => ({ uri: file.response.data.url, @@ -746,7 +747,6 @@ const level1Value = value[0] const level2Value = value.length >= 2 && value[1] const level3Value = value.length === 3 && value[2] - let opt; const find = (options, value) => { return options.find(option => option.id === value) @@ -757,27 +757,19 @@ leveled.push(selected) if (selected && level2Value) { selected = find(selected.children, level2Value) + leveled.push(selected) if (selected && level3Value) { - leveled.push(selected) selected = find(selected.children, level3Value) if (selected) { leveled.push(selected) - opt = selected } } - else { - opt = selected - } - } - else { - opt = selected } - this.selectedDepts = leveled.map(level => level.id) + // applyDeptId 提交时处理 this.processForm['applyDept'] = leveled.map(level => level.name).join(',') // (逗号分割) - this.processForm['applyDeptId'] = leveled.map(level => level.id).join(',') // (逗号分割) - this.processForm['applyDeptLeaderId'] = opt.leaderId - this.processForm['applyDeptLeaderName'] = opt.leaderName + this.processForm['applyDeptLeaderId'] = selected.leaderId + this.processForm['applyDeptLeaderName'] = selected.leaderName }, }