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(() => {}) }, // 表单提交