Browse Source

11

wulanhaote
liuminjian 3 years ago
parent
commit
74022216ca
2 changed files with 60 additions and 35 deletions
  1. +18
    -0
      src/api/homestead/index.js
  2. +42
    -35
      src/views/homestead/index.vue

+ 18
- 0
src/api/homestead/index.js View File

@@ -54,6 +54,15 @@ export function houseAdd(query) {
data: query data: query
}) })
} }
//农房编辑
export function houseEdit(query) {
return request({
url: '/geo/house/edit',
method: 'post',
data: query
})
}





//农地新增 //农地新增
@@ -65,6 +74,15 @@ export function landAdd(query) {
}) })
} }


//农地编辑
export function landEdit(query) {
return request({
url: '/geo/land/edit',
method: 'post',
data: query
})
}

//获取区、镇、村地区 //获取区、镇、村地区
export function treeselectByUser(query) { export function treeselectByUser(query) {
return request({ return request({


+ 42
- 35
src/views/homestead/index.vue View File

@@ -894,7 +894,10 @@ import {
houseAdd, houseAdd,
landAdd, landAdd,
treeselectByUser, treeselectByUser,
deptGetId
deptGetId,
houseEdit,
landEdit

} from "@/api/homestead/index"; } from "@/api/homestead/index";


export default { export default {
@@ -1252,31 +1255,36 @@ export default {
this.$toast("请选择房屋类型"); this.$toast("请选择房屋类型");
return false; return false;
} }

//新增 //新增
if(this.currentType == 0){ if(this.currentType == 0){
if(houseInfoList.theGeom ==''){ if(houseInfoList.theGeom ==''){
this.$toast("请选择地图坐标"); this.$toast("请选择地图坐标");
return false; return false;
} }
}
console.log(houseInfoList)
houseAdd(houseInfoList).then((res)=>{
if(res.code == 200){
this.landHomesteadEditVisbileFun("hide");
//新增
if(this.currentType == 0){
this.$toast("农房信息新建成功");
this.initDraw();
}else{
houseAdd(houseInfoList).then((res)=>{
if(res.code == 200){
this.landHomesteadEditVisbileFun("hide");
//新增
this.$toast("农房信息新建成功");
this.initDraw();
}
})
}else{
//编辑
houseEdit(houseInfoList).then((res)=>{
if(res.code == 200){
this.landHomesteadEditVisbileFun("hide");
this.$toast("农房信息修改成功"); this.$toast("农房信息修改成功");
//编辑
this.houseInfoLookList = this.houseInfoList;
this.houseInfoLookList = this.houseInfoList;
} }
}
})
})
}



@@ -1322,33 +1330,32 @@ export default {
return false; return false;
} }




//新增 //新增
if(this.currentType == 0){ if(this.currentType == 0){
if(landInfoList.theGeom==''){ if(landInfoList.theGeom==''){
this.$toast("请选择空间坐标"); this.$toast("请选择空间坐标");
return false; return false;
} }
}
landAdd(landInfoList).then((res)=>{
if(res.code == 200){
this.landHomesteadEditVisbileFun("hide");
//新增
this.initDraw();
this.$toast("农地信息新建成功");
}
})


landAdd(landInfoList).then((res)=>{
}else{
landEdit(landInfoList).then((res)=>{
if(res.code == 200){ if(res.code == 200){
this.landHomesteadEditVisbileFun("hide");
//新增
if(this.currentType == 0){
this.initDraw();
this.$toast("农地信息新建成功");
}else{
this.landHomesteadEditVisbileFun("hide");
this.$toast("农地信息修改成功"); this.$toast("农地信息修改成功");
//编辑
this.landInfoLookList = this.landInfoList; this.landInfoLookList = this.landInfoList;
} }
}
})



})
}


} }
//保存成功触发 //保存成功触发
@@ -2805,7 +2812,7 @@ export default {
background: #fff; background: #fff;
padding: 2px 6px; padding: 2px 6px;
border-radius: 8px; border-radius: 8px;
height: 36px;
min-height: 42px;
min-width: 100px; min-width: 100px;
} }
&.more { &.more {


Loading…
Cancel
Save