|
|
@ -2,328 +2,403 @@ |
|
|
|
<div> |
|
|
|
<div class="dialog-h-content scroll-h"> |
|
|
|
<div v-show="!propertyFormShow"> |
|
|
|
<el-form ref="ref_form" |
|
|
|
<el-form |
|
|
|
ref="ref_form" |
|
|
|
:inline="true" |
|
|
|
:model="dataForm" |
|
|
|
:rules="dataRule" |
|
|
|
class="form"> |
|
|
|
|
|
|
|
<el-form-item label="所属组织" |
|
|
|
class="form" |
|
|
|
> |
|
|
|
<el-form-item |
|
|
|
label="所属组织" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<span>{{ dataForm.agencyName }}</span> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属网格" |
|
|
|
<el-form-item |
|
|
|
label="所属网格" |
|
|
|
prop="gridId" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-select class="item_width_1" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
class="item_width_1" |
|
|
|
v-model="dataForm.gridId" |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in gridList" |
|
|
|
clearable |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in gridList" |
|
|
|
:key="item.gridId" |
|
|
|
:label="item.gridName" |
|
|
|
:value="item.gridId"> |
|
|
|
:value="item.gridId" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="小区名称" |
|
|
|
<el-form-item |
|
|
|
label="小区名称" |
|
|
|
prop="neighborHoodName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入小区名称" |
|
|
|
v-model="dataForm.neighborHoodName"> |
|
|
|
v-model="dataForm.neighborHoodName" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="小区编码" |
|
|
|
<el-form-item |
|
|
|
label="小区编码" |
|
|
|
prop="coding" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_2" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_2" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入楼栋编码" |
|
|
|
v-model="dataForm.coding"> |
|
|
|
|
|
|
|
v-model="dataForm.coding" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
<el-button |
|
|
|
style="margin-left: 10px" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
@click="handleCode">生成</el-button> |
|
|
|
@click="handleCode" |
|
|
|
>生成</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<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" |
|
|
|
<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> |
|
|
|
target="_blank" |
|
|
|
>下载</a |
|
|
|
> |
|
|
|
</div> |
|
|
|
<el-form-item label="关联物业" |
|
|
|
<el-form-item |
|
|
|
label="关联物业" |
|
|
|
prop="propertyId" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-select class="item_width_2" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
class="item_width_2" |
|
|
|
v-model="dataForm.propertyId" |
|
|
|
placeholder="请选择" |
|
|
|
filterable |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in propertyList" |
|
|
|
clearable |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in propertyList" |
|
|
|
:key="item.propertyId" |
|
|
|
:label="item.propertyName" |
|
|
|
:value="item.propertyId"> |
|
|
|
:value="item.propertyId" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
<el-button |
|
|
|
style="margin-left: 10px" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
@click="handleAddProperty">添加物业</el-button> |
|
|
|
@click="handleAddProperty" |
|
|
|
>添加物业</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="实有楼栋" |
|
|
|
<el-form-item |
|
|
|
label="实有楼栋" |
|
|
|
style="display: block" |
|
|
|
prop="realBuilding" |
|
|
|
label-width="150px"> |
|
|
|
<el-input-number class="item_width_4" |
|
|
|
label-width="150px" |
|
|
|
> |
|
|
|
<el-input-number |
|
|
|
class="item_width_4" |
|
|
|
v-model="dataForm.realBuilding" |
|
|
|
:min="0" |
|
|
|
:max="9999" |
|
|
|
label="总户数"></el-input-number> |
|
|
|
label="总户数" |
|
|
|
></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="地图位置" |
|
|
|
<el-form-item |
|
|
|
label="地图位置" |
|
|
|
prop="longitude" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<div style="width: 500px"> |
|
|
|
<el-select v-model="searchValue" |
|
|
|
<el-select |
|
|
|
v-model="searchValue" |
|
|
|
filterable |
|
|
|
style="width: 500px" |
|
|
|
remote |
|
|
|
:reserve-keyword="true" |
|
|
|
placeholder="请输入关键词" |
|
|
|
:remote-method="remoteMethod" |
|
|
|
:loading="loading"> |
|
|
|
<el-option v-for="(item,index) in searchOptions" |
|
|
|
:loading="loading" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in searchOptions" |
|
|
|
@click.native="handleClickKey(index)" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
:value="item.value" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<div id="app_community" |
|
|
|
class="div_map"></div> |
|
|
|
<div id="map" class="div_map"></div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="详细地址" |
|
|
|
<el-form-item |
|
|
|
label="详细地址" |
|
|
|
prop="address" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入详细地址" |
|
|
|
v-model="dataForm.address"> |
|
|
|
v-model="dataForm.address" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="备注" |
|
|
|
<el-form-item |
|
|
|
label="备注" |
|
|
|
prop="remark" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
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> |
|
|
|
v-model="dataForm.remark" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-show="propertyFormShow"> |
|
|
|
<el-form :inline="false" |
|
|
|
<el-form |
|
|
|
:inline="false" |
|
|
|
:model="propertyForm" |
|
|
|
:rules="propertyRule" |
|
|
|
class="form"> |
|
|
|
<el-form-item label="物业名称" |
|
|
|
class="form" |
|
|
|
> |
|
|
|
<el-form-item |
|
|
|
label="物业名称" |
|
|
|
prop="name" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
class="item_width_1" |
|
|
|
maxlength="10" |
|
|
|
placeholder="请输入小区名称" |
|
|
|
v-model="propertyForm.name"> |
|
|
|
v-model="propertyForm.name" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="div_btn"> |
|
|
|
<el-button size="small" |
|
|
|
@click="handleCancle">取 消</el-button> |
|
|
|
<el-button size="small" |
|
|
|
<el-button size="small" @click="handleCancle">取 消</el-button> |
|
|
|
<el-button |
|
|
|
size="small" |
|
|
|
type="primary" |
|
|
|
:disabled="btnDisable" |
|
|
|
@click="handleComfirm">确 定</el-button> |
|
|
|
@click="handleComfirm" |
|
|
|
>确 定</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { Loading } from 'element-ui' // 引入Loading服务 |
|
|
|
import { requestPost } from '@/js/dai/request' |
|
|
|
import daiMap from "@/utils/dai-map"; |
|
|
|
var map |
|
|
|
var search |
|
|
|
var markers |
|
|
|
var infoWindowList |
|
|
|
let loading // 加载动画 |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import daiMap from "@/utils/dai-map2"; |
|
|
|
|
|
|
|
var map; |
|
|
|
let loading; // 加载动画 |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
formType: "add", //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
searchOptions: [], |
|
|
|
searchValue: '', |
|
|
|
searchValue: "", |
|
|
|
resultList: [], |
|
|
|
loading: false, |
|
|
|
|
|
|
|
|
|
|
|
gridList: [], |
|
|
|
propertyList: [], |
|
|
|
btnDisable: false, |
|
|
|
|
|
|
|
neighborHoodId: '', //小区ID |
|
|
|
neighborHoodId: "", //小区ID |
|
|
|
dataForm: { |
|
|
|
neighborHoodName: '', // 小区名称【不超过50字】 |
|
|
|
agencyId: '', // 所属组织ID |
|
|
|
agencyName: '', |
|
|
|
gridId: '', //所属网格ID |
|
|
|
propertyId: '', //关联物业 |
|
|
|
address: '', //详细地址 |
|
|
|
remark: '', //备注【最大500字】 |
|
|
|
location: '', //坐标位置 |
|
|
|
longitude: '', //经度 |
|
|
|
latitude: '', //纬度 |
|
|
|
neighborHoodName: "", // 小区名称【不超过50字】 |
|
|
|
agencyId: "", // 所属组织ID |
|
|
|
agencyName: "", |
|
|
|
gridId: "", //所属网格ID |
|
|
|
propertyId: "", //关联物业 |
|
|
|
address: "", //详细地址 |
|
|
|
remark: "", //备注【最大500字】 |
|
|
|
location: "", //坐标位置 |
|
|
|
longitude: "", //经度 |
|
|
|
latitude: "", //纬度 |
|
|
|
realBuilding: 0, |
|
|
|
coding: '', |
|
|
|
sysCoding: '' |
|
|
|
coding: "", |
|
|
|
sysCoding: "", |
|
|
|
}, |
|
|
|
|
|
|
|
propertyFormShow: false, |
|
|
|
propertyForm: { |
|
|
|
name: '' |
|
|
|
name: "", |
|
|
|
}, |
|
|
|
|
|
|
|
keyWords: '', |
|
|
|
agencyObj: {} |
|
|
|
} |
|
|
|
keyWords: "", |
|
|
|
agencyObj: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
mounted () { |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
async initForm(type, row, agencyObj) { |
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
this.agencyObj = agencyObj |
|
|
|
this.agencyObj = agencyObj; |
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
this.formType = type |
|
|
|
this.formType = type; |
|
|
|
if (row) { |
|
|
|
this.dataForm = JSON.parse(JSON.stringify(row)) |
|
|
|
|
|
|
|
this.dataForm.neighborHoodId = this.dataForm.id |
|
|
|
this.neighborHoodId = this.dataForm.neighborHoodId |
|
|
|
|
|
|
|
this.dataForm = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
|
|
this.dataForm.neighborHoodId = this.dataForm.id; |
|
|
|
this.neighborHoodId = this.dataForm.neighborHoodId; |
|
|
|
} else { |
|
|
|
this.dataForm.latitude = latitude |
|
|
|
this.dataForm.longitude = longitude |
|
|
|
this.dataForm.latitude = latitude; |
|
|
|
this.dataForm.longitude = longitude; |
|
|
|
} |
|
|
|
if (!map) { |
|
|
|
this.initMap(this.dataForm.latitude, this.dataForm.longitude); |
|
|
|
this.$nextTick(() => { |
|
|
|
latitude = |
|
|
|
this.dataForm.latitude && this.dataForm.latitude != "0" |
|
|
|
? this.dataForm.latitude |
|
|
|
: latitude; |
|
|
|
longitude = |
|
|
|
this.dataForm.longitude && this.dataForm.longitude != "0" |
|
|
|
? this.dataForm.longitude |
|
|
|
: longitude; |
|
|
|
|
|
|
|
if (!this.mapLoaded) { |
|
|
|
this.initMap(latitude || latitude, longitude); |
|
|
|
this.mapLoaded = true; |
|
|
|
} else { |
|
|
|
map.setCenter(this.dataForm.latitude, this.dataForm.longitude); |
|
|
|
map.setMarker(this.dataForm.latitude, this.dataForm.longitude); |
|
|
|
map.setCenter(latitude, longitude); |
|
|
|
map.setMarker(latitude, longitude); |
|
|
|
} |
|
|
|
await this.loadAgency() |
|
|
|
await this.loadGrid() |
|
|
|
await this.loadProperty() |
|
|
|
}); |
|
|
|
await this.loadAgency(); |
|
|
|
await this.loadGrid(); |
|
|
|
await this.loadProperty(); |
|
|
|
}, |
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap(latitude, longitude) { |
|
|
|
|
|
|
|
map = new daiMap( |
|
|
|
document.getElementById("app_community"), |
|
|
|
document.getElementById("map"), |
|
|
|
{ latitude, longitude }, |
|
|
|
{ |
|
|
|
zoom: 16.2, // 设置地图缩放级别 |
|
|
|
pitch: 43.5, // 设置俯仰角 |
|
|
|
rotation: 45, // 设置地图旋转角度 |
|
|
|
// pitch: 43.5, // 设置俯仰角 |
|
|
|
// rotation: 45, // 设置地图旋转角度 |
|
|
|
// layers: "img_c,cva_c", |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
// 监听地图平移结束 |
|
|
|
map.on("dragend", (e) => { |
|
|
|
this.handleMoveCenter(e); |
|
|
|
//修改地图中心点 |
|
|
|
const { lat, lng } = map.getCenter(); |
|
|
|
this.handleMoveCenter(lat, lng); |
|
|
|
}); |
|
|
|
|
|
|
|
// 监听地图平移结束 |
|
|
|
map.on("click", (e) => { |
|
|
|
const { |
|
|
|
lnglat: { lat, lng }, |
|
|
|
} = e; |
|
|
|
this.handleMoveCenter(lat, lng); |
|
|
|
}); |
|
|
|
|
|
|
|
map.setCenter(latitude, longitude); |
|
|
|
map.setMarker(latitude, longitude); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async handleMoveCenter () { |
|
|
|
//修改地图中心点 |
|
|
|
const { lat, lng } = map.getCenter(); |
|
|
|
async handleMoveCenter(lat, lng) { |
|
|
|
this.dataForm.latitude = lat; |
|
|
|
this.dataForm.longitude = lng; |
|
|
|
map.setMarker(lat, lng); |
|
|
|
|
|
|
|
let { msg, data } = await map.getAddress(lat, lng); |
|
|
|
if (msg == "success") { |
|
|
|
this.dataForm.address = data.address |
|
|
|
this.searchValue = data.address |
|
|
|
this.searchOptions = [] |
|
|
|
|
|
|
|
this.dataForm.address = data.address; |
|
|
|
this.searchValue = data.address; |
|
|
|
this.searchOptions = []; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async remoteMethod(query) { |
|
|
|
|
|
|
|
if (query !== '') { |
|
|
|
if (query !== "") { |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
const { msg, data } = await map.searchNearby(query); |
|
|
|
this.loading = false; |
|
|
|
this.resultList = [] |
|
|
|
|
|
|
|
if (msg == "success" && data.resultList && data.resultList.length > 0) { |
|
|
|
this.resultList = []; |
|
|
|
|
|
|
|
if ( |
|
|
|
msg == "success" && |
|
|
|
data.resultList && |
|
|
|
data.resultList.length > 0 |
|
|
|
) { |
|
|
|
if (data.resultList && data.resultList.length > 0) { |
|
|
|
this.resultList = data.resultList |
|
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
|
return { value: `${item.hotPointID}`, label: `${item.address + item.name}` }; |
|
|
|
|
|
|
|
this.resultList = data.resultList; |
|
|
|
this.searchOptions = this.resultList.map((item) => { |
|
|
|
return { |
|
|
|
value: `${item.hotPointID}`, |
|
|
|
label: `${item.address + item.name}`, |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = [ |
|
|
|
{ |
|
|
|
value: '0', |
|
|
|
label: '未检索到结果' |
|
|
|
} |
|
|
|
] |
|
|
|
value: "0", |
|
|
|
label: "未检索到结果", |
|
|
|
}, |
|
|
|
]; |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = []; |
|
|
@ -331,246 +406,263 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleClickKey(index) { |
|
|
|
let selPosition = this.resultList[index] |
|
|
|
let lonlat = selPosition.lonlat.split(" ") |
|
|
|
let selPosition = this.resultList[index]; |
|
|
|
let lonlat = selPosition.lonlat.split(" "); |
|
|
|
map.setCenter(lonlat[1], lonlat[0]); |
|
|
|
map.setMarker(lonlat[1], lonlat[0]); |
|
|
|
this.dataForm.latitude = lonlat[1]; |
|
|
|
this.dataForm.longitude = lonlat[0]; |
|
|
|
this.dataForm.address = selPosition.address + selPosition.name |
|
|
|
this.dataForm.address = selPosition.address + selPosition.name; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async handleCode() { |
|
|
|
if (!this.dataForm.gridId) return this.$message.error('请选择网格') |
|
|
|
if (!this.dataForm.gridId) return this.$message.error("请选择网格"); |
|
|
|
const { data, code, msg } = await requestPost( |
|
|
|
"/gov/org/houseInformation/getNeighborHoodCoding/" + this.dataForm.gridId); |
|
|
|
"/gov/org/houseInformation/getNeighborHoodCoding/" + |
|
|
|
this.dataForm.gridId |
|
|
|
); |
|
|
|
if (msg == "success" && code == 0) { |
|
|
|
this.dataForm.coding = data.coding |
|
|
|
this.dataForm.sysCoding = data.sysCoding |
|
|
|
|
|
|
|
this.dataForm.coding = data.coding; |
|
|
|
this.dataForm.sysCoding = data.sysCoding; |
|
|
|
} |
|
|
|
}, |
|
|
|
//加载组织 |
|
|
|
async loadAgency() { |
|
|
|
const url = '/epmetuser/customerstaff/staffbasicinfo' |
|
|
|
let params = {} |
|
|
|
const url = "/epmetuser/customerstaff/staffbasicinfo"; |
|
|
|
let params = {}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.dataForm.agencyId = data.agencyId |
|
|
|
this.dataForm.agencyName = data.agencyName |
|
|
|
this.dataForm.agencyId = data.agencyId; |
|
|
|
this.dataForm.agencyName = data.agencyName; |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
//加载网格 |
|
|
|
async loadGrid() { |
|
|
|
const url = '/gov/org/grid/allgridsnopermission ' |
|
|
|
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 |
|
|
|
} |
|
|
|
agencyId: this.dataForm.agencyId, |
|
|
|
}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.gridList = data |
|
|
|
this.gridList = data; |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
//加载物业 |
|
|
|
async loadProperty() { |
|
|
|
const url = '/gov/org/propertymanagement/list' |
|
|
|
const url = "/gov/org/propertymanagement/list"; |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list" |
|
|
|
let params = {} |
|
|
|
let params = {}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.propertyList = data |
|
|
|
this.propertyList = data; |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleAddProperty() { |
|
|
|
this.propertyForm.name = '' |
|
|
|
this.propertyFormShow = true |
|
|
|
this.propertyForm.name = ""; |
|
|
|
this.propertyFormShow = true; |
|
|
|
}, |
|
|
|
|
|
|
|
async handleComfirm() { |
|
|
|
|
|
|
|
if (this.propertyFormShow) { |
|
|
|
|
|
|
|
this.addProperty() |
|
|
|
|
|
|
|
this.addProperty(); |
|
|
|
} else { |
|
|
|
this.btnDisable = true |
|
|
|
this.btnDisable = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.btnDisable = false |
|
|
|
}, 10000) |
|
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
|
this.btnDisable = false; |
|
|
|
}, 10000); |
|
|
|
this.$refs["ref_form"].validate((valid, messageObj) => { |
|
|
|
if (!valid) { |
|
|
|
app.util.validateRule(messageObj) |
|
|
|
this.btnDisable = false |
|
|
|
app.util.validateRule(messageObj); |
|
|
|
this.btnDisable = false; |
|
|
|
} else { |
|
|
|
this.addCommunity() |
|
|
|
this.addCommunity(); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
async addCommunity() { |
|
|
|
|
|
|
|
let url = '' |
|
|
|
if (this.formType === 'add') { |
|
|
|
url = '/gov/org/neighborhood/neighborhoodadd' |
|
|
|
let url = ""; |
|
|
|
if (this.formType === "add") { |
|
|
|
url = "/gov/org/neighborhood/neighborhoodadd"; |
|
|
|
// url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|
|
|
} else { |
|
|
|
url = '/gov/org/neighborhood/neighborhoodupdate' |
|
|
|
url = "/gov/org/neighborhood/neighborhoodupdate"; |
|
|
|
|
|
|
|
this.dataForm.neighborHoodId = this.neighborHoodId |
|
|
|
this.dataForm.neighborHoodId = this.neighborHoodId; |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, this.dataForm) |
|
|
|
const { data, code, msg } = await requestPost(url, this.dataForm); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功' |
|
|
|
}) |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogOk') |
|
|
|
this.btnDisable = false |
|
|
|
type: "success", |
|
|
|
message: "操作成功", |
|
|
|
}); |
|
|
|
this.resetData(); |
|
|
|
this.$emit("dialogOk"); |
|
|
|
this.btnDisable = false; |
|
|
|
} else { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(msg) |
|
|
|
this.btnDisable = false; |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async addProperty() { |
|
|
|
if (!this.propertyForm.name || this.propertyForm.name === '') { |
|
|
|
if (!this.propertyForm.name || this.propertyForm.name === "") { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: '物业名称不能为空' |
|
|
|
}) |
|
|
|
return false |
|
|
|
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" |
|
|
|
let params = { |
|
|
|
name: this.propertyForm.name |
|
|
|
} |
|
|
|
name: this.propertyForm.name, |
|
|
|
}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功' |
|
|
|
}) |
|
|
|
|
|
|
|
type: "success", |
|
|
|
message: "操作成功", |
|
|
|
}); |
|
|
|
|
|
|
|
this.propertyForm.name = '' |
|
|
|
this.propertyFormShow = false |
|
|
|
this.loadProperty() |
|
|
|
this.propertyForm.name = ""; |
|
|
|
this.propertyFormShow = false; |
|
|
|
this.loadProperty(); |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleCancle() { |
|
|
|
if (this.propertyFormShow) { |
|
|
|
this.propertyForm.name = '' |
|
|
|
this.propertyFormShow = false |
|
|
|
this.propertyForm.name = ""; |
|
|
|
this.propertyFormShow = false; |
|
|
|
} else { |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogCancle') |
|
|
|
this.resetData(); |
|
|
|
this.$emit("dialogCancle"); |
|
|
|
} |
|
|
|
}, |
|
|
|
resetData() { |
|
|
|
this.searchValue = '' |
|
|
|
this.searchOptions = [] |
|
|
|
this.resultList = [] |
|
|
|
this.neighborHoodId = '' //小区ID |
|
|
|
this.searchValue = ""; |
|
|
|
this.searchOptions = []; |
|
|
|
this.resultList = []; |
|
|
|
this.neighborHoodId = ""; //小区ID |
|
|
|
this.dataForm = { |
|
|
|
neighborHoodName: '', // 小区名称【不超过50字】 |
|
|
|
agencyId: '', // 所属组织ID |
|
|
|
agencyName: '', |
|
|
|
gridId: '', //所属网格ID |
|
|
|
propertyId: '', //关联物业 |
|
|
|
address: '', //详细地址 |
|
|
|
remark: '', //备注【最大500字】 |
|
|
|
location: '', //坐标位置 |
|
|
|
longitude: '', //经度 |
|
|
|
latitude: '', //纬度 |
|
|
|
neighborHoodName: "", // 小区名称【不超过50字】 |
|
|
|
agencyId: "", // 所属组织ID |
|
|
|
agencyName: "", |
|
|
|
gridId: "", //所属网格ID |
|
|
|
propertyId: "", //关联物业 |
|
|
|
address: "", //详细地址 |
|
|
|
remark: "", //备注【最大500字】 |
|
|
|
location: "", //坐标位置 |
|
|
|
longitude: "", //经度 |
|
|
|
latitude: "", //纬度 |
|
|
|
realBuilding: 0, |
|
|
|
coding: '', |
|
|
|
sysCoding: '' |
|
|
|
} |
|
|
|
this.propertyFormShow = false |
|
|
|
coding: "", |
|
|
|
sysCoding: "", |
|
|
|
}; |
|
|
|
this.propertyFormShow = false; |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading() { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: '正在加载……', // 加载中需要显示的文字 |
|
|
|
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|
|
|
}) |
|
|
|
text: "正在加载……", // 加载中需要显示的文字 |
|
|
|
background: "rgba(0,0,0,.7)", // 背景颜色 |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading() { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
loading.close(); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule() { |
|
|
|
return { |
|
|
|
neighborHoodName: [ |
|
|
|
{ required: true, message: '小区名称不能为空', trigger: 'blur' }, |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "小区名称不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
{ |
|
|
|
min: 1, |
|
|
|
max: 50, |
|
|
|
message: '小区名称长度在 1 到 50个字符', |
|
|
|
trigger: 'blur' |
|
|
|
} |
|
|
|
message: "小区名称长度在 1 到 50个字符", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
agencyId: [ |
|
|
|
{ required: true, message: '所属组织不能为空', trigger: 'blur' } |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "所属组织不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
gridId: [ |
|
|
|
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "所属网格不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
coding: [ |
|
|
|
{ required: true, message: '小区编码不能为空', trigger: 'blur' } |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "小区编码不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
address: [ |
|
|
|
{ required: true, message: '详细地址不能为空', trigger: 'blur' } |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "详细地址不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
longitude: [ |
|
|
|
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "坐标不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
}; |
|
|
|
}, |
|
|
|
propertyRule() { |
|
|
|
name: [ |
|
|
|
{ required: true, message: '物业名称不能为空', trigger: 'blur' } |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "物业名称不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
// { min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
|
]; |
|
|
|
}, |
|
|
|
props: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
props: {}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|