From c7d469efc2bc11d2c54d2aafef90d16e27088eb8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 02 Aug 2022 11:43:42 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhny_web

---
 src/views/land/LandDetail.vue |   98 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 66 insertions(+), 32 deletions(-)

diff --git a/src/views/land/LandDetail.vue b/src/views/land/LandDetail.vue
index 66c0cd8..6f2ad9a 100644
--- a/src/views/land/LandDetail.vue
+++ b/src/views/land/LandDetail.vue
@@ -2,7 +2,8 @@
     <div class="wraaper-box farming-detail-box">
         <div class="dd">
             <div class="da">
-                <div class="land-img" @click="mod(usePolygons)">
+<!--                <div class="land-img" @click="mod(usePolygons)">-->
+                <div class="land-img">
                     <img :src="url" class="landimg" />
                 </div>
                 <div class="cent">
@@ -15,8 +16,9 @@
                 <div class="edit">
                     <el-button @click="btnGrounpShow = !btnGrounpShow" icon="el-icon-menu"></el-button>
 
-                    <div v-show="btnGrounpShow" class="btn-grounp" @click="DelLand(delId)">
-                        <el-button>删除地块</el-button>
+                    <div v-show="btnGrounpShow" class="btn-grounp">
+                        <el-button @click="DelLand(delId)">删除地块</el-button>
+                        <el-button size="small" @click="land">编辑地块</el-button>
                     </div>
                 </div>
             </div>
@@ -34,24 +36,29 @@
                     <el-tab-pane label="采收记录" name="tab3">
                         <recovery></recovery>
                     </el-tab-pane>
+                    <!-- 农资记录 -->
+                    <el-tab-pane label="农资使用记录" name="tab4">
+                      <stockUseInfo></stockUseInfo>
+                    </el-tab-pane>
                 </el-tabs>
             </div>
         </div>
 
-        <el-dialog
-            title="地块位置"
-            class="current-map-box"
-            :visible.sync="gradeBoxVisible1"
-            :modal="true"
-            :modal-append-to-body="true"
-            :append-to-body="true"
-            :close-on-click-modal="false"
-            :close-on-press-escape="false"
-            :before-close="dialogBeforeClose"
-        >
-            <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>
-            <el-button class="save" type="success" @click="upLand()">保存</el-button>
-        </el-dialog>
+<!--        <el-dialog-->
+<!--            title="地块位置"-->
+<!--            class="current-map-box"-->
+<!--            :visible.sync="gradeBoxVisible1"-->
+<!--            :modal="true"-->
+<!--            :modal-append-to-body="true"-->
+<!--            :append-to-body="true"-->
+<!--            :close-on-click-modal="false"-->
+<!--            :close-on-press-escape="false"-->
+<!--            :before-close="dialogBeforeClose"-->
+<!--        >-->
+<!--            <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>-->
+<!--            <el-button class="save" type="success" @click="upLand()">保存</el-button>-->
+<!--        </el-dialog>-->
+        <landUpdate v-if="landVisible" ref="landUpdate" id="landUpdate"></landUpdate>
     </div>
 </template>
 
@@ -60,14 +67,18 @@
 import farmplant from "@/views/farmplant/farmplant.vue"
 import farming from "@/views/farm/farmingrecord.vue"
 import recovery from "@/views/recovery/recovery.vue"
+import stockUseInfo from "@/views/farm/stockUseInfo.vue"
 import getMapDataInThere from "./getMapDataInThere.vue"
-import { remove, update } from "@/api/land/land"
+import {getList, remove, update} from "@/api/land/land"
+import landUpdate from "./landUpdate"
 
 export default {
     components: {
         farmplant,
         farming,
         recovery,
+        stockUseInfo,
+        landUpdate,
         getMapDataInThere
     },
     data () {
@@ -84,6 +95,7 @@
             dic: "",
             formC: {},
             gradeBoxVisible1: false,
+            landVisible: false,
             option2: {
                 index: true,
                 tip: false,
@@ -114,21 +126,24 @@
         ...mapGetters(["userInfo", "permission", "polygons"]),
     },
     created () {
-        this.url = this.$route.query.url
-        this.landName = this.$route.query.landName
-        this.dic = this.$route.query.dic
-        this.landArea = this.$route.query.landArea
-        this.dica = this.$route.query.dica
-        this.deptname = this.$route.query.deptname
-        this.delId = this.$route.query.id
-        this.landUnit = this.$route.query.landUnit
-        // this.form = res.data.data;
-        this.usePolygons = this.$route.query.landRange
-            .split("POLYGON((")[1]
-            .split("))")[0]
-            .split(",")
+
     },
     methods: {
+        //圈地
+        land () {
+          this.landVisible = true
+          this.$nextTick(() => {
+            this.$refs.landUpdate.init()
+          })
+        },
+        openLandUpdate (page, params = {}) {
+          console.log('11111111111refreshOnLoad')
+          // getList(1, 10, Object.assign(params, this.query)).then(res => {
+          //   const data = res.data.data
+          //
+          //   this.farmPlanList = data.records
+          // })
+        },
         mod (usePolygons) {
             this.gradeBoxVisible1 = true
             this.$refs.getMapData.draw(usePolygons)
@@ -195,7 +210,26 @@
             // });
         }
     },
-    watch: {},
+    watch: {
+      '$route.query': {
+        immediate: true,
+        handler(newData, oldData) {
+          this.url = this.$route.query.url
+          this.landName = this.$route.query.landName
+          this.dic = this.$route.query.dic
+          this.landArea = this.$route.query.landArea
+          this.dica = this.$route.query.dica
+          this.deptname = this.$route.query.deptname
+          this.delId = this.$route.query.id
+          this.landUnit = this.$route.query.landUnit
+          // this.form = res.data.data;
+          this.usePolygons = this.$route.query.landRange
+            .split("POLYGON((")[1]
+            .split("))")[0]
+            .split(",")
+        }
+      }
+    },
 }
 </script>
 

--
Gitblit v1.9.3