Эх сурвалжийг харах

修改了部分接口遗漏问题

duanxiaoduan 1 жил өмнө
parent
commit
e46df802ad

+ 16 - 15
src/views/statisticalAnalysis/errorAnalysis/index.vue

@@ -786,16 +786,8 @@
             <u-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
             <u-table-column sortable label="车次" min-width="45px" align="center" prop="车次" />
             <u-table-column sortable label="班次" min-width="45px" align="center" prop="班次" />
-            <u-table-column sortable label="配方名称" min-width="70px" align="center" prop="配方名称">
-              <template slot-scope="{row}">
-                <a @click="clickRecipeName3(row)" style="text-decoration: underline;color: #0000FF;">{{ row.配方名称 }}</a>
-              </template>
-            </u-table-column>
-            <u-table-column sortable label="栏舍" min-width="70px" align="center" prop="栏舍">
-              <template slot-scope="{row}">
-                <a @click="clickFence3(row)" style="text-decoration: underline;color: #0000FF;">{{ row.栏舍 }}</a>
-              </template>
-            </u-table-column>
+            <u-table-column sortable label="配方名称" min-width="45px" align="center" prop="配方名称" />
+            <u-table-column sortable label="栏舍" min-width="45px" align="center" prop="栏舍" />
             <u-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
             <u-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
             <u-table-column sortable label="误差值" min-width="45px" align="center" prop="误差值" />
@@ -823,7 +815,7 @@
     </div>
     </el-dialog>
     <!-- 查看 -->
-    <See :show.sync="isShowDialog"  :row-pid="rowPid" :start-time="startTime" :stop-time="stopTime"  :optdevice="optdevice" :title-fname="titlefname" :method-name="methodName" :error="error" />
+    <See :show.sync="isShowDialog"  :row-pid="rowPid" :start-time="startTime" :stop-time="stopTime"  :optdevice="optdevice" :title-fname="titlefname" :method-name="methodName" :method-pastureid="methodPastureid" :error="error" />
 
     <!-- 配方名称弹窗 -->
     <el-dialog :title="textMap[recipeNameTemp2.dialogStatus]" :visible.sync="recipeNameTemp2.dialogFormVisible" :close-on-click-modal="false" width="90%">
@@ -1724,6 +1716,7 @@ export default {
       },
       titlefname: '',
       methodName:'',
+      methodPastureid:'',
       rowPid: '',
       optdevice:'',
       startTime:'',
@@ -4102,7 +4095,7 @@ export default {
         data.status = this.tab.chart7.getdataListParm.parammaps.status
       }
       postJson(url, data).then(response => {
-        if (response.data !== null && response.data.list !== null && response.data.data !== null) {
+        if (response.data !== null && response.data.list !== null && response.data.data !== null && response.data.data.length>0) {
           for (let i = 0; i < response.data.data.length; i++) {
             // 撒料时间
             var b = []
@@ -4699,34 +4692,42 @@ export default {
           this.methodName = 'getDownloadedplanByJsyHL'
           this.optdevice = row.驾驶员
           this.titlefname = '准确性详情——驾驶员:' + row.驾驶员
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         }else if (this.tab.radio == 1) {
           this.methodName = 'getDownloadedplanByTemHL'
           this.optdevice = row.配方名称
           this.titlefname = '准确性详情——配方名称:' + row.配方名称
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         } else if (this.tab.radio == 2) {
           this.methodName = 'getDownloadedplanByBarHL'
           this.optdevice = row.栏舍名称
           this.titlefname = '准确性详情——栏舍名称:' + row.栏舍名称
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         } else if (this.tab.radio == 3) {
           this.methodName = 'getDownloadedplanBySCHL'
           this.optdevice = row.牲畜类别
           this.titlefname = '准确性详情——牲畜类别:' + row.牲畜类别
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         } else if (this.tab.radio == 4) {
           this.methodName = 'getDownloadedplanByTrainsHL'
           this.optdevice = row.车次
           this.titlefname = '准确性详情——车次:' + row.车次
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         } else if (this.tab.radio == 5) {
           this.methodName = 'getDownloadedplanByTmrHL'
           this.optdevice = row.TMR名称
           this.titlefname = '准确性详情——TMR名称:' + row.TMR名称
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         } else if (this.tab.radio == 6) {
           this.methodName = 'getDownloadedplanByFeedHL'
           this.optdevice = row.fname
           this.titlefname = '准确性详情——饲料:' + row.fname
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         } else if (this.tab.radio == 7) {
           this.methodName = 'getDownloadedplanByWflHL'
           this.optdevice = row.fname
           this.titlefname = '准确性详情'
+          this.methodPastureid = this.tab.table.getdataListParm.parammaps.pastureId
         }
       }else{
         // 撒料
@@ -4911,7 +4912,7 @@ export default {
         parammaps:  this.feedTemp.getdataListParm.parammaps
       }
       postJson(url, data).then(response => {
-        if (response.data.list !== null && response.data.list !== '') {
+        if (response.data.list !== null && response.data.list !== '' && response.data.list.length > 0) {
           for (let i = 0; i < response.data.list.length; i++) {
             if (response.data.list[i].arrList == null) {
               this.$set(response.data.list[i], 'arrList', [])
@@ -4970,7 +4971,7 @@ export default {
         parammaps:this.recipeNameTemp3.getdataListParm.parammaps
       }
       postJson(url, data).then(response => {
-        if (response.data.list !== null && response.data.list !=='') {
+        if (response.data.list !== null && response.data.list !=='' && response.data.list.length > 0) {
           for (let i = 0; i < response.data.list.length; i++) {
             if (response.data.list[i].arrList == null) {
               this.$set(response.data.list[i], 'arrList', [])
@@ -5029,7 +5030,7 @@ export default {
       }
       postJson(url, data).then(response => {
         this.fenceTemp.tab1.listLoading = false
-        if (response.data !== null && response.data !== '') {
+        if (response.data !== null && response.data !== '' && response.data.length>0) {
           for (let i = 0; i < response.data.length; i++) {
             if (response.data[i].ptid == undefined || response.data[i].ptname == '') {
               this.$set(response.data[i], 'ptid', '')

+ 52 - 8
src/views/statisticalAnalysis/errorAnalysis/see.vue

@@ -88,6 +88,7 @@
                   :row-style="rowStyle"
                   :cell-style="cellStyle"
                   class="elTable table-fixed"
+                  max-height="300"
                 >
                   <el-table-column label="操作编号" min-width="50px" align="center" prop="sort" />
                   <el-table-column label="栏舍名称" min-width="50px" align="center" prop="fname" />
@@ -122,12 +123,14 @@ import * as echarts from 'echarts';
 require('echarts/theme/macarons')
 import Cookies from 'js-cookie'
 import { GetDataByName,postJson, GetReportform, formatNum } from '@/api/common'
+import { parseTime } from '@/utils/index.js'
 export default {
   name: 'See',
   props: {
     show: { type: Boolean, default: false }, // 弹框可见标志
     titleFname: { type: String, defalut: '准确性详情' },
     methodName:{ type: String, defalut: '' },
+    methodPastureid:{ type: String, defalut: '' },
     rowPid: { type: String, defalut: '0' },
     optdevice: { type: String, defalut: '' },
     startTime:{ type: String, defalut: '' },
@@ -141,6 +144,7 @@ export default {
       title: '',
       pid: '',
       methodname:'',
+      methodpastureid:'',
       optdevice1:'',
       startTime1:'',
       stopTime1:'',
@@ -216,6 +220,14 @@ export default {
         this.methodname = newVal
       }
     },
+    methodPastureid: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log(newVal, 'methodPastureid')
+        this.methodpastureid = newVal
+      }
+    },
+
     optdevice: {
       immediate: true,
       handler(newVal, oldVal) {
@@ -258,6 +270,7 @@ export default {
     },
     // TMR设备列表
     getList1() {
+      console.log(this.seepastureid,'this.seepastureid')
       this.table1.listLoading = true
       this.table1.getdataListParm.name = this.methodname
       this.table1.getdataListParm.parammaps.optdevice = this.optdevice1
@@ -265,11 +278,11 @@ export default {
       this.table1.getdataListParm.parammaps.stopTime = this.stopTime1
       this.table1.getdataListParm.parammaps.pid = this.pid
       this.table1.getdataListParm.parammaps.error = this.error1
-      this.table1.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
+      this.table1.getdataListParm.parammaps.pastureid = this.methodpastureid
       let url = 'api/v1/ops/accuracy/data_by_name'
       let data = {}
       data.api_name = this.table1.getdataListParm.name
-      data.optdevice = this.table1.getdataListParm.parammaps.optdevice 
+      data.optdevice = this.table1.getdataListParm.parammaps.optdevice
       data.start_time = this.table1.getdataListParm.parammaps.startTime
       data.end_time = this.table1.getdataListParm.parammaps.stopTime
       data.pid = this.table1.getdataListParm.parammaps.pid
@@ -285,6 +298,9 @@ export default {
           this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
           this.chart1.getdataListParm.parammaps.pid = response.data.list[0].pid
           this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+          this.getList2()
+          this.getList3()
+          this.getChart1()
         } else {
           this.table1.list = []
           this.table2.getdataListParm.parammaps.pid = ''
@@ -294,9 +310,6 @@ export default {
           this.chart1.getdataListParm.parammaps.pid = ''
           this.chart1.getdataListParm.parammaps.pastureid = ''
         }
-        this.getList2()
-        this.getList3()
-        this.getChart1()
         setTimeout(() => {
           this.table1.listLoading = false
         }, 100)
@@ -305,7 +318,16 @@ export default {
     getList2() {
       this.table2.listLoading = true
       this.table2.getdataListParm.parammaps.error = this.error
-      GetDataByName(this.table2.getdataListParm).then(response => {
+      let url = 'api/v1/ops/accuracy/data_by_name'
+      let data = {}
+      data.api_name = this.table2.getdataListParm.name
+      data.error = this.table2.getdataListParm.parammaps.error
+      data.pasture_id = this.methodpastureid
+      data.pid = this.table2.getdataListParm.parammaps.pid
+      data.start_time = parseTime(new Date(), '{y}-{m}-{d}')
+      data.end_time = parseTime(new Date(), '{y}-{m}-{d}')
+      postJson(url,data).then(response => {
+      // GetDataByName(this.table2.getdataListParm).then(response => {
         console.log('混料信息数据', response.data.list)
         if (response.data !== null && response.data.list !== null) {
           this.table2.list = response.data.list
@@ -337,7 +359,17 @@ export default {
     getList3() {
       this.table3.listLoading = true
       this.table3.getdataListParm.parammaps.error = this.error
-      GetDataByName(this.table3.getdataListParm).then(response => {
+      console.log(this.table3.getdataListParm,'table2')
+      let url = 'api/v1/ops/accuracy/data_by_name'
+      let data = {}
+      data.api_name = this.table3.getdataListParm.name
+      data.error = this.table3.getdataListParm.parammaps.error
+      data.pasture_id = this.methodpastureid
+      data.pid = this.table3.getdataListParm.parammaps.pid
+      data.start_time = parseTime(new Date(), '{y}-{m}-{d}')
+      data.end_time = parseTime(new Date(), '{y}-{m}-{d}')
+      postJson(url,data).then(response => {
+      // GetDataByName(this.table3.getdataListParm).then(response => {
         if (response.data !== null && response.data.list !== null) {
           console.log('撒料信息数据', response.data.list)
           this.table3.list = response.data.list
@@ -369,7 +401,19 @@ export default {
     getChart1() {
       this.chart1.listLoading = true
       this.chart1.getdataListParm.parammaps.error = this.error
-      GetReportform(this.chart1.getdataListParm).then(response => {
+      let page = 0
+      let page_size = 0
+      let url = '/api/v1/ops/process/analysis/mixed_sprinkle_detail' + '?page=' + page + '&page_size=' + page_size
+      let data = {
+        'pasture_id':this.methodpastureid,
+        'api_name':this.chart1.getdataListParm.name,
+        'start_time':this.chart1.getdataListParm.parammaps.startTime,
+        'end_time':this.chart1.getdataListParm.parammaps.stopTime
+      }
+      if(this.chart1.getdataListParm.parammaps.pid){
+        data.pid = this.chart1.getdataListParm.parammaps.pid
+      }
+      postJson(url, data).then(response => {
         if (response.data !== null && response.data.list !== null) {
           this.chart1.list = response.data.data
           console.log('监控图', response.data.list)

+ 2 - 2
src/views/statisticalAnalysis/inventoryManagement/index.vue

@@ -52,10 +52,10 @@
       </el-tab-pane>
       <el-tab-pane label="用料分析" name="second">
         <div class="search">
-          <el-select v-model="tab2.table.getdataListParm.parammaps.pastureId" placeholder="牧场" class="filter-item" style="width: 120px;float:left;margin-right: 10px;">
+          <el-select v-model="tab2.table.getdataListParm.parammaps.pastureId" placeholder="牧场" class="filter-item filter-item1" style="width: 120px;float:left;margin-right: 10px;">
             <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
-          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 245px;" :picker-options="pickerOptions" />
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item1" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 245px;margin-right: 10px;" :picker-options="pickerOptions" />
           <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
           <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
           <span style="margin-left: 10px;">统计类型:</span>