From fe65416eec088383f564f6a1a08f44abbfa1c74a Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Wed, 17 Jun 2020 08:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E7=BE=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partygroup/partygroup-add-or-update.vue | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/views/modules/partygroup/partygroup-add-or-update.vue b/src/views/modules/partygroup/partygroup-add-or-update.vue index 40f254b..68d6efd 100644 --- a/src/views/modules/partygroup/partygroup-add-or-update.vue +++ b/src/views/modules/partygroup/partygroup-add-or-update.vue @@ -121,7 +121,13 @@ export default { } let endOption = res.data.options for (let i = 0; i < endOption.length; i++) { - endOption[i].children = '' + if (endOption[i].children) { + for (let m = 0; m < endOption[i].children.length; m++) { + if (endOption[i].children[m].children) { + endOption[i].children[m].children = '' + } + } + } } this.options = endOption }) @@ -140,11 +146,9 @@ export default { }) }, getUserList () { - if (!this.dataForm.id) { - this.dataForm.userId = '' - this.nickname = '' - } - let deptId = Array.isArray(this.deptIdList) ? this.deptIdList[0] : this.deptIdList + this.dataForm.userId = '' + this.nickname = '' + let deptId = Array.isArray(this.deptIdList) ? this.deptIdList[1] : this.deptIdList this.dataForm.deptId = deptId }, handleAvatarSuccess (res, file) { @@ -182,9 +186,10 @@ export default { ...this.dataForm, ...res.data } - this.deptIdList = res.data.deptId + this.deptIdList = res.data.deptIdList this.nickname = res.data.nickname - this.getUserList() + let deptId = Array.isArray(this.deptIdList) ? this.deptIdList[1] : this.deptIdList + this.dataForm.deptId = deptId }).catch(() => {}) }, // 表单提交