-
@@ -136,7 +136,7 @@ export default {
houseId: '', //房屋ID
houseType: '1',
purpose: '1',
- rentFlag: false,
+ rentFlag: 0,
dataForm: {
neighborHoodId: '', // 所属小区ID
buildingId: '',//所属楼栋ID
@@ -169,20 +169,20 @@ export default {
this.formType = type
if (row) {
- this.houseId = row.houseId
- this.dataForm = row
+ this.dataForm = JSON.parse(JSON.stringify(row))
+ this.houseId = this.dataForm.houseId
- this.dataForm.buildingUnitId = row.unitNumKey
- this.houseType = row.houseTypeKey
- this.purpose = row.purposeKey
- if (row.rentFlagKey) {
+ this.dataForm.buildingUnitId = this.dataForm.unitNumKey
+ this.houseType = this.dataForm.houseTypeKey
+ this.purpose = this.dataForm.purposeKey
+ if (this.dataForm.rentFlagKey) {
this.rentFlag = 1
} else {
this.rentFlag = 0
}
}
- console.log(row)
+
await this.loadUnitList()
@@ -206,6 +206,20 @@ export default {
},
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 = ''
if (this.formType === 'add') {
@@ -215,9 +229,7 @@ export default {
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)
@@ -242,14 +254,17 @@ export default {
resetData () {
this.houseId = '' //房屋ID
+ this.houseType = '1'
+ this.purpose = '1'
+ this.rentFlag = 0
this.dataForm = {
neighborHoodId: '', // 所属小区ID
buildingId: '',//所属楼栋ID
- buildingUnitId: 0,//所属单元ID
- doorName: 0,//门牌号
+ buildingUnitId: '',//所属单元ID
+ doorName: '',//门牌号
houseType: '1',//房屋类型【楼房,平房,别墅】
purpose: '1',//房屋用途【住宅,商业,办公,工业,仓储,商住混用,其他】
- rentFlag: '1',//是否出租【是:1,否:0】
+ rentFlag: 0,//是否出租【是:1,否:0】
ownerPhone: '', //房主电话
ownerName: '', //房主名字
ownerIdCard: '' //房主身份证
@@ -277,14 +292,12 @@ export default {
buildingUnitId: [
{ required: true, message: '所属单元不能为空', trigger: 'blur' },
],
-
doorName: [
{ required: true, message: '门牌号不能为空', trigger: 'blur' }
],
houseType: [
{ required: true, message: '房屋类型不能为空', trigger: 'blur' }
],
-
purpose: [
{ required: true, message: '房屋用途不能为空', trigger: 'blur' }
],
diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue
index 88eff4c9..f2978907 100644
--- a/src/views/modules/base/community/roomTable.vue
+++ b/src/views/modules/base/community/roomTable.vue
@@ -54,12 +54,13 @@
:http-request="uploadFile">
导入小区数据
+ type="red">导入房屋数据