diff --git a/src/api/homestead/index.js b/src/api/homestead/index.js index 9aeab7d5..8931c8a8 100644 --- a/src/api/homestead/index.js +++ b/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({ diff --git a/src/views/homestead/index.vue b/src/views/homestead/index.vue index 11bd8514..8ace95c7 100644 --- a/src/views/homestead/index.vue +++ b/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 {