liuminjian преди 3 години
родител
ревизия
74022216ca
променени са 2 файла, в които са добавени 60 реда и са изтрити 35 реда
  1. +18
    -0
      src/api/homestead/index.js
  2. +42
    -35
      src/views/homestead/index.vue

+ 18
- 0
src/api/homestead/index.js Целия файл

@@ -54,6 +54,15 @@ export function houseAdd(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) {
return request({


+ 42
- 35
src/views/homestead/index.vue Целия файл

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

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

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

//新增
if(this.currentType == 0){
if(houseInfoList.theGeom ==''){
this.$toast("请选择地图坐标");
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.houseInfoLookList = this.houseInfoList;
this.houseInfoLookList = this.houseInfoList;
}
}
})
})
}


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



//新增
if(this.currentType == 0){
if(landInfoList.theGeom==''){
this.$toast("请选择空间坐标");
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){
this.landHomesteadEditVisbileFun("hide");
//新增
if(this.currentType == 0){
this.initDraw();
this.$toast("农地信息新建成功");
}else{
this.landHomesteadEditVisbileFun("hide");
this.$toast("农地信息修改成功");
//编辑
this.landInfoLookList = this.landInfoList;
}
}
})



})
}

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


Зареждане…
Отказ
Запис