社区 修改
This commit is contained in:
parent
9f4aff70ea
commit
8cf9f1c569
@ -6,7 +6,7 @@ ENV = 'development'
|
||||
|
||||
# 全医通护理站管理平台/开发环境
|
||||
# VUE_APP_BASE_API = '/dev-api'
|
||||
VUE_APP_BASE_API = 'http://192.168.16.64:8080'
|
||||
VUE_APP_BASE_API = 'http://192.168.16.85:8081'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@ -31,6 +31,13 @@ export function SecondaryLevelInfo(id) {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//省市区
|
||||
export function SubordinateRegions(Code) {
|
||||
return request({
|
||||
url: `/system/area/getSubordinateRegions?areaCode=${Code}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 新增居住社区信息
|
||||
export function addCommunityInfo(data) {
|
||||
return request({
|
||||
|
||||
@ -238,7 +238,7 @@
|
||||
v-for="(item, index) in form.communityInfoList"
|
||||
:key="index"
|
||||
style="margin-top: 20px; border-bottom: 1px solid #f3f3f3"
|
||||
|
||||
|
||||
>
|
||||
<el-form-item
|
||||
label="所属区域"
|
||||
@ -362,23 +362,82 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改居住社区信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<!-- <el-form-item label="所属区域编码" prop="areaCode">
|
||||
<el-input v-model="form.areaCode" placeholder="请输入所属区域编码" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="所属区域" prop="areaCode">
|
||||
<el-dialog :title="title" :visible.sync="open" width="1060px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true">
|
||||
<!-- <el-form-item label="所属区域" prop="areaCode">
|
||||
<el-input
|
||||
v-model="form.areaName"
|
||||
placeholder="请输入所属区域"
|
||||
maxlength="20"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item
|
||||
label="所属区域"
|
||||
prop="areaCode"
|
||||
>
|
||||
<el-select v-model="form.province" clearable placeholder="请选择省" >
|
||||
<el-option
|
||||
v-for="item in arealist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="province3(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-select
|
||||
v-model="form.city"
|
||||
clearable
|
||||
placeholder="请选择市"
|
||||
style="margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in citylist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickcity3(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="form.area"
|
||||
clearable
|
||||
placeholder="请选择区"
|
||||
style="margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in arealists"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
@click.native="clickarea3(item)"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="form.areaCode"
|
||||
clearable
|
||||
placeholder="请选择街道"
|
||||
style="margin-left: 10px"
|
||||
|
||||
>
|
||||
<el-option
|
||||
v-for="item in streetlist"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="社区名称" prop="communityName">
|
||||
<el-input
|
||||
v-model="form.communityName"
|
||||
placeholder="请输入社区名称"
|
||||
maxlength="30"
|
||||
style="width:200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社区经度" prop="communityLongitude">
|
||||
@ -386,6 +445,7 @@
|
||||
v-model="form.communityLongitude"
|
||||
placeholder="请输入社区经度"
|
||||
maxlength="20"
|
||||
style="width:200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社区纬度" prop="communityLatitude">
|
||||
@ -393,6 +453,7 @@
|
||||
v-model="form.communityLatitude"
|
||||
placeholder="请输入社区纬度"
|
||||
maxlength="20"
|
||||
style="width:200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -413,6 +474,7 @@ import {
|
||||
updateCommunityInfo,
|
||||
FirstLevels,
|
||||
SecondaryLevelInfo,
|
||||
SubordinateRegions,
|
||||
} from "@/api/system/communityInfo";
|
||||
|
||||
export default {
|
||||
@ -561,7 +623,7 @@ export default {
|
||||
this.queryParams.areaCode = "";
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.SecondaryLevelInfolist = res.data;
|
||||
// this.SecondaryLevelInfolist = res.data;
|
||||
// console.log(this.SecondaryLevelInfolist);
|
||||
this.citylist = res.data;
|
||||
});
|
||||
@ -574,7 +636,21 @@ export default {
|
||||
console.log(item);
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.SecondaryLevelInfolist = res.data;
|
||||
// this.SecondaryLevelInfolist = res.data;
|
||||
// console.log(this.SecondaryLevelInfolist);
|
||||
this.citylist = res.data;
|
||||
});
|
||||
},
|
||||
// 修改
|
||||
province3(item) {
|
||||
// this.form.xxx[index].code=''
|
||||
console.log(item);
|
||||
this.form.city = "";
|
||||
this.form.area = "";
|
||||
this.form.areaCode = "";
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
// this.SecondaryLevelInfolist = res.data;
|
||||
// console.log(this.SecondaryLevelInfolist);
|
||||
this.citylist = res.data;
|
||||
});
|
||||
@ -583,6 +659,8 @@ export default {
|
||||
clickcity(item) {
|
||||
console.log(item);
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
this.queryParams.area = "";
|
||||
this.queryParams.areaCode = "";
|
||||
console.log(res);
|
||||
this.arealists = res.data;
|
||||
});
|
||||
@ -593,14 +671,27 @@ export default {
|
||||
// this.queryParams.areaCode = "";
|
||||
// this.value2 = "";
|
||||
// this.value3 = "";
|
||||
this.form.communityInfoList[index].area = "";
|
||||
this.form.communityInfoList[index].areaCode = "";
|
||||
console.log(item);
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.arealists = res.data;
|
||||
});
|
||||
},
|
||||
// 修改
|
||||
clickcity3(item) {
|
||||
console.log(item);
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
this.form.area = "";
|
||||
this.form.areaCode = "";
|
||||
console.log(res);
|
||||
this.arealists = res.data;
|
||||
});
|
||||
},
|
||||
//点击区县城
|
||||
clickarea(item) {
|
||||
this.queryParams.areaCode = "";
|
||||
// this.queryParams.areaCode = "";
|
||||
// this.value3 = "";
|
||||
console.log(item);
|
||||
@ -613,6 +704,19 @@ export default {
|
||||
clickarea2(item, index) {
|
||||
// this.queryParams.areaCode = "";
|
||||
// this.value3 = "";
|
||||
|
||||
this.form.communityInfoList[index].areaCode = "";
|
||||
console.log(item);
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
this.streetlist = res.data;
|
||||
});
|
||||
},
|
||||
|
||||
clickarea3(item) {
|
||||
this.form.areaCode = "";
|
||||
// this.queryParams.areaCode = "";
|
||||
// this.value3 = "";
|
||||
console.log(item);
|
||||
SecondaryLevelInfo(item.id).then((res) => {
|
||||
console.log(res);
|
||||
@ -624,6 +728,10 @@ export default {
|
||||
this.queryParams.areaCode = item.areaCode;
|
||||
console.log(this.queryParams);
|
||||
},
|
||||
// clickstreet3(item) {
|
||||
// this.form.areaCode = item.areaCode;
|
||||
// // console.log(this.queryParams);
|
||||
// },
|
||||
// 所属省下拉框
|
||||
loadMore() {
|
||||
console.log("1");
|
||||
@ -717,6 +825,10 @@ export default {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
// this.arealist="",
|
||||
this.arealists="",
|
||||
this.streetlist="",
|
||||
this.citylist="",
|
||||
(this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@ -750,8 +862,22 @@ export default {
|
||||
const id = row.id || this.ids;
|
||||
getCommunityInfo(id).then((response) => {
|
||||
this.form = response.data;
|
||||
// this.form.province=response.data;
|
||||
// this.form.city=response.data;
|
||||
// this.form.area=response.data;
|
||||
// this.form.areaCode=response.data;
|
||||
this.open = true;
|
||||
this.title = "修改居住社区信息";
|
||||
SubordinateRegions(response.data.areaCode).then((res) => {
|
||||
console.log(res)
|
||||
if(res.data!==null){
|
||||
this.form.province = res.data.provinceCode;
|
||||
this.form.city = res.data.cityName;
|
||||
this.form.area = res.data.regionName;
|
||||
this.form.areaCode = res.data.streetName;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@ -762,7 +888,7 @@ export default {
|
||||
updateCommunityInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
|
||||
this.open2 = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user