+
+
+
+
@@ -19,14 +27,6 @@
clearable
>
-
-
-
-
{{ $t("query") }}
@@ -175,13 +175,24 @@ export default {
getloudongOptions(){
this.$http.post(`/opendata/caLoudong/getLouDongCascade`).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 8de489c5..07683ccc 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") }}
@@ -169,13 +169,24 @@ export default {
getloudongOptions(){
this.$http.post(`/opendata/caLoudong/getLouDongCascade`).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]