From eb7ced97c1a12d49a09ec4a876082644fcc357a6 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 12 Aug 2022 17:58:07 +0800
Subject: [PATCH] 农事记录、农资使用记录、采收记录、任务记录、农事操作的地块筛选,有列表显示的随农场变化,

---
 src/views/farm/stockUseInfo.vue |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/views/farm/stockUseInfo.vue b/src/views/farm/stockUseInfo.vue
index 27ec78a..5f93b3a 100644
--- a/src/views/farm/stockUseInfo.vue
+++ b/src/views/farm/stockUseInfo.vue
@@ -133,7 +133,7 @@
         this.initData()
     },
     computed: {
-        ...mapGetters(["permission", "userInfo"]),
+        ...mapGetters(["permission", "userInfo","$farmId"]),
         ids () {
             let ids = []
             this.selectionList.forEach((ele) => {
@@ -142,6 +142,22 @@
             return ids.join(",")
         },
     },
+    watch:{
+        '$farmId':{
+            handler (newName, oldName) {
+                //获取农地数据
+                getLandList(this.$farmId).then((res) => {
+                    if (res.data.code == 200) {
+                        var landIdcolumn = this.findObject(this.option.column, "landId")
+                        this.landList = res.data.data
+                        landIdcolumn.dicData = res.data.data
+                    }
+                })
+                this.query={}
+                this.onLoad(this.page)
+            }
+        }
+    },    
     mounted () {
     },
     methods: {
@@ -152,14 +168,13 @@
         initData () {
             var that = this
             //获取农地地块数据
-            getLandList(this.userInfo.dept_id).then((res) => {
+            getLandList(this.$farmId).then((res) => {
                 if (res.data.code == 200) {
                     var landIdcolumn = that.findObject(that.option.column, "landId")
                     that.landList = res.data.data
                     landIdcolumn.dicData = res.data.data
                 }
             })
-
         },
         beforeOpen (done, type) {
             if (["edit", "view"].includes(type)) {
@@ -196,11 +211,13 @@
             this.onLoad(this.page, this.query)
         },
         onLoad (page, params = {}) {
+            console.log(params)
             this.loading = true
             var datas = this.$route.query.id
             params.landId = datas
             params['tenantId'] = this.userInfo.tenant_id
-            params['deptId'] = this.userInfo.dept_id
+            params['farmId'] = this.$farmId
+            console.log(params)
             if (this.landId) {
                 params['landId'] = this.landId
             }

--
Gitblit v1.9.3