Browse Source

综合治理图层查询增加所属组织

shibei_master
jiangyy 3 years ago
parent
commit
b9e4c29a57
  1. 149
      src/views/modules/shequzhili/tuceng/zhonghe/base.vue

149
src/views/modules/shequzhili/tuceng/zhonghe/base.vue

@ -9,7 +9,19 @@
class="demo-form-inline"
>
<div>
<el-form-item prop="gridId" label="所属网格">
<el-form-item prop="gridId" label="所属组织">
<div class="resi-cell-value">
<el-cascader class="customer_cascader"
ref="myCascader"
clearable
v-model="agencyIdArray"
:options="orgOptions"
:props="orgOptionProps"
:show-all-levels="false"
@change="handleChangeAgency"></el-cascader>
</div>
</el-form-item>
<!-- <el-form-item prop="gridId" label="所属网格">
<div class="resi-cell-value">
<el-select
v-model.trim="fmData.gridId"
@ -28,7 +40,8 @@
</el-option>
</el-select>
</div>
</el-form-item>
</el-form-item> -->
<el-form-item label="所属房屋">
<div class="resi-cell-value">
<div class="resi-cell-col">
@ -331,6 +344,15 @@ export default {
optionsH: [],
optionsD: [],
optionsG: [],
orgOptions: [],
orgOptionProps:{
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
agencyIdArray:[],
optionsWelfare: [
{
@ -344,6 +366,7 @@ export default {
],
fmData: {
agencyId:"",
gridId: "",
villageId: "",
buildId: "",
@ -410,6 +433,7 @@ export default {
},
},
mounted() {
this.getOrgTreeList();
this.getGridList();
this.getValiheList();
this.getTableData();
@ -465,6 +489,24 @@ export default {
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
@ -489,7 +531,7 @@ export default {
this.$http
.post("/gov/org/icneighborhood/neighborhoodoption", {
gridId: this.fmData.gridId,
agencyId: "",
agencyId: this.fmData.agencyId,
// agencyId: user.agencyId
})
.then(({ data: res }) => {
@ -579,62 +621,125 @@ export default {
this.handleSearch();
},
handleChangeAgency(val) {
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data
if (obj) {
if(obj.level === 'grid'){
this.fmData.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.fmData.agencyId=''
}else{
this.fmData.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.fmData.gridId = ''
}
}else{
this.fmData.agencyId=''
this.fmData.gridId = ''
}
this.fmData.villageId = ''
this.fmData.buildId = ''
this.fmData.unitId = ''
this.fmData.homeId = ''
this.getValiheList()
},
computeQueryParams() {
const { pageSize, pageNo, elseParams, fmData } = this;
let conditions=[]
if(fmData.agencyId){
conditions.push({
queryType: "like",
tableName: "ic_resi_user",
columnName: "AGENCY_ID",
columnValue: [fmData.agencyId],
},)
}
return {
formCode: "resi_base_info",
pageSize,
pageNo,
conditions: [
if(fmData.gridId){
conditions.push(
{
queryType: "equal",
tableName: "ic_resi_user",
columnName: "GRID_ID",
columnValue: [fmData.gridId],
},
}
)
}
if(fmData.villageId){
conditions.push(
{
queryType: "equal",
tableName: "ic_resi_user",
columnName: "VILLAGE_ID",
columnValue: [fmData.villageId],
},
{
}
)
}
if(fmData.buildId){
conditions.push({
queryType: "equal",
tableName: "ic_resi_user",
columnName: "BUILD_ID",
columnValue: [fmData.buildId],
},
{
})
}
if(fmData.unitId){
conditions.push({
queryType: "equal",
tableName: "ic_resi_user",
columnName: "UNIT_ID",
columnValue: [fmData.unitId],
},
{
})
}
if(fmData.homeId){
conditions.push({
queryType: "equal",
tableName: "ic_resi_user",
columnName: "HOME_ID",
columnValue: [fmData.homeId],
},
{
})
}
if(fmData.name){
conditions.push({
queryType: "like",
tableName: "ic_resi_user",
columnName: "NAME",
columnValue: [fmData.name],
},
{
})
}
if(fmData.mobile){
conditions.push({
queryType: "like",
tableName: "ic_resi_user",
columnName: "MOBILE",
columnValue: [fmData.mobile],
},
{
})
}
if(fmData.idCard){
conditions.push({
queryType: "like",
tableName: "ic_resi_user",
columnName: "ID_CARD",
columnValue: [fmData.idCard],
},
})
}
return {
formCode: "resi_base_info",
pageSize,
pageNo,
conditions: [
...conditions,
...elseParams,
],
};

Loading…
Cancel
Save