智慧农业后台管理页面
guoshilong
2022-09-09 f749fe64d57ab41b7dddfa30df2f9542877197f1
绑定溯源列表跟随农场变化
1 files modified
36 ■■■■ changed files
src/views/traceability/recovery.vue 36 ●●●● patch | view | raw | blame | history
src/views/traceability/recovery.vue
@@ -35,7 +35,7 @@
<script>
import { getList } from "@/api/farmplant/recovery";
import { update } from "@/api/traceability/traceability";
import { getLandList } from "@/api/land/land";
import { getLandList,selectRecoveryLandList } from "@/api/land/land";
import { getStrainList } from "@/api/farmplant/strain";
import { mapGetters } from "vuex";
export default {
@@ -69,11 +69,16 @@
        column: [
          {
            label: "采收品种",
            prop: "strainName",
          },
          {
            label: "采收品种",
            prop: "strainId",
            search: true,
            searchSpan: 4,
            span: 12,
            type: "tree",
            hide:true,
            dicData: [],
            props: {
              label: "strainName",
@@ -150,6 +155,10 @@
          },
          {
            label: "操作人",
            prop: "realName",
          },
          {
            label: "操作人",
            prop: "operator",
            type: "tree",
            dicData: [],
@@ -157,6 +166,7 @@
              label: "realName",
              value: "id",
            },
            hide:true,
            span: 12,
            labelWidth: 145,
            rules: [
@@ -176,7 +186,7 @@
    this.initData();
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    ...mapGetters(["permission", "userInfo","$farmId"]),
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
@@ -184,6 +194,21 @@
      });
      return ids.join(",");
    },
  },
  watch:{
    '$farmId':{
        handler (newName, oldName) {
        //获取农地数据
        selectRecoveryLandList(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.onLoad(this.page)
      }
    }
  },
  mounted() {},
  methods: {
@@ -196,7 +221,7 @@
    initData() {
      var that = this;
      //获取农地数据
      getLandList(this.userInfo.user_id).then((res) => {
      selectRecoveryLandList(this.$farmId).then((res) => {
        if (res.data.code == 200) {
          var landIdcolumn = that.findObject(that.option.column, "landId");
          that.landList = res.data.data;
@@ -272,8 +297,9 @@
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      // params['deptId'] = this.userInfo.dept_id;
      // params['tenantId'] = this.userInfo.tenant_id;
      params['farmId'] = this.$farmId;
      console.log(this.$farmId,1111111111)
      this.loading = true;
      getList(
        page.currentPage,