Browse Source

111

shibei_master
jiangyy 3 years ago
parent
commit
8d0ade1e54
  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> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost, requestGet } from '@/js/dai/request'
let loading // let loading //
export default { export default {
@ -165,29 +166,28 @@ export default {
}, },
methods: { methods: {
async initForm (type, row) { async initForm (type, houseId, agencyObj) {
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
this.agencyObj = row this.agencyObj = agencyObj
this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId
this.dataForm.buildingId = this.agencyObj.buildingId
this.formType = type this.formType = type
if (row) { if (houseId) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.houseId = this.dataForm.houseId this.houseId = houseId
await this.loadHouseInfo()
this.dataForm.buildingUnitId = this.dataForm.unitNumKey // this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm = { ... this.dataForm } // this.houseId = this.dataForm.houseId
this.houseType = this.dataForm.houseTypeKey
this.purpose = this.dataForm.purposeKey // this.dataForm.buildingUnitId = this.dataForm.unitNumKey
this.rentFlag = parseInt(this.dataForm.rentFlagKey) // this.dataForm = { ... this.dataForm }
// if (this.dataForm.rentFlagKey==='2') { // this.houseType = this.dataForm.houseTypeKey
// this.rentFlag = parseInt(this.dataForm.rentFlagKey) // this.purpose = this.dataForm.purposeKey
// } else { // this.rentFlag = parseInt(this.dataForm.rentFlagKey)
// this.rentFlag = 0
// } } 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 () { async loadUnitList () {
const url = '/gov/org/building/buildingunitlist' const url = '/gov/org/building/buildingunitlist'
let params = { let params = {
buildingId: this.agencyObj.buildingId buildingId: this.dataForm.buildingId
} }
const { data, code, msg } = await requestPost(url, params) 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.total = data.total
this.validTableDataNum = 0 this.validTableDataNum = 0
data.list.forEach(item => { data.list.forEach(item => {
item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + '单元' + item.doorName item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + item.doorName
item.unitNumShow = item.unitNum + '单元'
if (item.agencyId === this.staffAgencyId) { if (item.agencyId === this.staffAgencyId) {
item.showBtn = true item.showBtn = true
this.validTableDataNum++ this.validTableDataNum++
@ -298,7 +298,8 @@ export default {
this.formTitle = '房屋详情' this.formTitle = '房屋详情'
this.formShow = true this.formShow = true
this.$nextTick(() => { 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.formTitle = '新增房屋'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.agencyObj)
this.$refs.ref_form.initForm('add', null, this.agencyObj) this.$refs.ref_form.initForm('add', null, this.agencyObj)
}) })
}, },
@ -315,7 +317,7 @@ export default {
this.formTitle = '修改房屋' this.formTitle = '修改房屋'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row, this.agencyObj) this.$refs.ref_form.initForm('edit', row.houseId, this.agencyObj)
}) })
}, },

Loading…
Cancel
Save