|
@ -1,7 +1,8 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div> |
|
|
<div> |
|
|
<el-form :inline="false" |
|
|
<el-form ref="ref_form" |
|
|
|
|
|
:inline="false" |
|
|
:model="dataForm" |
|
|
:model="dataForm" |
|
|
:rules="dataRule" |
|
|
:rules="dataRule" |
|
|
:disabled="formType === 'detail'" |
|
|
:disabled="formType === 'detail'" |
|
@ -103,7 +104,6 @@ |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block"> |
|
|
<el-input class="item_width_1" |
|
|
<el-input class="item_width_1" |
|
|
type='number' |
|
|
|
|
|
placeholder="请输入房主身份证" |
|
|
placeholder="请输入房主身份证" |
|
|
v-model="dataForm.ownerIdCard"> |
|
|
v-model="dataForm.ownerIdCard"> |
|
|
</el-input> |
|
|
</el-input> |
|
@ -136,7 +136,7 @@ export default { |
|
|
houseId: '', //房屋ID |
|
|
houseId: '', //房屋ID |
|
|
houseType: '1', |
|
|
houseType: '1', |
|
|
purpose: '1', |
|
|
purpose: '1', |
|
|
rentFlag: false, |
|
|
rentFlag: 0, |
|
|
dataForm: { |
|
|
dataForm: { |
|
|
neighborHoodId: '', // 所属小区ID |
|
|
neighborHoodId: '', // 所属小区ID |
|
|
buildingId: '',//所属楼栋ID |
|
|
buildingId: '',//所属楼栋ID |
|
@ -169,20 +169,20 @@ export default { |
|
|
|
|
|
|
|
|
this.formType = type |
|
|
this.formType = type |
|
|
if (row) { |
|
|
if (row) { |
|
|
this.houseId = row.houseId |
|
|
this.dataForm = JSON.parse(JSON.stringify(row)) |
|
|
this.dataForm = row |
|
|
this.houseId = this.dataForm.houseId |
|
|
|
|
|
|
|
|
this.dataForm.buildingUnitId = row.unitNumKey |
|
|
this.dataForm.buildingUnitId = this.dataForm.unitNumKey |
|
|
this.houseType = row.houseTypeKey |
|
|
this.houseType = this.dataForm.houseTypeKey |
|
|
this.purpose = row.purposeKey |
|
|
this.purpose = this.dataForm.purposeKey |
|
|
if (row.rentFlagKey) { |
|
|
if (this.dataForm.rentFlagKey) { |
|
|
this.rentFlag = 1 |
|
|
this.rentFlag = 1 |
|
|
} else { |
|
|
} else { |
|
|
this.rentFlag = 0 |
|
|
this.rentFlag = 0 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
console.log(row) |
|
|
|
|
|
|
|
|
|
|
|
await this.loadUnitList() |
|
|
await this.loadUnitList() |
|
|
|
|
|
|
|
@ -206,6 +206,20 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleComfirm () { |
|
|
async handleComfirm () { |
|
|
|
|
|
this.dataForm.houseType = this.houseType |
|
|
|
|
|
this.dataForm.purpose = this.purpose |
|
|
|
|
|
this.dataForm.rentFlag = this.rentFlag |
|
|
|
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
|
|
|
if (!valid) { |
|
|
|
|
|
app.util.validateRule(messageObj) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.addRoom() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async addRoom () { |
|
|
let url = '' |
|
|
let url = '' |
|
|
|
|
|
|
|
|
if (this.formType === 'add') { |
|
|
if (this.formType === 'add') { |
|
@ -215,9 +229,7 @@ export default { |
|
|
this.dataForm.houseId = this.houseId |
|
|
this.dataForm.houseId = this.houseId |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.dataForm.houseType = this.houseType |
|
|
|
|
|
this.dataForm.purpose = this.purpose |
|
|
|
|
|
this.dataForm.rentFlag = this.rentFlag |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, this.dataForm) |
|
|
const { data, code, msg } = await requestPost(url, this.dataForm) |
|
|
|
|
|
|
|
@ -242,14 +254,17 @@ export default { |
|
|
|
|
|
|
|
|
resetData () { |
|
|
resetData () { |
|
|
this.houseId = '' //房屋ID |
|
|
this.houseId = '' //房屋ID |
|
|
|
|
|
this.houseType = '1' |
|
|
|
|
|
this.purpose = '1' |
|
|
|
|
|
this.rentFlag = 0 |
|
|
this.dataForm = { |
|
|
this.dataForm = { |
|
|
neighborHoodId: '', // 所属小区ID |
|
|
neighborHoodId: '', // 所属小区ID |
|
|
buildingId: '',//所属楼栋ID |
|
|
buildingId: '',//所属楼栋ID |
|
|
buildingUnitId: 0,//所属单元ID |
|
|
buildingUnitId: '',//所属单元ID |
|
|
doorName: 0,//门牌号 |
|
|
doorName: '',//门牌号 |
|
|
houseType: '1',//房屋类型【楼房,平房,别墅】 |
|
|
houseType: '1',//房屋类型【楼房,平房,别墅】 |
|
|
purpose: '1',//房屋用途【住宅,商业,办公,工业,仓储,商住混用,其他】 |
|
|
purpose: '1',//房屋用途【住宅,商业,办公,工业,仓储,商住混用,其他】 |
|
|
rentFlag: '1',//是否出租【是:1,否:0】 |
|
|
rentFlag: 0,//是否出租【是:1,否:0】 |
|
|
ownerPhone: '', //房主电话 |
|
|
ownerPhone: '', //房主电话 |
|
|
ownerName: '', //房主名字 |
|
|
ownerName: '', //房主名字 |
|
|
ownerIdCard: '' //房主身份证 |
|
|
ownerIdCard: '' //房主身份证 |
|
@ -277,14 +292,12 @@ export default { |
|
|
buildingUnitId: [ |
|
|
buildingUnitId: [ |
|
|
{ required: true, message: '所属单元不能为空', trigger: 'blur' }, |
|
|
{ required: true, message: '所属单元不能为空', trigger: 'blur' }, |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
doorName: [ |
|
|
doorName: [ |
|
|
{ required: true, message: '门牌号不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '门牌号不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
houseType: [ |
|
|
houseType: [ |
|
|
{ required: true, message: '房屋类型不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '房屋类型不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
purpose: [ |
|
|
purpose: [ |
|
|
{ required: true, message: '房屋用途不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '房屋用途不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|