From 7ae4b4b6679ba419cfd92d2a60ed603c2c8a446d Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Thu, 11 Aug 2022 16:59:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/land/cs.vue                |   14 +++++++++++++-
 src/views/land/landAdd.vue           |   21 +++++++++------------
 src/views/land/getMapDataInThere.vue |    2 +-
 src/views/land/landUpdate.vue        |    1 +
 4 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/src/views/land/cs.vue b/src/views/land/cs.vue
index 3584296..1ce9628 100644
--- a/src/views/land/cs.vue
+++ b/src/views/land/cs.vue
@@ -105,6 +105,7 @@
                 keyword: "",
             },
             query: {},
+            farm:{},
             value: true,
             farmingCount: 0,
             landVisible: false,
@@ -128,9 +129,19 @@
         }
     },
     computed: {
-        ...mapGetters(["userInfo"]),
+        ...mapGetters(["userInfo","$farmId"]),
     },
+    watch: {
+    '$farmId':{
+      handler (newName, oldName) {
+        this.farm.id = newName
+        //地块页面
+        this.onLoad()
+      }
+    }
+  },
     created () {
+        this.farm.id = this.$farmId
         this.onLoad(this.page)
     },
     methods: {
@@ -184,6 +195,7 @@
             if(typeof(page) == "undefined" ){
                 page = this.page
             }
+            Object.assign(params,{farmId:this.farm.id})
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                 const data = res.data.data
                 this.page.total = data.total
diff --git a/src/views/land/getMapDataInThere.vue b/src/views/land/getMapDataInThere.vue
index a74db44..1ac07c4 100644
--- a/src/views/land/getMapDataInThere.vue
+++ b/src/views/land/getMapDataInThere.vue
@@ -48,7 +48,7 @@
         currentPolygons: {
             immediate: true,
             handler (newData, oldData) {
-                console.log(newData, 5656)
+                // console.log(newData, 5656)
                 if (newData.length > 0) {
 
                     this.draw(newData)
diff --git a/src/views/land/landAdd.vue b/src/views/land/landAdd.vue
index d31d187..e6afca1 100644
--- a/src/views/land/landAdd.vue
+++ b/src/views/land/landAdd.vue
@@ -51,11 +51,13 @@
                         label: "所属农场",
                         prop: "farmId",
                         type: "tree",
+                        value:"",
                         dicData: [],
                         props: {
                             label: "farmName",
                             value: "id"
                         },
+                        disabled:true,
                         slot: true,
                         rules: [{
                             required: true,
@@ -106,41 +108,36 @@
         }
     },
     computed: {
-        ...mapGetters(["userInfo", "permission", "polygons"]),
+        ...mapGetters(["userInfo", "permission", "polygons","$farmId"]),
     },
     mounted () {
         this.initData(this.userInfo.tenant_id)
     },
     methods: {
         initData (tenantId) {
-            // getDeptTree(tenantId).then(res => {        console.log(res)
-
-            //   const column = this.findObject(this.option.column, "deptId");
-            //   column.dicData = res.data.data;
-            // });
-            const data = {
-                deptId: this.userInfo.dept_id
-            }
-            getFarmList(data).then(res => {
+            getFarmList().then(res => {
                 const column = this.findObject(this.option.column, "farmId")
                 column.dicData = res.data.data
             })
         },
         //初始化
         init () {
+            console.log(22222222222222)
             //清空面的数据
             this.$store.commit('clear_polygon')
             //计算当前时间
             this.visible = true
+            this.form.farmId = this.$farmId
         },
         // 表单提交
         submit (row, loading) {
             row['deptId'] = this.userInfo.dept_id
+            // row.farmId = this.farm.id
             var that = this
             if (this.polygons.length == 0) {
                 //没有面的数据
-                this.$refs.getMapData.isCheck = true
-                loading()
+                // this.$refs.getMapData.isCheck = true
+                // loading()
             } else {
                 //如果有值,空间坐标转换
                 let pol = this.polygons
diff --git a/src/views/land/landUpdate.vue b/src/views/land/landUpdate.vue
index b42f077..57029e4 100644
--- a/src/views/land/landUpdate.vue
+++ b/src/views/land/landUpdate.vue
@@ -53,6 +53,7 @@
                         label: "所属农场",
                         prop: "farmId",
                         type: "tree",
+                        disabled:true,
                         dicData: [],
                         props: {
                             label: "farmName",

--
Gitblit v1.9.3