Browse Source

小区管理

dev
jiangyy 4 years ago
parent
commit
80f08345a5
  1. 30
      epmet-oper-web/src/views/modules/base/community/buildTable.vue
  2. 39
      epmet-oper-web/src/views/modules/base/community/community.vue
  3. 168
      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" <el-table :data="tableData"
border border
style="width: 100%"> style="width: 100%">
<el-table-column prop="neighborHoodName" <el-table-column prop="buildingName"
label="小区名称" label="楼宇名称"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column prop="orgName" <el-table-column prop="neighbourHoodName"
label="所属组织" label="所属楼宇"
width="160"> width="160">
</el-table-column> </el-table-column>
<el-table-column prop="gridName" <el-table-column prop="buildingType"
label="所属网格" label="楼栋类型"
width="140"> width="140">
</el-table-column> </el-table-column>
<el-table-column prop="address" <el-table-column prop="totalUnitNum"
label="详细地址"> 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>
<el-table-column prop="remark" <el-table-column prop="remark"
label="备注"> label="备注">
@ -145,7 +151,7 @@ export default {
//form //form
formShow: false, formShow: false,
formTitle: '新增小区' formTitle: '新增楼宇'
} }
}, },
@ -190,7 +196,7 @@ export default {
}, },
handleDetail (row) { handleDetail (row) {
this.formTitle = '小区详情' this.formTitle = '楼宇详情'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row) this.$refs.ref_form.initForm('detail', row)
@ -198,7 +204,7 @@ export default {
}, },
handleAdd () { handleAdd () {
this.formTitle = '新增小区' this.formTitle = '新增楼宇'
this.formShow = true this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('add') this.$refs.ref_form.initForm('add')
@ -206,7 +212,7 @@ export default {
}, },
handleEdit (row) { handleEdit (row) {
this.formTitle = '修改小区' this.formTitle = '修改楼宇'
this.formShow = true this.formShow = true
this.$refs.ref_form.initForm('edit', row) this.$refs.ref_form.initForm('edit', row)
}, },

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

@ -33,9 +33,9 @@
<div :style="{height:rowHeight}"> <div :style="{height:rowHeight}">
<build-table v-if="selTreeLevel==='neighbourHood'" <build-table v-if="selTreeLevel==='neighbourHood'"
ref="ref_communityTable"></build-table> ref="ref_neighTable"></build-table>
<room-table v-else-if="selTreeLevel==='building'" <room-table v-else-if="selTreeLevel==='building'"
ref="ref_communityTable"></room-table> ref="ref_buildingTable"></room-table>
<community-table v-else <community-table v-else
ref="ref_communityTable"></community-table> ref="ref_communityTable"></community-table>
@ -69,7 +69,9 @@ export default {
}, },
selTreeId: '', selTreeId: '',
selTreeLevel: '' selTreeLevel: '',
centerPoint: []
} }
}, },
@ -77,8 +79,10 @@ export default {
CDialog CDialog
}, },
async mounted () { 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) await this.$refs['ref_communityTable'].loadTable(this.selTreeId, this.selTreeLevel)
}, },
computed: { 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) { handleNodeClick (obj) {
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) this.$refs['ref_communityTable'].loadTable(obj.id, obj.level)
}
}, },
handleSizeChange (val) { handleSizeChange (val) {

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

@ -2,153 +2,112 @@
<div> <div>
<div> <div>
<div v-show="!propertyFormShow"> <div v-show="!propertyFormShow">
<el-form <el-form :inline="false"
:inline="false"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
class="form" class="form">
> <el-form-item label="小区名称"
<el-form-item
label="小区名称"
prop="neighborHoodName" prop="neighborHoodName"
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="50"
show-word-limit show-word-limit
placeholder="请输入小区名称" placeholder="请输入小区名称"
v-model="dataForm.neighborHoodName" v-model="dataForm.neighborHoodName">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="所属组织"
label="所属组织"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
>
<span>{{ dataForm.agencyName }}</span> <span>{{ dataForm.agencyName }}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="所属网格"
label="所属网格"
prop="gridId" prop="gridId"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-select class="item_width_1"
<el-select
class="item_width_1"
v-model="dataForm.gridId" v-model="dataForm.gridId"
placeholder="请选择" placeholder="请选择"
clearable clearable>
> <el-option v-for="item in gridList"
<el-option
v-for="item in gridList"
:key="item.gridId" :key="item.gridId"
:label="item.gridName" :label="item.gridName"
:value="item.gridId" :value="item.gridId">
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="关联物业"
label="关联物业"
prop="propertyId" prop="propertyId"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-select class="item_width_2"
<el-select
class="item_width_2"
v-model="dataForm.propertyId" v-model="dataForm.propertyId"
placeholder="请选择" placeholder="请选择"
clearable clearable>
> <el-option v-for="item in propertyList"
<el-option
v-for="item in propertyList"
:key="item.propertyId" :key="item.propertyId"
:label="item.propertyName" :label="item.propertyName"
:value="item.propertyId" :value="item.propertyId">
>
</el-option> </el-option>
</el-select> </el-select>
<el-button <el-button style="margin-left: 10px"
style="margin-left: 10px"
type="primary" type="primary"
size="small" size="small"
@click="handleAddProperty" @click="handleAddProperty">添加物业</el-button>
>添加物业</el-button
>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="详细地址"
label="详细地址"
prop="address" prop="address"
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="50"
show-word-limit show-word-limit
placeholder="请输入详细地址" placeholder="请输入详细地址"
v-model="dataForm.address" v-model="dataForm.address">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="备注"
label="备注"
prop="remark" prop="remark"
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="textarea" type="textarea"
maxlength="500" maxlength="500"
show-word-limit show-word-limit
:rows="3" :rows="3"
placeholder="请输入备注,不超过500字" placeholder="请输入备注,不超过500字"
v-model="dataForm.remark" v-model="dataForm.remark"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="位置坐标"
label="位置坐标"
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_3"
<el-input
class="item_width_3"
maxlength="50" maxlength="50"
placeholder="请输入关键字" placeholder="请输入关键字"
v-model="keyWords" v-model="keyWords">
>
</el-input> </el-input>
<el-button <el-button style="margin-left: 10px"
style="margin-left: 10px"
type="primary" type="primary"
size="small" size="small"
@click="handleSearchMap" @click="handleSearchMap">查询</el-button>
>查询</el-button <div id="app"
> class="div_map"></div>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span>经度</span> <span>经度</span>
<el-input <el-input class="item_width_3"
class="item_width_3"
maxlength="50" maxlength="50"
placeholder="请输入经度" placeholder="请输入经度"
v-model="dataForm.longitude" v-model="dataForm.longitude">
>
</el-input> </el-input>
<span style="margin-left: 20px">纬度</span> <span style="margin-left: 20px">纬度</span>
<el-input <el-input class="item_width_3"
class="item_width_3"
maxlength="50" maxlength="50"
placeholder="请输入纬度" placeholder="请输入纬度"
v-model="dataForm.latitude" v-model="dataForm.latitude">
>
</el-input> </el-input>
</div> </div>
</el-form-item> </el-form-item>
@ -156,25 +115,19 @@
</div> </div>
<div v-show="propertyFormShow"> <div v-show="propertyFormShow">
<el-form <el-form :inline="false"
:inline="false"
:model="propertyForm" :model="propertyForm"
:rules="propertyRule" :rules="propertyRule"
class="form" class="form">
> <el-form-item label="物业名称"
<el-form-item
label="物业名称"
prop="name" prop="name"
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="50"
show-word-limit show-word-limit
placeholder="请输入小区名称" placeholder="请输入小区名称"
v-model="propertyForm.name" v-model="propertyForm.name">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -182,12 +135,9 @@
</div> </div>
<div class="div_btn"> <div class="div_btn">
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button <el-button v-if="formType != 'detail'"
v-if="formType != 'detail'"
type="primary" type="primary"
@click="handleComfirm" @click="handleComfirm"> </el-button>
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
@ -228,7 +178,8 @@ export default {
name: '' name: ''
}, },
keyWords: '' keyWords: '',
centerPoint: []
} }
}, },
components: {}, components: {},
@ -240,7 +191,7 @@ export default {
// init // 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 TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), { map = new window.TMap.Map(document.getElementById('app'), {
center: center, // center: center, //
@ -248,8 +199,7 @@ export default {
pitch: 43.5, // pitch: 43.5, //
rotation: 45 // rotation: 45 //
}) })
console.log(map)
console.log(window)
search = new window.TMap.service.Search({ pageSize: 10 }) search = new window.TMap.service.Search({ pageSize: 10 })
// //
markers = new TMap.MultiMarker({ markers = new TMap.MultiMarker({
@ -317,7 +267,12 @@ export default {
this.setMarker(lat, lng) 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 this.formType = type
if (row) { if (row) {
this.neighborHoodId = row.neighborHoodId this.neighborHoodId = row.neighborHoodId
@ -345,7 +300,7 @@ export default {
}, },
// //
async loadGrid () { async loadGrid () {
const url = '/gov/org/grid/allgrids' const url = '/gov/org/grid/allgridsnopermission '
// const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids" // const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids"
let params = { let params = {
agencyId: this.dataForm.agencyId agencyId: this.dataForm.agencyId
@ -375,6 +330,7 @@ export default {
}, },
handleAddProperty () { handleAddProperty () {
this.propertyForm.name = '' this.propertyForm.name = ''
this.propertyFormShow = true this.propertyFormShow = true
}, },

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

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

Loading…
Cancel
Save