Ver código fonte

1.撒料计划新增物料详情;2.日执行撒料计划新增物料详情;3.栏舍配方修改特殊数据;4.剩料记录新增干物质;5.饲喂效率修改泌乳牛干物质图表

duanxiaoduan 1 ano atrás
pai
commit
26db5b2ba8

+ 2 - 2
.env.development

@@ -4,9 +4,9 @@ ENV = 'development'
 # base api
 # 测试线
 # VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
-VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 白少后台本地
-# VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
+VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
 # VUE_APP_BASE_API = 'http://192.168.1.93/'
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 3 - 3
src/utils/request.js

@@ -14,9 +14,9 @@ if (DoMainString) {
 var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
 var browserUrl = window.location.hostname
 console.log("========url===",reg.test(browserUrl))
-if (reg.test(browserUrl)){
-  URL = window.location.protocol +"//"+ browserUrl + ":8082/"
-}
+// if (reg.test(browserUrl)){
+//   URL = window.location.protocol +"//"+ browserUrl + ":8082/"
+// }
 
 Cookies.set('url',URL)
 console.log(process.env.VUE_APP_BASE_API,'===========URL1111')

+ 77 - 5
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -86,6 +86,22 @@
           <template slot-scope="scope">
             <span>{{ scope.row.ftname }}</span>
           </template>
+        </el-table-column>
+        <el-table-column label="物料详情" width="90px" align="center">
+          <template slot-scope="scope">
+            <el-popover
+              placement="bottom"
+              width="400"
+              trigger="click">
+              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+              <el-table :data="materialdetailsList" border height="200">
+                <el-table-column min-width="150" property="fname" label="物料" />
+                <el-table-column min-width="100" property="fweight" label="重量" />
+                <el-table-column min-width="100" property="scale" label="占比" />
+              </el-table>
+              <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">详情</span>
+            </el-popover>
+          </template>
         </el-table-column>
         <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="70px" align="center">
           <template slot-scope="scope">
@@ -294,10 +310,29 @@
                             >{{ item.barname }}</span>
                             <button style="background: red;float: right;width: 18px;color: #fff;font-size: 18px;border: none;text-align: center;" :disabled="isokDisable" @click="clickBar(item)">√</button>
                           </div>
+                        </el-tooltip>
+                        <el-tooltip placement="bottom" style="height: 18px;line-height: 18px;" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
+                          <div slot="content">{{ item.weight }}</div>
+                          <div class="barWeight">
+                            <span style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ item.weight }}</span>
+                            <el-popover
+                              placement="right"
+                              width="400"
+                              trigger="click">
+                              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                              <el-table :data="materialdetailsList" height="200" border>
+                                <el-table-column min-width="150" property="fname" label="物料" />
+                                <el-table-column min-width="100" property="fweight" label="重量" />
+                                <el-table-column min-width="100" property="scale" label="占比" />
+                              </el-table>
+                              <!-- <span  style="color: blue;">详情</span> -->
+                              <button slot="reference" style="background: #ccc;float: right;color: #fff;width: 18px;height:18px;font-size: 16px;border: none;text-align: center;" :disabled="isokDisable">?</button>
+                            </el-popover>
+                          </div>
                         </el-tooltip>
-                        <div class="barWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
+                        <!-- <div class="barWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
                           {{ item.weight }}
-                        </div>
+                        </div> -->
                       </div>
                     </div>
                   </li>
@@ -388,6 +423,19 @@
                   </div>
                   <div class="arr-t" :style="{'background':element.background}">
                     <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
+                    <el-popover
+                      placement="bottom"
+                      width="400"
+                      height="200"
+                      trigger="click">
+                      <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                      <el-table :data="materialdetailsList" height="200" border>
+                       <el-table-column min-width="150" property="fname" label="物料" />
+                       <el-table-column min-width="100" property="fweight" label="重量" />
+                       <el-table-column min-width="100" property="scale" label="占比" />
+                      </el-table>
+                      <i slot="reference" class="el-icon-question" style="position: absolute;right: 0;top: 20px;"/>
+                    </el-popover>
                   </div>
                 </div>
               </draggable>
@@ -469,7 +517,8 @@ export default {
       cellStyle: {
         padding: 0 + 'px'
       },
-      height: document.body.clientHeight - 220, // table高度
+      height: document.body.clientHeight - 220, // table高度
+      materialdetailsList: [],
       table: {
         getdataListParm: {
           page: 1,
@@ -790,7 +839,12 @@ export default {
     changeTemplateFormulation(item) {
       this.create.temp.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
       this.create.temp.ftvolume = this.templateFormulationList.find(obj => obj.id === item).volume
-      this.getCreateList1()
+      this.getCreateList1()
+      var obj = {
+        'pastureid':this.create.temp.pastureid,
+        'ftid':this.create.temp.ftid
+      }
+      this.getmaterialdetailsList(obj)
     },
     changeTimes(item) {
       this.getCreateList1()
@@ -1337,7 +1391,8 @@ export default {
       this.create.temp.mytmrid = row.tmrid
       console.log('this.create.temp', this.create.temp)
       this.create.checkBarList = []
-      this.getCreateList1()
+      this.getCreateList1()
+      this.getmaterialdetailsList(row)
     },
     updateData() {
       this.$refs['temp'].validate(valid => {
@@ -1865,6 +1920,23 @@ export default {
           }
         })
       })
+    },
+    getmaterialdetailsList(item){
+      let url = 'authdata/GetDataByName'
+      let data  = {
+        name:"getFTdetailList",page:1,offset:1,pagecount:"",returntype:"Map",
+        parammaps:{
+          pastureid:item.pastureid,ftid:item.ftid,
+          // fttypeid:item.fttypeid,
+        }
+      }
+      postJson(url, data).then(response => {
+        if (response.msg !== 'fail') {
+          this.materialdetailsList = response.data.list
+        } else {
+          this.materialdetailsList = []
+        }
+      })
     }
   }
 }

+ 164 - 68
src/views/formulationPlan/dhedFormula/index.vue

@@ -1666,12 +1666,12 @@ export default {
         row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
         row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
       }
-      if (row.w1 == '') { row.w1 = 0 }
-      if (row.w2 == '') { row.w2 = 0 }
-      if (row.w3 == '') { row.w3 = 0 }
-      if (row.w4 == '') { row.w4 = 0 }
-      if (row.w5 == '') { row.w5 = 0 }
-      if (row.w6 == '') { row.w6 = 0 }
+      if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
+      if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
+      if (row.w3 == '' || row.w3 == undefined || isNaN(row.w3)) { row.w3 = 0 }
+      if (row.w4 == '' || row.w4 == undefined || isNaN(row.w4)) { row.w4 = 0 }
+      if (row.w5 == '' || row.w5 == undefined || isNaN(row.w5)) { row.w5 = 0 }
+      if (row.w6 == '' || row.w6 == undefined || isNaN(row.w6)) { row.w6 = 0 }
 
       // 系数不变
       // 系数头数=实际牛头数*系数
@@ -1686,12 +1686,12 @@ export default {
         row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
         row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
       }
-      if (row.w1 == '') { row.w1 = 0 }
-      if (row.w2 == '') { row.w2 = 0 }
-      if (row.w3 == '') { row.w3 = 0 }
-      if (row.w4 == '') { row.w4 = 0 }
-      if (row.w5 == '') { row.w5 = 0 }
-      if (row.w6 == '') { row.w6 = 0 }
+      if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
+      if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
+      if (row.w3 == '' || row.w3 == undefined || isNaN(row.w3)) { row.w3 = 0 }
+      if (row.w4 == '' || row.w4 == undefined || isNaN(row.w4)) { row.w4 = 0 }
+      if (row.w5 == '' || row.w5 == undefined || isNaN(row.w5)) { row.w5 = 0 }
+      if (row.w6 == '' || row.w6 == undefined || isNaN(row.w6)) { row.w6 = 0 }
       // 配方重量=实际牛头数*系数*配方模板取Sfweight
       row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
       // 实际牛头数不变
@@ -1705,12 +1705,12 @@ export default {
         row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
         row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
       }
-      if (row.w1 == '') { row.w1 = 0 }
-      if (row.w2 == '') { row.w2 = 0 }
-      if (row.w3 == '') { row.w3 = 0 }
-      if (row.w4 == '') { row.w4 = 0 }
-      if (row.w5 == '') { row.w5 = 0 }
-      if (row.w6 == '') { row.w6 = 0 }
+      if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
+      if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
+      if (row.w3 == '' || row.w3 == undefined || isNaN(row.w3)) { row.w3 = 0 }
+      if (row.w4 == '' || row.w4 == undefined || isNaN(row.w4)) { row.w4 = 0 }
+      if (row.w5 == '' || row.w5 == undefined || isNaN(row.w5)) { row.w5 = 0 }
+      if (row.w6 == '' || row.w6 == undefined || isNaN(row.w6)) { row.w6 = 0 }
       // 配方重量=实际牛头数*系数*配方模板取Sfweight
       row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
       // 实际牛头数不变
@@ -1724,34 +1724,82 @@ export default {
       // 未锁定时:各班次比例不变,各班次重量=配方重量*各班次比例
       // 锁定时:未锁定班次比例不变,锁定班次比例=班次重量/配方重量x100%
       if(row.isOneWeight == true){
-        row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(row.w1 && row.ftweight && !isNaN(parseFloat(row.w1)) && !isNaN(parseFloat(row.ftweight))){
+          row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r1 =  0
+        }
       }else{
-        row.w1 = (parseFloat(row.ftweight) * parseFloat(row.r1) / 100).toFixed(this.decimal)
+        if(row.r1 && row.ftweight && !isNaN(parseFloat(row.r1)) && !isNaN(parseFloat(row.ftweight))){
+          row.w1 = (parseFloat(row.ftweight) * parseFloat(row.r1) / 100).toFixed(this.decimal)
+        }else{
+          row.w1 = 0
+        }
       }
       if(row.isTwoWeight == true){
-        row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(row.w2 && row.ftweight && !isNaN(parseFloat(row.w2)) && !isNaN(parseFloat(row.ftweight))){
+          row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r2 =  0
+        }
       }else{
-        row.w2 = (parseFloat(row.ftweight) * parseFloat(row.r2) / 100).toFixed(this.decimal)
+        if(row.r2 && row.ftweight && !isNaN(parseFloat(row.r2)) && !isNaN(parseFloat(row.ftweight))){
+          row.w2 = (parseFloat(row.ftweight) * parseFloat(row.r2) / 100).toFixed(this.decimal)
+        }else{
+          row.w2 = 0
+        }
       }
       if(row.isThreeWeight == true){
-        row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(row.w3 && row.ftweight && !isNaN(parseFloat(row.w3)) && !isNaN(parseFloat(row.ftweight))){
+          row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r3 =  0
+        }
       }else{
-        row.w3 = (parseFloat(row.ftweight) * parseFloat(row.r3) / 100).toFixed(this.decimal)
+        if(row.r3 && row.ftweight && !isNaN(parseFloat(row.r3)) && !isNaN(parseFloat(row.ftweight))){
+          row.w3 = (parseFloat(row.ftweight) * parseFloat(row.r3) / 100).toFixed(this.decimal)
+        }else{
+          row.w3 = 0
+        }
       }
       if(row.isFourWeight == true){
-        row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(row.w4 && row.ftweight && !isNaN(parseFloat(row.w4)) && !isNaN(parseFloat(row.ftweight))){
+          row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r4 =  0
+        }
       }else{
-        row.w4 = (parseFloat(row.ftweight) * parseFloat(row.r4) / 100).toFixed(this.decimal)
+        if(row.r4 && row.ftweight && !isNaN(parseFloat(row.r4)) && !isNaN(parseFloat(row.ftweight))){
+          row.w4 = (parseFloat(row.ftweight) * parseFloat(row.r4) / 100).toFixed(this.decimal)
+        }else{
+          row.w4 = 0
+        }
       }
       if(row.isFiveWeight == true){
-        row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(row.w5 && row.ftweight && !isNaN(parseFloat(row.w5)) && !isNaN(parseFloat(row.ftweight))){
+          row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r5 =  0
+        }
       }else{
-        row.w5 = (parseFloat(row.ftweight) * parseFloat(row.r5) / 100).toFixed(this.decimal)
+        if(row.r5 && row.ftweight && !isNaN(parseFloat(row.r5)) && !isNaN(parseFloat(row.ftweight))){
+          row.w5 = (parseFloat(row.ftweight) * parseFloat(row.r5) / 100).toFixed(this.decimal)
+        }else{
+          row.w5 = 0
+        }
       }
       if(row.isSixWeight == true){
-        row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(row.w6 && row.ftweight && !isNaN(parseFloat(row.w6)) && !isNaN(parseFloat(row.ftweight))){
+          row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r5 =  0
+        }
       }else{
-        row.w6 = (parseFloat(row.ftweight) * parseFloat(row.r6) / 100).toFixed(this.decimal)
+        if(row.r6 && row.ftweight && !isNaN(parseFloat(row.r6)) && !isNaN(parseFloat(row.ftweight))){
+          row.w6 = (parseFloat(row.ftweight) * parseFloat(row.r6) / 100).toFixed(this.decimal)
+        }else{
+          row.w6 = 0
+        }
       }
       console.log(row,'row2')
 
@@ -1810,26 +1858,50 @@ export default {
       }
       // 配方重量=实际牛头数*系数*配方模板取Sfweight
       row.ftweight = (parseFloat(row.ccount) * parseFloat(row.ratio) / 100 * parseFloat(row.Sfweight)).toFixed(this.decimal)
-        console.log(parseFloat(row.ccount))
-        console.log(parseFloat(row.ftweight))
+        console.log(parseFloat(row.ccount),'======ccount')
+        console.log(parseFloat(row.ftweight),'======ftweight')
       if(item == 1){
         // 一班比例
-        row.w1 = (parseFloat(row.r1)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        if(!isNaN(parseFloat(row.r1)) && !isNaN(parseFloat(row.ftweight)) && row.r1 && row.ftweight){
+          row.w1 = (parseFloat(row.r1)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        }else{
+          row.w1 = 0
+        }
       }else if(item == 2){
         // 二班比例
-        row.w2 = (parseFloat(row.r2)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        if(!isNaN(parseFloat(row.r2)) && !isNaN(parseFloat(row.ftweight)) && row.r2 && row.ftweight){
+          row.w2 = (parseFloat(row.r2)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        }else{
+          row.w2 = 0
+        }
       }else if(item == 3){
         // 三班比例
-        row.w3 = (parseFloat(row.r3)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        if(!isNaN(parseFloat(row.r3)) && !isNaN(parseFloat(row.ftweight)) && row.r3 && row.ftweight){
+          row.w3 = (parseFloat(row.r3)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        }else{
+          row.w3 = 0
+        }
       }else if(item == 4){
         // 四班比例
-        row.w4 = (parseFloat(row.r4)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        if(!isNaN(parseFloat(row.r4)) && !isNaN(parseFloat(row.ftweight)) && row.r4 && row.ftweight){
+          row.w4 = (parseFloat(row.r4)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        }else{
+          row.w4 = 0
+        }
       }else if(item == 5){
         // 五班比例
-        row.w5 = (parseFloat(row.r5)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        if(!isNaN(parseFloat(row.r5)) && !isNaN(parseFloat(row.ftweight)) && row.r5 && row.ftweight){
+          row.w5 = (parseFloat(row.r5)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        }else{
+          row.w5 = 0
+        }
       }else if(item == 6){
         // 六班比例
-        row.w6 = (parseFloat(row.r6)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        if(!isNaN(parseFloat(row.r6)) && !isNaN(parseFloat(row.ftweight)) && row.r6 && row.ftweight){
+          row.w6 = (parseFloat(row.r6)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
+        }else{
+          row.w6 = 0
+        }
       }
       // 总比例=所有比例之和
       // 饲喂投喂量 = 所有班次重量之和
@@ -1850,12 +1922,12 @@ export default {
       if(row.w6 && !isNaN(row.w6)){ sumw += parseFloat(row.w6) }
       this.$set(row, 'sumw', sumw.toFixed(this.decimal))
       // 日投喂量 = 饲喂投喂量+补料
-      if (isNaN(row.bw1)|| row.bw1 == '') { this.$set(row, 'bw1', 0) }
-      if (isNaN(row.bw2)|| row.bw2 == '') { this.$set(row, 'bw2', 0) }
-      if (isNaN(row.bw3)|| row.bw3 == '') { this.$set(row, 'bw3', 0) }
-      if (isNaN(row.bw4)|| row.bw4 == '') { this.$set(row, 'bw4', 0) }
-      if (isNaN(row.bw5)|| row.bw5 == '') { this.$set(row, 'bw5', 0) }
-      if (isNaN(row.bw6)|| row.bw6 == '') { this.$set(row, 'bw6', 0) }
+      if (isNaN(row.bw1) || row.bw1 == '' || row.bw1 == undefined) { this.$set(row, 'bw1', 0) }
+      if (isNaN(row.bw2) || row.bw2 == '' || row.bw1 == undefined) { this.$set(row, 'bw2', 0) }
+      if (isNaN(row.bw3) || row.bw3 == '' || row.bw1 == undefined) { this.$set(row, 'bw3', 0) }
+      if (isNaN(row.bw4) || row.bw4 == '' || row.bw1 == undefined) { this.$set(row, 'bw4', 0) }
+      if (isNaN(row.bw5) || row.bw5 == '' || row.bw1 == undefined) { this.$set(row, 'bw5', 0) }
+      if (isNaN(row.bw6) || row.bw6 == '' || row.bw1 == undefined) { this.$set(row, 'bw6', 0) }
       var sumbw = 0
       if(row.bw1 && !isNaN(row.bw1)){ sumbw += parseFloat(row.bw1) }
       if(row.bw2 && !isNaN(row.bw2)){ sumbw += parseFloat(row.bw2) }
@@ -1900,22 +1972,46 @@ export default {
       }
       if(item == 1){
         // 一班重量
-        row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(!isNaN(parseFloat(row.w1)) && !isNaN(parseFloat(row.ftweight)) && row.w1 && row.ftweight){
+          row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r1 = 0
+        }
       }else if(item == 2){
         // 二班重量
-        row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(!isNaN(parseFloat(row.w2)) && !isNaN(parseFloat(row.ftweight)) && row.w2 && row.ftweight){
+          row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r2 = 0
+        }
       }else if(item == 3){
         // 三班重量
-        row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(!isNaN(parseFloat(row.w3)) && !isNaN(parseFloat(row.ftweight)) && row.w3 && row.ftweight){
+          row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r3 = 0
+        }
       }else if(item == 4){
         // 四班重量
-        row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(!isNaN(parseFloat(row.w4)) && !isNaN(parseFloat(row.ftweight)) && row.w4 && row.ftweight){
+          row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r4 = 0
+        }
       }else if(item == 5){
         // 五班重量
-        row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(!isNaN(parseFloat(row.w5)) && !isNaN(parseFloat(row.ftweight)) && row.w5 && row.ftweight){
+          row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r5 = 0
+        }
       }else if(item == 6){
         // 六班重量
-        row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        if(!isNaN(parseFloat(row.w6)) && !isNaN(parseFloat(row.ftweight)) && row.w6 && row.ftweight){
+          row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
+        }else{
+          row.r6 = 0
+        }
       }
       // 总比例=所有比例之和
       // 饲喂投喂量 = 所有班次重量之和
@@ -1936,12 +2032,12 @@ export default {
       if(row.w6 && !isNaN(row.w6)){ sumw += parseFloat(row.w6) }
       this.$set(row, 'sumw', sumw.toFixed(this.decimal))
       // 日投喂量 = 饲喂投喂量+补料
-      if (isNaN(row.bw1)|| row.bw1 == '') { this.$set(row, 'bw1', 0) }
-      if (isNaN(row.bw2)|| row.bw2 == '') { this.$set(row, 'bw2', 0) }
-      if (isNaN(row.bw3)|| row.bw3 == '') { this.$set(row, 'bw3', 0) }
-      if (isNaN(row.bw4)|| row.bw4 == '') { this.$set(row, 'bw4', 0) }
-      if (isNaN(row.bw5)|| row.bw5 == '') { this.$set(row, 'bw5', 0) }
-      if (isNaN(row.bw6)|| row.bw6 == '') { this.$set(row, 'bw6', 0) }
+      if (isNaN(row.bw1) || row.bw1 == '' || row.bw1 == undefined) { this.$set(row, 'bw1', 0) }
+      if (isNaN(row.bw2) || row.bw2 == '' || row.bw2 == undefined) { this.$set(row, 'bw2', 0) }
+      if (isNaN(row.bw3) || row.bw3 == '' || row.bw3 == undefined) { this.$set(row, 'bw3', 0) }
+      if (isNaN(row.bw4) || row.bw4 == '' || row.bw4 == undefined) { this.$set(row, 'bw4', 0) }
+      if (isNaN(row.bw5) || row.bw5 == '' || row.bw5 == undefined) { this.$set(row, 'bw5', 0) }
+      if (isNaN(row.bw6) || row.bw6 == '' || row.bw6 == undefined) { this.$set(row, 'bw6', 0) }
       var sumbw = 0
       if(row.bw1 && !isNaN(row.bw1)){ sumbw += parseFloat(row.bw1) }
       if(row.bw2 && !isNaN(row.bw2)){ sumbw += parseFloat(row.bw2) }
@@ -2089,40 +2185,40 @@ export default {
       if (row.softccount == '') {
         row.softccount = 0
       }
-      if (row.r1 == '') {
+      if (row.r1 == '' || isNaN(row.r1)) {
         row.r1 = 0
       }
-      if (row.r2 == '') {
+      if (row.r2 == '' || isNaN(row.r2)) {
         row.r2 = 0
       }
-      if (row.r3 == '') {
+      if (row.r3 == '' || isNaN(row.r3)) {
         row.r3 = 0
       }
-      if (row.r4 == '') {
+      if (row.r4 == '' || isNaN(row.r4)) {
         row.r4 = 0
       }
-      if (row.r5 == '') {
+      if (row.r5 == '' || isNaN(row.r5)) {
         row.r5 = 0
       }
-      if (row.r6 == '') {
+      if (row.r6 == '' || isNaN(row.r6)) {
         row.r6 = 0
       }
-      if (row.w1 == '') {
+      if (row.w1 == '' || isNaN(row.w1)) {
         row.w1 = 0
       }
-      if (row.w2 == '' || row.w4 == NaN) {
+      if (row.w2 == '' || isNaN(row.w2)) {
         row.w2 = 0
       }
-      if (row.w3 == '' || row.w4 == NaN) {
+      if (row.w3 == '' || isNaN(row.w3)) {
         row.w3 = 0
       }
-      if (row.w4 == '' || row.w4 == NaN) {
+      if (row.w4 == '' || isNaN(row.w4)) {
         row.w4 = 0
       }
-      if (row.w5 == '' || row.w5 == NaN) {
+      if (row.w5 == '' || isNaN(row.w5)) {
         row.w5 = 0
       }
-      if (row.w6 == '' || row.w6 == NaN) {
+      if (row.w6 == '' || isNaN(row.w6)) {
         row.w6 = 0
       }
       console.log(row, '===========')

+ 76 - 3
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -88,6 +88,22 @@
             <span>{{ scope.row.ftname }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="物料详情" width="90px" align="center">
+          <template slot-scope="scope">
+            <el-popover
+              placement="bottom"
+              width="400"
+              trigger="click">
+              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+              <el-table :data="materialdetailsList" border height="200">
+                <el-table-column min-width="150" property="fname" label="物料" />
+                <el-table-column min-width="100" property="fweight" label="重量" />
+                <el-table-column min-width="100" property="scale" label="占比" />
+              </el-table>
+              <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">详情</span>
+            </el-popover>
+          </template>
+        </el-table-column>
         <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="70px" align="center">
           <template slot-scope="scope">
             <el-switch v-model="scope.row.issplit" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
@@ -262,7 +278,27 @@
                             <button style="background: red;float: right;color: #fff;width: 18px;font-size: 18px;border: none;text-align: center;" :disabled="isokDisable" @click="clickBar(item)">√</button>
                           </div>
                         </el-tooltip>
-                        <div class="barWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }"> {{ item.weight }} </div>
+                        <el-tooltip placement="bottom" style="height: 18px;line-height: 18px;" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
+                          <div slot="content">{{ item.weight }}</div>
+                          <div class="barWeight">
+                            <span style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ item.weight }}</span>
+                            <el-popover
+                              placement="right"
+                              width="400"
+                              trigger="click">
+                              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                              <el-table :data="materialdetailsList" height="200" border>
+                                <el-table-column min-width="150" property="fname" label="物料" />
+                                <el-table-column min-width="100" property="fweight" label="重量" />
+                                <el-table-column min-width="100" property="scale" label="占比" />
+                              </el-table>
+                              <!-- <span  style="color: blue;">详情</span> -->
+                              <button slot="reference" style="background: #ccc;float: right;color: #fff;width: 18px;height:18px;font-size: 16px;border: none;text-align: center;" :disabled="isokDisable">?</button>
+                            </el-popover>
+                          </div>
+                        </el-tooltip>
+                        <!-- <div class="barWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }"> {{ item.weight }} </div> -->
+
                       </div>
                     </div>
                   </li>
@@ -280,7 +316,7 @@
           </el-row>
           <!-- 撒料 -->
           <div class="spreadingMaterial">
-            <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
+            <div>撒料:<el-button type="danger" @click="handleEmpty">清空1</el-button></div>
             <div class="spreadingMaterialList">
               <!-- force-fallback="true" -->
               <draggable
@@ -353,6 +389,20 @@
                   </div>
                   <div class="arr-t" :style="{'background':element.background}">
                     <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
+                    <el-popover
+                      placement="bottom"
+                      width="400"
+                      height="200"
+                      trigger="click">
+                      <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                      <el-table :data="materialdetailsList" height="200" border>
+                       <el-table-column min-width="150" property="fname" label="物料" />
+                       <el-table-column min-width="100" property="fweight" label="重量" />
+                       <el-table-column min-width="100" property="scale" label="占比" />
+                      </el-table>
+                      <i slot="reference" class="el-icon-question" style="position: absolute;right: 0;top: 20px;"/>
+                    </el-popover>
+                    <!-- <span style="position: absolute;right: 5px;width: 5px;height: 5px;border-radius: 50%;">?</span> -->
                   </div>
                 </div>
               </draggable>
@@ -449,6 +499,7 @@ export default {
       rowStyle: { maxHeight: 25 + 'px', height: 25 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       height: document.body.clientHeight - 220, // table高度
+      materialdetailsList: [],
       table: {
         getdataListParm: {
           page: 1,
@@ -789,6 +840,11 @@ export default {
       this.create.temp.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
       this.create.temp.ftvolume = this.templateFormulationList.find(obj => obj.id === item).volume
       this.getCreateList1()
+      var obj = {
+        'pastureid':this.create.temp.pastureid,
+        'ftid':this.create.temp.ftid
+      }
+      this.getmaterialdetailsList(obj)
     },
     changeTimes(item) {
       this.getCreateList1()
@@ -1249,7 +1305,7 @@ export default {
       }
       console.log(this.create.temp,'this.create.temp')
       this.getCreateList1()
-
+      this.getmaterialdetailsList(row)
     },
     updateData() {
       this.$refs['temp'].validate(valid => {
@@ -1786,6 +1842,23 @@ export default {
         //   }
         // })
       }
+    },
+    getmaterialdetailsList(item){
+      let url = 'authdata/GetDataByName'
+      let data  = {
+        name:"getFTdetailList",page:1,offset:1,pagecount:"",returntype:"Map",
+        parammaps:{
+          pastureid:item.pastureid,ftid:item.ftid,
+          // fttypeid:item.fttypeid,
+        }
+      }
+      postJson(url, data).then(response => {
+        if (response.msg !== 'fail') {
+          this.materialdetailsList = response.data.list
+        } else {
+          this.materialdetailsList = []
+        }
+      })
     }
   }
 }

+ 1 - 1
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -769,7 +769,7 @@ export default {
               var excelDatas1 = [
                 {
                   tHeader: ['栏舍名称', '剩料量(kg)','干物质', '班次(第一班/第二班/第三班)', '收集时间', '操作人'],
-                  filterVal: ['barname', 'remain','try', 'timesstr', 'operatetime', 'emp'],
+                  filterVal: ['barname', 'remain','dry', 'timesstr', 'operatetime', 'emp'],
                   tableDatas: this.download.list,
                   sheetName: 'Sheet1'
                 }

+ 229 - 45
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -96,23 +96,28 @@
                 <h4 style="text-align:center;">泌乳牛干物质采食量</h4>
                 <div v-if="tab.chart1.isChart" class="button">
                   <div class="chartButton">
-                    <el-radio-group v-model="tab.chart1.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart1')">
+                    <my-select ref="tenantselect" :model="tab.chart1.getdataListParm.parammaps.statisticsList" :option="tab.chart1.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;margin-top: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart1" />
+                    <el-select v-model="tab.chart1.getdataListParm.parammaps.ccname" filterable placeholder="牲畜类别" class="filter-item" clearable style="width: 150px;margin-right: 5px;margin-top: 5px;" @change="changeLivestockType">
+                      <el-option v-for="item in tab.chart1.livestockTypeList" :key="item.value" :label="item.label" :value="item.label" />
+                    </el-select>
+                    <el-radio-group v-model="tab.chart1.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;margin-right: 10px;" @change="changeChartSpecificDate('chart1')">
                       <el-radio-button label="1" border>日</el-radio-button>
                       <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                       <el-radio-button label="3" border>月</el-radio-button>
                     </el-radio-group>
-                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
+                    <!-- <br/> -->
+                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-top: 5px;">
                       <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width:220px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
                     </div>
-                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
-                      <el-select v-model="tab.chart1.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;" placeholder="年份" @change="changeChartYear('chart1')">
+                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;">
+                      <el-select v-model="tab.chart1.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;margin-top: 5px;" placeholder="年份" @change="changeChartYear('chart1')">
                         <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                       </el-select>
                       <el-select v-model="tab.chart1.getdataListParm.parammaps.selectWeek" class="filter-item" style="width:160px;" multiple :multiple-limit="2" placeholder="请选择周">
                         <el-option v-for="(item,index) in tab.chart1.getdataListParm.parammaps.weekList" :key="index" :label="item.name" :value="item.id" />
                       </el-select>
                     </div>
-                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
+                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;">
                       <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.chartMonth" style="width:220px;" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
                     </div>
                     <el-button class="successBorder" style="margin-left:10px;" @click="handleChartDate('chart1')">确认</el-button>
@@ -217,6 +222,7 @@
                 <h4 style="text-align:center;">混料时间统计</h4>
                 <div v-if="tab.chart3.isChart" class="button">
                   <div class="chartButton">
+                    <my-select ref="tenantselect" :model="tab.chart3.getdataListParm.parammaps.statisticsList" :option="tab.chart3.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart3" />
                     <el-radio-group v-model="tab.chart3.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart3')">
                       <el-radio-button label="1" border>日</el-radio-button>
                       <!-- <el-radio-button label="2" border>周</el-radio-button> -->
@@ -264,7 +270,8 @@
                     class="elTable table-fixed"
                   >
                     <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
-                    <el-table-column sortable label="混料时间(分钟)" min-width="110px" align="center" prop="field1" />
+                    <el-table-column sortable label="配方名称" min-width="110px" align="center" prop="名称" />
+                    <el-table-column sortable label="准确率" min-width="110px" align="center" prop="准确率" />
                   </el-table>
                 </div>
               </div>
@@ -541,7 +548,7 @@
 import echarts from 'echarts'
 
 require('echarts/theme/macarons')
-import { GetDataByName, postJson, GetReportform, whichWeek } from '@/api/common'
+import { GetDataByName, postJson, GetReportform, whichWeek,GetDataByNames } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
@@ -678,6 +685,7 @@ export default {
         chart1: {
           chartLine: null,
           chartLine_data: {},
+          livestockTypeList: [], // 牲畜类别
           getdataListParm: {
             name: 'getFeedEffMR',
             page: 1,
@@ -695,13 +703,16 @@ export default {
               chartMonth: '',
               yearList: [],
               weekList: [],
-              status: 0
+              status: 0,
+              ccname:''
             }
           },
           tableKey: 1,
           list: [],
           total: 0,
           listLoading: true,
+          statisticsList:[],
+          chart1Data3:[],
           isChart: true,
           isTable: false,
           table: {
@@ -778,6 +789,8 @@ export default {
           list: [],
           total: 0,
           listLoading: true,
+          statisticsList: [],
+          chart3Data3: [],
           isChart: true,
           isTable: false,
           table: {
@@ -956,6 +969,9 @@ export default {
       tab2Download2List3:[],
       tab2Download2List4:[],
       frequencyList:[],
+      requestParams: [
+        {"name":"getCowclassList","page":1,"offset":1,"pagecount":50,"returntype":"Map","parammaps":{"pastureid":Cookies.get('pastureid'),"classname":"","parentname":"","enable":1}},
+      ],
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       myHeight: document.documentElement.clientHeight - 85 - 210
@@ -963,6 +979,7 @@ export default {
   },
   created() {
     this.getAllYear()
+    this.getDownList()
     this.getTabList()
     this.getTimeFn()
     this.getChart1()
@@ -973,6 +990,15 @@ export default {
     this.getIsDisplay()
   },
   methods: {
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.tab.chart1.livestockTypeList = response.data.getCowclassList.list
+        for(var i=0;i<this.tab.chart1.livestockTypeList.length;i++){
+        	this.tab.chart1.livestockTypeList[i].label = this.tab.chart1.livestockTypeList[i].classname;
+        	this.tab.chart1.livestockTypeList[i].value = this.tab.chart1.livestockTypeList[i].id;
+        }
+      })
+    },
     getIsDisplay() {
       GetDataByName(this.tab.maxTime.getMaxTimesParm).then(response => {
         console.log(response.data.list[0].inforvalue)
@@ -1892,6 +1918,36 @@ export default {
     handleQuickJumpTop() {
       window.scrollTo(0, 0)
     },
+
+    // 泌乳牛干物质采食量
+    changeStatisticChart1(arr) {
+      console.log(arr,'arr===')
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart1.getdataListParm.parammaps.statisticsList = arr1
+      console.log(this.tab.chart1.getdataListParm.parammaps.statisticsList,'=====0000')
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart1.chart1Data3[j])
+          }
+        }
+      }
+      console.log(arrData3,'arrData3')
+      this.tab.chart1.chartLine_data.data3 = arrData3
+
+      this.tab.chart1.chartLine_data.data3 = this.tab.chart1.getdataListParm.parammaps.statisticsList
+      this.roadChartLine1(this.tab.chart1.chartLine_data)
+    },
+    changeLivestockType(){
+      this.getChart1()
+    },
     // 泌乳牛干物质采食量
     getChart1() {
       this.tab.chart1.listLoading = true
@@ -1910,23 +1966,66 @@ export default {
         data.parammaps.status = this.tab.chart1.getdataListParm.parammaps.status
       }
       postJson(url, data).then(response => {
-        if (response.data !== null && response.data.list !== null && response.data.data !== null) {
-          console.log('泌乳牛干物质采食量图表数据', response.data.list)
-          for (let i = 0; i < response.data.data.length; i++) {
-            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
-              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
-            }
-            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
-              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
-            }
+        // if (response.data !== null && response.data.list !== null && response.data.data !== null) {
+          // console.log('泌乳牛干物质采食量图表数据', response.data.list)
+          // for (let i = 0; i < response.data.data.length; i++) {
+          //   if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+          //     response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+          //   }
+          //   if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+          //     response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+          //   }
+          // }
+          // this.tab.chart1.table.list = response.data.data
+          // this.tab.chart1.chartLine_data = response.data.list
+          // this.tab.chart1.chartLine_data = {
+          //   chartType:'line_bar',
+          //   date: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
+          //   legendArr1: ['采食量-数据1', '采食量-数据2', '采食量-数据3', '采食量-数据4' ],
+          //   dataArr1:[
+          //     [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
+          //     [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
+          //     [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
+          //     [2, 10, 3, 2, 10, 4, 4, 9, 3, 9, 3, 8],
+          //   ],
+          //   legendArr2: ['产奶量-数据1',  '产奶量-数据2'],
+          //   dataArr2:[
+          //     [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 5],
+          //     [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
+          //   ],
+          // }
+          this.tab.chart1.chartLine_data = response.data
+          this.tab.chart1.chartLine_data.legendArr1 = []
+          this.tab.chart1.chartLine_data.legendArr2 = []
+          response.data.ftname.forEach((item)=>{
+            var str1 = '采食量-' + item
+            this.tab.chart1.chartLine_data.legendArr1.push(str1)
+          })
+          response.data.ftname.forEach((item)=>{
+            var str2 = '产奶量-' + item
+            this.tab.chart1.chartLine_data.legendArr2.push(str2)
+          })
+          // this.tab.chart1.chartLine_data.legendArr1 = this.tab.chart1.chartLine_data.ftname
+          // this.tab.chart1.chartLine_data.legendArr2 = this.tab.chart1.chartLine_data.ftname
+          var data3 = this.tab.chart1.chartLine_data.legendArr1.concat(this.tab.chart1.chartLine_data.legendArr2)
+
+          this.tab.chart1.chartLine_data.data3 = Array.from(new Set(data3))
+          this.tab.chart1.getdataListParm.parammaps.statisticsList = []
+          this.tab.chart1.statisticsList = []
+          console.log(data3,'data3')
+          for (let i = 0; i < data3.length; i++) {
+            this.tab.chart1.getdataListParm.parammaps.statisticsList.push(data3[i])
+            var obj = {}
+            obj.id = i
+            obj.name = data3[i]
+            this.tab.chart1.statisticsList.push(obj)
           }
-          this.tab.chart1.table.list = response.data.data
-          this.tab.chart1.chartLine_data = response.data.list
+          console.log(this.tab.chart1.getdataListParm.parammaps.statisticsList,'statisticsList')
           // this.tab.chart1.total = response.data.total
-        } else {
-          this.tab.chart1.list = []
-          this.tab.chart1.chartLine_data = {}
-        }
+        // } else {
+        //   this.tab.chart1.list = []
+        //   this.tab.chart1.chartLine_data = {}
+        // }
         this.roadChartLine1(this.tab.chart1.chartLine_data)
         setTimeout(() => {
           this.tab.chart1.listLoading = false
@@ -1938,19 +2037,50 @@ export default {
         this.tab.chart1.chartLine.dispose()
       }
       this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
+      console.log(chartLine_data,'chartLine_data')
       var option = {
-        tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
-        legend: { data: ['泌乳牛干物质采食量', '泌乳牛产奶量'], right: 10, show: true, type: 'scroll' },
+        tooltip: {
+          trigger: "axis",
+          axisPointer: { type: 'cross', crossStyle: { color: '#999' }},
+        },
+        legend: {
+          data:chartLine_data.data3,
+          right: 10, show: true, type: 'scroll' ,
+       },
         grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
-        xAxis: [{ type: 'category', data: chartLine_data.data1 }],
+        xAxis: [{ type: 'category', data: chartLine_data.date }],
         yAxis: [
           { splitLine: { show: false }, type: 'value', name: '泌乳牛干物质\n采食量', axisLabel: { formatter: '{value} ' }},
           { splitLine: { show: false }, type: 'value', name: '泌乳牛产奶量', axisLabel: { formatter: '{value} ' }}
         ],
-        series: [
-          { name: '泌乳牛干物质采食量', type: 'bar', itemStyle: { normal: { color: '#61a5e8' }}, data: chartLine_data.data2 },
-          { name: '泌乳牛产奶量', type: 'line', itemStyle: { normal: { color: '#ff2d2d' }}, yAxisIndex: 1, data: chartLine_data.data3 }
-        ]
+        // series: [
+        //   { name: '泌乳牛干物质采食量', type: 'bar', itemStyle: { normal: { color: '#61a5e8' }}, data: chartLine_data.data2 },
+        //   { name: '泌乳牛产奶量', type: 'line', itemStyle: { normal: { color: '#ff2d2d' }}, yAxisIndex: 1, data: chartLine_data.data3 }
+        // ]
+        series: function (e) {
+           var serie = [];
+           for (var i = 0; i < chartLine_data.date.length; i++) {
+               var item = {
+                 name: chartLine_data.legendArr1[i],
+                 data: chartLine_data.dataArr1[i],
+                 type: 'line',
+                 emphasis: { label: { show: true, position: 'inside' } },
+               }
+             serie.push(item);
+           }
+
+           for (var i = 0; i < chartLine_data.date.length; i++) {
+               var item = {
+                 name: chartLine_data.legendArr2[i],
+                 data: chartLine_data.dataArr2[i],
+                 type: 'bar',
+                 yAxisIndex: 1,
+                 emphasis: { label: { show: true, position: 'inside' } },
+               }
+             serie.push(item);
+           }
+           return serie;
+         }()
       }
       this.tab.chart1.chartLine.setOption(option)
       window.onresize = function() {
@@ -2090,6 +2220,11 @@ export default {
                 type: 'line',
                 data: chartLine_data.data3[i].data
               }
+              var item2 = {
+                name: chartLine_data.data1[i],
+                type: '',
+                data: chartLine_data.data3[i].data
+              }
               serie.push(item)
             }
           }
@@ -2104,6 +2239,27 @@ export default {
       }
     },
 
+    changeStatisticChart3(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart3.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart3.chart3Data3[j])
+          }
+        }
+      }
+      this.tab.chart3.chartLine_data.data3 = arrData3
+      this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
+      this.roadChartLine3(this.tab.chart3.chartLine_data)
+    },
     // 混料时间统计
     getChart3() {
       this.tab.chart3.listLoading = true
@@ -2127,7 +2283,32 @@ export default {
           this.tab.chart3.table.list = response.data.data
           this.tab.chart3.chartLine_data = response.data.list
           this.tab.chart3.total = response.data.total
+          this.tab.chart3.statisticsList = []
+          this.tab.chart3.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            // if (i < 10) {
+              this.tab.chart3.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            // }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart3.statisticsList.push(obj)
+          }
+          this.tab.chart3.chart3Data3 = response.data.list.data3
           this.tab.chart3.total = response.data.total
+          console.log('牛栏剩料率图数据', this.tab.chart3.chartLine_data)
+          console.log('牛栏剩料率表数据', this.tab.chart3.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart3.chart3Data3[j])
+              }
+            }
+          }
+          this.tab.chart3.chartLine_data.data3 = arrData3
+          this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
         } else {
           this.tab.chart3.list = []
           this.tab.chart3.chartLine_data = {}
@@ -2150,10 +2331,7 @@ export default {
         tooltip: {
           trigger: 'axis'
         },
-        legend: {
-          data: ['混料时间'],
-          right: 10, show: true, type: 'scroll'
-        },
+        legend: { data: chartLine_data.data1, right: 10, show: true, type: 'scroll' },
         grid: {
           top: '15%',
           left: '5%',
@@ -2165,21 +2343,27 @@ export default {
           right: '2%',
           feature: {}
         },
-        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
         yAxis: {
           type: 'value', name: '分钟',
           axisLabel: {
             formatter: '{value}min'
           }
         },
-        series: [
-          {
-            name: '混料时间',
-            type: 'line',
-            stack: '总量',
-            data: chartLine_data.data2
+        series: (function() {
+          var serie = []
+          if (chartLine_data.data3 !== undefined) {
+            for (var i = 0; i < chartLine_data.data3.length; i++) {
+              var item = {
+                name: chartLine_data.data1[i],
+                type: 'line',
+                data: chartLine_data.data3[i].data
+              }
+              serie.push(item)
+            }
           }
-        ]
+          return serie
+        }())
       }
       this.tab.chart3.chartLine.setOption(option)
       window.onresize = function() {
@@ -2472,8 +2656,8 @@ export default {
         console.log('混料时间统计导出')
         var excelDatasTabChart3 = [
           {
-            tHeader: ['日期', '混料时间(分钟)'],
-            filterVal: ['日期', 'field1'],
+            tHeader: ['日期', '配方名称','准确率'],
+            filterVal: ['日期', '名称','准确率'],
             tableDatas: this.tab.chart3.table.list,
             sheetName: '混料时间统计'
           }
@@ -2646,7 +2830,7 @@ export default {
 </script>
 <style lang="scss" scoped>
   .button{
-    height: 95px;
+    height: 130px;
     .exportTable2{float: right;margin-right: 5px;margin-top: 5px;}
   }
   .app-container1{padding-left: 10px;background-color: #F4F4F4;}