From 575a84d880edfc46ca895a232dfce0acdbf6ea45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Thu, 9 Nov 2023 14:36:39 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A0=87=E5=87=86=E6=B3=95=E8=A7=84?= =?UTF-8?q?=E5=85=A5=E5=BA=93/=E5=8F=98=E6=9B=B4=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardEntryOrChangeProcess.vue | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue index 87008b55..a7346365 100644 --- a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue +++ b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue @@ -718,8 +718,19 @@ export default { // 处理业务信息 this.$refs.ruleForm.validate(valid => { if (valid) { + const formInline = JSON.parse(JSON.stringify(this.formInline)) + Object.keys(formInline).forEach(res => { + if (formInline[res] instanceof Array) { + if (formInline[res][0] instanceof Object) { + // 说明是树选择 + formInline[res] = formInline[res].map(item => item.value).join(',') + } else { + formInline[res] = formInline[res].josn(',') + } + } + }) formData.businessInfoDTO = { - businessMap: { ...this.formInline } + businessMap: formInline } } else { flag = false @@ -746,28 +757,25 @@ export default { } return flag }, - dealBusinessData (data) { - // 下划线转驼峰 - const toHump = (name) => { - return name.replace(/\_(\w)/g, function (all, letter) { - return letter.toUpperCase() - }) - } - const resultData = {} - Object.keys(data).forEach(key => { - const newKey = toHump(key) - resultData[newKey] = data[key] - }) - return resultData - }, /** * 保存 */ handleSave () { + const formInline = JSON.parse(JSON.stringify(this.formInline)) + Object.keys(formInline).forEach(res => { + if (formInline[res] instanceof Array) { + if (formInline[res][0] instanceof Object) { + // 说明是树选择 + formInline[res] = formInline[res].map(item => item.value).join(',') + } else { + formInline[res] = formInline[res].join(',') + } + } + }) const formData = { basicProcessInfoDTO: Object.assign(this.processInfo, this.processInfoForm.getFieldsValue()), // 流程信息 businessInfoDTO: { - businessMap: { ...this.formInline } + businessMap: formInline }, // 业务信息 basicTaskInfoDTO: Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue()), // 流程审批信息 userInfoMap: this.$refs.personnelInfo.getDataObj() // 用户信息