diff --git a/src/views/modules/base/community/buildForm.vue b/src/views/modules/base/community/buildForm.vue index 78ad23e8..e7d957e5 100644 --- a/src/views/modules/base/community/buildForm.vue +++ b/src/views/modules/base/community/buildForm.vue @@ -2,7 +2,8 @@
- @@ -37,28 +37,36 @@ - - - - @@ -159,15 +167,26 @@ export default { this.formType = type if (row) { - this.buildingId = row.buildingId - this.dataForm = row - this.buildType = row.buildingTypeKey + this.dataForm = JSON.parse(JSON.stringify(row)) + this.buildingId = this.dataForm.buildingId + this.buildType = this.dataForm.buildingTypeKey } - console.log(row) + }, async handleComfirm () { + this.dataForm.type = this.buildType + this.$refs['ref_form'].validate((valid, messageObj) => { + if (!valid) { + app.util.validateRule(messageObj) + } else { + this.addBuild() + } + + }) + }, + async addBuild () { let url = '' if (this.formType === 'add') { url = '/gov/org/building/buildingadd' @@ -176,7 +195,7 @@ export default { this.dataForm.buildingId = this.buildingId } - this.dataForm.type = this.buildType + const { data, code, msg } = await requestPost(url, this.dataForm) @@ -279,6 +298,7 @@ export default { resetData () { this.keyWords = '' this.buildingId = '' //楼栋ID + this.buildType = '1' this.dataForm = { agencyId: '', // 所属组织ID agencyName: '', @@ -289,7 +309,7 @@ export default { totalUnitNum: 0,//单元数 totalFloorNum: 0,//层数 totalHouseNum: 0,//户数 - type: '1',//房屋类型 + type: '',//房屋类型 location: '', //坐标位置 longitude: '', //经度 latitude: '' //纬度 @@ -323,16 +343,21 @@ export default { trigger: 'blur' } ], - agencyId: [ - { required: true, message: '所属组织不能为空', trigger: 'blur' } + type: [ + { required: true, message: '楼栋类型不能为空', trigger: 'blur' } ], - gridId: [ - { required: true, message: '所属网格不能为空', trigger: 'blur' } + totalUnitNum: [ + { required: true, message: '单元数不能为空', trigger: 'blur' } + ], + totalFloorNum: [ + { required: true, message: '层数不能为空', trigger: 'blur' } + ], + totalHouseNum: [ + { required: true, message: '户数不能为空', trigger: 'blur' } ], - longitude: [ { required: true, message: '坐标不能为空', trigger: 'blur' } - ] + ], } }, diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index eef64ebe..651a961c 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/src/views/modules/base/community/buildTable.vue @@ -54,25 +54,26 @@ :http-request="uploadFile"> 导入小区数据 + type="red">导入楼宇数据
+ min-width="180"> + min-width="160"> + min-width="140"> @@ -152,6 +153,7 @@ export default { total: 0, pageSize: 20, pageNo: 0, + tableLoading: true, agencyObj: {},//树所选的小区对象 ownerName: '', @@ -183,6 +185,7 @@ export default { }, async loadTable (fromTree, treeObj) { + this.tableLoading = true if (fromTree) { this.agencyObj = treeObj } @@ -204,6 +207,7 @@ export default { } else { this.$message.error(msg) } + this.tableLoading = false }, diaClose () { diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue index cbefbc81..8a3321e2 100644 --- a/src/views/modules/base/community/community.vue +++ b/src/views/modules/base/community/community.vue @@ -13,6 +13,7 @@ { // ref_tree 元素的ref value 绑定的node-key this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id); }); + this.treeLoading = false }, //解析树数据 diff --git a/src/views/modules/base/community/communityForm.vue b/src/views/modules/base/community/communityForm.vue index c4fc2411..50845fd3 100644 --- a/src/views/modules/base/community/communityForm.vue +++ b/src/views/modules/base/community/communityForm.vue @@ -2,7 +2,8 @@
- { + if (!valid) { + app.util.validateRule(messageObj) + } else { + this.addCommunity() + } + + }) + } }, async addCommunity () { + let url = '' if (this.formType === 'add') { url = '/gov/org/neighborhood/neighborhoodadd' @@ -367,8 +379,16 @@ export default { } else { this.$message.error(msg) } + }, async addProperty () { + if (!this.propertyForm.name || this.propertyForm.name === '') { + this.$message({ + type: 'error', + message: '物业名称不能为空' + }) + return false + } const url = '/gov/org/propertymanagement/add' // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add" let params = { diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index 3590e919..1a8ca199 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/src/views/modules/base/community/communityTable.vue @@ -63,6 +63,7 @@
- @@ -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">导入房屋数据