From b4d6279265e9a5f89887cd945034474ed0d4ca30 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 27 Jun 2025 12:09:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../key-person/components/addAndEditForm.vue | 30 ++++++++++++------- src/views/company-manage/key-person/index.vue | 8 ++--- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/views/company-manage/key-person/components/addAndEditForm.vue b/src/views/company-manage/key-person/components/addAndEditForm.vue index 03f75ff..6579c99 100644 --- a/src/views/company-manage/key-person/components/addAndEditForm.vue +++ b/src/views/company-manage/key-person/components/addAndEditForm.vue @@ -45,7 +45,9 @@ :upload-file-url="uploadFileUrl" :file-type="['jpg', 'png', 'jpeg']" :file-list.sync="addAndEditForm.idCardFront" - :is-uploaded="addAndEditForm.idCardFront.length >= 1" + :is-uploaded=" + addAndEditForm.idCardFront && addAndEditForm.idCardFront.length >= 1 + " > @@ -59,7 +61,9 @@ :upload-file-url="uploadFileUrl" :file-type="['jpg', 'png', 'jpeg']" :file-list.sync="addAndEditForm.idCardBack" - :is-uploaded="addAndEditForm.idCardBack.length >= 1" + :is-uploaded=" + addAndEditForm.idCardBack && addAndEditForm.idCardBack.length >= 1 + " > @@ -251,7 +255,7 @@ :upload-file-url="uploadFileUrl" :file-type="['jpg', 'png', 'jpeg']" :file-list.sync="item.diplomaImg" - :is-uploaded="item.diplomaImg.length >= 5" + :is-uploaded="item.diplomaImg && item.diplomaImg.length >= 5" /> @@ -277,7 +281,7 @@ :upload-file-url="uploadFileUrl" :file-type="['jpg', 'png', 'jpeg']" :file-list.sync="addAndEditForm.otherImg" - :is-uploaded="addAndEditForm.otherImg.length >= 5" + :is-uploaded="addAndEditForm.otherImg && addAndEditForm.otherImg.length >= 5" /> @@ -319,7 +323,10 @@ export default { fileViewUrl: process.env.VUE_APP_BASE_API + '/files', deleteFileList: [], uploadOuterVisible: false, - diplomaList: [{ name: '注册建造师' }, { name: '项目经理B证' }], // 资格证书列表 + diplomaList: [ + { name: '注册建造师', value: '注册建造师' }, + { name: '项目经理B证', value: '项目经理B证' }, + ], // 资格证书列表 addAndEditForm: { userName: '', // 姓名 idCard: '', // 身份证号码 @@ -344,7 +351,7 @@ export default { diplomaNum: '', level: '', diplomaImg: [], - diplomaList: [{ name: '注册建造师' }, { name: '项目经理B证' }], + diplomaList: [], }, ], // 资格证书列表 }, @@ -700,15 +707,16 @@ export default { watch: { editRow: { handler(newVal) { - if (newVal && Object.keys(newVal).length > 0) { + if (newVal) { Object.assign(this.addAndEditForm, { ...newVal }) + this.addAndEditForm = JSON.parse(JSON.stringify(this.addAndEditForm)) + if (this.addAndEditForm.certificateList.length > 0) { this.addAndEditForm.certificateList.forEach((item, index) => { - this.$set(this.addAndEditForm.certificateList[index], 'diplomaList', this.diplomaList) - - if (!this.diplomaList.includes(item.diploma)) { - this.addAndEditForm.certificateList[index].diplomaList.push({ + this.$set(item, 'diplomaList', this.diplomaList) + if (!item.diplomaList.some((j) => j.name === item.diploma)) { + item.diplomaList.push({ name: item.diploma, value: item.diploma, }) diff --git a/src/views/company-manage/key-person/index.vue b/src/views/company-manage/key-person/index.vue index 4b14fbe..adad059 100644 --- a/src/views/company-manage/key-person/index.vue +++ b/src/views/company-manage/key-person/index.vue @@ -14,7 +14,7 @@ -