From d0e3551b42f9402a1096f6f5e837111a6f4df1c9 Mon Sep 17 00:00:00 2001 From: rongchao Date: Fri, 6 Sep 2019 20:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=9C=BA=E6=9E=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/sys/dept-add-or-update.vue | 107 ++++++++++++++----- 1 file changed, 78 insertions(+), 29 deletions(-) diff --git a/src/views/modules/sys/dept-add-or-update.vue b/src/views/modules/sys/dept-add-or-update.vue index 33c0de85..ee9ba118 100644 --- a/src/views/modules/sys/dept-add-or-update.vue +++ b/src/views/modules/sys/dept-add-or-update.vue @@ -1,38 +1,70 @@ @@ -50,8 +82,11 @@ export default { name: '', pid: '', parentName: '', - sort: 0 - } + sort: 0, + typeKey: '', + typeName: '' + }, + secondOrgDictList: [] } }, computed: { @@ -79,6 +114,11 @@ export default { } }) }) + this.getSecondOrgDicList() + }, + // 改变机构类型 + changeOrgType (item) { + this.typeKey = item }, // 获取部门列表 getDeptList () { @@ -87,7 +127,16 @@ export default { return this.$message.error(res.msg) } this.deptList = res.data - }).catch(() => {}) + }).catch(() => { }) + }, + // 获取二级党委字典列表 + getSecondOrgDicList () { + this.$http.get(`/sys/dict/listSimple/org_type`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.secondOrgDictList = res.data + }).catch(() => { }) }, // 获取信息 getInfo () { @@ -103,7 +152,7 @@ export default { return this.deptListTreeSetDefaultHandle() } this.$refs.deptListTree.setCurrentKey(this.dataForm.pid) - }).catch(() => {}) + }).catch(() => { }) }, // 上级部门树, 设置默认值 deptListTreeSetDefaultHandle () { @@ -135,7 +184,7 @@ export default { this.$emit('refreshDataList') } }) - }).catch(() => {}) + }).catch(() => { }) }) }, 1000, { 'leading': true, 'trailing': false }) }