7 changed files with 1208 additions and 273 deletions
@ -0,0 +1,315 @@ |
|||
<template> |
|||
<div> |
|||
<div class="dialog-h-content scroll-h"> |
|||
|
|||
<div v-if="initLoading" |
|||
class="m-row"> |
|||
<div class="m-info"> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">所属小区:</span> |
|||
<span>{{ agencyObj.agencyName }}—{{ agencyObj.gridName }}—{{ agencyObj.label }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">楼栋名称:</span> |
|||
<span>{{ dataForm.buildingName?dataForm.buildingName:'--' }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">楼栋编码:</span> |
|||
<span>{{ dataForm.coding?dataForm.coding:'--'}}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">楼栋类型:</span> |
|||
<span>{{ dataForm.buildType?dataForm.buildType:'--'}}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">单元数:</span> |
|||
<span>{{dataForm.totalUnitNum?dataForm.totalUnitNum:0 }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">层数:</span> |
|||
<span>{{dataForm.totalFloorNum?dataForm.totalFloorNum:0 }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">总户数:</span> |
|||
<span>{{dataForm.totalHouseNum?dataForm.totalHouseNum:0 }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">人口数:</span> |
|||
<span>{{dataForm.realPerson?dataForm.realPerson:0 }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">楼长姓名:</span> |
|||
<span>{{ dataForm.buildingLeaderName?dataForm.buildingLeaderName:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">楼长电话:</span> |
|||
<span>{{ dataForm.buildingLeaderMobile?dataForm.buildingLeaderMobile:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">详细地址:</span> |
|||
<span>{{ dataForm.coordinatePosition?dataForm.coordinatePosition:'--' }}</span> |
|||
</div> |
|||
|
|||
<div v-if="dataForm.coordinatePosition" |
|||
class="info-prop"> |
|||
<span class="info-title-2">地图位置:</span> |
|||
<div class="div_map"> |
|||
|
|||
<div id="app_detail"></div> |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from '@/js/dai/request' |
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
|
|||
btnDisable: false, |
|||
initLoading: false, |
|||
|
|||
dataForm: { |
|||
agencyId: '', // 所属组织ID |
|||
agencyName: '', |
|||
gridId: '', //所属网格ID |
|||
neighborHoodId: '',//所属小区id |
|||
buildingName: '',//房屋名称 |
|||
// sort: 0,//排序 |
|||
totalUnitNum: 1,//单元数 |
|||
totalFloorNum: 0,//层数 |
|||
totalHouseNum: 0,//总户数 |
|||
realPerson: 0, |
|||
buildingLeaderName: '',//楼长姓名 |
|||
buildingLeaderMobile: '',//楼长电话 |
|||
type: '',//房屋类型 |
|||
coordinatePosition: '', |
|||
sysCoding: '', |
|||
coding: '', |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '' //纬度 |
|||
}, |
|||
|
|||
agencyObj: {}, |
|||
|
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
|
|||
}, |
|||
|
|||
methods: { |
|||
diaDestroy () { |
|||
if (map) { |
|||
map.destroy() |
|||
} |
|||
}, |
|||
async initForm (row, agencyObj) { |
|||
|
|||
this.dataForm = JSON.parse(JSON.stringify(row)) |
|||
this.agencyObj = agencyObj |
|||
|
|||
this.initLoading = true |
|||
|
|||
this.$nextTick(() => { |
|||
this.initMap() |
|||
}) |
|||
|
|||
|
|||
|
|||
}, |
|||
|
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
console.log('lat' + latitude + ',lon' + longitude) |
|||
|
|||
if (this.dataForm.latitude && this.dataForm.longitude) { |
|||
latitude = this.dataForm.latitude |
|||
longitude = this.dataForm.longitude |
|||
} |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(latitude, longitude); |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app_detail'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
this.handleMoveCenter() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.keyWords, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng }, |
|||
address |
|||
} = data[0] |
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.dataForm.latitude = lat |
|||
this.dataForm.longitude = lng |
|||
this.dataForm.coordinatePosition = address |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.dataForm.latitude = lat |
|||
this.dataForm.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
}, |
|||
resetData () { |
|||
|
|||
this.buildType = '1' |
|||
this.dataForm = { |
|||
agencyId: '', // 所属组织ID |
|||
agencyName: '', |
|||
gridId: '', //所属网格ID |
|||
neighborHoodId: '',//所属小区id |
|||
buildingName: '',//房屋名称 |
|||
// sort: 0,//排序 |
|||
totalUnitNum: 1,//单元数 |
|||
totalFloorNum: 0,//层数 |
|||
totalHouseNum: 0,//总户数 |
|||
realPerson: 0, |
|||
buildingLeaderName: '',//楼长姓名 |
|||
buildingLeaderMobile: '',//楼长电话 |
|||
type: '',//房屋类型 |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '', //纬度 |
|||
coding: '', |
|||
sysCoding: '', |
|||
coordinatePosition: '' |
|||
} |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
buildingName: [ |
|||
{ required: true, message: '楼栋名称不能为空', trigger: 'blur' }, |
|||
{ |
|||
min: 1, |
|||
max: 10, |
|||
message: '小区名称长度在 1 到 10个字符', |
|||
trigger: 'blur' |
|||
} |
|||
], |
|||
type: [ |
|||
{ required: true, message: '楼栋类型不能为空', trigger: 'blur' } |
|||
], |
|||
totalUnitNum: [ |
|||
{ required: true, message: '单元数不能为空', trigger: 'blur' } |
|||
], |
|||
coding: [ |
|||
{ required: true, message: '楼栋编码不能为空', trigger: 'blur' } |
|||
] |
|||
// totalFloorNum: [ |
|||
// { required: true, message: '层数不能为空', trigger: 'blur' } |
|||
// ], |
|||
// totalHouseNum: [ |
|||
// { required: true, message: '户数不能为空', trigger: 'blur' } |
|||
// ], |
|||
// longitude: [ |
|||
// { required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
// ], |
|||
} |
|||
}, |
|||
|
|||
}, |
|||
props: {} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/management/detail-main.scss"; |
|||
</style> |
@ -0,0 +1,298 @@ |
|||
<template> |
|||
<div> |
|||
<div class="dialog-h-content scroll-h"> |
|||
|
|||
<div v-if="initLoading" |
|||
class="m-row"> |
|||
<div class="m-info"> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">所属组织:</span> |
|||
<span>{{ dataForm.agencyName }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">所属网格:</span> |
|||
<span>{{ dataForm.gridName?dataForm.gridName:'--' }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">小区名称:</span> |
|||
<span>{{ dataForm.neighborHoodName}}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">小区编码:</span> |
|||
<span>{{ dataForm.coding?dataForm.coding:'--'}}</span> |
|||
</div> |
|||
|
|||
<div v-if="dataForm.qrcodeUrl" |
|||
style="display: flex;flex-direction: column;"> |
|||
<img style="margin-left: 70px;width: 200px;" |
|||
:src="dataForm.qrcodeUrl"> |
|||
<a style="margin-left: 80px" |
|||
:href="dataForm.qrcodeUrl" |
|||
target="_blank">下载</a> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">关联物业:</span> |
|||
<span>{{ dataForm.propertyName?dataForm.propertyName:'--'}}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">实有楼栋:</span> |
|||
<span>{{dataForm.realBuilding?dataForm.realBuilding:0 }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">详细地址:</span> |
|||
<span>{{ dataForm.address }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">地图位置:</span> |
|||
<div class="div_map"> |
|||
|
|||
<div id="app_detail"></div> |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from '@/js/dai/request' |
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
|
|||
btnDisable: false, |
|||
initLoading: false, |
|||
|
|||
dataForm: { |
|||
neighborHoodName: '', // 小区名称【不超过50字】 |
|||
agencyId: '', // 所属组织ID |
|||
agencyName: '', |
|||
gridId: '', //所属网格ID |
|||
propertyId: '', //关联物业 |
|||
address: '', //详细地址 |
|||
remark: '', //备注【最大500字】 |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '', //纬度 |
|||
realBuilding: 0, |
|||
coding: '', |
|||
sysCoding: '' |
|||
}, |
|||
|
|||
|
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
|
|||
}, |
|||
|
|||
methods: { |
|||
diaDestroy () { |
|||
if (map) { |
|||
map.destroy() |
|||
} |
|||
}, |
|||
|
|||
async initForm (row) { |
|||
this.dataForm = JSON.parse(JSON.stringify(row)) |
|||
|
|||
this.initLoading = true |
|||
|
|||
this.$nextTick(() => { |
|||
this.initMap() |
|||
}) |
|||
|
|||
}, |
|||
|
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
// 定义地图中心点坐标 |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
console.log('lat' + latitude + ',lon' + longitude) |
|||
|
|||
if (this.dataForm.latitude && this.dataForm.longitude) { |
|||
latitude = this.dataForm.latitude |
|||
longitude = this.dataForm.longitude |
|||
} |
|||
if (!latitude || latitude == "" || latitude == "0") { |
|||
latitude = 39.9088810666821; |
|||
longitude = 116.39743841556731; |
|||
} |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(latitude, longitude); |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app_detail'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
|
|||
search = new window.TMap.service.Search({ pageSize: 10 }) |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [] |
|||
}) |
|||
infoWindowList = Array(10) |
|||
|
|||
// 监听地图平移结束 |
|||
map.on('panend', () => { |
|||
this.handleMoveCenter() |
|||
}) |
|||
this.handleMoveCenter() |
|||
}, |
|||
|
|||
setMarker (lat, lng) { |
|||
markers.setGeometries([]) |
|||
markers.add([ |
|||
{ |
|||
id: '4', |
|||
styleId: 'marker', |
|||
position: new TMap.LatLng(lat, lng), |
|||
properties: { |
|||
title: 'marker4' |
|||
} |
|||
} |
|||
]) |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close() |
|||
}) |
|||
infoWindowList.length = 0 |
|||
markers.setGeometries([]) |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.keyWords, |
|||
bounds: map.getBounds() |
|||
}) |
|||
.then((result) => { |
|||
let { data } = result |
|||
if (Array.isArray(data) && data.length > 0) { |
|||
const { |
|||
location: { lat, lng } |
|||
} = data[0] |
|||
map.setCenter(new TMap.LatLng(lat, lng)) |
|||
this.setMarker(lat, lng) |
|||
this.dataForm.latitude = lat |
|||
this.dataForm.longitude = lng |
|||
} else { |
|||
this.$message.error('未检索到相关位置坐标') |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const center = map.getCenter() |
|||
const lat = center.getLat() |
|||
const lng = center.getLng() |
|||
this.dataForm.latitude = lat |
|||
this.dataForm.longitude = lng |
|||
this.setMarker(lat, lng) |
|||
}, |
|||
|
|||
|
|||
|
|||
resetData () { |
|||
|
|||
this.dataForm = { |
|||
neighborHoodName: '', // 小区名称【不超过50字】 |
|||
agencyId: '', // 所属组织ID |
|||
agencyName: '', |
|||
gridId: '', //所属网格ID |
|||
propertyId: '', //关联物业 |
|||
address: '', //详细地址 |
|||
remark: '', //备注【最大500字】 |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '', //纬度 |
|||
realBuilding: 0, |
|||
coding: '', |
|||
sysCoding: '' |
|||
} |
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
neighborHoodName: [ |
|||
{ required: true, message: '小区名称不能为空', trigger: 'blur' }, |
|||
{ |
|||
min: 1, |
|||
max: 50, |
|||
message: '小区名称长度在 1 到 50个字符', |
|||
trigger: 'blur' |
|||
} |
|||
], |
|||
agencyId: [ |
|||
{ required: true, message: '所属组织不能为空', trigger: 'blur' } |
|||
], |
|||
gridId: [ |
|||
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|||
], |
|||
coding: [ |
|||
{ required: true, message: '小区编码不能为空', trigger: 'blur' } |
|||
], |
|||
address: [ |
|||
{ required: true, message: '详细地址不能为空', trigger: 'blur' } |
|||
], |
|||
longitude: [ |
|||
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
propertyRule () { |
|||
name: [ |
|||
{ required: true, message: '物业名称不能为空', trigger: 'blur' } |
|||
// { min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
props: {} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/management/detail-main.scss"; |
|||
</style> |
|||
|
|||
|
|||
|
@ -0,0 +1,261 @@ |
|||
<template> |
|||
<div> |
|||
<div class="dialog-h-content scroll-h"> |
|||
|
|||
<div v-if="initLoading" |
|||
class="m-row"> |
|||
<div class="m-info"> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">所属楼栋:</span> |
|||
<span>{{ agencyObj.neighborHoodName }}-{{agencyObj.label}}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">单元号:</span> |
|||
<span>{{ dataForm.unitName?dataForm.unitName:'--' }}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">门牌号:</span> |
|||
<span>{{ dataForm.doorName}}</span> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">房屋编码:</span> |
|||
<span>{{ dataForm.coding?dataForm.coding:'--'}}</span> |
|||
</div> |
|||
<div v-if="dataForm.houseQrcodeUrl" |
|||
style="display: flex;flex-direction: column;"> |
|||
<img style="margin-left: 70px;width: 200px;" |
|||
:src="dataForm.houseQrcodeUrl"> |
|||
<a style="margin-left: 80px" |
|||
:href="dataForm.houseQrcodeUrl" |
|||
target="_blank">下载</a> |
|||
</div> |
|||
|
|||
<div class="info-prop"> |
|||
<span class="info-title-2">房屋类型:</span> |
|||
<span>{{dataForm.houseTypeName?dataForm.houseTypeName:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">房屋用途:</span> |
|||
<span>{{dataForm.purposeName?dataForm.purposeName:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">房屋状态:</span> |
|||
<span>{{dataForm.rentName?dataForm.rentName:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">房主姓名:</span> |
|||
<span>{{dataForm.ownerName?dataForm.ownerName:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">联系方式:</span> |
|||
<span>{{dataForm.ownerPhone?dataForm.ownerPhone:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">房主身份证:</span> |
|||
<span>{{dataForm.ownerIdCard?dataForm.ownerIdCard:'--' }}</span> |
|||
</div> |
|||
<div class="info-prop"> |
|||
<span class="info-title-2">备注:</span> |
|||
<span>{{dataForm.remark?dataForm.remark:'--' }}</span> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost, requestGet } from '@/js/dai/request' |
|||
|
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|||
btnDisable: false, |
|||
initLoading: false, |
|||
unitList: [], |
|||
|
|||
houseId: '', //房屋ID |
|||
houseType: '1', |
|||
purpose: '1', |
|||
rentFlag: 0, |
|||
dataForm: { |
|||
neighborHoodId: '', // 所属小区ID |
|||
buildingId: '',//所属楼栋ID |
|||
buildingUnitId: '',//所属单元ID |
|||
doorName: '',//门牌号 |
|||
houseType: '',//房屋类型【楼房,平房,别墅】 |
|||
purpose: '',//房屋用途【住宅,商业,办公,工业,仓储,商住混用,其他】 |
|||
rentFlag: 0,//房屋状态【是:1,否:0】 出租1、闲置2、自住 0 |
|||
ownerPhone: '', //联系方式 |
|||
ownerName: '', //房主名字 |
|||
ownerIdCard: '', //房主身份证 |
|||
remark: '', |
|||
// realPerson: 0, |
|||
coding: '', |
|||
sysCoding: '' |
|||
}, |
|||
|
|||
keyWords: '', |
|||
agencyObj: {}, |
|||
|
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
|
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
diaDestroy () { |
|||
if (map) { |
|||
map.destroy() |
|||
} |
|||
}, |
|||
async initForm (row, agencyObj) { |
|||
|
|||
|
|||
// this.dataForm = JSON.parse(JSON.stringify(row)) |
|||
this.agencyObj = agencyObj |
|||
this.houseId = row.houseId |
|||
await this.loadHouseInfo() |
|||
this.initLoading = true |
|||
|
|||
|
|||
|
|||
|
|||
// this.$refs.ref_form.resetFields(); |
|||
// this.agencyObj = agencyObj |
|||
// this.formType = type |
|||
// console.log('agencyObj-----', agencyObj) |
|||
// if (row) { |
|||
|
|||
// this.houseId = row.houseId |
|||
// await this.loadHouseInfo() |
|||
|
|||
|
|||
// } else { |
|||
|
|||
// this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId |
|||
// this.dataForm.buildingId = this.agencyObj.id |
|||
// } |
|||
|
|||
|
|||
// await this.loadUnitList() |
|||
|
|||
}, |
|||
|
|||
async loadHouseInfo () { |
|||
|
|||
const url = "/gov/org/ichouse/" + this.houseId |
|||
|
|||
const { data, code, msg } = await requestGet(url) |
|||
|
|||
if (code === 0) { |
|||
// debugger |
|||
this.dataForm = { ...data } |
|||
|
|||
this.houseType = this.dataForm.houseType |
|||
this.purpose = this.dataForm.purpose |
|||
this.rentFlag = parseInt(this.dataForm.rentFlag) |
|||
|
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
|
|||
|
|||
resetData () { |
|||
this.houseId = '' //房屋ID |
|||
this.houseType = '1' |
|||
this.purpose = '1' |
|||
this.rentFlag = 0 |
|||
this.dataForm = { |
|||
neighborHoodId: '', // 所属小区ID |
|||
buildingId: '',//所属楼栋ID |
|||
buildingUnitId: '',//所属单元ID |
|||
doorName: '',//门牌号 |
|||
houseType: '1',//房屋类型【楼房,平房,别墅】 |
|||
purpose: '1',//房屋用途【住宅,商业,办公,工业,仓储,商住混用,其他】 |
|||
rentFlag: 0,//是否出租【是:1,否:0】 |
|||
ownerPhone: '', //联系方式 |
|||
ownerName: '', //房主名字 |
|||
ownerIdCard: '', //房主身份证 |
|||
remark: '', // 备注 |
|||
coding: '', |
|||
sysCoding: '' |
|||
} |
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
buildingUnitId: [ |
|||
{ required: true, message: '所属单元不能为空', trigger: 'blur' }, |
|||
], |
|||
doorName: [ |
|||
{ required: true, message: '门牌号不能为空', trigger: 'blur' } |
|||
], |
|||
coding: [ |
|||
{ required: true, message: '房屋编码不能为空', trigger: 'blur' } |
|||
], |
|||
houseType: [ |
|||
{ required: true, message: '房屋类型不能为空', trigger: 'blur' } |
|||
], |
|||
purpose: [ |
|||
{ required: true, message: '房屋用途不能为空', trigger: 'blur' } |
|||
], |
|||
rentFlag: [ |
|||
{ required: true, message: '是否出租不能为空', trigger: 'blur' } |
|||
], |
|||
ownerPhone: [ |
|||
{ required: false } |
|||
], |
|||
ownerName: [ |
|||
{ required: false } |
|||
], |
|||
ownerIdCard: [ |
|||
{ required: false } |
|||
], |
|||
remark: [ |
|||
{ required: false } |
|||
], |
|||
} |
|||
}, |
|||
|
|||
}, |
|||
props: {} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
@import "@/assets/scss/modules/management/detail-main.scss"; |
|||
</style> |
Loading…
Reference in new issue