diff --git a/src/views/modules/base/community/roomForm.vue b/src/views/modules/base/community/roomForm.vue index be192eee1..37316861c 100644 --- a/src/views/modules/base/community/roomForm.vue +++ b/src/views/modules/base/community/roomForm.vue @@ -11,7 +11,7 @@ - {{ agencyObj.neighborHoodName }}{{agencyObj.buildingName}} + {{ agencyObj.neighborHoodName }}{{agencyObj.label}} import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 -import { requestPost } from '@/js/dai/request' +import { requestPost, requestGet } from '@/js/dai/request' + let loading // 加载动画 export default { @@ -165,29 +166,28 @@ export default { }, methods: { - async initForm (type, row) { + async initForm (type, row, agencyObj) { this.$refs.ref_form.resetFields(); - this.agencyObj = row - this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId - this.dataForm.buildingId = this.agencyObj.buildingId - + this.agencyObj = agencyObj this.formType = type if (row) { - this.dataForm = JSON.parse(JSON.stringify(row)) - this.houseId = this.dataForm.houseId - - this.dataForm.buildingUnitId = this.dataForm.unitNumKey - this.dataForm = { ... this.dataForm } - this.houseType = this.dataForm.houseTypeKey - this.purpose = this.dataForm.purposeKey - this.rentFlag = parseInt(this.dataForm.rentFlagKey) - // if (this.dataForm.rentFlagKey==='2') { - // this.rentFlag = parseInt(this.dataForm.rentFlagKey) - // } else { - // this.rentFlag = 0 - // } + this.houseId = row.houseId + await this.loadHouseInfo() + // this.dataForm = JSON.parse(JSON.stringify(row)) + // this.houseId = this.dataForm.houseId + + // this.dataForm.buildingUnitId = this.dataForm.unitNumKey + // this.dataForm = { ... this.dataForm } + // this.houseType = this.dataForm.houseTypeKey + // this.purpose = this.dataForm.purposeKey + // this.rentFlag = parseInt(this.dataForm.rentFlagKey) + + } else { + + this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId + this.dataForm.buildingId = this.agencyObj.id } @@ -195,12 +195,33 @@ export default { }, + async loadHouseInfo () { + + const url = "/gov/org/ichouse/" + this.houseId + + const { data, code, msg } = await requestGet(url) + + if (code === 0) { + // debugger + this.dataForm = { ...data } + + this.houseType = this.dataForm.houseType + this.purpose = this.dataForm.purpose + this.rentFlag = parseInt(this.dataForm.rentFlag) + + + } else { + this.$message.error(msg) + } + + }, + //加载单元 async loadUnitList () { const url = '/gov/org/building/buildingunitlist' let params = { - buildingId: this.agencyObj.buildingId + buildingId: this.dataForm.buildingId } const { data, code, msg } = await requestPost(url, params) diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index 70066d410..3b771eca2 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -2,7 +2,8 @@
- 新增房屋 @@ -162,6 +163,7 @@ let loading // 加载动画 export default { data () { return { + source: 'tree',//来源 importRoomLoading: false, total: 0, pageSize: 20, @@ -236,6 +238,7 @@ export default { async loadTable (source, treeObj, ownerName, ownerPhone, rentFlag) { + this.source = source this.tableLoading = true if (source === 'tree') {//来源于tree,查询数据清空 @@ -272,8 +275,8 @@ export default { this.total = data.total this.validTableDataNum = 0 data.list.forEach(item => { - item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + '单元' + item.doorName - item.unitNumShow = item.unitNum + '单元' + item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + item.doorName + if (item.agencyId === this.staffAgencyId) { item.showBtn = true this.validTableDataNum++ @@ -298,6 +301,7 @@ export default { this.formTitle = '房屋详情' this.formShow = true this.$nextTick(() => { + this.$refs.ref_form.initForm('detail', row, this.agencyObj) }) }, @@ -307,6 +311,7 @@ export default { this.formTitle = '新增房屋' this.formShow = true this.$nextTick(() => { + console.log(this.agencyObj) this.$refs.ref_form.initForm('add', null, this.agencyObj) }) }, diff --git a/src/views/pages/login.vue b/src/views/pages/login.vue index 099b694e7..6db09b136 100644 --- a/src/views/pages/login.vue +++ b/src/views/pages/login.vue @@ -213,7 +213,7 @@ export default { //没有客户,提示无法登录 this.$message.error("账号不存在"); this.endLoading(); - } else if (data.length === 10) { + } else if (data.length === 1) { this.selectCustomer(data[0]); } else { this.endLoading();