diff --git a/src/views/modules/cabaseinfo/caloudong.vue b/src/views/modules/cabaseinfo/caloudong.vue index e363467af..5d4f74ad1 100644 --- a/src/views/modules/cabaseinfo/caloudong.vue +++ b/src/views/modules/cabaseinfo/caloudong.vue @@ -2,6 +2,14 @@
+ + + + - - - - {{ $t("query") }} @@ -181,15 +181,26 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/capingfang.vue b/src/views/modules/cabaseinfo/capingfang.vue index b0d8df759..4226a1aa6 100644 --- a/src/views/modules/cabaseinfo/capingfang.vue +++ b/src/views/modules/cabaseinfo/capingfang.vue @@ -2,6 +2,14 @@
+ + + + - - - - {{ $t("query") }} @@ -181,15 +181,26 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/carental.vue b/src/views/modules/cabaseinfo/carental.vue index bb79ac5a8..47a0c4236 100644 --- a/src/views/modules/cabaseinfo/carental.vue +++ b/src/views/modules/cabaseinfo/carental.vue @@ -2,6 +2,14 @@
+ + + + - - - - {{ $t("query") }} @@ -182,15 +182,26 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/caresident.vue b/src/views/modules/cabaseinfo/caresident.vue index c1a5d8816..2b08a8e3b 100644 --- a/src/views/modules/cabaseinfo/caresident.vue +++ b/src/views/modules/cabaseinfo/caresident.vue @@ -2,6 +2,14 @@
+ + + + @@ -19,14 +27,6 @@ clearable > - - - - {{ $t("query") }} @@ -173,15 +173,26 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/carotators.vue b/src/views/modules/cabaseinfo/carotators.vue index 8de489c5b..330a848af 100644 --- a/src/views/modules/cabaseinfo/carotators.vue +++ b/src/views/modules/cabaseinfo/carotators.vue @@ -2,6 +2,14 @@
+ + + + @@ -18,14 +26,6 @@ placeholder="联系方式" clearable > - - - - {{ $t("query") }} @@ -167,15 +167,26 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1]