Selaa lähdekoodia

Merge branch 'feature/ci-test12' of duanxiaoduan/tmr-group-admin into develop

duanxiaoduan 1 vuosi sitten
vanhempi
commit
8359ca5d93

+ 1 - 1
src/componentChart/BarChart.vue

@@ -2,7 +2,7 @@
   <div ref="chart"  style="width:100%;height:385px;"  />
 </template>
 <script>
-import echarts from 'echarts'
+import * as echarts from 'echarts';
 import { GetDataByName } from '@/api/common'
 import draggable from 'vuedraggable'
 import Cookies from 'js-cookie'

+ 1 - 1
src/componentChart/HorizontalBarChart.vue

@@ -2,7 +2,7 @@
   <div ref="chart"  style="width:100%;height:385px;"  />
 </template>
 <script>
-import echarts from 'echarts'
+import * as echarts from 'echarts';
 import { GetDataByName } from '@/api/common'
 import draggable from 'vuedraggable'
 import Cookies from 'js-cookie'

+ 1 - 2
src/components/index.vue

@@ -386,8 +386,7 @@
 </template>
 
 <script>
-import echarts from 'echarts'
-
+import * as echarts from 'echarts';
 require('echarts/theme/macarons')
 import { GetDataByName, GetReportform } from '@/api/common'
 import Cookies from 'js-cookie'

+ 87 - 26
src/views/recipe/recipeList/index.vue

@@ -839,22 +839,18 @@
             :cell-style="cellStyle"
             class="elTable table-fixed"
           >
-            <el-table-column label="序号" align="center" type="index" width="50px">
-              <template slot-scope="scope">
-                <span>{{ scope.$index + (usageOverview.pageNum-1) * usageOverview.pageSize + 1 }}</span>
-              </template>
-            </el-table-column>
+            <el-table-column label="序号" align="center" width="50px" type="index" />
             <!-- <el-table-column label="序号" width="60px" align="center" prop="sort" /> -->
-            <el-table-column label="牧场名称" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="混料准确率(%)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="混料正确率(%)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="撒料准确率(%)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="撒料正确率(%)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="搅拌时间(分钟)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="搅拌延时(分钟)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="撒料时间(分钟)" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="最近修改配方时间" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="下发时间" min-width="100px" align="center" prop="datetime1" />
+            <el-table-column label="牧场名称" min-width="100px" align="center" prop="pasture_name" />
+            <el-table-column label="混料准确率(%)" min-width="100px" align="center" prop="mixed_fodder_accurate_ratio" />
+            <el-table-column label="混料正确率(%)" min-width="100px" align="center" prop="mixed_fodder_correct_ratio" />
+            <el-table-column label="撒料准确率(%)" min-width="100px" align="center" prop="sprinkle_fodder_accurate_ratio" />
+            <el-table-column label="撒料正确率(%)" min-width="100px" align="center" prop="sprinkle_fodder_correct_ratio" />
+            <el-table-column label="搅拌时间(分钟)" min-width="100px" align="center" prop="add_feed_time" />
+            <el-table-column label="搅拌延时(分钟)" min-width="100px" align="center" prop="sprinkle_time" />
+            <el-table-column label="撒料时间(分钟)" min-width="100px" align="center" prop="stir_time" />
+            <el-table-column label="最近修改配方时间" min-width="100px" align="center" prop="last_edit_time" />
+            <!-- <el-table-column label="下发时间" min-width="100px" align="center" prop="datetime1" /> -->
             <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <a class="correcting" size="mini" style="width: 80px;" @click="handle_feedingefficiency(row)">饲喂效率</a>
@@ -869,6 +865,31 @@
         <el-button class="cancelClose1" @click="usageOverview.dialogFormVisible = false; ">关闭</el-button>
       </div>
     </el-dialog>
+
+
+    <el-dialog :title="textMap[feedingEfficiency.dialogStatus]" :destroy-on-close="true" :visible.sync="feedingEfficiency.dialogFormVisible" :close-on-click-modal="false" width="50%">
+    <div class="content">
+      <div><span class="title">实际牛头数</span><span class="num">{{feedingEfficiency.data.actual_number_of_cattle}}</span></div>
+      <div><span class="title">应混料量(kg)</span><span class="num">{{feedingEfficiency.data.amount_to_be_mixed}}</span></div>
+      <div><span class="title">实际混料量(kg)</span><span class="num">{{feedingEfficiency.data.class_number}}</span></div>
+      <div><span class="title">撒料量(kg)</span><span class="num"></span></div>
+      <div><span class="title">转投剩料量(kg)</span><span class="num">{{feedingEfficiency.data.leftover_material}}</span></div>
+      <div><span class="title">今日剩料量(kg)</span><span class="num">{{feedingEfficiency.data.today_leftovers}}</span></div>
+      <div><span class="title">剩料率(%)</span><span class="num">{{feedingEfficiency.data.leftover_rate}}</span></div>
+      <div><span class="title">TMR干物质(%)</span><span class="num">{{feedingEfficiency.data.tmr_dry_matter}}</span></div>
+      <div><span class="title">配方干物质采食量(kg/头)</span><span class="num">{{feedingEfficiency.data.formulated_dry_matter_intake}}</span></div>
+      <div><span class="title">实际干物质采食量(kg/头)</span><span class="num">{{feedingEfficiency.data.actual_dry_matter_intake}}</span></div>
+      <div><span class="title">采食率(%)</span><span class="num">{{feedingEfficiency.data.food_intake_rate}}</span></div>
+      <div><span class="title">配方成本(元/头)</span><span class="num">{{feedingEfficiency.data.cost_of_formulation}}</span></div>
+      <div><span class="title">实际成本(元/头)</span><span class="num">{{feedingEfficiency.data.actual_cost}}</span></div>
+      <div><span class="title">产奶量(kg/头)</span><span class="num">{{feedingEfficiency.data.milk_yield}}</span></div>
+      <div><span class="title">饲料转化率(%)</span><span class="num">{{feedingEfficiency.data.feed_conversion_ratio}}</span></div>
+      <div><span class="title">公斤奶饲料成本</span><span class="num">{{feedingEfficiency.data.feed_costs}}</span></div>
+    </div>
+    <div slot="footer" class="dialog-footer" style="bottom: 10px;">
+        <el-button class="cancelClose1" @click="feedingEfficiency.dialogFormVisible = false; ">关闭</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -946,7 +967,8 @@ export default {
       dialogFull: false,
       textMap: {
         distributeFormula: '选择牧场',
-        usageOverviewTxt:'使用概况'
+        usageOverviewTxt:'使用概况',
+        feedingEfficiencyTxt:'饲喂效率'
       },
       // ==============================
 
@@ -1164,6 +1186,11 @@ export default {
         },
         tableKey: 0, total: 0, listLoading: true, list: []
       },
+      feedingEfficiency:{
+        dialogStatus: '',
+        dialogFormVisible: false,
+        data:{}
+      },
       isEnlarge: true,
       // enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
       enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
@@ -3162,21 +3189,21 @@ export default {
       }
       const url = 'api/v1/ops/feed_formula/usage'
       const data = {
-        'feed_formula_id':this.usageOverview.temp.id,
+        'feed_formula_id':1,
         'start_time':this.usageOverview.getdataListParm.parammaps.startTime,
         'end_time':this.usageOverview.getdataListParm.parammaps.stopTime
       }
       postJson(url, data).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].arrList == null) {
-              this.$set(response.data.list[i], 'arrList', [])
-            }
-          }
-          this.usageOverview.list = response.data.list
+        if (response.data !== null) {
+          // for (let i = 0; i < response.data.list.length; i++) {
+          //   if (response.data.list[i].arrList == null) {
+          //     this.$set(response.data.list[i], 'arrList', [])
+          //   }
+          // }
+          this.usageOverview.list = response.data
           this.usageOverview.pageNum = response.data.pageNum
           this.usageOverview.pageSize = response.data.pageSize
-          this.usageOverview.total = response.data.total
+          // this.usageOverview.total = response.data.total
         } else {
           this.usageOverview.list = []
           this.usageOverview.total = 0
@@ -3191,7 +3218,33 @@ export default {
       this.getRowUsageOverviewList()
     },
     handle_feedingefficiency(row){
-
+      console.log(row,'====')
+      this.feedingEfficiency.temp = Object.assign({}, row)
+      this.textMap.feedingEfficiencyTxt = row.pasture_name
+      this.feedingEfficiency.dialogStatus = 'feedingEfficiencyTxt'
+      this.getFeedingEfficiencyList()
+    },
+    getFeedingEfficiencyList(){
+      const url = 'api/v1/ops/feed_efficiency/statistics?page='+0+'&page_size='+0
+      const data = {
+        'api_name':'getFeedEfficiencyFT',
+        'start_time':this.usageOverview.getdataListParm.parammaps.startTime,
+        'end_time':this.usageOverview.getdataListParm.parammaps.stopTime,
+        'feed_formula_id':0,
+        // 'pasture_id':[this.feedingEfficiency.temp.pasture_id]
+        'pasture_id':[0]
+      }
+      postJson(url, data).then(response => {
+        if(response.data.list){
+          let list = response.data.list
+          let dataValue = Object.values(list)
+          this.feedingEfficiency.data= dataValue[0]
+          this.feedingEfficiency.dialogFormVisible = true
+        }else{
+          this.feedingEfficiency.data= {}
+          this.feedingEfficiency.dialogFormVisible = true
+        }
+      })
     },
     handle_canceldistributingformula(row){
       MessageBox.confirm('取消后该牧场将无法继续使用该配方,确认取消吗?', {
@@ -3331,6 +3384,14 @@ export default {
     position: relative;
   }
   .hide{float: right;margin-right: 60px;}
+  .content div{
+    text-align: center;
+    line-height: 30px;
+    border-bottom: 1px solid #eee;
+  }
+  .content div .title{
+    width:250px;text-align: right;display: inline-block;margin-right: 10px;
+  }
  </style>
  <style>
   .el-color-dropdown__main-wrapper{display: none !important;}

+ 1 - 1
src/views/statisticalAnalysis/errorAnalysis/see.vue

@@ -118,7 +118,7 @@
 </template>
 
 <script>
-import echarts from 'echarts'
+import * as echarts from 'echarts';
 require('echarts/theme/macarons')
 import Cookies from 'js-cookie'
 import { GetDataByName, GetReportform, formatNum } from '@/api/common'

+ 1 - 2
src/views/statisticalAnalysis/feedingEfficiency/index.vue

@@ -541,8 +541,7 @@
 </template>
 
 <script>
-import echarts from 'echarts'
-
+import * as echarts from 'echarts';
 require('echarts/theme/macarons')
 import { GetDataByName, postJson, GetReportform, whichWeek } from '@/api/common'
 import Cookies from 'js-cookie'