diff --git a/src/views/modules/epidemic/epidemicreportuserinfo-add-or-update.vue b/src/views/modules/epidemic/epidemicreportuserinfo-add-or-update.vue index 32d7e00..ceb880d 100644 --- a/src/views/modules/epidemic/epidemicreportuserinfo-add-or-update.vue +++ b/src/views/modules/epidemic/epidemicreportuserinfo-add-or-update.vue @@ -33,14 +33,22 @@ - - - + + + + + + @@ -102,9 +110,17 @@ - - - + + + + + + @@ -155,9 +171,17 @@ - - - + + + + + + @@ -223,9 +247,17 @@
- - - + + + + + + @@ -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(() => { }) }, diff --git a/src/views/modules/personroom/epidemicbuildingunit.vue b/src/views/modules/personroom/epidemicbuildingunit.vue index 58679df..59c35ad 100644 --- a/src/views/modules/personroom/epidemicbuildingunit.vue +++ b/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