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>
<div> <div>
<el-form :inline="true" <el-form ref="ref_form"
:inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
@ -18,8 +19,7 @@
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_1" <el-input class="item_width_1"
maxlength="50" maxlength="10"
show-word-limit
placeholder="请输入楼栋名称" placeholder="请输入楼栋名称"
v-model="dataForm.buildingName"> v-model="dataForm.buildingName">
</el-input> </el-input>
@ -37,28 +37,36 @@
</el-form-item> </el-form-item>
<el-form-item label="排序" <el-form-item label="排序"
prop="sort" prop="sort"
style="display: block"
label-width="150px"> 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> label="排序"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="单元数" <el-form-item label="单元数"
style="display: block"
prop="totalUnitNum" prop="totalUnitNum"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.totalUnitNum" <el-input-number class="item_width_1"
v-model="dataForm.totalUnitNum"
:min="1" :min="1"
label="单元数"></el-input-number> label="单元数"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="层数" <el-form-item label="层数"
style="display: block"
prop="totalFloorNum" prop="totalFloorNum"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.totalFloorNum" <el-input-number class="item_width_1"
v-model="dataForm.totalFloorNum"
:min="1" :min="1"
label="层数"></el-input-number> label="层数"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="户数" <el-form-item label="户数"
style="display: block"
prop="totalHouseNum" prop="totalHouseNum"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.totalHouseNum" <el-input-number class="item_width_1"
v-model="dataForm.totalHouseNum"
:min="1" :min="1"
label="户数"></el-input-number> label="户数"></el-input-number>
</el-form-item> </el-form-item>
@ -159,15 +167,26 @@ export default {
this.formType = type this.formType = type
if (row) { if (row) {
this.buildingId = row.buildingId this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm = row this.buildingId = this.dataForm.buildingId
this.buildType = row.buildingTypeKey this.buildType = this.dataForm.buildingTypeKey
} }
console.log(row)
}, },
async handleComfirm () { 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 = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
url = '/gov/org/building/buildingadd' url = '/gov/org/building/buildingadd'
@ -176,7 +195,7 @@ export default {
this.dataForm.buildingId = this.buildingId this.dataForm.buildingId = this.buildingId
} }
this.dataForm.type = this.buildType
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm)
@ -279,6 +298,7 @@ export default {
resetData () { resetData () {
this.keyWords = '' this.keyWords = ''
this.buildingId = '' //ID this.buildingId = '' //ID
this.buildType = '1'
this.dataForm = { this.dataForm = {
agencyId: '', // ID agencyId: '', // ID
agencyName: '', agencyName: '',
@ -289,7 +309,7 @@ export default {
totalUnitNum: 0,// totalUnitNum: 0,//
totalFloorNum: 0,// totalFloorNum: 0,//
totalHouseNum: 0,// totalHouseNum: 0,//
type: '1',// type: '',//
location: '', // location: '', //
longitude: '', // longitude: '', //
latitude: '' // latitude: '' //
@ -323,16 +343,21 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
agencyId: [ type: [
{ required: true, message: '所属组织不能为空', trigger: 'blur' } { required: true, message: '楼栋类型不能为空', trigger: 'blur' }
], ],
gridId: [ totalUnitNum: [
{ required: true, message: '所属网格不能为空', trigger: 'blur' } { required: true, message: '单元数不能为空', trigger: 'blur' }
],
totalFloorNum: [
{ required: true, message: '层数不能为空', trigger: 'blur' }
],
totalHouseNum: [
{ required: true, message: '户数不能为空', trigger: 'blur' }
], ],
longitude: [ longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' } { required: true, message: '坐标不能为空', trigger: 'blur' }
] ],
} }
}, },

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

@ -54,25 +54,26 @@
:http-request="uploadFile"> :http-request="uploadFile">
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
size="small" size="small"
type="red">导入小区数据</el-button> type="red">导入楼宇数据</el-button>
</el-upload> </el-upload>
</div> </div>
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table :data="tableData"
border border
v-loading="tableLoading"
style="width: 100%"> style="width: 100%">
<el-table-column prop="buildingName" <el-table-column prop="buildingName"
label="楼栋名称" label="楼栋名称"
width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="neighborHoodName" <el-table-column prop="neighborHoodName"
label="所属小区" label="所属小区"
width="160"> min-width="160">
</el-table-column> </el-table-column>
<el-table-column prop="buildingType" <el-table-column prop="buildingType"
label="楼栋类型" label="楼栋类型"
width="140"> min-width="140">
</el-table-column> </el-table-column>
<el-table-column prop="totalUnitNum" <el-table-column prop="totalUnitNum"
label="单元数"> label="单元数">
@ -152,6 +153,7 @@ export default {
total: 0, total: 0,
pageSize: 20, pageSize: 20,
pageNo: 0, pageNo: 0,
tableLoading: true,
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -183,6 +185,7 @@ export default {
}, },
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
} }
@ -204,6 +207,7 @@ export default {
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
this.tableLoading = false
}, },
diaClose () { diaClose () {

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

@ -13,6 +13,7 @@
</el-input> </el-input>
<el-tree ref="ref_tree" <el-tree ref="ref_tree"
v-loading="treeLoading"
class="filter-tree" class="filter-tree"
:data="treeData" :data="treeData"
:props="defaultProps" :props="defaultProps"
@ -66,6 +67,7 @@ export default {
data () { data () {
return { return {
filterText: '', filterText: '',
treeLoading: true,
treeData: [], treeData: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -82,6 +84,7 @@ export default {
CDialog CDialog
}, },
async mounted () { async mounted () {
this.treeLoading = true
await this.loadOrgData() await this.loadOrgData()
await this.loadTree() await this.loadTree()
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) 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.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
}); });
} }
this.treeLoading = false
}, },
computed: { computed: {
@ -166,12 +170,13 @@ export default {
// //
async refreshTree () { async refreshTree () {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id) await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => { this.$nextTick(() => {
// ref_tree ref value node-key // ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id); 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> <div>
<div v-show="!propertyFormShow"> <div v-show="!propertyFormShow">
<el-form :inline="true" <el-form ref="ref_form"
:inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
@ -276,10 +277,11 @@ export default {
this.formType = type this.formType = type
if (row) { 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.loadAgency()
await this.loadGrid() await this.loadGrid()
@ -332,19 +334,29 @@ export default {
}, },
handleAddProperty () { handleAddProperty () {
this.propertyForm.name = '' this.propertyForm.name = ''
this.propertyFormShow = true this.propertyFormShow = true
}, },
async handleComfirm () { async handleComfirm () {
if (this.propertyFormShow) { if (this.propertyFormShow) {
this.addProperty() this.addProperty()
} else {
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
} else { } else {
this.addCommunity() this.addCommunity()
} }
})
}
}, },
async addCommunity () { async addCommunity () {
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
url = '/gov/org/neighborhood/neighborhoodadd' url = '/gov/org/neighborhood/neighborhoodadd'
@ -367,8 +379,16 @@ export default {
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
async addProperty () { async addProperty () {
if (!this.propertyForm.name || this.propertyForm.name === '') {
this.$message({
type: 'error',
message: '物业名称不能为空'
})
return false
}
const url = '/gov/org/propertymanagement/add' const url = '/gov/org/propertymanagement/add'
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add" // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add"
let params = { let params = {

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

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

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

@ -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',//10 rentFlag: 0,//10
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' }
], ],

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

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

Loading…
Cancel
Save