diff --git a/src/views/homestead/index.vue b/src/views/homestead/index.vue index 6c06a11c..ac6a82fc 100644 --- a/src/views/homestead/index.vue +++ b/src/views/homestead/index.vue @@ -21,6 +21,8 @@
列表
+ +
@@ -139,15 +141,6 @@
-
-
-
-
-
-
+
{{ houseInfoList.fwsyrmc }}
{{ houseInfoList.dz }}
性质:{{ houseInfoList.tdxz }}
-
+
{{ houseInfoList.xh }}
大约{{ houseInfoList.jzmj }}㎡
-
+ >
-->
{{ houseInfoList.xzqk }}
@@ -219,21 +221,21 @@
-
+
{{ landInfoList.syrmc }}
{{ landInfoList.cm }}
性质:{{ landInfoList.nydlx }}
-
+
{{ landInfoList.xh }}
大约{{ landInfoList.mj }}㎡
-
+ >
-->
{{ landInfoList.xzqk }}
@@ -361,7 +363,7 @@
- 农地编号{{ landInfoLookList.xm }} + 农地编号{{ landInfoLookList.xh }}
@@ -437,6 +439,10 @@
+
农地编号
@@ -776,7 +782,7 @@
{ + // on confirm + this.coordinateList = ""; + this.$set(this.draw, "drawMapPolygon", true); + $("#drawPolygon").trigger("click"); + }) + .catch(() => { + // on cancel + }); + } } else { $("#drawRemove").trigger("click"); this.$set(this.draw, "drawMapPolygon", false); @@ -1141,7 +1173,7 @@ export default { } this.currentType = 0; this.farmlandEditSwitchVisbuleFun("show"); - this.searchBarOperVisbile = false; + // this.searchBarOperVisbile = false; }, //关闭选择农房土地 farmlandEditFun() { @@ -1327,23 +1359,53 @@ export default { this.$toast("请选择地图坐标"); return false; } - houseAdd(houseInfoList).then((res) => { - if (res.code == 200) { - this.landHomesteadEditVisbileFun("hide"); - //新增 - this.$toast("农房信息新建成功"); - this.initDraw(); - } - }); + + this.$dialog + .confirm({ + title: "新建农房信息", + message: "是否保存信息或修改信息", + }) + .then(() => { + // on confirm + houseAdd(houseInfoList).then((res) => { + if (res.code == 200) { + this.landHomesteadEditVisbileFun("hide"); + //新增 + this.$toast("新建农房信息成功"); + this.initDraw(); + $("#drawRemove").trigger("click"); + $("#drawReset").trigger("click"); + this.coordinateList = ""; + } + }); + }) + .catch(() => { + // on cancel + }); } else { + this.$dialog + .confirm({ + title: "修改农房信息", + message: "是否保存信息或修改信息", + }) + .then(() => { + // on confirm + houseEdit(houseInfoList).then((res) => { + if (res.code == 200) { + this.landHomesteadEditVisbileFun("hide"); + this.$toast("修改农房信息成功"); + this.houseInfoLookList = this.houseInfoList; + this.initDraw(); + $("#drawRemove").trigger("click"); + $("#drawReset").trigger("click"); + this.coordinateList = ""; + } + }); + }) + .catch(() => { + // on cancel + }); //编辑 - houseEdit(houseInfoList).then((res) => { - if (res.code == 200) { - this.landHomesteadEditVisbileFun("hide"); - this.$toast("农房信息修改成功"); - this.houseInfoLookList = this.houseInfoList; - } - }); } } else if (this.farmhouseStatus == 1) { // orgCode: "", // String 否 行政区代码 @@ -1355,7 +1417,7 @@ export default { landInfoList.orgCode = this.villageDataObj.orgCode; landInfoList.cdm = this.villageDataObj.orgCode; landInfoList.cm = this.villageDataObj.deptName; - if (landInfoList.xm == undefined || landInfoList.xm == "") { + if (landInfoList.xh == undefined || landInfoList.xh == "") { this.$toast("请填写农地编号"); return false; } else if ( @@ -1390,22 +1452,51 @@ export default { this.$toast("请选择空间坐标"); return false; } - landAdd(landInfoList).then((res) => { - if (res.code == 200) { - this.landHomesteadEditVisbileFun("hide"); - //新增 - this.initDraw(); - this.$toast("农地信息新建成功"); - } - }); + this.$dialog + .confirm({ + title: "新建农地信息", + message: "是否保存信息或修改信息", + }) + .then(() => { + // on confirm + landAdd(landInfoList).then((res) => { + if (res.code == 200) { + this.landHomesteadEditVisbileFun("hide"); + //新增 + this.initDraw(); + $("#drawRemove").trigger("click"); + $("#drawReset").trigger("click"); + this.coordinateList = ""; + this.$toast("新建农地信息成功"); + } + }); + }) + .catch(() => { + // on cancel + }); } else { - landEdit(landInfoList).then((res) => { - if (res.code == 200) { - this.landHomesteadEditVisbileFun("hide"); - this.$toast("农地信息修改成功"); - this.landInfoLookList = this.landInfoList; - } - }); + this.$dialog + .confirm({ + title: "修改农地信息", + message: "是否保存信息或修改信息", + }) + .then(() => { + // on confirm + landEdit(landInfoList).then((res) => { + if (res.code == 200) { + this.landHomesteadEditVisbileFun("hide"); + this.$toast("修改农地信息成功"); + this.landInfoLookList = this.landInfoList; + this.initDraw(); + $("#drawRemove").trigger("click"); + $("#drawReset").trigger("click"); + this.coordinateList = ""; + } + }); + }) + .catch(() => { + // on cancel + }); } } //保存成功触发 @@ -1434,9 +1525,9 @@ export default { //初始化绘制 initDraw() { //清除数据 - $("#drawRemove").trigger("click"); - $("#drawReset").trigger("click"); - this.coordinateList = ""; + // $("#drawRemove").trigger("click"); + // $("#drawReset").trigger("click"); + // this.coordinateList = ""; //农地数据初始化 this.landInfoList = { id: "", //String 是 主键id @@ -1599,7 +1690,7 @@ export default { if (res.code == 200) { let content = res.data; this.hcAreaInfoOption = content; - let currDeptId; // = "169"; + let currDeptId; //;= "169" if (content[0].children && content[0].children.length != 0) { if ( content[0].children[0].children && @@ -1652,12 +1743,14 @@ export default { } else { this.searchBarOperVisbile = false; //初始化绘制 + // this.coordinateList = ""; this.initDraw(); } }, /*右侧列表 --展开收缩*/ selectionPush() { + this.selectionIconShow = true; $(".homesteadList_wrap").animate( { right: "0", @@ -1666,6 +1759,7 @@ export default { ); }, homesteadListShrink() { + this.selectionIconShow = false; $(".homesteadList_wrap").animate( { right: "-300px", @@ -1947,7 +2041,8 @@ export default { obj.tdfl = trs.find("td").eq(23).text(); //集体/个人 obj.frontHouse = trs.find("td").eq(24).text(); //图片前 obj.behindHouse = trs.find("td").eq(25).text(); //图片后 - _this.houseInfoList = obj; + let cloneObj = JSON.parse(JSON.stringify(obj)); + _this.houseInfoList = cloneObj; _this.houseInfoList.frontland = ""; _this.houseInfoList.behindland = ""; _this.houseInfoLookList = obj; @@ -1959,7 +2054,7 @@ export default { let zjId = trs.find("td").eq(0).text(); let zjIdNum = zjId.replace("t_geo_hc_land.", ""); obj.id = zjIdNum; // 主键id - obj.xm = trs.find("td").eq(1).text(); //序号 + obj.xh = trs.find("td").eq(1).text(); //序号 obj.cm = trs.find("td").eq(2).text(); //村名 obj.cbrmc = trs.find("td").eq(3).text(); //承包人名称 obj.syrmc = trs.find("td").eq(4).text(); //使用人名称 @@ -1974,7 +2069,8 @@ export default { obj.frontland = trs.find("td").eq(18).text(); //图片前 obj.behindland = trs.find("td").eq(19).text(); //图片后 _this.nydlxOptionsValue = trs.find("td").eq(5).text(); //农用地类型 - _this.landInfoList = obj; + let cloneObj = JSON.parse(JSON.stringify(obj)); + _this.landInfoList = cloneObj; //编辑图片清空 _this.landInfoList.frontland = ""; _this.landInfoList.behindland = ""; @@ -2626,7 +2722,7 @@ export default { //农地 - 农用地类型 选择值 nydlxOptionsFun(value) { this.landInfoList.nydlx = value.dictLabel; - this.nydlxOptionsValue = value.dictLabel; + // this.nydlxOptionsValue = value.dictLabel; this.nydlxOptionsVibile = false; }, //农地 - 是否有流转 选择值 @@ -2650,17 +2746,6 @@ export default { this.landInfoList.frontland = res.url; }); }, - landHomeSerial(type, data) { - console.log(type); - console.log(data); - if (type == "house") { - $("#texiao_fang").val(data.fwsyrmc); - $("#texiao_fang").trigger("click"); - } else { - $("#texiao_di").val(data.syrmc); - $("#texiao_di").trigger("click"); - } - }, }, }; @@ -2868,7 +2953,7 @@ export default { } .address_wrap { position: fixed; - z-index: 9; + // z-index: 9; top: 24px; left: 16px; display: flex;