From d31c4cbcb14b643e6e4a46cddfb3bdba0ed30ca4 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Mon, 15 Jul 2024 15:47:02 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E5=B8=82=E5=9C=BA=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/BaseInfoForm.vue | 78 +++++++++++-------- 1 file changed, 46 insertions(+), 32 deletions(-) diff --git a/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue b/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue index 724935e..d29a78f 100644 --- a/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue +++ b/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue @@ -79,28 +79,30 @@ - -
- -
-
- * - +
@@ -149,11 +151,9 @@ export default { message: this.$t('listNumber') + this.$t('cannotEmpty'), trigger: 'change' } - ] - }, - userRules: { + ], // 抄送人员 - ccPerson: [ + copyUser: [ { required: true, message: this.$t('ccPerson') + this.$t('cannotEmpty'), @@ -361,8 +361,12 @@ export default { return { value: item } }) } - this.userFormInline.ccPerson = data.ccPerson - this.userFormInline.ccPerson_dictText = data.ccPerson_dictText + if (this.currentNode === 1) { + const userFormInline = {} + userFormInline.copyUser = data.copyUser + userFormInline.copyUser_dictText = data.copyUser_dictText + this.userFormInline = Object.assign({}, userFormInline) + } this.dataSource = JSON.parse(JSON.stringify(data.list)) this.isGetDataAfter = true }, @@ -371,27 +375,37 @@ export default { // 把数据抛出,在线编辑不知道要不要抛 const data = Object.assign({}, this.formInline) data.country = data.country.map(item => item.value).join(',') - data.ccPerson = this.userFormInline.ccPerson - data.ccPerson_dictText = this.userFormInline.ccPerson_dictText + data.copyUser = this.userFormInline.copyUser + data.copyUser_dictText = this.userFormInline.copyUser_dictText data.list = JSON.parse(JSON.stringify(this.dataSource)) return data }, // 外层获取数据要过校验,返回false表示没有通过校验 async getDataValidate () { let data = {} - await this.$refs.ruleForm.validate(valid => { - this.$refs.userRuleForm.validate(userValid => { - if (valid && userValid) { + if (this.currentNode === 1) { + await this.$refs.ruleForm.validate(async valid => { + await this.$refs.userRuleForm.validate(userValid => { + if (valid && userValid) { + data = Object.assign({}, this.formInline, this.userFormInline) + data.country = data.country.map(item => item.value).join(',') + data.list = JSON.parse(JSON.stringify(this.dataSource)) + } else { + data = false + } + }) + }) + } else { + await this.$refs.ruleForm.validate(valid => { + if (valid) { data = Object.assign({}, this.formInline) data.country = data.country.map(item => item.value).join(',') - data.ccPerson = this.userFormInline.ccPerson - data.ccPerson_dictText = this.userFormInline.ccPerson_dictText data.list = JSON.parse(JSON.stringify(this.dataSource)) } else { data = false } }) - }) + } return data }, // 选择用户得到用户名