Browse Source

fix:居民信息组织多选

chanpin_shequ_jiagou
wxz 2 years ago
parent
commit
d4f16929ff
  1. 47
      src/views/components/resiSearch.vue

47
src/views/components/resiSearch.vue

@ -242,6 +242,7 @@
<script>
import inputRange from './rangeInput.vue'
import Ar from 'element-ui/src/locale/lang/ar'
export default {
name: 'ResiSearch',
components: {
@ -332,7 +333,9 @@ export default {
fixedList: [],
fixedForm: {
AGENCY_ID: '',
AGENCY_IDS: [],
GRID_ID: '',
GRID_IDS: [],
VILLAGE_ID: '',
BUILD_ID: '',
UNIT_ID: '',
@ -519,11 +522,27 @@ export default {
}
},
handleChangeAgency(val) {
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data
if (obj) {
// let checkedNodes = this.$refs["myCascader"].getCheckedNodes()[0].data
this.$nextTick(()=> {
let checkedNodes = this.$refs["myCascader"].getCheckedNodes();
if (checkedNodes) {
//
this.form.GRID_IDS.push(obj.agencyId);
this.form.AGENCY_IDS.push( obj.pid);
// this.form.GRID_IDS.push(obj.agencyId);
// this.form.AGENCY_IDS.push( obj.pid);
//
this.form.GRID_IDS = [];
this.form.AGENCY_IDS = [];
for (let i in checkedNodes) {
let nodeData = checkedNodes[i].data;
if (nodeData.level == 'grid') {
this.form.GRID_IDS.push(nodeData.agencyId);
} else {
this.form.AGENCY_IDS.push(nodeData.agencyId);
}
}
} else {
this.form.AGENCY_IDS = []
this.form.GRID_IDS = []
@ -534,6 +553,7 @@ export default {
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.getValiheList()
})
},
handleChangeGrid(val) {
this.form.VILLAGE_ID = ''
@ -570,15 +590,32 @@ export default {
this.fixedList.forEach((item, index) => {
if (item.columnName == val) {
hasVal = true
let valueInForm = this.form[val]
if (valueInForm instanceof Array) {
//
item.columnValue = valueInForm
} else {
//
item.columnValue[0] = this.form[val]
}
if (!this.form[val]) this.fixedList.splice(index, 1)
console.log('fixedList----val', this.fixedList)
} else {
let columnValue = undefined;
let valueInForm = this.form[val]
if (valueInForm instanceof Array) {
//
columnValue = valueInForm
} else {
//
columnValue = [valueInForm]
}
_item = {
queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal',
tableName: 'ic_resi_user',
columnName: val,
columnValue: [this.form[val]]
columnValue: columnValue
}
console.log('fixedList----else', _item)
// this.$set(this.fixedList, index, _item)

Loading…
Cancel
Save