From b3f01d71a20b6ad42b3c83c5aa247fc87412f60b Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.com> Date: Wed, 11 Aug 2021 16:40:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/sys/partyorg-add-or-update.vue | 12 ++++- src/views/modules/sys/partyorg.vue | 50 ++++++++++++++++--- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/views/modules/sys/partyorg-add-or-update.vue b/src/views/modules/sys/partyorg-add-or-update.vue index 7a0a41d..8d1f645 100644 --- a/src/views/modules/sys/partyorg-add-or-update.vue +++ b/src/views/modules/sys/partyorg-add-or-update.vue @@ -110,6 +110,7 @@ export default { }, methods: { init () { + this.dataForm.allDeptIdArr = [] this.visible = true this.getOrgTypeOptions() this.getOptions() @@ -142,8 +143,15 @@ export default { }).catch(() => { }) }, allDeptIdsChangeHandle (value, selectedData) { - this.dataForm.deptName = this.$refs['org'].getCheckedNodes()[0].label - this.dataForm.deptId = this.$refs['org'].getCheckedNodes()[0].value + let len = 'value' + value + // len.length == 5 表示 未勾选任何所属机构 + if (5 < len.length) { + this.dataForm.deptName = this.$refs['org'].getCheckedNodes()[0].label + this.dataForm.deptId = this.$refs['org'].getCheckedNodes()[0].value + } else { + this.dataForm.deptId = '' + this.dataForm.deptName = '' + } }, // 地图相关 position (position) { diff --git a/src/views/modules/sys/partyorg.vue b/src/views/modules/sys/partyorg.vue index f24d28b..039f0e8 100644 --- a/src/views/modules/sys/partyorg.vue +++ b/src/views/modules/sys/partyorg.vue @@ -2,8 +2,19 @@
- - + + + + + + {{ $t('query') }} @@ -12,11 +23,11 @@ {{ $t('add') }} - {{ $t('deleteBatch') }} + {{ $t('export') }} - @@ -53,13 +64,38 @@ export default { getDataListURL: '/sys/partyorg/page', getDataListIsPage: true, deleteURL: '/sys/partyorg', - deleteIsBatch: true + deleteIsBatch: true, + exportURL: '/sys/partyorg/export', }, dataForm: { - id: '' - } + id: '', + deptId: '' + }, + options: [] } }, + methods: { + deptIdChangeHandle (value, selectedData) { + let len = 'value' + value + // len.length == 5 表示 未勾选任何所属机构 + if (5 < len.length) { + this.dataForm.deptId = this.$refs['org'].getCheckedNodes()[0].value + } else { + this.dataForm.deptId = '' + } + }, + }, + created () { + this.$http + .get(`/sys/user/deptOptions/getByLoginUser`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.options = res.data.options + }) + .catch(() => { }) + }, components: { AddOrUpdate }