Browse Source

居民搜索增加参数level

V1.0
mk 3 years ago
parent
commit
46967a61b3
  1. 23
      src/views/components/resiSearch.vue
  2. 4
      src/views/modules/base/resi.vue

23
src/views/components/resiSearch.vue

@ -320,6 +320,8 @@ export default {
queryType: { queryType: {
'agencyId ': 'like' 'agencyId ': 'like'
}, },
sarr:[],
level:'',
showSmartSearchForm: false, showSmartSearchForm: false,
formType: 'add', formType: 'add',
@ -654,8 +656,29 @@ export default {
// this.form.unitId = '' // this.form.unitId = ''
// this.form.homeId = '' // 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() 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) { handleChangeGrid(val) {
console.log('val', val) console.log('val', val)
this.form.villageId = '' this.form.villageId = ''

4
src/views/modules/base/resi.vue

@ -787,6 +787,7 @@ export default {
let obj = this.$refs.myResiSearch.form; let obj = this.$refs.myResiSearch.form;
let categoryArr = this.$refs.myResiSearch.form.categoryKey; let categoryArr = this.$refs.myResiSearch.form.categoryKey;
let agencyId = this.$refs.myResiSearch.form.agencyId; let agencyId = this.$refs.myResiSearch.form.agencyId;
if ( if (
typeof obj.categoryKey == "object" && typeof obj.categoryKey == "object" &&
obj.categoryKey.length != 0 obj.categoryKey.length != 0
@ -801,6 +802,7 @@ export default {
} else { } else {
obj.agencyId = ""; obj.agencyId = "";
} }
obj.level = this.$refs.myResiSearch.level ? this.$refs.myResiSearch.level :''
this.currentPage = 1; this.currentPage = 1;
this.getTableData(obj); this.getTableData(obj);
@ -1026,7 +1028,9 @@ export default {
resetSearchForm() { resetSearchForm() {
for (const n in this.$refs.myResiSearch.form) { for (const n in this.$refs.myResiSearch.form) {
this.$refs.myResiSearch.form[n] = ""; this.$refs.myResiSearch.form[n] = "";
} }
this.$refs.myResiSearch.level = ''
this.getTableData(); this.getTableData();
}, },
async handleExportModule() { async handleExportModule() {

Loading…
Cancel
Save