Browse Source

Merge branch 'master' into shibei_master

shibei_master
dai 3 years ago
parent
commit
26024d5a8d
  1. 61
      src/views/modules/base/community/roomForm.vue
  2. 11
      src/views/modules/base/community/roomTable.vue
  3. 2
      src/views/pages/login.vue

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

@ -11,7 +11,7 @@
<el-form-item label="所属楼栋"
label-width="150px"
style="display: block">
<span>{{ agencyObj.neighborHoodName }}{{agencyObj.buildingName}}</span>
<span>{{ agencyObj.neighborHoodName }}{{agencyObj.label}}</span>
</el-form-item>
<el-form-item label="单元号"
@ -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, 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.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.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 () {
const url = '/gov/org/building/buildingunitlist'
let params = {
buildingId: this.agencyObj.buildingId
buildingId: this.dataForm.buildingId
}
const { data, code, msg } = await requestPost(url, params)

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

@ -2,7 +2,8 @@
<div>
<div class="div_btn">
<el-button style="float:left"
<el-button v-if="agencyObj.level==='building'||source!=='search'"
style="float:left"
class="diy-button--add"
size="small"
@click="handleAdd">新增房屋</el-button>
@ -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)
})
},

2
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();

Loading…
Cancel
Save