Browse Source

房屋绑定

master
zhangyuan 3 years ago
parent
commit
832691fc20
  1. 157
      src/views/modules/epidemic/epidemicreportuserinfo-add-or-update.vue
  2. 11
      src/views/modules/personroom/epidemicbuildingunit.vue

157
src/views/modules/epidemic/epidemicreportuserinfo-add-or-update.vue

@ -33,14 +33,22 @@
<el-cascader v-model="dataForm.deptIdList"
ref="deptTree"
:options="deptOptions"
@change="changeDept"
@change="changeDept($event)"
clearable>
</el-cascader>
</el-form-item>
<el-form-item label="楼号" prop="buildingNo" label-width="135px">
<el-input v-model="dataForm.buildingNo" placeholder="楼号"></el-input>
</el-form-item>
<el-form-item label="楼号" prop="buildingId" label-width="135px">
<el-select v-model="dataForm.buildingId" @change="selectUnit($event)" clearable placeholder="请选择">
<el-option
v-for="item in buildingArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="人员姓名" prop="userName" label-width="135px">
<el-input v-model="dataForm.userName" placeholder="人员姓名" maxlength="20" clearable @keyup.native="btKeyUpUserName"></el-input>
@ -102,9 +110,17 @@
<el-input v-model="dataForm.houseProperty" placeholder="房屋性质"></el-input>
</el-form-item>
<el-form-item label="单元" prop="unit" label-width="135px">
<el-input v-model="dataForm.unit" placeholder="单元"></el-input>
</el-form-item>
<el-form-item label="单元" prop="unit" label-width="135px">
<el-select v-model="dataForm.unit" @change="selectRoom($event)" clearable placeholder="请选择">
<el-option
v-for="item in unitArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="曾用名" prop="formerName" label-width="135px">
<el-input v-model="dataForm.formerName" placeholder="曾用名"></el-input>
@ -155,9 +171,17 @@
<el-input v-model="dataForm.houseAddress" placeholder="房屋地址"></el-input>
</el-form-item>
<el-form-item label="房号" prop="roomNo" label-width="135px">
<el-input v-model="dataForm.roomNo" placeholder="房号"></el-input>
</el-form-item>
<el-form-item label="房号" prop="unitId" label-width="135px">
<el-select v-model="dataForm.unitId" @change="changeRoom($event)" clearable placeholder="请选择">
<el-option
v-for="item in roomArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="性别" prop="gender" label-width="135px">
<el-select v-model="dataForm.gender" clearable placeholder="性别">
@ -223,9 +247,17 @@
</div>
<div class="column">
<el-form-item label="小区" prop="plot" label-width="135px">
<el-input v-model="dataForm.plot" placeholder="小区"></el-input>
</el-form-item>
<el-form-item label="小区" prop="plotId" label-width="135px">
<el-select v-model="dataForm.plotId" @change="selectBuilding($event)" placeholder="请选择">
<el-option
v-for="item in plotArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="出生年月" prop="birthday" label-width="135px">
@ -397,7 +429,10 @@ export default {
],
options: [],
deptOptions:[],
buildingArr: [],
plotArr: [],
unitArr: [],
roomArr: [],
liveOptions: [],
educationLevelList: [],
maritalStatusList: [],
@ -464,9 +499,91 @@ export default {
})
.catch(() => { })
},
changeDept(value) {
changeDept(event) {
this.dataForm.deptId = this.dataForm.deptIdList[this.dataForm.deptIdList.length - 1]
this.queryPlot()
},
queryPlot () {
this.$http
.get(`/custom/epidemicplotcoordinate/getPlotOption?gridId=${this.dataForm.deptId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.plotArr = res.data
})
},
selectBuilding (event) {
this.dataForm.buildingId = ''
this.plotArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.plotId = item.dictValue
this.dataForm.plot = item.dictName
this.queryBuilding()
}
})
},
queryBuilding () {
this.$http
.get(`/custom/epidemicplotbuilding/getBuildingOption?plotId=${this.dataForm.plotId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingArr = res.data
})
.catch(() => {})
},
selectUnit (event) {
this.dataForm.unitId = ''
this.buildingArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.buildingId = item.dictValue
this.dataForm.buildingNo = item.dictName
this.queryUnit()
}
})
},
queryUnit () {
this.$http
.get(`/custom/epidemicbuildingunit/getUnitOptions?buildingId=${this.dataForm.buildingId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.unitArr = res.data
})
.catch(() => {})
},
selectRoom (event) {
this.dataForm.roomId = ''
this.unitArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.unit = item.dictValue
this.dataForm.unit = item.dictName
this.queryRoom()
}
})
},
queryRoom () {
this.$http
.get(`/custom/epidemicbuildingunit/getHouseOptions?buildingId=${this.dataForm.buildingId}&unit=${this.dataForm.unit}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.roomArr = res.data
})
.catch(() => {})
},
changeRoom (event) {
this.roomArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.roomNo = item.dictName
this.dataForm.unitId = item.dictValue
}
})
},
init () {
this.visible = true
this.isAble = true
@ -697,6 +814,16 @@ export default {
this.showFlagIn = false
this.showFlagOut = true
}
this.queryPlot()
if (this.dataForm.unitId !== 0 && this.dataForm.unitId !== '') {
this.queryBuilding()
this.queryUnit()
this.queryRoom()
} else if (this.dataForm.unitId === 0) {
this.dataForm.plotId = ''
this.dataForm.buildingId = ''
this.dataForm.unitId = ''
}
}).catch(() => {
})
},

11
src/views/modules/personroom/epidemicbuildingunit.vue

@ -317,9 +317,14 @@ export default {
return this.$message.error(res.msg)
}
}).catch(() => {})
this.$http.post(`/custom/epidemicplotcoordinate/updateMaCode`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}).catch(() => {})
this.$message({
type: 'success',
message: '更新成功'
type: 'warning',
message: '更新中,请稍后'
});
},
updateMaUrl () {
@ -346,7 +351,7 @@ export default {
this.$http(
{ method: 'post',
url: '/custom/epidemicbuildingunit/downloadZip',
data: {gridId: this.gridIdDownload},
data: { gridId: this.gridIdDownload },
responseType: 'blob'}).then(({ data: res }) => {
if (!res) {
this.zLoading = false

Loading…
Cancel
Save