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) {