|
|
@ -1,28 +1,30 @@ |
|
|
|
<template> |
|
|
|
<div class="mod-axis__caResident}"> |
|
|
|
<el-card> |
|
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|
|
|
<el-form :inline="true" :model="searchForm" @keyup.enter.native="getDataList()"> |
|
|
|
<el-form-item label="所属网格" prop="gridId"> |
|
|
|
<el-cascader |
|
|
|
:options="caLouDongOptions" |
|
|
|
:props="{ checkStrictly: true }" |
|
|
|
clearable |
|
|
|
@change="handlePartyChange"> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-select v-model="searchForm.gridId" filterable placeholder="请选择" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsG" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份证号" prop="idCard"> |
|
|
|
<el-input v-model="dataForm.idCard" placeholder="身份证号" clearable></el-input> |
|
|
|
<el-input v-model="searchForm.idCard" placeholder="身份证号" clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="姓名" prop="residentName"> |
|
|
|
<el-input |
|
|
|
v-model="dataForm.residentName" |
|
|
|
v-model="searchForm.residentName" |
|
|
|
placeholder="姓名" |
|
|
|
clearable |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="联系方式" prop="telephone"> |
|
|
|
<el-input |
|
|
|
v-model="dataForm.telephone" |
|
|
|
v-model="searchForm.telephone" |
|
|
|
placeholder="联系方式" |
|
|
|
clearable |
|
|
|
></el-input> |
|
|
@ -182,13 +184,14 @@ export default { |
|
|
|
deleteURL: "", |
|
|
|
deleteIsBatch: true, |
|
|
|
}, |
|
|
|
dataForm: { |
|
|
|
searchForm: { |
|
|
|
idCard: "", |
|
|
|
residentName: "", |
|
|
|
telephone: "", |
|
|
|
gridId:"" |
|
|
|
}, |
|
|
|
caLouDongOptions:[] |
|
|
|
caLouDongOptions:[], |
|
|
|
optionsG:[] |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods:{ |
|
|
@ -199,34 +202,56 @@ export default { |
|
|
|
closeBindHouse(){ |
|
|
|
this.bndingHouseVisible = false |
|
|
|
}, |
|
|
|
getloudongOptions(){ |
|
|
|
this.$http.post(`/opendata/bmGrid/getCascadeMenu`).then(resp => { |
|
|
|
if(resp.data.code === 0){ |
|
|
|
this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
removeEmptySubOrgList (orgArray) { |
|
|
|
orgArray.forEach((orgInfo) => { |
|
|
|
if (orgInfo && orgInfo.children) { |
|
|
|
if (orgInfo.children.length === 0) { |
|
|
|
orgInfo.children = undefined |
|
|
|
} else { |
|
|
|
this.removeEmptySubOrgList(orgInfo.children) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return orgArray; |
|
|
|
}, |
|
|
|
// getloudongOptions(){ |
|
|
|
// this.$http.post(`/opendata/bmGrid/getCascadeMenu`).then(resp => { |
|
|
|
// if(resp.data.code === 0){ |
|
|
|
// this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// this.$message.error(error) |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// removeEmptySubOrgList (orgArray) { |
|
|
|
// orgArray.forEach((orgInfo) => { |
|
|
|
// if (orgInfo && orgInfo.children) { |
|
|
|
// if (orgInfo.children.length === 0) { |
|
|
|
// orgInfo.children = undefined |
|
|
|
// } else { |
|
|
|
// this.removeEmptySubOrgList(orgInfo.children) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// return orgArray; |
|
|
|
// }, |
|
|
|
|
|
|
|
handlePartyChange(val) { |
|
|
|
console.log('val------pp', val) |
|
|
|
this.dataForm.gridId = val[val.length - 1] |
|
|
|
this.searchForm.gridId = val[val.length - 1] |
|
|
|
}, |
|
|
|
async getGridList(type, agencyId) { |
|
|
|
const { user } = await this.$store.state |
|
|
|
console.log('user---ppp', user) |
|
|
|
// addorupdate query |
|
|
|
await this.$http |
|
|
|
.post('/gov/org/customergrid/gridoption', { agencyId: agencyId || user.agencyId, purpose: type }) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsG = res.data |
|
|
|
if (type === 'query') this.optionsG = res.data |
|
|
|
else this.optionsEditG = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
this.getloudongOptions() |
|
|
|
// this.getloudongOptions() |
|
|
|
this.getGridList() |
|
|
|
}, |
|
|
|
components: { |
|
|
|
AddOrUpdate, |
|
|
|