From 9bee1f091eb2fc5af4f8e93fd8bdd0c98e0f2eba Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Wed, 20 Jul 2022 11:48:05 +0800
Subject: [PATCH] 1、经营概况相关问题修复

---
 src/components/date-select/index.vue |   24 ++++++-
 src/views/manage/index.vue           |  137 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 135 insertions(+), 26 deletions(-)

diff --git a/src/components/date-select/index.vue b/src/components/date-select/index.vue
index 10da1b1..4d58db9 100644
--- a/src/components/date-select/index.vue
+++ b/src/components/date-select/index.vue
@@ -4,7 +4,7 @@
             <div :class="{on: dateType == 'date'}" :data-type="'date'" :data-holder="'选择日'">
                 <span :data-type="'date'" :data-holder="'选择日'">日</span>
             </div>
-            <div :class="{on: dateType == 'month'}" :data-type="'month'" :data-holder="'选择月'">
+            <div :class="{on: dateType == 'month'}"  :data-type="'month'" :data-holder="'选择月'">
                 <span :data-type="'month'" :data-holder="'选择月'">月</span>
             </div>
             <div :class="{on: dateType == 'year'}" :data-type="'year'" :data-holder="'选择年'">
@@ -20,6 +20,7 @@
                 :type="dateType"
                 :placeholder="datePlaceHolder"
         ></el-date-picker>
+
     </div>
 </template>
 
@@ -36,15 +37,30 @@
                 currentDate: ''
             }
         },
-
+        created () {
+            var date = new Date()
+            this.currentDate = date
+        },
         methods: {
             select (e) {
-                console.log(e.target.dataset.holder)
                 this.dateType = e.target.dataset.type
                 this.datePlaceHolder = e.target.dataset.holder
+
+                var currentTime = this.gettime(this.currentDate)
+                if (this.type == 'taskSelect') {
+                    this.$parent.getTaskTime(currentTime)
+                } else if (this.type == 'ncptrSelect') {
+                    this.$parent.getNcptrTime(currentTime)
+                } else if (this.type == 'nztrSelect') {
+                    this.$parent.getNztrTime(currentTime)
+                } else if (this.type == 'cltjSelect') {
+                    this.$parent.getCltjTime(currentTime)
+                } else if (this.type == 'symSelect') {
+                    this.$parent.getSymTime(currentTime)
+                }
             },
             selectChange (e) {
-                const currentTime = this.gettime(e)
+                var currentTime = this.gettime(e)
                 if (this.type == 'taskSelect') {
                     this.$parent.getTaskTime(currentTime)
                 } else if (this.type == 'ncptrSelect') {
diff --git a/src/views/manage/index.vue b/src/views/manage/index.vue
index a6deaa8..cf65571 100644
--- a/src/views/manage/index.vue
+++ b/src/views/manage/index.vue
@@ -277,8 +277,8 @@
                             class="search-input"
                             size="small"
                             prefix-icon="el-icon-search"
-                            placeholder="请输入内容"
-                            v-model="input1"
+                            placeholder="请输入农资"
+                            v-model="inputTRP_nzname"
                         ></el-input>
                     </div>
                     <div class="btn-grounp">
@@ -287,12 +287,14 @@
                             class="search"
                             type="primary"
                             icon="el-icon-search"
+                            @click="TRP_query"
                         >查询</el-button>
                         <el-button
                             size="small"
                             class="reset"
                             type="info"
                             icon="el-icon-refresh-right"
+                            @click="TRP_refresh"
                         >重置</el-button>
                     </div>
                 </div>
@@ -306,7 +308,7 @@
                         <div>厂家</div>
                     </div>
                     <div class="t-body">
-                        <div class="table-list"  v-for="(item,index) in nztr" :key="index">
+                        <div class="table-list"  v-for="(item,index) in nztrAll" :key="index">
                             <div>{{item.agrname}}</div>
                             <div>{{item.stype}}</div>
                             <div>{{item.spn}}</div>
@@ -341,8 +343,8 @@
                                 class="search-input"
                                 size="small"
                                 prefix-icon="el-icon-search"
-                                placeholder="请输入内容"
-                                v-model="input1"
+                                placeholder="请输入农资"
+                                v-model="inputNZ_nzname"
                         ></el-input>
                     </div>
                     <div class="btn-grounp">
@@ -351,12 +353,14 @@
                                 class="search"
                                 type="primary"
                                 icon="el-icon-search"
+                                @click="NZCR_query"
                         >查询</el-button>
                         <el-button
                                 size="small"
                                 class="reset"
                                 type="info"
                                 icon="el-icon-refresh-right"
+                                @click="NZCR_refresh"
                         >重置</el-button>
                     </div>
                 </div>
@@ -373,7 +377,7 @@
                     <div class="t-body">
                         <div class="table-list"  v-for="(item,index) in stockrecordAll" :key="index">
                             <div style="width: 225px">{{item.agrname}}</div>
-                            <div>{{item.stype}}</div>
+                            <div>{{item.stype == 0 ? '采购入库':'调拨入库'}}</div>
                             <div>{{item.spn}}</div>
                             <div>{{item.type1}}</div>
                             <div>{{item.count}}</div>
@@ -407,8 +411,8 @@
                                 class="search-input"
                                 size="small"
                                 prefix-icon="el-icon-search"
-                                placeholder="请输入内容"
-                                v-model="input1"
+                                placeholder="请输入农资"
+                                v-model="inputNCP_nzname"
                         ></el-input>
                     </div>
                     <div class="btn-grounp">
@@ -417,12 +421,14 @@
                                 class="search"
                                 type="primary"
                                 icon="el-icon-search"
+                                @click="NCP_query"
                         >查询</el-button>
                         <el-button
                                 size="small"
                                 class="reset"
                                 type="info"
                                 icon="el-icon-refresh-right"
+                                @click="NCP_refresh"
                         >重置</el-button>
                     </div>
                 </div>
@@ -439,12 +445,12 @@
                     <div class="t-body">
                         <div class="table-list"  v-for="(item,index) in ncpAll" :key="index">
                             <div>{{item.strainName}}</div>
-                            <div>{{item.jobWay}}</div>
+                            <div>{{item.jobWay == 0 ? '人工':'机械'}}</div>
                             <div>{{item.landName}}</div>
                             <div>{{Number(item.leaves) + 1}}等品</div>
                             <div>{{item.weight}}公斤</div>
                             <div>{{item.createTime}}</div>
-                            <div>{{item.operator}}</div>
+                            <div>{{item.realName}}</div>
                         </div>
                     </div>
                 </div>
@@ -630,6 +636,8 @@
             plotNumArray: [],
             // 农事类型下拉
             farmingList: [],
+            // 农资投入记录窗体
+            nztrAll: [],
             // 农资出入库记录弹窗
             stockrecordAll: [],
             // 农产品监管记录弹窗
@@ -638,7 +646,9 @@
             farmSelect: [],
             // 所选值
             farmValue: 1,
-            input1: ''
+            inputNZ_nzname: '',
+            inputTRP_nzname: '',
+            inputNCP_nzname: ''
         }
     },
     created () {
@@ -658,26 +668,30 @@
         },
         // 全局数据刷新事件
         AllDataUpdate () {
+            // 获取当前时间
+            var date = new Date()
+            var y = date.getFullYear() + '-' + this.checkTime(date.getMonth() + 1)
+            var n = date.getFullYear() + ''
             this.selectXCount()
             this.getStockCount()
             // 年产量与库存数量
-            this.statisticsStockAndYield('2022')
+            this.statisticsStockAndYield(n)
             // 按月统计产量
-            this.statisticsStockMonth('2022-07')
+            this.statisticsStockMonth(y)
             // 农产品投入
-            this.pageCount('2022-07')
+            this.pageCount(y)
             // 农资投入
-            this.pageCountNz('2022-07')
+            this.pageCountNz(y)
             // 统计市场流通/去年流通量/本月流通量
-            this.selectMarketCirculate('2022')
+            this.selectMarketCirculate(n)
             // 统计任务总数
-            this.countTaskNum('2022-07')
+            this.countTaskNum(y)
             // 溯源趋势统计
-            this.getSweepRecordStatisticsByDayOrMonthOrYear('2022-07')
+            this.getSweepRecordStatisticsByDayOrMonthOrYear(y)
             // 农事操作
             this.farmingRecords()
             // 农产品监管
-            this.productsSupervise('2022')
+            this.productsSupervise(n)
             // 农资出入库记录
             this.pageCountNzCrk()
             // 溯源次数统计
@@ -699,7 +713,7 @@
             } else {
                 var params = {}
                 params.codes = '000000'
-                params.deptId = '1123598813738675201'
+                params.farmId = this.farmValue
                 params.current = '1'
                 params.size = '999'
                 productsSuperviseList(Object.assign(params)).then((res) => {
@@ -764,6 +778,78 @@
         // 溯源趋势时间查询
         getSymTime (e) {
             this.getSweepRecordStatisticsByDayOrMonthOrYear(e)
+        },
+        // 农资出库记录查询按钮
+        NZCR_query () {
+            var params = {}
+            params.codes = '000000'
+            params.farmId = this.farmValue
+            params.agrname = this.inputNZ_nzname
+            params.current = '1'
+            params.size = '999'
+            pageCountNzCrk(Object.assign(params)).then((res) => {
+                this.nzcrPopupFlag = true
+                this.stockrecordAll = res.data.data.records
+            })
+        },
+        // 农资出库记录重置按钮
+        NZCR_refresh () {
+            var params = {}
+            this.inputNZ_nzname = ''
+            params.codes = '000000'
+            params.farmId = this.farmValue
+            params.current = '1'
+            params.size = '999'
+            pageCountNzCrk(Object.assign(params)).then((res) => {
+                this.nzcrPopupFlag = true
+                this.stockrecordAll = res.data.data.records
+            })
+        },
+        // 投入品监管查询按钮
+        TRP_query () {
+            var params = {}
+            params.codes = '000000'
+            params.agrname = this.inputTRP_nzname
+            params.farmId = this.farmValue
+            pageCountNz(Object.assign(params)).then((res) => {
+                this.nztrAll = res.data.data.records
+            })
+        },
+        // 投入品监管重置按钮
+        TRP_refresh () {
+            var params = {}
+            params.codes = '000000'
+            this.inputTRP_nzname = ''
+            params.farmId = this.farmValue
+            pageCountNz(Object.assign(params)).then((res) => {
+                this.nztrAll = res.data.data.records
+            })
+        },
+        // 农产品监管查询按钮
+        NCP_query () {
+            var params = {}
+            params.codes = '000000'
+            params.strainName = this.inputNCP_nzname
+            params.farmId = this.farmValue
+            params.current = '1'
+            params.size = '999'
+            productsSuperviseList(Object.assign(params)).then((res) => {
+                this.ncpPopupFlag = true
+                this.ncpAll = res.data.data.records
+            })
+        },
+        // 农产品监管重置按钮
+        NCP_refresh () {
+            var params = {}
+            params.codes = '000000'
+            this.inputNCP_nzname = ''
+            params.farmId = this.farmValue
+            params.current = '1'
+            params.size = '999'
+            productsSuperviseList(Object.assign(params)).then((res) => {
+                this.ncpPopupFlag = true
+                this.ncpAll = res.data.data.records
+            })
         },
         initBar (dom) {
             const that = this
@@ -1293,6 +1379,7 @@
             params.year = e
             pageCountNz(Object.assign(params)).then((res) => {
                 this.nztr = res.data.data.records
+                this.nztrAll = res.data.data.records
                 // 投入品监管图表
                 this.initTrpBar('TrpEcharts')
             })
@@ -1409,6 +1496,12 @@
             getLandList(Object.assign(params)).then(res => {
                 this.plotNumArray = res.data.data
             })
+        },
+        checkTime (i) {
+            if (i < 10) {
+                i = '0' + i
+            }
+            return i
         }
     }
 }
@@ -1619,7 +1712,7 @@
                         display: flex;
                         align-items: center;
                         font-size: 16px;
-
+                        cursor:pointer;
                         img {
                             margin-left: 6px;
                             vertical-align: middle;
@@ -1761,7 +1854,7 @@
                         display: flex;
                         align-items: center;
                         font-size: 16px;
-
+                        cursor:pointer;
                         img {
                             margin-left: 6px;
                             vertical-align: middle;

--
Gitblit v1.9.3