From 5ce22e5df810217a3f6b83392fed505c1ecafed4 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 12 Jan 2021 15:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8C=BA=E5=9F=9F=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/sys/dept-add-or-update.vue | 36 +++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) 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)