From 08cbb8e6fd626d16a45deeebc252e925f0d0b0da Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 05 Aug 2022 11:55:58 +0800
Subject: [PATCH] 修复首页选择了农场后,对特定品种进行采收还能选择到其他地块

---
 src/views/wel/index.vue    |    2 +-
 src/views/wel/recovery.vue |   17 ++++++++++++++---
 src/api/land/land.js       |   11 +++++++++++
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/src/api/land/land.js b/src/api/land/land.js
index 6e301c3..7e6c667 100644
--- a/src/api/land/land.js
+++ b/src/api/land/land.js
@@ -106,4 +106,15 @@
       }
     })
   }
+
+  export const getByStrainIdFarmId = (strainId,farmId)=>{
+    return request({
+      url: '/api/land/land/getByStrainIdFarmId',
+      method: 'get',
+      params: {
+        strainId,
+        farmId
+      }
+    })
+  }
   
\ No newline at end of file
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 556f750..20fe223 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -167,7 +167,7 @@
             </div>
         </div>
         <!-- 弹窗, 采收 -->
-        <recovery v-if="recoveryVisible" ref="recovery"></recovery>
+        <recovery v-if="recoveryVisible" ref="recovery" :farmDetail="farm"></recovery>
         <!-- 圈地 -->
         <land v-if="landVisible" ref="land"></land>
         <!-- 种养品 -->
diff --git a/src/views/wel/recovery.vue b/src/views/wel/recovery.vue
index d5ddaf4..cb0da12 100644
--- a/src/views/wel/recovery.vue
+++ b/src/views/wel/recovery.vue
@@ -15,7 +15,7 @@
 <script>
 
 import { mapState } from "vuex";
-import { getLandList } from "@/api/land/land";
+import { getLandList,getByStrainIdFarmId } from "@/api/land/land";
 import { getUserList } from "@/api/system/user";
 import { getStrainList } from "@/api/farmplant/strain";
 import { save } from "@/api/farmplant/recovery";
@@ -221,6 +221,11 @@
       visible: false,
     };
   },
+  props:{
+    farmDetail:{
+      type:Object
+    }
+  },
   computed: {
     ...mapState({
       userInfo: (state) => state.user.userInfo,
@@ -271,14 +276,20 @@
       this.visible = true;
       var that = this;
       //获取农地数据
-      getLandList(this.userInfo.dept_id).then((res) => {
+      // getLandList(this.userInfo.dept_id).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;
+      //   }
+      // });
+      getByStrainIdFarmId(this.form.strainId,this.farmDetail.id).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;
         }
       });
-
       //获取操作人
       const user = {
         tenantId: this.userInfo.tenant_id,

--
Gitblit v1.9.3