Browse Source

小区管理

dev
jiangyy 4 years ago
parent
commit
80f08345a5
  1. 30
      epmet-oper-web/src/views/modules/base/community/buildTable.vue
  2. 41
      epmet-oper-web/src/views/modules/base/community/community.vue
  3. 312
      epmet-oper-web/src/views/modules/base/community/communityForm.vue
  4. 14
      epmet-oper-web/src/views/modules/base/community/communityTable.vue

30
epmet-oper-web/src/views/modules/base/community/buildTable.vue

@ -49,20 +49,26 @@
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="neighborHoodName"
label="小区名称"
<el-table-column prop="buildingName"
label="楼宇名称"
width="180">
</el-table-column>
<el-table-column prop="orgName"
label="所属组织"
<el-table-column prop="neighbourHoodName"
label="所属楼宇"
width="160">
</el-table-column>
<el-table-column prop="gridName"
label="所属网格"
<el-table-column prop="buildingType"
label="楼栋类型"
width="140">
</el-table-column>
<el-table-column prop="address"
label="详细地址">
<el-table-column prop="totalUnitNum"
label="单元数">
</el-table-column>
<el-table-column prop="totalFloorNum"
label="层数">
</el-table-column>
<el-table-column prop="totalHouseNum"
label="户数">
</el-table-column>
<el-table-column prop="remark"
label="备注">
@ -145,7 +151,7 @@ export default {
//form
formShow: false,
formTitle: '新增小区'
formTitle: '新增楼宇'
}
},
@ -190,7 +196,7 @@ export default {
},
handleDetail (row) {
this.formTitle = '小区详情'
this.formTitle = '楼宇详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row)
@ -198,7 +204,7 @@ export default {
},
handleAdd () {
this.formTitle = '新增小区'
this.formTitle = '新增楼宇'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add')
@ -206,7 +212,7 @@ export default {
},
handleEdit (row) {
this.formTitle = '修改小区'
this.formTitle = '修改楼宇'
this.formShow = true
this.$refs.ref_form.initForm('edit', row)
},

41
epmet-oper-web/src/views/modules/base/community/community.vue

@ -33,9 +33,9 @@
<div :style="{height:rowHeight}">
<build-table v-if="selTreeLevel==='neighbourHood'"
ref="ref_communityTable"></build-table>
ref="ref_neighTable"></build-table>
<room-table v-else-if="selTreeLevel==='building'"
ref="ref_communityTable"></room-table>
ref="ref_buildingTable"></room-table>
<community-table v-else
ref="ref_communityTable"></community-table>
@ -69,7 +69,9 @@ export default {
},
selTreeId: '',
selTreeLevel: ''
selTreeLevel: '',
centerPoint: []
}
},
@ -77,8 +79,10 @@ export default {
CDialog
},
async mounted () {
await this.loadTree()
await this.loadOrgData()
await this.$refs['ref_communityTable'].initData(this.centerPoint)
await this.loadTree()
await this.$refs['ref_communityTable'].loadTable(this.selTreeId, this.selTreeLevel)
},
computed: {
@ -108,8 +112,35 @@ export default {
}
},
//
async loadOrgData () {
const url = "/gov/org/agency/maporg"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.centerPoint = []
this.centerPoint.push(data.latitude)
this.centerPoint.push(data.longitude)
} else {
this.$message.error(msg)
}
},
handleNodeClick (obj) {
this.$refs['ref_communityTable'].loadTable(obj.id, obj.level)
if (obj.level === 'building') {
this.$refs['ref_buildingTable'].loadTable(obj.id, obj.level)
} else if (obj.level === 'neighbourHood') {
this.$refs['ref_neighTable'].loadTable(obj.id, obj.level)
} else {
this.$refs['ref_communityTable'].loadTable(obj.id, obj.level)
}
},
handleSizeChange (val) {

312
epmet-oper-web/src/views/modules/base/community/communityForm.vue

@ -2,153 +2,112 @@
<div>
<div>
<div v-show="!propertyFormShow">
<el-form
:inline="false"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="小区名称"
prop="neighborHoodName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入小区名称"
v-model="dataForm.neighborHoodName"
>
<el-form :inline="false"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="小区名称"
prop="neighborHoodName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入小区名称"
v-model="dataForm.neighborHoodName">
</el-input>
</el-form-item>
<el-form-item
label="所属组织"
label-width="150px"
style="display: block"
>
<el-form-item label="所属组织"
label-width="150px"
style="display: block">
<span>{{ dataForm.agencyName }}</span>
</el-form-item>
<el-form-item
label="所属网格"
prop="gridId"
label-width="150px"
style="display: block"
>
<el-select
class="item_width_1"
v-model="dataForm.gridId"
placeholder="请选择"
clearable
>
<el-option
v-for="item in gridList"
:key="item.gridId"
:label="item.gridName"
:value="item.gridId"
>
<el-form-item label="所属网格"
prop="gridId"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="dataForm.gridId"
placeholder="请选择"
clearable>
<el-option v-for="item in gridList"
:key="item.gridId"
:label="item.gridName"
:value="item.gridId">
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="关联物业"
prop="propertyId"
label-width="150px"
style="display: block"
>
<el-select
class="item_width_2"
v-model="dataForm.propertyId"
placeholder="请选择"
clearable
>
<el-option
v-for="item in propertyList"
:key="item.propertyId"
:label="item.propertyName"
:value="item.propertyId"
>
<el-form-item label="关联物业"
prop="propertyId"
label-width="150px"
style="display: block">
<el-select class="item_width_2"
v-model="dataForm.propertyId"
placeholder="请选择"
clearable>
<el-option v-for="item in propertyList"
:key="item.propertyId"
:label="item.propertyName"
:value="item.propertyId">
</el-option>
</el-select>
<el-button
style="margin-left: 10px"
type="primary"
size="small"
@click="handleAddProperty"
>添加物业</el-button
>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleAddProperty">添加物业</el-button>
</el-form-item>
<el-form-item
label="详细地址"
prop="address"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入详细地址"
v-model="dataForm.address"
>
<el-form-item label="详细地址"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入详细地址"
v-model="dataForm.address">
</el-input>
</el-form-item>
<el-form-item
label="备注"
prop="remark"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入备注,不超过500字"
v-model="dataForm.remark"
></el-input>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入备注,不超过500字"
v-model="dataForm.remark"></el-input>
</el-form-item>
<el-form-item
label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入关键字"
v-model="keyWords"
>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入关键字"
v-model="keyWords">
</el-input>
<el-button
style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap"
>查询</el-button
>
<div id="app" class="div_map"></div>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude"
>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude"
>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude">
</el-input>
</div>
</el-form-item>
@ -156,25 +115,19 @@
</div>
<div v-show="propertyFormShow">
<el-form
:inline="false"
:model="propertyForm"
:rules="propertyRule"
class="form"
>
<el-form-item
label="物业名称"
prop="name"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入小区名称"
v-model="propertyForm.name"
>
<el-form :inline="false"
:model="propertyForm"
:rules="propertyRule"
class="form">
<el-form-item label="物业名称"
prop="name"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入小区名称"
v-model="propertyForm.name">
</el-input>
</el-form-item>
</el-form>
@ -182,12 +135,9 @@
</div>
<div class="div_btn">
<el-button @click="handleCancle"> </el-button>
<el-button
v-if="formType != 'detail'"
type="primary"
@click="handleComfirm"
> </el-button
>
<el-button v-if="formType != 'detail'"
type="primary"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
@ -202,7 +152,7 @@ var markers
var infoWindowList
let loading //
export default {
data() {
data () {
return {
formType: 'add', // addeditdetail
@ -228,19 +178,20 @@ export default {
name: ''
},
keyWords: ''
keyWords: '',
centerPoint: []
}
},
components: {},
mounted() {
mounted () {
this.initMap()
},
methods: {
// init
initMap() {
initMap () {
//
var center = new window.TMap.LatLng(39.98412, 116.307484)
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
@ -248,8 +199,7 @@ export default {
pitch: 43.5, //
rotation: 45 //
})
console.log(map)
console.log(window)
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
@ -265,7 +215,7 @@ export default {
this.handleMoveCenter()
},
setMarker(lat, lng) {
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
@ -279,7 +229,7 @@ export default {
])
},
handleSearchMap() {
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
@ -307,7 +257,7 @@ export default {
})
},
handleMoveCenter() {
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
@ -317,7 +267,12 @@ export default {
this.setMarker(lat, lng)
},
async initForm(type, row) {
async initForm (centerPoint, type, row) {
this.centerPoint = centerPoint
// debugger
map.setCenter(new TMap.LatLng(this.centerPoint[0], this.centerPoint[1]))
this.formType = type
if (row) {
this.neighborHoodId = row.neighborHoodId
@ -330,7 +285,7 @@ export default {
},
//
async loadAgency() {
async loadAgency () {
const url = '/epmetuser/customerstaff/staffbasicinfo'
let params = {}
@ -344,8 +299,8 @@ export default {
}
},
//
async loadGrid() {
const url = '/gov/org/grid/allgrids'
async loadGrid () {
const url = '/gov/org/grid/allgridsnopermission '
// const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids"
let params = {
agencyId: this.dataForm.agencyId
@ -360,7 +315,7 @@ export default {
}
},
//
async loadProperty() {
async loadProperty () {
const url = '/gov/org/propertymanagement/list'
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list"
let params = {}
@ -374,19 +329,20 @@ export default {
}
},
handleAddProperty() {
handleAddProperty () {
this.propertyForm.name = ''
this.propertyFormShow = true
},
async handleComfirm() {
async handleComfirm () {
if (this.propertyFormShow) {
this.addProperty()
} else {
this.addCommunity()
}
},
async addCommunity() {
async addCommunity () {
let url = ''
if (this.formType === 'add') {
url = '/gov/org/neighborhood/neighborhoodadd'
@ -410,7 +366,7 @@ export default {
this.$message.error(msg)
}
},
async addProperty() {
async addProperty () {
const url = '/gov/org/propertymanagement/add'
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add"
let params = {
@ -431,7 +387,7 @@ export default {
this.$message.error(msg)
}
},
handleCancle() {
handleCancle () {
if (this.propertyFormShow) {
this.propertyForm.name = ''
this.propertyFormShow = false
@ -439,9 +395,9 @@ export default {
this.$emit('dialogCancle')
}
},
resetData() {},
resetData () { },
//
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
@ -449,7 +405,7 @@ export default {
})
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
@ -457,7 +413,7 @@ export default {
}
},
computed: {
dataRule() {
dataRule () {
return {
neighborHoodName: [
{ required: true, message: '小区名称不能为空', trigger: 'blur' },
@ -482,7 +438,7 @@ export default {
]
}
},
propertyRule() {
propertyRule () {
name: [
{ required: true, message: '物业名称不能为空', trigger: 'blur' }
// { min: 1, max: 50, message: ' 1 50', trigger: 'blur' }

14
epmet-oper-web/src/views/modules/base/community/communityTable.vue

@ -109,7 +109,7 @@
:close-on-press-escape="false"
:title="formTitle"
width="800px"
top='5'
top='15'
@closed="diaClose">
<community-form ref="ref_form"
@dialogCancle="addFormCancle"
@ -148,7 +148,8 @@ export default {
//form
formShow: false,
formTitle: '新增小区'
formTitle: '新增小区',
centerPoint: []
}
},
@ -165,6 +166,9 @@ export default {
...mapGetters(['clientHeight'])
},
methods: {
initData (centerPoint) {
this.centerPoint = centerPoint
},
handleSearch () {
this.loadTable()
},
@ -202,7 +206,7 @@ export default {
this.formTitle = '小区详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row)
this.$refs.ref_form.initForm(this.centerPoint, 'detail', row)
})
},
@ -210,14 +214,14 @@ export default {
this.formTitle = '新增小区'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add')
this.$refs.ref_form.initForm(this.centerPoint, 'add')
})
},
handleEdit (row) {
this.formTitle = '修改小区'
this.formShow = true
this.$refs.ref_form.initForm('edit', row)
this.$refs.ref_form.initForm(this.centerPoint, 'edit', row)
},
addFormCancle () {

Loading…
Cancel
Save