Browse Source

Merge branch 'dev-220411'

shibei_master
jiangyy 3 years ago
parent
commit
447f195d8e
  1. 63
      src/views/modules/base/community/roomForm.vue
  2. 10
      src/views/modules/base/community/roomTable.vue

63
src/views/modules/base/community/roomForm.vue

@ -127,7 +127,8 @@
<script>
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, houseId, 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
// }
if (houseId) {
this.houseId = 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)

10
src/views/modules/base/community/roomTable.vue

@ -272,8 +272,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,7 +298,8 @@ export default {
this.formTitle = '房屋详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row, this.agencyObj)
this.$refs.ref_form.initForm('detail', row.houseId, this.agencyObj)
})
},
@ -307,6 +308,7 @@ export default {
this.formTitle = '新增房屋'
this.formShow = true
this.$nextTick(() => {
console.log(this.agencyObj)
this.$refs.ref_form.initForm('add', null, this.agencyObj)
})
},
@ -315,7 +317,7 @@ export default {
this.formTitle = '修改房屋'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row, this.agencyObj)
this.$refs.ref_form.initForm('edit', row.houseId, this.agencyObj)
})
},

Loading…
Cancel
Save