|
|
|
@ -13,7 +13,7 @@ |
|
|
|
:props="orgOptionProps" |
|
|
|
:show-all-levels="false" |
|
|
|
@change="handleChangeAgency" |
|
|
|
clearable :disabled="disabled"></el-cascader> |
|
|
|
clearable ></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="villageId"> |
|
|
|
<div class="resi-cell"> |
|
|
|
@ -43,7 +43,7 @@ |
|
|
|
clearable |
|
|
|
style="margin-left: 5px" |
|
|
|
class="u-item-width-buildcascader" |
|
|
|
:disabled="changeVDisabled" |
|
|
|
:disabled=" disabled" |
|
|
|
@clear="handleClearBuild" |
|
|
|
@change="handleChangeB"> |
|
|
|
<el-option v-for="item in optionsB" |
|
|
|
@ -53,7 +53,7 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-model.trim="form.unitId" |
|
|
|
:disabled="changeBDisabled" |
|
|
|
:disabled="disabled" |
|
|
|
placeholder="单元" |
|
|
|
size="small" |
|
|
|
filterable |
|
|
|
@ -69,7 +69,7 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-model.trim="form.homeId" |
|
|
|
:disabled="changeDDisabled" |
|
|
|
:disabled="disabled" |
|
|
|
placeholder="房号" |
|
|
|
size="small" |
|
|
|
filterable |
|
|
|
@ -949,15 +949,35 @@ export default { |
|
|
|
if (this.columnName) this.handleChangeForm(this.columnName) |
|
|
|
}, |
|
|
|
mounted(){ |
|
|
|
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$nextTick( async ()=>{ |
|
|
|
if(this.infoObj){ |
|
|
|
this.form = this.infoObj; |
|
|
|
if(this.infoObj.agencyId){ |
|
|
|
await this.getOrgTreeList() |
|
|
|
this.cascaderAgencyId =this.findParentIds(this.orgOptions, this.infoObj.agencyId); |
|
|
|
await this.getValiheList() |
|
|
|
await this.getBuildList() |
|
|
|
await this.getUniList() |
|
|
|
await this.getHouseList() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
findParentIds(tree, targetId, parentIds = []) { |
|
|
|
for (let node of tree) { |
|
|
|
if (node.agencyId === targetId) { |
|
|
|
return parentIds; |
|
|
|
} |
|
|
|
if (node.subAgencyList) { |
|
|
|
const result = this.findParentIds(node.subAgencyList, targetId, [...parentIds, node.agencyId]); |
|
|
|
if (result) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
}, |
|
|
|
handleCategoryChange(newVal, oldVal) { |
|
|
|
console.log(newVal, oldVal,"slkdfjlfj"); |
|
|
|
let formCopy = JSON.parse(JSON.stringify(this.form)); |
|
|
|
@ -1162,91 +1182,79 @@ export default { |
|
|
|
if (item.columnName === val) item.isChange = true |
|
|
|
}) |
|
|
|
}, |
|
|
|
getOrgTreeList() { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customeragency/agencygridtree', {}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.orgOptions = [] |
|
|
|
this.orgOptions.push(res.data) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
async getOrgTreeList() { |
|
|
|
try { |
|
|
|
const { data: res } = await this.$http.post('/gov/org/customeragency/agencygridtree', {}); |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} |
|
|
|
this.orgOptions = []; |
|
|
|
this.orgOptions.push(res.data); |
|
|
|
} catch (error) { |
|
|
|
return this.$message.error('网络错误'); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
loadmore() { |
|
|
|
this.optionsVPageNo++; |
|
|
|
this.getValiheList(); |
|
|
|
}, |
|
|
|
getValiheList() { |
|
|
|
this.$http |
|
|
|
.post('/actual/base/communityQuarters/listQuartersOptions', { |
|
|
|
async getValiheList() { |
|
|
|
try { |
|
|
|
const { data: res } = await this.$http.post('/actual/base/communityQuarters/listQuartersOptions', { |
|
|
|
gridId: this.form.agencyId, |
|
|
|
agencyId: this.$store.state.user.agencyId, |
|
|
|
pageNo: this.optionsVPageNo, |
|
|
|
pageSize: 20 |
|
|
|
// agencyId: user.agencyId |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.optionsV = [...this.optionsV, ...res.data]; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}); |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} |
|
|
|
this.optionsV = [...this.optionsV, ...res.data]; |
|
|
|
} catch (error) { |
|
|
|
return this.$message.error('网络错误'); |
|
|
|
} |
|
|
|
}, |
|
|
|
getBuildList() { |
|
|
|
this.$http |
|
|
|
.post('/actual/base/communityBuilding/buildingoption', { |
|
|
|
async getBuildList() { |
|
|
|
try { |
|
|
|
const { data: res } = await this.$http.post('/actual/base/communityBuilding/buildingoption', { |
|
|
|
quartersId: this.form.villageId |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.optionsB = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}); |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} |
|
|
|
this.optionsB = res.data; |
|
|
|
} catch (error) { |
|
|
|
return this.$message.error('网络错误'); |
|
|
|
} |
|
|
|
}, |
|
|
|
getUniList() { |
|
|
|
this.$http |
|
|
|
.post('/actual/base/communityBuildingUnit/unitoption', { |
|
|
|
async getUniList() { |
|
|
|
try { |
|
|
|
const { data: res } = await this.$http.post('/actual/base/communityBuildingUnit/unitoption', { |
|
|
|
buildingId: this.form.buildId |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.optionsD = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}); |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} |
|
|
|
this.optionsD = res.data; |
|
|
|
} catch (error) { |
|
|
|
return this.$message.error('网络错误'); |
|
|
|
} |
|
|
|
}, |
|
|
|
getHouseList() { |
|
|
|
this.$http |
|
|
|
.post('/actual/base/communityHouse/houseoption', { buildingId: this.form.buildId, unitId: this.form.unitId }) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.optionsH = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
async getHouseList() { |
|
|
|
try { |
|
|
|
const { data: res } = await this.$http.post('/actual/base/communityHouse/houseoption', { |
|
|
|
buildingId: this.form.buildId, |
|
|
|
unitId: this.form.unitId |
|
|
|
}); |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} |
|
|
|
this.optionsH = res.data; |
|
|
|
} catch (error) { |
|
|
|
return this.$message.error('网络错误'); |
|
|
|
} |
|
|
|
}, |
|
|
|
getTreeData(data) { |
|
|
|
if (!Array.isArray(data)) return []; |
|
|
|
|