diff --git a/src/views/modules/sys/dept-add-or-update.vue b/src/views/modules/sys/dept-add-or-update.vue index 763c25c..8c09c40 100644 --- a/src/views/modules/sys/dept-add-or-update.vue +++ b/src/views/modules/sys/dept-add-or-update.vue @@ -18,10 +18,14 @@ - - + + + + + + + + { }) }, + // 获取区域编码 + getAreaCodeOption () { + return this.$http.get('/sys/dept/getEpmetAreaCode',{ params: { rootAreaCode: '370124', rootAreaLevel: 'province' }}).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.areaCodeOptions = res.data + }).catch(() => { }) + }, // 获取二级党委字典列表 getSecondOrgDicList () { this.$http.get(`/sys/dict/listSimple/org_type`).then(({ data: res }) => { @@ -174,6 +197,7 @@ export default { ...this.dataForm, ...res.data } + this.dataForm.allAreaCode = res.data.allAreaCode.split(',') if (this.dataForm.pid === '0') { return this.deptListTreeSetDefaultHandle() } @@ -197,6 +221,8 @@ export default { if (!valid) { return false } + this.dataForm.areaCode = this.dataForm.allAreaCode[this.dataForm.allAreaCode.length - 1]; + this.dataForm.allAreaCode = this.dataForm.allAreaCode.toString(); this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dept', this.dataForm).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg)