diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 0730cef55..6a47ad1bf 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -320,6 +320,8 @@ export default { queryType: { 'agencyId ': 'like' }, + sarr:[], + level:'', showSmartSearchForm: false, formType: 'add', @@ -653,9 +655,30 @@ export default { // this.form.buildId = '' // this.form.unitId = '' // this.form.homeId = '' - + + this.sarr = [] + const map = new Map(); + this.getLastItem( + this.orgOptions, + val, + "agencyId" + ); + this.level = this.sarr[this.sarr.length-1].level this.getValiheList() }, + getLastItem(list, vals, key) { + let LIST = list || []; + for (let item of LIST) { + // console.log(item[key]); + for (let i of vals) { + if (item[key] === i) { + this.sarr.push(item); + } else { + this.getLastItem(item.subAgencyList, vals, key); + } + } + } + }, handleChangeGrid(val) { console.log('val', val) this.form.villageId = '' diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 4ca8073af..6f4b06a65 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -787,6 +787,7 @@ export default { let obj = this.$refs.myResiSearch.form; let categoryArr = this.$refs.myResiSearch.form.categoryKey; let agencyId = this.$refs.myResiSearch.form.agencyId; + if ( typeof obj.categoryKey == "object" && obj.categoryKey.length != 0 @@ -801,6 +802,7 @@ export default { } else { obj.agencyId = ""; } + obj.level = this.$refs.myResiSearch.level ? this.$refs.myResiSearch.level :'' this.currentPage = 1; this.getTableData(obj); @@ -1026,7 +1028,9 @@ export default { resetSearchForm() { for (const n in this.$refs.myResiSearch.form) { this.$refs.myResiSearch.form[n] = ""; + } + this.$refs.myResiSearch.level = '' this.getTableData(); }, async handleExportModule() {