diff --git a/.env.development b/.env.development index de7243a..00ae071 100644 --- a/.env.development +++ b/.env.development @@ -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 diff --git a/src/api/system/communityInfo.js b/src/api/system/communityInfo.js index fe19e17..5433056 100644 --- a/src/api/system/communityInfo.js +++ b/src/api/system/communityInfo.js @@ -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({ diff --git a/src/views/system/communityInfo/index.vue b/src/views/system/communityInfo/index.vue index 3a600ec..8896028 100644 --- a/src/views/system/communityInfo/index.vue +++ b/src/views/system/communityInfo/index.vue @@ -238,7 +238,7 @@ v-for="(item, index) in form.communityInfoList" :key="index" style="margin-top: 20px; border-bottom: 1px solid #f3f3f3" - + > - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -386,6 +445,7 @@ v-model="form.communityLongitude" placeholder="请输入社区经度" maxlength="20" + style="width:200px" /> @@ -393,6 +453,7 @@ v-model="form.communityLatitude" placeholder="请输入社区纬度" maxlength="20" + style="width:200px" /> @@ -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 {