智慧农业后台管理页面
guoshilong
2022-08-11 3558e9f2b0cb9f9e899eec4a33c37174ac97f7e2
数据统计随农场选择变换,dept_id更换成farmId
4 files modified
65 ■■■■ changed files
src/views/land/cs.vue 16 ●●●● patch | view | raw | blame | history
src/views/statistics/farmplantarea.vue 16 ●●●● patch | view | raw | blame | history
src/views/statistics/farmproductstockstatistics.vue 14 ●●●● patch | view | raw | blame | history
src/views/statistics/stock.vue 19 ●●●● patch | view | raw | blame | history
src/views/land/cs.vue
@@ -132,14 +132,14 @@
        ...mapGetters(["userInfo","$farmId"]),
    },
    watch: {
    '$farmId':{
      handler (newName, oldName) {
        this.farm.id = newName
        //地块页面
        this.onLoad()
      }
    }
  },
        '$farmId':{
        handler (newName, oldName) {
            this.farm.id = newName
            //地块页面
            this.onLoad()
        }
        }
    },
    created () {
        this.farm.id = this.$farmId
        this.onLoad(this.page)
src/views/statistics/farmplantarea.vue
@@ -28,6 +28,7 @@
        return {
            visible: true,
            form: {},
            farm:{},
            query: {},
            search: {},
            loading: true,
@@ -133,9 +134,18 @@
    },
    created () {
        this.initData()
        this.farm.id = this.$farmId
    },
      watch: {
    '$farmId':{
      handler (newName, oldName) {
        this.farm.id = newName
        this.onLoad(this.page)
      }
    }
  },
    computed: {
        ...mapGetters(["permission", "userInfo"]),
        ...mapGetters(["permission", "userInfo","$farmId"]),
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
@@ -179,8 +189,6 @@
                    }
                }
            })
            // sums = sums.toFixed(3)
            console.log(sums,11111111)
            return sums
        },
        getStartTime () {
@@ -257,7 +265,7 @@
            this.loading = true
            const { releaseTimeRange } = this.query
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
            params['deptId'] = this.farm.id
            let values = {
                ...params,
            }
src/views/statistics/farmproductstockstatistics.vue
@@ -32,6 +32,7 @@
    return {
      visible: true,
      form: {},
      farm:{},
      query: {},
      loading: true,
      excelBox: false,
@@ -209,10 +210,11 @@
    };
  },
  created() {
    this.farm.id = this.$farmId
    this.initData();
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    ...mapGetters(["permission", "userInfo","$farmId"]),
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.social_add, true),
@@ -229,6 +231,14 @@
      return ids.join(",");
    },
  },
  watch: {
    '$farmId':{
      handler (newName, oldName) {
        this.farm.id = newName
        this.onLoad(this.page)
      }
    }
  },
  mounted() {
    var params = {
      startTime:this.getStartTime(),
@@ -337,7 +347,7 @@
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
      params['deptId'] = this.farm.id
      this.loading = true;
      const { releaseTimeRange } = this.query;
      let values = {
src/views/statistics/stock.vue
@@ -40,6 +40,7 @@
    return {
      visible: true,
      form: {},
      farm:{},
      query: {},
      loading: true,
      excelBox: false,
@@ -153,7 +154,7 @@
  ,
  computed: {
    ...
      mapGetters(["permission", "userInfo"]),
      mapGetters(["permission", "userInfo","$farmId"]),
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.social_add, true),
@@ -172,6 +173,17 @@
    ,
  }
  ,
  watch: {
    '$farmId':{
      handler (newName, oldName) {
        this.farm.id = newName
        this.onLoad(this.page)
      }
    }
  },
  created () {
    this.farm.id = this.$farmId
  },
  mounted() {
    var params = {
      startTime: this.getStartTime(),
@@ -382,7 +394,7 @@
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      params.deptId= this.userInfo.dept_id;
      params.deptId= this.farm.id;
      this.loading = true;
      const {releaseTimeRange} = this.query;
      let values = {
@@ -402,6 +414,9 @@
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        // this.data = this.data.filter((e)=>{
        //   return !(e.bfcknum == e.cgnum == e.dbcknum == e.dbrknum == e.lycknum == e.rknum == 0)
        // })
        this.loading = false;
        this.selectionClear();
      });