|
|
@ -9,7 +9,14 @@ |
|
|
|
<div> |
|
|
|
<el-form-item label="所属网格" |
|
|
|
prop="gridId"> |
|
|
|
<el-select v-model.trim="searchForm.gridId" |
|
|
|
<el-cascader class="customer_cascader" |
|
|
|
ref="myCascader" |
|
|
|
v-model="agencyIdArray" |
|
|
|
:options="orgOptions" |
|
|
|
:props="orgOptionProps" |
|
|
|
:show-all-levels="false" |
|
|
|
@change="handleChangeAgency"></el-cascader> |
|
|
|
<!-- <el-select v-model.trim="searchForm.gridId" |
|
|
|
placeholder="请选择" |
|
|
|
size="small" |
|
|
|
clearable |
|
|
@ -20,7 +27,7 @@ |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> --> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属小区" |
|
|
@ -480,6 +487,13 @@ import { mapGetters } from 'vuex' |
|
|
|
let loading // 加载动画 |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
let orgOptionProps = { |
|
|
|
multiple: false, |
|
|
|
value: 'agencyId', |
|
|
|
label: 'agencyName', |
|
|
|
children: 'subAgencyList', |
|
|
|
checkStrictly: true |
|
|
|
} |
|
|
|
return { |
|
|
|
loading: false, |
|
|
|
total: 0, |
|
|
@ -490,6 +504,10 @@ export default { |
|
|
|
agencyId: '', |
|
|
|
sHeight: 0, |
|
|
|
timeRange: [], |
|
|
|
agencyIdArray: [], |
|
|
|
orgOptions: [], |
|
|
|
orgOptionProps, |
|
|
|
|
|
|
|
searchForm: { |
|
|
|
agencyId: '', |
|
|
|
gridId: '', |
|
|
@ -552,10 +570,8 @@ export default { |
|
|
|
async mounted () { |
|
|
|
this.updateBtnAuths(); |
|
|
|
|
|
|
|
const { user } = this.$store.state |
|
|
|
this.agencyId = user.agencyId |
|
|
|
|
|
|
|
this.getGridList() |
|
|
|
this.getOrgTreeList() |
|
|
|
// this.getGridList() |
|
|
|
this.getValiheList() |
|
|
|
await this.loadTable() |
|
|
|
this.sHeight = this.$refs.div_search.offsetHeight + 270 |
|
|
@ -661,6 +677,30 @@ export default { |
|
|
|
this.searchForm.unitId = '' |
|
|
|
this.searchForm.houseId = '' |
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeAgency (val) { |
|
|
|
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
|
|
if (obj) { |
|
|
|
if (obj.level === 'grid') { |
|
|
|
this.searchForm.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|
|
|
this.searchForm.agencyId = '' |
|
|
|
} else { |
|
|
|
this.searchForm.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|
|
|
this.searchForm.gridId = '' |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.searchForm.agencyId = '' |
|
|
|
this.searchForm.gridId = '' |
|
|
|
} |
|
|
|
|
|
|
|
this.searchForm.neighborId = '' |
|
|
|
this.searchForm.buildingId = '' |
|
|
|
this.searchForm.unitId = '' |
|
|
|
this.searchForm.houseId = '' |
|
|
|
this.getValiheList() |
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeGrid (val) { |
|
|
|
console.log('val', val) |
|
|
|
this.searchForm.neighborId = '' |
|
|
@ -687,6 +727,23 @@ export default { |
|
|
|
this.searchForm.houseId = '' |
|
|
|
this.getHouseList() |
|
|
|
}, |
|
|
|
getOrgTreeList () { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customeragency/agencygridtree', {}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
console.log('获取组织树成功', res.data) |
|
|
|
this.orgOptions = [] |
|
|
|
this.orgOptions.push(res.data) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
getGridList () { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.$http |
|
|
@ -708,7 +765,7 @@ export default { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/icneighborhood/neighborhoodoption', { |
|
|
|
gridId: this.searchForm.gridId, |
|
|
|
agencyId: '' |
|
|
|
agencyId: this.searchForm.agencyId |
|
|
|
// agencyId: user.agencyId |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
@ -904,6 +961,7 @@ export default { |
|
|
|
//重置搜索条件 |
|
|
|
resetSearch () { |
|
|
|
this.timeRange = [] |
|
|
|
this.agencyIdArray = [] |
|
|
|
this.$refs.ref_searchform.resetFields() |
|
|
|
this.searchForm.buildingId = '' |
|
|
|
this.searchForm.unitId = '' |
|
|
|