Browse Source

fix:居民信息组织多选

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

69
src/views/components/resiSearch.vue

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

Loading…
Cancel
Save