From d5bad28e22b630c16020d06b956db159bca42b10 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Mon, 23 Sep 2019 13:52:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B8=85=E7=A9=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/news/news.vue | 16 ++++++++++ src/views/modules/news/newsdraft.vue | 16 +++++++++- src/views/modules/user/partymembers.vue | 16 ++++++++++ src/views/modules/user/user-add-or-update.vue | 2 ++ src/views/modules/user/user.vue | 31 +++++++++++++------ 5 files changed, 70 insertions(+), 11 deletions(-) diff --git a/src/views/modules/news/news.vue b/src/views/modules/news/news.vue index b8d9aafa..1590b3a4 100644 --- a/src/views/modules/news/news.vue +++ b/src/views/modules/news/news.vue @@ -9,6 +9,7 @@ prop="deptId">     { }) }, changeStreet (event) { + if (this.dataForm.streetId === '') { + this.communityList = [] + this.gridList = [] + this.dataForm.communityId = '' + this.dataForm.gridId = '' + return + } this.dataForm.streetId = event let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0] this.initDeptIdAndName(choosenItem) @@ -258,6 +269,11 @@ export default { this.getDeptInfoList('community', event) }, changeCommunity (event) { + if (this.dataForm.communityId === '') { + this.gridList = [] + this.dataForm.gridId = '' + return + } this.communityId = event let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0] this.initDeptIdAndName(choosenItem) diff --git a/src/views/modules/news/newsdraft.vue b/src/views/modules/news/newsdraft.vue index acfb9c90..0ac86470 100644 --- a/src/views/modules/news/newsdraft.vue +++ b/src/views/modules/news/newsdraft.vue @@ -8,6 +8,7 @@ { }) }, changeStreet (event) { - console.log(111111111111) + if (this.dataForm.streetId === '') { + this.communityList = [] + this.gridList = [] + this.dataForm.communityId = '' + this.dataForm.gridId = '' + return + } this.dataForm.streetId = event let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0] this.initDeptIdAndName(choosenItem) @@ -230,6 +239,11 @@ export default { this.getDeptInfoList('community', event) }, changeCommunity (event) { + if (this.dataForm.communityId === '') { + this.gridList = [] + this.dataForm.gridId = '' + return + } this.communityId = event let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0] this.initDeptIdAndName(choosenItem) diff --git a/src/views/modules/user/partymembers.vue b/src/views/modules/user/partymembers.vue index 44bd00d7..2642c032 100755 --- a/src/views/modules/user/partymembers.vue +++ b/src/views/modules/user/partymembers.vue @@ -7,6 +7,7 @@ @keyup.enter.native="getDataList()"> { }) }, getCommunityList () { + if (this.dataForm.streetId === '') { + this.communityOptions = [] + this.gridOptions = [] + this.dataForm.communityId = '' + this.dataForm.gridId = '' + return + } this.dataForm.communityId = '' this.dataForm.gridId = '' this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { @@ -258,6 +269,11 @@ export default { }).catch(() => { }) }, getGridList () { + if (this.dataForm.communityId === '') { + this.gridOptions = [] + this.dataForm.gridId = '' + return + } this.dataForm.gridId = '' this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { if (res.code !== 0) { diff --git a/src/views/modules/user/user-add-or-update.vue b/src/views/modules/user/user-add-or-update.vue index a4119b54..bfe96a1d 100644 --- a/src/views/modules/user/user-add-or-update.vue +++ b/src/views/modules/user/user-add-or-update.vue @@ -22,6 +22,7 @@

- + - + - + - + - + - +
- + - + - + - + {}) }, getCommunityList () { + if (this.dataForm.streetId === '') { + this.communityOptions = [] + this.dataForm.communityId = '' + this.dataForm.gridId = '' + return + } this.dataForm.communityId = '' this.dataForm.gridId = '' this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { @@ -436,6 +442,11 @@ export default { }).catch(() => {}) }, getGridList () { + if (this.dataForm.communityId === '') { + this.gridOptions = [] + this.dataForm.gridId = '' + return + } this.dataForm.gridId = '' this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { if (res.code !== 0) {