Browse Source

更新6-24

duanxiaoduan 2 years ago
parent
commit
a44da940ca

+ 2 - 2
.env.development

@@ -3,10 +3,10 @@ ENV = 'development'
 
 # base api
 # 测试线
-VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
+# VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
 
 
-# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 
 # VUE_APP_BASE_API = 'http://tmrwatch.cn/'
 

BIN
dist.zip


+ 1 - 1
src/api/common.js

@@ -421,4 +421,4 @@ export function whichWeek(year) {
         arr[arr.length - 1].last = yearDay(+new Date(year + 1, 0, 1) / 1000 - 86400)
       }
       return arr
-    }
+    }

+ 2 - 1
src/store/getters.js

@@ -13,7 +13,8 @@ const getters = {
   employeid: state => state.user.employeid,
   dashchartid: state => state.user.dashchartid,
   ispastureuse: state => state.user.ispastureuse,
-  decimal: state => state.user.decimal,
+  decimal: state => state.user.decimal,
+  decimalr: state => state.user.decimalr,
   dashchartidisedit: state => state.user.dashchartidisedit,
   permission_routes: state => state.permission.routes
 }

+ 9 - 2
src/store/modules/user.js

@@ -20,7 +20,8 @@ const state = {
 
   roles: [],
   buttons: [],
-  decimal:''
+  decimal:'',
+  decimalr:''
 }
 
 const mutations = {
@@ -73,6 +74,10 @@ const mutations = {
     Cookies.set('decimal', decimal)
     state.decimal = decimal
   },
+  SET_DECIMALR: (state, decimalr) => {
+    Cookies.set('decimalr', decimalr)
+    state.decimalr = decimalr
+  },
   SET_DEPARTMENTID: (state, departmentid) => {
     Cookies.set('departmentid', departmentid)
     state.departmentid = departmentid
@@ -142,7 +147,8 @@ const actions = {
             commit('SET_EMPLOYEID', response.data.list[0].employeId)
             commit('SET_EMPLOYENAME', response.data.list[0].employeName)
             commit('SET_ISPASTUREUSE', response.data.list[0].isgroups)
-            commit('SET_DECIMAL', 2)
+            commit('SET_DECIMAL', response.data.list[0].decimal)
+            commit('SET_DECIMALR', response.data.list[0].decimalr)
 
             GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'username': username, 'pastureid': response.data.list[0].pastureId } }).then(response => {
               if(response.data.list !== null){
@@ -177,6 +183,7 @@ const actions = {
         Cookies.remove('pastureid')
         Cookies.remove('ispastureuse')
         Cookies.remove('decimal')
+        Cookies.remove('decimalr')
         removeToken()
         resetRouter()
         resolve()

+ 28 - 6
src/utils/request.js

@@ -97,13 +97,35 @@ service.interceptors.response.use(
     }
   },
   error => {
-    console.log('err' + error) // for debug
-    Message({
-      message: error.message,
-      type: 'error',
-      duration: 5 * 1000
+    console.log('err' + error) // for debug
+    let config = error.config
+    if (!config) {
+      Message({ message: error.message, type: 'error', duration: 5 * 1000 })
+      return Promise.reject(error)
+    }
+    // 设置请求超时次数
+    config.__retryCount = config.__retryCount || 0
+    if (config.__retryCount >= 3) {
+      // Message({ message:error.message, type: 'error', duration: 5 * 1000 })
+      Message({ message:'请求超时', type: 'error', duration: 5 * 1000 })
+      // Message.error((error && error.data && error.data.msg) || '请求超时')
+      return Promise.reject(error)
+    }
+    config.__retryCount += 1
+    let backoff = new Promise((resolve) => {
+      setTimeout(() => {
+        resolve()
+      }, config.retryDelay || 1)
+    })
+    return backoff.then(() => {
+      return service(config)
     })
-    return Promise.reject(error)
+    // Message({
+    //   message: error.message,
+    //   type: 'error',
+    //   duration: 5 * 1000
+    // })
+    // return Promise.reject(error)
   }
 )
 

+ 42 - 13
src/views/basicData/defaultParameter/function/index.vue

@@ -35,6 +35,13 @@
         </el-col>
       </el-row>
       <el-row>
+        <el-col :span="12">
+          <el-form-item label="比例小数点位数:" prop="decimalRate">
+            <el-select v-model="createTemp.decimalRate" :disabled="isRoleEdit==false" filterable placeholder="比例小数点位数" class="filter-item" style="width:100%">
+              <el-option v-for="item in rateDecimalPlacesList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :span="12">
           <el-form-item label="是否启用饲料合同:" prop="isEnableContract">
             <el-select v-model="createTemp.isEnableContract" :disabled="isRoleEdit==false" filterable placeholder="启用饲料合同" class="filter-item" style="width:100%">
@@ -42,6 +49,8 @@
             </el-select>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="启用饲料锁定牛头数:" prop="isLockCount">
             <el-select v-model="createTemp.isLockCount" :disabled="isRoleEdit==false" filterable placeholder="启用饲料锁定牛头数" class="filter-item" style="width:100%">
@@ -49,20 +58,18 @@
             </el-select>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item label="车辆载重超出重量提醒比例(%):" prop="remainOptRate">
             <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="车辆载重超出重量禁止比例(%):" prop="remainOptRate">
             <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item label="是否启用补料:" prop="isEnableSupplyFeed">
             <el-select v-model="createTemp.isEnableSupplyFeed" :disabled="isRoleEdit==false" filterable placeholder="是否启用补料" class="filter-item" style="width:100%">
@@ -70,6 +77,8 @@
             </el-select>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="是否启用剩料:" prop="isEnableRemainFeed">
             <el-select v-model="createTemp.isEnableRemainFeed" :disabled="isRoleEdit==false" filterable placeholder="是否启用剩料" class="filter-item" style="width:100%">
@@ -77,8 +86,6 @@
             </el-select>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item label="剩料处理选项:" prop="remainOpt">
             <el-select v-model="createTemp.remainOpt" :disabled="isRoleEdit==false" filterable placeholder="剩料处理选项" class="filter-item" style="width:100%">
@@ -86,6 +93,8 @@
             </el-select>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="剩料分配方式:" prop="remainOptDis">
             <el-select v-model="createTemp.remainOptDis" :disabled="isRoleEdit==false" filterable placeholder="剩料分配方式" class="filter-item" style="width:100%">
@@ -93,13 +102,13 @@
             </el-select>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item label="剩料分配占比原料(%):" prop="remainOptRate">
             <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="小料是否称量:" prop="isSmallMaterial">
             <el-select v-model="createTemp.isSmallMaterial" :disabled="isRoleEdit==false" filterable placeholder="小料是否称量" class="filter-item" style="width:100%">
@@ -107,6 +116,13 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否启用数据同步:" prop="isDataSync">
+            <el-select v-model="createTemp.isDataSync" :disabled="isRoleEdit==false" filterable placeholder="是否启用数据同步" class="filter-item" style="width:100%">
+              <el-option v-for="item in dataSynchronizationList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
       <el-row>
         <!-- <el-col :span="12">
@@ -115,10 +131,15 @@
           </el-form-item>
         </el-col> -->
         <el-col :span="12">
-          <el-form-item label="是否启用数据同步:" prop="isDataSync">
-            <el-select v-model="createTemp.isDataSync" :disabled="isRoleEdit==false" filterable placeholder="是否启用数据同步" class="filter-item" style="width:100%">
-              <el-option v-for="item in dataSynchronizationList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
+          <el-form-item label="任意车数量:" prop="anyCar">
+            <el-input ref="anyCar" v-model="createTemp.anyCar" :disabled="isRoleEdit==false" class="filter-item" placeholder="任意车数量" type="text" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="混料准确率:" prop="accuracy">
+              <el-select v-model="createTemp.accuracy" :disabled="isRoleEdit==false" filterable placeholder="混料准确率" class="filter-item" style="width:100%">
+                <el-option v-for="item in accuracyList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
           </el-form-item>
         </el-col>
       </el-row>
@@ -191,8 +212,10 @@ export default {
       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: '三位小数' }], // 重量小数点位数
+      rateDecimalPlacesList:  [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }],//比例小数点位数
       smallMaterialList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 小料是否称量
       dataSynchronizationList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用数据同步
+      accuracyList: [{ id: '1', name: '排除允许误差准确率' }, { id: '0', name: '不排除允许误差准确率' }],  //混料准确率
       requestParams: [
         { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
       ],
@@ -259,6 +282,9 @@ export default {
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
+      if(this.createTemp.anyCar == '' || this.createTemp.anyCar == 0){
+        this.$message({ type: 'error', message: '任意车数量不能为空或为0', duration: 2000 })
+      }
       this.requestParam.common = { 'returnmap': '0' }
       this.requestParam.data = []
       this.requestParam.data[0] = { 'name': 'updatesysopt', 'type': 'e', 'parammaps': {
@@ -277,11 +303,14 @@ export default {
         isfeedstorage: this.createTemp.isfeedstorage,
         times: this.createTemp.times,
         decimalPlaces: this.createTemp.decimalPlaces,
+        decimalRate: this.createTemp.decimalRate,
         isEnableContract: this.createTemp.isEnableContract,
         remainOptDis: this.createTemp.remainOptDis,
         remainOptRate: this.createTemp.remainOptRate,
         isSmallMaterial: this.createTemp.isSmallMaterial,
-        isDataSync: this.createTemp.isDataSync
+        isDataSync: this.createTemp.isDataSync,
+        anyCar:this.createTemp.anyCar,
+        accuracy:this.createTemp.accuracy
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
         pastureid: this.createTemp.pastureid

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

@@ -31,7 +31,7 @@
           <el-option v-for="item in iscompletedList" :key="item.value" :label="item.lable" :value="item.value" />
         </el-select>
         <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
-        <!-- <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button> -->
+        <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button>
         <el-button class="export" style="margin-left: -5px;" @click="handleDeleteRecord">删除记录</el-button>
       </div>
       <div class="operation" style="margin-bottom: 10px;">

+ 20 - 3
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -575,7 +575,8 @@ export default {
         } else {
           this.TMRNumberList = []
         }
-      })
+      })
+      const url2 = 'authdata/tmrListEnableTypeAll'
       const data2 = {
         name: 'getTMRListEnableTypeAll',
         offset: 0,
@@ -583,9 +584,19 @@ export default {
           pastureid: Cookies.get('pastureid'),
           eqtype: '1'
         }
-      }
+      }
+      // 临时注释
+      // const data2 = {
+      //   parammaps: {
+      //     pastureid: Cookies.get('pastureid')
+      //   }
+      // }
+      // 临时注释
       postJson(url, data2).then(response => {
-        if (response.data !== null) {
+        if (response.data !== null) {
+          // 临时注释
+          // this.equipmentList = response.data
+          // 临时注释
           this.equipmentList = response.data.list
           if(this.create.dialogStatus == 'update'){
             if(this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid) !== undefined){
@@ -1178,6 +1189,12 @@ export default {
           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
+        // }
+        // 临时注释
       }
       console.log('this.create.temp.sumweight', this.create.temp.sumweight)
       var evt = this.create.temp

+ 110 - 45
src/views/formulationPlan/dhedFormula/index.vue

@@ -1875,6 +1875,18 @@ export default {
           return false
         }
       }
+      if(item == 1){
+        row.r1 = parseFloat(row.r1).toFixed(parseInt(Cookies.get('decimalr')))
+      }
+      if(item == 2){
+        row.r2 = parseFloat(row.r2).toFixed(parseInt(Cookies.get('decimalr')))
+      }
+      if(item == 3){
+        row.r3 = parseFloat(row.r3).toFixed(parseInt(Cookies.get('decimalr')))
+      }
+      if(item == 4){
+        row.r4 = parseFloat(row.r4).toFixed(parseInt(Cookies.get('decimalr')))
+      }
       if (row.r1 == '') { row.r1 = 0 }
       if (row.r2 == '') { row.r2 = 0 }
       if (row.r3 == '') { row.r3 = 0 }
@@ -2254,23 +2266,35 @@ export default {
                 console.log('34班比例为0,2班不为0')
               }else if(row.r4 === 0 && row.r2 !== 0 && row.r3 !== 0){
                 row.r4 = 0
-                row.r2 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r2)
-                row.r3 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r3)
+                // row.r2 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r2)
+                // row.r3 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r3)
+                let average1 = (parseFloat(this.focusWRow.r1) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow.r1) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average1) + parseFloat(this.focusWRow.r2)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average2) + parseFloat(this.focusWRow.r3)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('4班比例为0,23班不为0')
               }else if(row.r2 === 0 && row.r4 !== 0 && row.r3 !== 0){
                 row.r2 = 0
-                row.r3 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r3)
-                row.r4 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r4)
+                // row.r3 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r3)
+                // row.r4 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r4)
+                let average1 = (parseFloat(this.focusWRow.r1) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow.r1) - 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')))
                 console.log('2班比例为0,34班不为0')
               }else if(row.r3 === 0 && row.r4 !== 0 && row.r3 !== 0){
                 row.r3 = 0
-                row.r2 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r2)
-                row.r4 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r4)
+                // row.r2 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r2)
+                // row.r4 = parseFloat(this.focusWRow.r1) / 2 + parseFloat(this.focusWRow.r4)
+                let average1 = (parseFloat(this.focusWRow.r1) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow.r1) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average1) + parseFloat(this.focusWRow.r2)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow.r4)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('3班比例为0,24班不为0')
               }else{
                 console.log('234班不为0')
-                let average1 = (parseFloat(this.focusWRow.r1) /3 ).toFixed(2)
-                let average2 = (parseFloat(this.focusWRow.r1) - average1*2).toFixed(2)
+                let average1 = (parseFloat(this.focusWRow.r1) /3 ).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow.r1) - average1*2).toFixed(parseInt(Cookies.get('decimalr')))
                 row.r2 = parseFloat(average1) + parseFloat(this.focusWRow.r2)
                 row.r3 = parseFloat(average1) + parseFloat(this.focusWRow.r3)
                 row.r4 = parseFloat(average2) + parseFloat(this.focusWRow.r4)
@@ -2371,9 +2395,10 @@ export default {
                 console.log('3班比例为0,2班不为0')
               }else{
                 console.log('23班不为0')
-                let average1 = (parseFloat(this.focusWRow.r1) / 2 ).toFixed(2)
-                row.r2 = parseFloat(average1) + parseFloat(this.focusWRow.r2)
-                row.r3 = parseFloat(average1) + parseFloat(this.focusWRow.r3)
+                let average1 = (parseFloat(this.focusWRow.r1) / 2 ).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow.r1) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average1) + parseFloat(this.focusWRow.r2)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average2) + parseFloat(this.focusWRow.r3)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log(average1,row.r2,row.r3)
               }
             }
@@ -2811,23 +2836,35 @@ export default {
                 console.log('34班比例为0,1班不为0')
               }else if(row.r1 === 0 && row.r3 !== 0 && row.r4 !== 0){
                 row.r1 = 0
-                row.r3 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r3)
-                row.r4 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r4)
+                // row.r3 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r3)
+                // 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')))
                 console.log('1班比例为0,34班不为0')
               }else if(row.r3 === 0 && row.r1 !== 0 && row.r4 !== 0){
                 row.r3 = 0
-                row.r1 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r1)
-                row.r4 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r4)
+                // row.r1 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r1)
+                // 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')))
                 console.log('3班比例为0,14班不为0')
               }else if(row.r4 === 0 && row.r1 !== 0 && row.r3 !== 0){
                 row.r4 = 0
-                row.r1 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r1)
-                row.r3 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r3)
+                // row.r1 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r1)
+                // row.r3 = parseFloat(this.focusWRow2.r2) / 2 + parseFloat(this.focusWRow2.r3)
+                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.focusWRow2.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average2) + parseFloat(this.focusWRow2.r3)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('4班比例为0,13班不为0')
               }else{
                 console.log('134班不为0')
-                let average1 = (parseFloat(this.focusWRow2.r2) /3 ).toFixed(2)
-                let average2 = (parseFloat(this.focusWRow2.r2) - average1*2).toFixed(2)
+                let average1 = (parseFloat(this.focusWRow2.r2) /3 ).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow2.r2) - average1*2).toFixed(parseInt(Cookies.get('decimalr')))
                 row.r1 = parseFloat(average1) + parseFloat(this.focusWRow2.r1)
                 row.r3 = parseFloat(average1) + parseFloat(this.focusWRow2.r3)
                 row.r4 = parseFloat(average2) + parseFloat(this.focusWRow2.r4)
@@ -2922,9 +2959,10 @@ export default {
                 console.log('3班比例为0,1班不为0')
               }else{
                 console.log('13班不为0')
-                let average1 = (parseFloat(this.focusWRow2.r2) / 2 ).toFixed(2)
-                row.r1 = parseFloat(average1) + parseFloat(this.focusWRow2.r1)
-                row.r3 = parseFloat(average1) + parseFloat(this.focusWRow2.r3)
+                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.focusWRow2.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average2) + parseFloat(this.focusWRow2.r3)).toFixed(parseInt(Cookies.get('decimalr')))
               }
             }
           }else{
@@ -3332,11 +3370,13 @@ export default {
           }
           let a = 0
           if(parseFloat(this.focusWRow3.r3) !== 0){
+            console.log(row.r4,'==r4')
+            console.log(this.focusWRow3.r4,'==r42')
             a = 1 / (parseFloat(row.r3) / 100) * parseFloat(row.w3)
             if(parseFloat(row.w3) == 0){
               row.r3 = 0
               a = (parseFloat(this.focusWRow3.dailyWeight) / parseFloat(this.focusWRow3.sumr)*100).toFixed(2)
-              if(row.r1 === 0 && row.r2 === 0 && row.r4 === 0){
+              if(row.r1 == 0 && row.r2 == 0 && row.r4 === 0){
                 row.r1 = 0
                 row.r2 = 0
                 row.r4 = 0
@@ -3358,23 +3398,35 @@ export default {
                 console.log('24班比例为0,1班不为0')
               }else if(row.r1 === 0 && row.r2 !== 0 && row.r4 !== 0){
                 row.r1 = 0
-                row.r2 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r2)
-                row.r4 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r4)
+                // row.r2 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r2)
+                // row.r4 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r4)
+                let average1 = (parseFloat(this.focusWRow3.r3) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow3.r3) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average1) + parseFloat(this.focusWRow3.r2)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow3.r4)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('1班比例为0,24班不为0')
               }else if(row.r2 === 0 && row.r1 !== 0 && row.r4 !== 0){
                 row.r2 = 0
-                row.r1 = parseFloat(this.focusWRow3.r2) / 2 + parseFloat(this.focusWRow3.r1)
-                row.r4 = parseFloat(this.focusWRow3.r2) / 2 + parseFloat(this.focusWRow3.r4)
-                console.log('3班比例为0,14班不为0')
-              }else if(row.r4 === 0 && row.r1 !== 0 && row.r3 !== 0){
+                // row.r1 = parseFloat(this.focusWRow3.r2) / 2 + parseFloat(this.focusWRow3.r1)
+                // row.r4 = parseFloat(this.focusWRow3.r2) / 2 + parseFloat(this.focusWRow3.r4)
+                let average1 = (parseFloat(this.focusWRow3.r3) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow3.r3) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow3.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r4 = (parseFloat(average2) + parseFloat(this.focusWRow3.r4)).toFixed(parseInt(Cookies.get('decimalr')))
+                console.log('2班比例为0,14班不为0')
+              }else if(row.r4 === 0 && row.r1 !== 0 && row.r2 !== 0){
                 row.r4 = 0
-                row.r1 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r1)
-                row.r2 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r2)
+                // row.r1 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r1)
+                // row.r2 = parseFloat(this.focusWRow3.r3) / 2 + parseFloat(this.focusWRow3.r2)
+                let average1 = (parseFloat(this.focusWRow3.r3) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow3.r3) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow3.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average2) + parseFloat(this.focusWRow3.r2)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('4班比例为0,12班不为0')
               }else{
                 console.log('124班不为0')
-                let average1 = (parseFloat(this.focusWRow3.r3) / 3 ).toFixed(2)
-                let average2 = (parseFloat(this.focusWRow3.r3) - average1*2).toFixed(2)
+                let average1 = (parseFloat(this.focusWRow3.r3) / 3 ).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow3.r3) - average1*2).toFixed(parseInt(Cookies.get('decimalr')))
                 row.r1 = parseFloat(average1) + parseFloat(this.focusWRow3.r1)
                 row.r2 = parseFloat(average1) + parseFloat(this.focusWRow3.r2)
                 row.r4 = parseFloat(average2) + parseFloat(this.focusWRow3.r4)
@@ -3473,9 +3525,10 @@ export default {
                 console.log('2班比例为0,1班不为0')
               }else{
                 console.log('13班不为0')
-                let average1 = (parseFloat(this.focusWRow3.r3) / 2).toFixed(2)
-                row.r1 = parseFloat(average1) + parseFloat(this.focusWRow3.r1)
-                row.r2 = parseFloat(average1) + parseFloat(this.focusWRow3.r2)
+                let average1 = (parseFloat(this.focusWRow3.r3) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow3.r3) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow3.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average2) + parseFloat(this.focusWRow3.r2)).toFixed(parseInt(Cookies.get('decimalr')))
               }
             }
           }else{
@@ -3860,24 +3913,36 @@ export default {
                 console.log('23班比例为0,1班不为0')
               }else if(row.r1 === 0 && row.r2 !== 0 && row.r3 !== 0){
                 row.r1 = 0
-                row.r2 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r2)
-                row.r3 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r3)
+                // row.r2 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r2)
+                // row.r3 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r3)
+                let average1 = (parseFloat(this.focusWRow4.r4) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow4.r4) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average1) + parseFloat(this.focusWRow4.r2)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average2) + parseFloat(this.focusWRow4.r3)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('1班比例为0,23班不为0')
               }else if(row.r2 === 0 && row.r1 !== 0 && row.r3 !== 0){
                 row.r2 = 0
-                row.r1 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r1)
-                row.r3 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r3)
+                // row.r1 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r1)
+                // row.r3 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r3)
+                let average1 = (parseFloat(this.focusWRow4.r4) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow4.r4) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow4.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r3 = (parseFloat(average2) + parseFloat(this.focusWRow4.r3)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('2班比例为0,13班不为0')
               }else if(row.r3 === 0 && row.r1 !== 0 && row.r2 !== 0){
                 row.r3 = 0
                 row.w3 = 0
-                row.r1 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r1)
-                row.r2 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r2)
+                // row.r1 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r1)
+                // row.r2 = parseFloat(this.focusWRow4.r4) / 2 + parseFloat(this.focusWRow4.r2)
+                let average1 = (parseFloat(this.focusWRow4.r4) / 2).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow4.r4) - parseFloat(average1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r1 = (parseFloat(average1) + parseFloat(this.focusWRow4.r1)).toFixed(parseInt(Cookies.get('decimalr')))
+                row.r2 = (parseFloat(average2) + parseFloat(this.focusWRow4.r2)).toFixed(parseInt(Cookies.get('decimalr')))
                 console.log('3班比例为0,12班不为0')
               }else{
                 console.log('123班不为0')
-                let average1 = (parseFloat(this.focusWRow4.r4) / 3 ).toFixed(2)
-                let average2 = (parseFloat(this.focusWRow4.r4) - average1*2).toFixed(2)
+                let average1 = (parseFloat(this.focusWRow4.r4) / 3 ).toFixed(parseInt(Cookies.get('decimalr')))
+                let average2 = (parseFloat(this.focusWRow4.r4) - average1*2).toFixed(parseInt(Cookies.get('decimalr')))
                 row.r1 = parseFloat(average1) + parseFloat(this.focusWRow4.r1)
                 row.r2 = parseFloat(average1) + parseFloat(this.focusWRow4.r2)
                 row.r3 = parseFloat(average2) + parseFloat(this.focusWRow4.r3)
@@ -3962,7 +4027,7 @@ export default {
         }else{
           obj['supplement'] = row['bw' + i]
         }
-        obj['tratio'] = (parseFloat(row['r' + i])).toFixed(2)
+        obj['tratio'] = (parseFloat(row['r' + i])).toFixed(parseInt(Cookies.get('decimalr')))
         // obj['tratio'] = Math.round(row['r' + i])
         obj['todaysupplement'] = row.todaysupplement
         obj['todayweight'] = row.todayweight

+ 11 - 0
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -514,8 +514,19 @@ export default {
           eqtype: '1'
         }
       }
+      const url2 = 'authdata/tmrListEnableTypeAll'
+      // 临时注释
+      // 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
           if(this.create.dialogStatus == 'update'){
             if(this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid) !== undefined){

+ 35 - 1
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -55,6 +55,7 @@
           <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>
           <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
         </div>
@@ -1182,7 +1183,7 @@ export default {
       activeName: 'first',
       tab: {
         TMRNameList:[],
-        radio: '0',
+        radio: '2',
         isDriver: true,
         isFormulaName: false, // 配方名称
         isHouseName: false, // 栏舍名称
@@ -2829,6 +2830,25 @@ export default {
       }
       this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
     },
+    handleRefresh1(){
+      this.tab.table.getdataListParm.parammaps.fname = ''
+      this.tab.table.getdataListParm.parammaps.projname = ''
+      this.tab.table.getdataListParm.parammaps.times = ''
+      this.tab.table.getdataListParm.parammaps.hlwc1 = undefined
+      this.tab.table.getdataListParm.parammaps.hlwc2 = undefined
+      this.tab.table.getdataListParm.parammaps.hlzq1 = undefined
+      this.tab.table.getdataListParm.parammaps.hlzq2 = undefined
+      this.tab.table.getdataListParm.parammaps.hlzql1 = undefined
+      this.tab.table.getdataListParm.parammaps.hlzql2 = undefined
+      this.tab.table.getdataListParm.parammaps.slwc1 = undefined
+      this.tab.table.getdataListParm.parammaps.slwc2 = undefined
+      this.tab.table.getdataListParm.parammaps.slzq1 = undefined
+      this.tab.table.getdataListParm.parammaps.slzq2 = undefined
+      this.tab.table.getdataListParm.parammaps.slzql1 = undefined
+      this.tab.table.getdataListParm.parammaps.slzql2 = undefined
+      this.tab.table.getdataListParm.parammaps.error = false
+      this.handleSearch()
+    },
     handleBefore() {
       this.$forceUpdate()
       if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
@@ -4190,6 +4210,13 @@ export default {
       this.tab2.table.getdataListParm.parammaps.times = ''
       this.tab2.table.getdataListParm.parammaps.templetname = ''
       this.tab2.table.getdataListParm.parammaps.buttontype = ''
+      this.tab2.table.getdataListParm.parammaps.hlwc1 = undefined
+      this.tab2.table.getdataListParm.parammaps.hlwc2 = undefined
+      this.tab2.table.getdataListParm.parammaps.hlzq1 = undefined
+      this.tab2.table.getdataListParm.parammaps.hlzq2 = undefined
+      this.tab2.table.getdataListParm.parammaps.hlzql1 = undefined
+      this.tab2.table.getdataListParm.parammaps.hlzql2 = undefined
+      this.tab2.table.getdataListParm.parammaps.error = false
       this.getTab2List()
     },
     handleExport2() {
@@ -4285,6 +4312,13 @@ export default {
       this.tab3.table.getdataListParm.parammaps.templetname = ''
       this.tab3.table.getdataListParm.parammaps.buttontype = ''
       this.tab3.table.getdataListParm.parammaps.fname = ''
+      this.tab3.table.getdataListParm.parammaps.slwc1 = undefined
+      this.tab3.table.getdataListParm.parammaps.slwc2 = undefined
+      this.tab3.table.getdataListParm.parammaps.slzq1 = undefined
+      this.tab3.table.getdataListParm.parammaps.slzq2 = undefined
+      this.tab3.table.getdataListParm.parammaps.slzql1 = undefined
+      this.tab3.table.getdataListParm.parammaps.slzql2 = undefined
+      this.tab3.table.getdataListParm.parammaps.error = false
       this.getTab3List()
     },
     handleExport3() {

+ 32 - 0
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -11,6 +11,7 @@
           <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="配方模板" />
@@ -38,6 +39,7 @@
             <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="实际混料量" />
@@ -1463,6 +1465,16 @@ export default {
             }
           ]
           json2excel(excelDatas3, '效率统计-牲畜类别', true, 'xlsx')
+        }else if (this.tab.radio == '4') {
+          var excelDatas3 = [
+            {
+              tHeader: ['班次', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '平均混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方 物质采食量(kg/ 头)', '实际干物质采 食量(kg/头)', ' 采食率(%)', '配方 成本(元/头)', '实际成本(元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
+              filterVal: ['班次', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', ' 采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
+              tableDatas: this.tab.table.list,
+              sheetName: '班次'
+            }
+          ]
+          json2excel(excelDatas3, '效率统计-班次', true, 'xlsx')
         }
         this.isokDisable = false
         this.exportList.dialogFormVisible = false
@@ -1617,6 +1629,7 @@ 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 = ''
@@ -1633,6 +1646,7 @@ 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 = ''
@@ -1649,6 +1663,7 @@ 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 = ''
@@ -1660,6 +1675,23 @@ 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()
       }
     },
 

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

@@ -63,6 +63,9 @@
           <el-input v-if="tab2.isRadio4" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="TMR设备编号" />
           <el-input v-if="tab2.isRadio5" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="班次" />
           <el-input v-if="tab2.isRadio6" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="车次" />
+          <el-select v-model="tab2.table.getdataListParm.parammaps.typea" clearable placeholder="列表显示" class="filter-item" style="width: 120px;">
+            <el-option v-for="item in displayList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <el-button class="successBorder" @click="handleSearch('second')">查询</el-button>
           <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handleExport('tab2')">导出</el-button>
         </div>
@@ -173,6 +176,7 @@ export default {
         }
       },
       fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
+      displayList:[{id:'1',name:'理论'},{id:'2',name:'实际'}],//列表显示
       activeName: 'first',
       tab: {
         chartDate: [],
@@ -199,7 +203,8 @@ export default {
       },
 
       tab2: {
-        chartDate: [],
+        chartDate: [],
+        display:'',
         table: {
           getdataListParm: {
             name: 'getMaterialAnalysisSC',
@@ -213,7 +218,8 @@ export default {
               startTime: parseTime(new Date(), '{y}-{m}-{d}'),
               stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
               inputDatetime: [new Date(), new Date()],
-              fname: ''
+              fname: '',
+              typea:''
             }
           },
           tableKey: 1,

+ 9 - 3
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -26,7 +26,10 @@
         <el-input-number :controls="false" :precision="2" v-model="hlzq1" placeholder="混料准确率" :min="0" :max="100" style="width: 120px;"  class="filter-item" clearable />
         <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>
+      </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>
       <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 />
         <span>-</span>
@@ -567,7 +570,9 @@ export default {
         { 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: '已完成' }], // 工作状态
+      workingConditionList: [{ id: '0', name: '进行中' }, { id: '1', name: '已完成' }], // 工作状态
+      cixCategoryList: [{ id: '0', name: '饲料' }, { id: '1', name: '精料' }, { id: '2', name: '粗料' }, { id: '3', name: '其他' }], // 混料类别
+
       // TMR设备列表
       table: {
         getdataListParm: {
@@ -584,7 +589,8 @@ export default {
             iscompleted: '',
             tmrtname: '',
             lpplantype: '',
-            error:''
+            error:'',
+            cixCategory:''
           }
         },
         tableKey: 0,

+ 428 - 159
src/views/systemManagement/reminderSettings/index.vue

@@ -18,12 +18,19 @@
         class="elTable table-fixed"
         :max-height="myHeight"
       >
-        <el-table-column label="消息名称" min-width="130px" align="center" prop="rolename" />
-        <el-table-column label="触发条件" min-width="130px" align="center" prop="rolename" />
-        <el-table-column label="提醒类型" min-width="130px" align="center" prop="rolename" />
-        <el-table-column label="推送方式" min-width="130px" align="center" prop="rolename" />
-        <el-table-column label="详细配置" min-width="130px" align="center" prop="rolename" />
-        <el-table-column label="提醒对象" min-width="130px" align="center" prop="rolename" />
+        <el-table-column label="消息名称" min-width="130px" align="center" prop="message" />
+        <el-table-column label="触发条件" min-width="130px" align="center" prop="trigger" />
+        <el-table-column label="发送方式" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.data.remind_type }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="详细配置" min-width="130px" align="center">
+          <template slot-scope="{row}">
+            <a class="correcting" size="mini" style="width: 80px;" @click="handleSee(row)">查看</a>
+          </template>
+        </el-table-column>
+        <el-table-column label="提醒对象" min-width="130px" align="center" prop="user" />
         <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <a class="correcting" size="mini" style="width: 80px;" @click="handleSetUp(row)">设置</a>
@@ -31,6 +38,7 @@
         </el-table-column>
       </el-table>
     </div>
+    <!-- 设置 -->
     <el-dialog :title="textMap[setUp.dialogStatus]" :visible.sync="setUp.dialogFormVisible" :close-on-click-modal="false" width="70%">
       <div class="setup">
         <div style="height: 500px;">
@@ -40,14 +48,14 @@
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="消息名称:" prop="messageName">
-                      <el-input v-model="temp.messageName" style="width: 100%;" class="filter-item" placeholder="消息名称" />
+                      <span>{{temp.messageName}}</span>
                     </el-form-item>
                   </el-col>
                 </el-row>
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="触发条件:" prop="triggerCondition">
-                      <el-input ref="triggerCondition" v-model="temp.triggerCondition" style="width: 100%;" class="filter-item" placeholder="触发条件" type="text" />
+                      <span>{{temp.triggerCondition}}</span>
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -60,6 +68,29 @@
                     </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 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-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-form-item>
+                    </el-col>
+                  </el-row>
+                </div>
                 <div v-if="temp.sendingMethod == '2'">
                   <el-row>
                     <el-col :span="24">
@@ -73,7 +104,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 placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
                       </el-form-item>
                     </el-col>
                   </el-row>
@@ -129,7 +160,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 placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
                       </el-form-item>
                     </el-col>
                   </el-row>
@@ -138,55 +169,56 @@
             </el-col>
             <el-col :span="16">
               <b>提醒对象:</b>
-              <el-tabs v-model="activeName" @tab-click="handleClick">
-                  <el-tab-pane label="角色" name="first">
-                    <el-table
-                      :key="setUp.table1.tableKey"
-                      v-loading="setUp.table1.listLoading"
-                      element-loading-text="给我一点时间"
-                      :data="setUp.table1.list"
-                      border
-                      fit
-                      highlight-current-row
-                      style="width: 100%;"
-                      :row-style="rowStyle"
-                      :cell-style="cellStyle"
-                      class="elTable table-fixed"
-                      @selection-change="handleSelectionChange"
-                      :max-height="450"
-                    >
-                      <el-table-column type="selection" align="center" width="50" />
-                      <el-table-column label="角色名称" min-width="130px" align="center" prop="rolename" />
-                    </el-table>
-                  </el-tab-pane>
-                  <el-tab-pane label="用户" name="second">
-                    <div class="search">
-                      <el-input v-model="setUp.table2.getdataListParm.parammaps.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
-                      <el-input v-model="setUp.table2.getdataListParm.parammaps.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
-                      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-                    </div>
-                    <el-table
-                      :key="setUp.table2.tableKey"
-                      v-loading="setUp.table2.listLoading"
-                      element-loading-text="给我一点时间"
-                      :data="setUp.table2.list"
-                      border
-                      fit
-                      highlight-current-row
-                      style="width: 100%;"
-                      :row-style="rowStyle"
-                      :cell-style="cellStyle"
-                      class="elTable table-fixed"
-                      @selection-change="handleSelectionChange"
-                      :max-height="450"
-                    >
-                      <el-table-column type="selection" align="center" width="50" />
-                      <el-table-column label="用户名称" min-width="130px" align="center" prop="username" />
-                      <el-table-column label="员工姓名" min-width="130px" align="center" prop="empname" />
-                      <el-table-column label="角色" min-width="130px" align="center" prop="rolename" />
-                    </el-table>
-                  </el-tab-pane>
-                </el-tabs>
+              <div class="search">
+                <el-input v-model="setUp.empCode" placeholder="角色名称" style="width: 180px;" class="filter-item" clearable />
+                <el-input v-model="setUp.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
+                <el-input v-model="setUp.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
+                <el-button class="successBorder" @click="handleSearch">查询</el-button>
+              </div>
+              <el-row :gutter="5">
+                <el-col :span="6">
+                  <el-table
+                    :key="setUp.tableKey1"
+                    v-loading="setUp.listLoading1"
+                    element-loading-text="给我一点时间"
+                    :data="setUp.list1"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                    @selection-change="handleSelectionChange1"
+                    :height="450"
+                  >
+                    <el-table-column type="selection" align="center" width="50" />
+                    <el-table-column label="角色名" min-width="100px" align="center" prop="rolename" />
+                  </el-table>
+                </el-col>
+                <el-col :span="18">
+                  <el-table
+                    :key="setUp.tableKey2"
+                    v-loading="setUp.listLoading2"
+                    element-loading-text="给我一点时间"
+                    :data="setUp.list2"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                    @selection-change="handleSelectionChange2"
+                    :height="450"
+                  >
+                    <el-table-column type="selection" align="center" width="50" />
+                    <el-table-column label="用户名称" min-width="130px" align="center" prop="username" />
+                    <el-table-column label="员工姓名" min-width="130px" align="center" prop="empname" />
+                    <el-table-column label="角色" min-width="130px" align="center" prop="rolename" />
+                  </el-table>
+                </el-col>
+              </el-row>
             </el-col>
           </el-row>
         </div>
@@ -196,7 +228,116 @@
         </div>
       </div>
     </el-dialog>
-
+    <!-- 查看 -->
+    <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="40%">
+      <div class="setup">
+        <div style="height: 500px;">
+            <el-form ref="temp" :rules="temp.rules" :model="temp" label-position="right" label-width="110px" style="width: 100%;margin:0 auto">
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="消息名称:" prop="messageName">
+                    <span>{{temp.messageName}}</span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="触发条件:" prop="triggerCondition">
+                    <span>{{temp.triggerCondition}}</span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="发送方式:" prop="sendingMethod">
+                    <el-select 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 == '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-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-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-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-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-form-item>
+                  </el-col>
+                </el-row>
+              </div>
+              <div v-if="temp.sendingMethod == '3'">
+                <el-row>
+                  <el-col :span="24">
+                    <el-form-item label="发送机制:">
+                      <span>持续循环</span>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="5">
+                  <el-col :span="18">
+                    <el-form-item label="周期类型">
+                      <el-select 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-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-option v-for="item in monthList" :key="item.id" :label="item.name" :value="item.id" />
+                    </el-select>
+                  </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-form-item>
+                  </el-col>
+                </el-row>
+              </div>
+            </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>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 扫码 -->
     <el-dialog :title="textMap[QRcode.dialogStatus]" :visible.sync="QRcode.dialogFormVisible" :close-on-click-modal="false" width="50%">
       <div class="QRcode">
         <div class="content">
@@ -216,7 +357,7 @@
 </template>
 
 <script>
-  import { GetDataByName,postJson2 } from '@/api/common'
+  import { GetDataByName,postJson2,postJson } from '@/api/common'
   import Cookies from 'js-cookie'
   export default {
     name: 'ReminderSettings',
@@ -267,16 +408,6 @@
         mechanism: '0',
         activeName:'first',
         table: {
-          getdataListParm: {
-            name: 'getRoleList',
-            page: 1,
-            offset: 1,
-            pagecount: parseInt(Cookies.get('pageCount')),
-            returntype: 'Map',
-            parammaps: {
-              pastureid: Cookies.get('pastureid')
-            }
-          },
           tableKey: 0,
           list: [],
           total: 0,
@@ -285,39 +416,37 @@
         setUp:{
           dialogStatus: '',
           dialogFormVisible:false,
-          table1: {
-            getdataListParm: {
-              name: 'getRoleList',
-              page: 1,
-              offset: 1,
-              pagecount: parseInt(Cookies.get('pageCount')),
-              returntype: 'Map',
-              parammaps: {
-                pastureid: Cookies.get('pastureid')
-              }
-            },
-            tableKey: 0,
-            list: [],
-            total: 0,
-            listLoading: false
+          // 角色
+          tableKey1: 0,
+          list1: [],
+          total1: 0,
+          listLoading1: false,
+          data1:{
+            name: 'getRoleList', page: 1, offset: 1, pagecount:'',returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid')
+            }
           },
-          table2: {
-            getdataListParm: {
-              name: 'getuserallL',
-              page: 1,
-              offset: 1,
-              pagecount: parseInt(Cookies.get('pageCount')),
-              returntype: 'Map',
-              parammaps: {
-                pastureid: Cookies.get('pastureid')
-              }
-            },
-            tableKey: 0,
-            list: [],
-            total: 0,
-            listLoading: false
+          selectList1:[],
+          // 用户
+          tableKey2: 0,
+          list2: [],
+          total2: 0,
+          listLoading2: false,
+          data2:{
+            name: 'getuserallL', page: 1, offset: 1, pagecount:'',returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              roleid:''
+            }
           },
-          selectList:[]
+          selectList2:[],
+          temp:{}
+        },
+        see:{
+          dialogStatus: '',
+          dialogFormVisible:false,
+          temp:{}
         },
         QRcode:{
           dialogStatus: '',
@@ -327,7 +456,8 @@
         textMap: {
           setup: '设置',
           QRcode:'提示',
-          add:'新增'
+          add:'新增',
+          see:'查看'
         },
         isokDisable:false,
         rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
@@ -348,12 +478,16 @@
     methods: {
       getList() {
         this.table.listLoading = true
-        // let url = 'http://tmrwatch.cn/notice/msgtype'
-        // let data = {}
-        GetDataByName(this.table.getdataListParm).then(response => {
-          if (response.data.list !== null) {
-            console.log('table数据', response.data.list)
-            this.table.list = response.data.list
+        let url = 'authdata/remind/list'
+        let data = {
+          parammaps:{
+            pastureid:Cookies.get('pastureid')
+          }
+        }
+        postJson(url,data).then(response => {
+          if (response.data !== null) {
+            console.log('table数据', response.data)
+            this.table.list = response.data
             this.table.pageNum = response.data.pageNum
             this.table.pageSize = response.data.pageSize
           } else {
@@ -365,12 +499,79 @@
           }, 100)
         })
       },
-      handleSetUp(){
+      handleSetUp(row){
+        console.log(row,'row')
         this.setUp.dialogStatus = 'setup'
         this.setUp.dialogFormVisible = true
         this.activeName = 'first'
+        this.setUp.temp = Object.assign({}, row)
+        this.temp.messageName = row.data.type_name //消息名称
+        this.temp.triggerCondition = row.trigger //触发条件
+        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
+        }
+        // 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;
+        }
+        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;
+        }
+      },
+      handleSee(){
+        this.see.dialogStatus = 'see'
+        this.see.dialogFormVisible = true
+        this.see.temp = Object.assign({}, row)
+      },
       handleClick(item){
         if(item == 'first'){
           this.getList1()
@@ -378,10 +579,21 @@
           this.getList2()
         }
       },
-      handleSelectionChange(val) {
+      handleSelectionChange1(val) {
+        console.log('勾选数据', val)
+        this.setUp.selectList1 = []
+        for(let i=0;i<val.length;i++){
+          this.setUp.selectList1.push(val[i].id)
+        }
+        this.setUp.data2.parammaps.roleid = this.setUp.selectList1.join(',')
+        console.log(this.setUp.data2.parammaps.roleid)
+        this.getList2()
+      },
+      handleSelectionChange2(val) {
         console.log('勾选数据', val)
-        this.selectList = val
+        this.setUp.selectList2 = val
       },
+
       handleGenerateQRcode(){
         this.QRcode.dialogStatus = 'QRcode'
         this.QRcode.dialogFormVisible = true
@@ -390,53 +602,42 @@
         this.getList2()
       },
       getList1() {
-        this.setUp.table1.listLoading = true
-        GetDataByName(this.setUp.table1.getdataListParm).then(response => {
+        this.setUp.listLoading1 = true
+        let url = "authdata/GetDataByName"
+        postJson(url,this.setUp.data1).then(response => {
           if (response.data.list !== null) {
-            console.log('table数据', response.data.list)
-            this.setUp.table1.list = response.data.list
-            this.setUp.table1.pageNum = response.data.pageNum
-            this.setUp.table1.pageSize = response.data.pageSize
+            this.setUp.list1 = response.data.list
+            this.setUp.data2.parammaps.roleid = ''
+            this.getList2()
           } else {
-            this.setUp.table1.list = []
+            this.setUp.list1 = []
           }
-          this.setUp.table1.total = response.data.total
           setTimeout(() => {
-            this.setUp.table1.listLoading = false
+            this.setUp.listLoading1 = false
           }, 100)
         })
       },
       getList2() {
-        this.setUp.table2.listLoading = true
-        GetDataByName(this.setUp.table2.getdataListParm).then(response => {
+        this.setUp.listLoading2 = true
+        let url = "authdata/GetDataByName"
+        postJson(url,this.setUp.data2).then(response => {
           if (response.data.list !== null) {
-            console.log('table数据', response.data.list)
-            this.setUp.table2.list = response.data.list
-            this.setUp.table2.pageNum = response.data.pageNum
-            this.setUp.table2.pageSize = response.data.pageSize
+            this.setUp.list2 = response.data.list
+            if(this.setUp.selectList1.length > 0){
+              this.$set(this.setUp,'selectList2',response.data.list)
+            }
           } else {
-            this.setUp.table2.list = []
+            this.setUp.list2 = []
           }
-          this.setUp.table2.total = response.data.total
           setTimeout(() => {
-            this.setUp.table2.listLoading = false
+            this.setUp.listLoading2 = false
           }, 100)
         })
       },
       setData(){
-        let url = 'http://tmrwatch.cn:8089/notice/msgtype'
+        let url = 'authdata/remind/edit'
         let data = {}
-        data.sys_name = 'tmrWatch'
-        data.type_name = this.temp.messageName
-        data.remind_type_id = parseInt(this.temp.sendingMethod)
-        if(this.temp.sendingMethod == '1'){
-          data.remind_type = '立即'
-        }else if(this.temp.sendingMethod == '1'){
-          data.remind_type = '延时'
-        }else{
-          data.remind_type = '指定周期'
-        }
-        let dateTime = 0
+        let delayedTime = 0
         let delayed1 = 0
         let delayed2 = 0
         let delayed3 = 0
@@ -454,27 +655,95 @@
         if(this.temp.delayed3 !== ''){
           delayed3 = parseInt(this.temp.delayed3)
         }else{
-          delayed2 = 0
+          delayed3 = 0
         }
-        dateTime = delayed1+ delayed2 + delayed3
-        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
+        delayedTime = delayed1 + delayed2 + delayed3
+
+        let intervalPeriodTime = 0
+        let intervalPeriod1 = 0
+        let intervalPeriod2 = 0
+        let intervalPeriod3 = 0
+
+        if(this.temp.intervalPeriod1 !== ''){
+          intervalPeriod1 = parseInt(this.temp.intervalPeriod1)*24*60
+        }else {
+          intervalPeriod1 = 0
+        }
+        if(this.temp.intervalPeriod2 !== ''){
+          intervalPeriod2 = parseInt(this.temp.intervalPeriod2)*60
+        }else {
+          intervalPeriod2 = 0
         }
-        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
+        if(this.temp.intervalPeriod3 !== ''){
+          intervalPeriod3 = parseInt(this.temp.intervalPeriod3)
         }else{
-          data.push_limit = 0
+          intervalPeriod3 = 0
         }
-        data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
-        postJson2(url,data).then(response => {
+        intervalPeriodTime = intervalPeriod1+ intervalPeriod2 + intervalPeriod3
+
+        // sendingMethod   发送方式
+        // sendingMechanism   发送机制
+        // intervalPeriod1    间隔周期
+        // delayed1   延时
+        // sendTime   发送时间
+        // numberCycles   循环次数
+        if(this.temp.sendingMethod == '1'){
+          data.id = this.setUp.temp.id
+          data.user = this.setUp.temp.user
+          data.sys_name = 'tmrWatch'
+          data.type_name = this.temp.messageName
+          data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
+          data.pastureid = Cookies.get('pastureid')
+          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.
+          }
+        }
+        // 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 })