From 735027d05301cc3f1852942eb81503318a25d524 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 14 Jun 2022 11:58:38 +0800
Subject: [PATCH] 采收,统计,首页,农产品及库存,农事操作等习惯

---
 src/views/wel/index.vue                             |   10 +++--
 src/views/farmplant/farmproductstock.vue            |    2 +
 src/views/traceability/addTraceability.vue          |    5 ++
 src/views/farm/farmingrecord.vue                    |    4 +
 src/views/wel/recovery.vue                          |    2 +
 src/views/traceability/traceability.vue             |    2 +
 src/api/farm/farmingrecord.js                       |   12 ++++--
 src/views/recovery/recovery.vue                     |    2 
 src/views/traceability/recovery.vue                 |    4 +
 src/views/wel/farming.vue                           |    4 +
 src/views/statistics/farmproductstockstatistics.vue |    2 +
 src/views/wel/land.vue                              |    2 +
 src/views/statistics/farmplantarea.vue              |    2 +
 src/views/wel/stock.vue                             |    2 +
 src/views/farmplant/farmplant.vue                   |    5 +-
 src/views/wel/plant.vue                             |    2 +
 src/views/farmplant/strain.vue                      |    4 ++
 src/api/land/land.js                                |    8 ++-
 src/api/stock/stock.js                              |   34 +++++++++--------
 19 files changed, 74 insertions(+), 34 deletions(-)

diff --git a/src/api/farm/farmingrecord.js b/src/api/farm/farmingrecord.js
index 27f0c2e..f237073 100644
--- a/src/api/farm/farmingrecord.js
+++ b/src/api/farm/farmingrecord.js
@@ -48,18 +48,22 @@
 }
 
 
-export const getFarmingCount = () => {
+export const getFarmingCount = (deptId) => {
     return request({
         url: '/api/farmingRecord/getFarmingCount',
         method: 'get',
-        params: {}
+        params: {
+            deptId
+        }
     })
 }
 
-export const getFarmingStatis = () => {
+export const getFarmingStatis = (deptId) => {
     return request({
         url: '/api/farmingRecord/getFarmingStatis',
         method: 'get',
-        params: {}
+        params: {
+            deptId
+        }
     })
 }
\ No newline at end of file
diff --git a/src/api/land/land.js b/src/api/land/land.js
index 3621dc3..63d9eca 100644
--- a/src/api/land/land.js
+++ b/src/api/land/land.js
@@ -58,10 +58,12 @@
     })
 }
 
-export const selectCount = () => {
+export const selectCount = (deptId) => {
     return request({
         url: '/api/land/land/selectCount',
         method: 'get',
-        params: {}
+        params: {
+            deptId
+        }
     })
-}
+}
\ No newline at end of file
diff --git a/src/api/stock/stock.js b/src/api/stock/stock.js
index 89b5891..4730c66 100644
--- a/src/api/stock/stock.js
+++ b/src/api/stock/stock.js
@@ -48,20 +48,22 @@
     })
 }
 export const pagenum = (current, size, params) => {
-  return request({
-    url: '/api/stock/stock/pagenum',
-    method: 'post',
-    params: {
-      ...params,
-      current,
-      size,
-    }
-  })
+    return request({
+        url: '/api/stock/stock/pagenum',
+        method: 'post',
+        params: {
+            ...params,
+            current,
+            size,
+        }
+    })
 }
-export const StockCount = (row) => {
-  return request({
-    url: '/api/stock/stock/StockCount',
-    method: 'post',
-    data: row
-  })
-}
+export const StockCount = (deptId) => {
+    return request({
+        url: '/api/stock/stock/StockCount',
+        method: 'get',
+        params: {
+            deptId
+        }
+    })
+}
\ No newline at end of file
diff --git a/src/views/farm/farmingrecord.vue b/src/views/farm/farmingrecord.vue
index be9d152..cfc22eb 100644
--- a/src/views/farm/farmingrecord.vue
+++ b/src/views/farm/farmingrecord.vue
@@ -286,7 +286,7 @@
     initData() {
       var that = this;
       //获取农地数据
-      getLandList(this.userInfo.user_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;
@@ -423,6 +423,8 @@
       this.loading = true;
       var datas = this.$route.query.id;
       params.landId=datas;
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       getList(
         page.currentPage,
         page.pageSize,
diff --git a/src/views/farmplant/farmplant.vue b/src/views/farmplant/farmplant.vue
index b02e1ba..984346b 100644
--- a/src/views/farmplant/farmplant.vue
+++ b/src/views/farmplant/farmplant.vue
@@ -538,13 +538,12 @@
       return ids.join(",");
     },
   },
-  mounted() {},
   methods: {
     //初始化数据
     initData(){
       var that = this;
       //获取农地数据
-      getLandList(this.userInfo.user_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;
@@ -671,6 +670,8 @@
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       this.loading = true;
       getList(
         page.currentPage,
diff --git a/src/views/farmplant/farmproductstock.vue b/src/views/farmplant/farmproductstock.vue
index 84ee7c0..7668672 100644
--- a/src/views/farmplant/farmproductstock.vue
+++ b/src/views/farmplant/farmproductstock.vue
@@ -127,6 +127,8 @@
       this.onLoad(this.page);
     },
     onLoad(page, params = {}) {
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       getList(
         page.currentPage,
         page.pageSize,
diff --git a/src/views/farmplant/strain.vue b/src/views/farmplant/strain.vue
index b86a9c9..f1f11a6 100644
--- a/src/views/farmplant/strain.vue
+++ b/src/views/farmplant/strain.vue
@@ -172,6 +172,8 @@
     //新增
     rowSave(row, done, loading) {
       row['strainType'] =0;
+      row['tenantId'] = this.userInfo.tenant_id;
+      row['deptId'] = this.userInfo.dept_id;
       save(row).then(
         () => {
           this.onLoad(this.page);
@@ -279,6 +281,8 @@
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       this.loading = true;
       getList(
         page.currentPage,
diff --git a/src/views/recovery/recovery.vue b/src/views/recovery/recovery.vue
index f899a08..129ff0b 100644
--- a/src/views/recovery/recovery.vue
+++ b/src/views/recovery/recovery.vue
@@ -291,7 +291,7 @@
     initData(){
       var that = this;
       //获取农地数据
-      getLandList(this.userInfo.user_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;
diff --git a/src/views/statistics/farmplantarea.vue b/src/views/statistics/farmplantarea.vue
index 2886ad5..5f09fd3 100644
--- a/src/views/statistics/farmplantarea.vue
+++ b/src/views/statistics/farmplantarea.vue
@@ -253,6 +253,8 @@
     onLoad(page, params = {}) {
       this.loading = true;
       const { releaseTimeRange } = this.query;
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       let values = {
         ...params,
       };
diff --git a/src/views/statistics/farmproductstockstatistics.vue b/src/views/statistics/farmproductstockstatistics.vue
index 5d876e7..e6c5f81 100644
--- a/src/views/statistics/farmproductstockstatistics.vue
+++ b/src/views/statistics/farmproductstockstatistics.vue
@@ -335,6 +335,8 @@
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       this.loading = true;
       const { releaseTimeRange } = this.query;
       let values = {
diff --git a/src/views/traceability/addTraceability.vue b/src/views/traceability/addTraceability.vue
index d6a367a..0a52a7e 100644
--- a/src/views/traceability/addTraceability.vue
+++ b/src/views/traceability/addTraceability.vue
@@ -427,7 +427,8 @@
       } else {
         this.formLabelAlign["bind"] = "1";
       }
-
+      that.formLabelAlign['tenantId'] = this.userInfo.tenant_id;
+      that.formLabelAlign['deptId'] = this.userInfo.dept_id;
       this.$refs["formLabelAlign"].validate((valid) => {
         if (valid) {
           that.formLabelAlign.createTime =
@@ -482,6 +483,8 @@
         that.formLabelAlign['recoveryId'] = this.selectionList[0].id;
         that.formLabelAlign['bind'] = '0';
       }
+      that.formLabelAlign['tenantId'] = this.userInfo.tenant_id;
+      that.formLabelAlign['deptId'] = this.userInfo.dept_id;
       //新增
       save(that.formLabelAlign).then(
         () => {
diff --git a/src/views/traceability/recovery.vue b/src/views/traceability/recovery.vue
index d4c2b84..52cc5ac 100644
--- a/src/views/traceability/recovery.vue
+++ b/src/views/traceability/recovery.vue
@@ -229,7 +229,7 @@
         data['recoveryId'] = this.selectionList[0].id;
         data['bind'] = '0';
       }
-      //新增
+      //修改
       update(data).then(
         () => {
           that.$emit("refreshOnLoad");
@@ -272,6 +272,8 @@
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       this.loading = true;
       getList(
         page.currentPage,
diff --git a/src/views/traceability/traceability.vue b/src/views/traceability/traceability.vue
index d29e338..dc0bba0 100644
--- a/src/views/traceability/traceability.vue
+++ b/src/views/traceability/traceability.vue
@@ -349,6 +349,8 @@
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       this.loading = true;
       getList(
         page.currentPage,
diff --git a/src/views/wel/farming.vue b/src/views/wel/farming.vue
index 12cf9a1..c8cb8af 100644
--- a/src/views/wel/farming.vue
+++ b/src/views/wel/farming.vue
@@ -252,7 +252,7 @@
       this.visible = true;
       var that = this;
       //获取农地数据
-      getLandList(this.userInfo.user_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;
@@ -280,6 +280,8 @@
     // 表单提交
     submit(row,done) {
       var that = this;
+      row['tenantId'] = this.userInfo.tenant_id;
+      row['deptId'] = this.userInfo.dept_id;
       save(row).then(
         () => {
           that.$refs.form.resetFields();
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 59a2976..6d21d9e 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -224,7 +224,7 @@
     //本年农事操作记录
     getFarmingCount() {
       var that = this;
-      getFarmingCount().then((res) => {
+      getFarmingCount(this.userInfo.dept_id).then((res) => {
         that.total = res.data.data;
         // that.total = 0;
         if (that.total > 0) {
@@ -235,13 +235,13 @@
     //本年农事操作记录,分组统计
     getFarmingStatis() {
       var that = this;
-      getFarmingStatis().then((res) => {
+      getFarmingStatis(this.userInfo.dept_id).then((res) => {
         that.farmingList = res.data.data;
       });
     },
     StockCount() {
       var that = this;
-      StockCount().then((res) => {
+      StockCount(this.userInfo.dept_id).then((res) => {
         that.stockList= res.data.data;
         console.log(that.stockList)
       });
@@ -249,7 +249,7 @@
     //地块使用率统计
     getCountStatis() {
       var that = this;
-      selectCount().then((res) => {
+      selectCount(this.userInfo.dept_id).then((res) => {
         var data = res.data.data;
         that.landInfo = data;
       });
@@ -262,6 +262,8 @@
       var params = {
         status: 1,
       };
+      params['tenantId'] = this.userInfo.tenant_id;
+      params['deptId'] = this.userInfo.dept_id;
       getList(1, 10, Object.assign(params)).then((res) => {
         const data = res.data.data;
         this.farmPlanList = data.records;
diff --git a/src/views/wel/land.vue b/src/views/wel/land.vue
index 80fd86f..e34ea83 100644
--- a/src/views/wel/land.vue
+++ b/src/views/wel/land.vue
@@ -122,6 +122,8 @@
         row.userId = this.userInfo.user_id;
         row.landRange = usePolygons;
       }
+      row['tenantId'] = this.userInfo.tenant_id;
+      row['deptId'] = this.userInfo.dept_id;
       add(row).then(() => {
         that.$refs.form.resetFields();
         that.visible = false;
diff --git a/src/views/wel/plant.vue b/src/views/wel/plant.vue
index b16818e..177bc75 100644
--- a/src/views/wel/plant.vue
+++ b/src/views/wel/plant.vue
@@ -303,6 +303,8 @@
       var that = this;
       row['farmType'] = 0;
       row['createUser'] = this.userInfo.user_id;
+      row['tenantId'] = this.userInfo.tenant_id;
+      row['deptId'] = this.userInfo.dept_id;
       save(row).then(
         () => {
           that.$emit("refreshOnLoad")
diff --git a/src/views/wel/recovery.vue b/src/views/wel/recovery.vue
index 8a996a1..8bbebd7 100644
--- a/src/views/wel/recovery.vue
+++ b/src/views/wel/recovery.vue
@@ -301,6 +301,8 @@
     submit(row,done) {
       var that = this;
       row.time = row.time + ":00";
+      row['tenantId'] = this.userInfo.tenant_id;
+      row['deptId'] = this.userInfo.dept_id;
       save(row).then(
         () => {
           this.$refs.form.resetFields();
diff --git a/src/views/wel/stock.vue b/src/views/wel/stock.vue
index df78261..91ee439 100644
--- a/src/views/wel/stock.vue
+++ b/src/views/wel/stock.vue
@@ -193,6 +193,8 @@
     // 表单提交
     submit(row,done) {
       var that = this;
+      row['tenantId'] = this.userInfo.tenant_id;
+      row['deptId'] = this.userInfo.dept_id;
       add(row).then(
         () => {
           that.$refs.form.resetFields();

--
Gitblit v1.9.3