Browse Source

Merge branch 'master' into shibei_master

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

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

@ -11,7 +11,7 @@
<el-form-item label="所属楼栋" <el-form-item label="所属楼栋"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<span>{{ agencyObj.neighborHoodName }}{{agencyObj.buildingName}}</span> <span>{{ agencyObj.neighborHoodName }}{{agencyObj.label}}</span>
</el-form-item> </el-form-item>
<el-form-item label="单元号" <el-form-item label="单元号"
@ -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, row, 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 (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 () { 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)

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

@ -2,7 +2,8 @@
<div> <div>
<div class="div_btn"> <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" class="diy-button--add"
size="small" size="small"
@click="handleAdd">新增房屋</el-button> @click="handleAdd">新增房屋</el-button>
@ -162,6 +163,7 @@ let loading // 加载动画
export default { export default {
data () { data () {
return { return {
source: 'tree',//
importRoomLoading: false, importRoomLoading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 20,
@ -236,6 +238,7 @@ export default {
async loadTable (source, treeObj, ownerName, ownerPhone, rentFlag) { async loadTable (source, treeObj, ownerName, ownerPhone, rentFlag) {
this.source = source
this.tableLoading = true this.tableLoading = true
if (source === 'tree') {//tree if (source === 'tree') {//tree
@ -272,8 +275,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,6 +301,7 @@ 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, this.agencyObj)
}) })
}, },
@ -307,6 +311,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)
}) })
}, },

2
src/views/pages/login.vue

@ -213,7 +213,7 @@ export default {
// //
this.$message.error("账号不存在"); this.$message.error("账号不存在");
this.endLoading(); this.endLoading();
} else if (data.length === 10) { } else if (data.length === 1) {
this.selectCustomer(data[0]); this.selectCustomer(data[0]);
} else { } else {
this.endLoading(); this.endLoading();

Loading…
Cancel
Save