Epans 2 anos atrás
pai
commit
9ac3deea0b
73 arquivos alterados com 4307 adições e 11372 exclusões
  1. 11 7
      .env.development
  2. BIN
      dis20220408.zip
  3. BIN
      dist.zip
  4. BIN
      dist20220401.zip
  5. BIN
      dist20220407.zip
  6. BIN
      dist20220415.zip
  7. BIN
      dist20220420liuhuan.zip
  8. BIN
      dist20220425.2.zip
  9. BIN
      dist20220425.3.zip
  10. BIN
      dist20220425.4.zip
  11. BIN
      dist20220425.zip
  12. BIN
      dist20220427.zip
  13. BIN
      dist刘欢.zip
  14. 1 0
      package.json
  15. 42 6
      src/api/common.js
  16. 6 6
      src/components/index.vue
  17. 12 7
      src/components/mySelect/index.vue
  18. 2 0
      src/icons/svg/提醒设置.svg
  19. 2 1
      src/store/getters.js
  20. 9 2
      src/store/modules/user.js
  21. 35 11
      src/utils/request.js
  22. 43 14
      src/views/basicData/defaultParameter/function/index.vue
  23. 2 2
      src/views/basicData/driver/index.vue
  24. 2 2
      src/views/basicData/equipmentTMR/index.vue
  25. 1 1
      src/views/basicData/feedClassification/index.vue
  26. 171 93
      src/views/basicData/feedTable/index.vue
  27. 1 1
      src/views/basicData/forkliftManagement/index.vue
  28. 32 30
      src/views/basicData/groupColumn/index.vue
  29. 1 1
      src/views/basicData/livestockCategory/index.vue
  30. 1 1
      src/views/basicData/supplier/index.vue
  31. 310 9
      src/views/formulationPlan/dailyExecutionPlan/index.vue
  32. 170 102
      src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue
  33. 7 0
      src/views/formulationPlan/dailyExecutionPlan/typePage/surplusMaterialPlan.vue
  34. 364 451
      src/views/formulationPlan/dhedFormula/index.vue
  35. 104 46
      src/views/formulationPlan/dhedFormula/index备.vue
  36. 3 2
      src/views/formulationPlan/formulaDistribution/index.vue
  37. 0 667
      src/views/formulationPlan/formulaDistribution/index改.vue
  38. 15 40
      src/views/formulationPlan/materialIssuancePlan/historyRecord.vue
  39. 0 2875
      src/views/formulationPlan/materialIssuancePlan/index - 副本.vue
  40. 177 85
      src/views/formulationPlan/materialIssuancePlan/index.vue
  41. 113 112
      src/views/formulationPlan/pushMaterialPlan/index.vue
  42. 241 83
      src/views/formulationPlan/recipeTemplate/index.vue
  43. 0 3117
      src/views/formulationPlan/recipeTemplate/index备.vue
  44. 11 3
      src/views/formulationPlan/surplusMaterialPlan/index.vue
  45. 1 1
      src/views/inventoryManagement/feedContract/index.vue
  46. 5 4
      src/views/inventoryManagement/inventoryList/index.vue
  47. 0 671
      src/views/inventoryManagement/inventoryList/index改.vue
  48. 1 1
      src/views/inventoryManagement/laborConsumption/index.vue
  49. 0 675
      src/views/inventoryManagement/laborConsumption/index改.vue
  50. 1 1
      src/views/inventoryManagement/statistics/index.vue
  51. 14 22
      src/views/inventoryManagement/systemConsumption/index.vue
  52. 0 402
      src/views/inventoryManagement/systemConsumption/index备.vue
  53. 5 4
      src/views/inventoryManagement/warehousing/index.vue
  54. 0 1273
      src/views/inventoryManagement/warehousing/index改.vue
  55. 1 1
      src/views/inventoryManagement/warning/index.vue
  56. 6 34
      src/views/shedProduction/dungScores/index.vue
  57. 3 31
      src/views/shedProduction/fecalScreen/index.vue
  58. 3 36
      src/views/shedProduction/formulaDryMatter/index.vue
  59. 110 58
      src/views/shedProduction/materialRemainingRecord/index.vue
  60. 3 30
      src/views/shedProduction/pennsylvaniaSieve/index.vue
  61. 3 31
      src/views/shedProduction/physicalConditionScore/index.vue
  62. 628 112
      src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue
  63. 30 17
      src/views/statisticalAnalysis/errorAnalysis/pasture/see.vue
  64. 67 8
      src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue
  65. 6 6
      src/views/statisticalAnalysis/feedingEfficiency/pasture/index备.vue
  66. 45 20
      src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue
  67. 227 28
      src/views/statisticalAnalysis/processAnalysis/pasture/index.vue
  68. 212 116
      src/views/systemManagement/dataSynchronization/index.vue
  69. 40 0
      src/views/systemManagement/messagesReceiving/index.vue
  70. 1 1
      src/views/systemManagement/ranchInformation/index.vue
  71. 938 0
      src/views/systemManagement/reminderSettings/index.vue
  72. 1 1
      src/views/systemManagement/role/index.vue
  73. 67 11
      src/views/systemManagement/user/index.vue

+ 11 - 7
.env.development

@@ -5,19 +5,23 @@ ENV = 'development'
 # 测试线
 # 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/'
+
+
+VUE_APP_BASE_API = 'http://tmrwatch.cn:8081/'
 
 
-  
 # VUE_APP_BASE_API = 'http://lhpc81.kptyun.com/'
- 
 
-# 沙巍
-# VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
+
+# 陈文强
+# 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,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
 # It only does one thing by converting all import() to require().

BIN
dis20220408.zip


BIN
dist.zip


BIN
dist20220401.zip


BIN
dist20220407.zip


BIN
dist20220415.zip


BIN
dist20220420liuhuan.zip


BIN
dist20220425.2.zip


BIN
dist20220425.3.zip


BIN
dist20220425.4.zip


BIN
dist20220425.zip


BIN
dist20220427.zip


BIN
dist刘欢.zip


+ 1 - 0
package.json

@@ -30,6 +30,7 @@
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
+    "print-js": "^1.6.0",
     "screenfull": "4.2.0",
     "sortable.js": "^0.3.0",
     "umy-ui": "^1.1.6",

+ 42 - 6
src/api/common.js

@@ -109,7 +109,17 @@ export function GetAccount(data) {
 export function postJson(url,data) {
   return request({
     url: process.env.VUE_APP_BASE_API + url,
-    method: 'post',
+    method: 'post',
+    timeout: 600000,
+    data
+  })
+}
+
+export function postJson2(url,data) {
+  return request({
+    url: url,
+    method: 'post',
+    timeout: 600000,
     data
   })
 }
@@ -119,6 +129,15 @@ export function getJson(url,data) {
     url: process.env.VUE_APP_BASE_API + url + data,
     method: 'get'
   })
+}
+
+export function getData(url,data) {
+  return request({
+    url: url,
+    method: 'post',
+    timeout: 600000,
+    data
+  })
 }
 
 export function PostDataByNames(data) {
@@ -251,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){
@@ -402,4 +438,4 @@ export function whichWeek(year) {
         arr[arr.length - 1].last = yearDay(+new Date(year + 1, 0, 1) / 1000 - 86400)
       }
       return arr
-    }
+    }

+ 6 - 6
src/components/index.vue

@@ -1070,9 +1070,9 @@ export default {
           this.tab.chart2.statisticsList = []
           this.tab.chart2.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]
@@ -1254,9 +1254,9 @@ export default {
           this.$set(this.tab.chart4.getdataListParm.parammaps, 'statisticsList', [])
 
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]
@@ -1373,9 +1373,9 @@ export default {
           this.tab.chart5.statisticsList = []
           this.tab.chart5.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]

+ 12 - 7
src/components/mySelect/index.vue

@@ -9,8 +9,9 @@
       @change="selectChange"
       @visible-change="vselectChange"
     >
-      <el-option v-for="item in selectOption" :key="item.value" :label="item.label" :value="item.value" />
+      <el-option v-for="(item,index) in selectOption" :key="index" :label="item.label" :value="item.value" />
     </el-select>
+      <!-- <el-option v-for="(item,index) in selectOption" :key="item.label+index" :label="item.label" :value="item.value" /> -->
   </div>
 </template>
 <script>
@@ -29,7 +30,7 @@ export default {
     value: { // 做一个字典,实际的值
       type: String,
       default: 'value'
-    }
+    },
   },
   data() {
     return {
@@ -43,7 +44,6 @@ export default {
   computed: {},
   watch: {
     option() {
-      console.log(this.option, '===this.option')
       if (this.option.length != 0 && this.value in this.option[0] && this.label in this.option[0]) {
         this.selectOption = []
         this.selectOption.push({
@@ -51,16 +51,21 @@ export default {
           label: '全部'
         })
         this.option.map(item => {
+
           this.selectOption.push({
             value: item[this.value],
             label: item[this.label]
           })
         })
-        console.log(this.selectOption, '========123')
+        let arrs = []
+        let oldarrs = []
         this.selectOption.map(item => {
-          this.searchSelect.push(item.value)
-          this.oldSearchSelect.push(item.value)
+          arrs.push(item.value)
+          oldarrs.push(item.value)
         })
+        this.searchSelect = arrs
+        this.oldSearchSelect = oldarrs
+
       }
     }
   },
@@ -114,7 +119,7 @@ export default {
       })
     },
     vselectChange() {
-      console.log(this.searchSelect, '====777')
+      // console.log(this.searchSelect, '====777')
       this.$emit('searchSelect', this.searchSelect)
     }
   }

+ 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>

+ 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()

+ 35 - 11
src/utils/request.js

@@ -11,12 +11,12 @@ var aa = process.env.VUE_APP_BASE_API
 if(aa.indexOf('/')==0 && aa.length==1){
   aa= window.location.protocol + "//"+window.location.host+aa
 }
-const service = axios.create({
+  const service = axios.create({
     baseURL: aa, // url = base url + request url
     withCredentials: true, // send cookies when cross-domain requests
-    timeout: 60000 // request timeout
-  })
-// request interceptor
+    timeout: 60000 ,// request timeout
+  })
+// request interceptor
 service.interceptors.request.use(
   config => {
     // do something before request is sent
@@ -35,7 +35,7 @@ service.interceptors.request.use(
       } else {
         config.headers['token'] = getToken()
       }
-    }
+    }
     return config
   },
   error => {
@@ -97,13 +97,37 @@ 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)
+    }
+    console.log('config==>', config) // for debug
+    console.log('config.__retryCount==>', config.__retryCount) // for debug
+    // 设置请求超时次数
+    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 || 1000)
+    })
+    return backoff.then(() => {
+      return service(config)
     })
-    return Promise.reject(error)
+    // Message({
+    //   message: error.message,
+    //   type: 'error',
+    //   duration: 5 * 1000
+    // })
+    // return Promise.reject(error)
   }
 )
 

+ 43 - 14
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>
@@ -190,9 +211,11 @@ 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: '否' }], // 是否启用数据同步
+      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

+ 2 - 2
src/views/basicData/driver/index.vue

@@ -146,10 +146,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
-        }
+        }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 2 - 2
src/views/basicData/equipmentTMR/index.vue

@@ -226,10 +226,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
-        }
+        }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 1 - 1
src/views/basicData/feedClassification/index.vue

@@ -165,10 +165,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 171 - 93
src/views/basicData/feedTable/index.vue

@@ -37,6 +37,7 @@
     </div>
     <div class="operation" ref="operation">
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleGetSapCode">获取SAP编码</el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
       <el-button class="success" icon="el-icon-receiving" @click="handleFeedBank">饲料库</el-button>
       <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" class="success" @click="handleChangeOrder">更改顺序</el-button>
@@ -59,10 +60,10 @@
     <div class="table">
       <u-table
         id="table"
+        ref="table"
         :key="table.tableKey"
         v-loading="table.listLoading"
         element-loading-text="给我一点时间"
-        :data="table.list"
         border
         fit
         highlight-current-row
@@ -72,96 +73,38 @@
         class="elTable table-fixed"
         row-key="id"
         @selection-change="handleSelectionChange"
-        :max-height="myHeight"
+        :max-height="myHeight"
+        use-virtual
+        @table-body-scroll="tableScroll"
+        :row-height="rowHeight"
       >
         <u-table-column type="selection" align="center" width="50" fixed="left" />
         <u-table-column label="序号" type="index" align="center" width="50" fixed="left"/>
-        <u-table-column label="饲料名称" min-width="80px" align="center" fixed="left">
-          <template slot-scope="scope">
-            <span>{{ scope.row.fname }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="饲料分类" min-width="80px" align="center" fixed="left">
-          <template slot-scope="scope">
-            <span>{{ scope.row.fclass }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="唯一编码" min-width="80px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.feedcode }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="饲料来源" min-width="80px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.source }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="计划类型" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.printgroup }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column v-if="isInforvalue" label="小料秤" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.smtmrname }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="允许误差数(kg)" min-width="85px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.allowratio }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="包装单位重量(kg)" min-width="80px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.unitweight }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="单价" min-width="50px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.uprice }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="跳转重量域(kg)" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.autozone }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="跳转延时" min-width="80px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.autosecondname }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="确认开始" min-width="80px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.confirmstartname }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="继电器位置" min-width="60px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.trgaddress }}</span>
-          </template>
-        </u-table-column>
+        <u-table-column label="饲料名称" min-width="80px" align="center" prop="fclass" fixed="left"/>
+        <u-table-column label="饲料分类" min-width="80px" align="center" prop="fclass" fixed="left"/>
+        <u-table-column label="物料类型" min-width="90px" align="center" prop="materialtyp" />
+        <u-table-column label="SAP货位" min-width="90px" align="center" prop="goods" />
+        <u-table-column label="唯一编码" min-width="80px" align="center" prop="feedcode" />
+        <u-table-column label="SAP编码" min-width="90px" align="center" prop="sapcode" />
+        <u-table-column label="饲料来源" min-width="80px" align="center" prop="source" />
+        <u-table-column label="计划类型" min-width="80px" align="center" prop="printgroup" />
+        <u-table-column v-if="isInforvalue" label="小料秤" min-width="90px" align="center" prop="smtmrname" />
+        <u-table-column label="允许误差数(kg)" min-width="80px" align="center" prop="allowratio" />
+        <u-table-column label="包装单位重量(kg)" min-width="80px" align="center" prop="unitweight" />
+        <u-table-column label="单价" min-width="80px" align="center" prop="uprice" />
+        <u-table-column label="跳转重量域(kg)" min-width="80px" align="center" prop="autozone" />
+        <u-table-column label="跳转延时" min-width="80px" align="center" prop="autosecondname" />
+        <u-table-column label="确认开始" min-width="80px" align="center" prop="confirmstartname" />
+        <u-table-column label="继电器位置" min-width="80px" align="center" prop="trgaddress" />
         <u-table-column label="无上域" min-width="60px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.jmp == 0">否</span>
             <span v-else>是</span>
           </template>
-        </u-table-column>
-        <u-table-column label="备用字段01" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.backup1 }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="备用字段02" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.backup2 }}</span>
-          </template>
-        </u-table-column>
-        <u-table-column label="备用字段03" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.backup3 }}</span>
-          </template>
-        </u-table-column>
+        </u-table-column>
+        <u-table-column label="备用字段01" min-width="90px" align="center" prop="backup1" />
+        <u-table-column label="备用字段02" min-width="90px" align="center" prop="backup2" />
+        <u-table-column label="备用字段03" min-width="90px" align="center" prop="backup3" />
         <u-table-column label="是否启用" min-width="80px" align="center">
           <template slot-scope="scope">
             <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
@@ -248,6 +191,29 @@
                 <el-input ref="uprice" v-model="create.temp.uprice"  class="filter-item" placeholder="最多俩位小数" type="number" step="0.01" style="width: 100%;" />
               </el-form-item>
             </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="物料类型:" prop="materialtype">
+                <el-select v-model="create.temp.materialtype" filterable placeholder="物料类型" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in materialtypeList" :key="item.id" :label="item.mixname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="SAP货位:" prop="goods">
+                <el-select v-model="create.temp.goods" filterable placeholder="SAP货位" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in sapGoodsList" :key="item.id" :label="item.mixname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="SAP编码:" prop="sapcode">
+                <el-select v-model="create.temp.sapcode" filterable placeholder="SAP编码" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in sapCodeList" :key="item.id" :label="item.mixname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
           </el-row>
           <el-row>
             <el-col :span="24">
@@ -690,6 +656,60 @@
         </div>
       </div>
     </el-dialog>
+    <!-- 获取SAP编码 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="sapCode.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[sapCode.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <div class="search" ref="search">
+          <el-input v-model="sapCode.table.getdataListParm.parammaps.MAKTX" placeholder="原料名称" style="width: 130px;" class="filter-item" clearable />
+          <el-button class="successBorder" @click="handleSapCodeSearch">查询</el-button>
+        </div>
+        <div class="table">
+          <u-table
+            id="saptable"
+            ref="saptable"
+            :key="sapCode.table.tableKey"
+            v-loading="sapCode.table.listLoading"
+            element-loading-text="给我一点时间"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            row-key="id"
+            @selection-change="handleSapCodeSelectionChange"
+            :max-height="myHeight"
+            use-virtual
+            @table-body-scroll="tableScroll"
+            :row-height="rowHeight"
+          >
+            <u-table-column type="selection" align="center" width="50"/>
+            <u-table-column label="物料号" min-width="80px" align="center" prop="MATNR"/>
+            <u-table-column label="物料类型" min-width="90px" align="center" prop="MTART" />
+            <u-table-column label="物料组" min-width="80px" align="center" prop="MATKL"/>
+            <u-table-column label="物料描述" min-width="90px" align="center" prop="MAKTX" />
+            <u-table-column label="最后修改日期" min-width="80px" align="center" prop="LAEDA" />
+          </u-table>
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="sapCode.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="sapCode.dialogStatus==='sapCode' && isRoleEdit" class="save" :disabled="isokDisable" @click="sapCodeData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 
 </template>
@@ -728,7 +748,8 @@ export default {
     }
   },
   data() {
-    return {
+    return {
+      rowHeight: 30,
       dialogFull: false,
       isInforvalue: false,
       isRoleEdit: [],
@@ -770,7 +791,10 @@ export default {
       feedTypeList: [], // 饲料分类
       planTypeList: [], // 计划类型
       smallMaterialList: [], // 小料秤
-      jmpList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 无上域
+      jmpList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 无上域
+      materialtypeList:[],//物料类型
+      sapGoodsList:[],//sap货位
+      sapCodeList:[],//sap编码
       table: {
         tableKey: 0,
         list: [],
@@ -804,7 +828,7 @@ export default {
       create: {
         dialogFormVisible: false,
         dialogStatus: '',
-        temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '' },
+        temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '',feedgroupid:'',materialtype:'',goods:'',sapcode:''},
         rules: {
           printgroupid :[{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           fname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
@@ -864,13 +888,35 @@ export default {
         temp: {},
         rules: {}
       },
-
+
+      sapCode:{
+        dialogFormVisible: false,
+        dialogStatus: '',
+        selectList:[],
+        table: {
+          tableKey: 0,
+          list: [],
+          total: 0,
+          listLoading: false,
+          getdataListParm: {
+            name: 'getFeedSap',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              MAKTX:''
+            }
+          }
+        }
+      },
       textMap: {
         create: '新增',
         update: '编辑',
         feedBank: '饲料库',
         relation: '关联',
-        nutritive: '营养价值'
+        nutritive: '营养价值',
+        sapCode: '获取SAP编码'
       },
 
       isokDisable: false,
@@ -1107,18 +1153,23 @@ export default {
       this.table.listLoading = true
       GetDataByName(this.table.getdataListParm).then(response => {
         console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
+        if (response.data.list !== null) {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.$refs.table.reloadData( this.table.list)
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
       })
+    },
+    tableScroll ({scrollTop, scrollLeft, table, judgeFlse}) {
+      // {scrollTop, scrollLeft, table, judgeFlse: 这个参数返回一个boolean值,为true则代表表格滚动到了底部了,false没有滚动到底部,必须开起大数据渲染模式才能有值哦}, event
+      console.log(scrollTop, scrollLeft, table, judgeFlse)
     },
     handleSearch() {
       console.log('点击了查询')
@@ -1142,7 +1193,7 @@ export default {
     },
 
     resetTemp() {
-      this.create.temp = { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '', jmp: '0' }
+      this.create.temp = { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '', jmp: '0',feedgroupid:'' }
     },
     // 计划类型
     changePlanList(item) {
@@ -1761,8 +1812,35 @@ export default {
         }
       })
     },
-
-
+    handleGetSapCode(){
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择一条信息', duration: 2000 })
+      } else {
+        this.dialogFull = false
+        this.sapCode.dialogStatus = 'sapCode'
+        this.sapCode.dialogFormVisible = true
+        this.sapCode.table.getdataListParm.parammaps.MAKTX = this.selectList[0].sapcode
+        this.getsapCodeList()
+      }
+    },
+    getsapCodeList(){
+      GetDataByName(this.sapCode.table.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.sapCode.table.list = response.data.list
+        } else {
+          this.sapCode.table.list = []
+        }
+         this.$refs.saptable.reloadData(this.sapCode.table.list)
+      })
+    },
+    handleSapCodeSearch(){},
+    sapCodeData(){
+
+    },
+    handleSapCodeSelectionChange(val){
+      this.sapCode.selectList = val
+      console.log(this.sapCode.selectList,'this.sapCode.selectList')
+    }
   }
 }
 </script>

+ 1 - 1
src/views/basicData/forkliftManagement/index.vue

@@ -184,10 +184,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 32 - 30
src/views/basicData/groupColumn/index.vue

@@ -141,10 +141,14 @@ export default {
     return {
       isRoleEdit: [],
       requestParams: [
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] },
+        { name: 'getBarClass', offset: 0, pagecount: 0, parammaps: {pastureid: Cookies.get('pastureid')} },
+        { name: 'getScopeherd', offset: 0, pagecount: 0, parammaps: {pastureid: Cookies.get('pastureid')} }
       ],
       enableList: [{ id: '1', name: '是' }, { id: '0', name: '否' }],
-      jumpDelayList: [],
+      jumpDelayList: [],
+      barClassList:[],
+      scopeherdList:[],
 
       table: {
         getdataListParm: {
@@ -208,7 +212,9 @@ export default {
     },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
-        this.jumpDelayList = response.data.getDictByName.list
+        this.jumpDelayList = response.data.getDictByName.list
+        this.barClassList = response.data.getBarClass.list
+        this.scopeherdList = response.data.getScopeherd.list
       })
     },
     getList() {
@@ -226,10 +232,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
@@ -275,7 +281,7 @@ export default {
         }
       }
       this.table.temp.autosecondname = ''
-      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'isstart': 1, 'bname': '', 'bcode': '', 'allowratio': '', 'autozone': '', 'autosecond': '0', 'autosecondname': '禁用' })
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'isstart': 1, 'bname': '', 'bcode': '', 'allowratio': '', 'autozone': '', 'autosecond': '0', 'autosecondname': '禁用','scopeherdid':'','classid':'' })
     },
     createData(row) {
       console.log('点击了新增保存', row)
@@ -294,17 +300,17 @@ export default {
       this.table.temp.isstart = row.isstart
       this.table.temp.enable = row.enable
       // 检验用户名称/角色是否为空
-      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.bname == '') {
-        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
-        return false
+      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍名称/栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      }else if (this.table.temp.bname == '') {
+        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
+        return false
       }
-
+      
       // if (this.table.temp.bcode.length > 8) {
       //   this.$message({ type: 'error', message: '栏舍编号请输入1-8位数字', duration: 2000 })
       //   return false
@@ -402,21 +408,17 @@ export default {
       this.table.temp.isstart = row.isstart
       this.table.temp.enable = row.enable
       this.table.temp.id = row.id
-      // 检验用户名称/角色是否为空
-      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.bname == '') {
-        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
-        return false
+      // 检验用户名称/角色是否为空
+      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
+        return false
+      }else if (this.table.temp.bname == '') {
+        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
+        return false
       }
-      // if (this.table.temp.bcode.length > 8) {
-      //   this.$message({ type: 'error', message: '栏舍编号请输入1-8位数字', duration: 2000 })
-      //   return false
-      // }
       if (this.table.temp.allowratio !== '') {
         console.log(this.table.temp.allowratio)
         const allowratio = /^[0-9]\d*$/
@@ -621,7 +623,7 @@ export default {
 </script>
 <style lang="scss" scoped>
   .search{margin-top:10px;}
-  
+
   $width:350px;
   $left:325px;
   .selectInput{

+ 1 - 1
src/views/basicData/livestockCategory/index.vue

@@ -168,10 +168,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 1 - 1
src/views/basicData/supplier/index.vue

@@ -161,10 +161,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 310 - 9
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -30,7 +30,9 @@
         <el-select v-model="table.getdataListParm.parammaps.iscompleted" filterable placeholder="执行状态" class="filter-item" style="width: 120px;" :clearable="false">
           <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="handleExport">导出</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;">
         <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新生成</el-button>
@@ -40,7 +42,9 @@
         <div v-else style="margin-left: 10px;display: inline-block;">
           <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
           <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
-        </div>
+        </div>
+        <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
+        <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</el-button>
         <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
       </div>
       <!-- 日执行计划 -->
@@ -62,8 +66,10 @@
           class="elTable table-fixed"
           :row-class-name="tableRowClassName"
           :height="370"
-          @row-click="tableRowClick"
-        >
+          @row-click="tableRowClick"
+          @selection-change="handleSelect"
+        >
+          <el-table-column type="selection" min-width="50" />
           <el-table-column label="序号" align="center" prop="sort" width="50px" />
           <el-table-column label="计划名称" min-width="90px" align="center">
             <template slot-scope="scope">
@@ -560,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>
@@ -705,13 +711,68 @@
       </div>
     </el-dialog>
     <!-- 修改计划 -->
-    <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
+    <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
+    <!-- 删除记录 -->
+    <el-dialog :title="textMap[deleteRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="deleteRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div class="deleteRecord">
+        <div class="search">
+          <el-date-picker v-model="deleteRecord.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDeleteRecordDate" />
+        </div>
+        <div class="table">
+          <el-table
+            :key="deleteRecord.tableKey"
+            v-loading="deleteRecord.listLoading"
+            element-loading-text="给我一点时间"
+            :data="deleteRecord.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 98%;"
+            row-key="sort"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :height="370"
+          >
+            <el-table-column label="序号" align="center" prop="sort" width="50px" />
+            <el-table-column label="计划名称" min-width="90px" align="center" prop="projname" />
+            <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
+            <el-table-column label="TMR编号" min-width="90px" align="center" prop="tmrtname" />
+            <el-table-column label="驾驶员" min-width="90px" align="center" prop="driver" />
+            <el-table-column label="已执行" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.havebutton == 0">否</span>
+                <span v-else>是</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="班次" min-width="80px" align="center" prop="times" />
+            <el-table-column label="理论量" min-width="80px" align="center" prop="lweight" />
+            <el-table-column label="启用" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <el-switch v-if="dataDisabled == false" disabled v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
+                <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
+              </template>
+            </el-table-column>
+            <el-table-column label="时间" min-width="80px" align="center" prop="plantime" />
+            <el-table-column label="配方名称" min-width="100px" align="center" prop="ftname" />
+            <el-table-column label="牛头数" min-width="80px" align="center" prop="cowcount" />
+            <el-table-column label="描述" min-width="80px" align="center" prop="display" />
+            <el-table-column label="发料位" min-width="80px" align="left" prop="barnames" />
+          </el-table>
+          <span v-if="deleteRecord.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ deleteRecord.total }}条</span>
+        </div>
+        <div slot="footer" class="dialog-footer" style="bottom:20px">
+          <el-button class="cancelClose1" @click="deleteRecord.dialogFormVisible = false;getList()">取消</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons,postJson } from '@/api/common'
 import RevisePlan from './revisePlan.vue'
+import printJS from 'print-js'
 import { parseTime, json2excel,handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
 import Cookies from 'js-cookie'
 import Sortable from 'sortablejs'
@@ -897,7 +958,8 @@ export default {
         newGeneration: '新生成',
         historyRecord: '历史记录',
         revisePlan: '修改计划',
-        copy: '复制计划'
+        copy: '复制计划',
+        deleteRecord:'删除记录'
       },
       isokDisable: false,
       requestParam: {},
@@ -938,7 +1000,17 @@ export default {
       myMaxTimes:'',
       tipsList:[],
       spanObj: {},
-      mergekeys: ['sort', 'description'],
+      mergekeys: ['sort', 'description'],
+      deleteRecord:{
+        dialogFormVisible: false,
+        dialogStatus: '',
+        total:0,
+        tableKey:0,
+        listLoading:false,
+        list:[],
+        mydate: parseTime(new Date(), '{y}-{m}-{d}')
+      },
+      selectList: [],
     }
   },
 
@@ -2184,8 +2256,227 @@ export default {
           }
         }
       }
+    },
+    handleDeleteRecord(){
+      this.deleteRecord.dialogStatus = 'deleteRecord'
+      this.deleteRecord.dialogFormVisible = true
+      this.deleteRecord.mydate = this.table.getdataListParm.parammaps.mydate
+      this.getDeleteRecordList()
+    },
+    changeDeleteRecordDate(){
+      this.getDeleteRecordList()
+    },
+    getDeleteRecordList(){
+      const url = 'authdata/GetDataByName'
+      const data = {}
+      data.name = 'getDownloadedplanDeleteList'
+      data.page = 1
+      data.offset = 1
+      data.pagecount = ""
+      data.returntype = "Map"
+      data.parammaps = {}
+      data.parammaps.pastureid = Cookies.get('pastureid')
+      data.parammaps.mydate = this.deleteRecord.mydate
+      postJson(url, data).then(response => {
+        if(response.data !== null){
+          this.deleteRecord.list = response.data.list
+        }else{
+          this.deleteRecord.list = []
+        }
+        this.deleteRecord.total = response.data.total
+      })
+    },
+    handleSelect(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
+          confirmButtonText: '确认',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 1
+          }
+          console.log('生效', this.selectList)
+          this.requestParam.common = {
+            'returnmap': '0'
+          }
+          this.requestParam.data = []
+          this.requestParam.data[0] = {
+            'name': 'insertSpotList',
+            'resultmaps': {
+              'list': this.selectList
+            }
+          }
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = {
+            'name': 'updateDownloadedplanEnable',
+            'type': 'e',
+            'parammaps': {
+              enable: '@insertSpotList.enable',
+              id: '@insertSpotList.id',
+              pastureid: '@insertSpotList.pastureid'
+            }
+          }
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('生效保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '生效成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDisable() {
+      if (this.selectList.length == 0) {
+        this.$message({type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
+          confirmButtonText: '确认',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 0
+          }
+          console.log('禁用', this.selectList)
+          this.requestParam.common = {
+            'returnmap': '0'
+          }
+          this.requestParam.data = []
+          this.requestParam.data[0] = {
+            'name': 'insertSpotList',
+            'resultmaps': {
+              'list': this.selectList
+            }
+          }
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = {
+            'name': 'updateDownloadedplanEnable',
+            'type': 'e',
+            'parammaps': {
+              enable: '@insertSpotList.enable',
+              id: '@insertSpotList.id',
+              pastureid: '@insertSpotList.pastureid'
+            }
+          }
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('禁用保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handlePrint() {
+      this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+      this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
+      this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
+      this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
+      this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
+      var exportTitle = ''
+      if (this.table.getdataListParm.parammaps.plandimen == '1') {
+        if (this.table.getdataListParm.parammaps.enable3 == '0') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
+          this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
+          this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
+        } else {
+          this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
+        }
+      } else {
+        if (this.table.getdataListParm.parammaps.enable3 == '0') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
+          this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
+          this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
+        } else {
+          this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
+        }
+      }
+      GetReportform(this.downLoad.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.downLoad.labelList = []
+          var filterValArr = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            this.downLoad.labelList.push(response.data.list.data1[i].label)
+            filterValArr.push(response.data.list.data1[i].prop)
+          }
+          this.downLoad.list = response.data.list.data2
+        } else {
+          this.downLoad.list = []
+        }
+        let data = []
+        for(let i=0;i<filterValArr.length;i++){
+          let obj = {}
+          obj.field = filterValArr[i]
+          obj.columnSize = i
+          for(let j=i;j<this.downLoad.labelList.length;j++){
+            obj.displayName = this.downLoad.labelList[i]
+          }
+          if(obj.field !== undefined && obj.displayName !== undefined){
+            data.push(obj)
+          }
+          for(let i=0;i<this.downLoad.list.length;i++){
+            if(this.downLoad.list[i][obj.displayName] == null || this.downLoad.list[i][obj.displayName] == undefined){
+              this.downLoad.list[i][obj.displayName] = ''
+            }
+          }
+        }
+        console.log(this.downLoad.list)
+        printJS({
+          printable:this.downLoad.list,
+          properties:data,
+          type:'json',
+          header:exportTitle,
+          //样式设置
+          gridStyle:'border:1px solid #ccc;',
+          gridHeaderStyle:'border:1px solid #ccc;text-align:center'
+        })
+      })
     },
-
   }
 }
 </script>
@@ -2196,6 +2487,16 @@ export default {
 
   .el-table .success-row {
     background: #f0f9eb;
+  }
+  @page{
+    size: auto A4 landscape;
+    margin: 3mm;
+  }
+
+  .agreeCon {
+    background: #fff;
+    box-sizing: border-box;
+    padding: 2rem 3rem 4rem;
   }
 </style>
 <style lang="scss" scoped>

+ 170 - 102
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -1,38 +1,20 @@
 <template>
   <div class="app-container">
-    <div class="search">
-      <el-select
-        v-model="table.getdataListParm.parammaps.times"
-        filterable
-        placeholder="班次"
-        class="filter-item"
-        style="width: 120px;"
-        @change="changeFrequency"
-      >
-        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-    </div>
     <div class="operation">
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次
       </el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">
-        减少车次</el-button>
-      <el-button
-        v-if="isOrder && isRoleEdit"
-        icon="el-icon-sort"
-        style="float: left;"
-        class="success"
-        @click="handleChangeOrder"
-      >更改顺序</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">减少车次</el-button>
+      <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder" >更改顺序</el-button>
       <div v-else style="float: left;margin-left: 10px;">
-        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存
-        </el-button>
+        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存 </el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
       </div>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">
-        生效</el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">
-        禁用</el-button>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> 生效</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> 禁用</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
+        <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency" >
+          <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
     </div>
     <div class="table">
       <el-table
@@ -328,6 +310,7 @@
           <div class="spreadingMaterial">
             <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
             <div class="spreadingMaterialList">
+              <!-- force-fallback="true" -->
               <draggable
                 :disabled="isDropState"
                 id="1"
@@ -337,7 +320,6 @@
                 draggable=".item"
                 group="a"
                 animation="500"
-                force-fallback="true"
                 :move="move1"
                 @change="changeLog1"
                 @start="start1"
@@ -409,6 +391,29 @@
           </div>
         </div>
       </div>
+    </el-dialog>
+
+    <!-- 更改TMR编号 -->
+    <el-dialog 
+    :title="textMap[tmrNumber.dialogStatus]" 
+    :destroy-on-close="true" 
+    :visible.sync="tmrNumber.dialogFormVisible"
+    :before-close="close"
+    :close-on-click-modal="false" 
+    width="30%"
+    :modal-append-to-body="false"
+    :append-to-body="true">
+        <h3 style="text-align: center;">是否要改变TMR设备?</h3>
+      <div class="tmrNumber" style="padding: 10px 30px;">
+        <p>注:更换TMR撒料设备,变更后的装载重量不同,请选择处理方式</p>
+        <el-radio v-model="tmrNumber.radio" label="0">1、多出的饲料平均从已分配的各栏舍中扣减。</el-radio><br/><br/>
+        <el-radio v-model="tmrNumber.radio" label="1">2、多出的饲料从最后一个栏舍依次往前扣减。</el-radio><br/><br/>
+        <el-radio v-model="tmrNumber.radio" label="2">3、清空已分配的撒料车。</el-radio>
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
+        <el-button class="cancelClose" :disabled="isokDisable" @click="closeTmrNumber">否</el-button>
+        <el-button class="save" :disabled="isokDisable" @click="tmrNumberData()">是</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -493,7 +498,8 @@ export default {
       selectList: [],
       textMap: {
         create: '新增',
-        update: '编辑'
+        update: '编辑',
+        tmrNumber:''
       },
       dialogFull: false,
       isOrder: true,
@@ -546,7 +552,13 @@ export default {
       equipmentList: [], // 撒料设备
       templateFormulationList: [], // 模板配方
       isDispaly: false,
-      isDropState:false
+      isDropState:false,
+      tmrNumber:{
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp:{},
+        radio:'0'
+      }
     }
   },
   watch: {
@@ -593,20 +605,22 @@ export default {
         } else {
           this.TMRNumberList = []
         }
-      })
-      const data2 = {
-        name: 'getTMRListEnableTypeAll',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
-        }
+      })
+      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.list
+          this.equipmentList = response.data
           if(this.create.dialogStatus == 'update'){
-            this.create.temp.tclassname = this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid).tclassname
+            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
+            }else{
+              this.create.temp.tclassname = '固定式'
+            }
           }
         } else {
           this.equipmentList = []
@@ -752,28 +766,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({
@@ -796,38 +797,44 @@ export default {
       this.getCreateList1()
     },
     // TMR编号
-    changeTMRNumber(item) {
-      if (this.create.list2.length > 0) {
-        MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
-          confirmButtonText: '是',
-          cancelButtonText: '否',
-          type: 'warning'
-        }).then(() => {
-          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.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
-          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: '已取消'
-          })
-        })
+    changeTMRNumber(item) {
+      console.log(this.create.temp.tmrid,'this.create.temp.tmrid111')
+      if (this.create.list2.length > 0) {
+        // 备份
+        // MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
+        //   confirmButtonText: '是',
+        //   cancelButtonText: '否',
+        //   type: 'warning'
+        // }).then(() => {
+        //   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(() => {
+        //   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
+        //   console.log(this.create.temp)
+        //   this.$message({ type: 'info', message: '已取消' })
+        // })
+        // 备份
+        this.tmrNumber.dialogFormVisible = true
+        this.tmrNumber.dialogStatus = 'tmrNumber'
+        this.tmrNumber.radio = '0'
       } else {
         this.create.temp.tmrid = this.create.temp.tmrid2
         this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
@@ -838,6 +845,49 @@ export default {
         console.log('TMR编号item==>', item)
         console.log('tmrname==>', this.create.temp)
       }
+    },
+    tmrNumberData(){
+      if(this.tmrNumber.radio == '0'){
+        console.log('1、多出的饲料平均从已分配的各栏舍中扣减。')
+      }else if(this.tmrNumber.radio == '1'){
+        console.log('2、多出的饲料从最后一个栏舍依次往前扣减。')
+      }else if(this.tmrNumber.radio == '2'){
+        console.log('3、清空已分配的撒料车。')
+      }
+      const url = 'authdata/materialtmr/date/edit'
+      const data = {
+        tmrid:this.create.temp.tmrid2,
+        tmrtype: this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassid,
+        lppid:this.create.temp.id,
+        times:this.create.temp.times,
+        pastureid:Cookies.get('pastureid'),
+        status:this.tmrNumber.radio,
+        date:this.date
+      }
+      postJson(url, data).then(response => {
+        if (response.msg === 'fail') {
+          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
+          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.tmrNumber.dialogFormVisible = false
+          this.getCreateList1()
+        }
+      })
+    },
+    closeTmrNumber(){
+      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
+      this.tmrNumber.dialogFormVisible = false
     },
     getClearList() {
       const url = 'authdata/lpplandtl/del/day'
@@ -1161,7 +1211,7 @@ export default {
           this.create.temp.sumweight = (sumweight).toFixed(2)
         } else {
           this.create.list2 = []
-          this.create.temp.sort = 0
+          // this.create.temp.sort = 0
           this.create.temp.sumweight = 0
         }
       })
@@ -1187,10 +1237,11 @@ 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
         }
       }
       console.log('this.create.temp.sumweight', this.create.temp.sumweight)
@@ -1200,13 +1251,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
       }
@@ -1266,7 +1312,7 @@ export default {
           this.getCreateList1()
         })
       })
-
+      console.log(this.create.temp.tmrid,'66666')
     },
     handleUpdate(row) {
       this.getDownList()
@@ -1296,7 +1342,7 @@ export default {
           this.create.temp.sumcowcount = 0
           this.create.temp.date = this.date
           data.parammaps = this.create.temp
-          data.parammaps.tmrid = this.create.temp.mytmrid
+          data.parammaps.tmrid = this.create.temp.tmrid2
           data.parammaps.tmrname = this.create.temp.mytmrname
           postJson(url, data).then(response => {
             console.log('新增保存发送参数', this.requestParam)
@@ -1444,6 +1490,7 @@ export default {
        data.parammaps.pastureid = obj.pastureid
        data.parammaps.lppid = obj.lppid
        data.parammaps.sort = evt.moved.newIndex +1
+       data.parammaps.id = obj.id
        data.parammaps.date = this.date
        postJson(url, data).then(response => {
          console.log('拖动保存发送参数', this.requestParam)
@@ -1757,6 +1804,27 @@ export default {
           this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
           this.getCreateList1()
         }
+
+      })
+    },
+    handleAllEmpty(){
+      MessageBox.confirm('执行该操作会将现有车次已分配的撒料栏舍全部清空,是否要执行该操作?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
+        this.requestParam.data[0] = { 'name': 'deleteLpplandtl1dateAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid'),date:this.date }},
+        this.requestParam.data[1] = { 'name': 'deletefpdetaildateAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid'),date:this.date }},
+        ExecDataByConfig(this.requestParam).then(response => {
+          console.log('清空已分配栏舍', this.requestParam)
+          if (response.msg === 'fail') {
+            this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
+            this.getList()
+          }
+        })
       })
     }
   }

+ 7 - 0
src/views/formulationPlan/dailyExecutionPlan/typePage/surplusMaterialPlan.vue

@@ -1045,6 +1045,13 @@ export default {
           this.carFollowList = response.data.list
         }
       })
+      if(this.carFollowList.length>0){
+        if(this.carFollowList.find(obj => obj.id == row.lppid).lppcode == undefined){
+          this.$set(row, 'lppid', '')
+        }
+      }else{
+        this.$set(row, 'lppid', '')
+      }
       console.log(row, '====')
       if (row.lppcode == undefined) {
         this.$set(row, 'lppid', '')

Diferenças do arquivo suprimidas por serem muito extensas
+ 364 - 451
src/views/formulationPlan/dhedFormula/index.vue


+ 104 - 46
src/views/formulationPlan/dhedFormula/index - 副本.vue → src/views/formulationPlan/dhedFormula/index备.vue

@@ -13,19 +13,19 @@
         </el-select>
         <!-- <el-input v-model="table.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" /> -->
         <el-button class="successBorder" @click="handleSearch">查询</el-button>
+        <el-button v-if="isRoleEdit" class="successBorder" @click="handleDryMatterRegulation">干物质调节</el-button>
+        <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+          <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
+        </el-upload>
+        <el-dropdown style="float: right;margin-right: 10px;">
+          <el-button class="export" icon="el-icon-upload2">导出</el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+            <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-button class="export" style="float: right;margin-right: 10px;" @click="handleHistoryRecords">历史记录</el-button>
       </div>
-      <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleDryMatterRegulation">干物质调节</el-button>
-      <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">导出</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button class="export" style="float: right;margin-right: 10px;" @click="handleHistoryRecords">历史记录</el-button>
     </div>
     <div class="search" />
     <div class="table">
@@ -242,7 +242,7 @@
           <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
         </div>
         <div class="table">
-          <el-table
+          <u-table
             :key="history.tableKey"
             v-loading="history.listLoading"
             element-loading-text="给我一点时间"
@@ -255,30 +255,32 @@
             :cell-style="cellStyle"
             class="elTable table-fixed"
             :span-method="objectSpanMethod"
+            :max-height="500"
           >
-            <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
+            <u-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left" />
+            <!-- <u-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (history.pageNum-1) * history.pageSize + 1 }}</span>
               </template>
-            </el-table-column>
-            <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
-            <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
-            <el-table-column :key="4" label="软件牛头数" prop="softccount" min-width="70px" align="center" />
-            <el-table-column :key="5" label="实际牛头数" prop="ccount" min-width="70px" align="center" />
-            <el-table-column :key="6" label="系数(%)" prop="ratio" min-width="70px" align="center" />
-            <el-table-column :key="7" label="系数头数" prop="ccountratio" min-width="70px" align="center" />
-            <el-table-column :key="8" label="配方模板" prop="ptname" min-width="70px" align="center" />
-            <el-table-column v-if="table.isPtsfname" :key="9" label="补料配方" prop="ptsname" min-width="70px" align="center" />
-            <el-table-column :key="10" label="班次比例" prop="tratio" min-width="70px" align="center" />
-            <el-table-column :key="11" label="班次重量" prop="weight" min-width="70px" align="center" />
-            <el-table-column :key="12" label="配方重量" prop="pweight" min-width="70px" align="center" />
-            <el-table-column v-if="table.isPtsfname" :key="13" label="补料重量" prop="ptweight" min-width="70px" align="center" />
-            <el-table-column :key="14" label="配方干物质量" prop="dryweight" min-width="70px" align="center" />
-            <el-table-column :key="15" label="饲喂干物质量" prop="swdryw" min-width="70px" align="center" />
-            <el-table-column :key="16" label="采样干物质量" prop="cydryw" min-width="70px" align="center" />
-            <el-table-column :key="17" label="日投喂量" prop="sumweight" min-width="70px" align="center" />
-          </el-table>
-          <pagination2 v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
+            </u-table-column> -->
+            <u-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
+            <u-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
+            <u-table-column :key="4" label="软件牛头数" prop="softccount" min-width="70px" align="center" />
+            <u-table-column :key="5" label="实际牛头数" prop="ccount" min-width="70px" align="center" />
+            <u-table-column :key="6" label="系数(%)" prop="ratio" min-width="70px" align="center" />
+            <u-table-column :key="7" label="系数头数" prop="ccountratio" min-width="70px" align="center" />
+            <u-table-column :key="8" label="配方模板" prop="ptname" min-width="70px" align="center" />
+            <u-table-column v-if="table.isPtsfname" :key="9" label="补料配方" prop="ptsname" min-width="70px" align="center" />
+            <u-table-column :key="10" label="班次比例" prop="tratio" min-width="70px" align="center" />
+            <u-table-column :key="11" label="班次重量" prop="weight" min-width="70px" align="center" />
+            <u-table-column :key="12" label="配方重量" prop="pweight" min-width="70px" align="center" />
+            <u-table-column v-if="table.isPtsfname" :key="13" label="补料重量" prop="ptweight" min-width="70px" align="center" />
+            <u-table-column :key="14" label="配方干物质量" prop="dryweight" min-width="70px" align="center" />
+            <u-table-column :key="15" label="饲喂干物质量" prop="swdryw" min-width="70px" align="center" />
+            <u-table-column :key="16" label="采样干物质量" prop="cydryw" min-width="70px" align="center" />
+            <u-table-column :key="17" label="日投喂量" prop="sumweight" min-width="70px" align="center" />
+          </u-table>
+          <!-- <pagination2 v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" /> -->
         </div>
       </div>
       <div slot="footer" class="dialog-footer" style="bottom: 10px;">
@@ -787,7 +789,9 @@ export default {
         // pagecount: parseInt(Cookies.get('pageCount')),
         pagecount: '',
         returntype: 'Map',
-        parammaps: {}
+        parammaps: {
+          pastureid: Cookies.get('pastureid')
+        }
       },
       tnameList: [], // 配方名 称
       recipeTemplateList: [], // 配方模板
@@ -976,7 +980,8 @@ export default {
           name: 'getPlanModifyFPlist',
           page: 1,
           offset: 1,
-          pagecount: 12,
+          // pagecount: 12,
+          pagecount: '',
           returntype: 'Map',
           parammaps: {
             pastureid: Cookies.get('pastureid'),
@@ -1053,7 +1058,8 @@ export default {
       isokDisable: false,
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight: document.documentElement.clientHeight - 85 - 140
+      myHeight: document.documentElement.clientHeight - 85 - 140,
+      oldRowList:{}
     }
   },
   computed: {
@@ -1065,7 +1071,7 @@ export default {
     },
     uploadData() {
       return {
-        name: 'checkbarname,checkftsw,checkftbl,updateBigFPUpload,updateBigFPfeedweightUpload,updateBigFPDetailUpload,updateBigFPDetailUploadV1,updateBigFPDetailUploadV2,updateBigFPDetailUploadV3',
+        name: 'checkbarname,checkftsw,checkftbl',
         importParams: '栏舍名称,实际牛头数,系数(%),配方模板,补料配方,第一班比例(%),第二班比例(%),第三班比例(%)',
         sheetname: 'Sheet1',
         // 登录牧场
@@ -1080,7 +1086,7 @@ export default {
     },
     // 设置上传地址
     uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+      return process.env.VUE_APP_BASE_API + 'authdata/fpdimportexcel'
     }
   },
   created() {
@@ -2482,6 +2488,11 @@ export default {
       if (row.w2 == '') { row.w2 = 0 }
       if (row.w3 == '') { row.w3 = 0 }
       if (row.w4 == '') { row.w4 = 0 }
+      if (isNaN(row.r1)) { row.r1 = 0 }
+      if (isNaN(row.r2)) { row.r2 = 0 }
+      if (isNaN(row.r3)) { row.r3 = 0 }
+      if (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'))))
       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')))
     },
@@ -2851,7 +2862,6 @@ export default {
             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')))
             if (parseFloat(row.dailyWeight) > parseFloat(this.focusWRow2.dailyWeight)) {
-              console.log('huijia;')
               row.w1 = formatNum((parseFloat(this.focusWRow2.dailyWeight) - parseFloat(row.w2)) * parseFloat(row.r1) / (parseFloat(row.r1) + parseFloat(row.r3) + parseFloat(row.r4)), parseInt(Cookies.get('decimal')))
               row.r1 = formatNum(parseFloat(row.w1) / parseFloat(row.feedweight) * 100, parseInt(Cookies.get('decimal')))
             }
@@ -3084,6 +3094,11 @@ export default {
       if (row.w2 == '') { row.w2 = 0 }
       if (row.w3 == '') { row.w3 = 0 }
       if (row.w4 == '') { row.w4 = 0 }
+      if (isNaN(row.r1)) { row.r1 = 0 }
+      if (isNaN(row.r2)) { row.r2 = 0 }
+      if (isNaN(row.r3)) { row.r3 = 0 }
+      if (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'))))
       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')))
     },
@@ -3674,6 +3689,11 @@ export default {
       if (row.w2 == '') { row.w2 = 0 }
       if (row.w3 == '') { row.w3 = 0 }
       if (row.w4 == '') { row.w4 = 0 }
+      if (isNaN(row.r1)) { row.r1 = 0 }
+      if (isNaN(row.r2)) { row.r2 = 0 }
+      if (isNaN(row.r3)) { row.r3 = 0 }
+      if (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'))))
       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')))
     },
@@ -4164,6 +4184,11 @@ export default {
       if (row.w2 == '') { row.w2 = 0 }
       if (row.w3 == '') { row.w3 = 0 }
       if (row.w4 == '') { row.w4 = 0 }
+      if (isNaN(row.r1)) { row.r1 = 0 }
+      if (isNaN(row.r2)) { row.r2 = 0 }
+      if (isNaN(row.r3)) { row.r3 = 0 }
+      if (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'))))
       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')))
     },
@@ -4174,6 +4199,7 @@ export default {
     // 编辑
     handleUpdate(row) {
       console.log(row)
+      this.oldRowList = {...row}
       for (let i = 0; i < this.table.list.length; i++) {
         if (this.table.list[i].Edit == true) {
           this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
@@ -4230,6 +4256,7 @@ export default {
         }else{
           obj['supplement'] = row['bw' + i]
         }
+        obj['tratio'] = Math.round(row['r' + i])
         obj['todaysupplement'] = row.todaysupplement
         obj['todayweight'] = row.todayweight
         arr.push(obj)
@@ -4254,11 +4281,11 @@ export default {
       this.$set(row, 'ccountratio', Math.floor(parseFloat(row.ccountratio) * 100) / 100)
       row.ccountratio = String(row.ccountratio)
       row.sumr = Math.round(row.sumr)
-      for(let i=0;i<arr.length;i++){
-        if(arr[i].tratio == undefined ||arr[i].tratio =='' || arr[i].tratio == null){
-          arr[i].tratio = 0
-        }
-      }
+      // for(let i=0;i<arr.length;i++){
+      //   if(arr[i].tratio == undefined ||arr[i].tratio =='' || arr[i].tratio == null){
+      //     arr[i].tratio = 0
+      //   }
+      // }
       this.table.rwList = arr
       console.log('点击了编辑保存', row)
       this.table.temp.pastureid = row.pastureid
@@ -4315,6 +4342,28 @@ export default {
       this.table.temp.w3 = row.w3
       this.table.temp.w4 = row.w4
 
+      var obj = {}
+      obj.pastureid = row.pastureid
+      obj.id = row.id
+      obj.data = []
+      if(this.oldRowList.w1 !== row.w1){
+        obj.data.push({'old':this.oldRowList.w1,'new':row.w1,times:1,'ptid':row.ftid,'ptsid':row.ptsfid})
+      }
+      if(this.oldRowList.w2 !== row.w2){
+        obj.data.push({'old':this.oldRowList.w2,'new':row.w2,times:2,'ptid':row.ftid,'ptsid':row.ptsfid})
+      }
+      if(this.oldRowList.w3 !== row.w3){
+        obj.data.push({'old':this.oldRowList.w3,'new':row.w3,times:3,'ptid':row.ftid,'ptsid':row.ptsfid})
+      }
+      if(this.oldRowList.bw1 !== row.bw1){
+        obj.data.push({'old':this.oldRowList.bw1,'new':row.bw1,times:1,'ptid':row.ftid,'ptsid':row.ptsfid})
+      }
+      if(this.oldRowList.bw2 !== row.bw2){
+        obj.data.push({'old':this.oldRowList.bw2,'new':row.bw2,times:2,'ptid':row.ftid,'ptsid':row.ptsfid})
+      }
+      if(this.oldRowList.bw3 !== row.bw3){
+        obj.data.push({'old':this.oldRowList.bw3,'new':row.bw3,times:3,'ptid':row.ftid,'ptsid':row.ptsfid})
+      }
       if (this.table.temp.ccount == '' && this.table.temp.ratio == '' && this.table.temp.ccountratio == '' && this.table.temp.ftid == '') {
         this.$message({ type: 'error', message: '实际牛头数/系数/系数头数/配方模版不能为空', duration: 2000 })
         return false
@@ -4408,8 +4457,17 @@ export default {
         if (response.msg === 'fail') {
           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         } else {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          // this.reload()
+          if(obj.data.length>0){
+            const url = 'authdata/fpdetail/edit'
+            const data = obj
+            postJson(url, data).then(response => {
+              if(response.msg !== 'fail'){
+                this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              }
+            })
+          }else{
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          }
           this.getList()
           for (let i = 0; i < this.headerList.length; i++) {
             if (this.headerList[i].target.className == 'el-icon-lock') {

+ 3 - 2
src/views/formulationPlan/formulaDistribution/index.vue

@@ -323,7 +323,7 @@ export default {
             tableKey: 3,
             list: [],
             total: 0,
-            listLoading: true
+            listLoading: false
           },
           date: {
             getdataListParm: {
@@ -504,7 +504,8 @@ export default {
           pastureid: '@insertSpotList2.id',
           groupsid: Cookies.get('pastureid')
         }}
-        ExecDataByConfig(this.requestParam).then(response => {
+        let url = "authdata/formulaissued"
+        postJson(url,this.requestParam).then(response => {
           console.log('配方下发保存发送参数', this.requestParam)
           if (response.msg === 'fail') {
             this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })

+ 0 - 667
src/views/formulationPlan/formulaDistribution/index改.vue

@@ -1,667 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="operation">
-      <el-button class="successBorder" @click="handleFormulaDistribution">配方下发</el-button>
-    </div>
-    <div class="search">
-      <el-input v-model="table.getdataListParm.parammaps.fname" placeholder="配方名称" style="width: 180px;" class="filter-item" clearable />
-      <el-select v-model="table.getdataListParm.parammaps.ccname" placeholder="牲畜类别" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.parentname" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.fttype" placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.useStatus" placeholder="使用状态" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in useStatusList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.adjustmentResults" placeholder="调整结果" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in adjustmentResultsList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-      >
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="配方名称" min-width="100px" align="center" prop="tname" />
-        <el-table-column label="牲畜类别" min-width="100px" align="center" prop="ccname" />
-        <el-table-column label="配方类型" min-width="100px" align="center" prop="fttype" />
-        <el-table-column label="是否为当前配方" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.isissue == 0">否</span>
-            <span v-else>是</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="已下发牧场" min-width="100px" align="center" prop="grouppastures" />
-        <el-table-column label="下发时间" min-width="100px" align="center" prop="issueTime" />
-        <el-table-column label="使用状态" min-width="100px" align="center" prop="useStatus" />
-        <el-table-column label="调整结果" min-width="100px" align="center" prop="adjustmentResults">
-          <template slot-scope="scope">
-            <a v-if="scope.row.adjustmentResults == '已调整'" style="text-decoration:underline;">{{ scope.row.adjustmentResults }}</a>
-            <span v-else>{{ scope.row.adjustmentResults }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="最近一次调整时间" min-width="130px" align="center" prop="lastTime" />
-        <el-table-column label="备注" min-width="130px" align="center" prop="remark" />
-        <el-table-column label="操作" :show-overflow-tooltip="true" align="center" class-name="small-padding fixed-width" width="50" fixed="right">
-          <template slot-scope="{row}">
-            <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <!-- 配方下发 -->
-    <el-dialog :title="textMap[formulaDistribution.dialogStatus]" :visible.sync="formulaDistribution.dialogFormVisible" :close-on-click-modal="false" width="70%">
-      <div class="app-formulaDistribution">
-        <h4>请选择下发配方:</h4>
-        <div class="table">
-          <el-table
-            :key="formulaDistribution.table.tableKey"
-            v-loading="formulaDistribution.table.listLoading"
-            element-loading-text="给我一点时间"
-            :data="formulaDistribution.table.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-            @selection-change="handleSelectionChange"
-          >
-            <el-table-column type="selection" width="55" />
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="配方名称" min-width="130px" align="center" prop="tname" />
-            <el-table-column label="牲畜类别" min-width="130px" align="center" prop="ccname" />
-            <el-table-column label="配方类型" min-width="130px" align="center" prop="fttype" />
-            <el-table-column label="备注" min-width="130px" align="center" prop="remark" />
-            <el-table-column label="是否启用" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose" @click="formulaDistribution.dialogFormVisible = false; ">关闭</el-button>
-        <el-button class="save" :disabled="isokDisable" @click="nextData()">下一步</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 牧场 -->
-    <el-dialog :title="textMap[formulaDistribution.pasture.dialogStatus]" :visible.sync="formulaDistribution.pasture.dialogFormVisible" :close-on-click-modal="false" width="40%">
-      <div class="app-pasture">
-        <h4>选择下发牧场:</h4>
-        <el-checkbox v-model="formulaDistribution.pasture.checkAll" :indeterminate="formulaDistribution.pasture.isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
-        <div style="margin: 15px 0;" />
-        <el-checkbox-group v-model="formulaDistribution.pasture.checkedList" @change="handlePastureChange">
-          <el-checkbox v-for="item in formulaDistribution.pasture.list" :key="item.id" :label="item" :value="item.id">{{ item.pasturename }}</el-checkbox>
-        </el-checkbox-group>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose" @click="formulaDistribution.pasture.dialogFormVisible = false; ">关闭</el-button>
-        <el-button class="save" :disabled="isokDisable" @click="formulaDistributionData()">确认</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 查看 -->
-    <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="70%">
-      <div class="app-see">
-        <el-tabs v-model="see.activeName" @tab-click="handleSeeTabClick">
-          <el-tab-pane label="下发记录" name="first">
-            <div class="search">
-              <el-select v-model="see.tab1.table.getdataListParm.parammaps.pasturename" placeholder="牧场" class="filter-item" style="width: 120px;" clearable>
-                <el-option v-for="item in formulaDistribution.pasture.list" :key="item.id" :label="item.pasturename" :value="item.pasturename" />
-              </el-select>
-              <el-button class="successBorder" @click="handleSeeTab1Search">查询</el-button>
-            </div>
-            <div class="table">
-              <el-table
-                :key="see.tab1.table.tableKey"
-                v-loading="see.tab1.table.listLoading"
-                element-loading-text="给我一点时间"
-                :data="see.tab1.table.list"
-                border
-                fit
-                highlight-current-row
-                style="width: 100%;"
-                :row-style="rowStyle"
-                :cell-style="cellStyle"
-                class="elTable table-fixed"
-                @row-click="handleSeeTab1RowClick"
-              >
-                <el-table-column label="序号" align="center" type="index" width="50px">
-                  <template slot-scope="scope">
-                    <span>{{ scope.$index + (see.tab1.table.pageNum-1) * see.tab1.table.pageSize + 1 }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="牧场" min-width="130px" align="center" prop="pasturename" />
-                <el-table-column label="下发时间" min-width="130px" align="center" prop="date" />
-              </el-table>
-            </div>
-            <pagination v-show="see.tab1.table.total>0" :total="see.tab1.table.total" :page.sync="see.tab1.table.getdataListParm.offset" :limit.sync="see.tab1.table.getdataListParm.pagecount" @pagination="getSeeTab1List" />
-          </el-tab-pane>
-          <el-tab-pane label="使用情况" name="second">
-            <div class="search">
-              <el-autocomplete v-model="see.tab2.table.getdataListParm.parammaps.date" value-key="date" class="inline-input filter-item" :fetch-suggestions="dateSearch" placeholder="日期" style="width:250px" @select="handleSelectDate">
-                <template slot-scope="{ item }">
-                  <span>{{ item.date }}</span>
-                </template>
-              </el-autocomplete>
-              <el-button class="successBorder" @click="handleSeeTab2Search">查询</el-button>
-            </div>
-            <div class="table">
-              <el-table
-                id="table"
-                :key="see.tab2.table.tableKey"
-                ref="table"
-                v-loading="see.tab2.table.listLoading"
-                element-loading-text="给我一点时间"
-                :data="see.tab2.table.list"
-                border
-                highlight-current-row
-                style="width: 100%;"
-                :height="height"
-                :row-style="rowStyle"
-                :cell-style="cellStyle"
-                class="elTable table-fixed"
-                row-key="id"
-                :show-header="false"
-              >
-                <el-table-column label="1" width="100px" align="center" prop="pasturename" />
-                <el-table-column label="1" width="120px" align="center" prop="tname" />
-                <el-table-column label="1" width="130px" align="center" prop="datestr" />
-                <el-table-column label="1" min-width="800px" align="center">
-                  <template slot-scope="scope">
-                    <div v-for="element in scope.row.arrList" :key="element.concatname" class="list-group-item2 item" style="width: 100px;float: left;margin: 5px 5px;padding: 0;height: 30px;">
-                      <el-tooltip placement="top">
-                        <div slot="content">{{ element.concatname }}</div>
-                        <span :style="{'color':element.color}" style="display: block;height:30px;line-height: 30px;">
-                          {{ element.concatname }}
-                        </span>
-                      </el-tooltip>
-                    </div>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
-          </el-tab-pane>
-        </el-tabs>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose1" @click="see.dialogFormVisible = false; ">关闭</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, postJson, ExecDataByConfig } from '@/api/common'
-import Pagination from '@/components/Pagination'
-import { parseTime } from '@/utils/index.js'
-import Cookies from 'js-cookie'
-
-export default {
-  name: 'FormulaDistribution',
-  components: { Pagination },
-  data() {
-    return {
-      useStatusList: [{ id: 0, name: '未使用' }, { id: 1, name: '已使用' }],
-      adjustmentResultsList: [{ id: 0, name: '未调整' }, { id: 1, name: '已调整' }],
-      formulaTypeList: [],
-      livestockList: [],
-      requestParams: [
-        { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['配方类型'] },
-        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
-      ],
-      table: {
-        getdataListParm: {
-          name: 'getFTListXF',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            tname: '',
-            ccname: '',
-            fttype: '',
-            remark: '',
-            useStatus: '',
-            adjustmentResults: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
-
-      formulaDistribution: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        table: {
-          getdataListParm: {
-            name: 'getFTListXF',
-            page: 1,
-            offset: 1,
-            pagecount: 0,
-            returntype: 'Map',
-            parammaps: {
-              pastureid: Cookies.get('pastureid')
-            }
-          },
-          tableKey: 1,
-          list: [],
-          total: 0,
-          listLoading: true
-        },
-        selectList: [],
-        pasture: {
-          dialogFormVisible: false,
-          dialogStatus: '',
-          getdataListParm: {
-            name: 'getgroupsPasture',
-            page: 1,
-            offset: 1,
-            pagecount: 0,
-            returntype: 'Map',
-            parammaps: {
-              pastureid: Cookies.get('pastureid')
-            }
-          },
-          total: 0,
-          listLoading: true,
-          // 牧场
-          checkAll: false,
-          checkedList: [],
-          list: [],
-          isIndeterminate: false
-        }
-      },
-
-      see: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        activeName: 'first',
-        temp: {},
-        tab1: {
-          table: {
-            getdataListParm: {
-              name: 'getFTListXFhis',
-              page: 1,
-              offset: 1,
-              pagecount: 10,
-              returntype: 'Map',
-              parammaps: {
-                pastureid: '',
-                ftid: '',
-                pasturename: ''
-              }
-            },
-            tableKey: 2,
-            list: [],
-            total: 0,
-            listLoading: true
-          }
-        },
-        tab2: {
-          table: {
-            getdataListParm: {
-              name: 'getFTusageList',
-              name1: 'getFTdusageList',
-              page: 1,
-              offset: 1,
-              pagecount: 0,
-              returntype: 'Map',
-              parammaps: {
-                pastureid: Cookies.get('pastureid'),
-                date: ''
-              }
-            },
-            tableKey: 3,
-            list: [],
-            total: 0,
-            listLoading: true
-          },
-          date: {
-            getdataListParm: {
-              name: 'getFTListXFhisTime',
-              page: 1,
-              offset: 1,
-              pagecount: 10,
-              returntype: 'Map',
-              parammaps: {
-                pastureid: Cookies.get('pastureid'),
-                date: ''
-              }
-            },
-            list: []
-          }
-        }
-      },
-      textMap: {
-        formulaDistribution: '配方下发',
-        see: '查看',
-        pasture: '配方下发'
-      },
-      requestParam: {},
-      isokDisable: false,
-      height: document.body.clientHeight,
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
-    }
-  },
-  created() {
-    this.getDownList()
-    this.getList()
-  },
-
-  methods: {
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.livestockList = response.data.getCowclassListEnable.list
-        this.formulaTypeList = response.data.getDictByName2.list
-        console.log(this.formulaTypeList)
-      })
-    },
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSearch() {
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      this.table.getdataListParm.parammaps.tname = ''
-      this.table.getdataListParm.parammaps.ccname = ''
-      this.table.getdataListParm.parammaps.fttype = ''
-      this.table.getdataListParm.parammaps.remark = ''
-    },
-
-    // 配方下发
-    handleFormulaDistribution() {
-      this.formulaDistribution.dialogStatus = 'formulaDistribution'
-      this.formulaDistribution.dialogFormVisible = true
-      this.getFormulaDistributionList()
-    },
-    handleSelectionChange(item) {
-      this.formulaDistribution.selectList = item
-    },
-    getFormulaDistributionList() {
-      this.formulaDistribution.table.listLoading = true
-      GetDataByName(this.formulaDistribution.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.formulaDistribution.table.list = response.data.list
-        } else {
-          this.formulaDistribution.table.list = []
-        }
-        setTimeout(() => {
-          this.formulaDistribution.table.listLoading = false
-        }, 100)
-      })
-    },
-    nextData() {
-      if (this.formulaDistribution.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择下发配方', duration: 2000 })
-        return false
-      } else {
-        for (let i = 0; i < this.formulaDistribution.selectList.length; i++) {
-          if (this.formulaDistribution.selectList[i].enable == 0) {
-            this.$message({ type: 'error', message: '配方未启用不可下发', duration: 2000 })
-            return false
-          }
-        }
-        this.formulaDistribution.pasture.dialogStatus = 'pasture'
-        this.formulaDistribution.pasture.dialogFormVisible = true
-        this.getPastureList()
-      }
-    },
-    getPastureList() {
-      GetDataByName(this.formulaDistribution.pasture.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.formulaDistribution.pasture.list = response.data.list
-        } else {
-          this.formulaDistribution.pasture.list = []
-        }
-      })
-    },
-    handleCheckAllChange(val) {
-      this.formulaDistribution.pasture.checkedList = val ? this.formulaDistribution.pasture.list : []
-      this.formulaDistribution.pasture.isIndeterminate = false
-    },
-    handlePastureChange(value) {
-      const checkedCount = value.length
-      this.formulaDistribution.pasture.checkAll = checkedCount === this.formulaDistribution.pasture.list.length
-      this.formulaDistribution.pasture.isIndeterminate = checkedCount > 0 && checkedCount < this.formulaDistribution.pasture.list.length
-    },
-    formulaDistributionData() {
-      if (this.formulaDistribution.pasture.checkedList.length == 0) {
-        this.$message({ type: 'error', message: '请选择下发牧场', duration: 2000 })
-        return false
-      } else {
-        this.isokDisable = true
-        setTimeout(() => {
-          this.isokDisable = false
-        }, 1000)
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.formulaDistribution.selectList }}
-        this.requestParam.data[0].children = []
-        this.requestParam.data[0].children[0] = { 'name': 'insertfeedtemplet_issue', 'type': 'e', 'parammaps': {
-          pastureid: Cookies.get('pastureid'),
-          ftid: '@insertSpotList.id'
-        }}
-        this.requestParam.data[0].children[1] = { 'name': 'insertftdetail_issue', 'type': 'e', 'parammaps': {
-          pastureid: Cookies.get('pastureid'),
-          ftid: '@insertSpotList.id'
-        }}
-        this.requestParam.data[1] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.formulaDistribution.pasture.checkedList }}
-        this.requestParam.data[1].children = []
-        this.requestParam.data[1].children[0] = { 'name': 'deleteFTissue', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          groupsid: Cookies.get('pastureid')
-        }}
-        this.requestParam.data[1].children[1] = { 'name': 'insertfeedtempletISS', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          groupsid: Cookies.get('pastureid')
-        }}
-        this.requestParam.data[1].children[2] = { 'name': 'insertftdetailISS', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          groupsid: Cookies.get('pastureid')
-        }}
-        this.requestParam.data[1].children[3] = { 'name': 'insertfeedtemplet_pastureISS', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          pasturename: '@insertSpotList2.pasturename',
-          groupsid: Cookies.get('pastureid')
-        }}
-        this.requestParam.data[1].children[4] = { 'name': 'deleteFeedissue', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          groupsid: Cookies.get('pastureid')
-        }}
-
-        this.requestParam.data[1].children[5] = { 'name': 'insertFeedissue', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          groupsid: Cookies.get('pastureid')
-        }}
-        this.requestParam.data[1].children[6] = { 'name': 'insertFeednurissue', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList2.id',
-          groupsid: Cookies.get('pastureid')
-        }}
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('配方下发保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-            this.formulaDistribution.dialogFormVisible = false
-            this.formulaDistribution.pasture.dialogFormVisible = false
-            this.getList()
-          }
-        })
-      }
-    },
-
-    // 查看
-    handleSee(row) {
-      this.see.dialogStatus = 'see'
-      this.see.dialogFormVisible = true
-      this.see.temp = Object.assign({}, row)
-      this.see.activeName = 'first'
-      this.see.tab1.table.list = []
-      this.formulaDistribution.pasture.list = []
-      this.see.tab2.date.list = []
-      this.getSeeTab1List()
-      this.getPastureList()
-      this.getSeeTab2DateList()
-    },
-    getSeeTab1List() {
-      this.see.tab1.table.listLoading = true
-      this.see.tab1.table.getdataListParm.parammaps.ftid = this.see.temp.id
-      this.see.tab1.table.getdataListParm.parammaps.pastureid = this.see.temp.pastureid
-      GetDataByName(this.see.tab1.table.getdataListParm).then(response => {
-        console.log('下发记录数据', response.data.list)
-        if (response.data.list !== null) {
-          this.see.tab1.table.list = response.data.list
-          this.see.tab1.table.pageNum = response.data.pageNum
-          this.see.tab1.table.pageSize = response.data.pageSize
-          this.see.tab1.table.total = response.data.total
-        } else {
-          this.see.tab1.table.list = []
-        }
-        setTimeout(() => {
-          this.see.tab1.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSeeTab1Search() {
-      this.getSeeTab1List()
-    },
-    getSeeTab2List() {
-      this.see.tab2.table.listLoading = true
-      this.see.tab2.table.getdataListParm.parammaps.ftid = this.see.temp.id
-      const url = 'authdata/GetArrList'
-      const data = this.see.tab2.table.getdataListParm
-      postJson(url, data).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].arrList == null) {
-              this.$set(response.data.list[i], 'Disabled', false)
-              this.$set(response.data.list[i], 'arrList', [])
-            } else {
-              if (response.data.list[i].arrList.length > 0) {
-                for (let j = 0; j < response.data.list[i].arrList.length; j++) {
-                  if (response.data.list[i].arrList[j].nowweight == response.data.list[i].arrList[j].fweight) {
-                    this.$set(response.data.list[i].arrList[j], 'color', '#333')
-                  } else if (response.data.list[i].arrList[j].nowweight == -1) {
-                    console.log(response.data.list[i].arrList[j])
-                    this.$set(response.data.list[i].arrList[j], 'color', 'orange')
-                  } else if (response.data.list[i].arrList[j].nowweight !== response.data.list[i].arrList[j].fweight && parseFloat(response.data.list[i].arrList[j].nowweight) > 0) {
-                    this.$set(response.data.list[i].arrList[j], 'color', 'red')
-                  }
-                }
-              }
-            }
-          }
-          this.see.tab2.table.list = response.data.list
-          if (response.data.total) {
-            this.see.tab2.table.total = response.data.total
-          }
-        } else {
-          this.see.tab2.table.list = []
-        }
-        setTimeout(() => {
-          this.see.tab2.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSeeTab2Search() {
-      if (this.see.tab2.table.getdataListParm.parammaps.date == '') {
-        this.see.tab2.table.getdataListParm.parammaps.date = this.see.tab2.date.list[0].date
-      }
-      this.see.tab2.table.list = []
-      this.getSeeTab2List()
-    },
-    getSeeTab2DateList() {
-      this.see.tab2.date.getdataListParm.parammaps.ftid = this.see.temp.id
-      GetDataByName(this.see.tab2.date.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.see.tab2.date.list = response.data.list
-        } else {
-          this.see.tab2.table.list = []
-        }
-      })
-    },
-
-    dateSearch(queryString, cb) {
-      this.see.tab2.date.getdataListParm.parammaps['date'] = queryString
-      GetDataByName(this.see.tab2.date.getdataListParm).then(response => {
-        console.log('模糊查询搜索data', response.data.list)
-        if (response.data.list == null) {
-          cb([])
-        } else {
-          cb(response.data.list)
-        }
-      })
-    },
-    handleSelectDate(item) {
-      this.see.tab2.table.getdataListParm.parammaps.date = item.date
-    },
-    handleSeeTabClick() {
-      if (this.see.activeName == 'first') {
-        this.getSeeTab1List()
-      } else {
-        // this.see.tab2.table.getdataListParm.parammaps.date = this.see.tab2.date.list[0].date
-        this.getSeeTab2List()
-      }
-    },
-    handleSeeTab1RowClick(row) {
-      console.log(row)
-      this.see.activeName = 'second'
-      this.see.tab2.table.getdataListParm.parammaps.date = row.date
-      this.getSeeTab2List()
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  .search { clear: both;margin-top:10px; }
-  .table { margin-top: 10px; }
-</style>

+ 15 - 40
src/views/formulationPlan/materialIssuancePlan/historyRecord.vue

@@ -71,48 +71,18 @@
             <el-switch v-model="scope.row.issplit" :disabled="scope.row.NoEdit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" disabled />
           </template>
         </el-table-column>
-        <el-table-column label="撒料" width="950px" align="center">
+        <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
           <template slot-scope="scope">
-            <draggable id="2" data-source="juju" :list="scope.row.arrList" class="list-group2" draggable=".item" group="a" :move="move2" @change="changeLog2(scope.row)" @start="start2" @end="end2(scope.row)">
-              <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item">
-                <div class="arr-l">
-                  <div class="arr-l-t">
-                    <div class="arr-l-t-t" />
-                    <el-select v-model="element.tmrid" placeholder="撒料设备" class="arr-l-t-b el-icon-arrow-down" @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}">
-                      <el-option v-for="item in equipmentList" :key="item.id" :label="item.tmrmix" :value="item.id" />
-                    </el-select>
-                  </div>
-                  <div class="arr-l-b">
-                    <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
-                      <div slot="content">{{ element.tmrname }}</div>
-                      <div class="tmrname">{{ element.tmrname }}</div>
-                    </el-tooltip>
-                  </div>
+            <div v-for="element in scope.row.arrList" :key="element.name" class="list">
+              <el-tooltip placement="top" :open-delay="1000">
+                <div slot="content">
+                  <div> 栏舍全称:{{ element.barname }} </div>
+                  <div> 饲料重量:{{ element.weight }} </div>
+                  <!-- <div> 撒料车:{{ element.tmrname }} </div> -->
                 </div>
-                <div class="arr-r">
-                  <div class="arr-r-l">
-                    <el-tooltip placement="top">
-                      <div slot="content">{{ element.barname }}</div>
-                      <div class="barname">{{ element.barname }}</div>
-                    </el-tooltip>
-                  </div>
-                  <div class="arr-r-c">-</div>
-                  <div class="arr-r-r">
-                    <el-tooltip v-show="!element.isWeight" placement="top">
-                      <div slot="content">{{ element.weight }}</div>
-                      <div class="weight" @dblclick="dbclickWeight(element)">{{ element.weight }}</div>
-                    </el-tooltip>
-                    <el-tooltip v-show="element.isWeight" placement="top">
-                      <div slot="content">{{ element.weight }}</div>
-                      <input ref="weight" v-model="element.weight" v-focus="element.focusState" type="number" placeholder="重量" step="0.01" class="filter-item2" style="display: inline-block;height:16px;padding:4px 0px; font-size:12px;width: 95%;border: 1px solid #e6e6e6;" @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}">
-                    </el-tooltip>
-                  </div>
-                </div>
-                <div class="arr-t" :style="{'background':element.background}">
-                  <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element,scope.row)" />
-                </div>
-              </div>
-            </draggable>
+                <div :style="{'background':element.background}" class="tmrname">{{ element.barname }}</div>
+              </el-tooltip>
+            </div>
           </template>
         </el-table-column>
       </el-table>
@@ -208,4 +178,9 @@ export default {
 
 <style  lang="scss" scoped>
  .search{margin-bottom: 10px;}
+ .list{width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
+    .tmrname{
+      width:100%;padding: 5px 5px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+    }
+ }
 </style>

+ 0 - 2875
src/views/formulationPlan/materialIssuancePlan/index - 副本.vue

@@ -1,2875 +0,0 @@
-<template>
-  <div v-loading="fullscreenLoading" element-loading-text="给我一点时间" class="app-container">
-    <div class="menuList">
-      <div class="menuList-t">
-        <div class="menuList-t-l">
-          <span>班次:</span>
-          <el-radio-group v-model="menuRadio" size="small" @change="changeMenu">
-            <el-radio-button v-if="maxTime.isTime1" label="一班">一班</el-radio-button>
-            <el-radio-button v-if="maxTime.isTime2" label="二班">二班</el-radio-button>
-            <el-radio-button v-if="maxTime.isTime3" label="三班">三班</el-radio-button>
-            <el-radio-button v-if="maxTime.isTime4" label="四班">四班</el-radio-button>
-          </el-radio-group>
-        </div>
-        <div class="menuList-t-r">
-          <div v-if="!isBarracks" class="menuList-t-r-l" @click="clickBarracks(2);">栏舍计划统计-展开<i
-            class="el-icon-arrow-down"
-          /></div>
-          <div v-if="isBarracks" class="menuList-t-r-r" @click="clickBarracks(1);">栏舍计划统计-收起<i
-            class="el-icon-arrow-up"
-          /></div>
-          <div v-if="isBarracks" class="columnHouse">
-            <div class="smallTable">
-              <el-table
-                :list-loading="smallMenu.listLoading"
-                element-loading-text="给我一点时间"
-                :data="smallMenu.list"
-                :row-style="rowStyle2"
-                :cell-style="cellStyle2"
-                :header-row-style="headerRowStyle2"
-                :header-cell-style="headerCellStyle2"
-                show-summary
-                sum-text="总栏舍"
-                class="elTable"
-              >
-                <el-table-column label="配方/班次" min-width="80px" align="center" prop="tname" />
-                <el-table-column label="总数" min-width="50px" align="center" prop="usedsum" />
-                <el-table-column
-                  v-if="maxTime.isTime1"
-                  label="第一班未分配"
-                  min-width="105px"
-                  align="center"
-                  prop="onetime"
-                />
-                <el-table-column
-                  v-if="maxTime.isTime2"
-                  label="第二班未分配"
-                  min-width="105px"
-                  align="center"
-                  prop="twotime"
-                />
-                <el-table-column
-                  v-if="maxTime.isTime3"
-                  label="第三班未分配"
-                  min-width="105px"
-                  align="center"
-                  prop="threetime"
-                />
-                <el-table-column
-                  v-if="maxTime.isTime4"
-                  label="第四班未分配"
-                  min-width="105px"
-                  align="center"
-                  prop="fourtime"
-                />
-              </el-table>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="menuList-b">
-        <ul v-loading="listLoadingTimes" class="draggableList">
-          <li v-for="element in MenuList" :key="element.arrid">
-            <span v-if="element.isShowTitle" class="draggableTitle">{{ element.ftname }}:</span>
-            <draggable
-              v-if="dropState== false && isRoleEdit"
-              id="1"
-              data-source="juju1"
-              :list="element.arrList"
-              class="list-group1"
-              draggable=".item"
-              group="a"
-              animation="500"
-              force-fallback="true"
-              :move="move"
-              @change="changeLog"
-              @start="start"
-              @end="end"
-            >
-              <div
-                v-for="item in element.arrList"
-                id="item1"
-                :key="item.id"
-                class="list-group-item1 item"
-                style="width: 88px;float: left;margin:5px 5px;height: 36px;"
-              >
-                <div style="position: relative;">
-                  <el-tooltip
-                    placement="top"
-                    style="height: 18px;line-height: 18px;"
-                    :style="{'background':item.background}"
-                  >
-                    <div slot="content">{{ item.barname }}</div>
-                    <div class="draggableName not-select">{{ item.barname }}</div>
-                  </el-tooltip>
-                  <div class="draggableWeight not-select" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
-                    <!-- <span v-if="item.isfill==1" style="background: #009C69;color:#fff;position: absolute;left: 0;top: 0;">补</span> -->
-                    {{ item.weight }}
-                  </div>
-                </div>
-              </div>
-            </draggable>
-            <div
-              v-else
-              id="1"
-              data-source="juju1"
-              :list="element.arrList"
-              class="list-group1"
-              draggable=".item"
-              group="a"
-              animation="500"
-              force-fallback="true"
-              :move="move"
-              @change="changeLog"
-              @start="start"
-              @end="end"
-            >
-              <div
-                v-for="item in element.arrList"
-                :key="item.id"
-                class="list-group-item1 item"
-                style="width: 88px;float: left;margin:5px 5px;height: 36px;"
-              >
-                <div style="position: relative">
-                  <el-tooltip
-                    placement="top"
-                    style="height: 18px;line-height: 18px;"
-                    :style="{'background':item.background}"
-                  >
-                    <div slot="content">{{ item.barname }}</div>
-                    <div class="draggableName not-select">{{ item.barname }}</div>
-                  </el-tooltip>
-                  <div class="draggableWeight not-select" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
-                    {{ item.weight }} </div>
-                  <!-- <span v-if="item.isfill==1" style="background: #009C69;color:#fff;position: absolute;left: 0;top: 18px;">补</span> -->
-                </div>
-              </div>
-            </div>
-          </li>
-        </ul>
-      </div>
-    </div>
-    <div ref="list" class="list">
-      <div class="operation">
-        <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次
-        </el-button>
-        <el-button
-          v-if="isRoleEdit"
-          class="danger"
-          icon="el-icon-delete"
-          style="float:left;"
-          @click="handleReduceTrains"
-        >减少车次</el-button>
-        <el-button
-          v-if="isRoleEdit"
-          class="success"
-          icon="el-icon-download"
-          style="float:left;"
-          @click="handleAutomaticGeneration"
-        >自动生成</el-button>
-        <el-button
-          v-if="isOrder && isRoleEdit"
-          icon="el-icon-sort"
-          style="float: left;"
-          class="success"
-          @click="handleChangeOrder"
-        >更改顺序</el-button>
-        <div v-else style="float: left;margin-left: 10px;">
-          <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存
-          </el-button>
-          <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
-        </div>
-        <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">
-          生效</el-button>
-        <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">
-          禁用</el-button>
-        <el-button class="success" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录
-        </el-button>
-      </div>
-
-      <div class="table">
-        <el-table
-          id="table"
-          :key="table.tableKey"
-          ref="table"
-          v-loading="table.listLoading"
-          v-loadmore="loadMore"
-          element-loading-text="给我一点时间"
-          :data="table.list"
-          border
-          highlight-current-row
-          style="width: 100%;"
-          :height="height"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable"
-          row-key="id"
-          @selection-change="handleSelect"
-        >
-          <el-table-column type="selection" width="50" />
-          <el-table-column label="车次" width="80px" align="center" class-name="small-padding fixed-width" fixed="">
-            <template slot-scope="scope">
-              <span v-show="scope.row.NoEdit">{{ scope.row.sort }}</span>
-              <el-input
-                v-show="scope.row.Edit"
-                v-model="scope.row.sort"
-                type="number"
-                placeholder="车次"
-                class="filter-item"
-                style="display: inline-block;width: 95%;"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column
-            label="TMR编号"
-            width="110px"
-            align="center"
-            class-name="small-padding fixed-width"
-            fixed="left"
-          >
-            <template slot-scope="scope">
-              <span v-show="scope.row.NoEdit">{{ scope.row.tmrname }}</span>
-              <el-select
-                v-show="scope.row.Edit"
-                v-model="scope.row.tmrid"
-                placeholder="TMR编号"
-                class="filter-item"
-                style="width:95%;"
-                @change="(value)=> {changeTMRNumber(value, scope.row)}"
-              >
-                <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
-              </el-select>
-            </template>
-          </el-table-column>
-          <el-table-column label="描述" width="110px" align="center">
-            <template slot-scope="scope">
-              <span v-show="scope.row.NoEdit">{{ scope.row.display }}</span>
-              <el-input
-                v-show="scope.row.Edit"
-                v-model="scope.row.display"
-                type="textarea"
-                :autosize="{ minRows: 1.3, maxRows: 4}"
-                placeholder="描述"
-                maxlength="255"
-                class="filter-item"
-                style="display: inline-block;width: 95%;"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="生效" width="80px" align="center">
-            <template slot-scope="scope">
-              <el-switch
-                v-model="scope.row.sel"
-                :disabled="scope.row.NoEdit"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="1"
-                :inactive-value="0"
-                @change="handleTakeEffectChange(scope.$index, scope.row)"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="班次" width="100px" align="center">
-            <template slot-scope="scope">
-              <span v-show="scope.row.NoEdit">{{ scope.row.timesstr }}</span>
-              <el-select
-                v-show="scope.row.Edit"
-                v-model="scope.row.times"
-                :disabled="scope.row.Disabled"
-                placeholder="班次"
-                class="filter-item"
-                style="width:95%;"
-              >
-                <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </template>
-          </el-table-column>
-          <el-table-column label="时间" width="125px" align="center">
-            <template slot-scope="scope">
-              <span v-show="scope.row.NoEdit">{{ scope.row.begintime }}</span>
-              <el-time-picker
-                v-show="scope.row.Edit"
-                v-model="scope.row.begintime"
-                type="datetime"
-                placeholder="选择时间"
-                format="HH:mm"
-                value-format="HH:mm"
-                style="display: inline-block;width: 95%;"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="最大重量" width="75px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.maxweight }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="合计重量" width="80px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.sumweight }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="模板配方" width="120px" align="center">
-            <template slot-scope="scope">
-              <span v-show="scope.row.NoEdit">{{ scope.row.ftname }}</span>
-              <el-select
-                v-show="scope.row.Edit"
-                v-model="scope.row.ftid"
-                :disabled="scope.row.Disabled"
-                placeholder="模板配方"
-                class="filter-item"
-                style="width:95%;"
-                @change="(value)=> {changeTemplateFormulation(value, scope.row)}"
-              >
-                <el-option
-                  v-for="item in templateFormulationList"
-                  :key="item.id"
-                  :label="item.tname"
-                  :value="item.id"
-                />
-              </el-select>
-            </template>
-          </el-table-column>
-          <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="80px" align="center">
-            <template slot-scope="scope">
-              <el-switch
-                v-model="scope.row.issplit"
-                :disabled="scope.row.NoEdit"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="1"
-                :inactive-value="0"
-                @change="handleIssplitChange(scope.$index, scope.row)"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="撒料" width="950px" align="center">
-            <template slot-scope="scope">
-              <draggable
-                v-if="dropState== false && isRoleEdit"
-                id="2"
-                data-source="juju"
-                :list="scope.row.arrList"
-                class="list-group2"
-                draggable=".item"
-                group="a"
-                animation="500"
-                force-fallback="true"
-                :move="move2"
-                @change="changeLog2(scope.row)"
-                @start="start2"
-                @end="end2(scope.row)"
-              >
-                <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item">
-                  <div class="arr-l" :style="{'background':element.tbackground}">
-                    <div class="arr-l-t">
-                      <div class="arr-l-t-t" />
-                      <el-select
-                        v-model="element.tmrid"
-                        placeholder="撒料设备"
-                        class="arr-l-t-b el-icon-arrow-down"
-                        @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}"
-                      >
-                        <el-option
-                          v-for="item in equipmentList"
-                          :key="item.id"
-                          :disabled="table.myTemp.isUpdateSave"
-                          :label="item.tmrmix"
-                          :value="item.id"
-                        />
-                      </el-select>
-                    </div>
-                    <div class="arr-l-b">
-                      <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
-                        <div slot="content">{{ element.tmrname }}</div>
-                        <div class="tmrname">{{ element.tmrname }}</div>
-                      </el-tooltip>
-                    </div>
-                    <!-- <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div> -->
-                  </div>
-                  <div class="arr-r">
-                    <div class="arr-r-l">
-                      <el-tooltip placement="top">
-                        <div slot="content">{{ element.barname }}</div>
-                        <div class="barname">{{ element.barname }}</div>
-                      </el-tooltip>
-                    </div>
-                    <div class="arr-r-c">-</div>
-                    <div class="arr-r-r">
-                      <el-tooltip v-show="!element.isWeight" placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <div class="weight" @dblclick="dbclickWeight(element)">{{ element.weight }}</div>
-                      </el-tooltip>
-                      <el-tooltip v-show="element.isWeight && isRoleEdit" placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <input
-                          ref="weight"
-                          v-model="element.weight"
-                          v-focus="element.focusState"
-                          :disabled="table.myTemp.isUpdateSave"
-                          type="number"
-                          placeholder="重量"
-                          step="0.01"
-                          class="filter-item2"
-                          style="display: inline-block;height:25px;padding:4px 0px; font-size:12px;width: 95%;border: 1px solid #e6e6e6;"
-                          @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}"
-                        >
-                      </el-tooltip>
-                      <el-tooltip v-show="element.isWeight && isRoleEdit" placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <div class="weight" @dblclick="dbclickWeight(element)">{{ element.weight }}</div>
-                      </el-tooltip>
-                    </div>
-                  </div>
-                  <div class="arr-t" :style="{'background':element.background}">
-                    <i
-                      class="el-icon-close"
-                      style="position: absolute;right: 0;"
-                      @click="handleFLDelete(element,scope.row)"
-                    />
-                  </div>
-                </div>
-              </draggable>
-              <!-- <div v-else id="2" data-source="juju" :list="scope.row.arrList" class="list-group2" draggable=".item" group="a"> -->
-              <div v-else :list="scope.row.arrList" class="list-group2">
-                <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item">
-                  <div class="arr-l" :style="{'background':element.tbackground}">
-                    <div class="arr-l-t">
-                      <div class="arr-l-t-t" />
-                      <el-select
-                        v-model="element.tmrid"
-                        placeholder="撒料设备"
-                        :disabled="!isRoleEdit"
-                        class="arr-l-t-b el-icon-arrow-down"
-                        @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}"
-                      >
-                        <el-option
-                          v-for="item in equipmentList"
-                          :key="item.id"
-                          :disabled="table.myTemp.isUpdateSave"
-                          :label="item.tmrmix"
-                          :value="item.id"
-                        />
-                      </el-select>
-                    </div>
-                    <div class="arr-l-b">
-                      <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
-                        <div slot="content">{{ element.tmrname }}</div>
-                        <div class="tmrname">{{ element.tmrname }}</div>
-                      </el-tooltip>
-                    </div>
-                    <!-- <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div> -->
-                  </div>
-                  <div class="arr-r">
-                    <div class="arr-r-l">
-                      <el-tooltip placement="top">
-                        <div slot="content">{{ element.barname }}</div>
-                        <div class="barname">{{ element.barname }}</div>
-                      </el-tooltip>
-                    </div>
-                    <div class="arr-r-c">-</div>
-                    <div class="arr-r-r">
-                      <el-tooltip v-show="!element.isWeight" placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <div class="weight" @dblclick="dbclickWeight(element)">{{ element.weight }}</div>
-                      </el-tooltip>
-                      <el-tooltip v-show="element.isWeight && isRoleEdit" placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <input
-                          ref="weight"
-                          v-model="element.weight"
-                          v-focus="element.focusState"
-                          type="number"
-                          placeholder="重量1"
-                          step="0.01"
-                          class="filter-item2"
-                          style="display: inline-block;height:25px;padding:4px 0px; font-size:12px;width: 95%;border: 1px solid #e6e6e6;"
-                          @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}"
-                        >
-                      </el-tooltip>
-                      <el-tooltip v-show="element.isWeight && !isRoleEdit" placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <div class="weight">{{ element.weight }}</div>
-                      </el-tooltip>
-                    </div>
-                  </div>
-                  <div class="arr-t" :style="{'background':element.background}">
-                    <i
-                      v-if="isRoleEdit"
-                      class="el-icon-close"
-                      style="position: absolute;right: 0;"
-                      @click="handleFLDelete(element,scope.row)"
-                    />
-                  </div>
-                </div>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
-            <template slot-scope="{row}">
-              <el-button
-                v-if="row.isCreate && isRoleEdit"
-                :disabled="isokDisable"
-                icon="el-icon-folder-checked"
-                class="miniSuccess"
-                @click="createData(row)"
-              />
-              <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-              <el-button
-                v-if="row.isCreate && isRoleEdit"
-                class="minCancel"
-                icon="el-icon-close"
-                @click="createCancel(row)"
-              />
-              <el-button
-                v-if="row.isUpdate && isRoleEdit"
-                class="miniSuccess"
-                icon="el-icon-edit-outline"
-                @click="handleUpdate(row)"
-              />
-              <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-              <el-button
-                v-if="row.isUpdate && isRoleEdit"
-                class="miniDanger"
-                icon="el-icon-delete"
-                @click="handleRowDelete(row)"
-              />
-              <el-button
-                v-if="row.isUpdateSave && isRoleEdit"
-                :disabled="isokDisable"
-                icon="el-icon-folder-checked"
-                class="miniSuccess"
-                @click="updateData(row)"
-              />
-              <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-              <el-button
-                v-if="row.isUpdateSave && isRoleEdit"
-                class="minCancel"
-                icon="el-icon-close"
-                @click="updateCancel(row)"
-              />
-            </template>
-          </el-table-column>
-        </el-table>
-        <span
-          v-if="table.listLoading == false"
-          style="margin-right: 30px;margin-top: 10px;font-size: 14px;"
-        >共{{ table.total }}条</span>
-      </div>
-
-      <!-- 自动生成 -->
-      <el-dialog
-        :fullscreen="dialogFull"
-        :destroy-on-close="true"
-        :visible.sync="automaticGeneration.dialogFormVisible"
-        :close-on-click-modal="false"
-        width="30%"
-      >
-        <template slot="title">
-          <div class="avue-crud__dialog__header">
-            <span class="el-dialog__title">
-              <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-              {{ textMap[automaticGeneration.dialogStatus] }}
-            </span>
-            <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-              <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-              <svg-icon v-else icon-class="fullscreen" />
-            </div>
-          </div>
-        </template>
-        <div class="app-automaticGeneration" style="margin: 0 auto;">
-          <div style="width: 210px;margin:60px auto 120px;font-weight: 16px;">
-            请选择自动生成方式:<br>
-            清空计划并生成新计划;<br>
-            当前计划基础上继续生成计划;<br>
-          </div>
-          <div slot="footer" class="dialog-footer">
-            <el-button
-              style="right:240px;"
-              class="cancelClose"
-              @click="automaticGeneration.dialogFormVisible = false; "
-            >关闭</el-button>
-            <el-button style="right:130px;" class="save" :disabled="isokDisable" @click="continueData(0)">继续生成
-            </el-button>
-            <el-button style="right:20px;" class="save" :disabled="isokDisable" @click="continueData(1)">重新生成
-            </el-button>
-          </div>
-        </div>
-      </el-dialog>
-      <!-- 历史记录 -->
-      <el-dialog
-        :fullscreen="dialogFull"
-        :destroy-on-close="true"
-        :visible.sync="historyRecord.dialogFormVisible"
-        :close-on-click-modal="false"
-        width="90%"
-      >
-        <template slot="title">
-          <div class="avue-crud__dialog__header">
-            <span class="el-dialog__title">
-              <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-              {{ textMap[historyRecord.dialogStatus] }}
-            </span>
-            <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-              <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-              <svg-icon v-else icon-class="fullscreen" />
-            </div>
-          </div>
-        </template>
-        <div class="historyRecord">
-          <keep-alive>
-            <component :is="historyRecord.myComponent" ref="historyRecord" />
-          </keep-alive>
-        </div>
-        <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
-        </div>
-      </el-dialog>
-    </div>
-
-  </div>
-  </div>
-</template>
-
-<script>
-import {
-  GetDataByName,
-  postJson,
-  PostDataByName,
-  Autogeneration,
-  ExecDataByConfig,
-  checkButtons
-} from '@/api/common'
-import draggable from 'vuedraggable'
-import Sortable from 'sortablejs'
-import Cookies from 'js-cookie'
-import {
-  MessageBox
-} from 'element-ui'
-  // const id = 1
-export default {
-  inject: ['reload'],
-  name: 'MaterialIssuancePlan',
-  display: 'Two list header slot',
-  order: 14,
-  components: {
-    draggable
-  },
-  directives: {
-    focus: {
-      update: function(el, {
-        value
-      }) {
-        if (value) {
-          el.focus()
-        }
-      }
-    }
-  },
-  data() {
-    return {
-      pagindex: 1, // 页码
-      pagesize: 300, // 页/条数
-      pagetotal: 0, // 一共要请求的次数
-      intertimer: null, // 定时器
-      dialogFull: false,
-      isRoleEdit: [],
-      isInforvalue: false,
-      isBarracks: false,
-      requestParams: {
-        name: 'getTMRListEnableType',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
-        }
-      },
-      requestParams2: {
-        name: 'getTMRListEnableTypeAll',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
-        }
-      },
-      requestParams3: {
-        name: 'getFTSWList',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid')
-        }
-      },
-      requestParams4: {
-        name: 'getSysoptEnable',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          inforname: 'isSmallMaterial'
-        }
-      },
-      equipmentList: [], // 撒料设备
-      TMRNumberList: [], // TMR编号
-      frequencyList: [], // 班次
-      templateFormulationList: [], // 模板配方
-
-      // 班次
-      maxTime: {
-        getMaxTimesParm: {
-          name: 'getSysoptEnable',
-          page: 1,
-          offset: 1,
-          pagecount: 1,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inforname: 'times'
-          }
-        },
-        // 班次
-        isTime1: false,
-        isTime2: false,
-        isTime3: false,
-        isTime4: false
-      },
-
-      table: {
-        getdataListParm: {
-          name: 'getLppList',
-          name1: 'getLppdList',
-          page: 1,
-          offset: 1,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        list: [],
-        list2: [],
-        total: 0,
-        tableKey: 0,
-        listLoading: false,
-        tabClickIndex: null, // 点击的单元格
-        tabClickLabel: '', // 当前点击的列名
-        temp: {},
-        move1: '',
-        changeList: [],
-        startObj: {},
-        isGoing: false,
-        myTemp: {}
-      },
-      selectList: [], // 选中数据
-
-      // 班次
-      menuRadio: '一班',
-      MenuList: [], // 配单列表
-      listLoadingTimes: false,
-
-      // 栏舍统计
-      isLeftButton: true, // 向左
-      isRightButton: false, // 向右
-      rowStyle2: {
-        maxHeight: 20 + 'px',
-        height: 20 + 'px'
-      },
-      cellStyle2: {
-        padding: 0 + 'px'
-      },
-      headerRowStyle2: {
-        maxHeight: 20 + 'px',
-        height: 20 + 'px'
-      },
-      headerCellStyle2: {
-        padding: 0 + 'px'
-      },
-      smallMenu: {
-        getdataListParm: {
-          name: 'getLppUseSUMList',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        total: 0,
-        tableKey: 0,
-        listLoading: false,
-        list: []
-      },
-      // 自动生成
-      automaticGeneration: {
-        dialogFormVisible: false,
-        dialogStatus: ''
-      },
-      historyRecord: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        myComponent: null
-      },
-      textMap: {
-        automaticGeneration: '提示',
-        historyRecord: '历史记录'
-      },
-
-      isokDisable: false,
-      requestParam: {},
-      height: document.body.clientHeight - 350 - 50, // table高度
-      rowStyle: {
-        maxHeight: 50 + 'px',
-        height: 50 + 'px'
-      },
-      cellStyle: {
-        padding: 0 + 'px'
-      },
-      dropState: false,
-      isOrder: true,
-      fullscreenLoading: false,
-      getdataListParmAll: {
-        page: 1,
-        offset: 1,
-        pagecount: 0,
-        returntype: 'Map',
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          times: '1',
-          refresh: 0
-        }
-      }
-    }
-  },
-  doLayout() {
-    this.$nextTick(() => {
-      this.$refs.table.doLayout()
-    })
-  },
-  created() {
-    this.getButtons()
-    this.getIsDisplay()
-    this.getDownList()
-    this.table.list.forEach(val => {
-
-    })
-  },
-  methods: {
-    getButtons() {
-      const Edit = 'MaterialIssuancePlan'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    clickBarracks(item) {
-      this.isBarracks = !this.isBarracks
-    },
-    // 下拉列表
-    getDownList() {
-      GetDataByName(this.requestParams).then(response => {
-        if (response.data !== null) {
-          this.TMRNumberList = response.data.list
-        } else {
-          this.TMRNumberList = []
-        }
-      })
-      GetDataByName(this.requestParams2).then(response => {
-        if (response.data !== null) {
-          this.equipmentList = response.data.list
-        } else {
-          this.equipmentList = []
-        }
-      })
-      GetDataByName(this.requestParams3).then(response => {
-        if (response.data !== null) {
-          this.templateFormulationList = response.data.list
-        } else {
-          this.templateFormulationList = []
-        }
-      })
-      GetDataByName(this.requestParams4).then(response => {
-        if (response.data !== null) {
-          if (response.data.list[0].inforvalue == 0) {
-            this.isInforvalue = false
-          } else {
-            this.isInforvalue = true
-          }
-        } else {
-          this.isInforvalue = false
-        }
-      })
-    },
-
-    // 显示班次
-    getIsDisplay() {
-      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
-        console.log(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: '第四班'
-          }]
-        }
-        if (response.data.list !== null) {
-          if (response.data.list[0].inforvalue == 1) {
-            this.maxTime.isTime1 = true
-            this.maxTime.isTime2 = false
-            this.maxTime.isTime3 = false
-            this.maxTime.isTime4 = false
-          } else if (response.data.list[0].inforvalue == 2) {
-            this.maxTime.isTime1 = true
-            this.maxTime.isTime2 = true
-            this.maxTime.isTime3 = false
-            this.maxTime.isTime4 = false
-          } else if (response.data.list[0].inforvalue == 3) {
-            this.maxTime.isTime1 = true
-            this.maxTime.isTime2 = true
-            this.maxTime.isTime3 = true
-            this.maxTime.isTime4 = false
-          } else if (response.data.list[0].inforvalue == 4) {
-            this.maxTime.isTime1 = true
-            this.maxTime.isTime2 = true
-            this.maxTime.isTime3 = true
-            this.maxTime.isTime4 = true
-          }
-        } else {
-          this.maxTime.isTime1 = false
-          this.maxTime.isTime2 = false
-          this.maxTime.isTime3 = false
-          this.maxTime.isTime4 = false
-        }
-      })
-      this.getSmallMenuList() // 栏舍统计
-      this.getdataListParmAll.parammaps.refresh = 0
-      this.getAllList() // 头部跟表格
-    },
-    getAllList() {
-      const url = 'authdata/spillage'
-      const data = this.getdataListParmAll
-      postJson(url, data).then(response => {
-        console.log(response)
-        if (response.data.ftlist !== undefined) {
-          if (response.data.ftlist !== null) {
-            for (let i = 0; i < response.data.ftlist.length; i++) {
-              this.$set(response.data.ftlist[i], 'isShowTitle', true)
-              if (response.data.ftlist[i].arrList == null) {
-                this.$set(response.data.ftlist[i], 'isShowTitle', false)
-              } else {
-                for (let j = 0; j < response.data.ftlist[i].arrList.length; j++) {
-                  this.$set(response.data.ftlist[i].arrList[j], 'background2', this.colorRgb(response.data.ftlist[
-                    i].arrList[j].background))
-                }
-              }
-            }
-            this.MenuList = response.data.ftlist
-          } else {
-            this.MenuList = []
-          }
-        }
-        if (response.data.list !== undefined) {
-          if (response.data.list !== null) {
-            console.log('table数据', response.data.list)
-            for (let i = 0; i < response.data.list.length; i++) {
-              this.$set(response.data.list[i], 'Edit', false) // 编辑
-              this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
-              this.$set(response.data.list[i], 'isCreate', false) // 新增操作
-              this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
-              this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
-              this.$set(response.data.list[i], 'Disabled', true) // 班次/模板配方不可输入
-              if (response.data.list[i].arrList == null) {
-                this.$set(response.data.list[i], 'Disabled', false)
-                this.$set(response.data.list[i], 'arrList', [])
-              } else {
-                for (let j = 0; j < response.data.list[i].arrList.length; j++) {
-                  this.$set(response.data.list[i].arrList[j], 'isWeight', false)
-                  this.$set(response.data.list[i].arrList[j], 'focusState', false)
-                }
-              }
-            }
-            // this.table.list = response.data.list
-            var arr = []
-            for (let a = 0; a < response.data.list.length; a++) {
-              if (a < 5) {
-                arr.push(response.data.list[a])
-              }
-              // response.data.list.splice(5, response.data.list.length - 1)
-            }
-            this.table.list = arr
-            this.table.list2 = response.data.list
-            console.log(this.table.list2, 'this.table.list2 ')
-            this.table.changeList = []
-            this.table.startObj = {}
-            this.table.total = response.data.list.length
-            setTimeout(() => {
-              this.$refs.table.doLayout()
-            }, 100)
-            this.getPageInter(this.table.list2)
-          } else {
-            this.table.list = []
-          }
-        }
-        // this.listLoadingTimes = false
-        // this.table.listLoading = false
-      })
-    },
-    loadMore() {
-      this.getPageInter(this.table.list2)
-    },
-    getPageInter(map) {
-      this.intertimer = setInterval(() => {
-        this.intervalData(map) // 每三秒调用一次方法
-      }, 1000)
-    },
-    intervalData(map) {
-      if (this.pagindex * 5 < this.table.total) {
-        this.pagindex += 1
-        const arr = []
-        for (let i = 0; i < map.length; i++) {
-          if (i < this.pagindex * 5) {
-            arr.push(map[i])
-          }
-        }
-        this.table.list = arr
-      } else {
-        clearInterval(this.intertimer)
-      }
-      console.log(123)
-    },
-    colorRgb(sColor) {
-      sColor = sColor.toLowerCase()
-      var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
-      // 如果是16进制颜色
-      if (sColor && reg.test(sColor)) {
-        if (sColor.length === 4) {
-          var sColorNew = '#'
-          for (var i = 1; i < 4; i += 1) {
-            sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
-          }
-          sColor = sColorNew
-        }
-        // 处理六位的颜色值
-        var sColorChange = []
-        for (var i = 1; i < 7; i += 2) {
-          sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
-        }
-        return sColorChange.join(',')
-      }
-      return 'rgba(' + sColorChange.join(',') + ')'
-    },
-    // 切换班次
-    changeMenu(val) {
-      console.log(val)
-      if (this.menuRadio === '一班') {
-        this.getdataListParmAll.parammaps.times = '1'
-        this.getdataListParmAll.parammaps.refresh = 2
-        this.pagindex = 1
-        this.getAllList()
-      } else if (this.menuRadio === '二班') {
-        this.getdataListParmAll.parammaps.times = '2'
-        this.getdataListParmAll.parammaps.refresh = 2
-        this.pagindex = 1
-        this.getAllList()
-        this.MenuList = this.twoMenuList
-      } else if (this.menuRadio === '三班') {
-        this.getdataListParmAll.parammaps.times = '3'
-        this.getdataListParmAll.parammaps.refresh = 2
-        this.getAllList()
-      } else if (this.menuRadio === '四班') {
-        this.getdataListParmAll.parammaps.times = '4'
-        this.getdataListParmAll.parammaps.refresh = 2
-        this.pagindex = 1
-        this.getAllList()
-      }
-    },
-    // 右侧栏舍统计
-    getSmallMenuList() {
-      this.smallMenu.listLoading = true
-      GetDataByName(this.smallMenu.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].onetime == undefined) {
-              this.$set(response.data.list[i], 'onetime', 0)
-            } else {
-              response.data.list[i].onetime = parseFloat(response.data.list[i].onetime)
-            }
-            if (response.data.list[i].twotime == undefined) {
-              this.$set(response.data.list[i], 'twotime', 0)
-            } else {
-              response.data.list[i].twotime = parseFloat(response.data.list[i].twotime)
-            }
-            if (response.data.list[i].threetime == undefined) {
-              this.$set(response.data.list[i], 'threetime', 0)
-            } else {
-              response.data.list[i].threetime = parseFloat(response.data.list[i].threetime)
-            }
-            if (response.data.list[i].fourtime == undefined) {
-              this.$set(response.data.list[i], 'fourtime', 0)
-            } else {
-              response.data.list[i].fourtime = parseFloat(response.data.list[i].fourtime)
-            }
-            this.$set(response.data.list[i], 'usedsum', response.data.list[i].onetime + response.data.list[i]
-              .twotime + response.data.list[i].threetime + response.data.list[i].fourtime)
-            this.$set(response.data.list[i], 'all', '')
-          }
-          this.smallMenu.list = response.data.list
-          this.smallMenu.total = response.data.total
-        } else {
-          this.smallMenu.list = []
-        }
-        console.log('smallMenu数据', response.data.list)
-
-        setTimeout(() => {
-          this.smallMenu.listLoading = false
-        }, 100)
-      })
-    },
-    handleChangeOrder() {
-      this.isOrder = false
-      this.rowDrop()
-    },
-    // 行拖拽
-    rowDrop() {
-      console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
-      const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
-      const that = this
-      var sortable = Sortable.create(tbody, {
-        disabled: that.dropState,
-        onChoose({
-          newIndex,
-          oldIndex
-        }) {
-          console.log(that.isOrder, 'that.isOrder == false')
-          console.log(that.dropState, 'that.dropState')
-          if (that.dropState == true || that.isOrder == true) {
-            sortable.destroy()
-          }
-        },
-        onEnd({
-          newIndex,
-          oldIndex
-        }) {
-          const currRow = that.table.list.splice(oldIndex, 1)[0]
-          that.table.list.splice(newIndex, 0, currRow)
-          console.log('索引', newIndex)
-          console.log('拖动数据', currRow)
-          console.log('上', that.table.list[newIndex - 1])
-          console.log('下', that.table.list[newIndex + 1])
-        }
-      })
-    },
-    saveChangeOrder() {
-      // 保存顺序
-      var sortArr = []
-      for (let i = 0; i < this.table.list.length; i++) {
-        var obj = {}
-        obj.sort = i + 1
-        obj.id = this.table.list[i].id
-        obj.pastureid = this.table.list[i].pastureid
-        sortArr.push(obj)
-      }
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'insertSpotList',
-        'resultmaps': {
-          'list': sortArr
-        }
-      }
-      this.requestParam.data[0].children = []
-      this.requestParam.data[0].children[0] = {
-        'name': 'updateLppSort',
-        'type': 'e',
-        'parammaps': {
-          id: '@insertSpotList.id',
-          pastureid: '@insertSpotList.pastureid',
-          sort: '@insertSpotList.sort'
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('顺序切换保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({
-            title: '顺序切换失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-        } else {
-          this.$notify({
-            title: '',
-            message: '顺序切换成功',
-            type: 'success',
-            duration: 2000
-          })
-          this.getdataListParmAll.parammaps.refresh = 1
-          this.pagindex = 1
-          this.getAllList()
-          this.isOrder = true
-        }
-      })
-    },
-    cancelChangeOrder() {
-      // 取消顺序
-      this.getdataListParmAll.parammaps.refresh = 1
-      this.pagindex = 1
-      this.getAllList()
-      this.isOrder = true
-    },
-    // TMR编号
-    changeTMRNumber(item, row) {
-      row.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
-      row.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
-    },
-    // 配方模板
-    changeTemplateFormulation(item, row) {
-      row.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
-    },
-    // 增加车次
-    handleCreate() {
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (this.table.list2[i].Edit === true) {
-          this.$message({
-            type: 'error',
-            message: '当前内容未保存,请点击取消或保存继续进行操作',
-            duration: 2000
-          })
-          return false
-        }
-      }
-      if (this.table.list.length == 0) {
-        this.table.list.unshift({
-          'myId': (new Date()).valueOf(),
-          'Edit': true,
-          'NoEdit': false,
-          'isCreate': true,
-          'isUpdate': false,
-          'isUpdateSave': false,
-          'tmrname': '',
-          'tmrid': '',
-          'sort': 1,
-          'sel': 1,
-          'issplit': 1,
-          'times': '',
-          'display': '',
-          'begintime': '',
-          'ftname': '',
-          'ftid': '',
-          'sumweight': '',
-          'sumcowcount': '',
-          'maxweight': '',
-          'arrList': []
-        })
-      } else {
-        this.table.list.unshift({
-          'myId': (new Date()).valueOf(),
-          'Edit': true,
-          'NoEdit': false,
-          'isCreate': true,
-          'isUpdate': false,
-          'isUpdateSave': false,
-          'tmrname': '',
-          'tmrid': '',
-          'sort': parseInt(this.table.list2[this.table.list2.length - 1].sort) + 1,
-          'sel': 1,
-          'issplit': 1,
-          'times': '',
-          'display': '',
-          'begintime': '',
-          'ftname': '',
-          'ftid': '',
-          'sumweight': '',
-          'sumcowcount': '',
-          'maxweight': '',
-          'arrList': []
-        })
-      }
-      // this.$refs.box.scrollTop = 0
-      this.$refs.table.bodyWrapper.scrollTop = 0
-      this.dropState = true
-      console.log('点击了新增')
-    },
-    createData(row) {
-      console.log('点击了新增保存', row)
-      if (row.begintime == null || row.begintime == 'null') {
-        row.begintime = ''
-      }
-      this.table.temp.pastureid = Cookies.get('pastureid')
-      this.table.temp.tmrname = row.tmrname
-      this.table.temp.tmrid = row.tmrid
-      this.table.temp.sort = row.sort
-      this.table.temp.sel = row.sel
-      this.table.temp.issplit = row.issplit
-      this.table.temp.times = row.times
-      this.table.temp.display = row.display
-      this.table.temp.begintime = row.begintime
-      this.table.temp.ftname = row.ftname
-      this.table.temp.ftid = row.ftid
-      this.table.temp.sumweight = 0
-      this.table.temp.maxweight = row.maxweight
-
-      if (this.table.temp.sort == '' && this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp
-        .ftid == '') {
-        this.$message({
-          type: 'error',
-          message: '车次/TMR编号/班次/模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
-        this.$message({
-          type: 'error',
-          message: 'TMR编号/班次/模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.times == '' && this.table.temp.ftid == '') {
-        this.$message({
-          type: 'error',
-          message: '班次/模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.ftid == '') {
-        this.$message({
-          type: 'error',
-          message: '模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.times == '') {
-        this.$message({
-          type: 'error',
-          message: '班次不能为空',
-          duration: 2000
-        })
-        return false
-      }
-      for (let i = 0; i < this.table.list2.length; i++) {
-        if (row.sort == this.table.list2[i].sort) {
-          if (row.myId !== this.table.list2[i].myId) {
-            this.$message({
-              type: 'error',
-              message: '车次不可重复',
-              duration: 2000
-            })
-            return false
-          }
-        }
-      }
-      var isInteger = /^\d+$/
-      if (this.table.temp.sort !== '') {
-        if (!isInteger.test(parseFloat(this.table.temp.sort))) {
-          this.$message({
-            type: 'error',
-            message: '车次请输入整数',
-            duration: 2000
-          })
-          return false
-        }
-      }
-
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.name = 'insertLpp'
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({
-            title: '成功',
-            message: '保存成功',
-            type: 'success',
-            duration: 2000
-          })
-          this.getdataListParmAll.parammaps.refresh = 1
-          this.pagindex = 1
-          this.getAllList()
-          this.dropState = false
-        } else {
-          this.$notify({
-            title: '保存失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-        }
-      })
-    },
-    createCancel(row) {
-      this.dropState = false
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (row.myId === this.table.list[i].myId) {
-          var listIndex = this.table.list.indexOf(this.table.list[i])
-        }
-        if (listIndex > -1) {
-          this.table.list.splice(listIndex, 1)
-          this.table.list2.splice(listIndex, 1)
-          return
-        }
-      }
-      // for (let i = 0; i < this.table.list2.length; i++) {
-      //   if (row.myId === this.table.list2[i].myId) {
-      //     var listIndex2 = this.table.list2.indexOf(this.table.list2[i])
-      //   }
-      //   if (listIndex2 > -1) {
-      //     this.table.list2.splice(listIndex2, 1)
-      //     return
-      //   }
-      // }
-      console.log('点击了新增取消')
-    },
-
-    // 编辑
-    handleUpdate(row) {
-      console.log(row, '点击了行编辑')
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (this.table.list[i].Edit == true) {
-          this.$message({
-            type: 'error',
-            message: '当前内容未保存,请点击取消或保存继续进行操作',
-            duration: 2000
-          })
-          return false
-        }
-      }
-      // 编辑true,不可编辑false
-      row.Edit = true
-      row.NoEdit = false
-      // 新增false,编辑false,编辑保存true
-      row.isCreate = false
-      row.isUpdate = false
-      row.isUpdateSave = true
-      row.times = String(row.times)
-      if (row.sort == undefined) {
-        row.sort = ''
-      }
-      if (row.tmrid == undefined || row.tmrname == undefined) {
-        row.tmrid = ''
-        row.tmrname = ''
-      }
-      if (row.display == undefined) {
-        row.display = ''
-      }
-      if (row.times == undefined) {
-        row.times = ''
-      }
-      if (row.begintime == undefined) {
-        row.begintime = ''
-      }
-      if (row.ftid == undefined || row.ftname == undefined) {
-        row.ftid = ''
-        row.ftname = ''
-      }
-      this.dropState = true
-      this.table.myTemp = Object.assign({}, row)
-    },
-    updateData(row) {
-      console.log('点击了编辑保存', row)
-      this.table.myTemp = Object.assign({}, row)
-      if (row.begintime == null || row.begintime == 'null') {
-        row.begintime = ''
-      }
-      this.table.temp.pastureid = row.pastureid
-      this.table.temp.id = row.id
-      this.table.temp.tmrname = row.tmrname
-      this.table.temp.tmrid = row.tmrid
-      this.table.temp.sort = row.sort
-      this.table.temp.sel = row.sel
-      this.table.temp.issplit = row.issplit
-      this.table.temp.times = row.times
-      this.table.temp.display = row.display
-      this.table.temp.begintime = row.begintime
-      this.table.temp.ftname = row.ftname
-      this.table.temp.ftid = row.ftid
-      this.table.temp.sumweight = row.sumweight
-      this.table.temp.sumcowcount = row.sumcowcount
-      this.table.temp.maxweight = row.maxweight
-      if (this.table.temp.sort == '' && this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp
-        .ftid == '') {
-        this.$message({
-          type: 'error',
-          message: '车次/TMR编号/班次/模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
-        this.$message({
-          type: 'error',
-          message: 'TMR编号/班次/模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.times == '' && this.table.temp.ftid == '') {
-        this.$message({
-          type: 'error',
-          message: '班次/模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      } else if (this.table.temp.ftid == '') {
-        this.$message({
-          type: 'error',
-          message: '模板配方不能为空',
-          duration: 2000
-        })
-        return false
-      }
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (row.sort == this.table.list[i].sort) {
-          if (row.id !== this.table.list[i].id) {
-            this.$message({
-              type: 'error',
-              message: '车次不可重复',
-              duration: 2000
-            })
-            return false
-          }
-        }
-      }
-      var isInteger = /^\d+$/
-      if (this.table.temp.sort !== '') {
-        if (!isInteger.test(parseFloat(this.table.temp.sort))) {
-          this.$message({
-            type: 'error',
-            message: '车次请输入整数',
-            duration: 2000
-          })
-          return false
-        }
-      }
-
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.name = 'updateLpp'
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({
-            title: '成功',
-            message: '保存成功',
-            type: 'success',
-            duration: 2000
-          })
-          this.getdataListParmAll.parammaps.refresh = 1
-          this.pagindex = 1
-          this.getAllList()
-          this.table.myTemp.isUpdateSave = false
-          this.dropState = false
-        } else {
-          this.$notify({
-            title: '保存失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-        }
-      })
-    },
-    updateCancel(row) {
-      console.log('点击了编辑取消')
-      // 编辑false,不可编辑true
-      row.Edit = false
-      row.NoEdit = true
-      // 新增false,编辑true,编辑保存false
-      row.isCreate = false
-      row.isUpdate = true
-      row.isUpdateSave = false
-      this.dropState = false
-      this.getdataListParmAll.parammaps.refresh = 1
-      this.pagindex = 1
-      this.getAllList()
-      this.table.myTemp = Object.assign({}, row)
-    },
-
-    // 自动生成
-    handleAutomaticGeneration() {
-      this.dialogFull = false
-      this.automaticGeneration.dialogStatus = 'automaticGeneration'
-      this.automaticGeneration.dialogFormVisible = true
-    },
-    continueData(item) {
-      if (item == 0) {
-        console.log('点击继续生成')
-        this.requestParam = {}
-        this.requestParam.pastureid = Cookies.get('pastureid')
-        this.requestParam.type = 0
-        Autogeneration(this.requestParam).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg !== 'fail') {
-            this.$notify({
-              title: '成功',
-              message: '保存成功',
-              type: 'success',
-              duration: 2000
-            })
-            this.automaticGeneration.dialogFormVisible = false
-            this.getIsDisplay()
-            this.getDownList()
-          } else {
-            this.$notify({
-              title: '保存失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-          }
-        })
-      } else {
-        console.log('点击重新生成')
-        MessageBox.confirm('重新生成计划会将原有计划清空再生成,是否确认重新生成?', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          this.automaticGeneration.dialogFormVisible = false
-          // const loading = this.$loading({
-          //   lock: true,
-          //   text: 'Loading',
-          //   spinner: 'el-icon-loading'
-          // })
-          this.fullscreenLoading = true
-          this.requestParam = {}
-          this.requestParam.pastureid = Cookies.get('pastureid')
-          this.requestParam.type = 1
-          Autogeneration(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              // loading.close()
-              this.fullscreenLoading = false
-              this.$notify({
-                title: '成功',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.automaticGeneration.dialogFormVisible = false
-              this.getIsDisplay()
-              this.getDownList()
-            } else {
-              this.fullscreenLoading = false
-              // loading.close()
-              this.$notify({
-                title: '保存失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            }
-          })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消重新生成'
-          })
-        })
-      }
-    },
-    // 检验
-    // handleCheck() {
-    //   console.log('点击检验')
-    // },
-    // 历史记录
-    handleHistoryRecord() {
-      console.log('点击历史记录')
-      this.dialogFull = false
-      this.historyRecord.dialogStatus = 'historyRecord'
-      this.historyRecord.dialogFormVisible = true
-      const vue = this
-      var myComponent = () => import('./historyRecord.vue')
-      return vue.historyRecord.myComponent = myComponent
-    },
-
-    // 配方
-    changeLog: function(evt) {
-      console.log('change1', evt)
-    },
-    start(evt) {
-      console.log('start1===>', evt)
-      this.$set(this.table.startObj, 'from', evt.from.className)
-      this.$set(this.table.startObj, 'to', evt.from.className)
-    },
-    end(evt) {
-      console.log('end1===>', evt)
-    },
-    move(evt, originalEvent) {
-      console.log('move1===>', evt, originalEvent)
-      if (originalEvent.target.className === 'list-group-item1 item' || originalEvent.target.className ===
-          'draggableWeight') {
-        return false
-      }
-      if (evt.from._prevClass == evt.to._prevClass) {
-        return false
-      }
-      this.table.move1 = evt.draggedContext.element
-    },
-
-    start2(evt) {
-      console.log('start2===>', evt)
-      this.$set(this.table.startObj, 'from', evt.from.className)
-      this.$set(this.table.startObj, 'to', evt.from.className)
-    },
-    move2(evt, originalEvent) {
-      console.log('move2===>', evt, originalEvent)
-      if (originalEvent.target.className === 'list-group-item1 item' || originalEvent.target.className ===
-          'draggableWeight') {
-        return false
-      }
-      this.table.move1 = evt.draggedContext.element
-    },
-    end2(evt) {
-      // console.log(evt)
-      console.log('end2===》', evt)
-    },
-    // 撒料位
-    changeLog2(evt) {
-      // console.log(this.table.startObj)
-      console.log('changeLog2===>', evt)
-      // var _evt = [...evt]
-      this.table.changeList.push(evt)
-      evt = this.table.changeList[0]
-      if (evt.arrList.length == 1) {
-        evt.arrList[0].sort = 0
-      } else if (evt.arrList.length > 1) {
-        for (let i = 0; i < evt.arrList.length; i++) {
-          if (evt.arrList[i].id == this.table.move1.id && evt.arrList[i].fttype == this.table.move1.fttype) {
-            if (evt.arrList[i - 1] == undefined) {
-              evt.arrList[i].sort = 0
-              evt.sort = 0
-            } else {
-              evt.arrList[i].sort = parseFloat(evt.arrList[i - 1].sort) + 1
-              evt.sort = parseFloat(evt.arrList[i - 1].sort) + 1
-            }
-          }
-        }
-      }
-      console.log(evt.arrList, '==========1')
-      console.log(evt, '==========2')
-      console.log(this.table.move1.times, 'this.table.move1.times-------')
-      if (this.table.startObj.from == 'list-group1' && this.table.startObj.to == 'list-group1') {
-        if (parseFloat(evt.maxweight) - parseFloat(evt.sumweight) < parseFloat(this.table.move1.weight)) {
-          this.$set(this.table.move1, 'weight', parseFloat(evt.maxweight) - parseFloat(evt.sumweight))
-        }
-        console.log('this.table.move1.weight===>', this.table.move1.weight)
-        this.requestParam = {}
-        this.requestParam.common = {
-          'returnmap': '0'
-        }
-        this.requestParam.data = []
-        this.requestParam.data[0] = {
-          'name': 'checkLLPDetailInsert',
-          'type': 'v',
-          'parammaps': {
-            pastureid: this.table.move1.pastureid,
-            barid: this.table.move1.barid,
-            lppid: evt.id,
-            times: evt.times,
-            ftid: this.table.move1.ftid,
-            ptsid: this.table.move1.ptsid,
-            ptid: this.table.move1.ptid,
-            fttype: this.table.move1.fttype,
-            timesTem: this.table.move1.times
-          }
-        }
-        this.requestParam.data[1] = {
-          'name': 'updateLpplandtlSorts',
-          'type': 'e',
-          'parammaps': {
-            pastureid: evt.pastureid,
-            sort: evt.sort,
-            lppid: evt.id
-          }
-        }
-        this.requestParam.data[2] = {
-          'name': 'insertLppd',
-          'type': 'e',
-          'parammaps': {
-            pastureid: evt.pastureid,
-            lppid: evt.id,
-            barid: this.table.move1.barid,
-            barname: this.table.move1.barname,
-            fpdid: this.table.move1.id,
-            fttype: this.table.move1.fttype,
-            lweight: this.table.move1.weight,
-            sort: evt.sort,
-            tmrid: evt.tmrid,
-            tmrname: evt.tmrname,
-            background: this.table.move1.background,
-            ccountradio: this.table.move1.ccountradio,
-            cowcount: this.table.move1.cowcount
-          }
-        }
-        this.requestParam.data[3] = {
-          'name': 'updateFpdetailUse',
-          'type': 'e',
-          'parammaps': {
-            pastureid: this.table.move1.pastureid,
-            id: this.table.move1.id,
-            fttype: this.table.move1.fttype,
-            lweight: this.table.move1.weight
-          }
-        }
-
-        console.log('撒料位上-下新增', this.requestParam)
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('撒料位新增保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            this.$notify({
-              title: '保存失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-            this.getSmallMenuList()
-            this.getdataListParmAll.parammaps.refresh = 0
-            this.pagindex = 1
-            this.getAllList()
-          } else {
-            this.$notify({
-              title: '',
-              message: '保存成功',
-              type: 'success',
-              duration: 2000
-            })
-            this.getIsDisplay()
-            this.getSmallMenuList()
-            this.getdataListParmAll.parammaps.refresh = 0
-            this.pagindex = 1
-            this.getAllList()
-          }
-        })
-      } else if (this.table.startObj.from == 'list-group2' && this.table.startObj.to == 'list-group2') {
-        if (this.table.changeList.length == 1) {
-          this.requestParam = {}
-          this.requestParam.common = {
-            'returnmap': '0'
-          }
-          this.requestParam.data = []
-          this.requestParam.data[0] = {
-            'name': 'checkLLPDetailInsert',
-            'type': 'v',
-            'parammaps': {
-              pastureid: this.table.move1.pastureid,
-              barid: this.table.move1.barid,
-              lppid: evt.id,
-              times: evt.times,
-              ftid: this.table.move1.ftid,
-              ptsid: this.table.move1.ptsid,
-              ptid: this.table.move1.ptid,
-              fttype: this.table.move1.fttype,
-              timesTem: this.table.move1.times
-            }
-          }
-          this.requestParam.data[1] = {
-            'name': 'updateLpplandtlSorts',
-            'type': 'e',
-            'parammaps': {
-              pastureid: evt.pastureid,
-              sort: evt.sort,
-              lppid: evt.id
-            }
-          }
-          this.requestParam.data[2] = {
-            'name': 'deleteLppd',
-            'type': 'e',
-            'parammaps': {
-              pastureid: evt.pastureid,
-              id: this.table.move1.id
-            }
-          }
-          this.requestParam.data[3] = {
-            'name': 'insertLppd',
-            'type': 'e',
-            'parammaps': {
-              pastureid: evt.pastureid,
-              lppid: evt.id,
-              barid: this.table.move1.barid,
-              barname: this.table.move1.barname,
-              fpdid: this.table.move1.fpdid,
-              fttype: this.table.move1.fttype,
-              lweight: this.table.move1.weight,
-              sort: evt.sort,
-              tmrid: evt.tmrid,
-              tmrname: evt.tmrname,
-              background: this.table.move1.background,
-              ccountradio: this.table.move1.ccountradio,
-              cowcount: this.table.move1.cowcount
-            }
-          }
-          console.log('撒料位下-下新增', this.requestParam)
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('撒料位新增保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '保存失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-              this.getSmallMenuList()
-              this.getdataListParmAll.parammaps.refresh = 0
-              this.pagindex = 1
-              this.getAllList()
-            } else {
-              this.$notify({
-                title: '',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.getSmallMenuList()
-              this.getdataListParmAll.parammaps.refresh = 0
-              this.pagindex = 1
-              this.getAllList()
-              this.getIsDisplay()
-            }
-          })
-        } else if (this.table.changeList.length == 1) {
-          if (this.table.isGoing == true) {
-            console.log(11111)
-            this.requestParam.common = {
-              'returnmap': '0'
-            }
-            this.requestParam.data = []
-            this.requestParam.data[0] = {
-              'name': 'checkLLPDetailInsert',
-              'type': 'e',
-              'parammaps': {
-                pastureid: evt.pastureid,
-                sort: evt.sort,
-                lppid: evt.id
-              }
-            }
-            this.requestParam.data[1] = {
-              'name': 'deleteLppd',
-              'type': 'e',
-              'parammaps': {
-                pastureid: evt.pastureid,
-                id: this.table.move1.id
-              }
-            }
-            this.requestParam.data[2] = {
-              'name': 'insertLppd',
-              'type': 'e',
-              'parammaps': {
-                pastureid: evt.pastureid,
-                lppid: evt.id,
-                barid: this.table.move1.barid,
-                barname: this.table.move1.barname,
-                fpdid: this.table.move1.id,
-                fttype: this.table.move1.fttype,
-                lweight: this.table.move1.weight,
-                sort: evt.sort,
-                tmrid: evt.tmrid,
-                tmrname: evt.tmrname,
-                background: this.table.move1.background
-              }
-            }
-            this.requestParam.data[3] = {
-              'name': 'updateFpdetailUse',
-              'type': 'e',
-              'parammaps': {
-                pastureid: this.table.move1.pastureid,
-                id: this.table.move1.id,
-                fttype: this.table.move1.fttype,
-                statue: 1
-              }
-            }
-
-            console.log('撒料位新增', this.requestParam)
-            ExecDataByConfig(this.requestParam).then(response => {
-              console.log('撒料位新增保存发送参数', this.requestParam)
-              if (response.msg === 'fail') {
-                this.$notify({
-                  title: '保存失败',
-                  message: response.data,
-                  type: 'warning',
-                  duration: 2000
-                })
-                this.getdataListParmAll.parammaps.refresh = 0
-                this.pagindex = 1
-                this.getAllList()
-              } else {
-                this.$notify({
-                  title: '',
-                  message: '保存成功',
-                  type: 'success',
-                  duration: 2000
-                })
-                this.getSmallMenuList()
-                this.getdataListParmAll.parammaps.refresh = 0
-                this.pagindex = 1
-                this.getAllList()
-                this.getIsDisplay()
-              }
-            })
-            this.table.isGoing = false
-          } else {
-            this.table.isGoing = true
-          }
-        }
-      }
-    },
-    // 编辑-撒料设备
-    changeEquipment(item, row, fttype, myid) {
-      var objList = {}
-      for (let i = 0; i < row.arrList.length; i++) {
-        row.arrList[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
-        if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
-          objList = row.arrList[i]
-        }
-        console.log(item, 'item')
-        console.log(row, 'row')
-        // if (row.tmrid == row.arrList[i].tmrid) {
-        //   if (row.tmrid !== item) {
-        //     this.$message({ type: 'warning', message: '混料设备不可与其它撒料设备同时选择1', duration: 2000 })
-        // this.getdataListParmAll.parammaps.refresh = 1
-        // this.getAllList()
-        //     return false
-        //   }
-        // } else {
-        //   if (row.tmrid == item) {
-        //     this.$message({ type: 'warning', message: '混料设备不可与其它撒料设备同时选择2', duration: 2000 })
-        // this.getdataListParmAll.parammaps.refresh = 1
-        // this.getAllList()
-        //     return false
-        //   }
-        // }
-      }
-      console.log(row)
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'updateLppd',
-        'type': 'e',
-        'parammaps': {
-          pastureid: row.pastureid,
-          lppid: row.id,
-          barid: objList.barid,
-          barname: objList.barname,
-          fpdid: objList.fpdid,
-          fttype: objList.fttype,
-          lweight: objList.weight,
-          sort: objList.sort,
-          tmrid: objList.tmrid,
-          tmrname: objList.tmrname,
-          background: objList.background,
-          id: objList.id
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({
-            title: '保存失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-        } else {
-          this.$notify({
-            title: '',
-            message: '保存成功',
-            type: 'success',
-            duration: 2000
-          })
-          this.getdataListParmAll.parammaps.refresh = 0
-          this.pagindex = 1
-          this.getAllList()
-        }
-      })
-    },
-    dbclickWeight(row) {
-      if (this.table.myTemp.isUpdateSave == true) {
-        return false
-      }
-      console.log(row, this.isRoleEdit, '=====')
-      row.isWeight = true
-      row.focusState = true
-      this.dropState = true
-      this.myStart2 = false
-      this.myMove2 = false
-      this.myEnd2 = false
-    },
-
-    // 编辑-重量
-    blurWeight(row, fttype, myid) {
-      var objList = {}
-      for (let i = 0; i < row.arrList.length; i++) {
-        if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
-          objList = row.arrList[i]
-        }
-      }
-      if (objList.weight !== '') {
-        if (parseFloat(objList.weight) <= 0) {
-          this.$message({
-            type: 'error',
-            message: '重量不可输入小于0的数据',
-            duration: 2000
-          })
-          return false
-        }
-      }
-      if (objList.weight == '') {
-        objList.weight = 0
-      }
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'checkFPdLeftW',
-        'type': 'v',
-        'parammaps': {
-          pastureid: objList.pastureid,
-          fpdid: objList.fpdid,
-          fttype: objList.fttype,
-          lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight))
-        }
-      }
-      this.requestParam.data[1] = {
-        'name': 'updateLppd',
-        'type': 'e',
-        'parammaps': {
-          pastureid: row.pastureid,
-          lppid: row.id,
-          barid: objList.barid,
-          barname: objList.barname,
-          fpdid: objList.fpdid,
-          fttype: objList.fttype,
-          lweight: objList.weight,
-          sort: objList.sort,
-          tmrid: objList.tmrid,
-          tmrname: objList.tmrname,
-          background: objList.background,
-          id: objList.id
-        }
-      }
-      this.requestParam.data[2] = {
-        'name': 'updateFpdetailUse',
-        'type': 'e',
-        'parammaps': {
-          pastureid: objList.pastureid,
-          id: objList.fpdid,
-          fttype: objList.fttype,
-          lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight))
-        }
-      }
-
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({
-            title: '保存失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-          this.getdataListParmAll.parammaps.refresh = 0
-          this.pagindex = 1
-          this.getAllList()
-        } else {
-          this.$notify({
-            title: '',
-            message: '保存成功',
-            type: 'success',
-            duration: 2000
-          })
-          this.getdataListParmAll.parammaps.refresh = 0
-          this.pagindex = 1
-          this.getAllList()
-          this.isWeight = false
-        }
-      })
-    },
-    handleTakeEffectChange() {
-      console.log('点击了生效')
-    },
-    handleIssplitChange() {
-      console.log('是否提前小料拆分')
-    },
-
-    // 撒料位删除
-    handleFLDelete(ele, row) {
-      if (this.table.myTemp.isUpdateSave == true) {
-        return false
-      }
-      console.log(ele, row, '点击了撒料删除')
-      this.selectList = []
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'deleteLppd',
-        'type': 'e',
-        'parammaps': {
-          pastureid: ele.pastureid,
-          id: ele.id
-        }
-      }
-      this.requestParam.data[1] = {
-        'name': 'updateFpdetailUse',
-        'type': 'e',
-        'parammaps': {
-          pastureid: ele.pastureid,
-          id: ele.fpdid,
-          fttype: ele.fttype,
-          lweight: '-' + parseFloat(ele.weight)
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('删除保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({
-            title: '删除失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-        } else {
-          this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
-          this.reload()
-          // this.getdataListParmAll.parammaps.refresh = 0
-          // this.pagindex = 1
-          // this.getAllList()
-          // this.getSmallMenuList()
-        }
-      })
-    },
-
-    handleSelect(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    // 减少车次
-    handleReduceTrains() {
-      if (this.selectList.length == 0) {
-        this.$message({
-          type: 'error',
-          message: '请选择车次',
-          duration: 2000
-        })
-        return false
-      } else {
-        // 减少对应车次
-        for (let i = 0; i < this.selectList.length; i++) {
-          if (this.selectList[i].arrList.length > 0) {
-            this.$message({
-              type: 'error',
-              message: '本车次已添加栏舍不可删除',
-              duration: 2000
-            })
-            return false
-          }
-        }
-        MessageBox.confirm('是否确认删除此信息?', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam = {}
-          this.requestParam.common = {
-            'returnmap': '0'
-          }
-          this.requestParam.data = []
-          this.requestParam.data[0] = {
-            'name': 'insertSpotList',
-            'resultmaps': {
-              'list': this.selectList
-            }
-          }
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = {
-            'name': 'deleteLpp',
-            'type': 'e',
-            'parammaps': {
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }
-          }
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('删除保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '删除失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.$notify({
-                title: '',
-                message: '删除成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.getdataListParmAll.parammaps.refresh = 1
-              this.pagindex = 1
-              this.getAllList()
-            }
-          })
-        })
-      }
-    },
-
-    // 行内删除
-    handleRowDelete(row) {
-      console.log(row, '点击了行删除')
-      if (row.arrList.length == 0) {
-        MessageBox.confirm('是否确认删除此信息?', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          this.selectList = []
-          this.requestParam = {}
-          this.requestParam.name = 'deleteLpp'
-          this.requestParam.parammaps = {}
-          this.requestParam.parammaps.pastureid = row.pastureid
-          this.requestParam.parammaps.id = row.id
-          PostDataByName(this.requestParam).then(response => {
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '删除失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.$notify({
-                title: '成功',
-                message: '删除成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.getdataListParmAll.parammaps.refresh = 1
-              this.pagindex = 1
-              this.getAllList()
-            }
-          })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
-        })
-      } else {
-        this.$message({
-          type: 'error',
-          message: '本车次已添加栏舍不可删除',
-          duration: 2000
-        })
-        return false
-      }
-    },
-    handleLeftButton() { // 向左
-      console.log('向左', this.isLeftButton)
-      this.isLeftButton = false
-      this.isRightButton = true
-      this.$refs.listR.style.width = '46%'
-      this.$refs.listR.style.zIndex = 4
-      // this.$refs.listRight.style.zIndex = 4
-      // this.$refs.listRight2.style.zIndex = 4
-      this.getSmallMenuList()
-    },
-    handleRightButton() { // 向右
-      console.log('向右', this.isLeftButton)
-      this.isLeftButton = true
-      this.isRightButton = false
-      this.$refs.list.style.zIndex = 1
-      this.$refs.listR.style.width = '50px'
-      this.$refs.listR.style.zIndex = 1
-      this.$nextTick(() => {
-        this.$refs.listRight.style.zIndex = 1
-        this.$refs.listRight2.style.zIndex = 1
-      })
-    },
-    handleTakeEffect() {
-      if (this.selectList.length == 0) {
-        this.$message({
-          type: 'error',
-          message: '请选择车次信息',
-          duration: 2000
-        })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          for (let i = 0; i < this.selectList.length; i++) {
-            // this.$set(this.selectList[i], 'enable', '1')
-            this.selectList[i].sel = 1
-          }
-          console.log('生效', this.selectList)
-          this.requestParam.common = {
-            'returnmap': '0'
-          }
-          this.requestParam.data = []
-          this.requestParam.data[0] = {
-            'name': 'insertSpotList',
-            'resultmaps': {
-              'list': this.selectList
-            }
-          }
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = {
-            'name': 'updatelpplanEnable',
-            'type': 'e',
-            'parammaps': {
-              sel: '@insertSpotList.sel',
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }
-          }
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('生效保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '生效失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.$notify({
-                title: '',
-                message: '生效成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.getdataListParmAll.parammaps.refresh = 1
-              this.pagindex = 1
-              this.getAllList()
-            }
-          })
-        })
-      }
-    },
-    handleDisable() {
-      if (this.selectList.length == 0) {
-        this.$message({
-          type: 'error',
-          message: '请选择车次信息',
-          duration: 2000
-        })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          for (let i = 0; i < this.selectList.length; i++) {
-            // this.$set(this.selectList[i], 'enable', '1')
-            this.selectList[i].sel = 0
-          }
-          console.log('禁用', this.selectList)
-          this.requestParam.common = {
-            'returnmap': '0'
-          }
-          this.requestParam.data = []
-          this.requestParam.data[0] = {
-            'name': 'insertSpotList',
-            'resultmaps': {
-              'list': this.selectList
-            }
-          }
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = {
-            'name': 'updatelpplanEnable',
-            'type': 'e',
-            'parammaps': {
-              sel: '@insertSpotList.sel',
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }
-          }
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('禁用保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '禁用失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.$notify({
-                title: '',
-                message: '禁用成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.getdataListParmAll.parammaps.refresh = 1
-              this.pagindex = 1
-              this.getAllList()
-            }
-          })
-        })
-      }
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  /deep/ .el-radio-button__orig-radio:checked+.el-radio-button__inner {
-    color: #fff;
-    background-color: #009C69;
-    border-color: #009C69;
-    -webkit-box-shadow: -1px 0 0 0 #009C69;
-    box-shadow: -1px 0 0 0 #009C69;
-  }
-
-  .not-select {
-    -moz-user-select: none;
-    /*火狐*/
-    -webkit-user-select: none;
-    /*webkit浏览器*/
-    -ms-user-select: none;
-    /*IE10*/
-    -khtml-user-select: none;
-    /*早期浏览器*/
-    user-select: none;
-    position: relative;
-  }
-</style>
-
-<style lang="scss">
-  /deep/ :focus {
-    outline: 0;
-  }
-
-  :focus-visible {
-    outline: 0 !important;
-  }
-
-  // 下拉框
-  .filter-item2 .el-input--suffix .el-input__inner {
-    height: 30px !important;
-    font-size: 8px;
-    padding: 0 2px;
-  }
-
-  .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon {
-    line-height: 30px !important;
-  }
-
-  // 输入框
-  .filter-item2 .el-input__inner {
-    height: 30px !important;
-    font-size: 8px;
-    padding: 0 2px;
-  }
-</style>
-
-<style lang="scss">
-  // /deep/ .el-table__body .el-table__row{
-  //   max-height:50px!important;
-  //   height: 50px!important;
-  // }
-  .menuList {
-    height: 190px;
-    background: red;
-    border-bottom: 2px solid #d8dce5;
-    box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
-
-    .menuList-t {
-      height: 60px;
-      background: #fff;
-      display: flex;
-      justify: center;
-      align-items: center;
-      display: -webkit-flex;
-      flex-direction: row;
-      flex-wrap: wrap;
-      justify-content: space-between;
-
-      .menuList-t-l {}
-
-      .menuList-t-r {
-        display: flex;
-        flex-direction: row;
-        flex-wrap: wrap;
-        justify-content: space-between;
-        position: relative;
-
-        .menuList-t-r-l {
-          margin-right: 10px;
-          cursor: pointer;
-          width: 150px;
-          height: 20px;
-          line-height: 20px;
-          text-align: center;
-          background: rgba(25, 138, 244, 0);
-          border: 1px solid #1BBD89;
-          border-radius: 2px;
-          font-size: 12px;
-          color: #1BBD89;
-        }
-
-        .menuList-t-r-r {
-          margin-right: 10px;
-          cursor: pointer;
-          width: 150px;
-          height: 20px;
-          line-height: 20px;
-          text-align: center;
-          background: rgba(25, 138, 244, 0);
-          border: 1px solid #1BBD89;
-          border-radius: 2px;
-          font-size: 12px;
-          color: #1BBD89;
-        }
-
-        .columnHouse {
-          width: 650px;
-          background: #fff;
-          box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.04), 0 0 6px 6px rgba(0, 0, 0, 0.04);
-          position: absolute;
-          right: 0;
-          top: 25px;
-          z-index: 5;
-
-          .el-table {
-            height: 250px;
-            overflow: auto;
-          }
-        }
-      }
-
-    }
-
-    .menuList-b {
-      height: 130px;
-      background: #fff;
-      position: relative;
-
-      ::-webkit-scrollbar {
-        width: 7px;
-        height: 7px;
-        background-color: #F5F5F5;
-      }
-
-      ::-webkit-scrollbar-track {
-        box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
-        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
-        border-radius: 10px;
-        background-color: #F5F5F5;
-      }
-
-      ::-webkit-scrollbar-thumb {
-        border-radius: 10px;
-        box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
-        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
-        background-color: #c8c8c8;
-      }
-
-      .draggableList {
-        position: absolute;
-        width: 100%;
-        margin: 0 0;
-        height: 130px;
-        list-style: none;
-        padding: 0 0;
-        overflow: auto;
-        font-size: 12px;
-
-        .draggableTitle {
-          float: left;
-          width: 105px;
-          white-space: nowrap;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          margin: 5px 5px;
-          border-radius: 7px;
-          text-align: center;
-          color: #000;
-          height: 36px;
-          line-height: 36px;
-        }
-
-        li {
-          text-align: center;
-          color: #fff;
-
-          .draggableName {
-            display: block;
-            width: 100%;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            white-space: nowrap;
-          }
-        }
-      }
-    }
-  }
-
-  .list-group2 {
-    .list-group-item2 {
-      width: 220px;
-      height: 50px;
-      overflow: hidden;
-      float: left;
-      margin: 5px 5px;
-      position: relative;
-      color: #fff;
-
-      .arr-t {
-        height: 50px;
-        border-radius: 5px 5px;
-      }
-
-      .arr-l {
-        float: left;
-        width: 60px;
-        height: 50px;
-        overflow: hidden;
-        border-radius: 5px 50% 50% 5px;
-
-        .arr-l-t {
-          position: relative;
-
-          .arr-l-t-t {
-            width: 0;
-            height: 0;
-            border-top: 26px solid #3479f2;
-            border-right: 26px solid transparent;
-          }
-
-          .arr-l-t-b {
-            position: absolute;
-            top: 4px;
-            left: 1px;
-            color: #fff;
-            width: 10px;
-            height: 10px;
-
-            .el-input--suffix {
-              opacity: 0;
-
-              .el-input__inner {
-                height: 10px;
-              }
-            }
-          }
-        }
-
-        .arr-l-b {
-          width: 45px;
-          position: absolute;
-          top: 15px;
-          left: 10px;
-          color: #fff !important;
-          font-size: 12px;
-
-          .tmrname {
-            width: 100%;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            white-space: nowrap;
-          }
-        }
-      }
-
-      .arr-c {
-        position: absolute;
-        top: 0px;
-        left: 0;
-      }
-
-      .arr-r {
-        float: right;
-        width: 160px;
-        height: 50px;
-        overflow: hidden;
-        line-height: 50px;
-
-        .arr-r-l {
-          float: left;
-          width: 85px;
-
-          .barname {
-            width: 100%;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            white-space: nowrap;
-            font-size: 14px;
-          }
-        }
-
-        .arr-r-c {
-          float: left;
-          width: 10px;
-        }
-
-        .arr-r-r {
-          float: left;
-          width: 65px;
-
-          .weight {
-            width: 100%;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            white-space: nowrap;
-            font-size: 14px;
-          }
-        }
-      }
-    }
-  }
-</style>
-<style>
-  .draggableWeight {
-    display: block;
-    line-height: 18px;
-    height: 18px;
-    color: #000;
-    width: 100%;
-    margin: 0 auto;
-  }
-</style>

+ 177 - 85
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -13,10 +13,11 @@
       </div>
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> 生效</el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> 禁用</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
       <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;float: left;margin-left: 10px;" @change="changeFrequency">
         <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
-      <el-button class="success" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button>
+      <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button>
     </div>
     <!-- <div class="search">
       <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency">
@@ -272,6 +273,7 @@
           <div class="spreadingMaterial">
             <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
             <div class="spreadingMaterialList">
+              <!-- force-fallback="true" -->
               <draggable
                 :disabled="isDropState"
                 id="1"
@@ -281,7 +283,6 @@
                 draggable=".item"
                 group="a"
                 animation="500"
-                force-fallback="true"
                 :move="move1"
                 @change="changeLog1"
                 @start="start1"
@@ -372,6 +373,21 @@
         <el-button class="save" @click="check.dialogFormVisible=false;">确认</el-button>
       </div>
     </el-dialog>
+
+    <!-- 更改TMR编号 -->
+    <el-dialog :title="textMap[tmrNumber.dialogStatus]" :destroy-on-close="true" :visible.sync="tmrNumber.dialogFormVisible" :close-on-click-modal="false" width="30%">
+        <h3 style="text-align: center;">是否要改变TMR设备?</h3>
+      <div class="tmrNumber" style="padding: 10px 30px;">
+        <p>注:更换TMR撒料设备,变更后的装载重量不同,请选择处理方式</p>
+        <el-radio v-model="tmrNumber.radio" label="0">1、多出的饲料平均从已分配的各栏舍中扣减。</el-radio><br/><br/>
+        <el-radio v-model="tmrNumber.radio" label="1">2、多出的饲料从最后一个栏舍依次往前扣减。</el-radio><br/><br/>
+        <el-radio v-model="tmrNumber.radio" label="2">3、清空已分配的撒料车。</el-radio>
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
+        <el-button class="cancelClose" :disabled="isokDisable" @click="closeTmrNumber">否</el-button>
+        <el-button class="save" :disabled="isokDisable" @click="tmrNumberData()">是</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -440,7 +456,8 @@ export default {
         historyRecord: '历史记录',
         create: '新增',
         update: '编辑',
-        check: '提示'
+        check: '提示',
+        tmrNumber:''
       },
       check: {
         dialogFormVisible: false,
@@ -473,7 +490,13 @@ export default {
       templateFormulationList: [], // 模板配方
       isDispaly: false,
       dropState: false,
-      isDropState:false
+      isDropState:false,
+      tmrNumber:{
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp:{},
+        radio:'0'
+      }
     }
   },
   created() {
@@ -505,19 +528,21 @@ 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')
         }
       }
-      postJson(url, data2).then(response => {
+      postJson(url2, data2).then(response => {
         if (response.data !== null) {
-          this.equipmentList = response.data.list
+          this.equipmentList = response.data
           if(this.create.dialogStatus == 'update'){
-            this.create.temp.tclassname = this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid).tclassname
+            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
+            }else{
+              this.create.temp.tclassname = '固定式'
+            }
           }
         } else {
           this.equipmentList = []
@@ -661,29 +686,38 @@ export default {
     // TMR编号
     changeTMRNumber(item) {
       if (this.create.list2.length > 0) {
-        MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
-          confirmButtonText: '是', cancelButtonText: '否', type: 'warning'
-        }).then(() => {
-          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
-          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
-          console.log(this.create.temp)
-          this.$message({ type: 'info', message: '已取消' })
-        })
+        // 备份
+        // MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
+        //   confirmButtonText: '是', cancelButtonText: '否', type: 'warning'
+        // }).then(() => {
+        //   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(() => {
+        //   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
+        //   console.log(this.create.temp)
+        //   this.$message({ type: 'info', message: '已取消' })
+        // })
+        // 备份
+        this.tmrNumber.dialogFormVisible = true
+        this.tmrNumber.dialogStatus = 'tmrNumber'
+        this.tmrNumber.radio = '0'
       } else {
         this.create.temp.tmrid = this.create.temp.tmrid2
         this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
@@ -694,9 +728,49 @@ export default {
         if (this.isDispaly || this.create.dialogStatus == 'update') {
           this.getClearList()
         }
-        console.log('TMR编号item==>', item)
       }
-        console.log('tmrname==>', this.create.temp)
+    },
+    tmrNumberData(){
+      if(this.tmrNumber.radio == '0'){
+        console.log('1、多出的饲料平均从已分配的各栏舍中扣减。')
+      }else if(this.tmrNumber.radio == '1'){
+        console.log('2、多出的饲料从最后一个栏舍依次往前扣减。')
+      }else if(this.tmrNumber.radio == '2'){
+        console.log('3、清空已分配的撒料车。')
+      }
+      const url = 'authdata/materialtmr/edit'
+      const data = {
+        tmrid:this.create.temp.tmrid2,
+        tmrtype: this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassid,
+        lppid:this.create.temp.id,
+        times:this.create.temp.times,
+        pastureid:Cookies.get('pastureid'),
+        status:this.tmrNumber.radio
+      }
+      postJson(url, data).then(response => {
+        if (response.msg === 'fail') {
+          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
+          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.tmrNumber.dialogFormVisible = false
+          this.getCreateList1()
+        }
+      })
+    },
+    closeTmrNumber(){
+      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
+      this.tmrNumber.dialogFormVisible = false
     },
     getClearList() {
       const url = 'authdata/lpplandtl/del'
@@ -923,7 +997,7 @@ export default {
           this.create.temp.sumweight = (sumweight).toFixed(2)
         } else {
           this.create.list2 = []
-          this.create.temp.sort = 0
+          // this.create.temp.sort = 0
           this.create.temp.sumweight = 0
         }
       })
@@ -933,8 +1007,9 @@ export default {
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
-      console.log('点击了栏舍item==>', item)
       this.create.temp.sumweight = parseFloat(this.create.temp.sumweight)
+      console.log('this.TMRNumberList==>', this.TMRNumberList)
+      console.log('点击了栏舍item==>', item)
       console.log('temp==>',this.create.temp)
       console.log('this.equipmentList==>',this.equipmentList)
       // if(this.create.temp.tclassname == '固定式'){
@@ -950,9 +1025,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
@@ -966,7 +1041,8 @@ export default {
         this.getCreateList1()
         return
       }
-      console.log('item.weight===>', item.weight)
+      console.log('item.weight===>', evt.maxweight)
+      console.log('item.weight===>', evt.sumweight)
       const url = 'authdata/lpplandtl/add'
       const data = {}
       data.parammaps = {}
@@ -984,19 +1060,30 @@ export default {
       data.parammaps.cowcount = item.cowcount
       data.parammaps.ccountradio = item.ccountradio
       postJson(url, data).then(response => {
-        this.requestParam = {}
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        // this.requestParam.data[0] = { 'name': 'updateLpplandtlSorts', 'type': 'e',
-        //   'parammaps': { pastureid: evt.pastureid, sort: evt.sort, lppid: evt.id }
+        // this.requestParam = {}
+        // this.requestParam.common = {
+        //   'returnmap': '0'
         // }
-        // this.requestParam.data[1] = { 'name': 'insertLppd', 'type': 'e',
-        //   'parammaps': {
-        //     pastureid: evt.pastureid, lppid: evt.id, barid: item.barid, barname: item.barname, fpdid: item.id, fttype: item.fttype,
-        //     lweight: item.weight, sort: evt.sort, tmrid: evt.tmrid, tmrname: evt.tmrname,
-        //     background: item.background, ccountradio: item.ccountradio, cowcount: item.cowcount
+        // this.requestParam.data = []
+        // this.requestParam.data[0] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
+        //     pastureid:item.pastureid,
+        //     lppid:evt.id,
+        //     barid:item.barid,
+        //     barname:item.barname,
+        //     fpdid:item.id,
+        //     tmrid:evt.tmrid,
+        //     tmrname:evt.tmrname,
+        //     fttype:item.fttype,
+        //     background:item.background,
+        //     cowcount:item.cowcount,
+        //     ccountradio:item.ccountradio,
+        //     lweight:item.weight
         //   }
         // }
+        // ExecDataByConfig(this.requestParam).then(response => {
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
         this.requestParam.data[0] = { 'name': 'updateFpdetailUse', 'type': 'e',
           'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
         }
@@ -1039,8 +1126,9 @@ export default {
           this.create.temp.pastureid = Cookies.get('pastureid')
           this.create.temp.times = parseInt(this.create.temp.times)
           data.parammaps = this.create.temp
-          data.parammaps.tmrid = this.create.temp.mytmrid
+          data.parammaps.tmrid = this.create.temp.tmrid2
           data.parammaps.tmrname = this.create.temp.mytmrname
+          data.old = this.create.temp.arrList
           postJson(url, data).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
@@ -1138,44 +1226,13 @@ export default {
           this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
         }
       })
-      // this.requestParam = {}
-      // this.requestParam.common = {
-      //   'returnmap': '0'
-      // }
-      // this.requestParam.data = []
-      // this.requestParam.data[0] = {
-      //   'name': 'updateLppd',
-      //   'type': 'e',
-      //   'parammaps': {
-      //     pastureid: this.create.temp.pastureid,
-      //     lppid: this.create.temp.id,
-      //     barid: objList.barid,
-      //     barname: objList.barname,
-      //     fpdid: objList.fpdid,
-      //     fttype: objList.fttype,
-      //     lweight: objList.weight,
-      //     sort: objList.sort,
-      //     tmrid: objList.tmrid,
-      //     tmrname: objList.tmrname,
-      //     background: objList.background,
-      //     id: objList.id
-      //   }
-      // }
-      // ExecDataByConfig(this.requestParam).then(response => {
-      //   console.log('编辑保存发送参数', this.requestParam)
-      //   if (response.msg === 'fail') {
-      //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-      //   } else {
-      //     this.getCreateList2()
-      //     this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-      //   }
-      // })
     },
     move1(evt, originalEvent){
       console.log('move1===>evt', evt)
       console.log('move1===>originalEvent', originalEvent)
     },
     changeLog1(evt){
+      // 按组拖拽
       const url = 'authdata/lpplandtl/edit/sort'
       const data = {}
       var obj = evt.moved.element
@@ -1184,6 +1241,7 @@ export default {
       data.parammaps.pastureid = obj.pastureid
       data.parammaps.lppid = obj.lppid
       data.parammaps.sort = evt.moved.newIndex +1
+      data.parammaps.id = obj.id
       postJson(url, data).then(response => {
         console.log('拖动保存发送参数', this.requestParam)
         if (response.msg === 'fail') {
@@ -1484,6 +1542,40 @@ export default {
           this.getCreateList1()
         }
       })
+    },
+    handleAllEmpty(){
+      MessageBox.confirm('执行该操作会将现有车次已分配的撒料栏舍全部清空,是否要执行该操作?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
+        this.requestParam.data[0] = { 'name': 'deleteLpplandtl1All', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times}},
+        this.requestParam.data[1] = { 'name': 'deletefpdetailAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times}},
+        this.requestParam.data[1] = { 'name': 'deletefpdetailAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times}},
+        ExecDataByConfig(this.requestParam).then(response => {
+          console.log('清空已分配栏舍', this.requestParam)
+          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 })
+              }
+            })
+            this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
+            this.getList()
+          }
+        })
+      })
     }
   }
 }

+ 113 - 112
src/views/formulationPlan/pushMaterialPlan/index.vue

@@ -1,20 +1,20 @@
  <template>
   <div class="app-container">
     <div class="operation">
-   
+
 
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate1">设置推料时间</el-button>
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate2">设置允许误差时间</el-button>
 
-      
+
      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">启用</el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用</el-button>
       <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">校验</el-button>
 
       <el-button class="import" style="float: right;" @click="handleHistoryRecords">历史记录</el-button>
- 
+
     </div>
- 
+
     <div class="table">
       <el-table
         :key="table.tableKey"
@@ -29,19 +29,19 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
-        :max-height="myHeight"
         @header-click="headerClick"
         @cell-click="cellClick"
         @selection-change="handleSelect"
         @cell-dblclick="celldblclick"
+        :max-height="myHeight"
       >
         <el-table-column type="selection" width="50" />
         <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left" />
         <el-table-column label="栏舍名称" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left">
           <template slot-scope="scope">
-        
+
             <span  >{{ scope.row.bname }}</span>
- 
+
           </template>
         </el-table-column>
         <el-table-column :key="2" label="推料车名称" min-width="70px" align="center">
@@ -49,31 +49,31 @@
             <span v-if="scope.row.NoEdit">{{ scope.row.tmrname }}</span>
             <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" filterable placeholder="推料车名称" class="filter-item" style="width:95%;padding:10px 0;" @change="changeTmrCode(scope.$index, scope.row, $event)">
                   <el-option v-for="item in tmrCodeList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>  
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column :key="3" label="推料车编号" min-width="90px" align="center">
           <template slot-scope="scope">
             <span  >{{ scope.row.tmrcode }}</span>
-      
+
           </template>
         </el-table-column>
         <el-table-column :key="4" label="推料时间(每天)" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.times }}</span>
-            
+
             <el-tag v-if="scope.row.Edit" v-for="tag  in  scope.row.timesArr" :key="tag" closable @close="tag_close(scope.$index, scope.row, tag)" type="success">{{tag}}</el-tag>
 
-          
-                   <el-time-picker v-if="scope.row.Edit" 
+
+                   <el-time-picker v-if="scope.row.Edit"
                      v-model="scope.row.times"
                     :picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
                      value-format="HH:mm"
                      @change="change_time(scope.$index, scope.row, $event)" format="HH:mm"
                     placeholder="任意时间点">
                   </el-time-picker>
-     
-         
+
+
           </template>
         </el-table-column>
         <el-table-column :key="5" label="允许误差时间(分钟)" min-width="85px" align="center">
@@ -102,9 +102,10 @@
           </template>
         </el-table-column>
       </el-table>
+      <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
       <!-- <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" /> -->
     </div>
-    
+
 
 
      <el-dialog :fullscreen="dialogFull" :visible.sync="create1.dialogFormVisible" :close-on-click-modal="false" width="50%">
@@ -122,7 +123,7 @@
       </template>
       <div class="app-add">
         <el-form ref="temp" :rules="create1.rules" :model="create1.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
-        
+
           <el-row>
               <el-col :span="6">
                 <el-form-item label="设置时间:" prop="useinbarid">
@@ -142,7 +143,7 @@
 
             </el-row>
 
-        
+
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button class="cancelClose" @click="create1.dialogFormVisible = false;getList()">关闭</el-button>
@@ -167,7 +168,7 @@
       </template>
       <div class="app-add">
         <el-form ref="temp" :rules="create2.rules" :model="create2.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
-        
+
           <el-row>
               <el-col :span="12">
               <el-form-item label="允许误差时间(分钟):" prop="allowableerror">
@@ -176,9 +177,9 @@
             </el-col>
 
           </el-row>
-           
 
-        
+
+
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button class="cancelClose" @click="create2.dialogFormVisible = false;getList()">关闭</el-button>
@@ -239,7 +240,7 @@
             :cell-style="cellStyle"
             class="elTable table-fixed"
           >
- 
+
             <el-table-column label="栏舍名称" min-width="130px" align="center">
               <template slot-scope="scope">
                 <span>{{ scope.row.barname }}</span>
@@ -255,8 +256,8 @@
                 <span>{{ scope.row.tmrcode }}</span>
               </template>
             </el-table-column>
-  
-            
+
+
             <el-table-column label="推料时间(每天)" min-width="130px" align="center">
               <template slot-scope="scope">
                 <span>{{ scope.row.tisms }}</span>
@@ -267,7 +268,7 @@
                 <span>{{ scope.row.allowableerror }}</span>
               </template>
             </el-table-column>
-           
+
           </el-table>
           <pagination v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
         </div>
@@ -276,9 +277,9 @@
         <el-button class="cancelClose cancelClose1" @click="history.dialogFormVisible = false; ">关闭</el-button>
       </div>
     </el-dialog>
-    
- 
-    
+
+
+
   </div>
 </template>
 
@@ -291,7 +292,7 @@ import { MessageBox } from 'element-ui'
 import Cookies from 'js-cookie'
 import axios from 'axios'
 import { getToken } from '@/utils/auth'
- 
+
 export default {
   inject: ['reload'],
   name: 'PushMaterialPlan',
@@ -342,12 +343,12 @@ export default {
           name: 'getPushingList',
           page: 1,
           offset: 1,
- 
+
           pagecount: '',
           returntype: 'Map',
           parammaps: {
             pastureid: Cookies.get('pastureid'),
-         
+
           }
         },
         tableKey: 0,
@@ -355,8 +356,8 @@ export default {
         total: 0,
         listLoading: true,
         temp: {},
-  
- 
+
+
       },
 
 
@@ -416,16 +417,16 @@ export default {
       isRoleEdit: [],
       headerList: [],
       pickerMinDate: '',
- 
-   
+
+
       rules: {
         cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
       },
-      
+
       selectList: [],
-   
-   
-       
+
+
+
 
       requestParam: {},
       download: {
@@ -448,26 +449,26 @@ export default {
       isokDisable: false,
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight: document.documentElement.clientHeight - 85 - 140,
+      myHeight: document.documentElement.clientHeight - 85- 150,
       oldRowList:{},
 
 
-      
+
 
 
 
     }
   },
   computed: {
-    
-    
+
+
   },
   created() {
     this.getButtons()
 
     this.getTMRlist()
     this.getList()
-   
+
   },
 
   methods: {
@@ -501,7 +502,7 @@ export default {
             this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
             this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
             this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
-           
+
           }
 
           response.data.list.forEach(function(item){
@@ -513,15 +514,15 @@ export default {
           })
 
           // console.log(response.data.list, sumr)
-      
+
           this.table.list = response.data.list
           console.log(this.table.list, 'this.table.list')
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
@@ -533,15 +534,15 @@ export default {
     changeTmrCode(index,row,item) {
       console.log("推料车:====",index,row,item)
       var Code   = this.tmrCodeList.find(obj => obj.id === row.tmrid).Code
-      var itemName   = this.tmrCodeList.find(obj => obj.id === row.tmrid).name 
+      var itemName   = this.tmrCodeList.find(obj => obj.id === row.tmrid).name
       console.log( "推料车编号:====",Code , itemName)
       this.table.list[index].tmrcode = Code
       this.table.list[index].tmrname = itemName
-      
+
     },
-     
 
-  
+
+
 
      // 新增
     handleCreate1() {
@@ -555,13 +556,13 @@ export default {
         this.create1.dialogStatus = 'create'
         this.create1.dialogFormVisible = true
       }
-    
+
 
     },
      resetTemp1() {
       this.timetags1 = []
     },
-    
+
 
     create_sure1(){
         console.log('timetags1-----',this.timetags1)
@@ -581,7 +582,7 @@ export default {
             selectArr.forEach(function(item){
               timeArrRea.forEach(function(items){
                 timeIdArr.push({"time":items,"tmrname":item.tmrname,"tmrid":item.tmrid,"id":item.id})
-              }) 
+              })
             })
 
 
@@ -624,7 +625,7 @@ export default {
                   },
 										 "children":[{"name":"insertPushingDetailByPushingId","type":"e","parammaps":
 										 {"pastureid":Cookies.get('pastureid'),"id":"@insertPushingDetail.id","time":"@insertPushingDetail.time","type":0}}]}
-										 ]} 
+										 ]}
 
 
 
@@ -637,25 +638,25 @@ export default {
                   if (response.msg === 'fail') {
                     this.$notify({ title: '设置失败', message: response.data, type: 'warning', duration: 2000 })
                   } else {
-                    
+
                     this.$notify({ title: '设置成功', message: '设置成功', type: 'success', duration: 2000 })
                     this.create1.dialogFormVisible = false
                     this.getList()
-                    
+
                   }
                 })
           } else {
              this.$notify({ title: '设置失败', message: response.data, type: 'warning', duration: 2000 })
-          
+
           }
         })
-   
 
-       
+
+
     },
 
     handleCreate2() {
- 
+
 
       if (this.selectList.length == 0) {
         this.$message({ type: 'error', message: '请选择推料信息', duration: 2000 })
@@ -688,26 +689,26 @@ export default {
         if (response.msg === 'fail') {
                 this.$notify({ title: '设置失败', message: response.data, type: 'warning', duration: 2000 })
               } else {
-                
+
                 this.$notify({ title: '设置成功', message: '设置成功', type: 'success', duration: 2000 })
                 this.create2.dialogFormVisible = false
                 this.getList()
-                
+
               }
       })
     },
 
 
 
- 
-    
-    
-    
+
+
+
+
 
     change_time1(tag){
       console.log("tag", tag)
         console.log("timetags1", this.timetags1)
-  
+
      this.timetags1.push(tag)
 
     },
@@ -719,23 +720,23 @@ export default {
         console.log("tag", tag)
         console.log("timetags1", this.timetags1)
 
-        
+
         this.timetags1.splice(this.timetags1.indexOf(tag), 1);
     },
 
 
-    
+
     change_time(index,row,item){
         console.log("item", index,row,item)
 
         this.table.list[index].timesArr.push(item)
-         
-       
+
+
     },
     tag_close(index,row,tag){
         console.log("tag", index,row,tag)
         this.table.list[index].timesArr.splice(this.table.list[index].timesArr.indexOf(tag), 1);
-       
+
     },
 
 
@@ -791,7 +792,7 @@ export default {
             "parammaps":{"enable":"1","ids":idsArr.join(",")}
           }
           GetDataByName(send_data).then(response => {
-            
+
 
              if (response.msg == 'fail') {
               this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
@@ -799,9 +800,9 @@ export default {
               this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
               this.getList()
             }
-             
+
           })
-  
+
         })
       }
     },
@@ -824,7 +825,7 @@ export default {
             "parammaps":{"enable":"0","ids":idsArr.join(",")}
           }
           GetDataByName(send_data).then(response => {
-            
+
 
              if (response.msg == 'fail') {
               this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
@@ -832,7 +833,7 @@ export default {
               this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
               this.getList()
             }
-             
+
           })
         })
       }
@@ -872,12 +873,12 @@ export default {
           }
         }
     },
- 
- 
- 
-     
-    
-   
+
+
+
+
+
+
     celldblclick(row, column, cell, event) {
       console.log(row, '=====')
       this.handleUpdate(row)
@@ -898,21 +899,21 @@ export default {
       // 编辑false,编辑保存true
       row.isUpdate = false
       row.isUpdateSave = true
-    
+
     },
     updateData(row) {
-      
-     
+
+
       console.log('点击了编辑保存', row)
-   
+
        row.pastureid =  Cookies.get('pastureid')
-       
- 
+
+
       if (row.tmrid === '' || row.tmrid == null ) {
         this.$message({ type: 'error', message: '推料车名称不能为空', duration: 2000 })
         return false
       }
-     
+
      const positiveInteger = /^[0-9]\d*$/
       if (!positiveInteger.test(parseFloat(row.allowableerror))) {
         this.$message({
@@ -931,7 +932,7 @@ export default {
       }
 
 
-   
+
 
 
 
@@ -945,7 +946,7 @@ export default {
       var timesTempArr = []
       timeArrRea.forEach(function(item){
         timesTempArr.push({"time":item})
-      }) 
+      })
 
       var send_data = {
         "common":{"returnmap":"0"},
@@ -968,7 +969,7 @@ export default {
         ]
       }
 
-    
+
 
       if(row.id == 0){
          var send_data2 =  {
@@ -999,7 +1000,7 @@ export default {
             },
 						{"name": "delPushingDetail","type": "e",
             "parammaps": {"id": row.id }
-            }, 
+            },
 						{"name":"insertPushingDetail",
             "resultmaps":{"list":timesTempArr},
 						"children":[
@@ -1021,21 +1022,21 @@ export default {
                 if (response.msg === 'fail') {
                   this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
                 } else {
-                  
+
                   this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-                
+
                   this.getList()
-                  
+
                 }
               })
           } else {
              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          
+
           }
         })
 
-       
-     
+
+
     },
     updateCancel(row) {
       console.log('点击了编辑取消')
@@ -1064,7 +1065,7 @@ export default {
       console.log('勾选数据', val)
       this.selectList = val
     },
-    
+
     tableRowClassName({ row }) {
       // console.log(row)
       if (row.isColor == '0') {
@@ -1073,10 +1074,10 @@ export default {
         return ''
       }
     },
-  
-   
-    
-  
+
+
+
+
 
 
     // 历史记录
@@ -1112,17 +1113,17 @@ export default {
           this.history.list = response.data.list
           this.history.pageNum = response.data.pageNum
           this.history.pageSize = response.data.pageSize
-          this.history.total = response.data.total
         } else {
           this.history.list = []
         }
+        this.history.total = response.data.total
         setTimeout(() => {
           this.history.listLoading = false
         }, 100)
       })
     },
-  
-  
+
+
     // 应用
     handleApplication() {
       console.log('点击了应用')
@@ -1138,7 +1139,7 @@ export default {
             this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
           } else {
             this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-      
+
             this.getList()
           }
         })
@@ -1146,8 +1147,8 @@ export default {
         this.$message({ type: 'info', message: '已取消应用' })
       })
     },
-    
- 
+
+
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
@@ -1159,7 +1160,7 @@ export default {
         })
       )
     },
- 
+
     blurBw(row) {
       console.log(row)
     },

+ 241 - 83
src/views/formulationPlan/recipeTemplate/index.vue

@@ -247,15 +247,22 @@
             <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">
+            <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
               <template slot-scope="scope">
                 <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
+                <!-- <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>
+                </el-select> -->
+                <el-input v-if="scope.row.Edit" v-model="scope.row.autosecond" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" />
+              </template>
+            </el-table-column>
+            <el-table-column label="允许延时偏差(min)" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.deviation }}</span>
+                <el-input v-if="scope.row.Edit" v-model="scope.row.deviation" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" />
               </template>
             </el-table-column>
             <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
@@ -332,7 +339,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">
@@ -396,7 +403,7 @@
           <div class="recipeTemplate">
             <p>配方模板表</p>
           </div>
-          <div class="operation">
+          <div class="operation1">
             <el-date-picker v-model="template.table.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
             <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
           </div>
@@ -408,7 +415,7 @@
             <el-select v-model="template.table.getdataListParm.parammaps.fttype" placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
               <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
             </el-select>
-            <el-select v-model="template.table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
+            <el-select v-model="template.table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="margin-left:10px;width: 120px;" clearable>
               <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
             <div ref="selectInput" class="filter-item selectInput">
@@ -427,8 +434,8 @@
                 </li>
               </ul>
             </div>
-            <el-button class="successBorder" @click="handleDialogSearch">查询</el-button>
-            <el-button class="successBorder" @click="handleDialogRefresh">重置</el-button>
+            <el-button class="successBorder" @click="handleDialogSearch" style="margin-left:10px;">查询</el-button>
+            <el-button class="successBorder" @click="handleDialogRefresh" style="margin-left:10px;">重置</el-button>
           </div>
 
           <div class="table">
@@ -1012,6 +1019,7 @@ export default {
 
       requestParam: {},
       requestParam2: {},
+      requestParam3:{},
       download: {
         getdataListParm: {
           name: 'getFTList',
@@ -1142,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] = ''
           }
@@ -1377,6 +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 })
+            }
+          })
         } else {
           const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
           if (isRepeat.test(response.data)) {
@@ -1466,6 +1485,7 @@ export default {
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
+      this.requestParam2 = {}
       this.requestParam2.name = 'checkNumber'
       this.requestParam2.parammaps = {}
       this.requestParam2.parammaps.number = this.table.temp.tcode
@@ -1479,13 +1499,32 @@ export default {
       })
     },
     saveUpdateData() {
+      this.requestParam = {}
       this.requestParam.name = 'updateFT'
       this.requestParam.parammaps = this.table.temp
       PostDataByName(this.requestParam).then(response => {
         console.log('新增保存发送参数', this.requestParam)
         if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
+          this.requestParam3 = {}
+          this.requestParam3.name = 'insertFTHistory'
+          this.requestParam3.type = 'e'
+          this.requestParam3.parammaps = {}
+          this.requestParam3.parammaps.id = this.table.temp.id
+          this.requestParam3.parammaps.createdate = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+          PostDataByName(this.requestParam3).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
+              } 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)) {
@@ -2129,7 +2168,7 @@ export default {
       } else {
         var mysort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
       }
-      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0', 'islockcount': '0', 'sort': mysort })
+      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0','deviation':'0','islockcount': '0', 'sort': mysort })
       console.log(this.table2.list)
     },
     changeFname(item, row) {
@@ -2226,21 +2265,32 @@ export default {
       this.table2.temp.feedgroup = row.feedgroup
       this.table2.temp.preftid = this.table2.temp.preftid
       this.table2.temp.autosecond = row.autosecond
-      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
+      this.table2.temp.deviation = row.deviation
+      if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+        this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
+      } else if (this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+        this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fid == '') {
+      } else if (this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+        this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空', duration: 2000 })
+        return false
+      }else if (this.table2.temp.fid === '') {
         this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fweight == '') {
+      } else if (this.table2.temp.fweight === '') {
         this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.autosecond == '') {
+      } else if (this.table2.temp.autosecond === '') {
         this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
         return false
+      } else if (this.table2.temp.deviation === '') {
+        this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
+        return false
+      }
+      if(parseFloat(this.table2.temp.deviation) > parseFloat(this.table2.temp.autosecond)){
+        this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
+        return false
       }
       if (this.table2.temp.sort !== '') {
         this.table2.temp.sort = this.table2.temp.sort
@@ -2266,18 +2316,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,
@@ -2289,7 +2342,8 @@ export default {
         sort: row.sort,
         feedgroup: row.feedgroup,
         preftid: this.table2.temp.preftid,
-        autosecond: row.autosecond
+        autosecond: row.autosecond,
+        deviation: row.deviation
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
         pastureid: this.table2.temp.pastureid,
@@ -2306,12 +2360,18 @@ 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
+        fid: row.fid,
+        autosecond: row.autosecond
       }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
+      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 => {
         if (response.msg !== 'fail') {
           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
           this.getList2()
@@ -2320,6 +2380,16 @@ export default {
           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         }
       })
+      // ExecDataByConfig(this.requestParam).then(response => {
+      //   console.log('新增保存发送参数', this.requestParam)
+      //   if (response.msg !== 'fail') {
+      //     this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+      //     this.getList2()
+      //     this.getList3()
+      //   } else {
+      //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+      //   }
+      // })
     },
     createCancel2(row) {
       console.log('点击了详情新增取消')
@@ -2342,7 +2412,9 @@ export default {
       row.isGroupDisabled = false
       row.islockcount = String(row.islockcount)
       row.fid = String(row.fid)
-      row.autosecond = String(row.autosecond)
+      // row.autosecond = String(row.autosecond)
+      row.autosecond = row.autosecond
+      row.deviation = row.deviation
       this.table2.temp.fname = row.fname
       this.table2.temp.preftid = row.preftid
       const rowArr = []
@@ -2403,6 +2475,7 @@ export default {
           this.table2.temp.feedgroup = row.feedgroup
           this.table2.temp.preftid = this.table2.temp.preftid
           this.table2.temp.autosecond = row.autosecond
+          this.table2.temp.deviation = row.deviation
           this.table2.temp.id = row.id
           console.log('this.table2.updateList', this.table2.updateList)
           console.log('temp', this.table2.temp)
@@ -2412,21 +2485,31 @@ export default {
           // } else {
           //   status = 1
           // }
-          if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-            this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
+          if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+            this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-            this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
+          } else if (this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+            this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fid == '') {
+          } else if (this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+            this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空1=', duration: 2000 })
+            return false
+          }else if (this.table2.temp.fid === '') {
             this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fweight == '') {
+          } else if (this.table2.temp.fweight === '') {
             this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.autosecond == '') {
+          } else if (this.table2.temp.autosecond === '') {
             this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
             return false
+          } else if (this.table2.temp.deviation === '') {
+            this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
+            return false
+          }
+          if(parseFloat(this.table2.temp.deviation) > parseFloat(this.table2.temp.autosecond)){
+            this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
+            return false
           }
           if (this.table2.temp.sort !== '') {
             this.table2.temp.sort = this.table2.temp.sort
@@ -2445,24 +2528,28 @@ 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
+            fid: row.fid,
+            autosecond: row.autosecond
           }}
           this.requestParam.data[1] = { 'name': 'updateFTdetail', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
@@ -2475,7 +2562,8 @@ export default {
             feedgroup: row.feedgroup,
             preftid: this.table2.temp.preftid,
             autosecond: row.autosecond,
-            id: row.id
+            id: row.id,
+            deviation:row.deviation
           }}
           this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
@@ -2493,6 +2581,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 => {
@@ -2540,17 +2632,20 @@ 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
+            fid: row.fid,
+            autosecond: row.autosecond
           }}
           this.requestParam.data[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
@@ -2566,47 +2661,68 @@ 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[1] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
+          //   pastureid: this.table2.getdataListParm.parammaps.pastureid,
+          //   id: this.table2.getdataListParm.parammaps.ftid
+          // }}
           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
-          }}
-          this.requestParam.data[1] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
-            pastureid: this.table2.getdataListParm.parammaps.pastureid,
-            id: this.table2.getdataListParm.parammaps.ftid
+            fid: row.fid,
+            autosecond: row.autosecond
           }}
-          this.requestParam.data[2] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
+          this.requestParam.data[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
             id: row.id
           }}
-          this.requestParam.data[3] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
+          this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
             ftid: this.table2.getdataListParm.parammaps.ftid,
             type: this.table2.getdataListParm.parammaps.fttypeid,
             status: 1
           }}
-          this.requestParam.data[4] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
+          this.requestParam.data[3] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
             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
+          }}
         }
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
+        const url = 'authdata/ftdetail/edit'
+        const data = this.requestParam
+        postJson(url, data).then(response => {
+          if (response.msg !== 'fail') {
             this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
             this.getList2()
             this.getList3()
+          } else {
+            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
           }
         })
+        // ExecDataByConfig(this.requestParam).then(response => {
+        //   console.log('新增保存发送参数', this.requestParam)
+        //   if (response.msg === 'fail') {
+        //     this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+        //   } else {
+        //     this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
+        //     this.getList2()
+        //     this.getList3()
+        //   }
+        // })
       }).catch(() => {
         this.$message({ type: 'info', message: '已取消删除' })
       })
@@ -2628,8 +2744,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 = []
@@ -2638,9 +2756,10 @@ 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'
+              fid: '@insertSpotList.fid',
+              autosecond: '@insertSpotList.autosecond'
             }}
             this.requestParam.data[0].children[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
               id: '@insertSpotList.id',
@@ -2650,34 +2769,73 @@ export default {
               pastureid: this.table2.getdataListParm.parammaps.pastureid,
               id: this.table2.getdataListParm.parammaps.ftid
             }}
-          } else {
-            this.requestParam.common = { 'returnmap': '0' }
-            this.requestParam.data = []
-            this.requestParam.data[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
+            this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
               pastureid: this.table2.getdataListParm.parammaps.pastureid,
-              id: this.table2.getdataListParm.parammaps.ftid
+              ftid:this.table2.getdataListParm.parammaps.ftid,
+              type: this.table2.getdataListParm.parammaps.fttypeid,
+              status: 1
             }}
-            this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
-            this.requestParam.data[1].children = []
-            this.requestParam.data[1].children[0] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
+            this.requestParam.data[3] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
+              id:this.table2.getdataListParm.parammaps.ftid,
+              createdate:dateTime
             }}
-            this.requestParam.data[2] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
+            const url = 'authdata/ftdetail/edit'
+            const data = this.requestParam
+            postJson(url, data).then(response => {
+              if (response.msg !== 'fail') {
+                this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
+                this.getList2()
+                this.getList3()
+              } else {
+                this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            })
+          } else {
+            this.requestParam.common = { 'returnmap': '0' }
+            this.requestParam.data = []
+            // this.requestParam.data[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
+            //   pastureid: this.table2.getdataListParm.parammaps.pastureid,
+            //   id: this.table2.getdataListParm.parammaps.ftid
+            // }}
+            // this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
+            // this.requestParam.data[1].children = []
+            // this.requestParam.data[1].children[0] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
+            //   id: '@insertSpotList.id',
+            //   pastureid: '@insertSpotList.pastureid'
+            // }}
+            this.requestParam.data[0] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
               pastureid: this.table2.getdataListParm.parammaps.pastureid,
               id: this.table2.getdataListParm.parammaps.ftid
             }}
+            // this.requestParam.data[3] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
+            //   pastureid: this.table2.getdataListParm.parammaps.pastureid,
+            //   ftid:this.table2.getdataListParm.parammaps.ftid,
+            //   type: this.table2.getdataListParm.parammaps.fttypeid,
+            //   status: 1
+            // }}
+            ExecDataByConfig(this.requestParam).then(response => {
+              console.log('删除保存发送参数', this.requestParam)
+              if (response.msg === 'fail') {
+                this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+              } else {
+                const url = 'authdata/ftdetai/del'
+                const data = {}
+                data.parammaps = {}
+                data.parammaps.pastureid = this.table2.getdataListParm.parammaps.pastureid
+                data.parammaps.ftid = this.table2.getdataListParm.parammaps.ftid
+                data.parammaps.type = this.table2.getdataListParm.parammaps.fttypeid
+                postJson(url, data).then(response => {
+                  if (response.msg !== 'fail') {
+                    this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
+                    this.getList2()
+                    this.getList3()
+                  } else {
+                    this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+                  }
+                })
+              }
+            })
           }
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('删除保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
-              this.getList2()
-              this.getList3()
-            }
-          })
         })
       }
     },
@@ -3121,8 +3279,8 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
-  .search{margin-top:10px;height: 40px;}
-  .operation{height: 50px;}
+  // .search{margin-top:10px;height: 40px;}
+  // .operation{height: 50px;}
   .table{margin-top:5px;}
   .table2{margin-top:10px;}
   $width:350px;

+ 0 - 3117
src/views/formulationPlan/recipeTemplate/index备.vue

@@ -1,3117 +0,0 @@
-<template>
-  <div ref="appContainer" class="app-container">
-    <div ref="myContainer" class="myContainer">
-      <!-- 配方模板表 -->
-      <div ref="template" class="template">
-        <div class="recipeTemplate">
-          <p>配方模板表</p>
-        </div>
-        <div class="search">
-          <el-select v-model="table.getdataListParm.parammaps.ccname" filterable placeholder="牲畜类别" class="filter-item" clearable>
-            <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.label" />
-          </el-select>
-          <el-select v-model="table.getdataListParm.parammaps.fttype" filterable placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
-            <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
-          </el-select>
-          <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
-            <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
-          </el-select>
-          <div ref="selectInput" class="filter-item selectInput">
-            <el-input v-model="table.getdataListParm.parammaps.all" type="text" placeholder="请点击选择搜索条件" class="Input" />
-            <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
-            <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
-            <ul v-if="arrowUp" class="selectUl">
-              <li><a>配方名称</a><el-input v-model="table.getdataListParm.parammaps.tname" clearable style="width: 245px;" /></li>
-              <li><a>备注</a><el-input v-model="table.getdataListParm.parammaps.remark" clearable style="width: 245px;" /></li>
-              <li><a>来源</a><el-input v-model="table.getdataListParm.parammaps.source" clearable style="width: 245px;" /></li>
-              <li>
-                <div style="float: right;">
-                  <el-button class="downminCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
-                  <el-button class="miniPrimary" @click="handleSearch">搜索</el-button>
-                </div>
-              </li>
-            </ul>
-          </div>
-          <el-button class="successBorder" @click="handleSearch">查询</el-button>
-          <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-        </div>
-        <div class="operation">
-          <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
-          <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
-          <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制</el-button>
-          <el-upload style="float: right;margin-right: 15px;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-            <el-button v-if="isRoleEdit" class="export" icon="el-icon-download" style="float: right;">导入</el-button>
-          </el-upload>
-          <el-dropdown style="float: right;">
-            <el-button class="export" icon="el-icon-upload2">导出</el-button>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
-              <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-          <el-button class="export" style="float: right;" @click="handleRecipeRecord">配方记录</el-button>
-        </div>
-        <div ref="table" class="table">
-          <el-table
-            :key="table.tableKey"
-            v-loading="table.listLoading"
-            element-loading-text="给我一点时间"
-            :data="table.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 98%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-            :height="myheight"
-            @row-click="tableRowClick"
-            @selection-change="handleSelectionChange"
-          >
-            <el-table-column type="selection" align="center" width="50" />
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="配方名称" min-width="90px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.tname }}</span>
-                <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:98%;padding:10px 0;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="配方编码" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.tcode }}</span>
-                <!-- <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:98%;padding:10px 0;" /> -->
-                <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" disabled maxlength="32" style="width:98%;padding:10px 0;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="配方颜色" min-width="70px" align="center">
-              <template slot-scope="scope">
-                <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" :disabled="scope.row.NoEdit" />
-              </template>
-            </el-table-column>
-            <el-table-column label="牲畜类别" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.ccname }}</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.ccid" filterable placeholder="牲畜类别" class="filter-item" style="width:95%;padding:10px 0;" @change="changeLivestockType">
-                  <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="配方类型" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.fttype }}</span>
-                <el-select v-if="scope.row.Edit && scope.row.isCreate == true" v-model="scope.row.fttypeid" filterable placeholder="配方类型" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
-                  <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-                <el-select v-if="scope.row.Edit && scope.row.isUpdateSave == true" v-model="scope.row.fttypeid" disabled filterable placeholder="配方类型" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
-                  <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="来源" min-width="90px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.source }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="备注" min-width="90px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.remark }}</span>
-                <el-input v-if="scope.row.Edit" v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" style="width:95%;padding:10px 0;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="版本号" min-width="90px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.version }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="是否启用" min-width="90px" align="center">
-              <template slot-scope="scope">
-                <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
-              </template>
-            </el-table-column>
-            <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
-              <template slot-scope="{row}">
-                <el-button v-if="row.NoEdit && isRoleEdit && ispastureuse==0" icon="el-icon-tickets" class="miniSuccess" @click="handleRowRecipeRecord(row)" />
-                <span v-if="row.NoEdit && isRoleEdit && ispastureuse ==0" icon="el-icon-data-line" class="centerSpan">|</span>
-                <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
-                <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
-                <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-                <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
-                <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
-                <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-                <span v-if="row.NoEdit && isRoleEdit && ispastureuse ==0" icon="el-icon-data-line" class="centerSpan">|</span>
-                <el-button v-if="row.NoEdit && isRoleEdit && ispastureuse==0" icon="el-icon-data-line" class="miniSuccess" @click="handleFormulationEvaluation(row)" />
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;">共{{ table.total }}条</span>
-      </div>
-      <!-- 配方详情表 -->
-      <div v-if="isDetail" ref="detail" class="detail">
-        <div class="recipeTemplate">
-          <p>配方详情表</p>
-        </div>
-        <div class="operation">
-          <el-button v-if="isRoleEdit" style="float: left;" icon="el-icon-plus" class="success" @click="handleCreate2">新增</el-button>
-          <el-button v-if="isRoleEdit" style="float: left;" icon="el-icon-delete" class="danger" @click="handleDelete2">删除</el-button>
-          <el-button v-if="isRoleEdit" style="float: left;" class="success" icon="el-icon-takeaway-box" @click="handleSyntheticPremix">合成预混料</el-button>
-          <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder">更改顺序</el-button>
-          <div v-else style="float: left;margin-left: 10px;">
-            <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
-            <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
-          </div>
-          <div ref="selectInput2" class="filter-item selectInput" style="margin: 0 10px;">
-            <el-input v-model="table2.getdataListParm.parammaps.all" type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
-            <i v-if="arrowDown2" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
-            <i v-if="arrowUp2" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
-            <ul v-if="arrowUp2" class="selectUl">
-              <li>
-                <a style="width: 130px;">饲料名称</a>
-                <el-select v-model="table2.getdataListParm.parammaps.fname" filterable placeholder="" style="width:190px;">
-                  <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.fname" />
-                </el-select>
-              </li>
-              <li><a style="width: 130px;">饲料组名称</a><el-input v-model="table2.getdataListParm.parammaps.feedgroup" style="width: 190px;" /></li>
-              <li><a style="width: 130px;">重量</a><el-input v-model="table2.getdataListParm.parammaps.fweight" style="width: 190px;" /></li>
-              <li>
-                <a style="width: 130px;">搅拌延时</a>
-                <el-select v-model="table2.getdataListParm.parammaps.autosecondname" filterable placeholder="" style="width:190px;" clearable>
-                  <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.name" />
-                </el-select>
-              </li>
-              <li>
-                <a style="width: 130px;">是否锁定牛头数比例</a>
-                <el-select v-model="table2.getdataListParm.parammaps.islockcount" placeholder="" style="width:190px;" clearable>
-                  <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </li>
-              <li><a style="width: 130px;">顺序</a><el-input v-model="table2.getdataListParm.parammaps.sort" style="width: 190px;" /></li>
-              <li>
-                <div style="float: right;">
-                  <el-button class="downminCancel" @click="arrowUp2=false;arrowDown2=true;">取消</el-button>
-                  <el-button class="miniPrimary" @click="handleSearch2">搜索</el-button>
-                </div>
-              </li>
-            </ul>
-          </div>
-          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
-          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
-          <el-button class="hide" @click="handleCloseTable2">隐藏</el-button>
-          <el-button v-if="isEnlarge" class="hide2" @click="handleEnlarge">放大</el-button>
-          <el-button v-else class="hide2" @click="handleNarrow">缩小</el-button>
-        </div>
-        <div v-if="isEnlarge" class="table2">
-          <el-table
-            id="table2"
-            ref="table2"
-            :key="table2.tableKey"
-            v-loading="table2.listLoading"
-            element-loading-text="给我一点时间"
-            :data="table2.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 98%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable"
-            row-key="id"
-            show-summary
-            :max-height="220"
-            :summary-method="getSummaries"
-            @selection-change="handleSelectionChange2"
-            @cell-dblclick="celldblclick"
-          >
-            <el-table-column type="selection" width="50" />
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="饲料组" min-width="120px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.groupNoEdit">{{ scope.row.feedgroup }}</span>
-                <el-input v-if="scope.row.groupEdit" v-model="scope.row.feedgroup" :disabled="scope.row.isGroupDisabled" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="饲料名称" min-width="120px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.fname }}</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.fid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFname(value, scope.row)}">
-                  <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <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;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
-                <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>
-              </template>
-            </el-table-column>
-            <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit && scope.row.islockcount == '0'">否</span>
-                <span v-if="scope.row.NoEdit && scope.row.islockcount == '1'">是</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.islockcount" placeholder="" class="filter-item" style="width:95%;padding:10px 0;">
-                  <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="顺序" min-width="70px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
-                <el-input v-if="scope.row.Edit" v-model="scope.row.sort" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" @blur="blurSort(scope.row)" />
-              </template>
-            </el-table-column>
-
-            <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
-              <template slot-scope="{row}">
-                <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData2(row)" />
-                <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel2(row)" />
-                <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
-                <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete2(row)" />
-                <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row)" />
-                <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
-                <span v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" icon="el-icon-connection" class="miniSuccess" @click="handleSplitPremix(row)" />
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div v-else class="table2">
-          <el-table
-            id="table2"
-            ref="mytable2"
-            :key="table2.tableKey"
-            v-loading="table2.listLoading"
-            element-loading-text="给我一点时间"
-            :data="table2.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 98%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable"
-            row-key="id"
-            show-summary
-            :max-height="enlargeHeight"
-            :summary-method="getSummaries"
-            @selection-change="handleSelectionChange2"
-            @cell-dblclick="celldblclick"
-          >
-            <el-table-column type="selection" width="50" />
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="饲料组" min-width="120px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.groupNoEdit">{{ scope.row.feedgroup }}</span>
-                <el-input v-if="scope.row.groupEdit" v-model="scope.row.feedgroup" :disabled="scope.row.isGroupDisabled" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="饲料名称" min-width="120px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.fname }}</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.fid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFname(value, scope.row)}">
-                  <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <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;" />
-              </template>
-            </el-table-column>
-            <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
-                <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>
-              </template>
-            </el-table-column>
-            <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit && scope.row.islockcount == '0'">否</span>
-                <span v-if="scope.row.NoEdit && scope.row.islockcount == '1'">是</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.islockcount" placeholder="" class="filter-item" style="width:95%;padding:10px 0;">
-                  <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="顺序" min-width="70px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
-                <el-input v-if="scope.row.Edit" v-model="scope.row.sort" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" @blur="blurSort(scope.row)" />
-              </template>
-            </el-table-column>
-            <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
-              <template slot-scope="{row}">
-                <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData2(row)" />
-                <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel2(row)" />
-                <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
-                <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete2(row)" />
-                <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row)" />
-                <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
-                <span v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" class="centerSpan">|</span>
-                <el-button v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" icon="el-icon-connection" class="miniSuccess" @click="handleSplitPremix(row)" />
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-      </div>
-    </div>
-    <!-- 配方模板表 -->
-    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="template.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[template.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
-      <div class="dialogMinHeight" style="overflow-y: auto;margin-bottom: 0px;overflow-x: hidden;">
-        <div ref="templateDialog" class="templateDialog">
-          <div class="recipeTemplate">
-            <p>配方模板表</p>
-          </div>
-          <div class="operation">
-            <el-date-picker v-model="template.table.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
-            <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
-          </div>
-
-          <div class="search">
-            <el-select v-model="template.table.getdataListParm.parammaps.ccname" placeholder="牲畜类别" class="filter-item" clearable>
-              <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.label" />
-            </el-select>
-            <el-select v-model="template.table.getdataListParm.parammaps.fttype" placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
-              <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
-            </el-select>
-            <el-select v-model="template.table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
-              <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-            <div ref="selectInput" class="filter-item selectInput">
-              <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
-              <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
-              <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
-              <ul v-if="arrowUp" class="selectUl">
-                <li><a>配方名称</a><el-input v-model="template.table.getdataListParm.parammaps.tname" style="width: 245px;" /></li>
-                <li><a>备注</a><el-input v-model="template.table.getdataListParm.parammaps.remark" style="width: 245px;" /></li>
-                <li><a>来源</a><el-input v-model="template.table.getdataListParm.parammaps.source" style="width: 245px;" /></li>
-                <li>
-                  <div style="float: right;">
-                    <el-button class="downminCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
-                    <el-button class="miniPrimary" @click="handleDialogSearch">搜索</el-button>
-                  </div>
-                </li>
-              </ul>
-            </div>
-            <el-button class="successBorder" @click="handleDialogSearch">查询</el-button>
-            <el-button class="successBorder" @click="handleDialogRefresh">重置</el-button>
-          </div>
-
-          <div class="table">
-            <el-table
-              :key="template.table.tableKey"
-              v-loading="template.table.listLoading"
-              element-loading-text="给我一点时间"
-              :data="template.table.list"
-              border
-              fit
-              highlight-current-row
-              style="width: 98%;"
-              :row-style="rowStyle"
-              :height="myheight2"
-              :cell-style="cellStyle"
-              class="elTable table-fixed"
-              @row-click="tableRowClickDialog"
-            >
-              <el-table-column v-if="template.dialogStatus == 'RecipeRecord'" label="序号" align="center" type="index" width="50px" />
-              <el-table-column v-else label="序号" align="center" type="index" width="50px">
-                <template slot-scope="scope">
-                  <span>{{ scope.$index + (template.table.pageNum-1) * template.table.pageSize + 1 }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="配方名称" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.tname }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="配方编码" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.tcode }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="配方颜色" min-width="110px" align="center">
-                <template slot-scope="scope">
-                  <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" />
-                </template>
-              </el-table-column>
-              <el-table-column label="牲畜类别" min-width="110px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.ccname }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="配方类型" min-width="110px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.fttype }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="来源" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.source }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备注" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.remark }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="版本号" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.version }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="版本时间" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.versiontime }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="是否启用" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </div>
-
-        <div v-if="isDetailDialog" id="detailDialog2" ref="detailDialog2" class="detailDialog" style="margin-top: 30px;height: 200px;overflow-y: auto;overflow-x: hidden;">
-          <div class="recipeTemplate">
-            <p>配方详情表</p>
-          </div>
-          <div class="operation">
-            <div ref="selectInput2" class="filter-item selectInput">
-              <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
-              <i v-if="arrowDown2" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
-              <i v-if="arrowUp2" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
-              <ul v-if="arrowUp2" class="selectUl">
-                <li>
-                  <a style="width: 130px;">饲料名称</a>
-                  <el-select v-model="template.table2.getdataListParm.parammaps.fname" filterable placeholder="" style="width:245px;">
-                    <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.fname" />
-                  </el-select>
-                </li>
-                <li><a style="width: 130px;">饲料组名称</a><el-input v-model="template.table2.getdataListParm.parammaps.feedgroup" style="width: 245px;" /></li>
-                <li><a style="width: 130px;">重量</a><el-input v-model="template.table2.getdataListParm.parammaps.fweight" style="width: 245px;" /></li>
-                <li>
-                  <a style="width: 130px;">搅拌延时</a>
-                  <el-select v-model="template.table2.getdataListParm.parammaps.autosecondname" filterable placeholder="" style="width:245px;">
-                    <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.name" />
-                  </el-select>
-                </li>
-                <li>
-                  <a style="width: 130px;">是否锁定牛头数比例</a>
-                  <el-select v-model="template.table2.getdataListParm.parammaps.islockcount" placeholder="" style="width:245px;">
-                    <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
-                </li>
-                <li><a style="width: 130px;">顺序</a><el-input v-model="template.table2.getdataListParm.parammaps.sort" style="width: 245px;" /></li>
-                <li>
-                  <div style="float: right;">
-                    <el-button class="downminCancel" @click="arrowUp2=false;arrowDown2=true;">取消</el-button>
-                    <el-button class="miniPrimary" @click="handleDialogSearch2">搜索</el-button>
-                  </div>
-                </li>
-              </ul>
-            </div>
-            <el-button class="successBorder" @click="handleDialogSearch2">查询</el-button>
-            <el-button class="successBorder" @click="handleDialogRefresh2">重置</el-button>
-            <el-button class="hide" @click="handleDialogCloseTable2">隐藏</el-button>
-          </div>
-
-          <div class="table2">
-            <el-table
-              id="templateTable2"
-              :key="template.table2.tableKey"
-              v-loading="template.table2.listLoading"
-              element-loading-text="给我一点时间"
-              :data="template.table2.list"
-              border
-              fit
-              highlight-current-row
-              style="width: 98%;"
-              :summary-method="getTemplateTable2Summaries"
-              show-summary
-              :row-style="rowStyle"
-              :cell-style="cellStyle"
-              class="elTable table-fixed"
-              row-key="id"
-            >
-              <el-table-column label="饲料组" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.feedgroup }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="饲料名称" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.fname }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="重量(KG)" prop="fweight" min-width="200px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.fweight }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="搅拌延时(min)" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.autosecondname }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="是否锁定牛头数比例" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.islockcount == '0'">否</span>
-                  <span v-if="scope.row.islockcount == '1'">是</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="顺序" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.sort }}</span>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </div>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button class="cancelClose cancelClose1" @click="template.dialogFormVisible = false; ">关闭</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 合成预混料 -->
-    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="detail.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[detail.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
-      <div class="detailDialog">
-        <h2>饲料</h2>
-        <div class="table1">
-          <el-table
-            :key="detail.tableKey"
-            v-loading="detail.listLoading"
-            element-loading-text="给我一点时间"
-            :data="detail.list"
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-            show-summary
-          >
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="饲料名称" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.fname }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="fweight" label="重量(KG)" />
-            <el-table-column label="搅拌延时(min)" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.autosecond }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.islockcount == '0'">否</span>
-                <span v-if="scope.row.islockcount == '1'">是</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="顺序" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.sort }}</span>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <h2>合成预混料</h2>
-        <div class="table2" style="margin-bottom: 50px;">
-          <el-table
-            :key="detail.tableKey2"
-            v-loading="detail.listLoading2"
-            element-loading-text="给我一点时间"
-            :data="detail.list2"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-          >
-            <el-table-column label="配方名称" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.tname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" :disabled="detail.disabled" />
-              </template>
-            </el-table-column>
-            <el-table-column label="配方颜色" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" :disabled="detail.disabled" />
-              </template>
-            </el-table-column>
-            <el-table-column label="牲畜类别" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-select v-model="scope.row.ccid" placeholder="选择牲畜父类" class="filter-item" style="width:95%;padding:10px 0;" :disabled="detail.disabled" @change="changeLivestockType2">
-                  <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="配方类型" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.fttype }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="来源" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.source }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="备注" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" :disabled="detail.disabled" />
-              </template>
-            </el-table-column>
-            <el-table-column label="是否启用" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" :disabled="detail.disabled" />
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="detail.dialogFormVisible = false; ">关闭</el-button>
-          <el-button class="save" :disabled="isokDisable" @click="syntheticPremixData()">确认</el-button>
-        </div>
-      </div>
-    </el-dialog>
-    <!-- 历史记录 -->
-    <el-dialog :title="textMap[historyRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div class="historyRecord">
-        <keep-alive>
-          <component :is="historyRecord.myComponent" ref="historyRecord" />
-        </keep-alive>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 行内配方记录 -->
-    <el-dialog :title="textMap[rowRecipeRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="rowRecipeRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div class="rowRecipeRecord">
-        <div class="search">
-          <el-date-picker ref="inputDatetime" v-model="rowRecipeRecord.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="handleRowRecipeRecordSearch">查询</el-button>
-        </div>
-        <div class="table">
-          <el-table
-            :key="rowRecipeRecord.tableKey"
-            v-loading="rowRecipeRecord.listLoading"
-            element-loading-text="给我一点时间"
-            :data="rowRecipeRecord.list"
-            border
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-          >
-            <el-table-column label="序号" align="center" type="index" width="50px">
-              <template slot-scope="scope">
-                <span>{{ scope.$index + (rowRecipeRecord.pageNum-1) * rowRecipeRecord.pageSize + 1 }}</span>
-              </template>
-            </el-table-column>
-            <!-- <el-table-column label="序号" width="60px" align="center" prop="sort" /> -->
-            <el-table-column label="修改时间" width="100px" 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;margin: 5px 5px;padding: 0;height: 30px;">
-                  <el-tooltip v-if="element.change== 'red'" placement="top">
-                    <div slot="content">{{ element.name }}( {{ element.weight }} / {{ element.Eweight }} )</div>
-                    <span :style="{'color':element.change}" style="display: block;height:30px;line-height: 30px;">
-                      {{ element.name }}( {{ element.weight }} / {{ element.Eweight }} )
-                    </span>
-                  </el-tooltip>
-                  <el-tooltip v-else placement="top">
-                    <div slot="content">{{ element.name }}( {{ element.weight }} )</div>
-                    <span :style="{'color':element.change}" style="display: block;height:30px;line-height: 30px;">
-                      {{ element.name }}( {{ element.weight }})
-                    </span>
-                  </el-tooltip>
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-          <pagination v-show="rowRecipeRecord.total>=0" :total="rowRecipeRecord.total" :page.sync="rowRecipeRecord.getdataListParm.offset" :limit.sync="rowRecipeRecord.getdataListParm.pagecount" @pagination="getRowRecipeRecordList()" />
-        </div>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose1" @click="rowRecipeRecord.dialogFormVisible = false; ">关闭</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, PostDataByName, failproccess, checkButtons, postJson, ExecDataByConfig, formatNum } from '@/api/common'
-import Sortable from 'sortablejs'
-import { MessageBox } from 'element-ui'
-import Cookies from 'js-cookie'
-import { json2excel } from '@/utils/index.js'
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-import { parseTime } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'RecipeTemplate',
-  components: { Pagination },
-  data() {
-    return {
-      dialogFull: false,
-      predefineColors: [
-        '#E57373', '#F06292', '#BA68C8', '#9575CD', '#7986CB', '#64B5F6', '#4FC3F7', '#4DD0E1', '#4DB6AC', '#81C784', '#AED581', '#DCE775', '#FFF176', '#FFD54F', '#FFB74D', '#FF8A65', '#A1887F', '#E0E0E0', '#90A4AE'
-      ],
-      isRoleEdit: [],
-      myheight: '',
-      requestParams: [
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] },
-        { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['配方类型'] },
-        { name: 'getFeedAndPre', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
-      ],
-      enableList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否启用
-      lockBullsList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否锁定牛头数比例
-      livestockTypeList: [], // 牲畜类别
-      formulaTypeList: [], // 配方类型
-      feedNameList: [], // 饲料名称
-      mixingDelayList: [{ id: '0', name: '0' }, { id: '1', name: '1' }, { id: '2', name: '2' }, { id: '3', name: '3' }, { id: '4', name: '4' }, { id: '5', name: '5' }, { id: '6', name: '6' }, { id: '7', name: '7' }, { id: '8', name: '8' }, { id: '9', name: '9' }, { id: '10', name: '10' }, { id: '11', name: '11' }, { id: '12', name: '12' }, { id: '13', name: '13' }, { id: '14', name: '14' }, { id: '15', name: '15' }], // 搅拌延时
-      selectHistoryTimeList: [{ id: 0, name: '2020-06-10' }, { id: 1, name: '2020-06-11' }, { id: 2, name: '2020-06-12' }, { id: 3, name: '2020-06-13' }], // 请选择历史记录时间
-      sourceList: [{ id: 0, name: '自定义' }, { id: 1, name: '集团下发' }, { id: 2, name: '导入' }], // 导入
-
-      arrowDown: true,
-      arrowUp: false,
-      ispastureuse: Cookies.get('ispastureuse'),
-      table: {
-        getdataListParm: {
-          name: 'getFTList',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            tname: '',
-            ccid: '',
-            ccname: '',
-            fttypeid: '',
-            fttype: '',
-            remark: '',
-            enable: '',
-            source: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {}
-      },
-      lockCount: {
-        getdataListParm: {
-          name: 'getSysoptEnable',
-          page: 1,
-          offset: 1,
-          pagecount: 30,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inforname: 'isLockCount'
-          }
-        },
-        isLockCount: false // 是否显示是否锁定牛头数比例
-      },
-      isDetail: false,
-      arrowDown2: true,
-      arrowUp2: false,
-      table2: {
-        getDryweightParm: {
-          name: 'getFTdryweight',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: '',
-            ftid: ''
-          }
-        },
-        dryweight: '',
-        getdataListParm: {
-          name: 'getFTdetailList',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            fname: '',
-            feedgroup: '',
-            fweight: '',
-            autosecondname: '',
-            islockcount: '',
-            sort: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {},
-        updateList: {}
-      },
-      isDetailDialog: false,
-      template: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        table: {
-          getdataListParm: {
-            name: 'getFTListDate',
-            page: 1,
-            offset: 1,
-            pagecount: '',
-            returntype: 'Map',
-            parammaps: {
-              pastureid: Cookies.get('pastureid'),
-              tname: '',
-              ccid: '',
-              ccname: '',
-              fttype: '',
-              remark: '',
-              enable: '',
-              date: '',
-              source: ''
-            }
-          },
-          tableKey: 0,
-          total: 0,
-          listLoading: true,
-          list: []
-        },
-        table2: {
-          getdataListParm: {
-            name: 'getFTdetailListDate',
-            page: 1,
-            offset: 1,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {
-              pastureid: Cookies.get('pastureid'),
-              fname: '',
-              fweight: '',
-              islockcount: '',
-              sort: '',
-              feedgroup: '',
-              autosecondname: ''
-            }
-          },
-          tableKey: 0,
-          total: 0,
-          listLoading: true,
-          list: []
-        },
-        // 历史日期
-        getdataDateParm: {
-          name: 'getFTMaxDate',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        }
-      },
-
-      isOrder: true,
-      detail: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        tableKey: 0,
-        total: 0,
-        listLoading: true,
-        list: [],
-        tableKey2: 0,
-        total2: 0,
-        listLoading2: false,
-        list2: [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }],
-        getdataListParm: {
-          name: 'getFTDetailCompare',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {}
-        },
-        list3: [],
-        disabled: false,
-        getdataListParm2: {
-          name: 'getFTCompare',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {}
-        }
-      },
-      selectList: [],
-      selectList2: [],
-      textMap: {
-        RecipeRecord: '配方记录',
-        SyntheticPremix: '合成预混料',
-        historyRecord: '历史记录',
-        detail: '饲料详情',
-        rowRecipeRecordTxt: '配方修改记录'
-      },
-
-      requestParam: {},
-      requestParam2: {},
-      download: {
-        getdataListParm: {
-          name: 'getFTList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            tname: '',
-            ccid: '',
-            ccname: '',
-            fttypeid: '',
-            fttype: '',
-            remark: '',
-            enable: ''
-          }
-        },
-        list: []
-      },
-      historyRecord: {
-        dialogStatus: '',
-        dialogFormVisible: false
-      },
-      isokDisable: false,
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      dropState: false,
-      myheight2: 0,
-      height: 0,
-      rowRecipeRecord: {
-        dialogStatus: '',
-        dialogFormVisible: false,
-        getdataListParm: {
-          name: 'getFitHistory1', 'name1': 'getFitHistory2', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-          parammaps: { inputDatetime: '', pastureid: '', fitid: '' }
-        },
-        tableKey: 0, total: 0, listLoading: true, list: []
-      },
-      isEnlarge: true,
-      // enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
-      enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
-      getTcodeParm: {
-        name: 'getTcode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureid: '', fttypeid: '' }
-      }
-    }
-  },
-  computed: {
-    // 设置请求头
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'checkfttype,checkbigcowclass,checkFeed,insertFTUpload,insertFTdetailUpload',
-        importParams: '配方名称,牲畜类别,配方类型,备注,饲料组,饲料名称,重量(kg),搅拌延时(min),是否锁定牛头数比例',
-        sheetname: 'Sheet1',
-        // 登录牧场
-        pastureid: Cookies.get('pastureid'),
-        // 日期参数
-        dateParams: '',
-        // 必填参数
-        requiredParams: '配方名称,牲畜类别,配方类型,饲料名称,重量(kg),搅拌延时(min),是否锁定牛头数比例',
-        // 为数值的参数
-        numParams: '重量(kg),搅拌延时(min)'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  mounted() {
-    document.addEventListener('click', (e) => {
-      if (this.$refs.selectInput !== undefined) {
-        if (!this.$refs.selectInput.contains(e.target)) {
-          this.arrowDown = true
-          this.arrowUp = false
-        } else {
-          this.arrowDown = false
-          this.arrowUp = true
-        }
-      }
-      if (this.$refs.selectInput2 !== undefined) {
-        if (!this.$refs.selectInput2.contains(e.target)) {
-          this.arrowDown2 = true
-          this.arrowUp2 = false
-        } else {
-          this.arrowDown2 = false
-          this.arrowUp2 = true
-        }
-      }
-    })
-  },
-  created() {
-    this.getList()
-    this.getButtons()
-    this.getDownList()
-    this.getIsLockCount()
-  },
-  methods: {
-    getButtons() {
-      const Edit = 'FormulationEvaluation'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getSummaries(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)
-            sums[index] = sums[index].toFixed(3) + '(干物质量:' + this.table2.dryweight + ')'
-          } else {
-            sums[index] = ''
-          }
-        }
-      })
-      // console.log(sums, 'sums[index]')
-      return sums
-    },
-    getDryWeight() {
-      GetDataByName(this.table2.getDryweightParm).then(response => {
-        console.log('干物质数据', response.data.list)
-        if (response.data.list[0].dryweight !== undefined) {
-          this.table2.dryweight = response.data.list[0].dryweight
-        } else {
-          this.table2.dryweight = ''
-        }
-      })
-    },
-    getTemplateTable2Summaries(param) {
-      const { columns, data } = param
-      const sums = []
-      columns.forEach((column, index) => {
-        if (index === 0) {
-          sums[index] = '合计'
-          return
-        }
-        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)
-          // 后台待发
-          sums[index] += '(干物质量:' + this.template.table2.getdataListParm.parammaps.dryweight + ')'
-        } else {
-          sums[index] = ''
-        }
-      })
-      return sums
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.livestockTypeList = response.data.getDictByName.list
-        this.formulaTypeList = response.data.getDictByName2.list
-        this.feedNameList = response.data.getFeedAndPre.list
-      })
-    },
-    // -------------------模板-----------------------------
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('配方模板table数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.$set(response.data.list[i], 'Edit', false) // 编辑
-            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
-            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
-            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
-            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
-          }
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-          this.isDetail = false
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    getList3() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.$set(response.data.list[i], 'Edit', false) // 编辑
-            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
-            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
-            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
-            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
-          }
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-          this.isDetail = false
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSearch() {
-      console.log('点击了查询')
-      this.table.getdataListParm.offset = 1
-      this.getList()
-      this.table.getdataListParm.parammaps.all = ''
-      var obj = {}
-      obj.tname = this.table.getdataListParm.parammaps.tname
-      obj.remark = this.table.getdataListParm.parammaps.remark
-      obj.source = this.table.getdataListParm.parammaps.source
-      Object.getOwnPropertyNames(obj).forEach((key) => {
-        console.log(key, obj[key])
-        if (obj[key] !== '') {
-          this.table.getdataListParm.parammaps.all += obj[key] + '/'
-        }
-      })
-      if (this.table.getdataListParm.parammaps.all.charAt(this.table.getdataListParm.parammaps.all.length - 1) == '/') {
-        this.table.getdataListParm.parammaps.all = this.table.getdataListParm.parammaps.all.slice(0, this.table.getdataListParm.parammaps.all.length - 1)
-      }
-      this.arrowDown = true
-      this.arrowUp = false
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.offset = 1
-      this.table.getdataListParm.parammaps.ccid = ''
-      this.table.getdataListParm.parammaps.ccname = ''
-      this.table.getdataListParm.parammaps.fttype = ''
-      this.table.getdataListParm.parammaps.tname = ''
-      this.table.getdataListParm.parammaps.remark = ''
-      this.table.getdataListParm.parammaps.enable = ''
-      this.table.getdataListParm.parammaps.source = ''
-      this.table.getdataListParm.parammaps.all = ''
-      this.getList()
-    },
-
-    // 模板新增
-    handleCreate() {
-      // 编辑true/不可编辑false
-      // 新增操true,编辑false,编辑保存false
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (this.table.list[i].Edit === true) {
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-      }
-      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'tname': '', tcode: '', 'tcolor': '#ccc', 'ccid': '', 'ccname': '', 'fttype': '', 'fttypeid': '', 'source': '自定义', 'remark': '' })
-      console.log('点击了新增this.table.list====>', this.table.list)
-      this.table.temp = this.table.list[0]
-      this.getTcodeList()
-    },
-    getTcodeList() {
-      this.getTcodeParm.parammaps.pastureid = Cookies.get('pastureid')
-      console.log(this.table.temp, 'this.table.temp')
-      GetDataByName(this.getTcodeParm).then(response => {
-        if (response.data.list !== null) {
-          this.table.temp.tcode = response.data.list[0].tcode
-        } else {
-          this.table.temp.tcode = ''
-        }
-      })
-    },
-    // 畜生类别
-    changeLivestockType(item) {
-      this.table.temp.ccname = this.livestockTypeList.find(obj => obj.value === item).label
-    },
-    // 配方类型
-    changeFormulaType(item) {
-      this.table.temp.fttype = this.formulaTypeList.find(obj => obj.value === item).label
-    },
-    createData(row) {
-      console.log('点击了新增保存', row)
-      this.table.temp.tname = row.tname
-      this.table.temp.tcode = row.tcode
-      this.table.temp.tcolor = row.tcolor
-      this.table.temp.ccid = row.ccid
-      this.table.temp.ccname = this.table.temp.ccname
-      this.table.temp.fttype = this.table.temp.fttype
-      this.table.temp.fttypeid = row.fttypeid
-      this.table.temp.source = row.source
-      this.table.temp.remark = row.remark
-      this.table.temp.enable = row.enable
-      this.table.temp.pastureid = Cookies.get('pastureid')
-      if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
-        this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
-        this.$message({ type: 'error', message: '牲畜类别/配方类型不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.tname == '') {
-        this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.ccid == '') {
-        this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.fttypeid == '') {
-        this.$message({ type: 'error', message: '配方类型不能为空', duration: 2000 })
-        return false
-      }
-      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
-      // if (pattern.test(this.table.temp.tname)) {
-      //   this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
-      //   return false
-      // }
-      if (pattern.test(this.table.temp.tcode)) {
-        this.$message({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
-        return false
-      }
-      console.log(this.table.temp)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam2.name = 'checkNumber'
-      this.requestParam2.parammaps = {}
-      this.requestParam2.parammaps.number = this.table.temp.tcode
-      GetDataByName(this.requestParam2).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list[0].vmsg !== '输入非法字符') {
-          this.saveCreateData()
-        } else {
-          this.$notify({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
-        }
-      })
-    },
-    saveCreateData() {
-      this.requestParam.name = 'insertFT'
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
-          if (isRepeat.test(response.data)) {
-            this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
-          } else {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          }
-        }
-      })
-    },
-    createCancel(row) {
-      console.log('点击了新增取消')
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (row.myId === this.table.list[i].myId) {
-          var listIndex = this.table.list.indexOf(this.table.list[i])
-        }
-        if (listIndex > -1) {
-          this.table.list.splice(listIndex, 1)
-          return
-        }
-      }
-    },
-
-    // 模板编辑
-    handleUpdate(row) {
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (this.table.list[i].Edit == true) {
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-      }
-      // 编辑true,不可编辑false
-      row.Edit = true
-      row.NoEdit = false
-      // 新增false,编辑false,编辑保存true
-      row.isCreate = false
-      row.isUpdate = false
-      row.isUpdateSave = true
-      if (row.ccname !== undefined) {
-        row.ccid = String(row.ccid)
-      }
-      this.table.temp.ccname = row.ccname
-      row.fttypeid = String(row.fttypeid)
-      this.table.temp.fttype = row.fttype
-    },
-    updateData(row) {
-      console.log('点击了编辑保存', row)
-      this.table.temp.tname = row.tname
-      this.table.temp.tcode = row.tcode
-      this.table.temp.tcolor = row.tcolor
-      this.table.temp.ccid = row.ccid
-      this.table.temp.fttypeid = row.fttypeid
-      this.table.temp.source = row.source
-      this.table.temp.remark = row.remark
-      this.table.temp.enable = row.enable
-      this.table.temp.ccname = this.table.temp.ccname
-      this.table.temp.fttype = this.table.temp.fttype
-      this.table.temp.pastureid = row.pastureid
-      this.table.temp.id = row.id
-      if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
-        this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
-        this.$message({ type: 'error', message: '牲畜类别/配方类型不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.tname == '') {
-        this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.ccid == '') {
-        this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.fttypeid == '') {
-        this.$message({ type: 'error', message: '配方类型不能为空', duration: 2000 })
-        return false
-      }
-      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
-      // if (pattern.test(this.table.temp.tname)) {
-      //   this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
-      //   return false
-      // }
-      if (pattern.test(this.table.temp.tcode)) {
-        this.$message({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
-        return false
-      }
-      console.log(this.table.temp)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam2.name = 'checkNumber'
-      this.requestParam2.parammaps = {}
-      this.requestParam2.parammaps.number = this.table.temp.tcode
-      GetDataByName(this.requestParam2).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list[0].vmsg !== '输入非法字符') {
-          this.saveUpdateData()
-        } else {
-          this.$notify({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
-        }
-      })
-    },
-    saveUpdateData() {
-      this.requestParam.name = 'updateFT'
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
-          if (isRepeat.test(response.data)) {
-            this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
-          } else {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          }
-        }
-      })
-    },
-    updateCancel(row) {
-      console.log('点击了编辑取消')
-      // 编辑false,不可编辑true
-      row.Edit = false
-      row.NoEdit = true
-      // 新增false,编辑true,编辑保存false
-      row.isCreate = false
-      row.isUpdate = true
-      row.isUpdateSave = false
-      this.getList()
-    },
-
-    // 删除
-    handleRowDelete(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        this.requestParam.data[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
-          pastureid: row.pastureid,
-          id: row.id
-        }}
-        this.requestParam.data[1] = { 'name': 'deleteFT', 'type': 'e', 'parammaps': {
-          pastureid: row.pastureid,
-          id: row.id
-        }}
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-            this.getList()
-            this.isDetail = false
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    handleSelectionChange(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    handleDelete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择配方', duration: 2000 })
-      } else {
-        MessageBox.confirm('是否确认删除此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
-            id: '@insertSpotList.id',
-            pastureid: '@insertSpotList.pastureid'
-          }}
-          this.requestParam.data[0].children[1] = { 'name': 'deleteFT', 'type': 'e', 'parammaps': {
-            id: '@insertSpotList.id',
-            pastureid: '@insertSpotList.pastureid'
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('删除保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-
-    // 复制
-    handleCopy() {
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择配方', duration: 2000 })
-      } else {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': 'copyFT', 'type': 'e', 'parammaps': {
-            ftid: '@insertSpotList.id',
-            pastureid: '@insertSpotList.pastureid'
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('复制保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '复制失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '复制成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-
-    // 配方记录
-    handleRecipeRecord() {
-      console.log('点击了配方记录')
-      this.template.dialogStatus = 'RecipeRecord'
-      this.dialogFull = false
-      this.template.dialogFormVisible = true
-      this.template.table.getdataListParm.parammaps.ccname = ''
-      this.template.table.getdataListParm.parammaps.fttype = ''
-      this.template.table.getdataListParm.parammaps.enable = ''
-      this.template.table.getdataListParm.parammaps.tname = ''
-      this.template.table.getdataListParm.parammaps.remark = ''
-      this.template.table.getdataListParm.parammaps.source = ''
-      this.template.table.getdataListParm.offset = 1
-      this.getDateList()
-      this.isDetailDialog = false
-      this.myheight2 = document.documentElement.clientHeight - 85 - 265
-    },
-    // 历史时间
-    getDateList() {
-      GetDataByName(this.template.getdataDateParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.template.table.getdataListParm.parammaps.date = response.data.list[0].maxdate
-          this.getTemplateDialogList()
-        } else {
-          this.template.table.getdataListParm.parammaps.date = ''
-        }
-      })
-    },
-    // 配方记录-模板
-    getTemplateDialogList() {
-      this.template.table.listLoading = true
-      GetDataByName(this.template.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.template.table.list = response.data.list
-          this.template.table.pageNum = response.data.pageNum
-          this.template.table.pageSize = response.data.pageSize
-          this.template.table.total = response.data.total
-        } else {
-          this.template.table.list = []
-          this.template.table2.list = []
-        }
-        setTimeout(() => {
-          this.template.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleDialogSearch() {
-      this.template.table.getdataListParm.offset = 1
-      this.getTemplateDialogList()
-      this.arrowDown = true
-      this.arrowUp = false
-    },
-    handleDialogRefresh() {
-      this.template.table.getdataListParm.parammaps.ccname = ''
-      this.template.table.getdataListParm.parammaps.fttype = ''
-      this.template.table.getdataListParm.parammaps.enable = ''
-      this.template.table.getdataListParm.parammaps.tname = ''
-      this.template.table.getdataListParm.parammaps.remark = ''
-      this.template.table.getdataListParm.parammaps.source = ''
-      this.template.table.getdataListParm.offset = 1
-      this.getTemplateDialogList()
-    },
-
-    // 配方记录-模板行点击
-    tableRowClickDialog(row, column, event) {
-      console.log('配方记录-模板行点击')
-      this.isDetailDialog = true
-      this.template.table2.getdataListParm.parammaps.date = this.template.table.getdataListParm.parammaps.date
-      this.template.table2.getdataListParm.parammaps.version = row.version
-      this.template.table2.getdataListParm.parammaps.ftid = row.id
-      this.template.table2.getdataListParm.parammaps.dryweight = row.dryweight
-      this.myheight2 = document.documentElement.clientHeight - 85 - 265 - 185
-      this.getDialogList()
-      this.getDownList()
-      // aiaiaiai
-    },
-
-    getDialogList() {
-      this.template.table2.listLoading = true
-      GetDataByName(this.template.table2.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.template.table2.list = response.data.list
-          this.template.table2.pageNum = response.data.pageNum
-          this.template.table2.pageSize = response.data.pageSize
-          this.template.table2.total = response.data.total
-        } else {
-          this.template.table2.list = []
-        }
-        this.$nextTick(function() {
-          document.querySelector('#detailDialog2').scrollIntoView()
-          // window.scrollTo({
-          //   'top': this.$refs.detailDialog2.clientHeight
-          // })
-        })
-        setTimeout(() => {
-          this.template.table2.listLoading = false
-        }, 100)
-      })
-    },
-    handleDialogSearch2() {
-      console.log('点击了查询')
-      this.arrowDown2 = true
-      this.arrowUp2 = false
-      this.template.table2.getdataListParm.offset = 1
-      this.getDialogList2()
-    },
-    handleDialogRefresh2() {
-      console.log('点击了重置')
-      this.template.table2.getdataListParm.parammaps.fname = ''
-      this.template.table2.getdataListParm.parammaps.feedgroup = ''
-      this.template.table2.getdataListParm.parammaps.fweight = ''
-      this.template.table2.getdataListParm.parammaps.autosecondname = ''
-      this.template.table2.getdataListParm.parammaps.islockcount = '0'
-      this.template.table2.getdataListParm.parammaps.sort = ''
-      this.template.table2.getdataListParm.offset = 1
-      this.getDialogList2()
-    },
-    getDialogList2() {
-      this.template.table2.listLoading = true
-      GetDataByName(this.template.table2.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.template.table2.list = response.data.list
-          this.template.table2.pageNum = response.data.pageNum
-          this.template.table2.pageSize = response.data.pageSize
-          this.template.table2.total = response.data.total
-        } else {
-          this.template.table2.list = []
-        }
-        this.$nextTick(function() {
-          window.scrollTo({
-            'top': this.$refs.templateDialog.clientHeight
-          })
-        })
-        setTimeout(() => {
-          this.template.table2.listLoading = false
-        }, 100)
-      })
-    },
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/配方计划/配方模板导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '配方模板导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.name = 'downloadFTList'
-        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-        GetDataByName(this.download.getdataListParm).then(response => {
-          if (response.data.list !== null) {
-            for (let i = 0; i < response.data.list.length; i++) {
-              if (response.data.list[i].islockcount == 0) {
-                this.$set(response.data.list[i], 'islockcount', '否')
-              } else {
-                this.$set(response.data.list[i], 'islockcount', '是')
-              }
-              if (response.data.list[i].enable == 0) {
-                this.$set(response.data.list[i], 'enable', '否')
-              } else {
-                this.$set(response.data.list[i], 'enable', '是')
-              }
-            }
-            this.download.list = response.data.list
-          } else {
-            this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['配方名称', '配方编码', '牲畜类别', '配方类型', '来源', '备注', '是否启用', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', '顺序'],
-              filterVal: ['tname', 'tcode', 'ccname', 'fttype', 'source', 'remark', 'enable', 'feedgroup', 'fname', 'fweight', 'autosecond', 'islockcount', 'sort'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '配方模板', true, 'xlsx')
-        })
-      }
-    },
-
-    beforeImport(file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 2MB!')
-      }
-      return isLt2M
-    },
-    handleImportSuccess(res, file) {
-      this.getList()
-      if (res.msg === 'ok') {
-        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
-        if (res.data.err_count > 0) {
-          this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '配方名称', '牲畜类别', '配方类型', '备注', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', '错误信息'
-             ]
-             const filterVal = [
-               '配方名称', '牲畜类别', '配方类型', '备注', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '配方模板导入报错信息', autoWidth: true, bookType: 'xlsx' })
-           })
-        }
-      } else {
-        const isRepeat = new RegExp('Duplicate entry :feedtemplet_tname')
-        if (isRepeat.test(res.data)) {
-          this.$notify({ type: 'error', message: '配方名称不可重复,请重新录入', duration: 2000 })
-          return false
-        }
-        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    changeDate() {
-      this.getTemplateDialogList()
-    },
-    // 应用
-    handleApplication() {
-      console.log('点击了应用')
-      MessageBox.confirm('是否确认将' + this.template.table.getdataListParm.parammaps.date + '的数据应用到当前?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'applyFTdate'
-        this.requestParam.parammaps = {}
-        this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
-        this.requestParam.parammaps.date = this.template.table.getdataListParm.parammaps.date
-        PostDataByName(this.requestParam).then(response => {
-          if (response.msg === 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-            this.getTemplateDialogList()
-            this.getList()
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消应用' })
-      })
-    },
-    // 模板行点击
-    tableRowClick(row, column, event) {
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (this.table.list[i].Edit == true) {
-          return false
-        }
-      }
-      if (this.isOrder == false) {
-        this.$message({ type: 'error', message: '请保存或取消当前更改顺序操作', duration: 2000 })
-      } else {
-        if (column.label !== '操作') {
-          this.isDetail = true // 点击行显示详情
-          this.table2.getdataListParm.parammaps.ftid = row.id
-          this.table2.getdataListParm.parammaps.fttypeid = row.fttypeid
-          this.table2.getdataListParm.parammaps.dryweight = row.dryweight
-          if (row.fttype == '预混配方') {
-            this.requestParams[2].parammaps.type = '1'
-          } else {
-            this.requestParams[2].parammaps.type = ''
-          }
-          this.myheight = document.documentElement.clientHeight - 85 - 265 - 185
-          this.getList2()
-          this.getDownList()
-        }
-      }
-    },
-    handleCloseTable2() {
-      this.isDetail = false
-      this.myheight = ''
-      this.isEnlarge = true
-    },
-    handleDialogCloseTable2() {
-      this.isDetailDialog = false
-      this.myheight2 = document.documentElement.clientHeight - 85 - 265
-    },
-    // -------------------详情-----------------------------
-    // 获取是否显示是否锁定牛头数
-    getIsLockCount() {
-      GetDataByName(this.lockCount.getdataListParm).then(response => {
-        console.log(response.data.list)
-        if (response.data.list[0].inforvalue == 0) {
-          this.lockCount.isLockCount = false
-        } else {
-          this.lockCount.isLockCount = true
-        }
-      })
-    },
-    // 详情
-    getList2() {
-      this.table2.listLoading = true
-      GetDataByName(this.table2.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.$set(response.data.list[i], 'Edit', false) // 编辑
-            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
-            this.$set(response.data.list[i], 'groupEdit', false) // 饲料组编辑
-            this.$set(response.data.list[i], 'isGroupDisabled', false) // 饲料组编辑禁止编辑
-            this.$set(response.data.list[i], 'groupNoEdit', true) // 饲料组不可编辑
-            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
-            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
-            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
-          }
-          this.table2.getDryweightParm.parammaps = this.table2.getdataListParm.parammaps
-          this.getDryWeight()
-
-          // for (let i = 0; i < response.data.list.length; i++) {
-          //   console.log(response.data.list[i].fweight, '===12333')
-          // }
-          this.table2.list = response.data.list
-          this.table2.pageNum = response.data.pageNum
-          this.table2.pageSize = response.data.pageSize
-          this.table2.total = response.data.total
-        } else {
-          this.table2.list = []
-        }
-        setTimeout(() => {
-          this.table2.listLoading = false
-        }, 100)
-      })
-    },
-    // 行拖拽
-    rowDrop() {
-      console.log(document.querySelector('#table2 .el-table__body-wrapper tbody'))
-      const tbody = document.querySelector('#table2 .el-table__body-wrapper tbody')
-      // this.sorTable()
-      const that = this
-
-      // Sortable.create(tbody, {
-      var sortable = Sortable.create(tbody, {
-        disabled: that.dropState,
-        onChoose({ newIndex, oldIndex }) {
-          console.log(that.isOrder, 'that.isOrder == false')
-          console.log(that.dropState, 'that.dropState')
-          if (that.dropState == true || that.isOrder == true) {
-            sortable.destroy()
-          }
-        },
-        onEnd({ newIndex, oldIndex }) {
-          const currRow = that.table2.list.splice(oldIndex, 1)[0]
-          that.table2.list.splice(newIndex, 0, currRow)
-          console.log('索引', newIndex)
-          console.log('拖动数据', currRow)
-          console.log('上', that.table2.list[newIndex - 1])
-          console.log('下', that.table2.list[newIndex + 1])
-          if (that.table2.list[newIndex - 1] === undefined) { // 拖动至最上方无值 // 顺序等于0,其他+1 // 饲料组等于饲料名称
-            for (let i = 0; i < that.table2.list.length; i++) {
-              that.table2.list[i].sort = parseInt(that.table2.list[i].sort) + 1 // 其他的顺序+1
-            }
-            currRow.sort = 0
-            currRow.feedgroup = currRow.fname
-            console.log('拖动至最上方无值')
-          } else if (currRow.sort == that.table2.list[newIndex - 1].sort) { // 拖动值顺序等于上值顺序
-            currRow.sort = that.table2.list[newIndex - 1].sort
-            console.log('拖动值顺序等于上值顺序')
-          } else if (that.table2.list[newIndex + 1] == undefined) { // 拖动至最下方无值 // 顺序等于上方顺序+1 // 饲料组等于饲料名称
-            currRow.sort = parseInt(that.table2.list[newIndex - 1].sort) + 1
-            currRow.feedgroup = currRow.fname
-            console.log('拖动至最下方无值')
-          } else if (currRow.sort == that.table2.list[newIndex + 1].sort) { // 拖动值顺序等于下值顺序
-            currRow.sort == that.table2.list[newIndex + 1].sort
-            console.log('拖动值顺序等于下值顺序')
-          } else if (that.table2.list[newIndex - 1].sort == that.table2.list[newIndex + 1].sort) { // 拖动至上下顺序一致,顺序/饲料组与上下保持一致
-            currRow.sort = that.table2.list[newIndex - 1].sort
-            currRow.feedgroup = that.table2.list[newIndex - 1].feedgroup
-            console.log('拖动至上下顺序一致')
-          } else if (that.table2.list[newIndex - 1].sort !== undefined && that.table2.list[newIndex + 1].sort !== undefined) { // 拖动至上下都有值
-            console.log('上下')
-            if (parseInt(that.table2.list[newIndex - 1].sort) + 1 == that.table2.list[newIndex + 1].sort) {
-              console.log(newIndex)
-              for (let i = newIndex; i < that.table2.list.length; i++) {
-                that.table2.list[i].sort = parseInt(that.table2.list[i].sort) + 1
-              }
-            }
-            currRow.sort = parseInt(that.table2.list[newIndex - 1].sort) + 1
-            currRow.feedgroup = currRow.fname
-            console.log(that.table2.list[newIndex + 1].sort)
-          }
-        }
-      })
-      console.log(sortable.option('disabled'))
-    },
-    handleChangeOrder() {
-      this.isOrder = false
-      this.rowDrop()
-    },
-    saveChangeOrder() {
-      // 保存顺序
-      console.log(this.table2.list)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.table2.list }}
-      this.requestParam.data[0].children = []
-      this.requestParam.data[0].children[0] = { 'name': 'updateFTdetailSort', 'type': 'e', 'parammaps': {
-        id: '@insertSpotList.id',
-        pastureid: '@insertSpotList.pastureid',
-        sort: '@insertSpotList.sort',
-        feedgroup: '@insertSpotList.feedgroup'
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('顺序切换保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
-          this.getList2()
-          this.getList3()
-          this.isOrder = true
-        }
-      })
-    },
-    cancelChangeOrder() {
-      // 取消顺序
-      this.getList2()
-      this.isOrder = true
-    },
-    handleSearch2() {
-      console.log('点击了查询')
-      this.arrowDown2 = true
-      this.arrowUp2 = false
-      this.table2.getdataListParm.offset = 1
-      // fname, feedgroup, fweight, autosecondname, islockcount, sort
-      // this.table2.getdataListParm.parammaps.all = this.table2.getdataListParm.parammaps.fname + ' ' + this.table2.getdataListParm.parammaps.feedgroup + ' ' + this.table2.getdataListParm.parammaps.fweight + ' ' + this.table2.getdataListParm.parammaps.autosecondname + ' ' + this.table2.getdataListParm.parammaps.islockcount + ' ' + this.table2.getdataListParm.parammaps.sort
-      this.table2.getdataListParm.parammaps.all = ''
-      var obj = {}
-      obj.fname = this.table2.getdataListParm.parammaps.fname
-      obj.feedgroup = this.table2.getdataListParm.parammaps.feedgroup
-      obj.fweight = this.table2.getdataListParm.parammaps.fweight
-      obj.autosecondname = this.table2.getdataListParm.parammaps.autosecondname
-      if (this.table2.getdataListParm.parammaps.islockcount !== '') {
-        if (this.table2.getdataListParm.parammaps.islockcount == 0) {
-          this.table2.getdataListParm.parammaps.islockcount = '否'
-        } else {
-          this.table2.getdataListParm.parammaps.islockcount = '是'
-        }
-      }
-      obj.islockcount = this.table2.getdataListParm.parammaps.islockcount
-      obj.sort = this.table2.getdataListParm.parammaps.sort
-      Object.getOwnPropertyNames(obj).forEach((key) => {
-        console.log(key, obj[key])
-        if (obj[key] !== '') {
-          this.table2.getdataListParm.parammaps.all += obj[key] + '/'
-        }
-      })
-      if (this.table2.getdataListParm.parammaps.all.charAt(this.table2.getdataListParm.parammaps.all.length - 1) == '/') {
-        this.table2.getdataListParm.parammaps.all = this.table2.getdataListParm.parammaps.all.slice(0, this.table2.getdataListParm.parammaps.all.length - 1)
-      }
-      this.getList2()
-    },
-    handleRefresh2() {
-      console.log('点击了重置')
-      this.table2.getdataListParm.parammaps.fname = ''
-      this.table2.getdataListParm.parammaps.feedgroup = ''
-      this.table2.getdataListParm.parammaps.fweight = ''
-      this.table2.getdataListParm.parammaps.autosecondname = ''
-      this.table2.getdataListParm.parammaps.islockcount = '0'
-      this.table2.getdataListParm.parammaps.sort = ''
-      this.table2.getdataListParm.parammaps.all = ''
-      this.table2.getdataListParm.offset = 1
-      this.getList2()
-    },
-
-    // 详情新增
-    handleCreate2() {
-      console.log('点击了详情新增', this.table2.list)
-      // 编辑true/不可编辑false
-      // 新增操true,编辑false,编辑保存false
-      console.log(11)
-      for (let i = 0; i < this.table2.list.length; i++) {
-        if (this.table2.list[i].Edit === true) {
-          console.log(123)
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-      }
-      console.log(this.table2.list)
-      if (this.table2.list.length == 0) {
-        var mysort = 0
-      } else {
-        var mysort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
-      }
-      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0', 'islockcount': '0', 'sort': mysort })
-      console.log(this.table2.list)
-    },
-    changeFname(item, row) {
-      console.log(item, row)
-      this.table2.temp.fname = this.feedNameList.find(obj => obj.id == item).fname
-      row.fname = this.feedNameList.find(obj => obj.id == item).fname
-      if (this.feedNameList.find(obj => obj.id == item).ispreft == '0') {
-        this.table2.temp.preftid = '0'
-      } else {
-        this.table2.temp.preftid = item
-      }
-      if (row.sort == '') {
-        row.feedgroup = this.table2.temp.fname
-      } else {
-        if (row.isCreate == true) { // 新增状态下
-          for (let i = 1; i < this.table2.list.length; i++) {
-            if (this.table2.list[i].sort == row.sort) {
-              console.log(this.table2.list[i])
-              row.feedgroup = this.table2.list[i].feedgroup
-              break
-            } else {
-              row.feedgroup = this.table2.temp.fname
-            }
-          }
-        } else if (row.isUpdateSave == true) { // 编辑状态下
-          var Arr = []
-          for (let i = 0; i < this.table2.list.length; i++) {
-            Arr.push(this.table2.list[i].sort)
-          }
-          var Count = 0
-          for (let i = 0; i < Arr.length; i++) {
-            if (Arr[i] == row.sort) {
-              Count++
-            }
-          }
-          for (let i = 0; i < this.table2.list.length; i++) {
-            if (Count > 1) {
-              row.feedgroup = this.table2.list[i].feedgroup
-              console.log(this.table2.list[i].feedgroup)
-              break
-            } else if (Count == 1) {
-              row.feedgroup = this.table2.temp.fname
-              console.log(222, this.table2.temp.fname)
-            }
-          }
-        }
-      }
-    },
-
-    bort(row) {
-      if (row.isCreate == true) {
-        if (row.sort !== '') {
-          for (let i = 1; i < this.table2.list.length; i++) {
-            if (this.table2.list[i].sort == parseInt(row.sort)) {
-              row.feedgroup = this.table2.list[i].feedgroup
-              return false
-            } else {
-              row.feedgroup = row.fname
-            }
-          }
-        } else {
-          row.feedgroup = row.fname
-        }
-      } else if (row.isUpdateSave == true) {
-        if (row.sort !== '') {
-          for (let i = 0; i < this.table2.list.length; i++) {
-            if (this.table2.list[i].sort == row.sort) {
-              console.log('失去焦点,行内顺序与表格某顺序相同时', this.table2.list[i])
-              if (this.table2.list[i].id !== row.id) {
-                row.isGroupDisabled = true
-                row.feedgroup = this.table2.list[i].feedgroup
-                break
-              }
-            } else {
-              console.log('失去焦点,行内顺序与表格某顺序不相同时')
-              row.isGroupDisabled = true
-              row.feedgroup = row.fname
-            }
-          }
-        } else {
-          row.feedgroup = row.fname
-        }
-      }
-    },
-    createData2(row) {
-      console.log('点击了详情新增保存1', row)
-      this.table2.temp.pastureid = Cookies.get('pastureid')
-      this.table2.temp.ftid = this.table2.getdataListParm.parammaps.ftid
-      this.table2.temp.fid = row.fid
-      this.table2.temp.fname = this.table2.temp.fname
-      this.table2.temp.fweight = row.fweight
-      this.table2.temp.islockcount = row.islockcount
-      this.table2.temp.sort = row.sort
-      this.table2.temp.feedgroup = row.feedgroup
-      this.table2.temp.preftid = this.table2.temp.preftid
-      this.table2.temp.autosecond = row.autosecond
-      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fid == '') {
-        this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fweight == '') {
-        this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
-        return false
-      }
-      if (this.table2.temp.sort !== '') {
-        this.table2.temp.sort = this.table2.temp.sort
-      } else {
-        console.log(this.table2.list.length)
-        if (this.table2.list.length == 1) {
-          this.table2.temp.sort = 0
-        } else {
-          this.table2.temp.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
-          row.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
-        }
-      }
-      if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
-        if (parseInt(this.table2.temp.preftid) > 0) {
-          this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
-          return false
-        }
-      }
-      // 校验顺序是否>=0
-      var ruleSort = /^\d+$/
-      if (!ruleSort.test(this.table2.temp.sort)) {
-        this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
-        return false
-      }
-      // 检验重量>0
-      this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 3) // 根据默认参数设置小数位数
-      row.fweight = formatNum(row.fweight, 3)
-      // 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 })
-        return false
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
-        pastureid: this.table2.temp.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        fid: row.fid,
-        fname: this.table2.temp.fname,
-        fweight: String(row.fweight),
-        islockcount: row.islockcount,
-        sort: row.sort,
-        feedgroup: row.feedgroup,
-        preftid: this.table2.temp.preftid,
-        autosecond: row.autosecond
-      }}
-      this.requestParam.data[1] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
-        pastureid: this.table2.temp.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        type: this.table2.getdataListParm.parammaps.fttypeid,
-        status: 0
-      }}
-      this.requestParam.data[2] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
-        pastureid: this.table2.getdataListParm.parammaps.pastureid,
-        id: this.table2.getdataListParm.parammaps.ftid
-      }}
-      this.requestParam.data[3] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
-        weight: row.fweight,
-        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}'),
-        slid: 0,
-        fid: row.fid
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList2()
-          this.getList3()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-    createCancel2(row) {
-      console.log('点击了详情新增取消')
-      for (let i = 0; i < this.table2.list.length; i++) {
-        if (row.myId === this.table2.list[i].myId) {
-          var listIndex = this.table2.list.indexOf(this.table2.list[i])
-        }
-        if (listIndex > -1) {
-          this.table2.list.splice(listIndex, 1)
-          return
-        }
-      }
-      this.getDialogList()
-    },
-
-    // 详情编辑
-    handleUpdate2(row) {
-      console.log('详情编辑', row)
-      this.dropState = true
-      row.isGroupDisabled = false
-      row.islockcount = String(row.islockcount)
-      row.fid = String(row.fid)
-      row.autosecond = String(row.autosecond)
-      this.table2.temp.fname = row.fname
-      this.table2.temp.preftid = row.preftid
-      const rowArr = []
-      for (let i = 0; i < this.table2.list.length; i++) {
-        if (this.table2.list[i].Edit == true) {
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-        rowArr.push(this.table2.list[i].sort)
-      }
-      var count = 0
-      for (let i = 0; i < rowArr.length; i++) {
-        if (rowArr[i] == row.sort) {
-          count++
-        }
-      }
-      // 判断是否有相同顺序,如果没有饲料组不可编辑,若有饲料组可编辑
-      if (count == 1) {
-        // 饲料组编辑false,不可编辑true
-        row.groupEdit = false
-        row.groupNoEdit = true
-        // 编辑true,不可编辑false
-        row.Edit = true
-        row.NoEdit = false
-        // 新增false,编辑false,编辑保存true
-        row.isCreate = false
-        row.isUpdate = false
-        row.isUpdateSave = true
-      } else if (count > 1) {
-        // 饲料组编辑true,不可编辑false
-        row.groupEdit = true
-        row.groupNoEdit = false
-        console.log(222)
-        // 编辑true,不可编辑false
-        row.Edit = true
-        row.NoEdit = false
-        // 新增false,编辑false,编辑保存true
-        row.isCreate = false
-        row.isUpdate = false
-        row.isUpdateSave = true
-        return false
-      }
-      this.table2.updateList = Object.assign({}, row)
-    },
-    updateData2(row) {
-      console.log('点击了详情编辑保存', row)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.table2.temp.pastureid = row.pastureid
-      this.table2.temp.ftid = this.table2.getdataListParm.parammaps.ftid
-      this.table2.temp.fid = row.fid
-      this.table2.temp.fname = this.table2.temp.fname
-      this.table2.temp.fweight = row.fweight
-      this.table2.temp.islockcount = row.islockcount
-      this.table2.temp.sort = row.sort
-      this.table2.temp.feedgroup = row.feedgroup
-      this.table2.temp.preftid = this.table2.temp.preftid
-      this.table2.temp.autosecond = row.autosecond
-      this.table2.temp.id = row.id
-      console.log('this.table2.updateList', this.table2.updateList)
-      console.log('temp', this.table2.temp)
-      // var status = ''
-      // if (parseFloat(this.table2.temp.fweight) > parseFloat(this.table2.updateList.fweight)) {
-      //   status = 0
-      // } else {
-      //   status = 1
-      // }
-      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fid == '') {
-        this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fweight == '') {
-        this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
-        return false
-      }
-      if (this.table2.temp.sort !== '') {
-        this.table2.temp.sort = this.table2.temp.sort
-      } else {
-        this.table2.temp.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
-      }
-      if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
-        if (parseInt(this.table2.temp.preftid) > 0) {
-          this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
-          return false
-        }
-      }
-      // 校验顺序是否>=0
-      var ruleSort = /^\d+$/
-      if (!ruleSort.test(this.table2.temp.sort)) {
-        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)
-      // 检验重量>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 })
-        return false
-      }
-      this.requestParam.common = { 'returnmap': '0' }
-      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}'),
-        slid: this.table2.temp.id,
-        fid: row.fid
-      }}
-      this.requestParam.data[1] = { 'name': 'updateFTdetail', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        fid: row.fid,
-        fname: this.table2.temp.fname,
-        fweight: String(row.fweight),
-        islockcount: row.islockcount,
-        sort: row.sort,
-        feedgroup: row.feedgroup,
-        preftid: this.table2.temp.preftid,
-        autosecond: row.autosecond,
-        id: row.id
-      }}
-      this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        type: this.table2.getdataListParm.parammaps.fttypeid,
-        // status: status
-      }}
-      this.requestParam.data[3] = { 'name': 'updateFTdetailbySort', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        sort: row.sort,
-        feedgroup: row.feedgroup
-      }}
-      this.requestParam.data[4] = { 'name': 'updateFTdetailGroup', 'type': 'e', 'parammaps': {
-        pastureid: this.table2.getdataListParm.parammaps.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid
-      }}
-      const url = 'authdata/ftdetail/edit'
-      const data = this.requestParam
-      postJson(url, data).then(response => {
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList2()
-          this.getList3()
-          this.dropState = false
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-      // ExecDataByConfig(this.requestParam).then(response => {
-      //   console.log('新增保存发送参数', this.requestParam)
-      //   if (response.msg !== 'fail') {
-      //     this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-      //     this.getList2()
-      //     this.getList3()
-      //     this.dropState = false
-      //   } else {
-      //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-      //   }
-      // })
-    },
-    updateCancel2(row) {
-      console.log('点击了详情编辑取消')
-      // 饲料组编辑false,不可编辑true
-      row.groupEdit = false
-      row.groupNoEdit = true
-      // 编辑false,不可编辑true
-      row.Edit = false
-      row.NoEdit = true
-      // 新增false,编辑true,编辑保存false
-      row.isCreate = false
-      row.isUpdate = true
-      row.isUpdateSave = false
-      this.getList2()
-      this.dropState = false
-    },
-
-    // 详情删除
-    handleRowDelete2(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        console.log(this.table2.list.length)
-        if (this.table2.list.length > 1) {
-          this.requestParam.common = { 'returnmap': '0' }
-          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}'),
-            slid: row.id,
-            fid: row.fid
-          }}
-          this.requestParam.data[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-            pastureid: row.pastureid,
-            id: row.id
-          }}
-          this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
-            pastureid: row.pastureid,
-            ftid: this.table2.getdataListParm.parammaps.ftid,
-            type: this.table2.getdataListParm.parammaps.fttypeid,
-            status: 1
-          }}
-          this.requestParam.data[3] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
-            pastureid: this.table2.getdataListParm.parammaps.pastureid,
-            id: this.table2.getdataListParm.parammaps.ftid
-          }}
-        } else {
-          this.requestParam.common = { 'returnmap': '0' }
-          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}'),
-            slid: row.id,
-            fid: row.fid
-          }}
-          this.requestParam.data[1] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
-            pastureid: this.table2.getdataListParm.parammaps.pastureid,
-            id: this.table2.getdataListParm.parammaps.ftid
-          }}
-          this.requestParam.data[2] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-            pastureid: row.pastureid,
-            id: row.id
-          }}
-          this.requestParam.data[3] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
-            pastureid: row.pastureid,
-            ftid: this.table2.getdataListParm.parammaps.ftid,
-            type: this.table2.getdataListParm.parammaps.fttypeid,
-            status: 1
-          }}
-          this.requestParam.data[4] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
-            pastureid: this.table2.getdataListParm.parammaps.pastureid,
-            id: this.table2.getdataListParm.parammaps.ftid
-          }}
-        }
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-            this.getList2()
-            this.getList3()
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    handleSelectionChange2(val) {
-      console.log('勾选数据', val)
-      this.selectList2 = val
-    },
-    celldblclick(row, column, cell, event) {
-      console.log(row, '=====')
-      this.handleUpdate2(row)
-    },
-    handleDelete2() {
-      console.log('点击了删除')
-      if (this.selectList2.length == 0) {
-        this.$message({ type: 'error', message: '请选择配方详情', duration: 2000 })
-      } else {
-        MessageBox.confirm('是否确认删除此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.table2.list.length - this.selectList2.length)
-          if (this.table2.list.length - this.selectList2.length > 0) {
-            this.requestParam.common = { 'returnmap': '0' }
-            this.requestParam.data = []
-            this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
-            this.requestParam.data[0].children = []
-            this.requestParam.data[0].children[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
-              pastureid: '@insertSpotList.pastureid',
-              ftid: '@insertSpotList.ftid',
-              weight: 0,
-              preftid: '@insertSpotList.preftid',
-              dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
-              slid: '@insertSpotList.id',
-              fid: '@insertSpotList.fid'
-            }}
-            this.requestParam.data[0].children[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }}
-            this.requestParam.data[1] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
-              pastureid: this.table2.getdataListParm.parammaps.pastureid,
-              id: this.table2.getdataListParm.parammaps.ftid
-            }}
-          } else {
-            this.requestParam.common = { 'returnmap': '0' }
-            this.requestParam.data = []
-            this.requestParam.data[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
-              pastureid: this.table2.getdataListParm.parammaps.pastureid,
-              id: this.table2.getdataListParm.parammaps.ftid
-            }}
-            this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
-            this.requestParam.data[1].children = []
-            this.requestParam.data[1].children[0] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }}
-            this.requestParam.data[2] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
-              pastureid: this.table2.getdataListParm.parammaps.pastureid,
-              id: this.table2.getdataListParm.parammaps.ftid
-            }}
-          }
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('删除保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
-              this.getList2()
-              this.getList3()
-            }
-          })
-        })
-      }
-    },
-
-    // 拆分预混料
-    handleSplitPremix(row) {
-      console.log('点击了拆分预混料')
-      MessageBox.confirm('是否确认拆分当前预混料?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'splitFTpre'
-        this.requestParam.parammaps = {}
-        this.requestParam.parammaps.ftid = this.table2.getdataListParm.parammaps.ftid
-        this.requestParam.parammaps.preftid = row.preftid
-        this.requestParam.parammaps.ftdid = row.id
-        this.requestParam.parammaps.pastureid = row.pastureid
-        this.requestParam.parammaps.feedgroup = row.feedgroup
-        this.requestParam.parammaps.sort = row.sort
-        this.requestParam.parammaps.fweight = row.fweight
-        PostDataByName(this.requestParam).then(response => {
-          if (response.msg === 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-            this.getList2()
-            this.getList3()
-          }
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        })
-      })
-    },
-
-    // 合成预混料
-    handleSyntheticPremix() {
-      console.log('点击了合成预混料', this.selectList2)
-      this.dialogFull = false
-      if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
-        this.$message({ type: 'error', message: '预混配方不可合成预混料', duration: 2000 })
-        return false
-      } else {
-        if (this.selectList2.length > 1) {
-          for (let i = 0; i < this.selectList2.length; i++) {
-            if (parseInt(this.selectList2[i].preftid) > 0) {
-              this.$message({ type: 'error', message: '不可选择预混料', duration: 2000 })
-              return false
-            }
-          }
-
-          if (this.selectList2[0].splitftpreid !== undefined) {
-            this.detail.getdataListParm.parammaps.ftid = this.selectList2[0].splitftpreid
-            this.detail.getdataListParm.parammaps.pastureid = this.selectList2[0].pastureid
-            GetDataByName(this.detail.getdataListParm).then(response => {
-              if (response.data.list !== null) { // 不为空时得到比对数据
-                this.detail.list3 = response.data.list
-                const sortList = [] // 声明排序数组
-                var fweightSum = 0 // 总重量
-                for (let i = 0; i < this.selectList2.length; i++) {
-                  const obj = {}
-                  obj.fid = this.selectList2[i].fid
-                  obj.fweight = this.selectList2[i].fweight
-                  fweightSum = fweightSum + parseFloat(this.selectList2[i].fweight)
-                  sortList.push(obj)
-                }
-                // 排序
-                sortList.sort(function(a, b) {
-                  return a.fid.localeCompare(b.fid)
-                })
-                var a = 0
-                if (this.detail.list3.length == sortList.length) {
-                  for (let i = 0; i < this.detail.list3.length; i++) {
-                    if (this.detail.list3[i].fid == sortList[i].fid && (this.detail.list3[i].fweight / this.detail.list3[i].sumWeight).toFixed(3) == (sortList[i].fweight / fweightSum).toFixed(3)) {
-                      a++
-                    }
-                  }
-                  if (a == this.detail.list3.length) { // 如果相等,则该配方为原预混配方
-                    this.detail.getdataListParm2.parammaps.ftid = this.selectList2[0].splitftpreid
-                    this.detail.getdataListParm2.parammaps.pastureid = this.selectList2[0].pastureid
-                    GetDataByName(this.detail.getdataListParm2).then(response => {
-                      if (response.data.list !== null) {
-                        this.detail.dialogStatus = 'SyntheticPremix'
-                        this.detail.dialogFormVisible = true
-                        this.detail.list = this.selectList2
-                        this.detail.list2 = response.data.list
-                        this.detail.disabled = true
-                        setTimeout(() => {
-                          this.detail.listLoading = false
-                        }, 100)
-                      } else {
-                        this.detail.list2 = []
-                      }
-                    })
-                  } else {
-                    this.detail.dialogStatus = 'SyntheticPremix'
-                    this.detail.dialogFormVisible = true
-                    this.detail.list = this.selectList2
-                    this.detail.disabled = false
-                    this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
-                    setTimeout(() => {
-                      this.detail.listLoading = false
-                    }, 100)
-                  }
-                } else {
-                  this.detail.dialogStatus = 'SyntheticPremix'
-                  this.detail.dialogFormVisible = true
-                  this.detail.list = this.selectList2
-                  this.detail.disabled = false
-                  this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
-                  setTimeout(() => {
-                    this.detail.listLoading = false
-                  }, 100)
-                }
-              } else {
-                this.detail.list3 = []
-                this.detail.dialogStatus = 'SyntheticPremix'
-                this.detail.dialogFormVisible = true
-                this.detail.list = this.selectList2
-                this.detail.disabled = false
-                this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
-                setTimeout(() => {
-                  this.detail.listLoading = false
-                }, 100)
-              }
-            })
-          } else {
-            this.detail.dialogStatus = 'SyntheticPremix'
-            this.detail.dialogFormVisible = true
-            this.detail.list = this.selectList2
-            this.detail.disabled = false
-            this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
-            setTimeout(() => {
-              this.detail.listLoading = false
-            }, 100)
-          }
-        } else {
-          this.$message({ type: 'error', message: '请选择俩条及以上饲料进行合成', duration: 2000 })
-          return false
-        }
-      }
-    },
-    // 畜生类别
-    changeLivestockType2(item) {
-      this.detail.list2[0].ccname = this.livestockTypeList.find(obj => obj.value === item).label
-    },
-    syntheticPremixData() {
-      console.log('点击了合成预混料确认')
-      if (this.detail.disabled == true) { // 原预混料
-        let sumFweight = 0
-        for (let i = 0; i < this.detail.list.length; i++) {
-          sumFweight += parseFloat(this.detail.list[i].fweight)
-        }
-        sumFweight = sumFweight.toFixed(3)
-        this.isokDisable = true
-        setTimeout(() => {
-          this.isokDisable = false
-        }, 1000)
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.detail.list }}
-        this.requestParam.data[0].children = []
-        this.requestParam.data[0].children[0] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList.pastureid',
-          id: '@insertSpotList.id'
-        }}
-        this.requestParam.data[1] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.detail.list2 }}
-        this.requestParam.data[1].children = []
-        this.requestParam.data[1].children[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
-          pastureid: Cookies.get('pastureid'),
-          ftid: this.table2.getdataListParm.parammaps.ftid,
-          fid: this.detail.list2[0].id,
-          fname: '@insertSpotList2.tname',
-          fweight: sumFweight,
-          islockcount: '0',
-          sort: parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1,
-          feedgroup: '@insertSpotList2.tname',
-          preftid: this.detail.list2[0].id,
-          autosecond: this.detail.list[0].autosecond
-        }}
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('合成预混料保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            const tname = new RegExp("key 'tname'")
-            if (tname.test(response.data)) {
-              this.$message({ type: 'error', message: '预混配方已存在,不可重复生成', duration: 2000 })
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          } else {
-            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-            this.detail.dialogFormVisible = false
-            this.getList3()
-            this.getList2()
-            this.getDownList()
-          }
-        })
-      } else { // 现生成预混料
-        if (this.detail.list2[0].tname == '' && this.detail.list2[0].ccid == '') {
-          this.$message({ type: 'error', message: '配方名称/牲畜类别/不能为空', duration: 2000 })
-          return false
-        } else if (this.detail.list2[0].tname == '') {
-          this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
-          return false
-        } else if (this.detail.list2[0].ccid == '') {
-          this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
-          return false
-        }
-        const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
-        if (pattern.test(this.detail.list2[0].tname)) {
-          this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
-          return false
-        }
-        let sumFweight = 0
-        for (let i = 0; i < this.detail.list.length; i++) {
-          sumFweight += parseFloat(this.detail.list[i].fweight)
-        }
-        sumFweight = sumFweight.toFixed(3)
-        console.log(sumFweight)
-        this.isokDisable = true
-        setTimeout(() => {
-          this.isokDisable = false
-        }, 1000)
-        if (this.detail.list2[0].tcolor == null) {
-          this.detail.list2[0].tcolor = '#CCCCCC'
-        }
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        this.requestParam.data[0] = { 'name': 'insertFT', 'type': 'e', 'parammaps': {
-          pastureid: Cookies.get('pastureid'),
-          tcode: this.detail.list2[0].tcode,
-          tname: this.detail.list2[0].tname,
-          tcolor: this.detail.list2[0].tcolor,
-          ccid: this.detail.list2[0].ccid,
-          ccname: this.detail.list2[0].ccname,
-          fttype: this.detail.list2[0].fttype,
-          fttypeid: this.detail.list2[0].fttypeid,
-          source: this.detail.list2[0].source,
-          remark: this.detail.list2[0].remark,
-          enable: this.detail.list2[0].enable
-        }}
-        this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.detail.list }}
-        this.requestParam.data[1].children = []
-        this.requestParam.data[1].children[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList.pastureid',
-          ftid: '@insertFT.LastInsertId',
-          fid: '@insertSpotList.fid',
-          fname: '@insertSpotList.fname',
-          fweight: '@insertSpotList.fweight',
-          islockcount: '@insertSpotList.islockcount',
-          sort: '@insertSpotList.sort',
-          feedgroup: '@insertSpotList.feedgroup',
-          preftid: '@insertSpotList.preftid',
-          autosecond: '@insertSpotList.autosecond'
-        }}
-        this.requestParam.data[1].children[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
-          pastureid: '@insertSpotList.pastureid',
-          id: '@insertSpotList.id'
-        }}
-        this.requestParam.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.detail.list2 }}
-        this.requestParam.data[2].children = []
-        this.requestParam.data[2].children[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
-          pastureid: Cookies.get('pastureid'),
-          ftid: this.table2.getdataListParm.parammaps.ftid,
-          fid: '@insertFT.LastInsertId',
-          fname: '@insertSpotList2.tname',
-          fweight: sumFweight,
-          islockcount: '0',
-          sort: parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1,
-          feedgroup: '@insertSpotList2.tname',
-          preftid: '@insertFT.LastInsertId',
-          autosecond: this.detail.list[0].autosecond
-        }}
-        ExecDataByConfig(this.requestParam).then(response => {
-          console.log('合成预混料保存发送参数', this.requestParam)
-          if (response.msg === 'fail') {
-            const tname = new RegExp("key 'tname'")
-            if (tname.test(response.data)) {
-              this.$message({ type: 'error', message: '预混配方已存在,不可重复生成', duration: 2000 })
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          } else {
-            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-            this.detail.dialogFormVisible = false
-            this.getList3()
-            this.getList2()
-            this.getDownList()
-          }
-        })
-      }
-    },
-    handleFormulationEvaluation(row) {
-      console.log(row)
-      // this.$router.push({ path: '/statisticalAnalysis/FormulationEvaluation', query: { tname: row.tname }})
-      this.$router.push({
-        name: 'FormulationEvaluation',
-        params: {
-          tname: row.tname,
-          ftid: row.id,
-          pastureid: row.pastureid,
-          startTime: parseTime(new Date(), '{y}-{m}-{d}'),
-          inputDatetime: [new Date('startTime'), new Date('startTime')], // 日期后台待传
-          stopTime: parseTime(new Date(), '{y}-{m}-{d}')
-        }
-      })
-    },
-    // 配方记录
-    handleRowRecipeRecord(row) {
-      console.log(row)
-      this.rowRecipeRecord.temp = Object.assign({}, row)
-      this.rowRecipeRecord.dialogFormVisible = true
-      this.textMap.rowRecipeRecordTxt = '配方修改记录——配方:' + row.tname
-      this.rowRecipeRecord.dialogStatus = 'rowRecipeRecordTxt'
-      this.rowRecipeRecord.getdataListParm.parammaps.pastureid = row.pastureid
-      this.rowRecipeRecord.getdataListParm.parammaps.fitid = row.id
-      this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime = []
-      this.getRowRecipeRecordList()
-    },
-    getRowRecipeRecordList() {
-      this.rowRecipeRecord.listLoading = true
-      this.rowRecipeRecord.getdataListParm.parammaps.fitid = this.rowRecipeRecord.temp.id
-      if (this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime == null) {
-        this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime = ''
-        this.rowRecipeRecord.getdataListParm.parammaps.startTime = ''
-        this.rowRecipeRecord.getdataListParm.parammaps.stopTime = ''
-      } else {
-        this.rowRecipeRecord.getdataListParm.parammaps.startTime = this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime[0]
-        this.rowRecipeRecord.getdataListParm.parammaps.stopTime = this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime[1]
-      }
-      const url = 'authdata/GetArrList'
-      const data = this.rowRecipeRecord.getdataListParm
-      postJson(url, data).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].arrList == null) {
-              this.$set(response.data.list[i], 'arrList', [])
-            }
-          }
-          this.rowRecipeRecord.list = response.data.list
-          this.rowRecipeRecord.pageNum = response.data.pageNum
-          this.rowRecipeRecord.pageSize = response.data.pageSize
-          this.rowRecipeRecord.total = response.data.total
-        } else {
-          this.rowRecipeRecord.list = []
-          this.rowRecipeRecord.total = 0
-        }
-        console.log(response.data, 'response.data')
-        setTimeout(() => {
-          this.rowRecipeRecord.listLoading = false
-        }, 100)
-      })
-    },
-    handleRowRecipeRecordSearch() {
-      this.getRowRecipeRecordList()
-    },
-    handleEnlarge() {
-      var height = (document.documentElement.clientHeight - 165 + 50).toString() + 'px'
-      // var height = (document.documentElement.clientHeight - 165 + 80).toString() + 'px'
-      // var height2 = '-' + (document.documentElement.clientHeight - 400).toString() + 'px'
-      var height2 = '-' + (this.$refs.template.offsetHeight).toString() + 'px'
-      console.log(this.$refs.detail.offsetHeight)
-      console.log(height2, 'height2')
-      this.isEnlarge = false
-      this.$refs.detail.style.top = height2
-      this.$refs.detail.style.height = height
-      this.$refs.appContainer.style.height = height
-      this.$refs.table2.style.height = 0
-      this.$refs.myContainer.style.posiiton = 'relative'
-      this.$refs.detail.style.posiiton = 'absolute'
-    },
-    handleNarrow() {
-      this.isEnlarge = true
-      this.$refs.detail.style.top = 0
-      this.$refs.detail.style.height = '300px'
-      this.$refs.myContainer.style.posiiton = ''
-      this.$refs.detail.style.posiiton = ''
-      this.$refs.detail.style.zIndex = ''
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-  .search{margin-top:10px;height: 40px;}
-  .operation{height: 50px;}
-  .table{margin-top:5px;}
-  .table2{margin-top:10px;}
-  $width:350px;
-  $left:325px;
-  .selectInput{
-    position: relative;
-    display: inline-block;
-    .Input{width: $width;position: relative;}
-    .el-icon-arrow-down{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
-    .el-icon-arrow-up{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
-    .selectUl{
-      height:220px;overflow-y: auto;z-index: 111;width: $width;background: #fff;border: 1px solid #E4E7ED;box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);margin: -1px 0 0 0;padding: 6px 0; margin: 0;box-sizing: border-box;position: absolute;
-      li{
-        list-style: none;font-size: 14px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #606266; height: 50px; line-height: 50px; box-sizing: border-box; cursor: pointer;
-        a{float:left;width: 80px;}
-        a:hover{color: rgba(0, 204, 102, 0.71); font-weight: 700;}
-      }
-    }
-  }
-  .template{
-    background: #fff;
-    position: relative;
-  }
-  .app-container{background: #fff;}
-  .detail{
-    background: #fff;
-    overflow-y: hidden;
-    overflow-x: hidden;
-    // position: fixed;
-    // bottom: 0;
-    // right:0;
-    z-index: 3;
-    // width: calc(100% - 210px);
-    position: relative;
-  }
-  .hide2{float: right;right:0;}
-  .templateDialog{
-    background: #fff;
-    position: relative;
-  }
- .detailDialog{
-    background: #fff;
-    position: relative;
-  }
-  .hide{float: right;margin-right: 60px;}
- </style>
- <style>
-  .el-color-dropdown__main-wrapper{display: none !important;}
-  .el-color-dropdown__value{display: none !important;}
-  .el-color-dropdown__btns .el-button--text{display: none !important;}
- </style>

+ 11 - 3
src/views/formulationPlan/surplusMaterialPlan/index.vue

@@ -89,8 +89,7 @@
         </el-table-column> -->
         <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
-
-            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <!-- <span v-if="isRoleEdit" class="centerSpan">|</span> -->
             <el-button v-if="isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
             <span v-if="isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="isRoleEdit" icon="el-icon-delete" class="miniDanger" @click="handleRowDelete(row)" />
@@ -1456,9 +1455,18 @@
           console.log('撒料计划车次跟随列表数据', response.data.list)
           if (response.data.list !== null) {
             this.carFollowList = response.data.list
+          }else{
+            this.carFollowList = []
           }
         })
-        console.log(row, '====')
+        if(this.carFollowList.length>0){
+          if(this.carFollowList.find(obj => obj.id == row.lppid).lppcode == undefined){
+            this.$set(row, 'lppid', '')
+          }
+        }else{
+          this.$set(row, 'lppid', '')
+        }
+
         if (row.lppcode == undefined) {
           this.$set(row, 'lppid', '')
         }

+ 1 - 1
src/views/inventoryManagement/feedContract/index.vue

@@ -333,10 +333,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 5 - 4
src/views/inventoryManagement/inventoryList/index.vue

@@ -159,7 +159,7 @@
 </template>
 
 <script>
-import { GetDataByName, ExecDataByConfig, failproccess, checkButtons, PostDataByName } from '@/api/common'
+import { GetDataByName, ExecDataByConfig, failproccess, checkButtons, PostDataByName,postJson } from '@/api/common'
 import Pagination from '@/components/Pagination'
 import { parseTime, json2excel } from '@/utils/index.js'
 import { MessageBox } from 'element-ui'
@@ -350,10 +350,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
@@ -447,8 +447,9 @@ export default {
             feedid: '@insertSpotList.feedid',
             stockweight: '@insertSpotList.stockweight',
             factweight: '@insertSpotList.factweight'
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
+          }}
+          let url = 'authdata/biginventory'
+          postJson(url,this.requestParam).then(response => {
             if (response.msg === 'fail') {
               const inventorydate = new RegExp("key 'inventorydate'")
               if (inventorydate.test(response.data)) {

+ 0 - 671
src/views/inventoryManagement/inventoryList/index改.vue

@@ -1,671 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
-      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增盘点单</el-button>
-      <el-button class="success" icon="el-icon-upload2" @click="handleInventoryList">下载盘点单</el-button>
-      <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
-      </el-upload>
-      <el-button class="import" icon="el-icon-upload2" style="float: right;margin-right: 10px;" @click="handleExport(1)">导出</el-button>
-    </div>
-
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-      >
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="盘点日期" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.inventorydate }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="盘点人" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.createuser }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="盘盈库存(kg)" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.moreWeight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="盘亏库存(kg)" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.lessWeight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="盈亏净值(kg)" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.differWeight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="备注" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.remark }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="scope">
-            <el-button class="miniSuccess" :disabled="isokDisable" icon="el-icon-search" @click="handleSee(scope.row)" />
-            <span v-if="scope.$index + (table.pageNum-1) * table.pageSize + 1 == 1 && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="scope.$index + (table.pageNum-1) * table.pageSize + 1 == 1 && isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(scope.row)" />
-            <span v-if="scope.$index + (table.pageNum-1) * table.pageSize + 1 == 1 && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="scope.$index + (table.pageNum-1) * table.pageSize + 1 == 1 && isRoleEdit" icon="el-icon-delete" class="miniDanger" @click="handleRowDelete(scope.row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <!-- 新增盘点单 -->
-    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[create.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="create.rules" :model="create.createTemp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="盘点日期:" prop="inventorydate">
-                <el-date-picker v-model="create.createTemp.inventorydate" class="filter-item" type="date" placeholder="盘点日期" :disabled="create.dialogStatus==='see'" :picker-options="create.pickerOptions1" :clearable="false" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="盘点人:" prop="createuser">
-                <el-input ref="createuser" v-model="create.createTemp.createuser" class="filter-item" placeholder="盘点人" type="text" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="备注:" prop="remark">
-                <el-input ref="remark" v-model="create.createTemp.remark" class="filter-item" placeholder="备注" type="text" :disabled="create.dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <el-table
-          :key="create.tableKey"
-          v-loading="create.listLoading"
-          element-loading-text="给我一点时间"
-          :data="create.list"
-          border
-          fit
-          highlight-current-row
-          style="width: 100%;margin-bottom: 50px;"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable table-fixed"
-        >
-          <el-table-column label="饲料名称" min-width="130px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.feedname }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="库存重量(kg)" min-width="130px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.stockweight }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="实际重量(kg)" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <el-input v-if="create.dialogStatus =='create' || create.dialogStatus=='update'" ref="input" v-model="scope.row.factweight" style="width:80%;padding:10px 0;" @blur="blurFactweight(scope.row)" />
-              <span v-else> {{ scope.row.factweight }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="差值(kg)" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.differ }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-        <div slot="footer" class="dialog-footer">
-          <el-button v-if="create.dialogStatus==='see'" class="import" icon="el-icon-upload2" :disabled="isokDisable" @click="handleExport(2)">导出</el-button>
-          <el-button v-if="create.dialogStatus==='see'" class="cancelClose cancelClose1" @click="create.dialogFormVisible = false; ">关闭</el-button>
-          <el-button v-if="create.dialogStatus =='create' || create.dialogStatus=='update'" class="cancelClose" @click="create.dialogFormVisible = false; ">关闭</el-button>
-          <el-button v-if="create.dialogStatus =='create' || create.dialogStatus=='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
-  </div>
-</template>
-
-<script>
-import { GetDataByName, ExecDataByConfig, failproccess, checkButtons, PostDataByName } from '@/api/common'
-import Pagination from '@/components/Pagination'
-import { parseTime, json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import Cookies from 'js-cookie'
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-export default {
-  name: 'InventoryList',
-  components: { Pagination },
-  data() {
-    return {
-      dialogFull: false,
-      table: {
-        getdataListParm: {
-          name: 'getBigInventoryList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
-      textMap: {
-        create: '新增',
-        see: '查看盘点单',
-        update:'编辑'
-      },
-      create: {
-        pickerOptions1: {
-          disabledDate: this.disabledDate
-        },
-        dialogFormVisible: false,
-        dialogStatus: '',
-        createTemp: {
-          pastureid: Cookies.get('pastureid'),
-          remark: '',
-          inventorydate: parseTime(new Date(), '{y}-{m}-{d}'),
-          createuser: Cookies.get('employename')
-        },
-        rules: {},
-        getdataListParm: {
-          name: 'getFeedstorageWeightList',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            emp: Cookies.get('employename')
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        getMaxdataParm: {
-          name: 'getInventoryMaxdate',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        maxDate: ''
-      },
-      see: {
-        getdataListParm: {
-          name: 'getInventoryList',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {}
-        }
-      },
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getBigInventoryList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
-        },
-        list: []
-      },
-      isokDisable: false,
-      isRoleEdit: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
-    }
-  },
-  computed: {
-    // 设置请求头
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'checkFeed,insertBigInventoryUpload,insertInventoryUpload',
-        importParams: '盘点日期,盘点人,备注,饲料名称,库存重量(kg),实际重量(kg)',
-        sheetname: 'Sheet1',
-        // 登录牧场
-        pastureid: Cookies.get('pastureid'),
-        // 日期参数
-        dateParams: '盘点日期',
-        // 必填参数
-        requiredParams: '盘点日期,饲料名称,库存重量(kg),实际重量(kg)',
-        // 为数值的参数
-        numParams: '实际重量(kg)'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.getButtons()
-    this.getList()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'InventoryList'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    handleBefore() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(stop, '{y}-{m}-{d}')
-        this.$forceUpdate()
-      }
-    },
-    handleNext() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(stop, '{y}-{m}-{d}')
-        this.$forceUpdate()
-      }
-    },
-    handleSearch() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-
-    resetCreateTemp() {
-      this.create.createTemp = { pastureid: Cookies.get('pastureid'), remark: '', inventorydate: parseTime(new Date(), '{y}-{m}-{d}'), createuser: Cookies.get('employename') }
-    },
-    handleCreate() {
-      console.log('点击了新增盘点单')
-      this.resetCreateTemp()
-      this.dialogFull = false
-      this.create.dialogStatus = 'create'
-      this.create.dialogFormVisible = true
-      this.getMaxDate()
-      this.getCreateList()
-    },
-    disabledDate(time) {
-      return time.getTime() < new Date(this.create.maxDate) || time.getTime() > Date.now()
-    },
-    getMaxDate() {
-      GetDataByName(this.create.getMaxdataParm).then(response => {
-        this.create.maxDate = response.data.list[0].maxdate
-        console.log(response.data.list[0])
-      })
-    },
-    getCreateList() {
-      this.create.listLoading = true
-      GetDataByName(this.create.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.$set(response.data.list[i], 'factweight', '')
-            this.$set(response.data.list[i], 'differ', '')
-          }
-          this.create.list = response.data.list
-          this.create.pageNum = response.data.pageNum
-          this.create.pageSize = response.data.pageSize
-          this.create.total = response.data.total
-        } else {
-          this.create.list = []
-        }
-        setTimeout(() => {
-          this.create.listLoading = false
-        }, 100)
-      })
-    },
-    // 实际重量
-    blurFactweight(row) {
-      if (row.factweight !== '' && row.stockweight !== '') {
-        row.differ = parseFloat(row.factweight) - parseFloat(row.stockweight)
-      }
-    },
-    createData() {
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.isokDisable = true
-          setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          var createList = []
-          for (let i = 0; i < this.create.list.length; i++) {
-            if (this.create.list[i].factweight !== '') {
-              createList.push(this.create.list[i])
-            }
-          }
-          for (let i = 0; i < createList.length; i++) {
-            const keepTwoNum = /^\d+(\.\d{1,2})?$/
-            // 实际重量
-            if (!keepTwoNum.test(parseFloat(createList[i].factweight))) {
-              this.$message({ type: 'error', message: '实际重量请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            }
-          }
-
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertBigInventory', 'type': 'e', 'parammaps': {
-            'pastureid': this.create.createTemp.pastureid,
-            'inventorydate': parseTime(this.create.createTemp.inventorydate, '{y}-{m}-{d}'),
-            'createuser': this.create.createTemp.createuser,
-            'remark': this.create.createTemp.remark
-          }}
-          this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': createList }}
-          this.requestParam.data[1].children = []
-          this.requestParam.data[1].children[0] = { 'name': 'insertInventory', 'type': 'e', 'parammaps': {
-            invid: '@insertBigInventory.LastInsertId',
-            pastureid: '@insertSpotList.pastureid',
-            feedname: '@insertSpotList.feedname',
-            feedid: '@insertSpotList.feedid',
-            stockweight: '@insertSpotList.stockweight',
-            factweight: '@insertSpotList.factweight'
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
-            if (response.msg === 'fail') {
-              const inventorydate = new RegExp("key 'inventorydate'")
-              if (inventorydate.test(response.data)) {
-                this.$message({ type: 'error', message: '当前日期已盘点,不可重复录入', duration: 2000 })
-              } else {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-              }
-            } else {
-              this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
-            }
-          })
-        }
-      })
-    },
-
-    handleSee(row) {
-      console.log('点击了查看')
-      this.dialogFull = false
-      this.create.dialogStatus = 'see'
-      this.create.dialogFormVisible = true
-      this.create.createTemp = Object.assign({}, row)
-      this.see.getdataListParm.parammaps.pastureid = row.pastureid
-      this.see.getdataListParm.parammaps.id = row.id
-      this.getSeeList()
-    },
-    getSeeList() {
-      this.create.listLoading = true
-      GetDataByName(this.see.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.create.list = response.data.list
-          this.create.pageNum = response.data.pageNum
-          this.create.pageSize = response.data.pageSize
-          this.create.total = response.data.total
-        } else {
-          this.create.list = []
-        }
-        setTimeout(() => {
-          this.create.listLoading = false
-        }, 100)
-      })
-    },
-    handleRowDelete(row) {
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'deleteBigInventory'
-        this.requestParam.parammaps = {}
-        this.requestParam.parammaps.pastureid = row.pastureid
-        this.requestParam.parammaps.id = row.id
-        PostDataByName(this.requestParam).then(response => {
-          if (response.msg === 'fail') {
-            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-            this.getList()
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    handleUpdate(row){
-      console.log('点击了编辑')
-      this.dialogFull = false
-      this.create.dialogStatus = 'update'
-      this.create.dialogFormVisible = true
-      this.create.createTemp = Object.assign({}, row)
-      this.see.getdataListParm.parammaps.pastureid = row.pastureid
-      this.see.getdataListParm.parammaps.id = row.id
-      this.getSeeList()
-    },
-    updateData(){
-      console.log('点击了编辑保存')
-    },
-    handleInventoryList() {
-      this.download.getdataListParm.name = 'getFeedstorageWeightList'
-      this.download.getdataListParm.parammaps = {}
-      this.download.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
-      this.download.getdataListParm.parammaps.emp = Cookies.get('employename')
-      GetDataByName(this.download.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.download.list = response.data.list
-        } else {
-          this.download.list = []
-        }
-        var downloadList = [
-          { 'obj1': '1、文件类型为xlsx类型,对应表格文件名格式为:文件名称.xlsx;' },
-          { 'obj1': '2、底部工作表名称不可更改,默认为:Sheet1;' },
-          { 'obj1': '3、盘点日期,饲料名称为必填;' },
-          { 'obj1': '4、饲料名称必须与系统基础数据-饲料表中匹配;' },
-          { 'obj1': '5、实际重量为非负数,至多保留俩位小数;' },
-          { 'obj1': '6、盘点日期为文本格式的年-月-日,例:2020-10-10,盘点日期不可与系统已存在日期重复;盘点日期需保持一致' },
-          { 'obj1': '7、库存重量仅做参考,不与系统现有库存做校验;' },
-          { 'obj1': '8、实际重量可仅填写部分,导入已填写实际重量的饲料生成盘点单。' },
-          { 'obj1': '9、若有备注则填写在表格内容中第一个饲料行内即可;' }
-        ]
-        var excelDatas = [
-          {
-            tHeader: ['盘点日期', '盘点人', '备注', '饲料名称', '库存重量(kg)', '实际重量(kg)'],
-            filterVal: ['nowdate', 'emp', '', 'feedname', 'stockweight', ''],
-            tableDatas: this.download.list,
-            sheetName: 'Sheet1'
-          }, {
-            tHeader: ['填写规范:'],
-            filterVal: ['obj1'],
-            tableDatas: downloadList,
-            sheetName: 'Sheet2'
-          }
-        ]
-        json2excel(excelDatas, '盘点单导入模板', true, 'xlsx')
-      })
-    },
-    handleExport(item) {
-      if (item == 1) {
-        this.download.getdataListParm.parammaps.inputDatetime = this.table.getdataListParm.parammaps.inputDatetime
-        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
-          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-        } else {
-          this.download.getdataListParm.parammaps.inputDatetime = ''
-          this.download.getdataListParm.parammaps.startTime = ''
-          this.download.getdataListParm.parammaps.stopTime = ''
-        }
-        this.download.getdataListParm.name = 'getBigInventoryList'
-        GetDataByName(this.download.getdataListParm).then(response => {
-          if (response.data.list !== null) {
-            this.download.list = response.data.list
-          } else {
-            this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['盘点日期', '盘点人', '盘盈库存(kg)', '盘亏库存(kg)', '盈亏净值(kg)', '备注'],
-              filterVal: ['inventorydate', 'createuser', 'moreWeight', 'lessWeight', 'differWeight', 'remark'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '盘点单', true, 'xlsx')
-        })
-      } else {
-        this.download.getdataListParm.name = 'getInventoryList'
-        this.download.getdataListParm.parammaps = this.see.getdataListParm.parammaps
-        GetDataByName(this.download.getdataListParm).then(response => {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.$set(response.data.list[i], 'inventorydate', this.create.createTemp.inventorydate)
-            this.$set(response.data.list[i], 'createuser', this.create.createTemp.createuser)
-            this.$set(response.data.list[i], 'remark', this.create.createTemp.remark)
-          }
-          if (response.data.list !== null) {
-            this.download.list = response.data.list
-          } else {
-            this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['盘点日期', '盘点人', '备注', '饲料名称', '库存重量(kg)', '实际重量(kg)', '差值(kg)'],
-              filterVal: ['inventorydate', 'createuser', 'remark', 'feedname', 'stockweight', 'factweight', 'differ'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '盘点-查看', true, 'xlsx')
-        })
-      }
-    },
-    beforeImport(file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 2MB!')
-      }
-      return isLt2M
-    },
-    handleImportSuccess(res, file) {
-      this.getList()
-      if (res.msg === 'ok') {
-        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
-        if (res.data.err_count > 0) {
-          this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '盘点日期', '盘点人', '备注', '饲料名称', '库存重量(kg)', '实际重量(kg)', '错误信息'
-             ]
-             const filterVal = [
-               '盘点日期', '盘点人', '备注', '饲料名称', '库存重量(kg)', '实际重量(kg)', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '盘点单报错信息', autoWidth: true, bookType: 'xlsx' })
-           })
-        }
-      } else {
-        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  .search{margin-top:10px;}
-  
-</style>
-<style>
-  .inputDatetime .el-range-separator{ padding: 0; margin: 0 10px; }
-</style>

+ 1 - 1
src/views/inventoryManagement/laborConsumption/index.vue

@@ -358,10 +358,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 0 - 675
src/views/inventoryManagement/laborConsumption/index改.vue

@@ -1,675 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
-      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
-      <el-select v-model="table.getdataListParm.parammaps.usetype" placeholder="操作类型" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in operationTypeList" :key="item.id" :label="item.label" :value="item.value" />
-      </el-select>
-      <el-autocomplete v-model="table.getdataListParm.parammaps.feedname" value-key="feedname" class="inline-input filter-item" :fetch-suggestions="tableFeedNameSearch" placeholder="饲料名称" style="width:250px" @select="handleSelectTableFeedName">
-        <template slot-scope="{ item }">
-          <span>{{ item.feedname }}</span>
-        </template>
-      </el-autocomplete>
-      <el-select v-model="table.getdataListParm.parammaps.cowclassid" filterable placeholder="请选择牲畜类别" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
-      <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">导出</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        :max-height="myHeight"
-      >
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="出库日期" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.usedate }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="牲畜类别" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.cowclass }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="饲料名称" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.feedname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作重量(kg)" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.operateweight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作类型" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.usetype }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="备注" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.remark }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作人" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.createemp }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button  v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <span v-if="isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="isRoleEdit" icon="el-icon-delete" class="miniDanger" @click="handleRowDelete(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <!-- 新增/编辑 -->
-    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="80%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[create.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="create.rules" :model="create.createTemp" label-position="right" label-width="150px" style="width: 90%;height:300px;margin:0 auto 50px">
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="操作类型:" prop="usetype">
-                <el-select v-model="create.createTemp.usetype" placeholder="操作类型" class="filter-item" style="width: 100%;"  @change="changeUsetype">
-                  <el-option v-for="item in operationTypeList" :key="item.id" :label="item.label" :value="item.value" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="出库日期:" prop="usedate">
-                <el-date-picker v-model="create.createTemp.usedate" :picker-options="create.pickerOptions1" :clearable="false" class="filter-item" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" type="datetime" placeholder="出库日期" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="饲料名称:" prop="feedname">
-                <el-autocomplete v-model="create.createTemp.feedname" value-key="feedname" class="inline-input" :fetch-suggestions="feedNameSearch" placeholder="请选择饲料名称" style="width:100%" @select="handleSelectFeedName" @blur="blurFeedName">
-                  <template slot-scope="{ item }">
-                    <span>{{ item.feedname }}</span>
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="牲畜类别:" prop="cowclassid">
-                <el-input v-if="create.dialogStatus==='see'" ref="cowclass" v-model="create.createTemp.cowclass" disabled class="filter-item" placeholder="请选择牲畜类别" type="text" disabled />
-                <el-select v-else v-model="create.createTemp.cowclassid" filterable placeholder="请选择牲畜类别" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus==='see' || create.createTemp.usetype=='损耗'" @change="changeLivestock">
-                  <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="库存重量(kg):" prop="repertoryweight">
-                <el-input ref="repertoryweight" v-model="create.createTemp.repertoryweight" class="filter-item" placeholder="最多两位小数" type="text" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="操作重量(kg):" prop="operateweight">
-                <el-input ref="operateweight" v-model="create.createTemp.operateweight" class="filter-item" placeholder="最多两位小数" type="text" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="备注:" prop="remark">
-                <el-input ref="remark" v-model="create.createTemp.remark" class="filter-item" placeholder="1-255字符" type="text" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="操作人:" prop="createemp">
-                <el-input ref="createemp" v-model="create.createTemp.createemp" class="filter-item" placeholder="1-255字符" type="text" disabled />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="cancelClose" @click="create.dialogFormVisible = false;getList();">关闭</el-button>
-          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
-  </div>
-
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, checkButtons, ExecDataByConfig, failproccess } from '@/api/common'
-import Pagination from '@/components/Pagination'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-import { MessageBox } from 'element-ui'
-export default {
-  name: 'LaborConsumption',
-  components: { Pagination },
-  data() {
-    return {
-      dialogFull: false,
-      isRoleEdit: [],
-      requestParams: [
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['人工用量操作类型'] },
-        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
-      ],
-      operationTypeList: [], // 操作类型
-      feedNameList: [], // 饲料名称
-      livestockList: [], // 牲畜类别
-
-      table: {
-        getdataListParm: {
-          name: 'getFeeduseList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            inputDatetime: '',
-            pastureid: Cookies.get('pastureid'),
-            startTime: '',
-            stopTime: '',
-            usetype: '',
-            feedid: '',
-            cowclassid: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
-
-      create: {
-        pickerOptions1: {
-          disabledDate(time) {
-            return time.getTime() > Date.now()// 当天之前的时间可选
-          }
-        },
-        dialogFormVisible: false,
-        dialogStatus: '',
-        createTemp: {
-          pastureid: Cookies.get('pastureid'), usedate: parseTime(new Date(), '{y}-{m}-{d}'), feedid: '', feedname: '', cowclassid: '', cowclass: '', usetype: '', operateweight: '', repertoryweight: '', createemp: '', remark: '', price: '', operator: Cookies.get('employename')
-        },
-        getfeedNameParm: {
-          name: 'getFeedstorageuse',
-          offset: 0,
-          pagecount: '',
-          parammaps: { pastureid: Cookies.get('pastureid') }
-        },
-        rules: {
-          usetype: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          usedate: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          feedname: [{ type: 'string', required: true, message: '必填', trigger: 'change' }],
-          operateweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
-        }
-      },
-
-      textMap: {
-        create: '新增',
-        update: '编辑'
-      },
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getFeeduseList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            inputDatetime: '',
-            pastureid: Cookies.get('pastureid'),
-            startTime: '',
-            stopTime: '',
-            usetype: '',
-            feedid: '',
-            cowclassid: ''
-          }
-        },
-        list: []
-      },
-      isokDisable: false,
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  computed: {
-    // 设置请求头
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'checkFeed,checkclassname,checkfeedusetype,insertFeeduseUpload,insertFeedstorageUseUpload',
-        importParams: '出库日期,操作类型,牲畜类别,饲料名称,操作重量(kg),备注,操作人',
-        sheetname: 'Sheet1',
-        // 登录牧场
-        pastureid: Cookies.get('pastureid'),
-        // 日期参数
-        dateParams: '出库日期',
-        // 必填参数
-        requiredParams: '出库日期,操作类型,饲料名称,操作重量(kg)',
-        // 为数值的参数
-        numParams: '操作重量(kg)'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.getList()
-    this.getDownList()
-    this.getButtons()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'SystemConsumption'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.operationTypeList = response.data.getDictByName.list
-        this.livestockList = response.data.getCowclassListEnable.list
-      })
-    },
-    handleBefore() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(stop, '{y}-{m}-{d}')
-        this.$forceUpdate()
-      }
-    },
-    handleNext() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(stop, '{y}-{m}-{d}')
-        this.$forceUpdate()
-      }
-    },
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-
-    handleSearch() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.feedid = ''
-      this.table.getdataListParm.parammaps.cowclassid = ''
-      this.table.getdataListParm.parammaps.ischarge = ''
-      this.table.getdataListParm.parammaps.usetype = ''
-      this.table.getdataListParm.parammaps.feedname = ''
-      this.table.getdataListParm.parammaps.cowclassid = ''
-      this.getList()
-    },
-
-    // 操作类型
-    changeUsetype(item) {
-      console.log(item)
-      if (item == '损耗') {
-        console.log(item)
-        this.create.createTemp.cowclassid = '/'
-        this.create.createTemp.cowclass = '/'
-      } else {
-        this.create.createTemp.cowclassid = ''
-        this.create.createTemp.cowclass = ''
-      }
-    },
-    tableFeedNameSearch(queryString, cb) {
-      this.create.getfeedNameParm.parammaps['feedname'] = queryString
-      GetDataByName(this.create.getfeedNameParm).then(response => {
-        console.log('模糊查询搜索data', response.data.list)
-        if (response.data.list == null) {
-          cb([])
-        } else {
-          cb(response.data.list)
-        }
-      })
-    },
-    handleSelectTableFeedName(item) {
-      this.table.getdataListParm.parammaps.feedid = item.feedid
-    },
-    // 饲料名称
-    feedNameSearch(queryString, cb) {
-      this.create.getfeedNameParm.parammaps['feedname'] = queryString
-      GetDataByName(this.create.getfeedNameParm).then(response => {
-        console.log('模糊查询搜索data', response.data.list)
-        if (response.data.list == null) {
-          cb([])
-        } else {
-          cb(response.data.list)
-        }
-      })
-    },
-    handleSelectFeedName(item) {
-      console.log(item)
-      this.create.createTemp.feedname = item.feedname
-      this.create.createTemp.feedid = item.feedid
-      this.create.createTemp.price = item.price
-      this.create.createTemp.pcpde = item.pcpde
-      this.create.createTemp.repertoryweight = item.stockweight
-    },
-    blurFeedName() {
-      this.create.createTemp.feedname = ''
-      this.create.createTemp.feedid = ''
-      this.create.createTemp.price = ''
-      this.create.createTemp.pcpde = ''
-      this.create.createTemp.repertoryweight = ''
-    },
-    // 牲畜类别
-    changeLivestock(item) {
-      this.create.createTemp.cowclass = this.livestockList.find(obj => obj.id == item).classname
-    },
-    resetCreateTemp() {
-      this.create.createTemp = {
-        cowclassid1: '-1', pastureid: Cookies.get('pastureid'), usedate: parseTime(new Date(), '{y}-{m}-{d}'), feedid: '', feedname: '', cowclassid: '', cowclass: '', usetype: '', operateweight: '', repertoryweight: '', createemp: Cookies.get('employename'), remark: '', price: '', operator: Cookies.get('employename')
-      }
-    },
-    handleCreate() {
-      console.log('点击了新增')
-      this.create.dialogStatus = 'create'
-      this.dialogFull = false
-      this.create.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.resetCreateTemp()
-        this.$refs.createTemp.resetFields()
-      })
-    },
-    createData() {
-      console.log('点击了新增保存')
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.isokDisable = true
-          setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          if (this.create.createTemp.usetype == '人工用料') {
-            if (this.create.createTemp.cowclassid == '') {
-              this.$message({ type: 'error', message: '请选择牲畜类别', duration: 2000 })
-              return false
-            }
-          }
-          const keepTwoNum = /^\d+(\.\d{1,2})?$/
-          // 操作重量
-          if (this.create.createTemp.operateweight == 0) {
-            this.$message({ type: 'error', message: '操作重量请输入自然数并保留两位小数', duration: 2000 })
-            return false
-          } else {
-            if (!keepTwoNum.test(parseFloat(this.create.createTemp.operateweight))) {
-              this.$message({ type: 'error', message: '操作重量请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            }
-          }
-          if (this.create.createTemp.cowclassid == '/' && this.create.createTemp.cowclass == '/') {
-            this.create.createTemp.cowclassid = ''
-            this.create.createTemp.cowclass = ''
-          }
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertFeeduse', 'type': 'e', 'parammaps': {
-            'pastureid': this.create.createTemp.pastureid,
-            'usedate': this.create.createTemp.usedate,
-            'feedid': this.create.createTemp.feedid,
-            'feedname': this.create.createTemp.feedname,
-            'cowclassid': this.create.createTemp.cowclassid,
-            'cowclass': this.create.createTemp.cowclass,
-            'usetype': this.create.createTemp.usetype,
-            'operateweight': this.create.createTemp.operateweight,
-            'repertoryweight': this.create.createTemp.repertoryweight,
-            'createemp': this.create.createTemp.createemp,
-            'remark': this.create.createTemp.remark,
-            'price': this.create.createTemp.price
-          }}
-          this.requestParam.data[1] = { 'name': 'insertFeedstorageUse', 'type': 'e', 'parammaps': {
-            'pastureid': this.create.createTemp.pastureid,
-            'feedid': this.create.createTemp.feedid,
-            'operateweight': this.create.createTemp.operateweight,
-            'fname': this.create.createTemp.feedname,
-            'pcpde': this.create.createTemp.pcpde,
-            'price': this.create.createTemp.price
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
-            if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
-            }
-          })
-        }
-      })
-    },
-    handleUpdate(row) {
-      this.$nextTick(() => {
-        this.$refs.createTemp.resetFields()
-      })
-      this.dialogFull = false
-      this.create.dialogStatus = 'update'
-      this.create.dialogFormVisible = true
-      if (row.cowclassid == -1) {
-        row.cowclassid = ''
-        row.cowclass = ''
-      }
-      this.create.createTemp = Object.assign({}, row)
-    },
-    updateData(){
-      console.log('点击了编辑保存')
-    },
-    handleRowDelete(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/库存管理/人工用量导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '人工用量导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
-          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-        } else {
-          this.download.getdataListParm.parammaps.inputDatetime = ''
-          this.download.getdataListParm.parammaps.startTime = ''
-          this.download.getdataListParm.parammaps.stopTime = ''
-        }
-        GetDataByName(this.download.getdataListParm).then(response => {
-          if (response.data.list !== null) {
-            this.download.list = response.data.list
-          } else {
-            this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['出库日期', '操作类型', '牲畜类别', '饲料名称', '操作重量(kg)', '备注', '操作人'],
-              filterVal: ['usedate', 'usetype', 'cowclass', 'feedname', 'operateweight', 'remark', 'createemp'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '人工用量', true, 'xlsx')
-        })
-      }
-    },
-
-    beforeImport(file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 2MB!')
-      }
-      return isLt2M
-    },
-    handleImportSuccess(res, file) {
-      this.getList()
-      if (res.msg === 'ok') {
-        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
-        if (res.data.err_count > 0) {
-          this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '出库日期', '操作类型', '牲畜类别', '饲料名称', '操作重量(kg)', '备注', '操作人', '错误信息'
-             ]
-             const filterVal = [
-               '出库日期', '操作类型', '牲畜类别', '饲料名称', '操作重量(kg)', '备注', '操作人', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '人工用量导入报错信息', autoWidth: true, bookType: 'xlsx' })
-           })
-        }
-      } else {
-        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    }
-  }
-}
-</script>
- <style lang="scss">
-   .typeSelect span .el-popover__reference .el-input--suffix {
-       .el-input__inner{
-         height:40px !important;
-       }
-     }
- </style>

+ 1 - 1
src/views/inventoryManagement/statistics/index.vue

@@ -317,10 +317,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 14 - 22
src/views/inventoryManagement/systemConsumption/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="app-container">
+
     <div class="search">
       <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
       <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
@@ -10,9 +11,6 @@
       <el-select v-model="table.getdataListParm.parammaps.feedid" placeholder="饲料名称" class="filter-item" style="width: 150px;" filterable clearable>
         <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
       </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.ischarge" placeholder="是否预混料" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in isPremixList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
       <el-select v-model="table.getdataListParm.parammaps.ischarge" placeholder="是否审核" class="filter-item" style="width: 150px;" clearable>
         <el-option v-for="item in isAuditList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
@@ -36,8 +34,7 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
+        @selection-change="handleSelectionChange"
       >
         <el-table-column type="selection" align="center" width="50" />
         <el-table-column label="序号" align="center" type="index" width="50px">
@@ -60,10 +57,9 @@
             <span>{{ scope.row.feedname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="是否预混料" min-width="60px" align="center">
+        <el-table-column label="是否预混料" min-width="100px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.premix == 0">否</span>
-            <span v-else>是</span>
+            <span>{{ scope.row.feedname }}</span>
           </template>
         </el-table-column>
         <el-table-column label="库存重量(kg)" min-width="100px" align="center">
@@ -87,13 +83,13 @@
             <el-input v-if="scope.row.Edit" v-model="scope.row.operateweight" placeholder="最多保留两位小数" type="number" :step="0.01" style="width:95%;padding:10px 0;" />
           </template>
         </el-table-column>
-        <el-table-column label="备注" min-width="70px" align="center">
+        <el-table-column label="备注" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.remark }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.remark" placeholder="1-32个字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
           </template>
         </el-table-column>
-        <el-table-column label="是否审核" min-width="70px" align="center">
+        <el-table-column label="是否审核" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.ischarge == 1">是</span>
             <span v-else>否</span>
@@ -104,7 +100,6 @@
             <el-button v-if="row.isUpdate && row.ischarge !== 1 && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
             <el-button v-if="row.isUpdateSave" :disabled="isokDisable" class="miniSuccess" icon="el-icon-folder-checked" @click="updateData(row)" />
             <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-            <el-button v-if="row.ischarge == 1 && isRoleEdit" class="miniSuccess" icon="el-icon-refresh-left" @click="handleRevoke(row)" />
           </template>
         </el-table-column>
       </el-table>
@@ -125,7 +120,7 @@ export default {
   components: { Pagination },
   data() {
     return {
-      isPremixList:[{ id: '1', name: '是' }, { id: '0', name: '否' }],//是否预混料
+
       livestockTypeList: [], // 牲畜类别
       feedNameList: [{ id: 0, name: '羊草' }, { id: 1, name: '小苏打' }], // 饲料名称
       isAuditList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否审核
@@ -181,8 +176,7 @@ export default {
       isokDisable: false,
       isRoleEdit: [],
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
+      cellStyle: { padding: 0 + 'px' }
     }
   },
 
@@ -236,10 +230,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
@@ -315,13 +309,6 @@ export default {
       row.isUpdateSave = false
       this.getList()
     },
-    handleRevoke(row){
-      MessageBox.confirm('请确认是否要撤销审核结果?', '提示', {
-        confirmButtonText: '是', cancelButtonText: '否', type: 'warning'
-      }).then(() => {
-        console.log('点击了撤销')
-      })
-    },
     handleSelectionChange(val) {
       console.log('勾选数据', val)
       this.selectList = val
@@ -408,3 +395,8 @@ export default {
   }
 }
 </script>
+<style lang="scss" scoped>
+  // .operation{margin-top:10px;}
+  .search{margin-top:10px;}
+  
+ </style>

+ 0 - 402
src/views/inventoryManagement/systemConsumption/index备.vue

@@ -1,402 +0,0 @@
-<template>
-  <div class="app-container">
-
-    <div class="search">
-      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
-      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
-      <el-select v-model="table.getdataListParm.parammaps.cowclassid" placeholder="牲畜类别" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.value" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.feedid" placeholder="饲料名称" class="filter-item" style="width: 150px;" filterable clearable>
-        <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.ischarge" placeholder="是否审核" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in isAuditList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-document-checked" @click="handleExamine">审核</el-button>
-      <el-button class="export" icon="el-icon-upload2" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="业务日期" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.usedate }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="牲畜类别" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.cowclass }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="饲料名称" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.feedname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="是否预混料" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.feedname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="库存重量(kg)" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.repertoryweight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="计划重量(kg)" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.planweight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="设备实测重量(kg)" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.actweight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="出库重量(kg)" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.operateweight }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.operateweight" placeholder="最多保留两位小数" type="number" :step="0.01" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column label="备注" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.remark }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.remark" placeholder="1-32个字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column label="是否审核" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.ischarge == 1">是</span>
-            <span v-else>否</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button v-if="row.isUpdate && row.ischarge !== 1 && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <el-button v-if="row.isUpdateSave" :disabled="isokDisable" class="miniSuccess" icon="el-icon-folder-checked" @click="updateData(row)" />
-            <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-  </div>
-
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, checkButtons, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
-import Pagination from '@/components/Pagination'
-import { MessageBox } from 'element-ui'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-export default {
-  name: 'SystemConsumption',
-  components: { Pagination },
-  data() {
-    return {
-
-      livestockTypeList: [], // 牲畜类别
-      feedNameList: [{ id: 0, name: '羊草' }, { id: 1, name: '小苏打' }], // 饲料名称
-      isAuditList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否审核
-      requestParams: [
-        { name: 'getFeedListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
-      ],
-      table: {
-        getdataListParm: {
-          name: 'getFeeduseList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            inputDatetime: '',
-            pastureid: Cookies.get('pastureid'),
-            startTime: '',
-            stopTime: '',
-            usetype: '系统用量',
-            feedid: '',
-            cowclassid: '',
-            ischarge: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
-      selectList: [],
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getFeeduseList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            inputDatetime: '',
-            pastureid: Cookies.get('pastureid'),
-            startTime: '',
-            stopTime: '',
-            usetype: '系统用量',
-            feedid: '',
-            cowclassid: '',
-            ischarge: ''
-          }
-        },
-        list: []
-      },
-      isokDisable: false,
-      isRoleEdit: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
-    }
-  },
-
-  created() {
-    this.getButtons()
-    this.getDownList()
-    this.getList()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'SystemConsumption'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.feedNameList = response.data.getFeedListEnable.list
-        this.livestockTypeList = response.data.getDictByName.list
-      })
-    },
-    handleBefore() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.$forceUpdate()
-      }
-    },
-    handleNext() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.$forceUpdate()
-      }
-    },
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.$set(response.data.list[i], 'Edit', false) // 编辑
-            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
-            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
-            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
-          }
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSearch() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.feedid = ''
-      this.table.getdataListParm.parammaps.cowclassid = ''
-      this.table.getdataListParm.parammaps.ischarge = ''
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleUpdate(row) {
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (this.table.list[i].Edit == true) {
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-      }
-      // 编辑true,不可编辑false
-      row.Edit = true
-      row.NoEdit = false
-      // 编辑false,编辑保存true
-      row.isUpdate = false
-      row.isUpdateSave = true
-    },
-    updateData(row) {
-      console.log('点击了编辑保存', row)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam.name = 'updateFeeduse'
-      this.requestParam.parammaps = {}
-      this.requestParam.parammaps.pastureid = row.pastureid
-      this.requestParam.parammaps.id = row.id
-      this.requestParam.parammaps.remark = row.remark
-      this.requestParam.parammaps.operateweight = row.operateweight
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        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 })
-        }
-      })
-    },
-    updateCancel(row) {
-      console.log('点击了编辑取消')
-      // 编辑false,不可编辑true
-      row.Edit = false
-      row.NoEdit = true
-      // 编辑true,编辑保存false
-      row.isUpdate = true
-      row.isUpdateSave = false
-      this.getList()
-    },
-    handleSelectionChange(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    handleExamine() {
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择需要审核的单据', duration: 2000 })
-      } else {
-        for (let i = 0; i < this.selectList.length; i++) {
-          if (this.selectList[i].ischarge == 1) {
-            this.$message({ type: 'error', message: '单据不可重复审核,请重新选择', duration: 2000 })
-            return
-          }
-        }
-        MessageBox.confirm('是否确认审核系统用量?', '提示', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': 'insertFeedstorageUse', 'type': 'e', 'parammaps': {
-            snowid: '@insertSpotList.snowid',
-            pastureid: '@insertSpotList.pastureid',
-            feedid: '@insertSpotList.feedid',
-            fname: '@insertSpotList.fname',
-            pcpde: '@insertSpotList.pcpde',
-            operateweight: '@insertSpotList.operateweight',
-            price: '@insertSpotList.price'
-          }}
-          this.requestParam.data[0].children[1] = { 'name': 'chargeFeedstorageuse', 'type': 'e', 'parammaps': {
-            id: '@insertSpotList.id',
-            pastureid: '@insertSpotList.pastureid',
-            operateweight: '@insertSpotList.operateweight'
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('审核保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-    handleExport() {
-      console.log('点击了导出')
-      this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-      if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
-        this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.download.getdataListParm.parammaps.inputDatetime = ''
-        this.download.getdataListParm.parammaps.startTime = ''
-        this.download.getdataListParm.parammaps.stopTime = ''
-      }
-      GetDataByName(this.download.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].ischarge == 1) {
-              response.data.list[i].ischarge = '是'
-            } else {
-              response.data.list[i].ischarge = '否'
-            }
-          }
-          this.download.list = response.data.list
-        } else {
-          this.download.list = []
-        }
-        var excelDatas = [
-          {
-            tHeader: ['业务日期', '牲畜类别', '饲料名称', '库存重量(kg)', '计划重量(kg)', '设备实测重量(kg)', '出库重量(kg)', '备注', '是否审核'],
-            filterVal: ['usedate', 'cowclass', 'feedname', 'repertoryweight', 'planweight', 'actweight', 'operateweight', 'remark', 'ischarge'],
-            tableDatas: this.download.list,
-            sheetName: 'Sheet1'
-          }
-        ]
-        json2excel(excelDatas, '系统用量', true, 'xlsx')
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  // .operation{margin-top:10px;}
-  .search{margin-top:10px;}
-  
- </style>

+ 5 - 4
src/views/inventoryManagement/warehousing/index.vue

@@ -11,7 +11,7 @@
         <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id" />
       </el-select>
       <el-select v-model="table.getdataListParm.parammaps.islaid" placeholder="是否入库" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in islaidList" :key="item.id" :label="item.name" :value="item.name" />
+        <el-option v-for="item in islaidList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
@@ -338,7 +338,7 @@ export default {
       feedNameAddList: [], // 饲料名称新增
       supplierList: [], // 供应商
       contractNoList: [], // 合同编号
-      islaidList: [{ id: 0, name: '是' }, { id: 1, name: '否' }], // 是否入库
+      islaidList: [ { id: 0, name: '未入库' },{ id: 1, name: '已入库' }], // 是否入库
       requestParams: [
         { name: 'getFeedListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getProviderListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
@@ -377,7 +377,8 @@ export default {
           laiddate: '', feedid: '', feedname: '', operateweight: '', providerid: '', providername: '', startweight: '', priceold: '', contractcode: '', pricenew: '', sumprice: '', grossweight: '', tareweight: '', licence: '', pcpde: '', createemp: '', createdate: '', remark: '', 'wagonnumber': ''
         },
         rules: {
-          laiddate: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          laiddate: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          operateweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           feedname: [{ type: 'string', required: true, message: '必填', trigger: 'change' }],
           pricenew: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
         },
@@ -528,10 +529,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 0 - 1273
src/views/inventoryManagement/warehousing/index改.vue

@@ -1,1273 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
-      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
-      <el-select v-model="table.getdataListParm.parammaps.feedid" filterable placeholder="饲料名称" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.providerid" placeholder="供应商" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id" />
-      </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.islaid" placeholder="入库状态" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in islaidList" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增入库单</el-button>
-      <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">导出</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        :max-height="myHeight"
-      >
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="入库日期" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.laiddate }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="饲料名称" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.feedname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="供应商" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.providername }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="入库重量(kg)" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.operateweight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="总价(元)" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.sumprice }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="批号" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.pcpde }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="备注" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.remark }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="入库状态" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.islaid }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="创建人" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.createemp }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="创建日期" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.createdate }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
-            <el-button v-if="row.islaid == '已入库'" class="miniSuccess" icon="el-icon-refresh-left" @click="handleRevoke(row)" />
-            <el-button v-if="row.islaid == '未入库'" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <!-- 新增入库单 -->
-    <el-dialog :fullscreen="dialogFull" :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[create.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="create.rules" :model="create.createTemp" label-position="right" label-width="160px" style="width: 100%;margin:0 auto">
-          <el-row>
-            <el-col :span="24">
-              <h3 style="width: 160px;text-align: right;">基础信息</h3>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="入库日期:" prop="laiddate">
-                <el-date-picker v-model="create.createTemp.laiddate" :disabled="create.dialogStatus=='see'" class="filter-item" type="date" placeholder="入库日期" :clearable="false" :picker-options="create.pickerOptions1" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="送货单编号:" prop="wagonnumber">
-                <el-input ref="wagonnumber" v-model="create.createTemp.wagonnumber" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="送货单编号" type="text" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="饲料名称:" prop="feedname">
-                <el-autocomplete
-                  v-model="create.createTemp.feedname"
-                  value-key="fname"
-                  class="inline-input"
-                  :fetch-suggestions="feedNameSearch"
-                  placeholder="请选择饲料名称"
-                  style="width:98%"
-                  :disabled="create.dialogStatus=='see' || create.dialogStatus=='update'"
-                  @select="handleSelectFeedName"
-                  @blur="blurFeedName"
-                >
-                  <template slot-scope="{ item }">
-                    <span>{{ item.fname }}</span>
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="入库重量(kg):" prop="operateweight">
-                <el-input ref="operateweight" v-model.trim="create.createTemp.operateweight" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="最多两位小数" type="number" :step="0.01" @blur="blurOperateweight" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="供应商:" prop="providerid">
-                <el-input v-if="create.dialogStatus=='see'" ref="providername" v-model.trim="create.createTemp.providername" disabled class="filter-item" placeholder="请选择供应商" />
-                <el-select v-else v-model="create.createTemp.providerid" clearable placeholder="请选择供应商" :disabled="create.dialogStatus=='see'" class="filter-item" style="width: 100%" @change="changeSupplier">
-                  <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="合同编号:" prop="contractcode">
-                <el-select v-model="create.createTemp.contractcode" clearable placeholder="请选择合同编号" :disabled="create.dialogStatus=='see'" class="filter-item" style="width: 100%" @change="changeContractNo">
-                  <el-option v-for="item in contractNoList" :key="item.id" :label="item.contractcodeCat" :value="item.contractcode" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <h3 style="width: 160px;text-align: right;">价格信息</h3>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="单价(元):" prop="pricenew">
-                <el-input ref="pricenew" v-model="create.createTemp.pricenew" :disabled="create.createTemp.contractcode !=='' || create.dialogStatus=='see'" class="filter-item" placeholder="最多两位小数" type="number" :step="0.01" @blur="blurPricenew" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="总价(元):" prop="sumprice">
-                <el-input ref="sumprice" v-model="create.createTemp.sumprice" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="最多两位小数" type="number" :step="0.01" @blur="blurSumprice" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <h3 style="width: 160px;text-align: right;">饲料信息</h3>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="毛重(kg):" prop="grossweight">
-                <el-input ref="grossweight" v-model.trim="create.createTemp.grossweight" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="最多两位小数" type="number" :step="0.01" @blur="blurGrossweight" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="皮重(kg):" prop="tareweight">
-                <el-input ref="tareweight" v-model.trim="create.createTemp.tareweight" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="最多两位小数" type="number" :step="0.01" @blur="blurTareweight" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="许可证号:" prop="licence">
-                <el-input ref="licence" v-model="create.createTemp.licence" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="许可证号" type="text" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="批号:" prop="pcpde">
-                <el-input ref="pcpde" v-model="create.createTemp.pcpde" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="批号" type="text" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <h3 style="width: 160px;text-align: right;">操作信息</h3>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="创建人:" prop="createemp">
-                <el-input ref="createemp" v-model="create.createTemp.createemp" class="filter-item" placeholder="创建人" type="text" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="创建日期:" prop="createdate">
-                <el-date-picker v-model="create.createTemp.createdate" class="filter-item" type="date" placeholder="创建日期" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="备注:" prop="remark">
-                <el-input ref="remark" v-model="create.createTemp.remark" :disabled="create.dialogStatus=='see'" class="filter-item" placeholder="1-255字符" type="text" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button v-if="create.dialogStatus == 'see' " class="cancelClose cancelClose1" @click="create.dialogFormVisible = false;getList(); ">关闭</el-button>
-          <el-button v-if="create.dialogStatus !== 'see' " class="cancelClose" @click="create.dialogFormVisible = false;getList(); ">关闭</el-button>
-          <el-button v-if="create.dialogStatus !== 'see' " class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
-    <!-- 初始化库存 -->
-    <el-dialog :fullscreen="dialogFull" :visible.sync="initial.dialogFormVisible" :close-on-click-modal="false" width="80%" height="55%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[initial.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
-      <div class="app-add" style="height: 100%;margin: 0 auto 60px;">
-        <div class="operation">
-          <el-button style="float: left;margin-bottom:10px;" class="success" @click="handleInitialExport">模板下载</el-button>
-          <el-upload style="float: left;margin-left: 10px;margin-bottom:10px;" action="" :auto-upload="false" accept=".xlsx, .xls" :show-file-list="false" :on-change="handleInitialImport">
-            <el-button class="success" icon="el-icon-download">导入</el-button>
-          </el-upload>
-        </div>
-        <div class="table">
-          <el-table
-            :key="initial.tableKey"
-            v-loading="initial.listLoading"
-            element-loading-text="给我一点时间"
-            :data="initial.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-          >
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="饲料名称" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <span>{{ scope.row.fname }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="库存重量" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.stockweight" placeholder="最多两位小数" type="number" :step="0.01" style="width:95%;padding:10px 0;" />
-              </template>
-            </el-table-column>
-          </el-table>
-          <div slot="footer" class="dialog-footer">
-            <el-button class="cancelClose" @click="initial.dialogFormVisible = false; ">关闭</el-button>
-            <el-button class="save" :disabled="isokDisable" @click="initialData()">确认</el-button>
-          </div>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, checkButtons, ExecDataByConfig, failproccess, formatNum } from '@/api/common'
-import Pagination from '@/components/Pagination'
-import { MessageBox } from 'element-ui'
-import Cookies from 'js-cookie'
-import { json2excel, parseTime } from '@/utils/index.js'
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-import xlsx from 'xlsx'
-import { upload } from '@/utils/index.js'
-export default {
-  name: 'Warehousing',
-  components: { Pagination },
-  data() {
-    return {
-      dialogFull: false,
-      feedNameList: [], // 饲料名称
-      feedNameAddList: [], // 饲料名称新增
-      supplierList: [], // 供应商
-      contractNoList: [], // 合同编号
-      islaidList: [{ id: 0, name: '已入库' }, { id: 1, name: '未入库' }, { id: 2, name: '已撤销' }], // 是否入库
-      requestParams: [
-        { name: 'getFeedListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
-        { name: 'getProviderListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
-      ],
-      table: {
-        getdataListParm: {
-          name: 'getFeedlaidList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inputDatetime: '',
-            startTime: '',
-            stopTime: '',
-            feedid: '',
-            islaid: '',
-            providerid: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
-      create: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        pickerOptions1: {
-          disabledDate(time) {
-            return time.getTime() > Date.now()// 当天之前的时间可选
-          }
-        },
-        createTemp: {
-          laiddate: '', feedid: '', feedname: '', operateweight: '', providerid: '', providername: '', startweight: '', priceold: '', contractcode: '', pricenew: '', sumprice: '', grossweight: '', tareweight: '', licence: '', pcpde: '', createemp: '', createdate: '', remark: '', 'wagonnumber': ''
-        },
-        rules: {
-          laiddate: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          feedname: [{ type: 'string', required: true, message: '必填', trigger: 'change' }],
-          pricenew: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
-        },
-        getdataListParm: {
-          name: 'getBigContractListEnable',
-          offset: 0,
-          pagecount: '',
-          parammaps: { pastureid: Cookies.get('pastureid') }
-        },
-        getfeedNameParm: {
-          name: 'getFeedListEnableV2',
-          offset: 0,
-          pagecount: '',
-          parammaps: { pastureid: Cookies.get('pastureid') }
-        }
-      },
-      initial: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        rules: {},
-        getdataListParm: {
-          name: 'getinitFeed',
-          page: 1,
-          offset: 1,
-          pagecount: 6,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        character: {
-          fname: {
-            text: '饲料名称',
-            type: String
-          },
-          stockweight: {
-            text: '库存重量',
-            type: String
-          }
-        }
-      },
-      textMap: {
-        create: '新增入库单',
-        update: '编辑入库单',
-        see: '查看入库单',
-        initial: '初始化库存'
-      },
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getFeedlaidList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inputDatetime: '',
-            startTime: '',
-            stopTime: '',
-            feedid: '',
-            islaid: '',
-            providerid: ''
-          }
-        },
-        list: []
-      },
-      isokDisable: false,
-      isRoleEdit: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  computed: {
-    // 设置请求头
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'checkFeed,checkProviderRK,checkcontractcode,checkcontractcodePrice,insertFeedlaidUpload,insertFeedstorageLaidUpload',
-        importParams: '入库日期,送货单编号,饲料名称,供应商,合同编号,入库重量(kg),单价(元),总价(元),毛重(kg),皮重(kg),许可证号,批号,创建人,备注',
-        sheetname: 'Sheet1',
-        // 登录牧场
-        pastureid: Cookies.get('pastureid'),
-        // 日期参数
-        dateParams: '入库日期',
-        // 必填参数
-        requiredParams: '入库日期,饲料名称,入库重量(kg),单价(元)',
-        // 为数值的参数
-        numParams: '入库重量(kg),单价(元),总价(元),毛重(kg),皮重(kg)'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.getButtons()
-    this.getDownList()
-    this.getList()
-  },
-
-  methods: {
-
-    getButtons() {
-      const Edit = 'Warehousing'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.feedNameList = response.data.getFeedListEnable.list
-        this.supplierList = response.data.getProviderListEnable.list
-      })
-    },
-    handleBefore() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.$forceUpdate()
-      }
-    },
-    handleNext() {
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        this.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.$forceUpdate()
-      }
-    },
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
-        } else {
-          this.table.list = []
-        }
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSearch() {
-      // console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.feedid = ''
-      this.table.getdataListParm.parammaps.islaid = ''
-      this.table.getdataListParm.parammaps.providerid = ''
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-
-    resetCreateTemp() {
-      this.create.createTemp = {
-        pastureid: Cookies.get('pastureid'), laiddate: parseTime(new Date(), '{y}-{m}-{d}'), feedid: '', feedname: '', operateweight: '', providerid: '', providername: '', startweight: '', priceold: '', contractcode: '', pricenew: '', sumprice: '', grossweight: '', tareweight: '', licence: '', pcpde: '', createemp: Cookies.get('employename'), createdate: parseTime(new Date(), '{y}-{m}-{d}'), remark: '', 'wagonnumber': ''
-      }
-      this.contractNoList = []
-    },
-    // 供应商
-    changeSupplier(item) {
-      console.log(item)
-      if (item !== '') {
-        this.create.createTemp.providername = this.supplierList.find(obj => obj.id == item).providerName
-      } else {
-        this.create.createTemp.providername = ''
-        this.create.createTemp.contractcode = ''
-        this.create.createTemp.pricenew = ''
-        this.create.createTemp.sumprice = ''
-        this.contractNoList = []
-      }
-      if (this.create.createTemp.feedid !== '' && this.create.createTemp.providerid !== '') {
-        this.getContractNoList()
-      }
-    },
-    // 合同编号
-    changeContractNo(item) {
-      if (item !== '') {
-        this.create.createTemp.pricenew = this.contractNoList.find(obj => obj.contractcode == item).price
-      } else {
-        this.create.createTemp.pricenew = ''
-      }
-      if (this.create.createTemp.operateweight !== '' && this.create.createTemp.pricenew !== '') {
-        this.create.createTemp.sumprice = parseFloat(this.create.createTemp.operateweight) * parseFloat(this.create.createTemp.pricenew)
-        this.create.createTemp.sumprice = formatNum(this.create.createTemp.sumprice, 2)
-      }
-    },
-    getContractNoList() {
-      this.create.getdataListParm.parammaps.feedid = this.create.createTemp.feedid
-      this.create.getdataListParm.parammaps.providerid = this.create.createTemp.providerid
-      GetDataByName(this.create.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.contractNoList = response.data.list
-          this.create.createTemp.contractcode = ''
-          this.create.createTemp.pricenew = ''
-          this.create.createTemp.sumprice = ''
-        } else {
-          this.contractNoList = []
-          this.create.createTemp.contractcode = ''
-          this.create.createTemp.pricenew = ''
-          this.create.createTemp.sumprice = ''
-        }
-      })
-    },
-    feedNameSearch(queryString, cb) {
-      this.create.getfeedNameParm.parammaps['fname'] = queryString
-      GetDataByName(this.create.getfeedNameParm).then(response => {
-        console.log('模糊查询搜索data', response.data.list)
-        if (response.data.list == null) {
-          cb([])
-        } else {
-          cb(response.data.list)
-        }
-      })
-    },
-    handleSelectFeedName(item) {
-      console.log('模糊查询选中值', item)
-      this.create.createTemp.feedname = item.fname
-      this.create.createTemp.feedid = item.id
-      this.create.createTemp.startweight = item.stockweight
-      this.create.createTemp.priceold = item.price
-      this.create.createTemp.providerid = ''
-      this.create.createTemp.providername = ''
-      this.create.createTemp.contractcode = ''
-      this.create.createTemp.pricenew = ''
-      this.create.createTemp.sumprice = ''
-      if (this.create.createTemp.feedid !== '' && this.create.createTemp.providerid !== '') {
-        this.getContractNoList()
-      }
-    },
-    blurFeedName() {
-      this.create.createTemp.feedname = ''
-      this.create.createTemp.feedid = ''
-      this.create.createTemp.startweight = ''
-      this.create.createTemp.priceold = ''
-      this.create.createTemp.providerid = ''
-      this.create.createTemp.providername = ''
-      this.create.createTemp.contractcode = ''
-      this.create.createTemp.pricenew = ''
-      this.create.createTemp.sumprice = ''
-    },
-    // 入库重量
-    blurOperateweight() {
-      // 毛重grossweight皮重tareweight入库重量operateweight
-      if (this.create.createTemp.grossweight !== '' && this.create.createTemp.operateweight !== '') {
-        this.create.createTemp.tareweight = formatNum(parseFloat(this.create.createTemp.grossweight) - parseFloat(this.create.createTemp.operateweight), 2)
-      }
-      if (this.create.createTemp.grossweight !== '' && this.create.createTemp.operateweight !== '') {
-        if (parseFloat(this.create.createTemp.operateweight) > parseFloat(this.create.createTemp.grossweight)) {
-          this.create.createTemp.grossweight = formatNum(this.create.createTemp.operateweight, 2)
-          this.create.createTemp.tareweight = formatNum(parseFloat(this.create.createTemp.operateweight) - parseFloat(this.create.createTemp.operateweight), 2)
-        }
-      }
-      if (this.create.createTemp.tareweight !== '' && this.create.createTemp.grossweight !== '') {
-        if (this.create.createTemp.operateweight == '') {
-          this.create.createTemp.operateweight = formatNum(parseFloat(this.create.createTemp.grossweight) - parseFloat(this.create.createTemp.tareweight), 2)
-        }
-        if (parseFloat(this.create.createTemp.tareweight) > parseFloat(this.create.createTemp.grossweight)) {
-          this.create.createTemp.tareweight = formatNum(this.create.createTemp.grossweight, 2)
-          this.create.createTemp.operateweight = formatNum(parseFloat(this.create.createTemp.grossweight) - parseFloat(this.create.createTemp.tareweight), 2)
-        }
-      }
-      if (this.create.createTemp.operateweight !== '' && this.create.createTemp.pricenew !== '') {
-        this.create.createTemp.sumprice = parseFloat(this.create.createTemp.operateweight) * parseFloat(this.create.createTemp.pricenew)
-        this.create.createTemp.sumprice = formatNum(this.create.createTemp.sumprice, 2)
-      } else {
-        this.create.createTemp.sumprice = ''
-      }
-    },
-    // 毛重
-    blurGrossweight() {
-      // 毛重grossweight皮重tareweight入库重量operateweight
-      if (this.create.createTemp.grossweight !== '' && this.create.createTemp.operateweight !== '') {
-        this.create.createTemp.tareweight = formatNum(parseFloat(this.create.createTemp.grossweight) - parseFloat(this.create.createTemp.operateweight), 2)
-      }
-
-      if (this.create.createTemp.grossweight !== '' && this.create.createTemp.operateweight !== '') {
-        if (parseFloat(this.create.createTemp.operateweight) > parseFloat(this.create.createTemp.grossweight)) {
-          this.create.createTemp.grossweight = formatNum(this.create.createTemp.operateweight, 2)
-          this.create.createTemp.tareweight = formatNum(parseFloat(this.create.createTemp.operateweight) - parseFloat(this.create.createTemp.operateweight), 2)
-        }
-      }
-      if (this.create.createTemp.pricenew !== '' && this.create.createTemp.operateweight !== '') {
-        this.create.createTemp.sumprice = parseFloat(this.create.createTemp.operateweight) * parseFloat(this.create.createTemp.pricenew)
-        this.create.createTemp.sumprice = formatNum(this.create.createTemp.sumprice, 2)
-      } else {
-        this.create.createTemp.sumprice = ''
-      }
-    },
-    // 皮重
-    blurTareweight() {
-      // 毛重grossweight皮重tareweight入库重量operateweight
-      if (this.create.createTemp.operateweight !== '' && this.create.createTemp.tareweight !== '') {
-        this.create.createTemp.grossweight = formatNum(parseFloat(this.create.createTemp.tareweight) + parseFloat(this.create.createTemp.operateweight), 2)
-      }
-      if (this.create.createTemp.grossweight !== '' && this.create.createTemp.operateweight !== '') {
-        if (parseFloat(this.create.createTemp.operateweight) > parseFloat(this.create.createTemp.grossweight)) {
-          this.create.createTemp.grossweight = formatNum(this.create.createTemp.operateweight, 2)
-          this.create.createTemp.tareweight = formatNum(parseFloat(this.create.createTemp.operateweight) - parseFloat(this.create.createTemp.operateweight), 2)
-        }
-      }
-      if (this.create.createTemp.tareweight !== '' && this.create.createTemp.grossweight !== '') {
-        if (parseFloat(this.create.createTemp.tareweight) > parseFloat(this.create.createTemp.grossweight)) {
-          this.create.createTemp.tareweight = formatNum(this.create.createTemp.grossweight, 2)
-          this.create.createTemp.operateweight = formatNum(parseFloat(this.create.createTemp.grossweight) - parseFloat(this.create.createTemp.tareweight), 2)
-        } else {
-          this.create.createTemp.operateweight = formatNum(parseFloat(this.create.createTemp.grossweight) - parseFloat(this.create.createTemp.tareweight), 2)
-        }
-      }
-      if (this.create.createTemp.pricenew !== '' && this.create.createTemp.operateweight !== '') {
-        this.create.createTemp.sumprice = parseFloat(this.create.createTemp.operateweight) * parseFloat(this.create.createTemp.pricenew)
-        this.create.createTemp.sumprice = formatNum(this.create.createTemp.sumprice, 2)
-      } else {
-        this.create.createTemp.sumprice = ''
-      }
-    },
-    // 单价
-    blurPricenew() {
-      if (this.create.createTemp.operateweight !== '' && this.create.createTemp.pricenew !== '') {
-        this.create.createTemp.sumprice = parseFloat(this.create.createTemp.operateweight) * parseFloat(this.create.createTemp.pricenew)
-        this.create.createTemp.sumprice = formatNum(this.create.createTemp.sumprice, 2)
-      } else {
-        this.create.createTemp.sumprice = ''
-      }
-    },
-    // 总价
-    blurSumprice() {
-      if (this.create.createTemp.sumprice !== '' && this.create.createTemp.pricenew !== '') {
-        this.create.createTemp.operateweight = formatNum(parseFloat(this.create.createTemp.sumprice) / parseFloat(this.create.createTemp.pricenew), 2)
-      } else {
-        this.create.createTemp.operateweight = ''
-      }
-    },
-    handleCreate() {
-      console.log('点击了新增入库单')
-      this.dialogFull = false
-      this.create.dialogStatus = 'create'
-      this.create.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.resetCreateTemp()
-        this.$refs.createTemp.resetFields()
-      })
-    },
-    createData() {
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          if (this.create.createTemp.operateweight == '' && this.create.createTemp.grossweight == '') {
-            this.$message({ type: 'error', message: '请输入入库重量或毛重', duration: 2000 })
-            return false
-          }
-          if (this.create.createTemp.sumprice.length > 15) {
-            this.$message({ type: 'error', message: '数值过大请重新输入', duration: 2000 })
-          }
-          const keepTwoNum = /^\d+(\.\d{1,2})?$/
-          // 入库重量
-          if (this.create.createTemp.operateweight !== '') {
-            if (this.create.createTemp.operateweight == 0) {
-              this.$message({ type: 'error', message: '入库重量请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.operateweight))) {
-                this.$message({ type: 'error', message: '入库重量请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          // 单价
-          if (this.create.createTemp.pricenew == 0) {
-            this.$message({ type: 'error', message: '单价请输入自然数并保留两位小数', duration: 2000 })
-            return false
-          } else {
-            if (!keepTwoNum.test(parseFloat(this.create.createTemp.pricenew))) {
-              this.$message({ type: 'error', message: '单价请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            }
-          }
-          // 总价
-          if (this.create.createTemp.pricenew !== '' && this.create.createTemp.operateweight !== '') {
-            if (this.create.createTemp.sumprice == 0) {
-              this.$message({ type: 'error', message: '总价请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.sumprice))) {
-                this.$message({ type: 'error', message: '总价请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          // 毛重
-          if (this.create.createTemp.grossweight !== '') {
-            if (this.create.createTemp.grossweight == 0) {
-              this.$message({ type: 'error', message: '毛重请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.grossweight))) {
-                this.$message({ type: 'error', message: '毛重请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          // 皮重
-          if (this.create.createTemp.tareweight !== '') {
-            if (this.create.createTemp.tareweight == 0) {
-              this.$message({ type: 'error', message: '皮重请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.tareweight))) {
-                this.$message({ type: 'error', message: '皮重请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-
-          MessageBox.confirm('是否确认保存当前内容', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-          }).then(() => {
-            this.isokDisable = true
-            setTimeout(() => {
-              this.isokDisable = false
-            }, 1000)
-            this.requestParam.common = { 'returnmap': '0' }
-            this.requestParam.data = []
-            this.requestParam.data[0] = { 'name': 'insertFeedlaid', 'type': 'e', 'parammaps': {
-              'pastureid': this.create.createTemp.pastureid,
-              'laiddate': this.create.createTemp.laiddate,
-              'feedid': this.create.createTemp.feedid,
-              'feedname': this.create.createTemp.feedname,
-              'providerid': this.create.createTemp.providerid,
-              'providername': this.create.createTemp.providername,
-              'contractcode': this.create.createTemp.contractcode,
-              'operateweight': this.create.createTemp.operateweight,
-              'grossweight': this.create.createTemp.grossweight,
-              'tareweight': this.create.createTemp.tareweight,
-              'sumprice': this.create.createTemp.sumprice,
-              'licence': this.create.createTemp.licence,
-              'pcpde': this.create.createTemp.pcpde,
-              'remark': this.create.createTemp.remark,
-              'createdate': this.create.createTemp.createdate,
-              'createemp': this.create.createTemp.createemp,
-              'startweight': this.create.createTemp.startweight,
-              'priceold': this.create.createTemp.priceold,
-              'pricenew': this.create.createTemp.pricenew,
-              'wagonnumber': this.create.createTemp.wagonnumber
-            }}
-            if (this.create.createTemp.operateweight !== '' && parseFloat(this.create.createTemp.operateweight) > 0) {
-              this.requestParam.data[1] = { 'name': 'insertFeedstorageLaid', 'type': 'e', 'parammaps': {
-                'operateweight': this.create.createTemp.operateweight,
-                'pastureid': this.create.createTemp.pastureid,
-                'feedid': this.create.createTemp.feedid,
-                'fname': this.create.createTemp.fname,
-                'pcpde': this.create.createTemp.pcpde,
-                'stockweight': this.create.createTemp.startweight,
-                'price': this.create.createTemp.pricenew
-              }}
-            }
-            console.log('点击了新增入库单保存', this.requestParam)
-            ExecDataByConfig(this.requestParam).then(response => {
-              if (response.msg === 'fail') {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-              } else {
-                this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-                this.create.dialogFormVisible = false
-                this.getList()
-              }
-            })
-          })
-        }
-      })
-    },
-    handleUpdate(row) {
-      console.log('点击了编辑')
-      this.$nextTick(() => {
-        this.$refs.createTemp.resetFields()
-      })
-      this.dialogFull = false
-      this.create.dialogStatus = 'update'
-      this.create.dialogFormVisible = true
-      row.feedid = String(row.feedid)
-      if (row.providerid == -1) {
-        row.providerid = ''
-        row.providername = ''
-      }
-      this.create.createTemp = Object.assign({}, row)
-    },
-    updateData() {
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          if (this.create.createTemp.operateweight == '' && this.create.createTemp.grossweight == '') {
-            this.$message({ type: 'error', message: '请输入入库重量或毛重', duration: 2000 })
-            return false
-          }
-          if (this.create.createTemp.sumprice.length > 15) {
-            this.$message({ type: 'error', message: '数值过大请重新输入', duration: 2000 })
-          }
-          const keepTwoNum = /^\d+(\.\d{1,2})?$/
-          // 入库重量
-          if (this.create.createTemp.operateweight !== '') {
-            if (this.create.createTemp.operateweight == 0) {
-              this.$message({ type: 'error', message: '入库重量请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.operateweight))) {
-                this.$message({ type: 'error', message: '入库重量请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          // 单价
-          if (this.create.createTemp.pricenew == 0) {
-            this.$message({ type: 'error', message: '单价请输入自然数并保留两位小数', duration: 2000 })
-            return false
-          } else {
-            if (!keepTwoNum.test(parseFloat(this.create.createTemp.pricenew))) {
-              this.$message({ type: 'error', message: '单价请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            }
-          }
-          // 总价
-          if (this.create.createTemp.pricenew !== '' && this.create.createTemp.operateweight !== '') {
-            if (this.create.createTemp.sumprice == 0) {
-              this.$message({ type: 'error', message: '总价请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.sumprice))) {
-                this.$message({ type: 'error', message: '总价请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          // 毛重
-          if (this.create.createTemp.grossweight !== '') {
-            if (this.create.createTemp.grossweight == 0) {
-              this.$message({ type: 'error', message: '毛重请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.grossweight))) {
-                this.$message({ type: 'error', message: '毛重请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          // 皮重
-          if (this.create.createTemp.tareweight !== '') {
-            if (this.create.createTemp.tareweight == 0) {
-              this.$message({ type: 'error', message: '皮重请输入自然数并保留两位小数', duration: 2000 })
-              return false
-            } else {
-              if (!keepTwoNum.test(parseFloat(this.create.createTemp.tareweight))) {
-                this.$message({ type: 'error', message: '皮重请输入自然数并保留两位小数', duration: 2000 })
-                return false
-              }
-            }
-          }
-          MessageBox.confirm('是否确认保存当前内容', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-          }).then(() => {
-            this.isokDisable = true
-            setTimeout(() => {
-              this.isokDisable = false
-            }, 1000)
-            this.requestParam.common = { 'returnmap': '0' }
-            this.requestParam.data = []
-            this.requestParam.data[0] = { 'name': 'updateFeedlaid', 'type': 'e', 'parammaps': {
-              'pastureid': this.create.createTemp.pastureid,
-              'id': this.create.createTemp.id,
-              'laiddate': this.create.createTemp.laiddate,
-              'feedid': this.create.createTemp.feedid,
-              'feedname': this.create.createTemp.feedname,
-              'providerid': this.create.createTemp.providerid,
-              'providername': this.create.createTemp.providername,
-              'contractcode': this.create.createTemp.contractcode,
-              'operateweight': this.create.createTemp.operateweight,
-              'grossweight': this.create.createTemp.grossweight,
-              'tareweight': this.create.createTemp.tareweight,
-              'sumprice': this.create.createTemp.sumprice,
-              'licence': this.create.createTemp.licence,
-              'pcpde': this.create.createTemp.pcpde,
-              'remark': this.create.createTemp.remark,
-              'createdate': this.create.createTemp.createdate,
-              'createemp': this.create.createTemp.createemp,
-              'startweight': this.create.createTemp.startweight,
-              'priceold': this.create.createTemp.priceold,
-              'pricenew': this.create.createTemp.pricenew,
-              'wagonnumber': this.create.createTemp.wagonnumber
-            }}
-            if (this.create.createTemp.operateweight !== '' && parseFloat(this.create.createTemp.operateweight) > 0) {
-              this.requestParam.data[1] = { 'name': 'insertFeedstorageLaid', 'type': 'e', 'parammaps': {
-                'operateweight': this.create.createTemp.operateweight,
-                'pastureid': this.create.createTemp.pastureid,
-                'feedid': this.create.createTemp.feedid,
-                'fname': this.create.createTemp.fname,
-                'pcpde': this.create.createTemp.pcpde,
-                'stockweight': this.create.createTemp.startweight,
-                'price': this.create.createTemp.pricenew
-              }}
-            }
-            console.log('点击了新增入库单保存', this.requestParam)
-            ExecDataByConfig(this.requestParam).then(response => {
-              if (response.msg === 'fail') {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-              } else {
-                this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-                this.create.dialogFormVisible = false
-                this.getList()
-              }
-            })
-          })
-        }
-      })
-    },
-    handleRevoke(row){
-      console.log('点击了撤销')
-    },
-    handleSee(row) {
-      console.log('点击了查看')
-      this.$nextTick(() => {
-        this.$refs.createTemp.resetFields()
-      })
-      this.dialogFull = false
-      this.create.dialogStatus = 'see'
-      this.create.dialogFormVisible = true
-      if (row.providerid == -1) {
-        row.providerid = ''
-        row.providername = ''
-      }
-      this.create.createTemp = Object.assign({}, row)
-    },
-
-    handleInitial() {
-      console.log('点击了初始化库存')
-      this.dialogFull = false
-      this.initial.dialogStatus = 'initial'
-      this.initial.dialogFormVisible = true
-      this.getInitialList()
-    },
-    getInitialList() {
-      this.initial.listLoading = true
-      GetDataByName(this.initial.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.initial.list = response.data.list
-          this.initial.pageNum = response.data.pageNum
-          this.initial.pageSize = response.data.pageSize
-          this.initial.total = response.data.total
-        } else {
-          this.initial.list = []
-        }
-        setTimeout(() => {
-          this.initial.listLoading = false
-        }, 100)
-      })
-    },
-    handleInitialExport() {
-      console.log('点击了初始化库存导出')
-
-      const ExcelDatas = [
-        {
-          tHeader: ['饲料名称', '库存重量'],
-          filterVal: ['fname', 'stockweight'],
-          tableDatas: this.initial.list,
-          sheetName: '初始化库存'
-        }
-      ]
-      json2excel(ExcelDatas, '初始化库存', true, 'xlsx')
-    },
-    async handleInitialImport(eve) {
-      const file = eve.raw
-      if (!file) return
-      let reader = await upload(file)
-      const worker = xlsx.read(reader, { type: 'binary' })
-      // 将返回的数据转换为json对象的数据
-      reader = xlsx.utils.sheet_to_json(worker.Sheets[worker.SheetNames[0]])
-      console.log(reader)
-      const arr = []
-      reader.forEach(item => {
-        const obj = {}
-        for (const key in this.initial.character) {
-          if (!this.initial.character.hasOwnProperty(key)) break
-          let v = this.initial.character[key]
-          const text = v.text
-          const type = v.type
-          v = item[text] || ''
-          type === 'string' ? (v = String(v)) : null
-          type === 'number' ? (v = Number(v)) : null
-          obj[key] = v
-        }
-        arr.push(obj)
-      })
-      console.log('导入处理后数据', arr)
-      var sum = 0
-      for (let i = 0; i < this.initial.list.length; i++) {
-        for (let j = 0; j < arr.length; j++) {
-          if (this.initial.list[i].fname == arr[j].fname) {
-            this.initial.list[i].stockweight = arr[j].stockweight
-            sum++
-            arr.splice(j, 1)
-          }
-        }
-      }
-      console.log(arr)
-      for (let i = 0; i < arr.length; i++) {
-        this.$set(arr[i], 'msg', '饲料名称与系统不匹配')
-      }
-      console.log(sum)
-      this.$message({ title: '成功', message: '导入成功:' + sum + '条!', type: 'success', duration: 2000 })
-      this.$notify({ title: '失败', message: '导入失败:' + arr.length + '条!', type: 'danger', duration: 2000 })
-      if (arr.length > 0) {
-        const ExcelDatas1 = [
-          {
-            tHeader: ['饲料名称', '库存重量', '报错信息'],
-            filterVal: ['fname', 'stockweight', 'msg'],
-            tableDatas: arr,
-            sheetName: 'ExcelDatas1'
-          }
-        ]
-        json2excel(ExcelDatas1, '初始化库存报错信息', true, 'xlsx')
-      }
-    },
-    initialData() {
-      console.log('点击了初始化库存保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      var rulesStockweight = /^\d+(\.\d{1,2})?$/
-      for (let i = 0; i < this.initial.list.length; i++) {
-        if (!rulesStockweight.test(parseFloat(this.initial.list[i].stockweight))) {
-          this.$message({ type: 'warning', message: '库存重量不可小于0,且保留俩位小数', duration: 2000 })
-          return false
-        }
-      }
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'clearFS', 'type': 'e', 'parammaps': {
-        'pastureid': Cookies.get('pastureid')
-      }}
-      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.initial.list }}
-      this.requestParam.data[1].children = []
-      this.requestParam.data[1].children[0] = { 'name': 'insertFeedstorage', 'type': 'e', 'parammaps': {
-        pastureid: '@insertSpotList.pastureid',
-        feedid: '@insertSpotList.feedid',
-        fname: '@insertSpotList.fname',
-        pcpde: '@insertSpotList.pcpde',
-        stockweight: '@insertSpotList.stockweight',
-        price: '@insertSpotList.price'
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-          this.create.dialogFormVisible = false
-          this.getList()
-        }
-      })
-    },
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/库存管理/入库导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '入库管理导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
-          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-        } else {
-          this.download.getdataListParm.parammaps.inputDatetime = ''
-          this.download.getdataListParm.parammaps.startTime = ''
-          this.download.getdataListParm.parammaps.stopTime = ''
-        }
-        GetDataByName(this.download.getdataListParm).then(response => {
-          if (response.data.list !== null) {
-            this.download.list = response.data.list
-          } else {
-            this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['入库日期', '送货单编号', '饲料名称', '供应商', '合同编号', '入库重量(kg)', '单价(元)', '总价', '毛重(kg)', '皮重(kg)', '许可证号', '批号', '创建人', '创建日期', '备注'],
-              filterVal: ['laiddate', 'wagonnumber', 'feedname', 'providername', 'contractcode', 'operateweight', 'pricenew', 'sumprice', 'grossweight', 'tareweight', 'licence', 'pcpde', 'createemp', 'createdate', 'remark'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '入库管理', true, 'xlsx')
-        })
-      }
-    },
-
-    beforeImport(file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 2MB!')
-      }
-      return isLt2M
-    },
-    handleImportSuccess(res, file) {
-      this.getList()
-      if (res.msg === 'ok') {
-        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
-        if (res.data.err_count > 0) {
-          this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '入库日期', '送货单编号', '饲料名称', '供应商', '合同编号', '入库重量(kg)', '单价(元)', '总价(元)', '毛重(kg)', '皮重(kg)', '许可证号', '批号', '创建人', '创建日期', '备注', '错误信息'
-             ]
-             const filterVal = [
-               '入库日期', '送货单编号', '饲料名称', '供应商', '合同编号', '入库重量(kg)', '单价(元)', '总价(元)', '毛重(kg)', '皮重(kg)', '许可证号', '批号', '创建人', '创建日期', '备注', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '入库管理导入报错信息', autoWidth: true, bookType: 'xlsx' })
-           })
-        }
-      } else {
-        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    }
-  }
-}
-</script>

+ 1 - 1
src/views/inventoryManagement/warning/index.vue

@@ -370,10 +370,10 @@ export default {
           this.table.list = response.data.list
           // this.table.pageNum = response.data.pageNum
           // this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 6 - 34
src/views/shedProduction/dungScores/index.vue

@@ -13,7 +13,9 @@
     <div class="operation">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="handleDelete">删除</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
       <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -764,36 +766,6 @@ export default {
         })
       }
     },
-    // 复制
-    // handleCopy() {
-    //   console.log('点击了复制')
-    //   if (this.selectList.length == 0) {
-    //     this.$message({ type: 'error', message: '请选择粪便评分', duration: 2000 })
-    //   } else if (this.selectList.length == 1) {
-    //     MessageBox.confirm('是否确认复制此信息?', {
-    //       confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-    //     }).then(() => {
-    //       this.requestParam.name = 'copyDungscore'
-    //       this.requestParam.parammaps = {}
-    //       this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
-    //       this.requestParam.parammaps.id = this.selectList[0].id
-    //       PostDataByName(this.requestParam).then(response => {
-    //         if (response.msg === 'fail') {
-    //           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-    //         } else {
-    //           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-    //           this.getList()
-    //         }
-    //       })
-    //     }).catch(() => {
-    //       this.$message({ type: 'info', message: '已取消复制' })
-    //     })
-    //   } else {
-    //     this.$message({ type: 'error', message: '请选择一条粪便评分', duration: 2000 })
-    //   }
-    // },
-
-
     // 改成多条,后端接口未改正确,先注释
      handleCopy() {
       console.log('点击了复制')
@@ -803,7 +775,7 @@ export default {
         MessageBox.confirm('是否确认复制此信息?', {
           confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
         }).then(() => {
-     
+
           var send_data = {
             "common":{"returnmap":"0"},
             "data":[
@@ -825,7 +797,7 @@ export default {
             ]
           }
           ExecDataByConfig(send_data).then(response => {
-            if (response.msg === 'fail') {     
+            if (response.msg === 'fail') {
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
@@ -835,7 +807,7 @@ export default {
         }).catch(() => {
           this.$message({ type: 'info', message: '已取消复制' })
         })
-      } 
+      }
     },
 
 

+ 3 - 31
src/views/shedProduction/fecalScreen/index.vue

@@ -14,7 +14,9 @@
     <div class="operation">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="handleDelete">删除</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
       <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -723,36 +725,6 @@ export default {
         })
       }
     },
-    // 复制
-    // handleCopy() {
-    //   console.log('点击了复制')
-    //   if (this.selectList.length == 0) {
-    //     this.$message({ type: 'error', message: '请选择粪便筛', duration: 2000 })
-    //   } else if (this.selectList.length == 1) {
-    //     MessageBox.confirm('是否确认复制此信息?', {
-    //       confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-    //     }).then(() => {
-    //       this.requestParam.name = 'copyDungsieve'
-    //       this.requestParam.parammaps = {}
-    //       this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
-    //       this.requestParam.parammaps.id = this.selectList[0].id
-    //       PostDataByName(this.requestParam).then(response => {
-    //         if (response.msg === 'fail') {
-    //           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-    //         } else {
-    //           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-    //           this.getList()
-    //         }
-    //       })
-    //     }).catch(() => {
-    //       this.$message({ type: 'info', message: '已取消复制' })
-    //     })
-    //   } else {
-    //     this.$message({ type: 'error', message: '请选择一条粪便筛', duration: 2000 })
-    //   }
-    // },
-
-
      // 改成多条,后端接口未改正确,先注释
      handleCopy() {
       console.log('点击了复制')

+ 3 - 36
src/views/shedProduction/formulaDryMatter/index.vue

@@ -16,7 +16,9 @@
     <div class="operation">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="handleDelete">删除</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
       <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -722,41 +724,6 @@ export default {
         })
       }
     },
-    // 复制
-    // handleCopy() {
-    //   console.log('点击了复制')
-    //   if (this.selectList.length == 0) {
-    //     this.$message({ type: 'error', message: '请选择配方干物质', duration: 2000 })
-    //   } else if (this.selectList.length == 1) {
-    //     MessageBox.confirm('是否确认复制此信息?', {
-    //       confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-    //     }).then(() => {
-    //       this.requestParam.name = 'copyFtdry'
-    //       this.requestParam.parammaps = {}
-    //       this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
-    //       this.requestParam.parammaps.id = this.selectList[0].id
-    //       PostDataByName(this.requestParam).then(response => {
-    //         if (response.msg === 'fail') {
-    //           const barid = new RegExp("key 'barid'")
-    //           if (barid.test(response.data)) {
-    //             this.$notify({ type: 'warning', message: '该栏舍该班次今日配方干物质已存在,不可重复生成', duration: 2000 })
-    //             return
-    //           }
-    //           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-    //         } else {
-    //           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-    //           this.getList()
-    //         }
-    //       })
-    //     }).catch(() => {
-    //       this.$message({ type: 'info', message: '已取消复制' })
-    //     })
-    //   } else {
-    //     this.$message({ type: 'error', message: '请选择一条配方干物质', duration: 2000 })
-    //   }
-    // },
-
-
     // 改成多条,后端接口未改正确,先注释
      handleCopy() {
       console.log('点击了复制')

+ 110 - 58
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -6,11 +6,17 @@
       <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
       <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
         <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+      <el-select v-model="record" filterable placeholder="记录" class="filter-item" style="width: 150px;" @change="changeRecord">
+        <el-option v-for="item in recordList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-select v-if="record== '1'" v-model="table.getdataListParm.parammaps.eqcode" filterable placeholder="TMR编号" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.tname" :value="item.eqcode" />
       </el-select>
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
     </div>
-    <div class="operation">
+    <div class="operation" v-if="record== '0'">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="handleDelete">删除</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button>
@@ -19,13 +25,17 @@
       </el-upload>
       <el-dropdown style="float: right;margin-right: 10px;">
         <el-button class="export" icon="el-icon-upload2">导出</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item  @click.native="handleExport(1)">导出模板</el-dropdown-item>
           <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
-    </div>
-    <div class="table">
+    </div>
+    <div class="operation" v-else>
+        <el-button style="float: right;margin-right: 10px;" class="export" icon="el-icon-upload2" @click="handleExport(3)">导出</el-button>
+    </div>
+    <!-- 手动记录 -->
+    <div class="table" v-if="record== '0'">
       <el-table
         :key="table.tableKey"
         v-loading="table.listLoading"
@@ -46,32 +56,12 @@
           <template slot-scope="scope">
             <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
           </template>
-        </el-table-column>
-        <el-table-column label="栏舍名称" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.barname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="剩料量(kg)" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.remain }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="班次" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.timesstr }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="收集时间" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.operatetime }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作人" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.emp }}</span>
-          </template>
-        </el-table-column>
+        </el-table-column>
+        <el-table-column label="栏舍名称" min-width="150px" align="center" prop="barname" />
+        <el-table-column label="剩料量(kg)" min-width="150px" align="center" prop="remain" />
+        <el-table-column label="班次" min-width="90px" align="center" prop="timesstr" />
+        <el-table-column label="收集时间" min-width="100px" align="center" prop="operatetime" />
+        <el-table-column label="操作人" min-width="90px" align="center" prop="emp" />
         <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <el-button v-if="isRoleEdit" :disabled="row.emp == '设备采集'" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
@@ -81,6 +71,35 @@
         </el-table-column>
       </el-table>
       <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+    <!-- TMR设备自动记录 -->
+    <div class="table" v-else>
+      <el-table
+        :key="table.tableKey2"
+        v-loading="table.listLoading2"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 98%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column label="TMR设备编号" min-width="150px" align="center" prop="eqcode" />
+        <el-table-column label="TMR设备名称" min-width="150px" align="center" prop="eqname" />
+        <el-table-column label="TMR设备类型" min-width="150px" align="center" prop="tclassname" />
+        <el-table-column label="栏舍名称" min-width="150px" align="center" prop="barname" />
+        <el-table-column label="收集时间" min-width="150px" align="center" prop="createtime" />
+        <el-table-column label="剩料重量(kg)" min-width="150px" align="center" prop="weight" />
+        <el-table-column label="开始重量(kg)" min-width="150px" align="center" prop="beginweight" />
+        <el-table-column label="结束重量(kg)" min-width="150px" align="center" prop="endweight" />
+        <el-table-column label="驾驶员" min-width="150px" align="center" prop="driver" />
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
     </div>
 
     <!-- 新增/编辑 -->
@@ -175,11 +194,14 @@ export default {
       isRoleEdit: [],
       requestParams: [
         { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
-        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }},
+        { name: 'getTMRListEnableType', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'eqtype': '1' }},
+
       ],
       houseNameList: [], // 栏舍名称
-      frequencyList: [], // 班次
-
+      frequencyList: [], // 班次
+      recordList:[{id:'0',name:'手动记录'},{id:'1',name:'TMR设备自动记录'}],
+      record:'0',
       table: {
         getdataListParm: {
           name: 'getBarfeedremainList',
@@ -199,7 +221,10 @@ export default {
         list: [],
         total: 0,
         listLoading: true,
-        temp: {}
+        temp: {},
+        tableKey2:0,
+        listLoading2: false,
+        list2:[]
       },
 
       // 新增/编辑
@@ -295,7 +320,8 @@ export default {
     },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
-        this.houseNameList = response.data.getBarListEnable.list
+        this.houseNameList = response.data.getBarListEnable.list
+        this.TMRNumberList = response.data.getTMRListEnableType.list
         if (response.data.getSysoptEnable.list !== null) {
           for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
             const obj = {}
@@ -328,7 +354,15 @@ export default {
     },
 
     getList() {
-      this.table.listLoading = true
+      this.table.listLoading = true
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
       GetDataByName(this.table.getdataListParm).then(response => {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
@@ -343,17 +377,18 @@ export default {
           this.table.listLoading = false
         }, 100)
       })
+    },
+    changeRecord(item){
+      if(item == '0'){
+        this.table.getdataListParm.name = 'getBarfeedremainList'
+      }else{
+        this.table.getdataListParm.name = 'getRemainplanrecord'
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
     },
     handleSearch() {
       console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
       this.table.getdataListParm.offset = 1
       this.getList()
     },
@@ -625,10 +660,10 @@ export default {
         console.log('点击了导出模板')
         console.log('点击了导出模板')
         const requestParam = this.requestParam
-        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/栏舍生产/栏舍剩料记录导入模板.xlsx' // 请求下载文件的地址
+        const url = process.env.VUE_APP_BASE_API + 'authdata/barfeedremain/excel' // 请求下载文件的地址
         console.log(url)
         axios({
-          method: 'GET',
+          method: 'POST',
           url: url,
           data: requestParam,
           headers: { token: getToken(), optname: 'insertcustomdoc' },
@@ -654,7 +689,12 @@ export default {
           window.URL.revokeObjectURL(url)
         })
       } else {
-        console.log('点击了导出数据')
+        console.log('点击了导出数据',item,this.record)
+        if(this.record == '0'){
+          this.download.getdataListParm.name = 'getBarfeedremainList'
+        }else{
+          this.download.getdataListParm.name = 'getRemainplanrecord'
+        }
         this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
         if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
           this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -669,16 +709,28 @@ export default {
             this.download.list = response.data.list
           } else {
             this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['栏舍名称', '剩料量(kg)', '班次', '收集时间', '操作人'],
-              filterVal: ['barname', 'remain', 'timesstr', 'operatetime', 'emp'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '栏舍剩料记录', true, 'xlsx')
+          }
+           if(item== 2){
+              var excelDatas1 = [
+                {
+                  tHeader: ['栏舍名称', '剩料量(kg)', '班次', '收集时间', '操作人'],
+                  filterVal: ['barname', 'remain', 'timesstr', 'operatetime', 'emp'],
+                  tableDatas: this.download.list,
+                  sheetName: 'Sheet1'
+                }
+              ]
+              json2excel(excelDatas1, '栏舍剩料记录-手动记录', true, 'xlsx')
+           }else{
+             var excelDatas2 = [
+               {
+                 tHeader: ['TMR设备编号','TMR设备名称','TMR设备类型','栏舍名称','收集时间','剩料重量(kg)','开始重量(kg)','结束重量(kg)','驾驶员'],
+                 filterVal: ['eqcode','eqname','tclassname','barname','createtime','weight','beginweight','endweight','driver'],
+                 tableDatas: this.download.list,
+                 sheetName: 'Sheet1'
+               }
+             ]
+             json2excel(excelDatas2, '栏舍剩料记录-TMR设备自动记录', true, 'xlsx')
+           }
         })
       }
     },

+ 3 - 30
src/views/shedProduction/pennsylvaniaSieve/index.vue

@@ -16,7 +16,9 @@
     <div class="operation">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="handleDelete">删除</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
       <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -768,35 +770,6 @@ export default {
         })
       }
     },
-    // 复制
-    // handleCopy() {
-    //   console.log('点击了复制')
-    //   if (this.selectList.length == 0) {
-    //     this.$message({ type: 'error', message: '请选择宾州筛', duration: 2000 })
-    //   } else if (this.selectList.length == 1) {
-    //     MessageBox.confirm('是否确认复制此信息?', {
-    //       confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-    //     }).then(() => {
-    //       this.requestParam.name = 'copyPennsieve'
-    //       this.requestParam.parammaps = {}
-    //       this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
-    //       this.requestParam.parammaps.id = this.selectList[0].id
-    //       PostDataByName(this.requestParam).then(response => {
-    //         if (response.msg === 'fail') {
-    //           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-    //         } else {
-    //           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-    //           this.getList()
-    //         }
-    //       })
-    //     }).catch(() => {
-    //       this.$message({ type: 'info', message: '已取消复制' })
-    //     })
-    //   } else {
-    //     this.$message({ type: 'error', message: '请选择一条宾州筛', duration: 2000 })
-    //   }
-    // },
-
     // 改成多条,后端接口未改正确,先注释
      handleCopy() {
       console.log('点击了复制')

+ 3 - 31
src/views/shedProduction/physicalConditionScore/index.vue

@@ -13,7 +13,9 @@
     <div class="operation">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="handleDelete">删除</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
       <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -792,36 +794,6 @@ export default {
         })
       }
     },
-    // 复制
-    // handleCopy() {
-    //   console.log('点击了复制')
-    //   if (this.selectList.length == 0) {
-    //     this.$message({ type: 'error', message: '请选择体况评分', duration: 2000 })
-    //   } else if (this.selectList.length == 1) {
-    //     MessageBox.confirm('是否确认复制此信息?', {
-    //       confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-    //     }).then(() => {
-    //       this.requestParam.name = 'copyBodyscore'
-    //       this.requestParam.parammaps = {}
-    //       this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
-    //       this.requestParam.parammaps.id = this.selectList[0].id
-    //       PostDataByName(this.requestParam).then(response => {
-    //         if (response.msg === 'fail') {
-    //           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-    //         } else {
-    //           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-    //           this.getList()
-    //         }
-    //       })
-    //     }).catch(() => {
-    //       this.$message({ type: 'info', message: '已取消复制' })
-    //     })
-    //   } else {
-    //     this.$message({ type: 'error', message: '请选择一条体况评分', duration: 2000 })
-    //   }
-    // },
-
-
     // 改成多条,后端接口未改正确,先注释
      handleCopy() {
       console.log('点击了复制')

Diferenças do arquivo suprimidas por serem muito extensas
+ 628 - 112
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue


+ 30 - 17
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" />
@@ -131,7 +131,8 @@ export default {
     rowPid: { type: String, defalut: '0' },
     optdevice: { type: String, defalut: '' },
     startTime:{ type: String, defalut: '' },
-    stopTime:{ type: String, defalut: '' }
+    stopTime:{ type: String, defalut: '' },
+    error:{type: String, defalut: '' }
   },
   data() {
     return {
@@ -140,9 +141,10 @@ export default {
       title: '',
       pid: '',
       methodname:'',
-      optdevice:'',
-      startTime:'',
-      stopTime:'',
+      optdevice1:'',
+      startTime1:'',
+      stopTime1:'',
+      error1:'',
       table1: {
         getdataListParm: {
           name: '', page: 1, offset: 1, pagecount: '', returntype: 'Map',
@@ -218,23 +220,30 @@ export default {
       immediate: true,
       handler(newVal, oldVal) {
         console.log(newVal, 'optdevice')
-        this.optdevice = newVal
+        this.optdevice1 = newVal
       }
     },
     startTime: {
       immediate: true,
       handler(newVal, oldVal) {
         console.log(newVal, 'startTime')
-        this.startTime = newVal
+        this.startTime1 = newVal
       }
     },
     stopTime: {
       immediate: true,
       handler(newVal, oldVal) {
         console.log(newVal, 'stopTime')
-        this.stopTime = newVal
+        this.stopTime1 = newVal
       }
-    }
+    },
+    error: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log(newVal, 'error')
+        this.error1 = newVal
+      }
+    },
   },
   created() {
 
@@ -251,10 +260,11 @@ export default {
     getList1() {
       this.table1.listLoading = true
       this.table1.getdataListParm.name = this.methodname
-      this.table1.getdataListParm.parammaps.optdevice = this.optdevice
-      this.table1.getdataListParm.parammaps.startTime = this.startTime
-      this.table1.getdataListParm.parammaps.stopTime = this.stopTime
+      this.table1.getdataListParm.parammaps.optdevice = this.optdevice1
+      this.table1.getdataListParm.parammaps.startTime = this.startTime1
+      this.table1.getdataListParm.parammaps.stopTime = this.stopTime1
       this.table1.getdataListParm.parammaps.pid = this.pid
+      this.table1.getdataListParm.parammaps.error = this.error1
       this.table1.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
       GetDataByName(this.table1.getdataListParm).then(response => {
         console.log('车次信息数据', response.data.list)
@@ -285,6 +295,7 @@ export default {
     },
     getList2() {
       this.table2.listLoading = true
+      this.table2.getdataListParm.parammaps.error = this.error
       GetDataByName(this.table2.getdataListParm).then(response => {
         console.log('混料信息数据', response.data.list)
         if (response.data !== null && response.data.list !== null) {
@@ -316,6 +327,7 @@ export default {
     },
     getList3() {
       this.table3.listLoading = true
+      this.table3.getdataListParm.parammaps.error = this.error
       GetDataByName(this.table3.getdataListParm).then(response => {
         if (response.data !== null && response.data.list !== null) {
           console.log('撒料信息数据', response.data.list)
@@ -347,6 +359,7 @@ export default {
     },
     getChart1() {
       this.chart1.listLoading = true
+      this.chart1.getdataListParm.parammaps.error = this.error
       GetReportform(this.chart1.getdataListParm).then(response => {
         if (response.data !== null && response.data.list !== null) {
           this.chart1.list = response.data.data
@@ -370,7 +383,7 @@ export default {
       this.chartLine = echarts.init(document.getElementById('chartLine'))
       var option = {
         title: { text: '', subtext: '' },
-        color: ['#38c193', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
+        color: ['#ff0000', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
         legend: [{
           itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
           data: [{ name: '设计重量' }, { name: '实际重量' }]
@@ -420,15 +433,15 @@ export default {
           {type:'slider' },  //用于添加滑动条缩放,
         ],
         series: [
-          { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#38c193' }}}},
+          { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#ff0000' }}}},
           { symbol: 'none', name: '设计重量', type: 'line', step: 'middle', data: chartLine_data.data2 },
           { name: '开始重量', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
           { name: '结束重量', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
         ]
       }
       this.chartLine.setOption(option)
-      if (this.chartLine != null) {
-        window.onresize = function() {
+      if (this.chartLine != null ) {
+        window.onresize = ()=> {
           this.chartLine.resize()
         }
       }
@@ -443,7 +456,7 @@ export default {
     },
     rowStyle({ row, rowIndex }) {
         let stylejson = {};
-        if (row.labnormal == 1) {
+        if (row.abnormal == 1) {
             stylejson.background = "#fb8072";// 背景颜色
             stylejson.maxHeight = '30px';// 背景颜色
             stylejson.height = '30px';// 背景颜色

+ 67 - 8
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -3,7 +3,8 @@
     <el-tabs v-model="activeName" @tab-click="handleTabClick">
       <el-tab-pane label="效率统计" name="first">
         <div class="search">
-          <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期"> </el-date-picker>
+          <!-- <el-date-picker v-model="tab2.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" /> -->
+          <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期" @change="changeTab1Date"> </el-date-picker>
           <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled1" @click="handleBefore" />
           <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled1" @click="handleNext" />
           <span style="margin-left: 10px;">统计类型:</span>
@@ -14,6 +15,9 @@
           <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" />
@@ -631,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',
@@ -640,6 +658,7 @@ export default {
             returntype: 'Map',
             parammaps: {
               pastureid: Cookies.get('pastureid'),
+              date: parseTime(new Date(), '{y}-{m}-{d}'),
               startTime: parseTime(new Date(), '{y}-{m}-{d}'),
               stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
               ftname: '',
@@ -651,7 +670,7 @@ export default {
           list: [],
           total: 0,
           listLoading: true,
-          temp: {}
+          temp: {},
         },
         chart1: {
           chartLine: null,
@@ -933,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
@@ -947,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() // 获取当年年份
@@ -1376,6 +1412,8 @@ export default {
       end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
 
       that.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.stopTime = parseTime(start2, '{y}-{m}-{d}')
 
       // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
       that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
@@ -1459,6 +1497,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
@@ -1585,6 +1633,8 @@ export default {
         const start2 = new Date()
         start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
         this.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
+        this.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(start2, '{y}-{m}-{d}')
         this.getTabList()
         this.getChart1()
         this.getChart2()
@@ -1595,6 +1645,8 @@ export default {
         const start2 = new Date()
         start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
         this.tab2.date = parseTime(start2, '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(start2, '{y}-{m}-{d}')
         this.getTab2List()
         this.getTab2List2()
         this.getTab2List3()
@@ -1696,6 +1748,11 @@ export default {
         this.getTabList()
       }
     },
+    changeTab1Date(){
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
+      this.getTabList()
+    },
     handleBefore() {
       if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {
         this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)
@@ -1904,9 +1961,9 @@ export default {
           this.tab.chart2.statisticsList = []
           this.tab.chart2.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]
@@ -1931,6 +1988,8 @@ export default {
           this.tab.chart2.list = []
           this.tab.chart2.chartLine_data = {}
         }
+        console.log(this.tab.chart2.statisticsList,'statisticsList======888')
+        console.log(this.tab.chart2.getdataListParm.parammaps.statisticsList,'statisticsList======999')
         this.roadChartLine2(this.tab.chart2.chartLine_data)
         setTimeout(() => {
           this.tab.chart2.listLoading = false
@@ -2118,9 +2177,9 @@ export default {
           this.tab.chart4.statisticsList = []
           this.tab.chart4.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]
@@ -2248,9 +2307,9 @@ export default {
           this.tab.chart5.statisticsList = []
           this.tab.chart5.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]

+ 6 - 6
src/views/statisticalAnalysis/feedingEfficiency/pasture/index备.vue

@@ -1140,9 +1140,9 @@ export default {
           this.tab.chart2.statisticsList = []
           this.tab.chart2.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]
@@ -1327,9 +1327,9 @@ export default {
           this.tab.chart4.statisticsList = []
           this.tab.chart4.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]
@@ -1445,9 +1445,9 @@ export default {
           this.tab.chart5.statisticsList = []
           this.tab.chart5.getdataListParm.parammaps.statisticsList = []
           for (let i = 0; i < response.data.list.data1.length; i++) {
-            if (i < 10) {
+            // if (i < 10) {
               this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
-            }
+            // }
             var obj = {}
             obj.id = i
             obj.name = response.data.list.data1[i]

+ 45 - 20
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>
@@ -109,7 +112,7 @@
         </div>
         <div v-if="tab3.table.tableConfig.length>2">
         <u-table v-if="isDispayTable3" ref="plTable3" v-loading="tab3.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable3">
-          <u-table-column v-for="(item,key) in tab3.table.tableConfig" :key="key" :label="item.label" :show-overflow-tooltip="item.showOverflow" align="center" :prop="item.prop" :fixed="key==0">
+          <u-table-column v-for="(item,key) in tab3.table.tableConfig" :key="key" :label="item.label" :show-overflow-tooltip="item.showOverflow" align="center"  :prop="item.prop" :fixed="key==0">
               <u-table-column v-for="(item1,key1) in item.children" v-if="item.children || item.children.length>0" :key="key1" align="center" :label="item1.label" :prop="item1.prop" :min-width="item1.width">
                 <u-table-column v-for="(item2,key2) in item1.children" v-if="item1.children || item1.children.length>0" :key="key2" :label="item2.label" :prop="item2.prop" />
               </u-table-column>
@@ -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,
@@ -762,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 = [
@@ -794,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('价格分析导出')
@@ -881,4 +898,12 @@ export default {
     padding-right: 0 !important;;
   }
   // .el-radio{margin-right: 20px;}
+</style>
+<style lang="css">
+  .el-tooltip__popper{
+  max-width: 60% !important;
+  }
+  .plTableBox .el-table td.is-hidden>*, .plTableBox .el-table th.is-hidden>*{
+    visibility:inherit;
+  }
 </style>

+ 227 - 28
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -1,26 +1,47 @@
 <template>
   <div class="app-container">
-    <!-- <h1>牧场</h1> -->
     <div class="search">
       <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" @change="change_date"/>
-
       <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
       <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
       <el-select v-model="table.getdataListParm.parammaps.lpplantype" placeholder="计划类型" class="filter-item" style="width: 120px;" clearable>
         <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
       </el-select>
-      <el-select v-model="table.getdataListParm.parammaps.tmrtname" placeholder="TMR名称" class="filter-item" style="width: 220px;" clearable multiple>
+      <el-select v-model="table.getdataListParm.parammaps.tmrtname" placeholder="TMR名称" class="filter-item" style="width: 180px;" clearable multiple>
         <el-option v-for="item in TMRList" :key="item.tmrtname" :label="item.tmrtname" :value="item.tmrtname" />
       </el-select>
-
-       <el-select v-model="table.getdataListParm.parammaps.error" placeholder="误差筛选范围" class="filter-item" style="width: 220px;" clearable>
+      <el-select v-model="table.getdataListParm.parammaps.error" placeholder="误差筛选范围" class="filter-item" style="width: 140px;" clearable>
         <el-option v-for="item in errorList" :key="item.value" :label="item.label" :value="item.value" />
       </el-select>
-
-      <!-- <el-input v-model="table.getdataListParm.parammaps.tmrtname" placeholder="TMR名称" style="width: 180px;" class="filter-item" clearable /> -->
       <el-select v-model="table.getdataListParm.parammaps.iscompleted" placeholder="工作状态" class="filter-item" style="width: 120px;" clearable>
         <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">
+        <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 />
+      </div>
+      <div style="display: inline-block;" class="filter-item1">
+        <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>
+      <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 />
+        <span>-</span>
+        <el-input-number :controls="false" :precision="2"  v-model="slwc2" placeholder="撒料误差值" style="width: 120px;" class="filter-item" clearable />
+      </div>
+      <div style="display: inline-block;" class="filter-item1">
+        <el-input-number :controls="false" :precision="2" v-model="slzq1" placeholder="撒料准确率" :min="0" :max="100" style="width: 120px;"  class="filter-item" clearable />
+        <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-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
     </div>
@@ -496,7 +517,16 @@ import { parseTime } from '@/utils/index.js'
 export default {
   name: 'PastureProcessAnalysis',
   data() {
-    return {
+    return {
+      hlwc1:undefined ,
+      hlwc2:undefined ,
+      hlzq1:undefined ,
+      hlzq2:undefined ,
+      slwc1:undefined ,
+      slwc2:undefined ,
+      slzq1:undefined ,
+      slzq2:undefined ,
+      ccys:false,
       myheight:970,
       title: '',
       isPremixedPlan: '', // 预混计划
@@ -534,13 +564,15 @@ 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: '已完成' }], // 工作状态
+      workingConditionList: [{ id: '0', name: '进行中' }, { id: '1', name: '已完成' }], // 工作状态
+      cixCategoryList: [], // 混料类别
+
       // TMR设备列表
       table: {
         getdataListParm: {
@@ -556,7 +588,9 @@ export default {
             inputDatetime: [new Date(), new Date()],
             iscompleted: '',
             tmrtname: '',
-            lpplantype: ''
+            lpplantype: '',
+            error:'',
+            fclassid:''
           }
         },
         tableKey: 0,
@@ -654,7 +688,8 @@ export default {
       },
     }
   },
-  created() {
+  created() {
+    this.getCixCategoryList()
     this.getList()
   },
   methods: {
@@ -671,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
@@ -689,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 == '剩料计划') {
@@ -706,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()
@@ -722,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()
@@ -741,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()
@@ -760,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()
@@ -779,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()
@@ -812,12 +867,90 @@ export default {
         this.table.getdataListParm.parammaps.inputDatetime = ''
         this.table.getdataListParm.parammaps.startTime = ''
         this.table.getdataListParm.parammaps.stopTime = ''
-      }
+      }
+      // 临时注释
+      // this.table.getdataListParm.parammaps.hlwc1 = this.hlwc1
+      // this.table.getdataListParm.parammaps.hlwc2 = this.hlwc2
+      // this.table.getdataListParm.parammaps.hlzq1 = this.hlzq1
+      // this.table.getdataListParm.parammaps.hlzq2 = this.hlzq2
+      // this.table.getdataListParm.parammaps.slwc1 = this.slwc1
+      // this.table.getdataListParm.parammaps.slwc2 = this.slwc2
+      // this.table.getdataListParm.parammaps.slzq1 = this.slzq1
+      // this.table.getdataListParm.parammaps.slzq2 = this.slzq2
+      // if(this.ccys == true){
+      //   if(this.table3.getdataListParm.name !== 'getprocessAnalysisHL'){
+      //     this.hlwc1 = undefined
+      //     this.hlwc2 = undefined
+      //     this.hlzq1 = undefined
+      //     this.hlzq2 = undefined
+      //     this.slwc1 = undefined
+      //     this.slwc2 = undefined
+      //     this.slzq1 = undefined
+      //     this.slzq2 = undefined
+      //     this.table.getdataListParm.parammaps.error = ''
+      //     this.table3.getdataListParm.parammaps.error = ''
+      //     this.table4.getdataListParm.parammaps.error = ''
+      //   }
+      //   if(this.table3.getdataListParm.name == 'getprocessAnalysisHL'){
+      //     this.table3.getdataListParm.parammaps.hlwc1  = this.hlwc1
+      //     this.table3.getdataListParm.parammaps.hlwc2  = this.hlwc2
+      //     this.table3.getdataListParm.parammaps.hlzq1  = this.hlzq1
+      //     this.table3.getdataListParm.parammaps.hlzq2  = this.hlzq2
+      //     this.table3.getdataListParm.parammaps.slwc1  = this.slwc1
+      //     this.table3.getdataListParm.parammaps.slwc2  = this.slwc2
+      //     this.table3.getdataListParm.parammaps.slzq1  = this.slzq1
+      //     this.table3.getdataListParm.parammaps.slzq2  = this.slzq2
+      //     this.table3.getdataListParm.parammaps.error  = '有误差'
+      //   }
+      //   if(this.table4.getdataListParm.name == 'getprocessAnalysisSL'){
+      //     this.table4.getdataListParm.parammaps.hlwc1  = this.hlwc1
+      //     this.table4.getdataListParm.parammaps.hlwc2  = this.hlwc2
+      //     this.table4.getdataListParm.parammaps.hlzq1  = this.hlzq1
+      //     this.table4.getdataListParm.parammaps.hlzq2  = this.hlzq2
+      //     this.table4.getdataListParm.parammaps.slwc1  = this.slwc1
+      //     this.table4.getdataListParm.parammaps.slwc2  = this.slwc2
+      //     this.table4.getdataListParm.parammaps.slzq1  = this.slzq1
+      //     this.table4.getdataListParm.parammaps.slzq2  = this.slzq2
+      //     this.table4.getdataListParm.parammaps.error  = '有误差'
+      //   }
+      //   if(this.table.getdataListParm.name == 'getprocessAnalysis'){
+      //     this.table.getdataListParm.parammaps.hlwc1  = this.hlwc1
+      //     this.table.getdataListParm.parammaps.hlwc2  = this.hlwc2
+      //     this.table.getdataListParm.parammaps.hlzq1  = this.hlzq1
+      //     this.table.getdataListParm.parammaps.hlzq2  = this.hlzq2
+      //     this.table.getdataListParm.parammaps.slwc1  = this.slwc1
+      //     this.table.getdataListParm.parammaps.slwc2  = this.slwc2
+      //     this.table.getdataListParm.parammaps.slzq1  = this.slzq1
+      //     this.table.getdataListParm.parammaps.slzq2  = this.slzq2
+      //     this.table.getdataListParm.parammaps.error = '有误差'
+      //   }
+      // }else{
+      //   this.table3.getdataListParm.parammaps.hlwc1  = ''
+      //   this.table3.getdataListParm.parammaps.hlwc2  = ''
+      //   this.table3.getdataListParm.parammaps.hlzq1  = ''
+      //   this.table3.getdataListParm.parammaps.hlzq2  = ''
+      //   this.table3.getdataListParm.parammaps.slwc1  = ''
+      //   this.table3.getdataListParm.parammaps.slwc2  = ''
+      //   this.table3.getdataListParm.parammaps.slzq1  = ''
+      //   this.table3.getdataListParm.parammaps.slzq2  = ''
+      //   this.table4.getdataListParm.parammaps.hlwc1  = ''
+      //   this.table4.getdataListParm.parammaps.hlwc2  = ''
+      //   this.table4.getdataListParm.parammaps.hlzq1  = ''
+      //   this.table4.getdataListParm.parammaps.hlzq2  = ''
+      //   this.table4.getdataListParm.parammaps.slwc1  = ''
+      //   this.table4.getdataListParm.parammaps.slwc2  = ''
+      //   this.table4.getdataListParm.parammaps.slzq1  = ''
+      //   this.table4.getdataListParm.parammaps.slzq2  = ''
+      //   this.table3.getdataListParm.parammaps.error  = ''
+      //   this.table4.getdataListParm.parammaps.error  = ''
+      // }
+      // 临时注释
       this.table.getdataListParm.offset = 1
       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 = ''
@@ -870,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
@@ -1217,14 +1352,78 @@ export default {
             return "";
         }
     },
-
+    changeccysChecked(){
+      // table.getdataListParm.parammaps.ccys
+      // console.log(this.table.getdataListParm.parammaps.ccys,'===')
+      if(this.ccys == true){
+        if(this.table3.getdataListParm.name !== 'getprocessAnalysisHL'){
+          this.hlwc1 = undefined
+          this.hlwc2 = undefined
+          this.hlzq1 = undefined
+          this.hlzq2 = undefined
+          this.slwc1 = undefined
+          this.slwc2 = undefined
+          this.slzq1 = undefined
+          this.slzq2 = undefined
+          this.table3.getdataListParm.parammaps.error = ''
+          this.table4.getdataListParm.parammaps.error = ''
+          this.table.getdataListParm.parammaps.error = ''
+        }
+        if(this.table3.getdataListParm.name == 'getprocessAnalysisHL'){
+        //   // hlwc1,hlwc2,hlzq1,hlzq2,slwc1,slwc2,slzq1,slzq2,ccys
+          this.table3.getdataListParm.parammaps.hlwc1  = this.hlwc1
+          this.table3.getdataListParm.parammaps.hlwc2  = this.hlwc2
+          this.table3.getdataListParm.parammaps.hlzq1  = this.hlzq1
+          this.table3.getdataListParm.parammaps.hlzq2  = this.hlzq2
+          this.table3.getdataListParm.parammaps.slwc1  = this.slwc1
+          this.table3.getdataListParm.parammaps.slwc2  = this.slwc2
+          this.table3.getdataListParm.parammaps.slzq1  = this.slzq1
+          this.table3.getdataListParm.parammaps.slzq2  = this.slzq2
+          this.table3.getdataListParm.parammaps.error = '有误差'
+        }
+        if(this.table4.getdataListParm.name == 'getprocessAnalysisSL'){
+          this.table4.getdataListParm.parammaps.hlwc1  = this.hlwc1
+          this.table4.getdataListParm.parammaps.hlwc2  = this.hlwc2
+          this.table4.getdataListParm.parammaps.hlzq1  = this.hlzq1
+          this.table4.getdataListParm.parammaps.hlzq2  = this.hlzq2
+          this.table4.getdataListParm.parammaps.slwc1  = this.slwc1
+          this.table4.getdataListParm.parammaps.slwc2  = this.slwc2
+          this.table4.getdataListParm.parammaps.slzq1  = this.slzq1
+          this.table4.getdataListParm.parammaps.slzq2  = this.slzq2
+          this.table4.getdataListParm.parammaps.error = '有误差'
+        }
+        if(this.table.getdataListParm.name == 'getprocessAnalysis'){
+          this.table.getdataListParm.parammaps.hlwc1  = this.hlwc1
+          this.table.getdataListParm.parammaps.hlwc2  = this.hlwc2
+          this.table.getdataListParm.parammaps.hlzq1  = this.hlzq1
+          this.table.getdataListParm.parammaps.hlzq2  = this.hlzq2
+          this.table.getdataListParm.parammaps.slwc1  = this.slwc1
+          this.table.getdataListParm.parammaps.slwc2  = this.slwc2
+          this.table.getdataListParm.parammaps.slzq1  = this.slzq1
+          this.table.getdataListParm.parammaps.slzq2  = this.slzq2
+          this.table.getdataListParm.parammaps.error = '有误差'
+        }
+        this.getList2()
+        this.getList3()
+        this.getList4()
+      }else{
+        this.table.getdataListParm.parammaps.error = ''
+        this.table3.getdataListParm.parammaps.error = ''
+        this.table4.getdataListParm.parammaps.error = ''
+        this.getList2()
+        this.getList3()
+        this.getList4()
+      }
+    }
   }
 }
 
 </script>
 <style lang="scss" scoped>
-  .search{padding-top:10px;clear: both;}
-  
+  .filter-item1{
+    margin-top: 10px;
+    span{margin-right: 5px;}
+  }
   /deep/.el-table--scrollable-y .el-table__body-wrapper{
     bottom: 15px;
   }

+ 212 - 116
src/views/systemManagement/dataSynchronization/index.vue

@@ -3,100 +3,49 @@
 
     <el-form ref="form" :model="form" label-width="180px">
         <el-form-item label="每日自动同步:">
-          
-
-          <el-col :span="20">
-            <el-switch v-model="form.delivery"></el-switch>
-          </el-col>
-       
-          <el-col :span="4">
-           <el-select v-model="form.cmo"  >
-            <el-option  v-for="item in companyArr" :key="item.id" :label="item.name" :value="item.name"/> 
-          </el-select>
- 
-          </el-col>
-
-
-
-        </el-form-item>
-
-
-   
-
-
-
-        
-
-        <el-form-item label="">
-          <el-col :span="6">
-            <el-select v-model="form.region" placeholder=""  @change="change_select">
-              <el-option v-for="item in selectArr"  :key="item.id" :label="item.name" :value="item.id" /> 
+          <el-row>
+            <el-col :span="20">
+              <el-switch v-model="form.delivery" :disabled="form.cmo == ''" active-value="1" inactive-value="0" active-color="#169bd5" inactive-color="#8c8c8c" @change="changeEnable"></el-switch>
+            </el-col>
+            <el-col :span="4">
+             <el-select v-model="form.cmo" placeholder="已对接公司" @change="change_company">
+              <el-option  v-for="(item,index) in companyArr" :key="index" :label="item.company" :value="item.company"/>
             </el-select>
-
-          
-          </el-col>
-          <el-col :span="6">
-              <el-time-picker
-                v-model="time1"
-                :picker-options="{
-                  selectableRange: '00:00:00 - 23:59:59'
-                }"
-                @change = "change_time1"
-                placeholder="任意时间点">
-              </el-time-picker>
-
-          </el-col>
+            </el-col>
+          </el-row>
         </el-form-item>
-        <!-- <el-form-item label="活动时间">
-          <el-col :span="11">
-            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
-          </el-col>
-          <el-col class="line" :span="2">-</el-col>
-          <el-col :span="11">
-            <el-time-picker placeholder="选择时间" v-model="form.date2" style="width: 100%;"></el-time-picker>
-          </el-col>
-        </el-form-item> -->
-       
         <el-form-item label="同步内容:">
-          下载数据
-          <el-checkbox-group v-model="form.type" @change="change_auto1">
-              <el-checkbox v-for="item in autoArr1" :key="item.id" :label="item" :value="item.name">{{ item.name }}</el-checkbox>
-          </el-checkbox-group>
           上传数据
-          <el-checkbox-group v-model="form.type" @change="change_auto1">
-              <el-checkbox v-for="item in autoArr2" :key="item.id" :label="item" :value="item.name">{{ item.name }}</el-checkbox>
+          <el-radio-group v-model="form.type1" @change="changeEnable">
+            <el-radio v-for="item in autoArr3"  :disabled="form.cmo == ''" :key="item.id" :label="item.id" :value="item.name">{{ item.name }}</el-radio>
+          </el-radio-group>
+          <el-checkbox-group v-model="form.type2" @change="change_auto1('automatic','0',form.type2,myautoArr2)">
+            <el-checkbox v-for="(item,index) in autoArr2" :key="index" :label="item.name" :value="item.name">{{ item.name }}</el-checkbox>
           </el-checkbox-group>
         </el-form-item>
-
-
         <el-divider></el-divider>
-
         <el-form-item label="手动同步:">
-          <el-button class="successBorder" @click="handleSearch">立刻同步</el-button>
+          <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="同步内容:">
           下载数据
-          <el-checkbox-group v-model="form.type" @change="change_auto1">
-              <el-checkbox v-for="item in autoArr1" :key="item.id" :label="item" :value="item.name">{{ item.name }}</el-checkbox>
+          <el-checkbox-group v-model="form.type3" @change="change_auto1('manual','1',form.type3,myautoArr3)">
+              <el-checkbox v-for="(item,index) in autoArr1" :key="index" :label="item.name" :value="item.name">{{ item.name }}</el-checkbox>
           </el-checkbox-group>
           上传数据
-          <el-checkbox-group v-model="form.type" @change="change_auto1">
-              <el-checkbox v-for="item in autoArr2" :key="item.id" :label="item" :value="item.name">{{ item.name }}</el-checkbox>
+          <el-checkbox-group v-model="form.type4" @change="change_auto1('manual','0',form.type4,myautoArr2)">
+            <el-checkbox v-for="(item,index) in autoArr2" :key="item.index" :label="item.name" :value="item.name">{{ item.name }}</el-checkbox>
           </el-checkbox-group>
         </el-form-item>
-       
-       
       </el-form>
- 
-
-   
   </div>
 
 </template>
 
 <script>
-import { GetDataByName, PostDataByName, failproccess, checkButtons } from '@/api/common'
+  import { parseTime } from '@/utils/index.js'
+import { postJson,checkButtons } from '@/api/common'
 import Cookies from 'js-cookie'
 import Pagination from '@/components/Pagination'
 export default {
@@ -106,46 +55,57 @@ export default {
     return {
       isRoleEdit: [],
       companyArr: [
-        { id: '公司1', name: '公司1' }, 
-        { id: '公司2', name: '公司2' },
-        { id: '公司3', name: '公司3' } 
+        // { id: '公司1', name: '公司1' },
+        // { id: '公司2', name: '公司2' },
+        // { id: '公司3', name: '公司3' }
       ],
       autoArr1: [
-        { id: '栏舍', name: '栏舍' }, 
-        { id: '配方', name: '配方' },
-        { id: '饲料', name: '饲料' },
-        { id: '饲料分类', name: '饲料分类' },
-        { id: '牲畜类别', name: '牲畜类别' },
-        { id: '驾驶员', name: '驾驶员' }
+        // { id: '栏舍', name: '栏舍' },
+        // { id: '配方', name: '配方' },
+        // { id: '饲料', name: '饲料' },
+        // { id: '饲料分类', name: '饲料分类' },
+        // { id: '牲畜类别', name: '牲畜类别' },
+        // { id: '驾驶员', name: '驾驶员' }
       ],
       autoArr2: [
-        { id: '栏舍', name: '栏舍' }, 
-        { id: '配方', name: '配方' },
-        { id: '搅拌数据', name: '饲料' },
-        { id: '发料数据', name: '饲料分类' },
-        { id: '剩料数据', name: '牲畜类别' },
-        { id: '干物质信息', name: '干物质信息' },
-        { id: '滨州筛', name: '滨州筛' },
-        { id: '粪便筛', name: '粪便筛' },
-        { id: '计划完成车次', name: '计划完成车次' },
-        { id: '实际完成车次', name: '实际完成车次' },
-        { id: '计划重量', name: '计划重量' },
-        { id: '完成重量', name: '完成重量' },
-        { id: '准确率', name: '准确率' },
+        // { id: '栏舍', name: '栏舍' },
+        // { id: '配方', name: '配方' },
+        // { id: '搅拌数据', name: '饲料' },
+        // { id: '发料数据', name: '饲料分类' },
+        // { id: '剩料数据', name: '牲畜类别' },
+        // { id: '干物质信息', name: '干物质信息' },
+        // { id: '滨州筛', name: '滨州筛' },
+        // { id: '粪便筛', name: '粪便筛' },
+        // { id: '计划完成车次', name: '计划完成车次' },
+        // { id: '实际完成车次', name: '实际完成车次' },
+        // { id: '计划重量', name: '计划重量' },
+        // { id: '完成重量', name: '完成重量' },
+        // { id: '准确率', name: '准确率' },
+      ],
+      myautoArr2:[],
+      autoArr3: [
+        { id: '0', name: '每车次结束' },
+        { id: '1', name: '每班次结束' },
+        { id: '2', name: '每天计划完成后' }
       ],
 
       time1:"",
-time2:"",
-time3:"",
+      time2:"",
+      time3:"",
        form: {
+         cmo:'',
           name: '',
           region: '',
           date1: '',
           date2: '',
-          delivery: false,
-          type: [],
+          delivery: '',
+          type1: '',
+          type2: [],
+          type3: [],
+          type4: [],
           resource: '',
-          desc: ''
+          desc: '',
+          date:parseTime(new Date(), '{y}-{m}-{d}')
         },
 
 
@@ -162,7 +122,7 @@ time3:"",
             'contact': '',
             'address': '',
             'pastureName': '',
-            enable: ''
+            'enable': ''
           }
         },
         tableKey: 0,
@@ -181,11 +141,11 @@ time3:"",
   },
 
   created() {
- 
+    this.getCompanyList()
     this.getButtons()
   },
   mounted() {
-  
+
   },
   methods: {
     getButtons() {
@@ -197,22 +157,12 @@ time3:"",
     onSubmit() {
         console.log('submit!');
       },
-       change_auto1() {
-        console.log('submit!');
-      },
     handleEnableChange() {
       console.log('点击了是否启用')
     },
     handleConfirmStartChange() {
       console.log('点击了确认开始')
     },
-    handleSearch() {
-      console.log('点击了查询')
-      this.getList()
-      this.table.getdataListParm.offset = 1
-      this.arrowDown = true
-      this.arrowUp = false
-    },
 
     change_time1(){
       console.log(this.time1)
@@ -221,11 +171,157 @@ time3:"",
     change_select(){
       console.log(this.time1)
     },
- 
+    getCompanyList(){
+      const url = 'authdata/GetDataByName'
+      const data = {}
+      data.name = 'getCompanyName'
+      postJson(url, data).then(response => {
+        console.log('公司数据', response.data.list)
+        if (response.data.list !== null) {
+          this.companyArr = response.data.list
+        } else {
+          this.companyArr = []
+        }
+      })
+    },
+    change_company(item){
+      console.log(item)
+      this.getUploadCheckedList()
+      this.getDownloadCheckedList()
+      this.getUploadRadioCheckedList()
+    },
+    getUploadCheckedList(){
+      const url = 'authdata/GetDataByName'
+      const data = {}
+      data.name = 'getScheduledUpByCompany'
+      data.parammaps = {}
+      data.parammaps.company = this.form.cmo
+      postJson(url, data).then(response => {
+        if (response.data.list !== null) {
+          this.form.type2 = []
+          this.autoArr2 = []
+          this.myautoArr2 = []
+          for(let i=0;i<response.data.list.length;i++){
+            var obj={}
+            obj.name = response.data.list[i].sname
+            this.autoArr2.push(obj)
+            this.myautoArr2.push(response.data.list[i])
+            if(response.data.list[i].automatic== 1){
+              this.form.type2.push(response.data.list[i].sname)
+            }
+            if(response.data.list[i].manual== 1){
+              this.form.type4.push(response.data.list[i].sname)
+            }
+          }
+        } else {
+          this.companyArr = []
+        }
+      })
+    },
+    getDownloadCheckedList(){
+      const url = 'authdata/GetDataByName'
+      const data = {}
+      data.name = 'getScheduledDownByCompany'
+      data.parammaps = {}
+      data.parammaps.company = this.form.cmo
+      postJson(url, data).then(response => {
+        if (response.data.list !== null) {
+          this.form.type3 = []
+          this.autoArr1 = []
+          this.myautoArr3 = []
+          for(let i=0;i<response.data.list.length;i++){
+            var obj={}
+            obj.name = response.data.list[i].sname
+            this.autoArr1.push(obj)
+            this.myautoArr3.push(response.data.list[i])
+            if(response.data.list[i].manual== 1){
+              this.form.type3.push(response.data.list[i].sname)
+            }
+          }
+          console.log('this.form.type3',this.form.type3)
+          console.log('this.autoArr1',this.autoArr1)
+        } else {
+          this.companyArr = []
+        }
+      })
+    },
+    getUploadRadioCheckedList(){
+      const url = 'authdata/GetDataByName'
+      const data = {}
+      data.name = 'getScheduledUpStatusByCompany'
+      data.parammaps = {}
+      data.parammaps.company = this.form.cmo
+      postJson(url, data).then(response => {
+        if (response.data.list !== null) {
+          this.form.type1 = response.data.list[0].times
+          this.form.delivery = response.data.list[0].enable
+        } else {
+          this.form.type1 = ''
+          this.form.delivery = ''
+        }
+      })
+    },
+    changeEnable(){
+      const url = 'authdata/GetDataByName'
+      const data = {}
+      data.name = 'updateScheduledStatus'
+      data.parammaps = {}
+      data.parammaps.company = this.form.cmo
+      data.parammaps.enable = this.form.delivery
+      data.parammaps.times = this.form.type1
+      postJson(url, data).then(response => {
+        if (response.msg == 'ok') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success',  duration: 2000 })
+        } else {
+          this.$notify({ title: '失败', message: '保存失败', type: 'success',  duration: 2000 })
+        }
+      })
+    },
+    change_auto1(item,type,ids,list) {
+      console.log(ids,'5555555555')
+      // console.log(this.myautoArr2)
+      var myIds = []
+      for(let i=0;i<list.length;i++){
+        for(let j=0;j<ids.length;j++){
+          if(list[i].sname == ids[j]){
+            myIds.push(list[i].scheduledid)
+          }
+        }
+      }
+      const url = 'authdata/scheduled/status/edit'
+      const data = {}
+      data.company = this.form.cmo
+      data.id = myIds
+      if(item == 'automatic'){
+         data.automatic = '1'
+      }else{
+        data.manual = '1'
+      }
+      console.log('myIds',myIds)
+      data.type = type
+      postJson(url, data).then(response => {
+        if (response.msg == 'ok') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success',  duration: 2000 })
+        } else {
+          this.$notify({ title: '失败', message: '保存失败', type: 'success',  duration: 2000 })
+        }
+      })
+    },
+    handleSyncNow() {
+      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 })
+        } else {
+          this.$notify({ title: '失败', message: '保存失败', type: 'success',  duration: 2000 })
+        }
+      })
+    },
   }
 }
 </script>
 <style lang="scss" scoped>
   .search{margin-top:10px;}
-  
- 

+ 40 - 0
src/views/systemManagement/messagesReceiving/index.vue

@@ -0,0 +1,40 @@
+<template>
+  <div class="app-container">
+      <div class="content">
+      <div class="title">微信接收系统待办、预警等消息,必须先扫码关注公众号</div>
+        <div style="font-weight: 600;">关注微信:</div>
+          <img :src="imgUrl" alt="">
+      </div>
+  </div>
+</template>
+
+<script>
+  import { getData } from '@/api/common'
+  import Cookies from 'js-cookie'
+  export default {
+    name: 'MessagesReceiving',
+    data() {
+      return {
+        imgUrl:'http://tmrwatch.cn/wx/code?scene_id:tmrwatch.'+Cookies.get('employeid')
+      }
+    },
+    created() {
+    },
+
+    methods: {
+
+    }
+  }
+</script>
+
+<style scoped>
+  .app-container{display:flex;justify-content: center; align-items:center;}
+  .content{
+    margin-top: 100px;
+    width: 500px;
+  }
+  .content img{
+    max-width:300px;
+
+  }
+</style>

+ 1 - 1
src/views/systemManagement/ranchInformation/index.vue

@@ -173,10 +173,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 938 - 0
src/views/systemManagement/reminderSettings/index.vue

@@ -0,0 +1,938 @@
+<template>
+  <div class="app-container">
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :max-height="myHeight"
+      >
+        <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>
+          </template>
+        </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;">
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <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 == '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">
+                      <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="发送时间" :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-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="发送时间" :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>
+                </div>
+              </el-form>
+            </el-col>
+            <el-col :span="16">
+              <b>提醒对象:</b>
+              <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
+                    ref="setUpTable1"
+                    :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="350"
+                  >
+                    <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
+                    ref="setUpTable2"
+                    :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="350"
+                  >
+                    <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>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
+          <el-button class="cancelClose" @click="setUp.dialogFormVisible = false;getList(); ">取消</el-button>
+          <el-button class="save" :disabled="isokDisable" @click="setData()">确认</el-button>
+        </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 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 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 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 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 == '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 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 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 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>
+                </el-row>
+                <el-row>
+                  <el-col :span="24">
+                    <el-form-item label="发送时间">
+                       <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>
+              </div>
+            </el-form>
+        </div>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
+          <el-button class="cancelClose1" @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">
+          <div class="title">
+            <p>微信接收系统待办、预警等消息,必须先扫码关注公众号;</p>
+            <p>请将下方二维码分享给需要接收信息的用户扫码</p>
+          </div>
+          <div style="font-weight: 600;">关注微信:</div>
+          <img src="https://img2.baidu.com/it/u=1151188475,1753963046&fm=253&fmt=auto&app=138&f=JPEG?w=504&h=300" alt="">
+        </div>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
+          <el-button class="save" :disabled="isokDisable" @click="QRcode.dialogFormVisible = false;">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { GetDataByName,postJson2,postJson } from '@/api/common'
+  import Cookies from 'js-cookie'
+  export default {
+    name: 'ReminderSettings',
+    data() {
+      return {
+        temp:{
+          rules:{},
+          messageName:'',//消息名称
+          triggerCondition:'',//触发条件,
+          sendingMethod:'1',//发送方式
+          delayed1:'',//延时
+          delayed2:'',//延时
+          delayed3:'',//延时,
+          sendTime:'',//发送时间,
+          sendingMechanism:'1',// 发送机制
+          numberCycles:'',//循环次数
+          intervalPeriod1:'',//间隔周期
+          intervalPeriod2:'',//间隔周期
+          intervalPeriod3:'',//间隔周期
+          cycleType:'1',
+        },
+        modeList: [
+          { id: '1', name: '立即' },
+          { id: '2', name: '延时' },
+          { id: '3', name: '指定周期' },
+        ],
+        mode: '0',
+        mechanismList: [
+          { id: '1', name: '单次' },
+          { id: '2', name: '指定循环次数' },
+          { id: '3', name: '循环至任务结束' },
+        ],
+        cycleTypeList:[
+          { id: '1', name: '每天' },
+          { id: '2', name: '每周' },
+          { id: '3', name: '每月' },
+        ],//周期类型
+        weekList:[
+          { id: '1', name: '周一' },
+          { id: '2', name: '周二' },
+          { id: '3', name: '周三' },
+          { id: '4', name: '周四' },
+          { id: '5', name: '周五' },
+          { id: '6', name: '周六' },
+          { id: '7', name: '周日' },
+        ],//周
+        monthList:[],//月
+        mechanism: '0',
+        activeName:'first',
+        table: {
+          tableKey: 0,
+          list: [],
+          total: 0,
+          listLoading: false
+        },
+        setUp:{
+          dialogStatus: '',
+          dialogFormVisible:false,
+          // 角色
+          tableKey1: 0,
+          list1: [],
+          total1: 0,
+          listLoading1: false,
+          data1:{
+            name: 'getRoleList', page: 1, offset: 1, pagecount:'',returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid')
+            }
+          },
+          // 用户
+          tableKey2: 0,
+          list2: [],
+          total2: 0,
+          listLoading2: false,
+          data2:{
+            name: 'getuserallL', page: 1, offset: 1, pagecount:'',returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              roleid:''
+            }
+          },
+          temp:{}
+        },
+        see:{
+          dialogStatus: '',
+          dialogFormVisible:false,
+          temp:{}
+        },
+        QRcode:{
+          dialogStatus: '',
+          dialogFormVisible:false,
+        },
+        myHeight:document.documentElement.clientHeight - 85- 150 - 45,
+        textMap: {
+          setup: '设置',
+          QRcode:'提示',
+          add:'新增',
+          see:'查看'
+        },
+        selectList1:[],
+        selectList2:[],
+        isokDisable:false,
+        rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+        cellStyle: { padding: 0 + 'px' }
+      }
+    },
+    created() {
+      this.monthList = []
+      for(let i=1;i<=31;i++){
+        let obj = {}
+        obj.id = String(i)
+        obj.name = i+'日'
+        this.monthList.push(obj)
+      }
+      this.getList()
+    },
+    methods: {
+      getList() {
+        this.table.listLoading = true
+        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 {
+            this.table.list = []
+          }
+          this.table.total = response.data.total
+          setTimeout(() => {
+            this.table.listLoading = false
+          }, 100)
+        })
+      },
+      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.message //消息名称
+        this.temp.triggerCondition = row.trigger //触发条件
+        this.temp.sendTime = row.data.push_time //发送时间
+        this.selectList1 = []
+        if(row.user){
+          this.selectList2 = row.user.split(',')
+        }
+        console.log(this.selectList2,'this.selectList211')
+        // 立即
+        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)
+          }
+        }
+        this.getList1()
+      },
+      handleSee(row){
+        this.see.dialogStatus = 'see'
+        this.see.dialogFormVisible = true
+        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'){
+          this.getList1()
+        }else{
+          this.getList2()
+        }
+      },
+      handleSelectionChange1(val) {
+        console.log('勾选数据', val)
+        this.selectList1 = []
+        for(let i=0;i<val.length;i++){
+          this.selectList1.push(val[i].id)
+        }
+        this.setUp.data2.parammaps.roleid = this.selectList1.join(',')
+        this.getList2()
+      },
+      handleSelectionChange2(val) {
+        this.selectList2 = val.map(item=>item.username)
+        console.log('勾选数据', this.selectList2)
+      },
+
+      handleGenerateQRcode(){
+        this.QRcode.dialogStatus = 'QRcode'
+        this.QRcode.dialogFormVisible = true
+      },
+      handleSearch(){
+        this.getList2()
+      },
+      getList1() {
+        this.setUp.listLoading1 = true
+        let url = "authdata/GetDataByName"
+        postJson(url,this.setUp.data1).then(response => {
+          if (response.data.list !== null) {
+            this.setUp.list1 = response.data.list
+            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 = []
+          }
+          setTimeout(() => {
+            this.setUp.listLoading1 = false
+          }, 100)
+        })
+      },
+      getList2() {
+        this.setUp.listLoading2 = true
+        let url = "authdata/GetDataByName"
+        postJson(url,this.setUp.data2).then(response => {
+          if (response.data.list !== null) {
+            this.setUp.list2 = 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)
+        })
+      },
+      setData(){
+        let url = 'authdata/remind/edit'
+        let data = {}
+        let delayedTime = 0
+        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
+        }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{
+          delayed3 = 0
+        }
+        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
+        }
+        if(this.temp.intervalPeriod3 !== ''){
+          intervalPeriod3 = parseInt(this.temp.intervalPeriod3)
+        }else{
+          intervalPeriod3 = 0
+        }
+        intervalPeriodTime = intervalPeriod1+ intervalPeriod2 + intervalPeriod3
+
+        // sendingMethod   发送方式
+        // sendingMechanism   发送机制
+        // intervalPeriod1    间隔周期
+        // 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.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 = '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.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
+          }
+        }
+        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: 'warning', duration: 2000 })
+            console.log('失败')
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+  .app-container{
+    padding: 20px 20px;
+  }
+  .content-left{padding: 5px 5px;}
+  .content-left b{padding-right: 10px;}
+
+  .QRcode{display:flex;justify-content: center; align-items:center;}
+  .content{
+    /* margin-top: 100px; */
+    width: 500px;
+  }
+  .content img{
+    max-width:300px;
+
+  }
+</style>

+ 1 - 1
src/views/systemManagement/role/index.vue

@@ -251,10 +251,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)

+ 67 - 11
src/views/systemManagement/user/index.vue

@@ -7,7 +7,11 @@
         <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-
+      <!-- 临时注释 -->
+      <!-- <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="公众号关注状态" class="filter-item" style="width: 150px;" clearable>
+        <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select> -->
+      <!-- 临时注释 -->
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
     </div>
@@ -61,7 +65,17 @@
               <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
             </el-select>
           </template>
-        </el-table-column>
+        </el-table-column>
+        <!-- 临时注释 -->
+        <!-- <el-table-column label="公众号关注状态" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
+              <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column> -->
+        <!-- 临时注释 -->
         <el-table-column label="创建时间" min-width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.createdtime }}</span>
@@ -77,12 +91,17 @@
             <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
+        <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <!-- 新增 -->
             <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
             <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+            <!-- 扫码接收消息 -->
+            <!-- 临时注释 -->
+            <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleScanningCode(row)">扫码接收消息</a>
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <!-- 临时注释 -->
             <!-- 重置密码 -->
             <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleResetPassword(row)">重置密码</a>
             <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
@@ -98,9 +117,23 @@
         </el-table-column>
       </el-table>
       <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
+    </div>
+    <el-dialog :title="textMap[QRcode.dialogStatus]" :visible.sync="QRcode.dialogFormVisible" :close-on-click-modal="false" width="50%">
+      <div class="QRcode">
+        <div class="content">
+          <div class="title">
+            <p>微信接收系统待办、预警等消息,必须先扫码关注公众号;</p>
+            <p>请将下方二维码分享给需要接收信息的用户扫码</p>
+          </div>
+          <div style="font-weight: 600;">关注微信:</div>
+          <img :src="imgUrl" alt="">
+        </div>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
+          <el-button class="save" :disabled="isokDisable" @click="QRcode.dialogFormVisible = false;">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
-
 </template>
 
 <script>
@@ -118,7 +151,8 @@ export default {
       requestParams: [
         { name: 'getRoleAll', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
       ],
-      enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
+      enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
+      attentionStatusList: [{ id: 1, name: '已关注公众号' }, { id: 0, name: '未关注公众号' }],
       roleList: [], // 角色
 
       table: {
@@ -146,9 +180,17 @@ export default {
       },
       requestParam: {},
       isokDisable: false,
-      selectList: [],
+      selectList: [],
+      QRcode:{
+        dialogStatus: '',
+        dialogFormVisible:false,
+      },
+      textMap: {
+        QRcode:'提示'
+      },
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      imgUrl:''
 
     }
   },
@@ -185,10 +227,10 @@ export default {
           this.table.list = response.data.list
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
         } else {
           this.table.list = []
         }
+        this.table.total = response.data.total
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
@@ -447,11 +489,25 @@ export default {
           })
         })
       })
+    },
+    handleScanningCode(row){
+      this.QRcode.dialogStatus = 'QRcode'
+      this.QRcode.dialogFormVisible = true
+      this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_str=tmrwatch.'+ Cookies.get('pastureid')+'.'+ row.username + '.'+row.empname
+      console.log(this.imgUrl)
     }
   }
 }
 </script>
 <style lang="scss" scoped>
-  .search{margin-top:10px;}
-  
+  // .search{margin-top:10px;}
+  .QRcode{display:flex;justify-content: center; align-items:center;}
+  .content{
+    /* margin-top: 100px; */
+    width: 500px;
+  }
+  .content img{
+    max-width:300px;
+
+  }
  </style>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff