Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev

shibei_master
13176889840 4 years ago
parent
commit
682734fc2b
  1. 63
      src/views/modules/base/community/buildForm.vue
  2. 12
      src/views/modules/base/community/buildTable.vue
  3. 7
      src/views/modules/base/community/community.vue
  4. 30
      src/views/modules/base/community/communityForm.vue
  5. 4
      src/views/modules/base/community/communityTable.vue
  6. 49
      src/views/modules/base/community/roomForm.vue
  7. 8
      src/views/modules/base/community/roomTable.vue

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

@ -2,7 +2,8 @@
<div>
<div>
<el-form :inline="true"
<el-form ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
@ -18,8 +19,7 @@
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
maxlength="10"
placeholder="请输入楼栋名称"
v-model="dataForm.buildingName">
</el-input>
@ -37,28 +37,36 @@
</el-form-item>
<el-form-item label="排序"
prop="sort"
style="display: block"
label-width="150px">
<el-input-number v-model="dataForm.sort"
<el-input-number class="item_width_1"
v-model="dataForm.sort"
label="排序"></el-input-number>
</el-form-item>
<el-form-item label="单元数"
style="display: block"
prop="totalUnitNum"
label-width="150px">
<el-input-number v-model="dataForm.totalUnitNum"
<el-input-number class="item_width_1"
v-model="dataForm.totalUnitNum"
:min="1"
label="单元数"></el-input-number>
</el-form-item>
<el-form-item label="层数"
style="display: block"
prop="totalFloorNum"
label-width="150px">
<el-input-number v-model="dataForm.totalFloorNum"
<el-input-number class="item_width_1"
v-model="dataForm.totalFloorNum"
:min="1"
label="层数"></el-input-number>
</el-form-item>
<el-form-item label="户数"
style="display: block"
prop="totalHouseNum"
label-width="150px">
<el-input-number v-model="dataForm.totalHouseNum"
<el-input-number class="item_width_1"
v-model="dataForm.totalHouseNum"
:min="1"
label="户数"></el-input-number>
</el-form-item>
@ -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' }
]
],
}
},

12
src/views/modules/base/community/buildTable.vue

@ -54,25 +54,26 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="red">导入小区数据</el-button>
type="red">导入楼宇数据</el-button>
</el-upload>
</div>
<div class="div_table">
<el-table :data="tableData"
border
v-loading="tableLoading"
style="width: 100%">
<el-table-column prop="buildingName"
label="楼栋名称"
width="180">
min-width="180">
</el-table-column>
<el-table-column prop="neighborHoodName"
label="所属小区"
width="160">
min-width="160">
</el-table-column>
<el-table-column prop="buildingType"
label="楼栋类型"
width="140">
min-width="140">
</el-table-column>
<el-table-column prop="totalUnitNum"
label="单元数">
@ -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 () {

7
src/views/modules/base/community/community.vue

@ -13,6 +13,7 @@
</el-input>
<el-tree ref="ref_tree"
v-loading="treeLoading"
class="filter-tree"
:data="treeData"
:props="defaultProps"
@ -66,6 +67,7 @@ export default {
data () {
return {
filterText: '',
treeLoading: true,
treeData: [],
defaultProps: {
children: 'children',
@ -82,6 +84,7 @@ export default {
CDialog
},
async mounted () {
this.treeLoading = true
await this.loadOrgData()
await this.loadTree()
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
@ -91,6 +94,7 @@ export default {
this.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
});
}
this.treeLoading = false
},
computed: {
@ -166,12 +170,13 @@ export default {
//
async refreshTree () {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
this.treeLoading = false
},
//

30
src/views/modules/base/community/communityForm.vue

@ -2,7 +2,8 @@
<div>
<div>
<div v-show="!propertyFormShow">
<el-form :inline="true"
<el-form ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
@ -276,10 +277,11 @@ export default {
this.formType = type
if (row) {
this.neighborHoodId = row.neighborHoodId
this.dataForm = row
this.dataForm = JSON.parse(JSON.stringify(row))
this.neighborHoodId = this.dataForm.neighborHoodId
}
console.log(row)
await this.loadAgency()
await this.loadGrid()
@ -332,19 +334,29 @@ export default {
},
handleAddProperty () {
this.propertyForm.name = ''
this.propertyFormShow = true
},
async handleComfirm () {
if (this.propertyFormShow) {
this.addProperty()
} else {
this.$refs['ref_form'].validate((valid, messageObj) => {
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 = {

4
src/views/modules/base/community/communityTable.vue

@ -63,6 +63,7 @@
<div class="div_table">
<el-table :data="tableData"
border
v-loading="tableLoading"
style="width: 100%">
<el-table-column prop="neighborHoodName"
label="小区名称"
@ -154,6 +155,7 @@ export default {
total: 0,
pageSize: 20,
pageNo: 0,
tableLoading: true,
agencyObj: {},//
ownerName: '',
@ -188,6 +190,7 @@ export default {
this.loadTable()
},
async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) {
this.agencyObj = treeObj
}
@ -211,6 +214,7 @@ export default {
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {

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

@ -1,7 +1,8 @@
<template>
<div>
<div>
<el-form :inline="false"
<el-form ref="ref_form"
:inline="false"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
@ -103,7 +104,6 @@
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type='number'
placeholder="请输入房主身份证"
v-model="dataForm.ownerIdCard">
</el-input>
@ -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',//10
rentFlag: 0,//10
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' }
],

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

@ -54,12 +54,13 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="red">导入小区数据</el-button>
type="red">导入房屋数据</el-button>
</el-upload>
</div>
<div class="div_table">
<el-table :data="tableData"
v-loading="tableLoading"
border
style="width: 100%">
<el-table-column prop="houseName"
@ -164,7 +165,7 @@ export default {
total: 0,
pageSize: 20,
pageNo: 0,
tableLoading: true,
agencyObj: {},//
ownerName: '',
@ -198,6 +199,7 @@ export default {
},
async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) {
this.agencyObj = treeObj
}
@ -219,9 +221,11 @@ export default {
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},

Loading…
Cancel
Save