智慧农业后台管理页面
guoshilong
2022-08-05 08cbb8e6fd626d16a45deeebc252e925f0d0b0da
修复首页选择了农场后,对特定品种进行采收还能选择到其他地块
3 files modified
30 ■■■■ changed files
src/api/land/land.js 11 ●●●●● patch | view | raw | blame | history
src/views/wel/index.vue 2 ●●● patch | view | raw | blame | history
src/views/wel/recovery.vue 17 ●●●● patch | view | raw | blame | history
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
      }
    })
  }
  
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>
        <!-- 种养品 -->
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,