duanxiaoduan 2 gadi atpakaļ
vecāks
revīzija
958baf58ba

+ 1 - 1
.env.development

@@ -18,7 +18,7 @@ VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 陈文强
 # VUE_APP_BASE_API = 'http://192.168.1.87:8081/'
 # 白少杰
-# VUE_APP_BASE_API = 'http://192.168.1.90:8081/'
+# VUE_APP_BASE_API = 'http://192.168.1.89:8081/'
 
 #=====
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

BIN
dist.zip


+ 21 - 4
src/api/common.js

@@ -270,10 +270,27 @@ export function DownloadExcel(data, filename) {
     navigator.msSaveBlob(blob, fileName)
   }
 }
-// 取小数
-export function formatNum(f, digit) {
-  var m = Math.pow(10, digit);
-  return parseInt(f * m, 10) / m;
+// 取小数
+// export function formatNum(f, digit) {
+//   var m = Math.pow(10, digit);
+//   return parseInt(f * m, 10) / m;
+// }
+export function formatNum(value, n) {
+  console.log(value, n,'====')
+  var f = Math.round(value*Math.pow(10,n))/Math.pow(10,n);
+  var s = f.toString();
+  var rs = s.indexOf('.');
+  if(rs < 0) {
+    if(n==0){
+      s = s
+    }else{
+      s += '.';
+    }
+  }
+  for(var i = s.length - s.indexOf('.'); i <= n; i++){
+    s += "0";
+  }
+  return s;
 }
 
 export function compareSort(property){

+ 2 - 0
src/icons/svg/提醒设置.svg

@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1656553387467" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1361" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
+</style></defs><path d="M585.6 905.6 585.6 905.6c25.6-32 38.4-44.8 41.6-44.8 208-38.4 345.6-198.4 345.6-396.8 3.2-227.2-204.8-406.4-460.8-406.4s-464 179.2-464 406.4c0 198.4 140.8 358.4 345.6 396.8 3.2 0 16 12.8 41.6 44.8l0 0c32 41.6 51.2 64 73.6 64S550.4 947.2 585.6 905.6M620.8 803.2c-19.2 3.2-32 19.2-67.2 64l0 0c-22.4 25.6-41.6 44.8-41.6 44.8l-9.6-9.6c-6.4-6.4-16-19.2-25.6-32-38.4-48-51.2-64-70.4-67.2-185.6-32-307.2-172.8-307.2-345.6 0-192 185.6-352 416-352s416 160 416 352C928 633.6 806.4 771.2 620.8 803.2z" p-id="1362"></path><path d="M281.6 470.4a1.4 1.5 0 1 0 89.6 0 1.4 1.5 0 1 0-89.6 0Z" p-id="1363"></path><path d="M467.2 470.4a1.4 1.5 0 1 0 89.6 0 1.4 1.5 0 1 0-89.6 0Z" p-id="1364"></path><path d="M652.8 470.4a1.4 1.5 0 1 0 89.6 0 1.4 1.5 0 1 0-89.6 0Z" p-id="1365"></path></svg>

+ 1 - 1
src/views/basicData/defaultParameter/function/index.vue

@@ -211,7 +211,7 @@ export default {
       numberList: [{ id: '0', name: '1' }, { id: '1', name: '2' }, { id: '2', name: '3' }, { id: '3', name: '4' }], // 班次数量
       feedontractList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用饲料合同
       leftoverMaterialList: [{ id: '0', name: '顶额分配' }, { id: '1', name: '剩料分配' }],
-      weightDecimalPlacesList: [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }, { id: '3', name: '三位小数' }], // 重量小数点位数
+      weightDecimalPlacesList: [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }, { id: '3', name: '三位小数' }, { id: '4', name: '四位小数' }], // 重量小数点位数
       rateDecimalPlacesList:  [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }],//比例小数点位数
       smallMaterialList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 小料是否称量
       dataSynchronizationList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用数据同步

+ 1 - 1
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -566,7 +566,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <p v-if="newGeneration.temp.tips == true" style="font-weight: 700;color: red;text-align: center;">注:撒料计划中存在未分配完栏舍,如下所示;建议及时进行分配</p>
+          <p v-if="newGeneration.temp.tips == true || newGeneration.dialogStatus == 'copy'" style="font-weight: 700;color: red;text-align: center;">注:撒料计划中存在未分配完栏舍,如下所示;建议及时进行分配</p>
           <div style="height: 200px;overflow: auto;">
             <div v-if="myMaxTimes == 1">
               <div>第一班:</div>

+ 33 - 68
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -576,28 +576,15 @@ export default {
           this.TMRNumberList = []
         }
       })
-      const url2 = 'authdata/tmrListEnableTypeAll'
-      const data2 = {
-        name: 'getTMRListEnableTypeAll',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
-        }
-      }
-      // 临时注释
-      // const data2 = {
-      //   parammaps: {
-      //     pastureid: Cookies.get('pastureid')
-      //   }
-      // }
-      // 临时注释
-      postJson(url, data2).then(response => {
-        if (response.data !== null) {
-          // 临时注释
-          // this.equipmentList = response.data
-          // 临时注释
-          this.equipmentList = response.data.list
+      const url2 = 'authdata/tmrListEnableTypeAll'
+      const data2 = {
+        parammaps: {
+          pastureid: Cookies.get('pastureid')
+        }
+      }
+      postJson(url2, data2).then(response => {
+        if (response.data !== null) {
+          this.equipmentList = response.data
           if(this.create.dialogStatus == 'update'){
             if(this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid) !== undefined){
               this.create.temp.tclassname = this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid).tclassname
@@ -749,28 +736,15 @@ export default {
           const data = this.requestParam
           postJson(url, data).then(response => {
             if (response.msg === 'fail') {
-              this.$notify({
-                title: '删除失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
-              this.$notify({
-                title: '成功',
-                message: '删除成功',
-                type: 'success',
-                duration: 2000
-              })
+              this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
               this.table.getdataListParm.parammaps.refresh = 1
               this.getList()
             }
           })
         }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
+          this.$message({ type: 'info', message: '已取消删除' })
         })
       } else {
         this.$message({
@@ -793,7 +767,8 @@ export default {
       this.getCreateList1()
     },
     // TMR编号
-    changeTMRNumber(item) {
+    changeTMRNumber(item) {
+      console.log(this.create.temp.tmrid,'this.create.temp.tmrid111')
       if (this.create.list2.length > 0) {
         MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
           confirmButtonText: '是',
@@ -803,27 +778,27 @@ export default {
           this.create.temp.tmrid = this.create.temp.tmrid2
           this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
           this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
+          this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
           this.create.temp.mytmrid = this.create.temp.tmrid
           this.create.temp.mytmrname = this.create.temp.tmrname
           console.log('tmrname==>', this.create.temp)
           if (this.isDispaly || this.create.dialogStatus == 'update') {
             this.getClearList()
           }
-        }).catch(() => {
-          this.create.temp.tmrid2 = this.create.temp.tmrid
-          this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
-          this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
+        }).catch(() => {
+          console.log(this.create.temp,'====')
+          if(this.create.temp.tclassname == '固定式'){
+            console.log( this.create.temp,'====')
+            this.create.temp.tmrid = this.create.temp.mytmrid
+          }
+          this.create.temp.tmrid2 = this.create.temp.tmrid
+          this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
+          this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
           this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
           this.create.temp.mytmrid = this.create.temp.tmrid2
           this.create.temp.mytmrname = this.create.temp.tmrname
-          if (this.isDispaly || this.create.dialogStatus == 'update') {
-            this.getClearList()
-          }
-          console.log(this.create.temp)
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          })
+          console.log(this.create.temp)
+          this.$message({ type: 'info', message: '已取消' })
         })
       } else {
         this.create.temp.tmrid = this.create.temp.tmrid2
@@ -1184,17 +1159,12 @@ export default {
       //   }
       //   console.log('temp',this.create.temp)
       // }
+      console.log(this.create.temp.tclassname,'this.create.temp.tclassname')
       if(this.create.temp.tclassname == '固定式'){
-        if(this.equipmentList.find(obj => obj.tclassname == '任意车') !== undefined){
-          this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车').eqcode
-          this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车').id
+        if(this.equipmentList.find(obj => obj.tclassname == '任意车1') !== undefined){
+          this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车1').eqcode
+          this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车1').id
         }
-        // 临时注释
-        // if(this.equipmentList.find(obj => obj.tclassname == '任意车1') !== undefined){
-        //   this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车1').eqcode
-        //   this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车1').id
-        // }
-        // 临时注释
       }
       console.log('this.create.temp.sumweight', this.create.temp.sumweight)
       var evt = this.create.temp
@@ -1203,13 +1173,8 @@ export default {
           this.$set(item, 'weight', (parseFloat(evt.maxweight) - parseFloat(evt.sumweight)).toFixed(2))
         }
       }
-      if (parseFloat(evt.maxweight) == parseFloat(evt.sumweight) || parseFloat(evt.maxweight) < parseFloat(evt
-        .sumweight)) {
-        this.$message({
-          type: 'error',
-          message: '计划配方已经是最大容量',
-          duration: 2000
-        })
+      if (parseFloat(evt.maxweight) == parseFloat(evt.sumweight) || parseFloat(evt.maxweight) < parseFloat(evt.sumweight)) {
+        this.$message({ type: 'error', message: '计划配方已经是最大容量', duration: 2000 })
         this.getCreateList1()
         return
       }
@@ -1269,7 +1234,7 @@ export default {
           this.getCreateList1()
         })
       })
-
+      console.log(this.create.temp.tmrid,'66666')
     },
     handleUpdate(row) {
       this.getDownList()

+ 58 - 57
src/views/formulationPlan/dhedFormula/index.vue

@@ -94,13 +94,13 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;"  @focus="focusR(scope.row)" @blur="blurR(scope.row,1)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="200px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW(scope.row)" @focus="focusW(scope.row)" />
@@ -112,13 +112,13 @@
             <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r2" step="0.01" type="number" :disabled="scope.row.isTwoWeight" style="width:95%;padding:10px 0;" @focus="focusR(scope.row)" @blur="blurR(scope.row,2)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="200px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW2(scope.row)" @focus="focusW2(scope.row)" />
@@ -130,13 +130,13 @@
             <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:95%;padding:10px 0;" @focus="focusR(scope.row)" @blur="blurR(scope.row,3)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="200px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW3(scope.row)" @focus="focusW3(scope.row)" />
@@ -148,13 +148,13 @@
             <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:95%;padding:10px 0;" @focus="focusR(scope.row)" @blur="blurR(scope.row,4)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="200px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW4(scope.row)" @focus="focusW4(scope.row)" />
@@ -1295,9 +1295,8 @@ export default {
               response.data.list[i].r4 = 0
               response.data.list[i].w4 = 0
             }
-
             this.$set(response.data.list[i], 'sumr', parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4))
-            response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimal')))
+            response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimalr')))
             // this.$set(response.data.list[i],'feedweight',formatNum(parseFloat(response.data.list[i].feedweight) * parseFloat(response.data.list[i].sumr)/100,2))
             this.$set(response.data.list[i], 'dailyWeight', parseFloat(response.data.list[i].w1) + parseFloat(response.data.list[i].w2) + parseFloat(response.data.list[i].w3) + parseFloat(response.data.list[i].w4))
             response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
@@ -1903,11 +1902,15 @@ export default {
       if (row.r4 !== '') {
         row.w4 = formatNum(parseFloat(row.feedweight) * parseFloat(row.r4) / 100, parseInt(Cookies.get('decimal')))
       }
+      if (row.r1 == '' || isNaN(row.r1)) { row.r1 = 0 }
+      if (row.r2 == '' || isNaN(row.r2)) { row.r2 = 0 }
+      if (row.r3 == '' || isNaN(row.r3)) { row.r3 = 0 }
+      if (row.r4 == '' || isNaN(row.r4)) { row.r4 = 0 }
       this.$set(row, 'sumr', formatNum(parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4), parseInt(Cookies.get('decimal'))))
-      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.w1 == '' || isNaN(row.w1)) { row.w1 = 0 }
+      if (row.w2 == '' || isNaN(row.w2)) { row.w2 = 0 }
+      if (row.w3 == '' || isNaN(row.w3)) { row.w3 = 0 }
+      if (row.w4 == '' || isNaN(row.w4)) { row.w4 = 0 }
       this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
       row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
     },
@@ -2840,8 +2843,8 @@ export default {
                 // row.r4 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r4)
                 let average1 = (parseFloat(this.focusWRow2.r2) / 2).toFixed(parseInt(Cookies.get('decimalr')))
                 let average2 = (parseFloat(this.focusWRow2.r2) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
-                row.r3 = (parseFloat(average1) + parseFloat(this.focusWRow.r3)).toFixed(parseInt(Cookies.get('decimalr')))
-                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow.r4)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average1) + parseFloat(this.focusWRow2.r3)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow2.r4)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('1班比例为0,34班不为0')
               }else if(row.r3 === 0 && row.r1 !== 0 && row.r4 !== 0){
                 row.r3 = 0
@@ -2849,8 +2852,8 @@ export default {
                 // row.r4 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r4)
                 let average1 = (parseFloat(this.focusWRow2.r2) / 2).toFixed(parseInt(Cookies.get('decimalr')))
                 let average2 = (parseFloat(this.focusWRow2.r2) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
-                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow.r1)).toFixed(parseInt(Cookies.get('decimalr')))
-                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow.r4)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow2.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow2.r4)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('3班比例为0,14班不为0')
               }else if(row.r4 === 0 && row.r1 !== 0 && row.r3 !== 0){
                 row.r4 = 0
@@ -4225,44 +4228,42 @@ export default {
         pastureid: row.pastureid,
         fpid: row.id
       }}
-      // 临时注释
-      // this.requestParam.data[3] = { 'name': 'insertFeedphistory', 'type': 'e', 'parammaps': {
-      //   createdate:createdate,
-      //   pastureid:row.pastureid,
-      //   barname:row.barname,
-      //   barid:row.barid,
-      //   softccount:row.softccount,
-      //   ccount:row.ccount,
-      //   ratio:row.ratio,
-      //   ccountratio:row.ccountratio,
-      //   ftid:row.ftid,
-      //   ftname:row.ftname,
-      //   ptsfid:row.ptsfid,
-      //   ptsfname:row.ptsfname,
-      //   feedweight:row.feedweight,
-      //   ftweight:row.ftweight,
-      //   supplyweight:row.supplyweight
-      // }}
-      // this.requestParam.data[4] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.table.rwList }}
-      // this.requestParam.data[4].children = []
-      // this.requestParam.data[4].children[0] = { 'name': 'insertFpdetailhistory', 'type': 'e', 'parammaps': {
-      //   createdate:createdate,
-      //   pastureid: '@insertSpotList2.pastureid',
-      //   barname: row.barname,
-      //   barid: '@insertSpotList2.barid',
-      //   times: '@insertSpotList2.times',
-      //   tratio: '@insertSpotList2.tratio',
-      //   weight: '@insertSpotList2.weight',
-      //   cowcount: '@insertSpotList2.cowcount',
-      //   ccountradio: row.ccountratio,
-      //   ptid: '@insertSpotList2.ptid',
-      //   ptsid: '@insertSpotList2.ptsid',
-      //   supplement: '@insertSpotList2.supplement',
-      //   feedweight: row.feedweight,
-      //   supplyweight: row.supplyweight,
-      //   ratio: row.ratio
-      // }}
-      // 临时注释
+      this.requestParam.data[3] = { 'name': 'insertFeedphistory', 'type': 'e', 'parammaps': {
+        createdate:createdate,
+        pastureid:row.pastureid,
+        barname:row.barname,
+        barid:row.barid,
+        softccount:row.softccount,
+        ccount:row.ccount,
+        ratio:row.ratio,
+        ccountratio:row.ccountratio,
+        ftid:row.ftid,
+        ftname:row.ftname,
+        ptsfid:row.ptsfid,
+        ptsfname:row.ptsfname,
+        feedweight:row.feedweight,
+        ftweight:row.ftweight,
+        supplyweight:row.supplyweight
+      }}
+      this.requestParam.data[4] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.table.rwList }}
+      this.requestParam.data[4].children = []
+      this.requestParam.data[4].children[0] = { 'name': 'insertFpdetailhistory', 'type': 'e', 'parammaps': {
+        createdate:createdate,
+        pastureid: '@insertSpotList2.pastureid',
+        barname: row.barname,
+        barid: '@insertSpotList2.barid',
+        times: '@insertSpotList2.times',
+        tratio: '@insertSpotList2.tratio',
+        weight: '@insertSpotList2.weight',
+        cowcount: '@insertSpotList2.cowcount',
+        ccountradio: row.ccountratio,
+        ptid: '@insertSpotList2.ptid',
+        ptsid: '@insertSpotList2.ptsid',
+        supplement: '@insertSpotList2.supplement',
+        feedweight: row.feedweight,
+        supplyweight: row.supplyweight,
+        ratio: row.ratio
+      }}
       ExecDataByConfig(this.requestParam).then(response => {
         console.log('编辑保存发送参数', this.requestParam)
         if (response.msg === 'fail') {
@@ -5039,7 +5040,7 @@ export default {
                 response.data.list[i].w4 = 0
               }
               this.$set(response.data.list[i], 'sumr', parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4))
-              response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimal')))
+              response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimalr')))
               this.$set(response.data.list[i], 'dailyWeight', parseFloat(response.data.list[i].w1) + parseFloat(response.data.list[i].w2) + parseFloat(response.data.list[i].w3) + parseFloat(response.data.list[i].w4))
               response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
             }

+ 25 - 38
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -506,28 +506,15 @@ export default {
           this.TMRNumberList = []
         }
       })
+      const url2 = 'authdata/tmrListEnableTypeAll'
       const data2 = {
-        name: 'getTMRListEnableTypeAll',
-        offset: 0,
         parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
+          pastureid: Cookies.get('pastureid')
         }
       }
-      const url2 = 'authdata/tmrListEnableTypeAll'
-      // 临时注释
-      // const data2 = {
-      //   parammaps: {
-      //     pastureid: Cookies.get('pastureid')
-      //   }
-      // }
-      // 临时注释
-      postJson(url, data2).then(response => {
+      postJson(url2, data2).then(response => {
         if (response.data !== null) {
-          // 临时注释
-          // this.equipmentList = response.data
-          // 临时注释
-          this.equipmentList = response.data.list
+          this.equipmentList = response.data
           if(this.create.dialogStatus == 'update'){
             if(this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid) !== undefined){
               this.create.temp.tclassname = this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid).tclassname
@@ -691,6 +678,10 @@ export default {
             this.getClearList()
           }
         }).catch(() => {
+          if(this.create.temp.tclassname == '固定式'){
+            console.log( this.create.temp,'====')
+            this.create.temp.tmrid = this.create.temp.mytmrid
+          }
           this.create.temp.tmrid2 = this.create.temp.tmrid
           this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
           this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
@@ -967,9 +958,9 @@ export default {
       //   }
       // }
       if(this.create.temp.tclassname == '固定式'){
-        if(this.equipmentList.find(obj => obj.tclassname == '任意车') !== undefined){
-          this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车').eqcode
-          this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车').id
+        if(this.equipmentList.find(obj => obj.tclassname == '任意车1') !== undefined){
+          this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车1').eqcode
+          this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车1').id
         }
       }
       var evt = this.create.temp
@@ -1070,9 +1061,7 @@ export default {
           data.parammaps = this.create.temp
           data.parammaps.tmrid = this.create.temp.mytmrid
           data.parammaps.tmrname = this.create.temp.mytmrname
-          //临时注释
-          // data.old = this.create.temp.arrList
-          //临时注释
+          data.old = this.create.temp.arrList
           postJson(url, data).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
@@ -1502,21 +1491,19 @@ export default {
           if (response.msg === 'fail') {
             this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
           } else {
-            // 临时注释
-            // let url = 'authdata/spillageall/del'
-            // let data  = {}
-            // data.parammaps = {}
-            // data.parammaps.pastureid = Cookies.get('pastureid')
-            // data.parammaps.times = this.table.getdataListParm.parammaps.times
-            // postJson(url, data).then(response => {
-            //   if (response.msg !== 'fail') {
-            //     this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
-            //     this.getList()
-            //   } else {
-            //     this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
-            //   }
-            // })
-            // 临时注释
+            let url = 'authdata/spillageall/del'
+            let data  = {}
+            data.parammaps = {}
+            data.parammaps.pastureid = Cookies.get('pastureid')
+            data.parammaps.times = this.table.getdataListParm.parammaps.times
+            postJson(url, data).then(response => {
+              if (response.msg !== 'fail') {
+                this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
+                this.getList()
+              } else {
+                this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            })
             this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
             this.getList()
           }

+ 61 - 27
src/views/formulationPlan/recipeTemplate/index.vue

@@ -250,7 +250,7 @@
             <el-table-column label="重量(KG)" prop="fweight" width="120px" align="center">
               <template slot-scope="scope">
                 <span v-if="scope.row.NoEdit">{{ scope.row.fweight }}</span>
-                <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.001" type="number" style="width:95%;padding:10px 0;" />
+                <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.0001" type="number" style="width:95%;padding:10px 0;" />
               </template>
             </el-table-column>
             <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
@@ -259,6 +259,11 @@
                 <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
                   <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
+                <!-- <div v-if="scope.row.Edit">
+                  <el-input-number  v-model="num" style="width:50%;padding:10px 0;dispaly:inline-block;" :controls='false' :precision="2"/>
+                  <span>-</span>
+                  <el-input-number v-model="num" style="width:45%;padding:10px 0;dispaly:inline-block;" :controls='false' :precision="2"/>
+                </div> -->
               </template>
             </el-table-column>
             <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
@@ -335,7 +340,7 @@
             <el-table-column label="重量(KG)" prop="fweight" width="120px" align="center">
               <template slot-scope="scope">
                 <span v-if="scope.row.NoEdit">{{ scope.row.fweight }}</span>
-                <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.01" type="number" style="width:95%;padding:10px 0;" />
+                <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.0001" type="number" style="width:95%;padding:10px 0;" />
               </template>
             </el-table-column>
             <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
@@ -1145,7 +1150,7 @@ export default {
                 return prev
               }
             }, 0)
-            sums[index] = sums[index].toFixed(3) + '(干物质量:' + this.table2.dryweight + ')'
+            sums[index] = sums[index].toFixed(4) + '(干物质量:' + this.table2.dryweight + ')'
           } else {
             sums[index] = ''
           }
@@ -1380,19 +1385,17 @@ export default {
         if (response.msg !== 'fail') {
           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
           this.getList()
-          // 临时注释
-          // let data = {}
-          // data.name = 'insertFeedtemplethistory'
-          // data.parammaps = this.table.temp
-          // PostDataByName(data).then(response => {
-          //   if (response.msg !== 'fail') {
-          //     this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          //     this.getList()
-          //   } else {
-          //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          //   }
-          // })
-          // 临时注释
+          let data = {}
+          data.name = 'insertFeedtemplethistory'
+          data.parammaps = this.table.temp
+          PostDataByName(data).then(response => {
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
         } else {
           const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
           if (isRepeat.test(response.data)) {
@@ -2282,18 +2285,21 @@ export default {
         return false
       }
       // 检验重量>0
-      this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 3) // 根据默认参数设置小数位数
-      row.fweight = formatNum(row.fweight, 3)
+      this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 4) // 根据默认参数设置小数位数
+      row.fweight = formatNum(row.fweight, 4)
+      // return
       // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
       if (this.table2.temp.fweight == 0) {
-        this.$message({ type: 'error', message: '重量请输入正数,最多保留位小数', duration: 2000 })
+        this.$message({ type: 'error', message: '重量请输入正数,最多保留位小数', duration: 2000 })
         return false
       }
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
+      let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
       this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.createdate = dateTime
       this.requestParam.data = []
       this.requestParam.data[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
         pastureid: this.table2.temp.pastureid,
@@ -2322,10 +2328,14 @@ export default {
         preftid: this.table2.temp.preftid,
         pastureid: this.table2.getdataListParm.parammaps.pastureid,
         ftid: this.table2.getdataListParm.parammaps.ftid,
-        dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+        dateTime: dateTime,
         slid: 0,
         fid: row.fid
       }}
+      this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
+        id:this.table2.getdataListParm.parammaps.ftid,
+        createdate:dateTime
+      }}
       const url = 'authdata/ftdetail/edit'
       const data = this.requestParam
       postJson(url, data).then(response => {
@@ -2472,22 +2482,25 @@ export default {
             this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
             return false
           }
-          this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 3) // 根据默认参数设置小数位数
-          row.fweight = formatNum(row.fweight, 3)
+          this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 4) // 根据默认参数设置小数位数
+          row.fweight = formatNum(row.fweight, 4)
           // 检验重量>0
           // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
           if (this.table2.temp.fweight == 0) {
-            this.$message({ type: 'error', message: '重量请输入正数,最多保留位小数', duration: 2000 })
+            this.$message({ type: 'error', message: '重量请输入正数,最多保留位小数', duration: 2000 })
             return false
           }
+          console.log(row.fweight,'row.fweight')
+          let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
           this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.createdate = dateTime
           this.requestParam.data = []
           this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
             ftid: this.table2.getdataListParm.parammaps.ftid,
             weight: String(row.fweight),
             preftid: this.table2.temp.preftid,
-            dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+            dateTime: dateTime,
             slid: this.table2.temp.id,
             fid: row.fid
           }}
@@ -2520,6 +2533,10 @@ export default {
             pastureid: this.table2.getdataListParm.parammaps.pastureid,
             ftid: this.table2.getdataListParm.parammaps.ftid
           }}
+          this.requestParam.data[5] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
+            id:this.table2.getdataListParm.parammaps.ftid,
+            createdate:dateTime
+          }}
           const url = 'authdata/ftdetail/edit'
           const data = this.requestParam
           postJson(url, data).then(response => {
@@ -2567,15 +2584,17 @@ export default {
         confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
       }).then(() => {
         console.log(this.table2.list.length)
+        let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
         if (this.table2.list.length > 1) {
           this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.createdate = dateTime
           this.requestParam.data = []
           this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
             ftid: this.table2.getdataListParm.parammaps.ftid,
             weight: 0,
             preftid: row.preftid,
-            dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+            dateTime: dateTime,
             slid: row.id,
             fid: row.fid
           }}
@@ -2593,15 +2612,20 @@ export default {
             pastureid: this.table2.getdataListParm.parammaps.pastureid,
             id: this.table2.getdataListParm.parammaps.ftid
           }}
+          this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
+            id:this.table2.getdataListParm.parammaps.ftid,
+            createdate:dateTime
+          }}
         } else {
           this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.createdate = dateTime
           this.requestParam.data = []
           this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
             ftid: this.table2.getdataListParm.parammaps.ftid,
             weight: 0,
             preftid: row.preftid,
-            dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+            dateTime: dateTime,
             slid: row.id,
             fid: row.fid
           }}
@@ -2623,6 +2647,10 @@ export default {
             pastureid: this.table2.getdataListParm.parammaps.pastureid,
             id: this.table2.getdataListParm.parammaps.ftid
           }}
+          this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
+            id:this.table2.getdataListParm.parammaps.ftid,
+            createdate:dateTime
+          }}
         }
         const url = 'authdata/ftdetail/edit'
         const data = this.requestParam
@@ -2666,8 +2694,10 @@ export default {
           confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
         }).then(() => {
           console.log(this.table2.list.length - this.selectList2.length)
+          let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
           if (this.table2.list.length - this.selectList2.length > 0) {
             this.requestParam.common = { 'returnmap': '0' }
+            this.requestParam.createdate = dateTime
             this.requestParam.data = []
             this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
             this.requestParam.data[0].children = []
@@ -2676,7 +2706,7 @@ export default {
               ftid: '@insertSpotList.ftid',
               weight: 0,
               preftid: '@insertSpotList.preftid',
-              dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+              dateTime: dateTime,
               slid: '@insertSpotList.id',
               fid: '@insertSpotList.fid'
             }}
@@ -2694,6 +2724,10 @@ export default {
               type: this.table2.getdataListParm.parammaps.fttypeid,
               status: 1
             }}
+            this.requestParam.data[3] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
+              id:this.table2.getdataListParm.parammaps.ftid,
+              createdate:dateTime
+            }}
             const url = 'authdata/ftdetail/edit'
             const data = this.requestParam
             postJson(url, data).then(response => {

+ 392 - 193
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -16,13 +16,15 @@
           <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="栏舍名称" />
           <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="牲畜名称" />
           <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.projname" class="filter-item" style="width: 100px;" placeholder="车次" />
-          <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.times" class="filter-item" style="width: 100px;" placeholder="班次" />
+          <!-- <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.times" class="filter-item" style="width: 100px;" placeholder="班次" /> -->
+          <el-select v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in tab2.frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 100px;" placeholder="TMR名称" />
           <el-select v-if="tab.isTMRName" v-model="tab.table.getdataListParm.parammaps.fname" placeholder="请选择TMR设备" class="filter-item" style="width: 150px;">
             <el-option v-for="(item,index) in tab.TMRNameList" :key="index" :label="item.tmrloadname" :value="item.tmrloadname" />
           </el-select>
-          <!-- 临时注释 -->
-         <!-- <div style="display: inline-block;" class="filter-item1">
+          <div style="display: inline-block;" class="filter-item1">
             <el-input-number :controls="false" :precision="2" v-model="tab.table.getdataListParm.parammaps.hlwc1" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
             <span>-</span>
             <el-input-number :controls="false" :precision="2"  v-model="tab.table.getdataListParm.parammaps.hlwc2" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -52,8 +54,7 @@
             <span>-</span>
             <el-input-number :controls="false" :precision="2" v-model="tab.table.getdataListParm.parammaps.slzql2" placeholder="撒料正确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
           </div>
-          <el-checkbox v-model="tab.table.getdataListParm.parammaps.error" style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox> -->
-          <!-- 临时注释 -->
+          <el-checkbox v-model="tab.table.getdataListParm.parammaps.error" style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox>
           <el-button class="successBorder" @click="handleSearch">查询</el-button>
           <el-button class="successBorder" @click="handleRefresh1">重置</el-button>
           <el-button class="export" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
@@ -657,8 +658,7 @@
           <!-- <el-select v-model="tab2.table.getdataListParm.parammaps.isuse" style="margin-top: 5px;width: 130px;" filterable placeholder="上传状态" class="filter-item" clearable>
             <el-option v-for="item in tab2.isuseList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select> -->
-          <!-- 临时注释 -->
-          <!-- <div style="display: inline-block;" class="filter-item1">
+          <div style="display: inline-block;" class="filter-item1">
             <el-input-number :controls="false" :precision="2" v-model="tab2.table.getdataListParm.parammaps.hlwc1" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
             <span>-</span>
             <el-input-number :controls="false" :precision="2"  v-model="tab2.table.getdataListParm.parammaps.hlwc2" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -673,8 +673,8 @@
             <span>-</span>
             <el-input-number :controls="false" :precision="2" v-model="tab2.table.getdataListParm.parammaps.hlzql2" placeholder="混料正确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
           </div>
-          <el-checkbox v-model="tab2.table.getdataListParm.parammaps.error" style="margin-right: 10px;">只看超出预设值数据</el-checkbox> -->
-          <!-- 临时注释 -->
+          <el-checkbox v-model="tab2.table.getdataListParm.parammaps.error" style="margin-right: 10px;">只看超出预设值数据</el-checkbox>
+
           <el-button class="successBorder" style="margin-top: 5px;" @click="handleSearch2">查询</el-button>
           <el-button class="successBorder" style="margin-top: 5px;" @click="handleRefresh2">重置</el-button>
           <el-button style="float: right;margin-right: 10px;margin-bottom:10px;margin-top: 5px;" class="export" icon="el-icon-upload2" @click="handleExport2">导出</el-button>
@@ -699,10 +699,10 @@
             <u-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
             <u-table-column sortable label="车次" min-width="50px" align="center" prop="车次" />
             <u-table-column sortable label="班次" min-width="50px" align="center" prop="班次" />
-            <u-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
-            <u-table-column sortable label="饲料" min-width="70px" align="center" prop="饲料" />
+            <!-- <u-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
+            <u-table-column sortable label="饲料" min-width="70px" align="center" prop="饲料" /> -->
             <!-- 临时注释 -->
-           <!-- <u-table-column sortable label="配方名称" min-width="70px" align="center" prop="配方名称">
+           <u-table-column sortable label="配方名称" min-width="70px" align="center" prop="配方名称">
               <template slot-scope="{row}">
                 <a @click="clickRecipeName2(row)" style="text-decoration: underline;color: #0000FF;">{{ row.配方名称 }}</a>
               </template>
@@ -711,7 +711,7 @@
               <template slot-scope="{row}">
                 <a @click="clickFeed2(row)" style="text-decoration: underline;color: #0000FF;">{{ row.饲料 }}</a>
               </template>
-            </u-table-column> -->
+            </u-table-column>
             <!-- 临时注释 -->
             <u-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
             <u-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
@@ -751,8 +751,7 @@
           <!-- <el-select v-model="tab3.table.getdataListParm.parammaps.isuse" style="margin-top: 5px;width: 130px;" filterable placeholder="上传状态" class="filter-item" clearable>
             <el-option v-for="item in tab3.isuseList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select> -->
-          <!-- 临时注释 -->
-          <!-- <div style="display: inline-block;" class="filter-item1">
+          <div style="display: inline-block;" class="filter-item1">
             <el-input-number :controls="false" :precision="2" v-model="tab3.table.getdataListParm.parammaps.slwc1" placeholder="撒料误差值" style="width: 120px;" class="filter-item" clearable />
             <span>-</span>
             <el-input-number :controls="false" :precision="2"  v-model="tab3.table.getdataListParm.parammaps.slwc2" placeholder="撒料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -767,8 +766,7 @@
             <span>-</span>
             <el-input-number :controls="false" :precision="2" v-model="tab3.table.getdataListParm.parammaps.slzql2" placeholder="撒料正确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
           </div>
-          <el-checkbox v-model="tab3.table.getdataListParm.parammaps.error" style="margin-right: 10px;">只看超出预设值数据</el-checkbox> -->
-          <!-- 临时注释 -->
+          <el-checkbox v-model="tab3.table.getdataListParm.parammaps.error" style="margin-right: 10px;">只看超出预设值数据</el-checkbox>
           <el-button class="successBorder" style="margin-top: 5px;" @click="handleSearch3">查询</el-button>
           <el-button class="successBorder" style="margin-top: 5px;" @click="handleRefresh3">重置</el-button>
           <el-button style="float: right;margin-right: 10px;margin-bottom:10px;margin-top: 5px;" class="export" icon="el-icon-upload2" @click="handleExport3">导出</el-button>
@@ -793,10 +791,10 @@
             <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="90px" align="center" prop="配方名称" />
-            <u-table-column sortable label="栏舍" min-width="90px" align="center" prop="栏舍" />
+           <!-- <u-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
+            <u-table-column sortable label="栏舍" min-width="90px" align="center" prop="栏舍" /> -->
             <!-- 临时注释 -->
-            <!-- <u-table-column sortable label="配方名称" min-width="70px" 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>
@@ -805,7 +803,7 @@
               <template slot-scope="{row}">
                 <a @click="clickFence3(row)" style="text-decoration: underline;color: #0000FF;">{{ row.栏舍 }}</a>
               </template>
-            </u-table-column> -->
+            </u-table-column>
             <!-- 临时注释 -->
             <u-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
             <u-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
@@ -838,10 +836,10 @@
     <See :show.sync="isShowDialog"  :row-pid="rowPid" :start-time="startTime" :stop-time="stopTime"  :optdevice="optdevice" :title-fname="titlefname" :method-name="methodName" :error="error" />
 
     <!-- 配方名称弹窗 -->
-    <el-dialog :title="textMap[recipeNameTemp.dialogStatus]" :visible.sync="recipeNameTemp.dialogFormVisible" :close-on-click-modal="false" width="98%">
+    <el-dialog :title="textMap[recipeNameTemp.dialogStatus]" :visible.sync="recipeNameTemp.dialogFormVisible" :close-on-click-modal="false" width="90%">
       <div class="recipeNameTemp">
         <div class="search">
-          <el-date-picker ref="inputDatetime" v-model="recipeNameTemp.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+          <el-date-picker ref="inputDatetime" :clearable="false" v-model="recipeNameTemp.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
           <el-button class="successBorder" @click="handleRecipeNameSearch">查询</el-button>
         </div>
         <div class="table">
@@ -856,13 +854,14 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
+            :max-height="450"
           >
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (recipeNameTemp.pageNum-1) * recipeNameTemp.pageSize + 1 }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="修改时间" width="100px" align="center" prop="datetime1" />
+            <el-table-column label="修改时间" width="130px" align="center" prop="datetime1" />
             <el-table-column label="饲料名称(单位:kg)" min-width="800px" align="center">
               <template slot-scope="scope">
                 <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item" style="width:150px;float: left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin: 5px 5px;padding: 0;height: 30px;">
@@ -893,7 +892,7 @@
     <el-dialog :title="textMap[feedTemp.dialogStatus]" :visible.sync="feedTemp.dialogFormVisible" :close-on-click-modal="false" width="98%">
       <div class="feedTemp">
         <div class="search">
-          <el-date-picker ref="inputDatetime" v-model="feedTemp.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+          <el-date-picker ref="inputDatetime" v-model="feedTemp.getdataListParm.parammaps.inputDatetime" :clearable="false" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
           <el-button class="successBorder" @click="handleFeedSearch">查询</el-button>
         </div>
         <div class="table">
@@ -914,8 +913,13 @@
                 <span>{{ scope.$index + (feedTemp.pageNum-1) * feedTemp.pageSize + 1 }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="修改时间" min-width="100px" align="center" prop="datetime1" />
-            <el-table-column label="饲料重量(KG)" min-width="100px" align="center" prop="datetime1" />
+            <el-table-column label="修改时间" min-width="100px" align="center" prop="updateTime" />
+            <el-table-column label="饲料重量(KG)" min-width="100px" align="center">
+              <template slot-scope="{row}">
+                  <span v-if="row.status == 0">{{row.weight}}</span>
+                  <span v-else style="color: red;">{{row.weight}}</span>
+                </template>
+            </el-table-column>
           </el-table>
           <pagination v-show="feedTemp.total>0" :total="feedTemp.total" :page.sync="feedTemp.getdataListParm.offset" :limit.sync="feedTemp.getdataListParm.pagecount" @pagination="getFeedList()" />
         </div>
@@ -926,12 +930,12 @@
     </el-dialog>
 
     <!-- 栏舍 -->
-    <el-dialog :title="textMap[fenceTemp.dialogStatus]" :visible.sync="fenceTemp.dialogFormVisible" :close-on-click-modal="false" width="98%">
+    <el-dialog :title="textMap[fenceTemp.dialogStatus]" :visible.sync="fenceTemp.dialogFormVisible" :close-on-click-modal="false" width="90%">
       <div class="fenceTemp">
         <el-tabs v-model="fenceTemp.activeName" @tab-click="handleFenceTabClick">
           <el-tab-pane label="班次重量" name="first">
               <div class="search">
-                <el-date-picker ref="inputDatetime" v-model="fenceTemp.tab1.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+                <el-date-picker ref="inputDatetime" v-model="fenceTemp.tab1.getdataListParm.parammaps.inputDatetime" :clearable="false" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
                 <el-button class="successBorder" @click="handleFenceSearch">查询</el-button>
               </div>
               <div class="table">
@@ -946,31 +950,42 @@
                   :row-style="rowStyle"
                   :cell-style="cellStyle"
                   class="elTable table-fixed"
-                  :span-method="objectSpanMethod"
+                  :span-method="objectSpanMethod1"
                 >
                   <u-table-column label="序号" width="50px" align="center" type="index" />
-                  <u-table-column label="修改时间" width="100px" align="center" prop="barname" />
+                  <u-table-column label="修改时间" width="100px" align="center" prop="createdate" />
                   <u-table-column label="班次" min-width="100px" align="center" prop="times" />
-                  <u-table-column label="实际牛头数" min-width="100px" align="center" prop="times" />
-                  <u-table-column label="系数(%)" min-width="100px" align="center" prop="times" />
-                  <u-table-column label="系数头数" min-width="100px" align="center" prop="times" />
-                  <u-table-column label="配方模板" min-width="70px" align="center" prop="times">
+                  <u-table-column label="实际牛头数" min-width="100px" align="center" prop="ccount" />
+                  <u-table-column label="系数(%)" min-width="100px" align="center" prop="ratio" />
+                  <u-table-column label="系数头数" min-width="100px" align="center" prop="ccountratio" />
+                  <u-table-column label="配方模板" min-width="70px" align="center" prop="ftname">
                     <template slot-scope="{row}">
-                      <a @click="clickRecipeTemplate3(row)" style="text-decoration: underline;color: #0000FF;">{{ row.times }}</a>
+                      <a v-if="row.ftnamestatus == 1" @click="clickRecipeTemplate3(row)" style="text-decoration: underline;color: red;">{{ row.ftname }}</a>
+                      <a v-else @click="clickRecipeTemplate3(row)" style="text-decoration: underline;">{{ row.ftname }}</a>
                     </template>
                   </u-table-column>
-                  <u-table-column label="比例(%)" min-width="100px" align="center" prop="times" />
-                  <u-table-column label="重量(KG)" min-width="100px" align="center" prop="times" />
+                  <u-table-column label="比例(%)" min-width="100px" align="center">
+                    <template slot-scope="{row}">
+                        <span v-if="row.tratiostatus == 1" style="color: red;">{{row.tratio}}</span>
+                        <span v-else >{{row.tratio}}</span>
+                      </template>
+                  </u-table-column>
+                  <u-table-column label="重量(KG)" min-width="100px" align="center" prop="weight">
+                    <template slot-scope="{row}">
+                        <span v-if="row.weightstatus == 1" style="color: red;">{{row.weight}}</span>
+                        <span v-else>{{row.weight}}</span>
+                      </template>
+                  </u-table-column>
                 </u-table>
               </div>
           </el-tab-pane>
           <el-tab-pane label="车次重量" name="second">
               <div class="search">
-                <el-date-picker ref="inputDatetime" v-model="fenceTemp.tab2.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+                <el-date-picker ref="inputDatetime" :clearable="false" v-model="fenceTemp.tab2.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
                 <el-button class="successBorder" @click="handleFenceSearch">查询</el-button>
               </div>
               <div class="table">
-                <u-table
+                <!-- <u-table
                   :key="fenceTemp.tab2.tableKey"
                   v-loading="fenceTemp.tab2.listLoading"
                   element-loading-text="给我一点时间"
@@ -979,17 +994,44 @@
                   highlight-current-row
                   style="width: 100%;"
                   :row-style="rowStyle"
-                  :cell-style="cellStyle"
+                  :cell-style="rowStyle"
                   class="elTable table-fixed"
-                  :span-method="objectSpanMethod"
+                  :span-method="objectSpanMethod2"
                 >
                   <u-table-column label="序号" width="50px" align="center" type="index" />
-                  <u-table-column label="修改时间" width="100px" align="center" prop="barname" />
+                  <u-table-column label="修改时间" width="100px" align="center" prop="createdate" />
                   <u-table-column label="班次" min-width="100px" align="center" prop="times" />
-                  <u-table-column label="第一车" min-width="100px" align="center" prop="times" />
+                  <u-table-column label="车" min-width="100px" align="center" prop="times" />
                   <u-table-column label="第二车" min-width="100px" align="center" prop="times" />
                   <u-table-column label="第三车" min-width="100px" align="center" prop="times" />
                   <u-table-column label="第四车" min-width="100px" align="center" prop="times" />
+                </u-table> -->
+                <u-table
+                  :key="fenceTemp.tab2.tableKey"
+                  v-loading="fenceTemp.tab2.listLoading"
+                  element-loading-text="给我一点时间"
+                  :data="fenceTemp.tab2.list"
+                  border
+                  highlight-current-row
+                  style="width: 100%;"
+                  :row-style="rowStyle"
+                  class="elTable table-fixed"
+                  :span-method="objectSpanMethod2"
+                  >
+                  <u-table-column label="序号" width="50px" align="center" type="index" />
+                  <u-table-column label="修改时间" width="100px" align="center" prop="createdate" />
+                  <u-table-column label="班次" width="100px" align="center" prop="times" />
+                  <!-- <u-table-column v-for="(item, index) in fenceTemp.tab2.tableLabel" :key="index" align="center" :min-width="item.width" :prop="item.prop" :label="item.label"> -->
+                  <u-table-column v-for="(item, index) in fenceTemp.tab2.tableLabel" :key="index" align="center" :min-width="item.width" :prop="item.prop"  :label="item.label">
+                    <template slot-scope="scope">
+                      <span v-if="scope.row[item.prop] !== undefined && scope.row[item.prop].indexOf('/') !== -1" style="color: red;">
+                        {{scope.row[item.prop]}}
+                      </span>
+                      <span v-else>{{scope.row[item.prop]}}</span>
+                    </template>
+                    <!-- :prop="item.prop"
+                    indexOf("A") != -1 -->
+                  </u-table-column>
                 </u-table>
               </div>
           </el-tab-pane>
@@ -1000,26 +1042,26 @@
         </div>
     </el-dialog>
     <!-- 配方模板修改记录 -->
-    <el-dialog :title="textMap[modificationRecordTemp.dialogStatus]" :visible.sync="modificationRecordTemp.dialogFormVisible" :close-on-click-modal="false" width="98%">
+    <el-dialog :title="textMap[modificationRecordTemp.dialogStatus]" :visible.sync="modificationRecordTemp.dialogFormVisible" :close-on-click-modal="false" width="90%">
       <div class="modificationRecord">
         <h3 style="flex: 1;">修改前</h3>
         <div class="top">
           <div class="left">
-            <div><b>配方名称</b>:{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>配方编码</b>:{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>配方颜色</b>:{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>牲畜类别</b>:{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>配方类型</b>:{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>来源:</b>{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>版本号:</b>{{modificationRecordTemp.temp1.times}}</div>
-            <div><b>备注:</b>{{modificationRecordTemp.temp1.times}}</div>
+            <div><b>配方名称:</b>{{modificationRecordTemp.list1.tname}}</div>
+            <div><b>配方编码:</b>{{modificationRecordTemp.list1.tcode}}</div>
+            <div><b>配方颜色:</b><el-color-picker v-model="modificationRecordTemp.list1.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" disabled /></div>
+            <div><b>牲畜类别:</b>{{modificationRecordTemp.list1.ccname}}</div>
+            <div><b>配方类型:</b>{{modificationRecordTemp.list1.fttype}}</div>
+            <div><b>来源:</b>{{modificationRecordTemp.list1.source}}</div>
+            <div><b>版本号:</b>{{modificationRecordTemp.list1.version}}</div>
+            <div><b>备注:</b>{{modificationRecordTemp.list1.remark}}</div>
           </div>
           <div class="right">
             <el-table
               :key="modificationRecordTemp.tableKey1"
               v-loading="modificationRecordTemp.listLoading1"
               element-loading-text="给我一点时间"
-              :data="modificationRecordTemp.list1"
+              :data="modificationRecordTemp.list1.fit"
               border
               fit
               highlight-current-row
@@ -1028,11 +1070,14 @@
               :row-style="rowStyle"
               :cell-style="cellStyle"
               class="elTable table-fixed"
+              show-summary
+              :summary-method="getSummaries1"
             >
-              <el-table-column label="饲料组" min-width="90px" align="center" prop="日期" />
-              <el-table-column label="饲料名称" min-width="90px" align="center" prop="名称" />
-              <el-table-column label="重量(KG)" min-width="100px" align="center" prop="理论量" />
-              <el-table-column label="搅拌延时(min)" min-width="100px" align="center" prop="实际量" />
+              <el-table-column label="饲料组" min-width="90px" align="center" prop="feedgroup" />
+              <el-table-column label="饲料名称" min-width="90px" align="center" prop="name" />
+              <el-table-column v-if="Eweight == undefined" label="重量(KG)" min-width="100px" align="center" prop="weight" />
+              <el-table-column v-else label="重量(KG)" min-width="100px" align="center" prop="Eweight" />
+              <el-table-column label="搅拌延时(min)" min-width="100px" align="center" prop="autosecond" />
             </el-table>
           </div>
         </div>
@@ -1040,21 +1085,21 @@
         <h3 style="color: red;">修改后</h3>
         <div class="bottom">
           <div class="left">
-            <div><b>配方名称:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>配方编码:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>配方颜色:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>牲畜类别:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>配方类型:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>来源:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>版本号:</b>{{modificationRecordTemp.temp2.times}}</div>
-            <div><b>备注:</b>{{modificationRecordTemp.temp2.times}}</div>
+            <div><b>配方名称:</b>{{modificationRecordTemp.list2.tname}}</div>
+            <div><b>配方编码:</b>{{modificationRecordTemp.list2.tcode}}</div>
+            <div><b>配方颜色:</b><el-color-picker v-model="modificationRecordTemp.list2.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" disabled /></div>
+            <div><b>牲畜类别:</b>{{modificationRecordTemp.list2.ccname}}</div>
+            <div><b>配方类型:</b>{{modificationRecordTemp.list2.fttype}}</div>
+            <div><b>来源:</b>{{modificationRecordTemp.list2.source}}</div>
+            <div><b>版本号:</b>{{modificationRecordTemp.list2.version}}</div>
+            <div><b>备注:</b>{{modificationRecordTemp.list2.remark}}</div>
           </div>
           <div class="right">
             <el-table
               :key="modificationRecordTemp.tableKey2"
               v-loading="modificationRecordTemp.listLoading2"
               element-loading-text="给我一点时间"
-              :data="modificationRecordTemp.list2"
+              :data="modificationRecordTemp.list2.fit"
               border
               fit
               highlight-current-row
@@ -1063,11 +1108,14 @@
               :row-style="rowStyle"
               :cell-style="cellStyle"
               class="elTable table-fixed"
+              show-summary
+              :summary-method="getSummaries2"
             >
-              <el-table-column label="饲料组"  min-width="90px" align="center" prop="日期" />
-              <el-table-column label="饲料名称"  min-width="90px" align="center" prop="名称" />
-              <el-table-column label="重量(KG)"  min-width="100px" align="center" prop="理论量" />
-              <el-table-column label="搅拌延时(min)"  min-width="100px" align="center" prop="实际量" />
+              <el-table-column label="饲料组" min-width="90px" align="center" prop="feedgroup" />
+              <el-table-column label="饲料名称" min-width="90px" align="center" prop="name" />
+              <el-table-column v-if="Eweight == undefined" label="重量(KG)" min-width="100px" align="center" prop="weight" />
+              <el-table-column v-else label="重量(KG)" min-width="100px" align="center" prop="Eweight" />
+              <el-table-column label="搅拌延时(min)" min-width="100px" align="center" prop="autosecond" />
             </el-table>
           </div>
         </div>
@@ -1094,6 +1142,14 @@ export default {
   components: { Pagination, mySelect, See },
   data() {
     return {
+      error:'',
+      optdevice:'',
+      stopTime:'',
+      startTime:'',
+      Eweight:'',
+      predefineColors: [
+        '#E57373', '#F06292', '#BA68C8', '#9575CD', '#7986CB', '#64B5F6', '#4FC3F7', '#4DD0E1', '#4DB6AC', '#81C784', '#AED581', '#DCE775', '#FFF176', '#FFD54F', '#FFB74D', '#FF8A65', '#A1887F', '#E0E0E0', '#90A4AE'
+      ],
       pickerMinMonth: '',
       pickerOptionsMonth: {
         onPick: ({ maxDate, minDate }) => {
@@ -1184,9 +1240,9 @@ export default {
       tab: {
         TMRNameList:[],
         radio: '2',
-        isDriver: true,
+        isDriver: false,
         isFormulaName: false, // 配方名称
-        isHouseName: false, // 栏舍名称
+        isHouseName: true, // 栏舍名称
         isLivestockType: false, // 牲畜类别
         isTrainNumber: false, // 车次
         isTMRName: false, // TMR名称
@@ -1632,12 +1688,14 @@ export default {
       fenceTemp:{
         dialogStatus: '',
         dialogFormVisible: false,
-        spanObj: {},
-        mergekeys: ['barname', 'sumweight'],
+        spanObj1: {},
+        spanObj2: {},
+        mergekeys1: ['createdate'],
+        mergekeys2: ['createdate'],
         tab1:{
           getdataListParm: {
             name: 'getPlanModifyFPlist',page: 1, offset: 1, pagecount: '', returntype: 'Map',
-            parammaps: { inputDatetime: '', pastureid: '', fitid: '' }
+            parammaps: { inputDatetime: [], pastureid: '', fitid: '' }
           },
           tableKey: 0, total: 0, listLoading: true, list: [],
         },
@@ -1653,19 +1711,12 @@ export default {
       modificationRecordTemp:{
         dialogStatus: '',
         dialogFormVisible: false,
-        getdataListParm1: {
-          name: 'getPlanModifyFPlist',page: 1, offset: 1, pagecount: '', returntype: 'Map',
-          parammaps: { inputDatetime: '', pastureid: '', fitid: '' }
-        },
         tableKey1: 0, total1: 0, listLoading1: false, list1: [],
-        getdataListParm2: {
-          name: 'getPlanModifyFPlist',page: 1, offset: 1, pagecount: '', returntype: 'Map',
-          parammaps: { inputDatetime: '', pastureid: '', fitid: '' }
-        },
         tableKey2: 0, total2: 0, listLoading2: false, list2: [],
         temp1:{},
-        temp2:{}
-      }
+        temp2:{},
+        lastdate:'',currentdate:'',
+      },
     }
   },
   created() {
@@ -4462,7 +4513,7 @@ export default {
       data.parammaps.startTime = this.tab2.table.getdataListParm.parammaps.startTime
       data.parammaps.stopTime = this.tab2.table.getdataListParm.parammaps.stopTime
       GetDataByName(data).then(response => {
-        if(response.data.list !== null){
+        if(response.data !== null){
           this.tab2.TMRNameList = response.data.list
         }else{
           this.tab2.TMRNameList =  []
@@ -4490,14 +4541,17 @@ export default {
       this.recipeNameTemp.dialogFormVisible = true
       this.textMap.recipeNameTxt = '配方修改记录——配方:' + row.配方名称
       this.recipeNameTemp.dialogStatus = 'recipeNameTxt'
-      this.recipeNameTemp.getdataListParm.parammaps.pastureid = row.pastureid
-      this.recipeNameTemp.getdataListParm.parammaps.fitid = row.id
+      this.recipeNameTemp.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
+      this.recipeNameTemp.getdataListParm.parammaps.fitid = row.ftid
       this.recipeNameTemp.getdataListParm.parammaps.inputDatetime = []
+      const start = new Date()
+      const end = new Date()
+      this.recipeNameTemp.getdataListParm.parammaps.inputDatetime[0] = parseTime(start.setTime(start.getTime() - 3600 * 1000 * 24 * 7), '{y}-{m}-{d}')
+      this.recipeNameTemp.getdataListParm.parammaps.inputDatetime[1] = parseTime(end.setTime(end.getTime() - 3600 * 1000 * 24 * 1), '{y}-{m}-{d}')
       this.getRecipeNameList()
     },
     getRecipeNameList(){
       this.recipeNameTemp.listLoading = true
-      this.recipeNameTemp.getdataListParm.parammaps.fitid = this.recipeNameTemp.temp.id
       if (this.recipeNameTemp.getdataListParm.parammaps.inputDatetime == null) {
         this.recipeNameTemp.getdataListParm.parammaps.inputDatetime = ''
         this.recipeNameTemp.getdataListParm.parammaps.startTime = ''
@@ -4507,7 +4561,15 @@ export default {
         this.recipeNameTemp.getdataListParm.parammaps.stopTime = this.recipeNameTemp.getdataListParm.parammaps.inputDatetime[1]
       }
       const url = 'authdata/GetArrList'
-      const data = this.recipeNameTemp.getdataListParm
+      const data = {
+        name:'getFitHistory1',
+        name1:'getFitHistory2',
+        page:this.recipeNameTemp.getdataListParm.page,
+        offset:this.recipeNameTemp.getdataListParm.offset,
+        pagecount:this.recipeNameTemp.getdataListParm.pagecount,
+        returntype:this.recipeNameTemp.getdataListParm.returntype,
+        parammaps:this.recipeNameTemp.getdataListParm.parammaps
+      }
       postJson(url, data).then(response => {
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {
@@ -4539,13 +4601,17 @@ export default {
       this.textMap.feedTxt = '配方修改记录——饲料:' + row.饲料
       this.feedTemp.dialogStatus = 'feedTxt'
       this.feedTemp.getdataListParm.parammaps.pastureid = row.pastureid
-      this.feedTemp.getdataListParm.parammaps.fitid = row.id
+      this.feedTemp.getdataListParm.parammaps.ftid = row.ftid
+      this.feedTemp.getdataListParm.parammaps.name = row.饲料
       this.feedTemp.getdataListParm.parammaps.inputDatetime = []
+      const start = new Date()
+      const end = new Date()
+      this.feedTemp.getdataListParm.parammaps.inputDatetime[0] = parseTime(start.setTime(start.getTime() - 3600 * 1000 * 24 * 7), '{y}-{m}-{d}')
+      this.feedTemp.getdataListParm.parammaps.inputDatetime[1] = parseTime(end.setTime(end.getTime() - 3600 * 1000 * 24 * 1), '{y}-{m}-{d}')
       this.getFeedList()
     },
     getFeedList(){
       this.feedTemp.listLoading = true
-      this.feedTemp.getdataListParm.parammaps.fitid = this.feedTemp.temp.id
       if (this.feedTemp.getdataListParm.parammaps.inputDatetime == null) {
         this.feedTemp.getdataListParm.parammaps.inputDatetime = ''
         this.feedTemp.getdataListParm.parammaps.startTime = ''
@@ -4554,8 +4620,15 @@ export default {
         this.feedTemp.getdataListParm.parammaps.startTime = this.feedTemp.getdataListParm.parammaps.inputDatetime[0]
         this.feedTemp.getdataListParm.parammaps.stopTime = this.feedTemp.getdataListParm.parammaps.inputDatetime[1]
       }
-      const url = 'authdata/GetArrList'
-      const data = this.feedTemp.getdataListParm
+      const url = 'authdata/GetDataByName'
+      const data = {
+        name:'getFitistoryByName',
+        page: this.feedTemp.getdataListParm.page,
+        offset:  this.feedTemp.getdataListParm.offset,
+        pagecount:  this.feedTemp.getdataListParm.pagecount,
+        returntype:  this.feedTemp.getdataListParm.returntype,
+        parammaps:  this.feedTemp.getdataListParm.parammaps
+      }
       postJson(url, data).then(response => {
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {
@@ -4586,9 +4659,13 @@ export default {
       this.recipeNameTemp.dialogFormVisible = true
       this.textMap.recipeNameTxt = '配方修改记录——配方:' + row.配方名称
       this.recipeNameTemp.dialogStatus = 'rowRecipeRecordTxt'
-      this.recipeNameTemp.getdataListParm.parammaps.pastureid = row.pastureid
-      this.recipeNameTemp.getdataListParm.parammaps.fitid = row.id
+      this.recipeNameTemp.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
+      this.recipeNameTemp.getdataListParm.parammaps.fitid = row.ftid
+      const start = new Date()
+      const end = new Date()
       this.recipeNameTemp.getdataListParm.parammaps.inputDatetime = []
+      this.recipeNameTemp.getdataListParm.parammaps.inputDatetime[0] = parseTime(start.setTime(start.getTime() - 3600 * 1000 * 24 * 7), '{y}-{m}-{d}')
+      this.recipeNameTemp.getdataListParm.parammaps.inputDatetime[1] = parseTime(end.setTime(end.getTime() - 3600 * 1000 * 24 * 1), '{y}-{m}-{d}')
       this.getRecipeNameList()
     },
     clickFence3(row) {
@@ -4598,9 +4675,13 @@ export default {
       this.textMap.fenceTxt = '配方修改记录——饲料:' + row.饲料
       this.fenceTemp.dialogStatus = 'fenceTxt'
       this.fenceTemp.activeName = 'first'
-      this.fenceTemp.tab1.getdataListParm.parammaps.pastureid = row.pastureid
-      this.fenceTemp.tab1.getdataListParm.parammaps.fitid = row.id
+      this.fenceTemp.tab1.getdataListParm.parammaps.barname = row.栏舍
+      this.fenceTemp.tab2.getdataListParm.parammaps.barname = row.栏舍
       this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime = []
+      const start = new Date()
+      const end = new Date()
+      this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start.setTime(start.getTime() - 3600 * 1000 * 24 * 7), '{y}-{m}-{d}')
+      this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end.setTime(end.getTime() - 3600 * 1000 * 24 * 1), '{y}-{m}-{d}')
       this.getFenceList1()
     },
     getFenceList1(){
@@ -4608,25 +4689,29 @@ export default {
       this.fenceTemp.tab1.getdataListParm.parammaps.fitid = this.fenceTemp.temp.id
       if (this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime == null) {
         this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime = ''
-        this.fenceTemp.tab1.getdataListParm.parammaps.startTime = ''
-        this.fenceTemp.tab1.getdataListParm.parammaps.stopTime = ''
+        this.fenceTemp.tab1.getdataListParm.parammaps.startDate = ''
+        this.fenceTemp.tab1.getdataListParm.parammaps.endDate = ''
       } else {
-        this.fenceTemp.tab1.getdataListParm.parammaps.startTime = this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[0]
-        this.fenceTemp.tab1.getdataListParm.parammaps.stopTime = this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[1]
+        this.fenceTemp.tab1.getdataListParm.parammaps.startDate = this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[0]+' 00:00'
+        this.fenceTemp.tab1.getdataListParm.parammaps.endDate = this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[1]+' 23:59'
+      }
+      const url = 'authdata/feedp/history'
+      // const data = this.fenceTemp.tab1.getdataListParm
+      const data = {
+          barname:this.fenceTemp.tab1.getdataListParm.parammaps.barname,
+          startDate:this.fenceTemp.tab1.getdataListParm.parammaps.startDate,
+          endDate:this.fenceTemp.tab1.getdataListParm.parammaps.endDate
       }
-      const url = 'authdata/GetDataByName'
-      const data = this.fenceTemp.tab1.getdataListParm
-      this.fenceTemp.tab1.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
-      this.fenceTemp.tab1.getdataListParm.parammaps.date = '2022-05-27'
       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].ptid == undefined || response.data.list[i].ptname == '') {
-              this.$set(response.data.list[i], 'ptid', '')
-              this.$set(response.data.list[i], 'ptname', '')
+        this.fenceTemp.tab1.listLoading = false
+        if (response.data !== null) {
+          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', '')
+              this.$set(response.data[i], 'ptname', '')
             }
           }
-          this.fenceTemp.tab1.list = response.data.list
+          this.fenceTemp.tab1.list = response.data
           this.handleSpan1()
         } else {
           this.fenceTemp.tab1.list = []
@@ -4643,25 +4728,68 @@ export default {
       this.fenceTemp.tab2.getdataListParm.parammaps.fitid = this.fenceTemp.temp.id
       if (this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime == null) {
         this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime = ''
-        this.fenceTemp.tab2.getdataListParm.parammaps.startTime = ''
-        this.fenceTemp.tab2.getdataListParm.parammaps.stopTime = ''
+        this.fenceTemp.tab2.getdataListParm.parammaps.startDate = ''
+        this.fenceTemp.tab2.getdataListParm.parammaps.endDate = ''
       } else {
-        this.fenceTemp.tab2.getdataListParm.parammaps.startTime = this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime[0]
-        this.fenceTemp.tab2.getdataListParm.parammaps.stopTime = this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime[1]
+        this.fenceTemp.tab2.getdataListParm.parammaps.startDate = this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime[0]+' 00:00'
+        this.fenceTemp.tab2.getdataListParm.parammaps.endDate = this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime[1]+' 23:59'
+      }
+      const url = 'authdata/spillageall/history'
+      const data = {
+        barname:this.fenceTemp.tab2.getdataListParm.parammaps.barname,
+        pastureid:Cookies.get('pastureid'),
+        startDate:this.fenceTemp.tab2.getdataListParm.parammaps.startDate,
+        endDate:this.fenceTemp.tab2.getdataListParm.parammaps.endDate
       }
-      const url = 'authdata/GetDataByName'
-      const data = this.fenceTemp.tab2.getdataListParm
-      this.fenceTemp.tab2.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
-      this.fenceTemp.tab2.getdataListParm.parammaps.date = '2022-05-27'
       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].ptid == undefined || response.data.list[i].ptname == '') {
-              this.$set(response.data.list[i], 'ptid', '')
-              this.$set(response.data.list[i], 'ptname', '')
-            }
-          }
-          this.fenceTemp.tab2.list = response.data.list
+        if (response.data.data !== null) {
+          // 表数据
+          this.fenceTemp.tab2.list = response.data.data
+          // this.fenceTemp.tab2.list = [{
+          // 			"a1": "2079.00(3号车)",
+          // 			"a2": "12000.00/12000.00(任意车1)",
+          // 			"createdate": "2022-07-11 17:18:12",
+          // 			"times": 3
+          // 		}, {
+          // 			"a1": "1000.00(任意车1)",
+          // 		  	"a2":"",
+          // 			"createdate": "2022-07-11 17:17:41",
+          // 			"times": 1
+          // 		}, {
+          // 			"a1": "260.00(任意车1)",
+          // 		  	"a2":"",
+          // 			"createdate": "2022-07-11 17:17:37",
+          // 			"times": 1
+          // 		}],
+          // [
+          //   {id: 1, createdate: '2018-07-24', times: 1, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 2, createdate: '2018-07-24', times: 2, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 3, createdate: '2018-07-24', times: 3, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 4, createdate: '2018-07-24', times: 4, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 5, createdate: '2018-07-25', times: 1, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 6, createdate: '2018-07-25', times: 2, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 7, createdate: '2018-07-25', times: 3, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 8, createdate: '2018-07-25', times: 4, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 9, createdate: '2018-07-26', times: 1, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 10, createdate: '2018-07-26', times: 2, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 11, createdate: '2018-07-26', times: 3, a1: 137597.76, a2: 102203.71, a3: 35394.05},
+          //   {id: 12, createdate: '2018-07-26', times: 4, a1: 137597.76, a2: 102203.71, a3: 35394.05}
+          // ]
+       // 表头数据
+       // for(let i=0;i<response.data.trains.length;i++){
+       //   var obj = {}
+       //   obj.label
+       //   this.$set(response.data.trains[i],'width')
+       // }
+       this.fenceTemp.tab2.tableLabel = response.data.trains
+       // [
+       //      {label: '序号', width: '40', prop: 'id'},
+       //      {label: '修改时间', width: '', prop: 'createdate'},
+       //      {label: '班次', width: '', prop: 'times'},
+       //      {label: '第一车', width: '', prop: 'a1'},
+       //      {label: '第二车', width: '', prop: 'a2'},
+       //      {label: '第三车', width: '', prop: 'a3'}
+       //    ]
           this.handleSpan2()
         } else {
           this.fenceTemp.tab2.list = []
@@ -4673,6 +4801,7 @@ export default {
         }, 100)
       })
     },
+
     handleFenceSearch(){
       if(this.fenceTemp.activeName == 'first'){
         this.getFenceList1()
@@ -4681,76 +4810,76 @@ export default {
       }
     },
     handleFenceTabClick(item){
+      const start = new Date()
+      const end = new Date()
       if(item == 'first'){
+        this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime = []
+        this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start.setTime(start.getTime() - 3600 * 1000 * 24 * 7), '{y}-{m}-{d}')
+        this.fenceTemp.tab1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end.setTime(end.getTime() - 3600 * 1000 * 24 * 1), '{y}-{m}-{d}')
         this.getFenceList1()
       }else{
+        this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime = []
+        this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start.setTime(start.getTime() - 3600 * 1000 * 24 * 7), '{y}-{m}-{d}')
+        this.fenceTemp.tab2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end.setTime(end.getTime() - 3600 * 1000 * 24 * 1), '{y}-{m}-{d}')
         this.getFenceList2()
       }
     },
     handleSpan1() {
-      this.fenceTemp.mergekeys.forEach(key => {
-        this.fenceTemp.spanObj[key] = []
+      this.fenceTemp.mergekeys1.forEach(key => {
+        this.fenceTemp.spanObj1[key] = []
         let position = 0
         this.fenceTemp.tab1.list.forEach((item, index) => {
           if (index === 0) {
-            this.fenceTemp.spanObj[key].push(1)
+            this.fenceTemp.spanObj1[key].push(1)
             position = 0
           } else {
-            if (key == 'sumweight') {
-              if (this.fenceTemp.tab1.list[index][key] === this.fenceTemp.tab1.list[index - 1][key] && this.fenceTemp.tab1.list[index]['barname'] === this.fenceTemp.tab1.list[index - 1]['barname']) {
-                this.fenceTemp.spanObj[key][position] += 1
-                this.fenceTemp.spanObj[key].push(0)
-              } else {
-                this.fenceTemp.spanObj[key].push(1)
-                position = index
-              }
+            if (this.fenceTemp.tab1.list[index][key] === this.fenceTemp.tab1.list[index - 1][key]) {
+              this.fenceTemp.spanObj1[key][position] += 1
+              this.fenceTemp.spanObj1[key].push(0)
             } else {
-              if (this.fenceTemp.tab1.list[index][key] === this.fenceTemp.tab1.list[index - 1][key]) {
-                this.fenceTemp.spanObj[key][position] += 1
-                this.fenceTemp.spanObj[key].push(0)
-              } else {
-                this.fenceTemp.spanObj[key].push(1)
-                position = index
-              }
+              this.fenceTemp.spanObj1[key].push(1)
+              position = index
             }
           }
         })
       })
     },
     handleSpan2() {
-      this.fenceTemp.mergekeys.forEach(key => {
-        this.fenceTemp.spanObj[key] = []
+      this.fenceTemp.mergekeys2.forEach(key => {
+        this.fenceTemp.spanObj2[key] = []
         let position = 0
         this.fenceTemp.tab2.list.forEach((item, index) => {
           if (index === 0) {
-            this.fenceTemp.spanObj[key].push(1)
+            this.fenceTemp.spanObj2[key].push(1)
             position = 0
           } else {
-            if (key == 'sumweight') {
-              if (this.fenceTemp.tab2.list[index][key] === this.fenceTemp.tab2.list[index - 1][key] && this.fenceTemp.tab2.list[index]['barname'] === this.fenceTemp.tab2.list[index - 1]['barname']) {
-                this.fenceTemp.spanObj[key][position] += 1
-                this.fenceTemp.spanObj[key].push(0)
-              } else {
-                this.fenceTemp.spanObj[key].push(1)
-                position = index
-              }
+            if (this.fenceTemp.tab2.list[index][key] === this.fenceTemp.tab2.list[index - 1][key]) {
+              this.fenceTemp.spanObj2[key][position] += 1
+              this.fenceTemp.spanObj2[key].push(0)
             } else {
-              if (this.fenceTemp.tab2.list[index][key] === this.fenceTemp.tab2.list[index - 1][key]) {
-                this.fenceTemp.spanObj[key][position] += 1
-                this.fenceTemp.spanObj[key].push(0)
-              } else {
-                this.fenceTemp.spanObj[key].push(1)
-                position = index
-              }
+              this.fenceTemp.spanObj2[key].push(1)
+              position = index
             }
           }
         })
       })
     },
-    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      for (let i = 0; i < this.fenceTemp.mergekeys.length; i++) {
-        if (column.property === this.fenceTemp.mergekeys[i]) {
-          const _row = this.fenceTemp.spanObj[this.fenceTemp.mergekeys[i]][rowIndex]
+    objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
+      for (let i = 0; i < this.fenceTemp.mergekeys1.length; i++) {
+        if (column.property === this.fenceTemp.mergekeys1[i]) {
+          const _row = this.fenceTemp.spanObj1[this.fenceTemp.mergekeys1[i]][rowIndex]
+          const _col = _row > 0 ? 1 : 0
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
+    },
+    objectSpanMethod2({ row, column, rowIndex, columnIndex }) {
+      for (let i = 0; i < this.fenceTemp.mergekeys2.length; i++) {
+        if (column.property === this.fenceTemp.mergekeys2[i]) {
+          const _row = this.fenceTemp.spanObj2[this.fenceTemp.mergekeys2[i]][rowIndex]
           const _col = _row > 0 ? 1 : 0
           return {
             rowspan: _row,
@@ -4761,44 +4890,50 @@ export default {
     },
     clickRecipeTemplate3(row){
       this.modificationRecordTemp.temp1 = Object.assign({}, row)
-      this.modificationRecordTemp.temp2 = Object.assign({}, row)
       this.modificationRecordTemp.dialogFormVisible = true
       this.modificationRecordTemp.dialogStatus = 'modificationRecord'
+      this.getFTHisdryweightList()
       this.getRecipeTemplateList1()
-      this.getRecipeTemplateList2()
     },
     getRecipeTemplateList1() {
       this.modificationRecordTemp.listLoading1 = true
-      let url = 'authdata/GetDataByName'
-      let data = {}
-      data.parammaps = this.modificationRecordTemp.getdataListParm1.parammaps
+      let url = 'authdata/recipetemplate/history'
+      let data = {
+        ftid: this.modificationRecordTemp.temp1.ftid,
+        pastureid: Cookies.get('pastureid'),
+        createdate: this.modificationRecordTemp.temp1.createdate
+      }
       postJson(url, data).then(response => {
-        // if (response.data.list !== null) {
-        //   this.modificationRecordTemp.list1 = response.data.list
-        // } else {
+        if (response.data !== null) {
+          this.modificationRecordTemp.list1 = response.data.current
+          this.modificationRecordTemp.list2 = response.data.last
+        } else {
           this.modificationRecordTemp.list1 = []
-        // }
-        // this.modificationRecordTemp.total1 = response.data.total
+        }
         setTimeout(() => {
           this.modificationRecordTemp.listLoading1 = false
         }, 100)
       })
     },
-    getRecipeTemplateList2() {
-      this.modificationRecordTemp.listLoading2 = true
+    getFTHisdryweightList(){
       let url = 'authdata/GetDataByName'
-      let data = {}
-      data.parammaps = this.modificationRecordTemp.getdataListParm2.parammaps
+      let data = {
+        name:'getFTHisdryweight',
+        parammaps:{
+          ftid: this.modificationRecordTemp.temp1.ftid,
+          pastureid: Cookies.get('pastureid'),
+          createdate: this.modificationRecordTemp.temp1.createdate
+        }
+      }
       postJson(url, data).then(response => {
-        // if (response.data.list !== null) {
-        //   this.modificationRecordTemp.list2 = response.data.list
-        // } else {
-          this.modificationRecordTemp.list2 = []
-        // }
-        // this.modificationRecordTemp.total2 = response.data.total
-        setTimeout(() => {
-          this.modificationRecordTemp.listLoading2 = false
-        }, 100)
+        console.log(response)
+        if (response.data !== null) {
+          this.modificationRecordTemp.lastdate = response.data.list.lastdate
+          this.modificationRecordTemp.currentdate = response.data.list.currentdate
+        } else {
+          this.modificationRecordTemp.lastdate = ''
+          this.modificationRecordTemp.currentdate = ''
+        }
       })
     },
     changeccysChecked(item){
@@ -4807,7 +4942,71 @@ export default {
       }
       this.getTabList()
       this.getTabList2()
-    }
+    },
+    getSummaries1(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        if (column.property !== undefined) {
+          // 加了prop属性的el-table-column 才能找到column.property
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr // 多行相加
+              } else {
+                return prev
+              }
+            }, 0)
+            if(this.modificationRecordTemp.lastdate == undefined){
+              this.modificationRecordTemp.lastdate = ''
+            }
+            sums[index] = sums[index].toFixed(4) + '(干物质量:' + this.modificationRecordTemp.lastdate + ')'
+          } else {
+            sums[index] = ''
+          }
+        }
+      })
+      // console.log(sums, 'sums[index]')
+      return sums
+    },
+    getSummaries2(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        if (column.property !== undefined) {
+          // 加了prop属性的el-table-column 才能找到column.property
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr // 多行相加
+              } else {
+                return prev
+              }
+            }, 0)
+            if(this.modificationRecordTemp.currentdate == undefined){
+              this.modificationRecordTemp.currentdate = ''
+            }
+            sums[index] = sums[index].toFixed(4) + '(干物质量:' + this.modificationRecordTemp.currentdate + ')'
+          } else {
+            sums[index] = ''
+          }
+        }
+      })
+      // console.log(sums, 'sums[index]')
+      return sums
+    },
   }
 }
 </script>

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

@@ -90,7 +90,7 @@
                   class="elTable table-fixed"
                 >
                   <el-table-column label="操作编号" min-width="50px" align="center" prop="sort" />
-                  <el-table-column label="饲料名称" min-width="50px" align="center" prop="fname" />
+                  <el-table-column label="栏舍名称" min-width="50px" align="center" prop="fname" />
                   <el-table-column label="计划重量" min-width="50px" align="center" prop="lweight" />
                   <el-table-column label="实际重量" min-width="50px" align="center" prop="actualweightminus" />
                   <el-table-column label="误差值" min-width="50px" align="center" prop="diff" />

+ 35 - 23
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -11,11 +11,13 @@
           <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
           <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
           <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
-          <!-- <el-radio v-model="tab.radio" label="4" @change="changeRadio">班次</el-radio> -->
           <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 245px;" placeholder="配方模板" />
           <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.barname" class="filter-item" style="width: 150px;" placeholder="栏舍" />
           <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 150px;" placeholder="配方模板" />
           <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.cowclass" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />
+          <el-select v-model="tab.table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <el-button class="successBorder" @click="handleSearch">查询</el-button>
           <el-button class="export" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
           <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
@@ -39,7 +41,6 @@
             <el-table-column v-if="tab.isHouseName" sortable label="栏舍" min-width="70px" align="center" prop="栏舍" />
             <el-table-column v-if="tab.isHouseName" sortable label="配方模板" min-width="70px" align="center" prop="配方模板" />
             <el-table-column v-if="tab.isLivestockType" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
-            <el-table-column v-if="tab.isTimes" sortable label="班次" min-width="70px" align="center" prop="班次" />
             <el-table-column sortable label="实际牛头数" min-width="60px" align="center" prop="实际牛头数" />
             <el-table-column sortable label="应混料量(kg)" min-width="60px" align="center" prop="应混料量" />
             <el-table-column sortable label="实际混料量(kg)" min-width="70px" align="center" prop="实际混料量" />
@@ -634,6 +635,20 @@ export default {
         selectYear: parseTime(new Date(), '{y}'),
         yearList: [],
         weekList: [],
+        // 班次
+        maxTime: {
+          getMaxTimesParm: {
+            name: 'getSysoptEnable',
+            page: 1,
+            offset: 1,
+            pagecount: 1,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              inforname: 'times'
+            }
+          }
+        },
         table: {
           getdataListParm: {
             name: 'getFeedEfficiencyFT',
@@ -655,7 +670,7 @@ export default {
           list: [],
           total: 0,
           listLoading: true,
-          temp: {}
+          temp: {},
         },
         chart1: {
           chartLine: null,
@@ -937,6 +952,7 @@ export default {
       tab2Download2List2:[],
       tab2Download2List3:[],
       tab2Download2List4:[],
+      frequencyList:[],
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       myHeight: document.documentElement.clientHeight - 85 - 210
@@ -951,8 +967,24 @@ export default {
     this.getChart3()
     this.getChart4()
     this.getChart5()
+    this.getIsDisplay()
   },
   methods: {
+    getIsDisplay() {
+      GetDataByName(this.tab.maxTime.getMaxTimesParm).then(response => {
+        console.log(response.data.list[0].inforvalue)
+        this.myMaxTimes = response.data.list[0].inforvalue
+        if (response.data.list[0].inforvalue == 1) {
+          this.frequencyList = [{ id: '1', name: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+        } else if (response.data.list[0].inforvalue == 3) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+        } else if (response.data.list[0].inforvalue == 4) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+        }
+      })
+    },
     getAllYear() {
       var myDate = new Date()
       var thisYear = myDate.getFullYear() // 获取当年年份
@@ -1629,7 +1661,6 @@ export default {
         this.tab.isFormulaName = true
         this.tab.isHouseName = false
         this.tab.isLivestockType = false
-        this.tab.isTimes = false
         this.tab.table.getdataListParm.parammaps.ftname = ''
         this.tab.table.getdataListParm.parammaps.barname = ''
         this.tab.table.getdataListParm.parammaps.ftname = ''
@@ -1646,7 +1677,6 @@ export default {
         this.tab.isFormulaName = false
         this.tab.isHouseName = true
         this.tab.isLivestockType = false
-        this.tab.isTimes = false
         this.tab.table.getdataListParm.parammaps.ftname = ''
         this.tab.table.getdataListParm.parammaps.barname = ''
         this.tab.table.getdataListParm.parammaps.ftname = ''
@@ -1663,7 +1693,6 @@ export default {
         this.tab.isFormulaName = false
         this.tab.isHouseName = false
         this.tab.isLivestockType = true
-        this.tab.isTimes = false
         this.tab.table.getdataListParm.parammaps.ftname = ''
         this.tab.table.getdataListParm.parammaps.barname = ''
         this.tab.table.getdataListParm.parammaps.ftname = ''
@@ -1675,23 +1704,6 @@ export default {
         this.getChart5()
         this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
         this.getChart4()
-      }else if (this.tab.radio == '4') {
-        console.log('接口待对班次')
-        this.tab.isFormulaName = false
-        this.tab.isHouseName = false
-        this.tab.isLivestockType = false
-        this.tab.isTimes = true
-        // this.tab.table.getdataListParm.parammaps.ftname = ''
-        // this.tab.table.getdataListParm.parammaps.barname = ''
-        // this.tab.table.getdataListParm.parammaps.ftname = ''
-        // this.tab.table.getdataListParm.parammaps.cowclass = ''
-        // this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
-        // this.getTabList()
-        // this.tab.chart5.statisticsList = []
-        // this.tab.chart5.getdataListParm.name = 'getFeedEffCB'
-        // this.getChart5()
-        // this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
-        // this.getChart4()
       }
     },
 

+ 28 - 17
src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue

@@ -768,25 +768,22 @@ export default {
               headerArr.push(exportTitle1[i])
             }
           }
-        } else {
-          for (let i = 0; i < exportTitle1.length; i++) {
-            if (i > 0) {
-              headerArr.push(exportTitle1[i], '')
-            } else {
-              headerArr.push(exportTitle1[i])
-            }
+        } else {
+          if(this.tab2.table.getdataListParm.parammaps.typea == ''){
+            for (let i = 0; i < exportTitle1.length; i++) {
+              if (i > 0) {
+                headerArr.push(exportTitle1[i], '')
+              } else {
+                headerArr.push(exportTitle1[i])
+              }
+            }
+          }else{
+            headerArr = exportTitle1
           }
         }
-        console.log('一级表头处理后', headerArr)
-        // var valueArr = [] // 对应字段
-        // for (let i = 0; i < exportTitle2.length; i++) {
-        //   if (i == 0) {
-        //     valueArr.push('A')
-        //   } else {
-        //     valueArr.push('a' + [i - 1])
-        //   }
-        // }
-        // console.log('对应字段valueArr', valueArr)
+        console.log('headerArr', headerArr)
+        console.log('exportTitle2', exportTitle2)
+        console.log('filterValArr', filterValArr)
         if (headerArr.length > 0) {
           import('@/vendor/Export3Excel').then((excel) => {
             const multiHeader = [
@@ -800,6 +797,20 @@ export default {
             const merges = ['A1:A1']
             excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
           })
+        }else{
+          import('@/vendor/Export3Excel').then((excel) => {
+            const multiHeader = [
+              headerArr
+            ]
+            const multiHeader2 = []
+            const tHeader = exportTitle2
+            const filterVal = filterValArr
+            const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
+            // const data = []
+            // const merges = ['A1:A1']
+            const merges = []
+            excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
+          })
         }
       } else if (item == 'tab3') {
         console.log('价格分析导出')

+ 44 - 20
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -17,7 +17,7 @@
         <el-option v-for="item in workingConditionList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <!-- 临时注释 -->
-      <!-- <div style="display: inline-block;" class="filter-item1">
+      <div style="display: inline-block;" class="filter-item1">
         <el-input-number :controls="false" :precision="2" v-model="hlwc1" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
         <span>-</span>
         <el-input-number :controls="false" :precision="2"  v-model="hlwc2" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -27,8 +27,8 @@
         <span>-</span>
         <el-input-number :controls="false" :precision="2" v-model="hlzq2" placeholder="混料准确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
       </div>
-      <el-select v-model="table.getdataListParm.parammaps.cixCategory" placeholder="混料类别" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in cixCategoryList" :key="item.id" :label="item.name" :value="item.id" />
+      <el-select v-model="table.getdataListParm.parammaps.fclassid" placeholder="混料类别" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in cixCategoryList" :key="item.id" :label="item.fcname" :value="item.id" />
       </el-select>
       <div style="display: inline-block;" class="filter-item1">
         <el-input-number :controls="false" :precision="2" v-model="slwc1" placeholder="撒料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -40,7 +40,7 @@
         <span>-</span>
         <el-input-number :controls="false" :precision="2" v-model="slzq2" placeholder="撒料准确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
       </div>
-      <el-checkbox v-model="ccys"style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox> -->
+      <el-checkbox v-model="ccys"style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox>
       <!-- 临时注释 -->
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
@@ -564,14 +564,14 @@ export default {
           }
           return time.getTime() > Date.now() + 8.64e7
         }
+      },
+      cixCategoryParm:{
+        name: 'getFeedclassList', offset: 0, pagecount: 0,
+        parammaps: { 'pastureid': Cookies.get('pastureid') }
       },
-      requestParams: [
-        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
-        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
-      ],
       planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
       workingConditionList: [{ id: '0', name: '进行中' }, { id: '1', name: '已完成' }], // 工作状态
-      cixCategoryList: [{ id: '0', name: '饲料' }, { id: '1', name: '精料' }, { id: '2', name: '粗料' }, { id: '3', name: '其他' }], // 混料类别
+      cixCategoryList: [], // 混料类别
 
       // TMR设备列表
       table: {
@@ -590,7 +590,7 @@ export default {
             tmrtname: '',
             lpplantype: '',
             error:'',
-            cixCategory:''
+            fclassid:''
           }
         },
         tableKey: 0,
@@ -688,7 +688,8 @@ export default {
       },
     }
   },
-  created() {
+  created() {
+    this.getCixCategoryList()
     this.getList()
   },
   methods: {
@@ -705,7 +706,15 @@ export default {
          this.TMRList = response.data.list
       })
     },
-
+    getCixCategoryList(){
+      GetDataByName(this.cixCategoryParm).then(response => {
+        if(response.data.list !== null){
+          this.cixCategoryList = response.data.list
+        }else{
+          this.cixCategoryList = []
+        }
+      })
+    },
     // TMR设备列表
     getList() {
       this.table.listLoading = true
@@ -723,7 +732,9 @@ export default {
             this.table2.getdataListParm.parammaps.id = response.data.list[0].id
             this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
-            this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+            this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
             this.getList2()
             this.getList3()
           } else if (response.data.list[0].lpplantype == '剩料计划') {
@@ -740,7 +751,9 @@ export default {
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
             this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
-            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+            this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
             this.getList2()
             this.getList3()
             this.getList4()
@@ -756,7 +769,9 @@ export default {
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
             this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
-            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+            this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
             this.getList2()
             this.getList3()
             this.getList4()
@@ -775,7 +790,9 @@ export default {
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
             this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
-            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+            this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
             this.getList2()
             this.getList3()
             this.getList4()
@@ -794,7 +811,9 @@ export default {
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
             this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
-            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+            this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
             this.getList2()
             this.getList3()
             this.getList4()
@@ -813,7 +832,9 @@ export default {
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
             this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
-            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+            this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+            this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
             this.getList2()
             this.getList3()
             this.getList4()
@@ -928,7 +949,8 @@ export default {
       this.getList()
     },
     handleRefresh() {
-      console.log('点击了重置')
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.fclassid = ''
       this.table.getdataListParm.parammaps.tmrtname = ''
       this.table.getdataListParm.parammaps.iscompleted = ''
       this.table.getdataListParm.parammaps.lpplantype = ''
@@ -981,7 +1003,9 @@ export default {
       this.getDownList()
       this.getList()
     },
-    rowClick(row, column, event) {
+    rowClick(row, column, event) {
+      this.table2.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
+      this.table3.getdataListParm.parammaps.fclassid = this.table.getdataListParm.parammaps.fclassid
       this.table2.getdataListParm.parammaps.id = row.id
       this.table3.getdataListParm.parammaps.pid = row.id
       this.table4.getdataListParm.parammaps.pid = row.id

+ 5 - 1
src/views/systemManagement/dataSynchronization/index.vue

@@ -26,6 +26,7 @@
         <el-divider></el-divider>
         <el-form-item label="手动同步:">
           <el-button class="successBorder" :disabled="form.cmo == ''" @click="handleSyncNow">立刻同步</el-button>
+           <el-date-picker v-model="form.date" :clearable="false"  :disabled="form.cmo == ''" style="margin-left: 10px;" type="date" placeholder="选择日期"> </el-date-picker>
         </el-form-item>
         <el-form-item label="同步内容:">
           下载数据
@@ -43,6 +44,7 @@
 </template>
 
 <script>
+  import { parseTime } from '@/utils/index.js'
 import { postJson,checkButtons } from '@/api/common'
 import Cookies from 'js-cookie'
 import Pagination from '@/components/Pagination'
@@ -102,7 +104,8 @@ export default {
           type3: [],
           type4: [],
           resource: '',
-          desc: ''
+          desc: '',
+          date:parseTime(new Date(), '{y}-{m}-{d}')
         },
 
 
@@ -308,6 +311,7 @@ export default {
       const url = 'authdata/synchronizeNow'
       const data = {}
       data.company = this.form.cmo
+      data.date = parseTime(this.form.date, '{y}-{m}-{d}')
       postJson(url, data).then(response => {
         if (response.msg == 'ok') {
           this.$notify({ title: '成功', message: '保存成功', type: 'success',  duration: 2000 })

+ 305 - 150
src/views/systemManagement/reminderSettings/index.vue

@@ -1,9 +1,6 @@
 <template>
   <div class="app-container">
     <div class="table">
-      <div class="search">
-        <el-button class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
-      </div>
       <el-table
         :key="table.tableKey"
         v-loading="table.listLoading"
@@ -104,7 +101,7 @@
                   <el-row>
                     <el-col :span="24">
                       <el-form-item label="发送时间">
-                         <el-time-select placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
+                         <el-time-select placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:05', end: '23:59' }" />
                       </el-form-item>
                     </el-col>
                   </el-row>
@@ -160,7 +157,7 @@
                   <el-row>
                     <el-col :span="24">
                       <el-form-item label="发送时间">
-                         <el-time-select placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
+                         <el-time-select placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:05', end: '23:59' }" />
                       </el-form-item>
                     </el-col>
                   </el-row>
@@ -178,6 +175,7 @@
               <el-row :gutter="5">
                 <el-col :span="6">
                   <el-table
+                    ref="setUpTable1"
                     :key="setUp.tableKey1"
                     v-loading="setUp.listLoading1"
                     element-loading-text="给我一点时间"
@@ -190,7 +188,7 @@
                     :cell-style="cellStyle"
                     class="elTable table-fixed"
                     @selection-change="handleSelectionChange1"
-                    :height="450"
+                    :height="350"
                   >
                     <el-table-column type="selection" align="center" width="50" />
                     <el-table-column label="角色名" min-width="100px" align="center" prop="rolename" />
@@ -198,6 +196,7 @@
                 </el-col>
                 <el-col :span="18">
                   <el-table
+                    ref="setUpTable2"
                     :key="setUp.tableKey2"
                     v-loading="setUp.listLoading2"
                     element-loading-text="给我一点时间"
@@ -210,7 +209,7 @@
                     :cell-style="cellStyle"
                     class="elTable table-fixed"
                     @selection-change="handleSelectionChange2"
-                    :height="450"
+                    :height="350"
                   >
                     <el-table-column type="selection" align="center" width="50" />
                     <el-table-column label="用户名称" min-width="130px" align="center" prop="username" />
@@ -250,47 +249,70 @@
               <el-row>
                 <el-col :span="24">
                   <el-form-item label="发送方式:" prop="sendingMethod">
-                    <el-select v-model="temp.sendingMethod" style="width: 100%;" placeholder="发送方式">
+                    <el-select disabled v-model="temp.sendingMethod" style="width: 100%;" placeholder="发送方式">
                       <el-option v-for="item in modeList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                   </el-form-item>
                 </el-col>
               </el-row>
+              <div v-if="temp.sendingMethod == '1'">
+                <el-row :gutter="5">
+                  <el-col :span="18">
+                    <el-form-item label="发送机制">
+                      <el-select disabled v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
+                        <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id" />
+                      </el-select>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6" v-if="temp.sendingMechanism == '2'">
+                      <el-input disabled ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
+                  </el-col>
+                </el-row>
+                <el-row v-if="temp.sendingMechanism !== '1' && temp.sendingMechanism !== ''">
+                  <el-col :span="24">
+                    <el-form-item label="间隔周期:">
+                      <el-input disabled ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
+                      <el-input disabled ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
+                      <el-input disabled ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </div>
               <div v-if="temp.sendingMethod == '2'">
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="延时:">
-                      <el-input ref="delayed1" v-model="temp.delayed1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
-                      <el-input ref="delayed2" v-model="temp.delayed2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
-                      <el-input ref="delayed3" v-model="temp.delayed3" style="width: 32%;" placeholder="分钟" type="text" />
+                      <el-input disabled ref="delayed1" v-model="temp.delayed1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
+                      <el-input disabled ref="delayed2" v-model="temp.delayed2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
+                      <el-input disabled ref="delayed3" v-model="temp.delayed3" style="width: 32%;" placeholder="分钟" type="text" />
                     </el-form-item>
                   </el-col>
                 </el-row>
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="发送时间">
-                       <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
+                       <el-time-select disabled placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:05', end: '23:59' }" />
                     </el-form-item>
                   </el-col>
                 </el-row>
                 <el-row :gutter="5">
                   <el-col :span="18">
                     <el-form-item label="发送机制">
-                      <el-select v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
+                      <el-select disabled v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
                         <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id" />
                       </el-select>
                     </el-form-item>
                   </el-col>
                   <el-col :span="6" v-if="temp.sendingMechanism == '2'">
-                      <el-input ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
+                      <el-input disabled ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
                   </el-col>
                 </el-row>
                 <el-row v-if="temp.sendingMechanism !== '1' && temp.sendingMechanism !== ''">
                   <el-col :span="24">
                     <el-form-item label="间隔周期:">
-                      <el-input ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
-                      <el-input ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
-                      <el-input ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
+                      <el-input disabled ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
+                      <el-input disabled ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
+                      <el-input disabled ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -306,18 +328,18 @@
                 <el-row :gutter="5">
                   <el-col :span="18">
                     <el-form-item label="周期类型">
-                      <el-select v-model="temp.cycleType" style="width: 100%;" placeholder="周期类型">
+                      <el-select disabled v-model="temp.cycleType" style="width: 100%;" placeholder="周期类型">
                         <el-option v-for="item in cycleTypeList" :key="item.id" :label="item.name" :value="item.id" />
                       </el-select>
                     </el-form-item>
                   </el-col>
                   <el-col :span="6" v-if="temp.cycleType == '2'">
-                    <el-select v-model="temp.week" style="width: 100%;" placeholder="每周">
+                    <el-select disabled v-model="temp.week" style="width: 100%;" placeholder="每周">
                       <el-option v-for="item in weekList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                   </el-col>
                   <el-col :span="6" v-if="temp.cycleType == 3">
-                    <el-select v-model="temp.month" style="width: 100%;" placeholder="每月">
+                    <el-select disabled v-model="temp.month" style="width: 100%;" placeholder="每月">
                       <el-option v-for="item in monthList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                   </el-col>
@@ -325,7 +347,7 @@
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="发送时间">
-                       <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
+                       <el-time-select disabled placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:05', end: '23:59' }" />
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -333,7 +355,7 @@
             </el-form>
         </div>
         <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
-          <el-button class="cancelClose" @click="see.dialogFormVisible = false;getList(); ">取消</el-button>
+          <el-button class="cancelClose1" @click="see.dialogFormVisible = false;getList(); ">取消</el-button>
         </div>
       </div>
     </el-dialog>
@@ -396,13 +418,13 @@
           { id: '3', name: '每月' },
         ],//周期类型
         weekList:[
-          { id: 'w1', name: '周一' },
-          { id: 'w2', name: '周二' },
-          { id: 'w3', name: '周三' },
-          { id: 'w4', name: '周四' },
-          { id: 'w5', name: '周五' },
-          { id: 'w6', name: '周六' },
-          { id: 'w7', name: '周日' },
+          { id: '1', name: '周一' },
+          { id: '2', name: '周二' },
+          { id: '3', name: '周三' },
+          { id: '4', name: '周四' },
+          { id: '5', name: '周五' },
+          { id: '6', name: '周六' },
+          { id: '7', name: '周日' },
         ],//周
         monthList:[],//月
         mechanism: '0',
@@ -427,7 +449,6 @@
               pastureid: Cookies.get('pastureid')
             }
           },
-          selectList1:[],
           // 用户
           tableKey2: 0,
           list2: [],
@@ -440,7 +461,6 @@
               roleid:''
             }
           },
-          selectList2:[],
           temp:{}
         },
         see:{
@@ -459,6 +479,8 @@
           add:'新增',
           see:'查看'
         },
+        selectList1:[],
+        selectList2:[],
         isokDisable:false,
         rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
         cellStyle: { padding: 0 + 'px' }
@@ -468,13 +490,12 @@
       this.monthList = []
       for(let i=1;i<=31;i++){
         let obj = {}
-        obj.id = 'd'+i
+        obj.id = String(i)
         obj.name = i+'日'
         this.monthList.push(obj)
       }
       this.getList()
     },
-
     methods: {
       getList() {
         this.table.listLoading = true
@@ -505,72 +526,181 @@
         this.setUp.dialogFormVisible = true
         this.activeName = 'first'
         this.setUp.temp = Object.assign({}, row)
-        this.temp.messageName = row.data.type_name //消息名称
+        this.temp.messageName = row.message //消息名称
         this.temp.triggerCondition = row.trigger //触发条件
+        this.temp.sendTime = row.data.push_time //发送时间
+        this.selectList1 = []
+        this.selectList2 = row.user.split(',')
+        console.log(this.selectList2,'this.selectList211')
+        // 立即
         this.temp.sendingMethod = String(row.data.remind_type) //发送方式
-        // if(this.temp.sendingMethod == '2'){
-        //   this.formatMinutes(row.data.interval_time) //延时
-        // }
-        // this.temp.sendTime = row.data.push_time //发送时间
-        // if(row.data.push_limit == 1){//发送机制
-        //   this.temp.sendingMechanism = '1'
-        // }else if(row.data.push_limit == 0){
-        //   this.temp.sendingMechanism = '3'
-        // }else{
-        //   this.temp.sendingMechanism = '2'
-        // }
-        // this.temp.numberCycles = row.data.push_limit  //循环次数
-        // if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
-        //   this.formatMinutes(row.data.interval_time) //间隔周期
-        // }
-        // data.cycle_type = this.temp.sendingMechanism //循环类型
-        // data.date_type = this.temp.cycleType //周期类型
-        // if(this.temp.cycleType == '1'){
-        //   data.push_date = ''
-        // }else if(this.temp.cycleType == '2'){
-        //   data.push_date = this.temp.week
-        // }else{
-        //   data.push_date = this.temp.month
-        // }
-        // 周期类型?
-        if(row.data.date_type == 1){
-          this.temp.cycleType == '1'
-        }else if(row.data.date_type == 2){
-          this.temp.cycleType == '2'
-          row.data.push_date = this.temp.week
-        }else{
-          this.temp.cycleType == '3'
-          row.data.push_date = this.temp.month
+        if(this.temp.sendingMethod == '1'){
+          this.temp.sendingMechanism = String(row.data.cycle_type) //发送机制
+          if(this.temp.sendingMechanism == '2'){
+            this.temp.numberCycles = row.data.push_limit //循环次数
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
         }
-        // this.temp.cycleType = row.data.push_limit  //周期类型
-        this.temp.sendTime = row.data.push_time //发送时间
-        this.getList1()
-      },
-      formatMinutes(minutes) {
-        var day = parseInt(Math.floor(minutes / 1440));
-        var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
-        var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+        // 延时
         if(this.temp.sendingMethod == '2'){
-          this.temp.delayed1 = day;
-          this.temp.delayed2 = hour;
-          this.temp.delayed3 = minute;
-          return this.temp.delayed1;
-          return this.temp.delayed2;
-          return this.temp.delayed3;
+          this.temp.sendingMethod = String(row.data.remind_type) //发送方式
+          if(this.temp.sendingMethod == '2'){
+            //延时
+            var minutes = row.data.delay_time
+            var day = parseInt(Math.floor(minutes / 1440));
+            var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+            var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+            this.temp.delayed1 = day;
+            this.temp.delayed2 = hour;
+            this.temp.delayed3 = minute;
+          }
+          this.temp.sendTime = row.data.push_time //发送时间
+          this.temp.sendingMechanism = String(row.data.cycle_type) //发送机制
+          if(this.temp.sendingMechanism == '2'){
+            this.temp.numberCycles = row.data.push_limit //循环次数
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
         }
-        if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
-          this.temp.intervalPeriod1 = day;
-          this.temp.intervalPeriod2 = hour;
-          this.temp.intervalPeriod3 = minute;
-          return this.temp.intervalPeriod1;
-          return this.temp.intervalPeriod2;
-          return this.temp.intervalPeriod3;
+        // 指定周期
+        if(this.temp.sendingMethod == '3'){
+          this.temp.cycleType = String(row.data.date_type)  //周期类型
+          if(this.temp.cycleType == '2'){
+            this.temp.week = String(row.data.push_date)
+          }
+          if(this.temp.cycleType == '3'){
+            this.temp.month = String(row.data.push_date)
+          }
         }
+        this.getList1()
       },
-      handleSee(){
+      handleSee(row){
         this.see.dialogStatus = 'see'
         this.see.dialogFormVisible = true
-        this.see.temp = Object.assign({}, row)
+        this.setUp.temp = Object.assign({}, row)
+        this.temp.messageName = row.message //消息名称
+        this.temp.triggerCondition = row.trigger //触发条件
+        this.temp.sendTime = row.data.push_time //发送时间
+        // 立即
+        this.temp.sendingMethod = String(row.data.remind_type) //发送方式
+        if(this.temp.sendingMethod == '1'){
+          this.temp.sendingMechanism = String(row.data.cycle_type) //发送机制
+          if(this.temp.sendingMechanism == '2'){
+            this.temp.numberCycles = row.data.push_limit //循环次数
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+        }
+        // 延时
+        if(this.temp.sendingMethod == '2'){
+          this.temp.sendingMethod = String(row.data.remind_type) //发送方式
+          if(this.temp.sendingMethod == '2'){
+            //延时
+            var minutes = row.data.delay_time
+            var day = parseInt(Math.floor(minutes / 1440));
+            var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+            var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+            this.temp.delayed1 = day;
+            this.temp.delayed2 = hour;
+            this.temp.delayed3 = minute;
+          }
+          this.temp.sendTime = row.data.push_time //发送时间
+          this.temp.sendingMechanism = String(row.data.cycle_type) //发送机制
+          if(this.temp.sendingMechanism == '2'){
+            this.temp.numberCycles = row.data.push_limit //循环次数
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+        }
+        // 指定周期
+        if(this.temp.sendingMethod == '3'){
+          this.temp.cycleType = String(row.data.date_type)  //周期类型
+          if(this.temp.cycleType == '2'){
+            this.temp.week = String(row.data.push_date)
+          }
+          if(this.temp.cycleType == '3'){
+            this.temp.month = String(row.data.push_date)
+          }
+        }
       },
       handleClick(item){
         if(item == 'first'){
@@ -581,17 +711,16 @@
       },
       handleSelectionChange1(val) {
         console.log('勾选数据', val)
-        this.setUp.selectList1 = []
+        this.selectList1 = []
         for(let i=0;i<val.length;i++){
-          this.setUp.selectList1.push(val[i].id)
+          this.selectList1.push(val[i].id)
         }
-        this.setUp.data2.parammaps.roleid = this.setUp.selectList1.join(',')
-        console.log(this.setUp.data2.parammaps.roleid)
+        this.setUp.data2.parammaps.roleid = this.selectList1.join(',')
         this.getList2()
       },
       handleSelectionChange2(val) {
-        console.log('勾选数据', val)
-        this.setUp.selectList2 = val
+        this.selectList2 = val.map(item=>item.username)
+        console.log('勾选数据', this.selectList2)
       },
 
       handleGenerateQRcode(){
@@ -607,7 +736,18 @@
         postJson(url,this.setUp.data1).then(response => {
           if (response.data.list !== null) {
             this.setUp.list1 = response.data.list
-            this.setUp.data2.parammaps.roleid = ''
+            if(this.selectList1.length== 0){
+              this.setUp.data2.parammaps.roleid = ''
+            }
+            this.selectList1.forEach(key => {
+              this.setUp.list1.forEach(row => {
+                if (row.id == key) {
+                  this.$nextTick(() => {
+                      this.$refs.setUpTable1.toggleRowSelection(row, true);
+                  })
+                }
+              })
+            })
             this.getList2()
           } else {
             this.setUp.list1 = []
@@ -623,12 +763,26 @@
         postJson(url,this.setUp.data2).then(response => {
           if (response.data.list !== null) {
             this.setUp.list2 = response.data.list
-            if(this.setUp.selectList1.length > 0){
-              this.$set(this.setUp,'selectList2',response.data.list)
+            if(this.selectList1.length !== 0){
+              this.selectList2 = []
+              response.data.list.forEach(key => {
+                this.selectList2.push(key.username)
+              })
             }
+            this.selectList2.forEach(key => {
+              console.log(key,'key')
+              this.setUp.list2.forEach(row => {
+                if (row.username == key) {
+                  this.$nextTick(() => {
+                      this.$refs.setUpTable2.toggleRowSelection(row, true);
+                  })
+                }
+              })
+            })
           } else {
             this.setUp.list2 = []
           }
+          console.log(this.selectList2,'this.selectList2')
           setTimeout(() => {
             this.setUp.listLoading2 = false
           }, 100)
@@ -641,6 +795,9 @@
         let delayed1 = 0
         let delayed2 = 0
         let delayed3 = 0
+        if(this.temp.sendTime == null){
+          this.temp.sendTime = ''
+        }
 
         if(this.temp.delayed1 !== ''){
           delayed1 = parseInt(this.temp.delayed1)*24*60
@@ -687,76 +844,74 @@
         // delayed1   延时
         // sendTime   发送时间
         // numberCycles   循环次数
+        // 发送方式-立即
         if(this.temp.sendingMethod == '1'){
+          data.sys_name = 'tmrWatch'
+          data.pastureid = this.setUp.temp.pastureid
+          // data.service_id = this.setUp.temp.service_id
+          data.type_name = this.temp.messageName
+          data.template_id = 'RLPlaCnqQZt_6s4HZuaFJYbQ9gmTfIYipTYDoKJInY8'
           data.id = this.setUp.temp.id
-          data.user = this.setUp.temp.user
+          data.user = this.selectList2
+          data.remind_type = parseInt(this.temp.sendingMethod)  //发送方式123
+          data.cycle_type = parseInt(this.temp.sendingMechanism)  //发送机制123
+          if(this.temp.sendingMechanism == 2){
+            data.push_limit = this.temp.numberCycles  //循环次数
+            data.interval_time = intervalPeriodTime //间隔周期
+          }
+          if(this.temp.sendingMechanism == 3){
+            data.interval_time = intervalPeriodTime //间隔周期
+          }
+        }
+        // 发送方式-延时
+        if(this.temp.sendingMethod == '2'){
+          data.id = this.setUp.temp.id
+          data.user = this.selectList2
           data.sys_name = 'tmrWatch'
           data.type_name = this.temp.messageName
-          data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
+          data.template_id = 'RLPlaCnqQZt_6s4HZuaFJYbQ9gmTfIYipTYDoKJInY8'
           data.pastureid = Cookies.get('pastureid')
           data.remind_type = parseInt(this.temp.sendingMethod)  //发送方式123
+          data.delay_time = delayedTime //延时
+          data.push_time = this.temp.sendTime //发送时间
           data.cycle_type = parseInt(this.temp.sendingMechanism)  //发送机制123
           if(this.temp.sendingMechanism == 2){
             data.push_limit = this.temp.numberCycles  //循环次数
-            // data.
+            data.interval_time = intervalPeriodTime
+          }
+          if(this.temp.sendingMechanism == 3){
+             data.interval_time = intervalPeriodTime //间隔周期
+          }
+        }
+        // 发送方式-指定周期
+        if(this.temp.sendingMethod == '3'){
+          data.id = this.setUp.temp.id
+          data.user = this.selectList2
+          data.sys_name = 'tmrWatch'
+          data.type_name = this.temp.messageName
+          data.template_id = 'RLPlaCnqQZt_6s4HZuaFJYbQ9gmTfIYipTYDoKJInY8'
+          data.pastureid = Cookies.get('pastureid')
+          data.remind_type = parseInt(this.temp.sendingMethod)  //发送方式123
+          data.cycle_type = '4'//发送机制
+          data.date_type = parseInt(this.temp.cycleType)  //周期类型
+          data.push_time = this.temp.sendTime //发送时间
+          if(this.temp.cycleType == 2){
+            data.push_date = this.temp.week
+          }else{
+            data.push_date = this.temp.month
           }
         }
-        // data.remind_type = parseInt(this.temp.sendingMethod)
-        // let dateTime = 0
-        // let delayed1 = 0
-        // let delayed2 = 0
-        // let delayed3 = 0
-
-        // if(this.temp.delayed1 !== ''){
-        //   delayed1 = parseInt(this.temp.delayed1)*24*60
-        // }else {
-        //   delayed1 = 0
-        // }
-        // if(this.temp.delayed2 !== ''){
-        //   delayed2 = parseInt(this.temp.delayed2)*60
-        // }else {
-        //   delayed2 = 0
-        // }
-        // if(this.temp.delayed3 !== ''){
-        //   delayed3 = parseInt(this.temp.delayed3)
-        // }else{
-        //   delayed2 = 0
-        // }
-        // dateTime = delayed1+ delayed2 + delayed3
-        // if(this.temp.cycleType == '1'){
-        //   data.push_date = 0
-        // }else if(this.temp.cycleType == '2'){
-        //   data.push_date = this.temp.week
-        // }else{
-        //   data.push_date = this.temp.month
-        // }
-        // data.push_time = this.temp.sendTime
-        // data.interval_time = dateTime
-        // if(this.temp.sendingMechanism == '1'){
-        //   data.push_limit = 1
-        // }else if(this.temp.sendingMechanism == '2'){
-        //   data.push_limit = this.temp.numberCycles
-        // }else{
-        //   data.push_limit = 0
-        // }
-
-        // data.cycle_type = this.temp.sendingMechanism //循环类型
-        // data.date_type = this.temp.cycleType //周期类型
-
         postJson(url,data).then(response => {
           if(response.code == 200){
             console.log('成功')
             this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.setUp.dialogFormVisible = false
+            this.getList()
           }else{
-            this.$notify({ title: '成功', message: response.message, type: 'success', duration: 2000 })
+            this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
             console.log('失败')
           }
         })
-      },
-      handleCreate(){
-        this.setUp.dialogStatus = 'add'
-        this.setUp.dialogFormVisible = true
-        this.activeName = 'first'
       }
     }
   }

+ 2 - 2
src/views/systemManagement/user/index.vue

@@ -490,10 +490,10 @@ export default {
         })
       })
     },
-    handleScanningCode(){
+    handleScanningCode(row){
       this.QRcode.dialogStatus = 'QRcode'
       this.QRcode.dialogFormVisible = true
-      this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_id:tmrwatch.'+Cookies.get('name')+ '.'+Cookies.get('employename')
+      this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_str=tmrwatch.'+ Cookies.get('pastureid')+'.'+ row.username + '.'+row.empname
       console.log(this.imgUrl)
     }
   }