Просмотр исходного кода

Merge branch 'feature-hss2025' of Shan_2024/Tmr-Admin into release/shengmu

baishaojie 1 месяц назад
Родитель
Сommit
c6eaae7f4f
67 измененных файлов с 19531 добавлено и 8435 удалено
  1. 11 5
      .env.development
  2. 1 1
      .env.production
  3. BIN
      dist-20250226-tmr-正式-80.zip
  4. BIN
      dist-250811.zip
  5. BIN
      dist-251125.zip
  6. BIN
      dist-251203.zip
  7. BIN
      dist-80-tmr-正式-20250225.zip
  8. BIN
      dist-tmr-0319.zip
  9. BIN
      dist-tmr-0328.zip
  10. BIN
      dist-tmr-20241225-正式.zip
  11. BIN
      dist-tmr-20250103-正式包.zip
  12. BIN
      dist-tmr-20250122-正式.zip
  13. BIN
      dist-tmr-20250310-2.zip
  14. BIN
      dist-tmr-20250310.zip
  15. BIN
      dist-tmr-20250325.zip
  16. BIN
      dist-tmr-20250326.zip
  17. BIN
      dist-tmr-20253019-全部.zip
  18. BIN
      dist-tmr-8081-20250319.zip
  19. BIN
      dist-tmr-正式-20241205.zip
  20. BIN
      dist-tmr-正式-20250114.zip
  21. BIN
      dist-tmr-正式-20250117.zip
  22. BIN
      dist-tmr-正式-20250212.zip
  23. BIN
      dist-tmr-正式-20250224.zip
  24. BIN
      dist-tmr-正式-20250318.zip
  25. BIN
      dist-tmr-正式-20250319.zip
  26. BIN
      dist-tmr-测试-20250107.zip
  27. BIN
      dist.zip
  28. BIN
      dist250408.zip
  29. BIN
      dist250409.zip
  30. BIN
      dist250424.zip
  31. BIN
      dist250427.zip
  32. BIN
      dist250505.zip
  33. BIN
      dist250513.zip
  34. BIN
      dist250828.zip
  35. BIN
      disttmr250418.zip
  36. 1 0
      package.json
  37. 38 17
      public/index.html
  38. 268 234
      src/api/common.js
  39. BIN
      src/assets/images/jp1.jpg
  40. BIN
      src/assets/images/jp2.jpg
  41. 28 31
      src/dashboard/index.vue
  42. 196 134
      src/router/index.js
  43. 83 73
      src/store/modules/permission.js
  44. 126 125
      src/utils/request.js
  45. 33 2
      src/views/basicData/defaultParameter/function/index.vue
  46. 19 19
      src/views/basicData/defaultParameter/index2.vue
  47. 690 105
      src/views/basicData/feedTable/index.vue
  48. 670 623
      src/views/basicData/groupColumn/index.vue
  49. 77 10
      src/views/basicData/leftoverManagement/index.vue
  50. 48 47
      src/views/dashboard/pasture/index.vue
  51. 1585 606
      src/views/formulationPlan/dailyExecutionPlan/index.vue
  52. 1140 149
      src/views/formulationPlan/dhedFormula/index.vue
  53. 717 137
      src/views/formulationPlan/materialIssuancePlan/index.vue
  54. 6 1
      src/views/formulationPlan/pushMaterialPlan/index.vue
  55. 6274 0
      src/views/formulationPlan/recipeTemplate/index-copy.vue
  56. 845 133
      src/views/formulationPlan/recipeTemplate/index.vue
  57. 0 3547
      src/views/formulationPlan/recipeTemplate/indexhss.vue
  58. 2 2
      src/views/formulationPlan/surplusMaterialPlan/index.vue
  59. 1175 717
      src/views/shedProduction/dutyRecord/index.vue
  60. 1436 523
      src/views/shedProduction/materialRemainingRecord/index.vue
  61. 2745 634
      src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue
  62. 1 1
      src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue
  63. 16 8
      src/views/statisticalAnalysis/inventoryManagement/group/index.vue
  64. 45 8
      src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue
  65. 1177 537
      src/views/statisticalAnalysis/processAnalysis/group/index.vue
  66. 74 6
      src/views/statisticalAnalysis/processAnalysis/pasture/index.vue
  67. 4 0
      src/views/systemManagement/boardEchartManagement/index.vue

+ 11 - 5
.env.development

@@ -3,11 +3,17 @@ ENV = 'development'
 
 # base api
 # 测试线
-# VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
-VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+#VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+
 # 白少后台本地
-# VUE_APP_BASE_API = 'http://192.168.1.233/'
-# VUE_APP_BASE_API = 'http://192.168.1.93/'
+#VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+
+# 线上
+VUE_APP_BASE_API = 'http://127.0.0.1:8081/'
+
+线上
+#VUE_APP_BASE_API = 'http://127.0.0.1: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().
@@ -16,4 +22,4 @@ VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
 
 
-VUE_CLI_BABEL_TRANSPILE_MODULES = true
+VUE_CLI_BABEL_TRANSPILE_MODULES = true  

+ 1 - 1
.env.production

@@ -6,4 +6,4 @@ ENV = 'production'
 # VUE_APP_BASE_API = ':8081/'
 # VUE_APP_BASE_API = 'http://192.168.1.70:8088/'
 # VUE_APP_BASE_API = 'http://127.0.0.1:8081/'
-VUE_APP_BASE_API = '/'
+VUE_APP_BASE_API = '/'

BIN
dist-20250226-tmr-正式-80.zip


BIN
dist-250811.zip


BIN
dist-251125.zip


BIN
dist-251203.zip


BIN
dist-80-tmr-正式-20250225.zip


BIN
dist-tmr-0319.zip


BIN
dist-tmr-0328.zip


BIN
dist-tmr-20241225-正式.zip


BIN
dist-tmr-20250103-正式包.zip


BIN
dist-tmr-20250122-正式.zip


BIN
dist-tmr-20250310-2.zip


BIN
dist-tmr-20250310.zip


BIN
dist-tmr-20250325.zip


BIN
dist-tmr-20250326.zip


BIN
dist-tmr-20253019-全部.zip


BIN
dist-tmr-8081-20250319.zip


BIN
dist-tmr-正式-20241205.zip


BIN
dist-tmr-正式-20250114.zip


BIN
dist-tmr-正式-20250117.zip


BIN
dist-tmr-正式-20250212.zip


BIN
dist-tmr-正式-20250224.zip


BIN
dist-tmr-正式-20250318.zip


BIN
dist-tmr-正式-20250319.zip


BIN
dist-tmr-测试-20250107.zip



BIN
dist250408.zip


BIN
dist250409.zip


BIN
dist250424.zip


BIN
dist250427.zip


BIN
dist250505.zip


BIN
dist250513.zip


BIN
dist250828.zip


BIN
disttmr250418.zip


+ 1 - 0
package.json

@@ -27,6 +27,7 @@
     "fuse.js": "3.4.4",
     "js-cookie": "^2.2.0",
     "js-table2excel": "^1.0.3",
+    "jszip": "^3.10.1",
     "leaflet": "^1.9.4",
     "md5": "^2.3.0",
     "moment": "^2.24.0",

+ 38 - 17
public/index.html

@@ -1,24 +1,45 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+    <meta
+      name="viewport"
+      content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
+    />
     <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> -->
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= webpackConfig.name %></title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
+    <title><%= webpackConfig.name %></title>
+    <script>
+      var _hmt = _hmt || [];
+      (function () {
+        var hm = document.createElement("script");
+        hm.src = "https://hm.baidu.com/hm.js?897acab98cbea7f5c2754de8f2cd0f48";
+        var s = document.getElementsByTagName("script")[0];
+        s.parentNode.insertBefore(hm, s);
+        // 自动跟踪所有子域名
+        _hmt.push(["_setAutoPageview", true]);
+        _hmt.push(["_setDomain", ".kptyun.com"]); // 设置主域名
+      })();
+    </script>
+  </head>
+  <body>
+    <noscript>
+      <strong
+        >We're sorry but <%= webpackConfig.name %> doesn't work properly without
+        JavaScript enabled. Please enable it to continue.</strong
+      >
+    </noscript>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
   </body>
-  <script src="//api.tianditu.gov.cn/api?v=4.0&tk=dbb376d009d74e90490af79879f33ef5" type="text/javascript"></script>
+  <script
+    src="//api.tianditu.gov.cn/api?v=4.0&tk=dbb376d009d74e90490af79879f33ef5"
+    type="text/javascript"
+  ></script>
   <script src="//lbs.tianditu.gov.cn/js/lib/jquery/jquery-1.7.2.min.js"></script>
   <script src="//cdn.bootcss.com/d3/3.5.17/d3.js " charset="utf-8"></script>
   <script src="//lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/D3SvgOverlay.js"></script>
   <script src="//lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/CarTrack.js"></script>
   <!-- <script language="javascript" src="//api.tianditu.gov.cn/js/maps.js"></script> -->
-</html>
+</html>

+ 268 - 234
src/api/common.js

@@ -1,282 +1,292 @@
-import request from '@/utils/request'
-import parseTime from '@/utils/index.js'
+import request from "@/utils/request";
+import parseTime from "@/utils/index.js";
 
 export function checkDates(data) {
   return request({
-    url: '/authdata/checkDates',
-    method: 'post',
-    data
-  })
+    url: "/authdata/checkDates",
+    method: "post",
+    data,
+  });
 }
 
-
-
 export function GetDataByName(data) {
   return request({
-    url: '/authdata/GetDataByName',
-    method: 'post',
-    data
-  })
+    url: "/authdata/GetDataByName",
+    method: "post",
+    data,
+  });
 }
 
 export function SyncSCJH(data) {
   return request({
-    url: '/authdata/syncSCJH',
-    method: 'post',
-    data
-  })
+    url: "/authdata/syncSCJH",
+    method: "post",
+    data,
+  });
 }
 
-
 export function processAnalysist(data) {
   return request({
-    url: '/authdata/processAnalysist',
-    method: 'post',
-    data
-  })
+    url: "/authdata/processAnalysist",
+    method: "post",
+    data,
+  });
 }
 
 export function ExeSqlJiade(data) {
   return request({
-    url: '/authdata/exesql',
-    method: 'post',
-    data
-  })
+    url: "/authdata/exesql",
+    method: "post",
+    data,
+  });
 }
 export function dashboardListJiade(data) {
   return request({
-    url: '/authdata/Dashboards',
-    method: 'post',
-    data
-  })
+    url: "/authdata/Dashboards",
+    method: "post",
+    data,
+  });
 }
 export function updateDashboardJiade(data) {
   return request({
-    url: '/authdata/Updatedashboard',
-    method: 'post',
-    data
-  })
+    url: "/authdata/Updatedashboard",
+    method: "post",
+    data,
+  });
 }
 
 export function GetReportform(data) {
   return request({
-    url: '/authdata/GetReportform',
-    method: 'post',
+    url: "/authdata/GetReportform",
+    method: "post",
     timeout: 600000,
-    data
-  })
+    data,
+  });
 }
 export function requestbyname(data, requestname) {
   return request({
-    url: '/authdata/' + requestname,
-    method: 'post',
-    data
-  })
+    url: "/authdata/" + requestname,
+    method: "post",
+    data,
+  });
 }
 
 export function GetDataByNameXlsx(data) {
   return request({
-    url: '/authdata/GetDataByName',
-    method: 'post',
+    url: "/authdata/GetDataByName",
+    method: "post",
     data,
-    responseType: 'blob'
-  })
+    responseType: "blob",
+  });
 }
 
 export function GetDataByNames(data) {
   return request({
-    url: '/authdata/GetDataByNames',
-    method: 'post',
-    data
-  })
+    url: "/authdata/GetDataByNames",
+    method: "post",
+    data,
+  });
 }
 
 export function PostDataByName(data) {
   return request({
-    url: '/authdata/PostDataByName',
-    method: 'post',
-    data
-  })
+    url: "/authdata/PostDataByName",
+    method: "post",
+    data,
+  });
 }
 export function GetUpkeepPlan(data) {
   return request({
-    url: '/authdata/GetUpkeepPlan',
-    method: 'post',
-    data
-  })
+    url: "/authdata/GetUpkeepPlan",
+    method: "post",
+    data,
+  });
 }
 export function GetAccount(data) {
   return request({
-    url: '/authdata/GetAccount',
-    method: 'post',
+    url: "/authdata/GetAccount",
+    method: "post",
     timeout: 600000,
-    data
-  })
+    data,
+  });
 }
 
-
-export function postJson(url,data) {
+export function postJson(url, data) {
   return request({
     url: url,
-    method: 'post',
+    method: "post",
     timeout: 600000,
-    data
-  })
+    data,
+  });
 }
 
-export function postJson2(url,data) {
+export function postJson2(url, data) {
   return request({
     url: url,
-    method: 'post',
+    method: "post",
     timeout: 600000,
-    data
-  })
+    data,
+  });
 }
 
-export function getJson(url,data) {
+export function getJson(url, data) {
   return request({
     url: url + data,
-    method: 'get'
-  })
+    method: "get",
+  });
 }
 
-export function getData(url,data) {
+export function getData(url, data) {
   return request({
     url: url,
-    method: 'post',
+    method: "post",
     timeout: 600000,
-    data
-  })
+    data,
+  });
 }
 
 export function PostDataByNames(data) {
   return request({
-    url: '/authdata/PostDataByNames',
-    method: 'post',
-    data
-  })
+    url: "/authdata/PostDataByNames",
+    method: "post",
+    data,
+  });
 }
 
 export function ExecDataByConfig(data) {
   return request({
-    url: '/authdata/ExecDataByConfig',
-    method: 'post',
-    data
-  })
+    url: "/authdata/ExecDataByConfig",
+    method: "post",
+    data,
+  });
 }
 
 export function getDorm(data) {
   return request({
-    url: '/authdata/getDorm',
-    method: 'post',
+    url: "/authdata/getDorm",
+    method: "post",
     timeout: 6000000,
-    data
-  })
+    data,
+  });
 }
 
 export function removeimage(data) {
   return request({
-    url: '/authdata/removeimage',
-    method: 'post',
-    data
-  })
+    url: "/authdata/removeimage",
+    method: "post",
+    data,
+  });
 }
 
 export function getRecuData(data) {
   return request({
-    url: '/authdata/GetRecuDataByName',
-    method: 'post',
-    data
-  })
+    url: "/authdata/GetRecuDataByName",
+    method: "post",
+    data,
+  });
 }
 export function Autogeneration(data) {
   return request({
-    url: '/authdata/autogeneration',
-    method: 'post',
-    data
-  })
+    url: "/authdata/autogeneration",
+    method: "post",
+    data,
+  });
 }
 export function failproccess(data, notify) {
-  if (data.data.includes('Duplicate')) {
+  if (data.data.includes("Duplicate")) {
     notify({
-      title: '失败',
-      message: '不可以录入重复数据',
-      type: 'error',
-      duration: 2000
-    })
+      title: "失败",
+      message: "不可以录入重复数据",
+      type: "error",
+      duration: 2000,
+    });
   } else {
     notify({
-      title: '失败',
-      message: '数据存在错误,请校验好重新录入,不可以录入数据',
-      type: 'error',
-      duration: 2000
-    })
+      title: "失败",
+      message: "数据存在错误,请校验好重新录入,不可以录入数据",
+      type: "error",
+      duration: 2000,
+    });
   }
 }
 
 export function UpdateDataRelation(data) {
   return request({
-    url: '/authdata/UpdateDataRelation',
-    method: 'post',
-    data
-  })
+    url: "/authdata/UpdateDataRelation",
+    method: "post",
+    data,
+  });
 }
 
 export function transData(a, idStr, pidStr, chindrenStr) {
-  var r = []; var hash = {}; var id = idStr; var pid = pidStr; var children = chindrenStr; var i = 0; var j = 0; var len = a.length
+  var r = [];
+  var hash = {};
+  var id = idStr;
+  var pid = pidStr;
+  var children = chindrenStr;
+  var i = 0;
+  var j = 0;
+  var len = a.length;
   for (; i < len; i++) {
-    hash[a[i][id]] = a[i]
+    hash[a[i][id]] = a[i];
   }
   for (; j < len; j++) {
-    var aVal = a[j]; var hashVP = hash[aVal[pid]]
+    var aVal = a[j];
+    var hashVP = hash[aVal[pid]];
     if (hashVP) {
-      !hashVP[children] && (hashVP[children] = [])
-      hashVP[children].push(aVal)
+      !hashVP[children] && (hashVP[children] = []);
+      hashVP[children].push(aVal);
     } else {
-      r.push(aVal)
+      r.push(aVal);
     }
   }
-  return r
+  return r;
 }
 
 export function checkButtons(buttonsList, PermissionButtons) {
   // console.log(PermissionButtons)
   for (let i = 0; i < buttonsList.length; i++) {
     // if (buttonsList[i].path === PermissionButtons && buttonsList[i].menu_id && buttonsList[i].path) { // path不为空且menu_id不为空时返回true
-    if (buttonsList[i].path === PermissionButtons && buttonsList[i].editbutton === 1) { // path不为空且menu_id不为空时返回true
-      return true
+    if (
+      buttonsList[i].path === PermissionButtons &&
+      buttonsList[i].editbutton === 1
+    ) {
+      // path不为空且menu_id不为空时返回true
+      return true;
     }
   }
-  return false
+  return false;
 }
 
 export function formatJson(filterVal, jsonData) {
-  return jsonData.map(v =>
-    filterVal.map(j => {
-      if (j === 'timestamp') {
-        return parseTime(v[j])
+  return jsonData.map((v) =>
+    filterVal.map((j) => {
+      if (j === "timestamp") {
+        return parseTime(v[j]);
       } else {
-        return v[j]
+        return v[j];
       }
     })
-  )
+  );
 }
 
 export function DownloadExcel(data, filename) {
-  const content = data
-  const blob = new Blob([content])
-  const fileName = filename + '.xlsx'
-  if ('download' in document.createElement('a')) { // 非IE下载
-    const elink = document.createElement('a')
-    elink.download = fileName
-    elink.style.display = 'none'
-    elink.href = URL.createObjectURL(blob)
-    document.body.appendChild(elink)
-    elink.click()
-    URL.revokeObjectURL(elink.href) // 释放URL 对象
-    document.body.removeChild(elink)
-  } else { // IE10+下载
-    navigator.msSaveBlob(blob, fileName)
+  const content = data;
+  const blob = new Blob([content]);
+  const fileName = filename + ".xlsx";
+  if ("download" in document.createElement("a")) {
+    // 非IE下载
+    const elink = document.createElement("a");
+    elink.download = fileName;
+    elink.style.display = "none";
+    elink.href = URL.createObjectURL(blob);
+    document.body.appendChild(elink);
+    elink.click();
+    URL.revokeObjectURL(elink.href); // 释放URL 对象
+    document.body.removeChild(elink);
+  } else {
+    // IE10+下载
+    navigator.msSaveBlob(blob, fileName);
   }
 }
 // 取小数
@@ -285,32 +295,31 @@ export function DownloadExcel(data, filename) {
 //   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);
+  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 += '.';
+  var rs = s.indexOf(".");
+  if (rs < 0) {
+    if (n == 0) {
+      s = s;
+    } else {
+      s += ".";
     }
   }
-  for(var i = s.length - s.indexOf('.'); i <= n; i++){
+  for (var i = s.length - s.indexOf("."); i <= n; i++) {
     s += "0";
   }
   return s;
 }
 
-export function compareSort(property){
-  return function(a,b){
+export function compareSort(property) {
+  return function (a, b) {
     var value1 = a[property];
     var value2 = b[property];
     return value1 - value2;
-  }
+  };
 }
 
-
 //将日期转换成一年中的第几周
 export function getYearWeek(date) {
   //按照国际标准
@@ -377,7 +386,7 @@ export function getWeekStartAndEnd(count, currentDate) {
   resultArr.push(currentWeekLastDay.format());
   return resultArr;
 }
-Date.prototype.format = function() {
+Date.prototype.format = function () {
   let s = "";
   let mouth =
     this.getMonth() + 1 >= 10
@@ -401,12 +410,15 @@ export function addDays(date, num) {
 }
 
 export function yearDay(long) {
-  var time = new Date(long * 1000)
-  var year = time.getFullYear()
-  var month = (time.getMonth() + 1) < 10 ? '0' + (time.getMonth() + 1) : (time.getMonth() + 1)
-  var date = time.getDate() < 10 ? '0' + time.getDate() : time.getDate()
-  var yearday = { year, month, date }
-  return yearday
+  var time = new Date(long * 1000);
+  var year = time.getFullYear();
+  var month =
+    time.getMonth() + 1 < 10
+      ? "0" + (time.getMonth() + 1)
+      : time.getMonth() + 1;
+  var date = time.getDate() < 10 ? "0" + time.getDate() : time.getDate();
+  var yearday = { year, month, date };
+  return yearday;
 }
 
 // 计算一年中的每一周都是从几号到几号
@@ -417,84 +429,106 @@ export function yearDay(long) {
 // 12月31 日不论是周几,都算为本周的最后一天
 // 参数年份 ,函数返回一个数组,数组里的对象包含 这一周的开始日期和结束日期
 export function whichWeek(year) {
-      var d = new Date(year, 0, 1)
-      while (d.getDay() != 1) {
-        d.setDate(d.getDate() + 1)
-      }
-      const arr = []
-      const longnum = d.setDate(d.getDate())
-      if (longnum > +new Date(year, 0, 1)) {
-        const obj = yearDay(+new Date(year, 0, 1) / 1000)
-        obj.last = yearDay(longnum / 1000 - 86400)
-        arr.push(obj)
-      }
-      const oneitem = yearDay(longnum / 1000)
-      oneitem.last = yearDay(longnum / 1000 + 86400 * 6)
-      arr.push(oneitem)
-      var lastStr
-      for (var i = 0; i < 51; i++) {
-        const long = d.setDate(d.getDate() + 7)
-        const obj = yearDay(long / 1000)
-        obj.last = yearDay(long / 1000 + 86400 * 6)
-        lastStr = long + 86400000 * 6
-        arr.push(obj)
-      }
-      if (lastStr < +new Date(year + 1, 0, 1)) {
-        const obj = yearDay(lastStr / 1000 + 86400)
-        obj.last = yearDay(+new Date(year + 1, 0, 1) / 1000 - 86400)
-        arr.push(obj)
-      } else {
-        arr[arr.length - 1].last = yearDay(+new Date(year + 1, 0, 1) / 1000 - 86400)
-      }
-      return arr
-    }
+  var d = new Date(year, 0, 1);
+  while (d.getDay() != 1) {
+    d.setDate(d.getDate() + 1);
+  }
+  const arr = [];
+  const longnum = d.setDate(d.getDate());
+  if (longnum > +new Date(year, 0, 1)) {
+    const obj = yearDay(+new Date(year, 0, 1) / 1000);
+    obj.last = yearDay(longnum / 1000 - 86400);
+    arr.push(obj);
+  }
+  const oneitem = yearDay(longnum / 1000);
+  oneitem.last = yearDay(longnum / 1000 + 86400 * 6);
+  arr.push(oneitem);
+  var lastStr;
+  for (var i = 0; i < 51; i++) {
+    const long = d.setDate(d.getDate() + 7);
+    const obj = yearDay(long / 1000);
+    obj.last = yearDay(long / 1000 + 86400 * 6);
+    lastStr = long + 86400000 * 6;
+    arr.push(obj);
+  }
+  if (lastStr < +new Date(year + 1, 0, 1)) {
+    const obj = yearDay(lastStr / 1000 + 86400);
+    obj.last = yearDay(+new Date(year + 1, 0, 1) / 1000 - 86400);
+    arr.push(obj);
+  } else {
+    arr[arr.length - 1].last = yearDay(
+      +new Date(year + 1, 0, 1) / 1000 - 86400
+    );
+  }
+  return arr;
+}
 
+// 剩料新增
+export function addSurplus(data) {
+  return request({
+    headers: {
+      "Content-type": "application/json; charset=utf-8",
+    },
+    url: "/authdata/surplus/add",
+    method: "post",
+    data,
+  });
+}
 
+//剩料查询 authdata/surplus/list
 
-   // 剩料新增
-    export function addSurplus(data) {
-      return request({
-        headers: {
-          'Content-type': 'application/json; charset=utf-8'
-        },
-        url: '/authdata/surplus/add',
-        method: 'post',
-        data
-      })
-    }
+export function getSurplus(id) {
+  return request({
+    url: "/authdata/surplus/list?pastureId=" + id,
+    method: "get",
+  });
+}
 
-    //剩料查询 authdata/surplus/list
+// 删除剩料
 
-    export function getSurplus(id){
-      return request({
-        url: '/authdata/surplus/list?pastureId=' + id,
-        method: 'get'
-      })
-    }
+export function delSurplus(data) {
+  return request({
+    url: "/authdata/surplus/del",
+    method: "post",
+    data,
+  });
+}
 
-    // 删除剩料
+export function editWeightHL(data) {
+  return request({
+    url: "/authdata/planexec/edit",
+    method: "POST",
+    data,
+  });
+}
 
-    export function delSurplus(data){
-      return request({
-        url: '/authdata/surplus/del',
-        method: 'post',
-        data
-      })
-    }
+export function editWeightSL(data) {
+  return request({
+    url: "/authdata/plan2/edit",
+    method: "POST",
+    data,
+  });
+}
 
+export function getPastureData() {
+  return request({
+    url: "/admin/special/restartMqtt.html",
+    method: "POST",
+  });
+}
 
-export function editWeightHL(data) {
+export function processAnalysistDown(data) {
   return request({
-    url: '/authdata/planexec/edit',
-    method: 'POST',
-    data
-  })
+    url: "/authdata/process/excel",
+    method: "POST",
+    data,
+  });
 }
 
-export function editWeightSL(data) {
+export function getSapRoute(data) {
   return request({
-    url: '/authdata/plan2/edit',
-    method: 'POST',
-    data
-  })
-}
+    url: "/xdmy/sap/leftoverEntry",
+    method: "POST",
+    data,
+  });
+}

BIN
src/assets/images/jp1.jpg


BIN
src/assets/images/jp2.jpg


+ 28 - 31
src/dashboard/index.vue

@@ -1,32 +1,29 @@
-<template>
-  <div class="dashboard-container">
+<template>
+  <div class="dashboard-container">
     <component :is="currentRole" />
-    123
-  </div>
-</template>
-
-<script>
-import { mapGetters } from 'vuex'
-import adminDashboard from './admin'
-import editorDashboard from './editor'
-
-export default {
-  name: 'Dashboard',
-  components: { adminDashboard, editorDashboard },
-  data() {
-    return {
-      currentRole: 'adminDashboard'
-    }
-  },
-  computed: {
-    ...mapGetters([
-      'roles'
-    ])
-  },
-  created() {
-    if (!this.roles.includes('admin')) {
-      this.currentRole = 'editorDashboard'
-    }
-  }
-}
-</script>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import adminDashboard from "./admin";
+import editorDashboard from "./editor";
+
+export default {
+  name: "Dashboard",
+  components: { adminDashboard, editorDashboard },
+  data() {
+    return {
+      currentRole: "adminDashboard",
+    };
+  },
+  computed: {
+    ...mapGetters(["roles"]),
+  },
+  created() {
+    if (!this.roles.includes("admin")) {
+      this.currentRole = "editorDashboard";
+    }
+  },
+};
+</script>

+ 196 - 134
src/router/index.js

@@ -1,11 +1,18 @@
-import Vue from 'vue'
-import Router from 'vue-router'
+import Vue from "vue";
+import Router from "vue-router";
 
-
-Vue.use(Router)
+Vue.use(Router);
 
 /* Layout */
-import Layout from '@/layout'
+import Layout from "@/layout";
+// import router from "./router";
+
+// router.afterEach((to) => {
+//   // 百度统计:单页面应用手动上报页面访问
+//   if (window._hmt) {
+//     window._hmt.push(["_trackPageview", to.fullPath]);
+//   }
+// });
 
 /**
  * Note: sub-menu only appear when route children.length >= 1
@@ -31,149 +38,204 @@ import Layout from '@/layout'
  * a base page that does not have permission requirements
  * all roles can be accessed
  */
-export const constantRoutes = [
-  {
-    path: '/login',
-    component: () => import('@/views/login/index'),
-    hidden: true
-  },
-  {
-    path: '/404',
-    component: () => import('@/views/404'),
-    hidden: true
-  },
+export const constantRoutes = [{
+        path: "/login",
+        component: () =>
+            import ("@/views/login/index"),
+        hidden: true,
+    },
+    {
+        path: "/404",
+        component: () =>
+            import ("@/views/404"),
+        hidden: true,
+    },
 
-  {
-    path: '/',
-    component: Layout,
-    redirect: '/dashboard',
-    children: [{
-      path: 'dashboard',
-      name: 'Dashboard',
-      // component: () => import('@/views/dashboard/editor/index'),
-      component: () => import('@/views/dashboard/index'),
-      meta: { title: '首页', icon: '首页', affix: true }
-    }]
-  },
-  {
-    path: '/changpwd',
-    component: Layout,
-    redirect: '/changpwd',
-    children: [{
-      path: 'changpwd',
-      name: 'Changpwd',
-      component: () => import('@/views/changpwd/changpwd/index'),
-      meta: { title: '修改密码', icon: '修改密码', affix: false }
-    }]
-  },
-  // {
-  //   path: '/drawDot',
-  //   component: Layout,
-  //   redirect: '/drawDot',
-  //   children: [{
-  //     path: 'drawDot',
-  //     name: 'drawDot',
-  //     component: () => import('@/views/drawDot/index.vue'),
-  //     meta: { title: '画点图',icon: '撒料计划'}
-  //   }]
-  // },
-]
+    {
+        path: "/",
+        component: Layout,
+        redirect: "/dashboard",
+        children: [{
+            path: "dashboard",
+            name: "Dashboard",
+            // component: () => import('@/views/dashboard/editor/index'),
+            component: () =>
+                import ("@/views/dashboard/index"),
+            meta: { title: "首页", icon: "首页", affix: true },
+        }, ],
+    },
+    {
+        path: "/changpwd",
+        component: Layout,
+        redirect: "/changpwd",
+        children: [{
+            path: "changpwd",
+            name: "Changpwd",
+            component: () =>
+                import ("@/views/changpwd/changpwd/index"),
+            meta: { title: "修改密码", icon: "修改密码", affix: false },
+        }, ],
+    },
+    // {
+    //     path: "/Addboard",
+    //     component: Layout,
+    //     redirect: "/Addboard",
+    //     children: [{
+    //         path: "Addboard",
+    //         name: "Addboard",
+    //         component: () =>
+    //             import ("@/views/customboard/addboard/index"),
+    //         meta: { title: "123", icon: "" },
+    //     }, ],
+    // },
+    // {
+    //   path: "/leftoverUse",
+    //   component: Layout,
+    //   redirect: "/leftoverUse",
+    //   children: [
+    //     {
+    //       path: "leftoverUse",
+    //       name: "leftoverUse",
+    //       component: () => import("@/views/basicData/leftoverUse/index.vue"),
+    //       meta: { title: "剩料使用", icon: "撒料计划" },
+    //     },
+    //   ],
+    // },
+    // {
+    //   path: "/leftoverManagement",
+    //   component: Layout,
+    //   redirect: "/leftoverManagement",
+    //   children: [
+    //     {
+    //       path: "leftoverManagement",
+    //       name: "leftoverManagement",
+    //       component: () =>
+    //         import("@/views/basicData/leftoverManagement/index.vue"),
+    //       meta: { title: "剩料配置", icon: "撒料计划" },
+    //     },
+    //   ],
+    // },
+    // {
+    //   path: '/drawDot',
+    //   component: Layout,
+    //   redirect: '/drawDot',
+    //   children: [{
+    //     path: 'drawDot',
+    //     name: 'drawDot',
+    //     component: () => import('@/views/drawDot/index.vue'),
+    //     meta: { title: '画点图',icon: '撒料计划'}
+    //   }]
+    // },
+];
 
 /**
  * asyncRoutes
  * the routes that need to be dynamically loaded based on user roles
  */
-export const asyncRoutes = [
-  {
-    path: '/nested',
-    component: Layout,
-    redirect: '/nested/menu1',
-    name: 'Nested',
-    meta: {
-      title: 'Nested',
-      icon: 'nested'
+export const asyncRoutes = [{
+        path: "/nested",
+        component: Layout,
+        redirect: "/nested/menu1",
+        name: "Nested",
+        meta: {
+            title: "Nested",
+            icon: "nested",
+        },
+        children: [{
+                path: "menu1",
+                component: () =>
+                    import ("@/views/nested/menu1/index"), // Parent router-view
+                name: "Menu1",
+                meta: { title: "Menu1" },
+                children: [{
+                        path: "menu1-1",
+                        component: () =>
+                            import ("@/views/nested/menu1/menu1-1"),
+                        name: "Menu1-1",
+                        meta: { title: "Menu1-1" },
+                    },
+                    {
+                        path: "menu1-2",
+                        component: () =>
+                            import ("@/views/nested/menu1/menu1-2"),
+                        name: "Menu1-2",
+                        meta: { title: "Menu1-2" },
+                        children: [{
+                                path: "menu1-2-1",
+                                component: () =>
+                                    import ("@/views/nested/menu1/menu1-2/menu1-2-1"),
+                                name: "Menu1-2-1",
+                                meta: { title: "Menu1-2-1" },
+                            },
+                            {
+                                path: "menu1-2-2",
+                                component: () =>
+                                    import ("@/views/nested/menu1/menu1-2/menu1-2-2"),
+                                name: "Menu1-2-2",
+                                meta: { title: "Menu1-2-2" },
+                            },
+                        ],
+                    },
+                    {
+                        path: "menu1-3",
+                        component: () =>
+                            import ("@/views/nested/menu1/menu1-3"),
+                        name: "Menu1-3",
+                        meta: { title: "Menu1-3" },
+                    },
+                ],
+            },
+            {
+                path: "menu2",
+                component: () =>
+                    import ("@/views/nested/menu2/index"),
+                meta: { title: "menu2" },
+            },
+        ],
     },
-    children: [
-      {
-        path: 'menu1',
-        component: () => import('@/views/nested/menu1/index'), // Parent router-view
-        name: 'Menu1',
-        meta: { title: 'Menu1' },
-        children: [
-          {
-            path: 'menu1-1',
-            component: () => import('@/views/nested/menu1/menu1-1'),
-            name: 'Menu1-1',
-            meta: { title: 'Menu1-1' }
-          },
-          {
-            path: 'menu1-2',
-            component: () => import('@/views/nested/menu1/menu1-2'),
-            name: 'Menu1-2',
-            meta: { title: 'Menu1-2' },
-            children: [
-              {
-                path: 'menu1-2-1',
-                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
-                name: 'Menu1-2-1',
-                meta: { title: 'Menu1-2-1' }
-              },
-              {
-                path: 'menu1-2-2',
-                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
-                name: 'Menu1-2-2',
-                meta: { title: 'Menu1-2-2' }
-              }
-            ]
-          },
-          {
-            path: 'menu1-3',
-            component: () => import('@/views/nested/menu1/menu1-3'),
-            name: 'Menu1-3',
-            meta: { title: 'Menu1-3' }
-          }
-        ]
-      },
-      {
-        path: 'menu2',
-        component: () => import('@/views/nested/menu2/index'),
-        meta: { title: 'menu2' }
-      }
 
-    ]
-  },
+    {
+        path: "external-link",
+        component: Layout,
+        children: [{
+            path: "https://panjiachen.github.io/vue-element-admin-site/#/",
+            meta: { title: "External Link", icon: "link" },
+        }, ],
+    },
+    // 404 page must be placed at the end !!!
+    { path: "*", redirect: "/404", hidden: true },
+];
 
-  {
-    path: 'external-link',
-    component: Layout,
-    children: [
-      {
-        path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
-        meta: { title: 'External Link', icon: 'link' }
-      }
-    ]
-  },
-  // 404 page must be placed at the end !!!
-  { path: '*', redirect: '/404', hidden: true }
-]
+const createRouter = () =>
+    new Router({
+        // mode: 'history', // require service support
+        scrollBehavior: () => ({ y: 0 }),
+        routes: constantRoutes,
+    });
 
-const createRouter = () => new Router({
-  // mode: 'history', // require service support
-  scrollBehavior: () => ({ y: 0 }),
-  routes: constantRoutes
-})
+const router = createRouter();
 
-const router = createRouter()
+router.afterEach((to, from) => {
+    // 百度统计:单页面应用手动上报页面访问
+    console.log(window._hmt, "0");
+    if (window._hmt) {
+        console.log(window._hmt, "0->1");
+        const referrer = from.fullPath || "direct";
+        window._hmt.push(["_trackPageview", to.fullPath]);
+        window._hmt.push(["_trackEvent", "Navigation", "Referrer", referrer]);
+    }
+});
 
 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
 export function resetRouter() {
-  const newRouter = createRouter()
-  router.matcher = newRouter.matcher // reset router
+    const newRouter = createRouter();
+    router.matcher = newRouter.matcher; // reset router
 }
-const originalPush = Router.prototype.push
+const originalPush = Router.prototype.push;
 Router.prototype.push = function push(location, onResolve, onReject) {
-  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
-  return originalPush.call(this, location).catch(err => err)
-}
+    if (onResolve || onReject)
+        return originalPush.call(this, location, onResolve, onReject);
+    return originalPush.call(this, location).catch((err) => err);
+};
 
-export default router
+export default router;

+ 83 - 73
src/store/modules/permission.js

@@ -1,50 +1,55 @@
 // import { asyncRoutes, constantRoutes } from '@/router'
-import { constantRoutes } from '@/router'
-import { validatenull } from '@/utils/validate'
+import { constantRoutes } from "@/router";
+import { validatenull } from "@/utils/validate";
 // for get menus from server
 // import { getMenuByRole } from '@/api/menu'
-import { getRecuData,transData,GetDataByName } from '@/api/common'
-import Layout from '@/layout'
+import { getRecuData, transData, GetDataByName } from "@/api/common";
+import Layout from "@/layout";
 
 function buildRouter(aMenu) {
-  const aRouter = []
+  const aRouter = [];
 
-  aMenu.forEach(item => {
+  aMenu.forEach((item) => {
     if (!validatenull(item.component)) {
       const oRouter = {
-        meta: { 'title': '', 'icon': '' },
-        children: []
-      }
+        meta: { title: "", icon: "" },
+        children: [],
+      };
 
-      if (item.component !== 'Iframe') {
-        if (item.component === 'Layout') {
-          oRouter.component = Layout
+      if (item.component !== "Iframe") {
+        if (item.component === "Layout") {
+          oRouter.component = Layout;
         } else {
-          oRouter.component = require('@/views/' + item.component + '.vue').default
+          console.log("@/views/" + item.component + ".vue");
+          oRouter.component = require("@/views/" +
+            item.component +
+            ".vue").default;
         }
-          oRouter.name = item.path
-          oRouter.id = item.id || null
-        if (item.redirect !== '') {
-          oRouter.redirect = item.redirect || null
-          oRouter.path = '/' + item.path
+        oRouter.name = item.path;
+        oRouter.id = item.id || null;
+        if (item.redirect !== "") {
+          oRouter.redirect = item.redirect || null;
+          oRouter.path = "/" + item.path;
         } else {
-          oRouter.path = item.path
+          oRouter.path = item.path;
         }
         // console.log(item)
-        if(item.seebutton == 1 || item.seebutton == 2){
-          oRouter.meta.icon = item.icon
-          oRouter.meta.title = item.title
+        if (item.seebutton == 1 || item.seebutton == 2) {
+          oRouter.meta.icon = item.icon;
+          oRouter.meta.title = item.title;
           // oRouter.meta.noCache = item.noCache || false
-          oRouter.meta.noCache = true
+          oRouter.meta.noCache = true;
           // oRouter.meta.breadcrumb = item.breadcrumb || true
-          oRouter.children = validatenull(item.children) ? [] : buildRouter(item.children)
-          aRouter.push(oRouter)
+          oRouter.children = validatenull(item.children)
+            ? []
+            : buildRouter(item.children);
+          aRouter.push(oRouter);
         }
       }
     }
-  })
+  });
 
-  return aRouter
+  return aRouter;
 }
 
 /**
@@ -54,9 +59,9 @@ function buildRouter(aMenu) {
  */
 function hasPermission(roles, route) {
   if (route.meta && route.meta.roles) {
-    return roles.some(role => route.meta.roles.includes(role))
+    return roles.some((role) => route.meta.roles.includes(role));
   } else {
-    return true
+    return true;
   }
 }
 
@@ -66,92 +71,97 @@ function hasPermission(roles, route) {
  * @param roles
  */
 export function filterAsyncRoutes(routes, roles) {
-  const res = []
+  const res = [];
 
-  routes.forEach(route => {
-    const tmp = { ...route }
+  routes.forEach((route) => {
+    const tmp = { ...route };
     if (hasPermission(roles, tmp)) {
       if (tmp.children) {
-        tmp.children = filterAsyncRoutes(tmp.children, roles)
+        tmp.children = filterAsyncRoutes(tmp.children, roles);
       }
-      res.push(tmp)
+      res.push(tmp);
     }
-  })
+  });
 
-  return res
+  return res;
 }
 
 const state = {
   routes: [],
   addRoutes: [],
   data1: {
-    name: 'getmenu',
-    idname: 'id',
-    parammaps: { id: -1 }
-  }
-}
+    name: "getmenu",
+    idname: "id",
+    parammaps: { id: -1 },
+  },
+};
 
 const mutations = {
   SET_ROUTES: (state, routes) => {
     // console.log(state,routes)
-    state.addRoutes = routes
-    state.routes = constantRoutes.concat(routes)
-  }
-}
+    state.addRoutes = routes;
+    state.routes = constantRoutes.concat(routes);
+  },
+};
 
 const actions = {
   generateRoutes({ commit }, roles) {
     return new Promise((resolve, reject) => {
-      GetDataByName(state.data1).then(response => {
-        if(response.data.list !== null){
-          for(let i=0;i<response.data.list.length;i++){
-            response.data.list[i].affix = true
-            response.data.list[i].keepAlive = true
-            if(response.data.list[i].children !== undefined){
-              for(let j=0;j<response.data.list[i].children.length;j++){
-                response.data.list[i].children[j].affix = true
-                response.data.list[i].children[j].keepAlive = true
+      GetDataByName(state.data1).then((response) => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].affix = true;
+            response.data.list[i].keepAlive = true;
+            if (response.data.list[i].children !== undefined) {
+              for (let j = 0; j < response.data.list[i].children.length; j++) {
+                response.data.list[i].children[j].affix = true;
+                response.data.list[i].children[j].keepAlive = true;
               }
             }
           }
-          console.log(response.data.list,'==========9999')
+          console.log(response.data.list, "==========9999");
           // const arrRout = response.data.list.filter((item)=>{
           //     return item.component != 'basicDate/leftoverManagement/index'
           // })
-          const menus  = transData(response.data.list, 'id', 'parentId', 'children')
+          const menus = transData(
+            response.data.list,
+            "id",
+            "parentId",
+            "children"
+          );
           // const menus = response.data
           if (menus.length === 0) {
-            reject('menus data is null1')
+            reject("menus data is null1");
           }
-          const accessedRoutes = buildRouter(menus)
+          const accessedRoutes = buildRouter(menus);
           // final add 404
-          accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
+          accessedRoutes.push({ path: "*", redirect: "/404", hidden: true });
           // commit to stores
-          commit('SET_ROUTES', accessedRoutes)
+          commit("SET_ROUTES", accessedRoutes);
           // return for add to router
-          resolve(accessedRoutes)
+          resolve(accessedRoutes);
         } else {
-          const menus  = []
+          const menus = [];
           // const menus = response.data
           if (menus.length == 0) {
-            reject('当前用户角色未分配页面权限,无法登录')
+            reject("当前用户角色未分配页面权限,无法登录");
           }
-          const accessedRoutes = buildRouter(menus)
+          const accessedRoutes = buildRouter(menus);
           // final add 404
-          accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
+          accessedRoutes.push({ path: "*", redirect: "/404", hidden: true });
           // commit to stores
-          commit('SET_ROUTES', accessedRoutes)
+          commit("SET_ROUTES", accessedRoutes);
           // return for add to router
-          resolve(accessedRoutes)
+          resolve(accessedRoutes);
         }
-      })
-    })
-  }
-}
+      });
+    });
+  },
+};
 
 export default {
   namespaced: true,
   state,
   mutations,
-  actions
-}
+  actions,
+};

+ 126 - 125
src/utils/request.js

@@ -1,148 +1,149 @@
-import axios from 'axios'
-import { MessageBox, Message } from 'element-ui'
-import store from '@/store'
-import { getToken } from '@/utils/auth'
-import Cookies from 'js-cookie';
+import axios from "axios";
+import { MessageBox, Message } from "element-ui";
+import store from "@/store";
+import { getToken } from "@/utils/auth";
+import Cookies from "js-cookie";
 
 //获取当前url
 const DoMainString = document.querySelector("html").getAttribute("domain");
-var URL = process.env.VUE_APP_BASE_API
+var URL = process.env.VUE_APP_BASE_API;
 if (DoMainString) {
-  URL = DoMainString
+    URL = DoMainString;
 }
 
-var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
+var reg = /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
 var browserUrl = window.location.hostname
-console.log("========url===",reg.test(browserUrl))
-if (reg.test(browserUrl)){
-  // URL = window.location.protocol +"//"+ browserUrl + ":8082"
-  URL = window.location.protocol +"//"+ browserUrl + ":8082/"
+console.log("========url===", reg.test(browserUrl))
+if (reg.test(browserUrl)) {
+    // URL = window.location.protocol +"//"+ browserUrl + ":8082"
+    URL = window.location.protocol + "//" + browserUrl + ":80/"
 }
 
-Cookies.set('url',URL)
-console.log(process.env.VUE_APP_BASE_API,'===========URL1111')
-console.log(URL,'===========URL')
+Cookies.set("url", URL);
+console.log(process.env.VUE_APP_BASE_API, "===========URL1111");
+console.log(URL, "===========URL");
 
 const service = axios.create({
-  baseURL: URL, // url = base url + request url
-  withCredentials: true, // send cookies when cross-domain requests
-  timeout: 60000 ,// request timeout
-})
+    baseURL: URL, // url = base url + request url
+    withCredentials: true, // send cookies when cross-domain requests
+    timeout: 60000, // request timeout
+});
 // request interceptor
 service.interceptors.request.use(
-  config => {
-    // do something before request is sent
-    // config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'  //此处是增加的代码,设置请求头的类型
-    // debugger
-    if (process.env.VUE_APP_BASE_API !== '/dev-api') {
-      config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
-      config.withCredentials = false
-    }
-    // console.log(config,'config')
+    (config) => {
+        // do something before request is sent
+        // config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'  //此处是增加的代码,设置请求头的类型
+        // debugger
+        console.log(process.env.VUE_APP_BASE_API, "process.env.VUE_APP_BASE_API");
+        if (process.env.VUE_APP_BASE_API !== "/dev-api") {
+            config.headers["Content-Type"] = "application/json;charset=UTF-8";
+            config.withCredentials = false;
+        }
+        console.log(config, "config");
 
-    if (store.getters.token) {
-      // let each request carry token
-      // ['Authorization'] is a custom headers key
-      // please modify it according to the actual situation
-      if (process.env.VUE_APP_BASE_API === '/dev-api') {
-        config.headers['X-Token'] = getToken()
-      } else {
-        config.headers['token'] = getToken()
-      }
+        if (store.getters.token) {
+            // let each request carry token
+            // ['Authorization'] is a custom headers key
+            // please modify it according to the actual situation
+            if (process.env.VUE_APP_BASE_API === "/dev-api") {
+                config.headers["X-Token"] = getToken();
+            } else {
+                config.headers["token"] = getToken();
+            }
+        }
+        return config;
+    },
+    (error) => {
+        // do something with request error
+        console.log(error); // for debug
+        return Promise.reject(error);
     }
-    return config
-  },
-  error => {
-    // do something with request error
-    console.log(error) // for debug
-    return Promise.reject(error)
-  }
-)
+);
 
 // response interceptor
 service.interceptors.response.use(
-  /**
-   * If you want to get http information such as headers or status
-   * Please return  response => response
-  */
+    /**
+     * If you want to get http information such as headers or status
+     * Please return  response => response
+     */
 
-  /**
-   * Determine the request status by custom code
-   * Here is just an example
-   * You can also judge the status by HTTP Status Code
-   */
-  response => {
-    const res = response.data
+    /**
+     * Determine the request status by custom code
+     * Here is just an example
+     * You can also judge the status by HTTP Status Code
+     */
+    (response) => {
+        const res = response.data;
 
-    // if the custom code is not 20000, it is judged as an error.
-    if (res.code !== 200) {
-      Message({
-        // message: res.msg + res.code,
-        message: '请求超时',
-        type: 'error',
-        duration: 5 * 1000
-      })
+        // if the custom code is not 20000, it is judged as an error.
+        if (res.code !== 200) {
+            Message({
+                // message: res.msg + res.code,
+                message: "请求超时",
+                type: "error",
+                duration: 5 * 1000,
+            });
 
-      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
-      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
-        // to re-login
-        MessageBox.confirm('你已经注销登陆,你可以取消或重新登陆', '确认注销', {
-          confirmButtonText: '重新登陆',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          store.dispatch('user/resetToken').then(() => {
-            location.reload()
-          })
-        })
-      }
-      if (res.code === 20002) {
-        store.dispatch('user/resetToken').then(() => {
-          location.reload()
-        })
-      }
-      if (res.code === undefined) {
-        return res
-      } else {
-        return Promise.reject(new Error(res.message || 'Error'))
-      }
-    } else {
-      return res
-    }
-  },
-  error => {
-    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)
+            // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
+            if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
+                // to re-login
+                MessageBox.confirm("你已经注销登陆,你可以取消或重新登陆", "确认注销", {
+                    confirmButtonText: "重新登陆",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                }).then(() => {
+                    store.dispatch("user/resetToken").then(() => {
+                        location.reload();
+                    });
+                });
+            }
+            if (res.code === 20002) {
+                store.dispatch("user/resetToken").then(() => {
+                    location.reload();
+                });
+            }
+            if (res.code === undefined) {
+                return res;
+            } else {
+                return Promise.reject(new Error(res.message || "Error"));
+            }
+        } else {
+            return res;
+        }
+    },
+    (error) => {
+        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);
+        });
+        // Message({
+        //   message: error.message,
+        //   type: 'error',
+        //   duration: 5 * 1000
+        // })
+        // return Promise.reject(error)
     }
-    config.__retryCount += 1
-    let backoff = new Promise((resolve) => {
-      setTimeout(() => {
-        resolve()
-      }, config.retryDelay || 1000)
-    })
-    return backoff.then(() => {
-      return service(config)
-    })
-    // Message({
-    //   message: error.message,
-    //   type: 'error',
-    //   duration: 5 * 1000
-    // })
-    // return Promise.reject(error)
-  }
-)
+);
 
-export default service
+export default service;

+ 33 - 2
src/views/basicData/defaultParameter/function/index.vue

@@ -188,6 +188,31 @@
             <el-input ref="excess" v-model="createTemp.excess" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料编码:" type="text" />
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="预称重计划" prop="isConcentrate">
+              <el-select v-model="createTemp.isConcentrate" :disabled="isRoleEdit==false" filterable placeholder="预称重计划" class="filter-item" style="width:100%">
+                <el-option v-for="item in weightList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+           </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="TMR最大重量" prop="tmrOrVolume">
+              <el-select v-model="createTemp.tmrOrVolume" :disabled="isRoleEdit==false" filterable placeholder="TMR最大重量" class="filter-item" style="width:100%">
+                <el-option v-for="item in volumeList" :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="theoryOrPractice">
+              <el-select v-model="createTemp.theoryOrPractice" :disabled="isRoleEdit==false" filterable placeholder="用料分析统计方式" class="filter-item" style="width:100%">
+                <el-option v-for="item in dosageList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+           </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer" style="bottom: 10px;">
@@ -246,6 +271,9 @@ export default {
   name: 'DefaultParameter',
   data() {
     return {
+      weightList:[{ id: '0', name: '手动' }, { id: '1', name: '自动' }],
+      volumeList:[{ id: '0', name: 'TMR' }, { id: '1', name: '容积' }],
+      dosageList:[{ id: '0', name: '理论重量' }, { id: '1', name: '实际重量' }],
       isRoleEdit: [],
       planBeforeDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取前一天计划
       planNextDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取后一天计划
@@ -363,8 +391,11 @@ export default {
         tmrUpper:this.createTemp.tmrUpper,
         tmrUnder:this.createTemp.tmrUnder,
         yhfeedtemplet:this.createTemp.yhfeedtemplet,
-        yhautosecond:this.createTemp.yhautosecond,
-        excess:this.createTemp.excess
+        yhautosecond: this.createTemp.yhautosecond,
+        isConcentrate: this.createTemp.isConcentrate,
+        excess:this.createTemp.excess,
+        tmrOrVolume :this.createTemp.tmrOrVolume,
+        theoryOrPractice :this.createTemp.theoryOrPractice
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
         pastureid: this.createTemp.pastureid

+ 19 - 19
src/views/basicData/defaultParameter/index2.vue

@@ -1,4 +1,4 @@
-<template>
+<template>
   <div class="app-container">
     <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="250px" style="margin-top: 40px;margin-bottom:30px;">
       <el-row>
@@ -126,17 +126,17 @@
       <el-button v-if="isRoleEdit" class="success" :disabled="isokDisable" @click="handleSave">保存</el-button>
       <el-button v-if="isRoleEdit" class="warning" :disabled="isokDisable" @click="handleRecovery">恢复默认</el-button>
     </div>
-  </div>
-
-</template>
-
+  </div>
+
+</template>
+
 <script>
-import { GetDataByName, PostDataByName, GetDataByNames, failproccess, checkButtons, ExecDataByConfig } from '@/api/common'
+import { GetDataByName, PostDataByName, GetDataByNames, failproccess, checkButtons, ExecDataByConfig } from '@/api/common'
 import Cookies from 'js-cookie'
-import { MessageBox } from 'element-ui'
-export default {
-  name: 'DefaultParameter',
-  data() {
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'DefaultParameter',
+  data() {
     return {
       isRoleEdit: [],
       planBeforeDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取前一天计划
@@ -151,8 +151,8 @@ 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: '平均分配' }],
-      requestParams: [
-        { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+      requestParams: [
+        { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
       ],
       getdataListParm: {
         name: 'getysoptList',
@@ -171,14 +171,14 @@ export default {
       isokDisable: false,
       requestParam: {}
 
-    }
-  },
+    }
+  },
   created() {
     this.getList()
     this.getButtons()
     this.getDownList()
-  },
-
+  },
+
   methods: {
     getButtons() {
       const Edit = 'DefaultParameter'
@@ -274,9 +274,9 @@ export default {
         })
       })
     }
-  }
-}
+  }
+}
 </script>
 <style lang="scss" scoped>
 
-</style>
+</style>

Разница между файлами не показана из-за своего большого размера
+ 690 - 105
src/views/basicData/feedTable/index.vue


Разница между файлами не показана из-за своего большого размера
+ 670 - 623
src/views/basicData/groupColumn/index.vue


+ 77 - 10
src/views/basicData/leftoverManagement/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <div class="container">
+  <div class="container"> 
     <div class="header-box">
-      <p> 剩料计划</p>
+      <p> 剩料替代方案</p>
       <el-button type="primary" plain class="add-btn" @click="addBtn">新 增</el-button>
     </div>
 
@@ -24,7 +24,7 @@
         <el-table-column
           label="替代方案"
           prop="surplus"
-          width="180">
+          width="600">
         </el-table-column>
         <el-table-column label="操作">
           <template slot-scope="scope">
@@ -58,15 +58,45 @@
         :visible.sync="dialogVisible"
         width="30%"
        >
-        <div>
-          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-            <el-form-item label="替代方案" prop="surplus">
+       <!-- <div>
+        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+          <div style="display: flex; align-items: center;">
+            <el-radio v-model="radio" :label="''" style="margin-right: 10px;"></el-radio>
+            <el-form-item label="替代方案" prop="surplus" style="margin-bottom: 0;">
               <el-select v-model="ruleForm.surplus" placeholder="请选择替代方案" @change="getLeftObj">
                 <el-option v-for="item in leftList" :key="item.id" :label="item.fname" :value="item"></el-option>
               </el-select>
             </el-form-item>
-          </el-form>
-        </div>
+          </div>
+        </el-form>
+      </div> -->
+      <!-- <div class="checkbox-group">
+        <el-checkbox  class="circle-checkbox">日粮</el-checkbox>
+        <el-checkbox  class="circle-checkbox">选择替代的剥原料</el-checkbox>
+    </div> -->
+    <el-radio-group v-model="selectedOption">
+  <div class="radio-item">
+    <el-radio label="daily">日粮</el-radio>
+  </div>
+  <div class="radio-item">
+    <el-radio label="alternative">
+      选择替代的剥原料
+      <el-select
+        v-model="alternativeValue"
+        :disabled="selectedOption !== 'alternative'"
+        filterable
+        placeholder="请选择"
+      >
+        <el-option
+          v-for="item in feedList"
+          :key="item.id"
+          :label="item.fname"
+          :value="item.id"
+        />
+      </el-select>
+    </el-radio>
+  </div>
+</el-radio-group>
         <span slot="footer" class="dialog-footer">
           <el-button class="add-btn" @click="dialogVisible = false">取 消</el-button>
           <el-button class="add-btn" type="primary" @click="addLeftData()">确 定</el-button>
@@ -93,6 +123,9 @@
       return {
          pastureId:parseInt(Cookies.get('pastureid')),
          title:"",
+         selectedOption: "", 
+         alternativeValue:"",
+        feedList: [],
          leftgetParams:{ // 获取下拉剩料列表
           name: "getFeedData",          "page": 1,
           offset: 1,
@@ -103,6 +136,14 @@
           fname: ""
           }
         },
+        getFeedSurplusParm: {
+          name: "getFeedSurplus",
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid")
+          },
+       },
+  
         leftList:[],
         tableData: [],
         currentPage1: 1,
@@ -121,7 +162,8 @@
       }
     },
     created() {
-      this.getLeftoverData();
+      this.getFeedSurplus();
+      // this.getLeftoverData();
       this.getLeftTable();
     },
     methods: {
@@ -142,6 +184,16 @@
           feedId: ""
         };
       },
+      getFeedSurplus(){
+        GetDataByName(this.getFeedSurplusParm).then((response) => {
+          console.log("table数据", response.data.list);
+          if (response.data.list !== null) {
+            this.feedList = response.data.list;
+          } else {
+            this.feedList = [];
+          }
+        });
+    },
       // 获取下拉的数据
       getLeftObj(obj){
         this.ruleForm.feedId = obj.id;
@@ -156,6 +208,16 @@
 
       // 剩料新增
       async addLeftData(){
+        console.log(this.selectedOption)
+        console.log(this.alternativeValue)
+        if (this.selectedOption === 'daily'){
+          this.ruleForm.feedId = "0"
+          this.ruleForm.surplus = "日粮"
+        }else{
+          this.ruleForm.feedId = this.alternativeValue
+          // this.ruleForm.surplus =  this.selectedOption
+        }
+
         const { data }  = await addSurplus(this.ruleForm);
         if(data == true){
           this.$message({
@@ -239,4 +301,9 @@
       margin-top:20px;
     }
   }
-</style>
+
+/* 强制将复选框的方框改为圆形 */
+.circle-checkbox /deep/ .el-checkbox__inner {
+  border-radius: 50%;
+}
+</style>

+ 48 - 47
src/views/dashboard/pasture/index.vue

@@ -88,11 +88,11 @@
           <div class="title">
             <div class="img-title" />
             <span class="content">今日计划统计</span>
-          </div>
+          </div>
           <b style="margin-left: 20px;">统计类型:</b>
-          <el-select v-model="row2.value" size="mini" placeholder="请选择" style="width: 100px;" @change="changeType">
-            <el-option v-for="item in row2.typeList" :key="item.id" :label="item.name" :value="item.id" />
-          </el-select>
+          <el-select v-model="row2.value" size="mini" placeholder="请选择" style="width: 100px;" @change="changeType">
+            <el-option v-for="item in row2.typeList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <div class="todayPlan">
             <div>
               <div id="row2chartLine1" style="height: 185px;" v-loading="row1.listLoading" />
@@ -450,8 +450,8 @@ export default {
         listLoading: true,
         list: ''
       },
-      row2: {
-        value:0,
+      row2: {
+        value:0,
         typeList:[{id:0,name:'全部'},{id:1,name:'固定式'},{id:2,name:'抛料车'}],
         chart1: {
           chartLine: null,
@@ -706,7 +706,7 @@ export default {
       that.row4.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
     },
     getList() {
-      this.row1.listLoading = true
+      this.row1.listLoading = true
       this.row1.getdataListParm.parammaps.lpplantype = this.row2.value
       GetDataByName(this.row1.getdataListParm).then(response => {
         if (response.data !== null && response.data.list !== null) {
@@ -745,9 +745,9 @@ export default {
           this.row1.listLoading = false
         }, 100)
       })
-    },
-    changeType(){
-      this.getList()
+    },
+    changeType(){
+      this.getList()
     },
     // 今日计划统计-完成车次
     roadChartLine1(chartLine_data) {
@@ -821,6 +821,7 @@ export default {
       this.row2.chart2.chartLine.setOption(option)
       if (this.row2.chart2.chartLine != null) {
         window.onresize = function() {
+        // console.log(this.row2.chart2.chartLine,"88888888888888888888888888888");
           this.row2.chart2.chartLine.resize()
         }
       }
@@ -887,39 +888,39 @@ export default {
         color: ['#ff0000', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
         grid: {
           bottom: '10%'
-        },
-        legend: [{
-          itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
-          data: [{ name: '设计重量' }, { name: '实际重量'  }]
-        }, {
-          itemWidth: 5, itemHeight: 5, right: '0', textStyle: { fontSize: 12 },
-          data: [
-            { name: '开始重量' },
-            { name: '结束重量' }
-          ]
+        },
+        legend: [{
+          itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
+          data: [{ name: '设计重量' }, { name: '实际重量'  }]
+        }, {
+          itemWidth: 5, itemHeight: 5, right: '0', textStyle: { fontSize: 12 },
+          data: [
+            { name: '开始重量' },
+            { name: '结束重量' }
+          ]
         }],
-        tooltip: {
-          trigger: 'axis',
-          formatter: function(params) {
-            // console.log(params, 'params')
-            var tip = params[0].name
-            for (let i = 0; i < params.length; i++) {
-              if (params[i].seriesName == '设计重量') {
-                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
-              }
-              if (params[i].seriesName == '实际重量') {
-                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
-              }
-              if (params[i].seriesName == '开始重量') {
-                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
-              }
-              if (params[i].seriesName == '结束重量') {
-                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1] + '<br>' + params[i].value[2] + params[i].value[3]
-              }
-            }
-            return tip
-          }
-        },
+        tooltip: {
+          trigger: 'axis',
+          formatter: function(params) {
+            // console.log(params, 'params')
+            var tip = params[0].name
+            for (let i = 0; i < params.length; i++) {
+              if (params[i].seriesName == '设计重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
+              }
+              if (params[i].seriesName == '实际重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
+              }
+              if (params[i].seriesName == '开始重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
+              }
+              if (params[i].seriesName == '结束重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1] + '<br>' + params[i].value[2] + params[i].value[3]
+              }
+            }
+            return tip
+          }
+        },
         calculable: true,
         yAxis: [
           { type: 'value', name: '重量(kg)', splitLine: { show: false }, axisLabel: { show: true, textStyle: { color: '#666' }}}
@@ -941,7 +942,7 @@ export default {
         series: [
           { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#ff0000' ,width:2}}}},
           { symbol: 'none', name: '设计重量', type: 'line',  data: chartLine_data.data2, itemStyle: { normal: { lineStyle: {  width:2}}}},
-          { name: '开始重量', symbolSize: 6, type: 'scatter', data: chartLine_data.data4 },
+          { name: '开始重量', symbolSize: 6, type: 'scatter', data: chartLine_data.data4 },
           { name: '结束重量', symbolSize: 6, type: 'scatter', data: chartLine_data.data5 }
         ]
       }
@@ -1114,8 +1115,8 @@ export default {
       this.row3.chart1.listLoading = true
       GetReportform(this.row3.chart1.getdataListParm).then(response => {
         if (response.data !== null && response.data.list !== null) {
-          console.log('计划统计数据', response.data.list)
-          if(response.data.data){
+          console.log('计划统计数据', response.data.list)
+          if(response.data.data){
             for (let i = 0; i < response.data.data.length; i++) {
               if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
                 response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
@@ -1342,8 +1343,8 @@ export default {
       this.row4.chart2.listLoading = true
       GetReportform(this.row4.chart2.getdataListParm).then(response => {
         if (response.data !== null && response.data.list !== null) {
-          console.log('混料实际重量统计数据', response.data.data)
-          if(response.data.data){
+          console.log('混料实际重量统计数据', response.data.data)
+          if(response.data.data){
             for (let i = 0; i < response.data.data.length; i++) {
               if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
                 response.data.data[i].field1 = parseFloat(response.data.data[i].field1)

Разница между файлами не показана из-за своего большого размера
+ 1585 - 606
src/views/formulationPlan/dailyExecutionPlan/index.vue


Разница между файлами не показана из-за своего большого размера
+ 1140 - 149
src/views/formulationPlan/dhedFormula/index.vue


Разница между файлами не показана из-за своего большого размера
+ 717 - 137
src/views/formulationPlan/materialIssuancePlan/index.vue


+ 6 - 1
src/views/formulationPlan/pushMaterialPlan/index.vue

@@ -182,7 +182,12 @@ export default {
           pastureid: Cookies.get('pastureid'),eqtype:'1'
         }
       }
-      postJson(url,data).then(response => {
+      postJson(url, data, {
+         headers: {
+          'Content-Type': 'application/json',
+            type:'true'
+         }
+      }).then(response => {
         if (response.data.list !== null) {
           this.tmrList = response.data.list
         } else {

+ 6274 - 0
src/views/formulationPlan/recipeTemplate/index-copy.vue

@@ -0,0 +1,6274 @@
+<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.source"
+            filterable
+            placeholder="来源"
+            class="filter-item"
+            style="width: 120px"
+            clearable
+          >
+            <el-option
+              v-for="item in sourceList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </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 />
+              <!-- <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="form_search"
+                    >搜索</el-button
+                  >
+                </div>
+              </li>
+            </ul>
+          </div>
+          <el-button class="successBorder" @click="form_search">查询</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 && ispalyUd"
+            class="success"
+            icon="el-icon-plus"
+            @click="handleGetUd"
+            >配方上传</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="容重(kg/m³)"
+              min-width="110px"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.volume }}</span>
+                <el-input
+                  v-if="scope.row.Edit"
+                  v-model.trim="scope.row.volume"
+                  type="number"
+                  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 && !isproportion"
+                />
+              </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="130px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.cattleName }}</span>
+                <el-select
+                  v-if="scope.row.Edit"
+                  v-model="scope.row.cattle"
+                  filterable
+                  placeholder="牛群类别"
+                  class="filter-item"
+                  style="width: 95%; padding: 10px 0"
+                >
+                  <el-option
+                    v-for="item in distCattle"
+                    :key="item.value"
+                    :label="item.distName"
+                    :value="item.distCode"
+                  />
+                </el-select>
+              </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"
+                  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="跳转重量域(kg)"
+              min-width="85px"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.autozone }}</span>
+                <el-input
+                  v-if="scope.row.Edit"
+                  v-model="scope.row.autozone"
+                  type="textarea"
+                  :disabled="scope.row.fttype !== '预混配方'"
+                  :autosize="{ minRows: 1.3, maxRows: 4 }"
+                  style="width: 95%; padding: 10px 0"
+                />
+              </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.surplus }}</span>
+                <el-select
+                  v-if="scope.row.id && scope.row.Edit"
+                  v-model="scope.row.surplusId"
+                  filterable
+                  clearable
+                  placeholder="替代方案"
+                  class="filter-item"
+                  style="width: 95%; padding: 10px 0"
+                  @change="(val) => handlegetSurplus(val, scope.row)"
+                >
+                  <el-option
+                    v-for="item in tableData"
+                    :key="item.id"
+                    :label="item.surplus"
+                    :value="item.id"
+                  />
+                </el-select>
+              </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"
+                  :disabled="row.is_modify !== 1"
+                  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
+          style="
+            line-height: 25px;
+            border-bottom: 1px solid #000;
+            margin-bottom: 10px;
+            font-size: 16px;
+            font-weight: 600;
+          "
+        >
+          <span :style="{ color: table2.getdataListParm.parammaps.tcolor }"
+            >配方名称:{{ table2.getdataListParm.parammaps.tname }}</span
+          ><span style="margin: 0 60px"
+            >牲畜类别:{{ table2.getdataListParm.parammaps.ccname }}</span
+          ><span>配方类型:{{ table2.getdataListParm.parammaps.fttype }}</span>
+        </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="form_delete2"
+            >删除</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="form_search2"
+                    >搜索</el-button
+                  >
+                </div>
+              </li>
+            </ul>
+          </div>
+          <el-button class="successBorder" @click="form_search2"
+            >查询</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 class="operation">
+          <el-button
+            v-if="isRoleEdit && !isproportion"
+            class="successBorder"
+            @click="handle_batchEdit"
+            >批量编辑</el-button
+          >
+          <el-button
+            v-if="isRoleEdit && isproportion"
+            icon="el-icon-folder-checked"
+            class="success"
+            @click="handle_batchEdit_save"
+            >保存</el-button
+          >
+          <el-button
+            v-if="isRoleEdit && isproportion"
+            icon="el-icon-close"
+            class="sortCancel"
+            @click="cancelChangeEdit"
+            >取消</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 && !isproportion">{{
+                  scope.row.fname
+                }}</span>
+                <el-select
+                  v-if="scope.row.Edit || isproportion"
+                  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 && !isproportion">{{
+                  scope.row.fweight
+                }}</span>
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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"
+            >
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit && !isproportion">{{
+                  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> -->
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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 && !isproportion">{{
+                  scope.row.deviation
+                }}</span>
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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"
+            >
+              <template slot-scope="scope">
+                <span
+                  v-if="
+                    scope.row.NoEdit &&
+                    !isproportion &&
+                    !isproportion &&
+                    scope.row.islockcount == '0'
+                  "
+                  >否</span
+                >
+                <span
+                  v-if="
+                    scope.row.NoEdit &&
+                    !isproportion &&
+                    !isproportion &&
+                    scope.row.islockcount == '1'
+                  "
+                  >是</span
+                >
+                <el-select
+                  v-if="scope.row.Edit || isproportion"
+                  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">
+                <el-switch
+                  v-model="scope.row.shutdown"
+                  :disabled="
+                    scope.row.NoEdit && !isproportion && !isproportion == true
+                  "
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  :active-value="1"
+                  :inactive-value="0"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="顺序" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit && !isproportion">{{
+                  scope.row.sort
+                }}</span>
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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"
+                  :disabled="isproportion"
+                  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="序号11"
+              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 && !isproportion">{{
+                  scope.row.fname
+                }}</span>
+                <el-select
+                  v-if="scope.row.Edit || isproportion"
+                  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 && !isproportion">{{
+                  scope.row.fweight
+                }}</span>
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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"
+            >
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit && !isproportion">{{
+                  scope.row.autosecond
+                }}</span>
+                <el-select
+                  v-if="scope.row.Edit || isproportion"
+                  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
+              label="允许延时偏差(min)"
+              min-width="80px"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit && !isproportion">{{
+                  scope.row.deviation
+                }}</span>
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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 label="加料前停机" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <el-switch
+                  v-model="scope.row.shutdown"
+                  :disabled="scope.row.NoEdit && !isproportion == true"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  :active-value="1"
+                  :inactive-value="0"
+                />
+              </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 &&
+                    !isproportion &&
+                    scope.row.islockcount == '0'
+                  "
+                  >否</span
+                >
+                <span
+                  v-if="
+                    scope.row.NoEdit &&
+                    !isproportion &&
+                    scope.row.islockcount == '1'
+                  "
+                  >是</span
+                >
+                <el-select
+                  v-if="scope.row.Edit || isproportion"
+                  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 && !isproportion">{{
+                  scope.row.sort
+                }}</span>
+                <el-input
+                  v-if="scope.row.Edit || isproportion"
+                  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"
+                  :disabled="isproportion"
+                  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="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>
+
+          <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="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">
+              <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"
+              style="margin-left: 10px"
+              >查询</el-button
+            >
+            <el-button
+              class="successBorder"
+              @click="handleDialogRefresh"
+              style="margin-left: 10px"
+              >重置</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="容重(kg/m³)"
+              min-width="130px"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.volume"
+                  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-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="修改用户"
+              width="130px"
+              align="center"
+              prop="empname"
+            />
+            <el-table-column
+              label="饲料名称(单位:kg)"
+              min-width="800px"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <div
+                  v-for="element in scope.row.arrList"
+                  :key="element.name"
+                  class="list-group-item2 item"
+                  style="
+                    width: 150px;
+                    float: left;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    white-space: nowrap;
+                    margin: 5px 5px;
+                    padding: 0;
+                    height: 30px;
+                  "
+                >
+                  <el-tooltip
+                    v-if="element.change == 'red'"
+                    placement="top"
+                    :open-delay="1000"
+                  >
+                    <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" :open-delay="1000">
+                    <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,
+  getSurplus,
+} 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 {
+      isproportion: false,
+      oldList: [],
+      tableData: [],
+      chooseTableData: [],
+      dialogFull: false,
+      predefineColors: [
+        "#E57373",
+        "#F06292",
+        "#BA68C8",
+        "#9575CD",
+        "#7986CB",
+        "#64B5F6",
+        "#4FC3F7",
+        "#4DD0E1",
+        "#4DB6AC",
+        "#81C784",
+        "#AED581",
+        "#DCE775",
+        "#FFF176",
+        "#FFD54F",
+        "#FFB74D",
+        "#FF8A65",
+        "#A1887F",
+        "#E0E0E0",
+        "#90A4AE",
+      ],
+      isRoleEdit: [],
+      myheight: document.documentElement.clientHeight - 265,
+      requestParams: [
+        {
+          name: "getCowclassList",
+          page: 1,
+          offset: 1,
+          pagecount: 50,
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+            classname: "",
+            parentname: "",
+            enable: 1,
+          },
+        },
+        // { 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") },
+        },
+        { name: "getDistCattle", offset: 0, pagecount: 0, parammaps: {} },
+      ],
+      distCattle: [], //牛群类别
+      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" },
+      ], // 请选择历史记录时间
+      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: "1",
+            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: {},
+      requestParam3: {},
+      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,
+      ispalyUd: 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: "" },
+      },
+      sourceList: [
+        { id: "0", name: "自定义" },
+        { id: "1", name: "集团下发未调整" },
+        { id: "2", name: "集团下发有调整" },
+        { id: "3", name: "导入" },
+      ],
+    };
+  },
+  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 Cookies.get("url") + "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.getIspalyUd();
+    this.getList();
+    this.getButtons();
+    this.getDownList();
+    this.getIsLockCount();
+    this.getLeftTable();
+  },
+  methods: {
+    handle_batchEdit() {
+      this.isproportion = true;
+      this.oldList = JSON.parse(JSON.stringify(this.table2.list));
+      this.table2.list.forEach((item, key) => {
+        item.Edit = false;
+        item.NoEdit = true;
+        item.isUpdate = true;
+        item.isUpdateSave = false;
+        item.groupEdit = false;
+      });
+    },
+    cancelChangeEdit() {
+      // 取消顺序
+      this.form_search2();
+      this.isproportion = false;
+    },
+    SaveEdit() {
+      const arr = this.table2.list.filter((item2) => {
+        return !this.oldList.some(
+          (item1) =>
+            item1.id == item2.id &&
+            item1.fname == item2.fname &&
+            item1.fweight === item2.fweight &&
+            item1.autosecondname === item2.autosecondname &&
+            item1.islockcount === item2.islockcount &&
+            item1.sort === item2.sort &&
+            item1.deviation == item2.deviation
+        );
+      });
+      console.log(arr, "arr");
+      const barList = [];
+      arr.forEach((item) => {
+        let obj = {};
+        obj.fname = item.fname;
+        obj.fweight = item.fweight;
+        obj.autosecondname = item.autosecondname;
+        obj.islockcount = item.islockcount;
+        obj.sort = item.sort;
+        obj.deviation = item.deviation;
+        barList.push(obj);
+      });
+      console.log(barList, "barList");
+      let dateTime = parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
+      this.requestParam.common = { returnmap: "0" };
+      this.requestParam.createdate = dateTime;
+      this.requestParam.userId = Cookies.get("employeid");
+      this.requestParam.data = [];
+      if (Array.isArray(barList)) {
+        this.requestParam.data = barList.reduce((acc, currentRow) => {
+          const newData = this.c(currentRow);
+          newData.forEach((item, index) => {
+            // 使用Vue.set确保响应式更新[1,2](@ref)
+            this.$set(acc, acc.length + index, item);
+          });
+          return acc;
+        }, []);
+      }
+      console.log(this.requestParam.data, "this.requestParam");
+      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,
+          });
+        }
+      });
+    },
+    handle_batchEdit_save() {
+      console.log(this.oldList, "oldList");
+      console.log(this.table2.list, "this.table2.list");
+      this.SaveEdit();
+    },
+
+    // 获取替代方案的名字
+    handlegetSurplus(id, row) {
+      const arr = this.tableData.filter((item) => {
+        if (item.id == id) return item;
+      });
+      row.surplus = (arr.length && arr[0].surplus) || "";
+      row.surplusId = (arr.length && arr[0].id) || 0;
+      console.log(row, "hsss");
+    },
+    // 点击编辑的时候 获取当前配方下的饲料数组
+    // 把剩料的数组和 配方下的进行比较 相同的值则可选择,不同的则只能禁止掉
+    handleChooseLeftOver(row) {
+      this.table2.getdataListParm.parammaps.tcolor = row.tcolor;
+      this.table2.getdataListParm.parammaps.tname = row.tname;
+      this.table2.getdataListParm.parammaps.ccname = row.ccname;
+      this.table2.getdataListParm.parammaps.fttype = row.fttype;
+      this.table2.getdataListParm.parammaps.ftid = row.id;
+      this.table2.getdataListParm.parammaps.fttypeid = row.fttypeid;
+      this.table2.getdataListParm.parammaps.dryweight = row.dryweight;
+      GetDataByName(this.table2.getdataListParm).then((res) => {
+        const { data } = res;
+
+        let ids = [];
+        if (data.list && data.list.length) {
+          ids = data.list.map((item) => {
+            return item.fid;
+          });
+        } else {
+          ids = [];
+        }
+        console.log(ids, this.chooseTableData, "饲料-----");
+        const arr = this.chooseTableData.filter((item) => {
+          if (ids.includes(item.feedId) || item.surplus == "日粮") {
+            return item;
+          }
+        });
+        console.log(ids, arr, "hss----");
+        this.tableData = arr;
+      });
+    },
+    async getLeftTable() {
+      const { data } = await getSurplus(Cookies.get("pastureid"));
+      this.chooseTableData = JSON.parse(JSON.stringify(data));
+      this.tableData = data;
+    },
+    getButtons() {
+      const Edit = "RecipeTemplate";
+      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(4) +
+              "(干物质量:" +
+              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.livestockTypeList = response.data.getCowclassList.list;
+        for (var i = 0; i < this.livestockTypeList.length; i++) {
+          this.livestockTypeList[i].label = this.livestockTypeList[i].classname;
+          this.livestockTypeList[i].value = this.livestockTypeList[i].id;
+        }
+        this.formulaTypeList = response.data.getDictByName2.list;
+        this.feedNameList = response.data.getFeedAndPre.list;
+        this.distCattle = response.data.getDistCattle.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);
+      });
+    },
+    form_search() {
+      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 = "1";
+      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,
+        autozone: 0,
+        tname: "",
+        tcode: "",
+        tcolor: "#ccc",
+        ccid: "",
+        ccname: "",
+        fttype: "",
+        fttypeid: "",
+        volume: "",
+        source: "自定义",
+        remark: "",
+        cattle: "",
+      });
+      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.surplusId = row.surplusId
+      if (this.table.temp.volume == "" || this.table.temp.volume == null) {
+        this.table.temp.volume = 0;
+      }
+      if (
+        isNaN(this.table.temp.autozone) ||
+        this.table.temp.autozone == "" ||
+        this.table.temp.autozone == undefined
+      ) {
+        this.table.temp.autozone = 0;
+      }
+      this.table.temp.volume = parseFloat(row.volume);
+      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;
+      console.log(this.requestParam2, "this.requestParam2");
+      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.table.temp.cattle =
+        this.table.temp.cattle == "" ? 0 : this.table.temp.cattle;
+      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();
+          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)) {
+            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) {
+      console.log("点击编辑了");
+
+      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;
+      this.handleChooseLeftOver(row);
+      console.log(row, "当前数据", this.table.temp);
+    },
+    updateData(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;
+      this.table.temp.cattle = row.cattle;
+      this.table.temp.autozone = row.autozone;
+
+      this.table.temp.surplusId = row.surplusId;
+      this.table.temp.surplus = row.surplus;
+      if (
+        this.table.temp.volume == "" ||
+        this.table.temp.volume == null ||
+        this.table.temp.volume == undefined
+      ) {
+        this.table.temp.volume = 0;
+      }
+      if (
+        isNaN(this.table.temp.autozone) ||
+        this.table.temp.autozone == "" ||
+        this.table.temp.autozone == undefined
+      ) {
+        this.table.temp.autozone = 0;
+      }
+      this.table.temp.volume = parseFloat(row.volume);
+      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 = {};
+      this.requestParam2.name = "checkNumber";
+      this.requestParam2.parammaps = {};
+      this.requestParam2.parammaps.number = this.table.temp.tcode;
+      console.log("点击了编辑保存-------——————", row, this.table.temp);
+      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 = {};
+      this.requestParam.name = "updateFT";
+      if (
+        this.table.temp.volume == "" ||
+        this.table.temp.volume == null ||
+        this.table.temp.volume == undefined ||
+        isNaN(this.table.temp.volume)
+      ) {
+        this.table.temp.volume = 0;
+      }
+      console.log(this.table.temp.volume, "----");
+      if (
+        isNaN(this.table.temp.autozone) ||
+        this.table.temp.autozone == "" ||
+        this.table.temp.autozone == undefined
+      ) {
+        this.table.temp.autozone = 0;
+      }
+      console.log(this.table.temp, "hss");
+      if (!this.table.temp.surplusId) {
+        this.table.temp.surplusId = 0;
+        this.table.temp.surplus = "";
+      }
+      this.requestParam.parammaps = this.table.temp;
+      PostDataByName(this.requestParam).then((response) => {
+        console.log("新增保存发送参数", this.requestParam);
+        if (response.msg !== "fail") {
+          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}"
+          );
+          this.requestParam3.parammaps.userId = Cookies.get("employeid");
+          PostDataByName(this.requestParam3).then((response) => {
+            console.log("新增保存发送参数", this.requestParam);
+            if (response.msg !== "fail") {
+              this.$notify({
+                title: "成功",
+                message: "保存成功",
+                type: "success",
+                duration: 2000,
+              });
+              this.table.temp.surplusId = "";
+              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)) {
+            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(() => {
+          const url = "authdata/feedtemplet/del";
+          const data = {
+            ftId: row.id,
+            userId: Cookies.get("employeid"),
+          };
+          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.getList();
+              this.isDetail = false;
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({ type: "info", message: "已取消删除" });
+        });
+    },
+    handleSelectionChange(val) {
+      console.log("勾选数据", val);
+      this.selectList = val;
+    },
+    form_delete() {
+      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 =
+          Cookies.get("url") +
+          "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.tcolor = row.tcolor;
+          this.table2.getdataListParm.parammaps.tname = row.tname;
+          this.table2.getdataListParm.parammaps.ccname = row.ccname;
+          this.table2.getdataListParm.parammaps.fttype = row.fttype;
+          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 - 230;
+          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;
+    },
+    form_search2() {
+      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",
+        deviation: "0",
+        islockcount: "0",
+        sort: mysort,
+        shutdown: "0",
+      });
+      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;
+      this.table2.temp.deviation = row.deviation;
+      this.table2.temp.shutdown = row.shutdown;
+      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.table2.temp.deviation === ""
+      ) {
+        this.$message({
+          type: "error",
+          message: "重量/搅拌延时/允许延时偏差不能为空",
+          duration: 2000,
+        });
+        return false;
+      } 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 === "") {
+        this.$message({
+          type: "error",
+          message: "重量不能为空",
+          duration: 2000,
+        });
+        return false;
+      } 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;
+      } 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.temp.shutdown == "") {
+        this.table2.temp.shutdown = 0;
+      }
+      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, 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,
+        });
+        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.userId = Cookies.get("employeid");
+      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,
+          deviation: row.deviation,
+          shutdown: this.table2.temp.shutdown,
+        },
+      };
+      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: dateTime,
+          slid: 0,
+          fid: row.fid,
+          autosecond: row.autosecond,
+          userId: Cookies.get("employeid"),
+        },
+      };
+      this.requestParam.data[4] = {
+        name: "insertFTHistory",
+        type: "e",
+        parammaps: {
+          id: this.table2.getdataListParm.parammaps.ftid,
+          createdate: dateTime,
+          userId: Cookies.get("employeid"),
+        },
+      };
+      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: '保存成功', 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("hssssssss");
+      console.log("详情编辑", row);
+      this.dropState = true;
+      row.isGroupDisabled = false;
+      row.islockcount = String(row.islockcount);
+      row.fid = String(row.fid);
+      // 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 = [];
+      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);
+    //   console.log(row.autosecond, "======");
+    //   if (
+    //     row.autosecond == null ||
+    //     row.autosecond == undefined ||
+    //     isNaN(row.autosecond)
+    //   ) {
+    //     row.autosecond = "0";
+    //   }
+    //   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.deviation = row.deviation;
+    //   this.table2.temp.shutdown = row.shutdown;
+    //   this.table2.temp.id = row.id;
+    //   console.log("this.table2.updateList", this.table2.updateList);
+    //   console.log("temp", this.table2.temp);
+
+    //   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.table2.temp.deviation === ""
+    //   ) {
+    //     this.$message({
+    //       type: "error",
+    //       message: "重量/搅拌延时/允许延时偏差不能为空",
+    //       duration: 2000,
+    //     });
+    //     return false;
+    //   } 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 === "") {
+    //     this.$message({
+    //       type: "error",
+    //       message: "重量不能为空",
+    //       duration: 2000,
+    //     });
+    //     return false;
+    //   } 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.shutdown == "") {
+    //     this.table2.temp.shutdown = 0;
+    //   }
+    //   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, 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,
+    //     });
+    //     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.userId = Cookies.get("employeid");
+    //   // 处理数组数据
+    //   if (Array.isArray(row)) {
+    //     this.requestParam.data = row.reduce((acc, currentRow) => {
+    //       const newData = this.generateRequestData(currentRow);
+    //       newData.forEach((item, index) => {
+    //         // 使用Vue.set确保响应式更新[1,2](@ref)
+    //         this.$set(acc, acc.length + index, item);
+    //       });
+    //       return acc;
+    //     }, []);
+    //   } else {
+    //     // 处理单条数据
+    //     this.requestParam.data = this.generateRequestData(row);
+    //   }
+    //   console.log(this.requestParam.data, "this.requestParam.data");
+    //   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,
+    //       });
+    //     }
+    //   });
+    // },
+
+    // generateRequestData(row) {
+    //   return [
+    //     {
+    //       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,
+    //         autosecond: row.autosecond,
+    //         userId: Cookies.get("employeid"),
+    //       },
+    //     },
+    //     {
+    //       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,
+    //         deviation: row.deviation,
+    //         shutdown: this.table2.temp.shutdown,
+    //       },
+    //     },
+    //     {
+    //       name: "updateFPbyFTChange",
+    //       type: "e",
+    //       parammaps: {
+    //         pastureid: row.pastureid,
+    //         ftid: this.table2.getdataListParm.parammaps.ftid,
+    //         type: this.table2.getdataListParm.parammaps.fttypeid,
+    //         // status: status
+    //       },
+    //     },
+    //     {
+    //       name: "updateFTdetailbySort",
+    //       type: "e",
+    //       parammaps: {
+    //         pastureid: row.pastureid,
+    //         ftid: this.table2.getdataListParm.parammaps.ftid,
+    //         sort: row.sort,
+    //         feedgroup: row.feedgroup,
+    //       },
+    //     },
+    //     {
+    //       name: "updateFTdetailGroup",
+    //       type: "e",
+    //       parammaps: {
+    //         pastureid: this.table2.getdataListParm.parammaps.pastureid,
+    //         ftid: this.table2.getdataListParm.parammaps.ftid,
+    //       },
+    //     },
+    //     {
+    //       name: "insertFTHistory",
+    //       type: "e",
+    //       parammaps: {
+    //         id: this.table2.getdataListParm.parammaps.ftid,
+    //         createdate: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}"),
+    //         userId: Cookies.get("employeid"),
+    //       },
+    //     },
+    //   ];
+    // },
+
+    ////////////////////
+    updateData2(row) {
+      console.log("点击了详情编辑保存", row);
+      this.isokDisable = true;
+      setTimeout(() => {
+        this.isokDisable = false;
+      }, 1000);
+      // 统一处理输入为数组
+      const rows = Array.isArray(row) ? row : [row];
+      // 预处理校验数据
+      const validationPromises = rows.map(async (currentRow, index) => {
+        try {
+          await this.validateRow(currentRow, index);
+          return this.processSingleRow(currentRow);
+        } catch (error) {
+          this.$message.error(error.message || "校验失败");
+          throw error; // 中断后续处理
+        }
+      });
+      // 执行批量处理
+      Promise.all(validationPromises)
+        .then((results) => {
+          this.buildRequestData(results);
+          this.sendRequest();
+        })
+        .catch(() => {
+          this.requestParam.data = []; // 清空无效数据
+        });
+    },
+    // 单独校验逻辑
+    validateRow(row, index) {
+      return new Promise((resolve, reject) => {
+        // 核心校验逻辑(与原逻辑保持一致)
+        if (!row.fid) return reject("饲料名称不能为空");
+        if (!row.fweight || parseFloat(row.fweight) <= 0) {
+          return reject("重量请输入正数,最多保留四位小数");
+        }
+        if (parseFloat(row.deviation) > parseFloat(row.autosecond)) {
+          return reject("允许延时偏差不可超出搅拌延时");
+        }
+        // 特殊校验处理
+        if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
+          if (parseInt(row.preftid) > 0) {
+            return reject("饲料名称不能选择预混配方");
+          }
+        }
+        // 格式化处理
+        row.fweight = formatNum(row.fweight, 4);
+        row.sort = row.sort || this.getNextSortValue();
+        resolve(row);
+      });
+    },
+    // 单条数据处理
+    processSingleRow(row) {
+      const baseParam = {
+        pastureid: row.pastureid,
+        ftid: this.table2.getdataListParm.parammaps.ftid,
+        userId: Cookies.get("employeid"),
+        createdate: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}"),
+      };
+
+      return [
+        this.buildFitHistory(row, baseParam),
+        this.buildUpdateFTdetail(row, baseParam),
+        this.buildUpdateFPbyFTChange(baseParam),
+        this.buildUpdateFTdetailbySort(baseParam),
+        this.buildUpdateFTdetailGroup(baseParam),
+        this.buildInsertFTHistory(baseParam),
+      ];
+    },
+    // 构建具体请求对象(示例)
+    buildFitHistory(row, baseParam) {
+      return {
+        name: "insertFitHistory",
+        type: "e",
+        parammaps: {
+          ...baseParam,
+          weight: String(row.fweight),
+          preftid: this.table2.temp.preftid,
+          slid: this.table2.temp.id,
+          fid: row.fid,
+          autosecond: row.autosecond,
+        },
+      };
+    },
+    buildUpdateFTdetail(row, baseParam) {
+      return {
+        name: "updateFTdetail",
+        type: "e",
+        parammaps: {
+          ...baseParam,
+          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,
+          deviation: row.deviation,
+          shutdown: this.table2.temp.shutdown,
+        },
+      };
+    },
+    buildUpdateFPbyFTChange(row, baseParam) {
+      return {
+        name: "updateFPbyFTChange",
+        type: "e",
+        parammaps: {
+          ...baseParam,
+          type: this.table2.getdataListParm.parammaps.fttypeid,
+        },
+      };
+    },
+    buildUpdateFTdetailbySort(row, baseParam) {
+      return {
+        name: "updateFTdetailbySort",
+        type: "e",
+        parammaps: {
+          ...baseParam,
+          sort: row.sort,
+          feedgroup: row.feedgroup,
+        },
+      };
+    },
+    buildUpdateFTdetailGroup(row, baseParam) {
+      return {
+        name: "updateFTdetailGroup",
+        type: "e",
+        parammaps: {
+          ...baseParam,
+        },
+      };
+    },
+    buildInsertFTHistory(row, baseParam) {
+      return {
+        name: "insertFTHistory",
+        type: "e",
+        parammaps: {
+          ...baseParam,
+          id: this.table2.getdataListParm.parammaps.ftid,
+        },
+      };
+    },
+
+    // 发送请求
+    sendRequest() {
+      const url = "authdata/ftdetail/edit";
+      postJson(url, this.requestParam).then((response) => {
+        if (response.msg !== "fail") {
+          this.$notify.success({ message: "保存成功" });
+          this.getList2();
+          this.getList3();
+          this.dropState = false;
+          this.isproportion = false;
+        } else {
+          this.$notify.warning({ message: response.data });
+        }
+      });
+    },
+
+    // 获取下一个排序值
+    getNextSortValue() {
+      const lastItem = this.table2.list[this.table2.list.length - 1];
+      return lastItem ? parseInt(lastItem.sort) + 1 : 1;
+    },
+    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);
+          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}"),
+                slid: row.id,
+                fid: row.fid,
+                autosecond: row.autosecond,
+                userId: Cookies.get("employeid"),
+              },
+            };
+            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,
+              },
+            };
+            this.requestParam.data[4] = {
+              name: "insertFTHistory",
+              type: "e",
+              parammaps: {
+                id: this.table2.getdataListParm.parammaps.ftid,
+                createdate: dateTime,
+                userId: Cookies.get("employeid"),
+              },
+            };
+          } else {
+            this.requestParam.common = { returnmap: "0" };
+            this.requestParam.createdate = dateTime;
+            this.requestParam.userId = Cookies.get("employeid");
+            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: dateTime,
+                slid: row.id,
+                fid: row.fid,
+                autosecond: row.autosecond,
+                userId: Cookies.get("employeid"),
+              },
+            };
+            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,
+              },
+            };
+            this.requestParam.data[4] = {
+              name: "insertFTHistory",
+              type: "e",
+              parammaps: {
+                id: this.table2.getdataListParm.parammaps.ftid,
+                createdate: dateTime,
+                userId: Cookies.get("employeid"),
+              },
+            };
+          }
+          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: "已取消删除" });
+        });
+    },
+    handleSelectionChange2(val) {
+      console.log("勾选数据", val);
+      this.selectList2 = val;
+    },
+    celldblclick(row, column, cell, event) {
+      console.log(row, "=====");
+      this.handleUpdate2(row);
+    },
+    form_delete2() {
+      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);
+          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.userId = Cookies.get("employeid");
+            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: dateTime,
+                slid: "@insertSpotList.id",
+                fid: "@insertSpotList.fid",
+                autosecond: "@insertSpotList.autosecond",
+                userId: Cookies.get("employeid"),
+              },
+            };
+            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,
+              },
+            };
+            this.requestParam.data[2] = {
+              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,
+              },
+            };
+            this.requestParam.data[3] = {
+              name: "insertFTHistory",
+              type: "e",
+              parammaps: {
+                id: this.table2.getdataListParm.parammaps.ftid,
+                createdate: dateTime,
+                userId: Cookies.get("employeid"),
+              },
+            };
+            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,
+                    });
+                  }
+                });
+              }
+            });
+          }
+        });
+      }
+    },
+
+    // 拆分预混料
+    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,
+                        volume: "",
+                      },
+                    ];
+                    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,
+                      volume: "",
+                    },
+                  ];
+                  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,
+                    volume: "",
+                  },
+                ];
+                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,
+                volume: "",
+              },
+            ];
+            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",
+            shutdown: "0",
+            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,
+            volume: this.detail.list2[0].volume,
+          },
+        };
+        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",
+            shutdown: "@insertSpotList.shutdown",
+          },
+        };
+        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",
+            shutdown: "0",
+            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 = "";
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({
+          type: "error",
+          message: "请选择车次信息",
+          duration: 2000,
+        });
+      } else {
+        MessageBox.confirm(
+          "当前选中" + this.selectList.length + "条信息,是否生效?",
+          {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          }
+        ).then(() => {
+          let ids = [];
+          for (let i = 0; i < this.selectList.length; i++) {
+            ids.push(this.selectList[i].id);
+          }
+          var data = {};
+          data.parammaps = {};
+          data.parammaps.enable = 1;
+          data.parammaps.id = ids.toString();
+          var url = "authdata/feedtemplet/enable";
+          postJson(url, data).then((response) => {
+            console.log("生效保存发送参数", data);
+            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(() => {
+          let ids = [];
+          for (let i = 0; i < this.selectList.length; i++) {
+            ids.push(this.selectList[i].id);
+          }
+          var data = {};
+          data.parammaps = {};
+          data.parammaps.enable = 0;
+          data.parammaps.id = ids.toString();
+          console.log("禁用", data);
+          var url = "authdata/feedtemplet/enable";
+          postJson(url, data).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();
+            }
+          });
+        });
+      }
+    },
+    getIspalyUd() {
+      let url = "authdata/GetDataByName";
+      let data = {
+        name: "getSysoptEnable",
+        page: 1,
+        offset: 1,
+        pagecount: 1,
+        returntype: "Map",
+        parammaps: {
+          pastureid: Cookies.get("pastureid"),
+          inforname: "gmUdSync",
+        },
+      };
+      postJson(url, data).then((response) => {
+        if (response.msg !== "fail") {
+          if (response.data.list[0].inforvalue == 0) {
+            this.ispalyUd = false;
+          } else {
+            this.ispalyUd = true;
+          }
+        } else {
+          this.$notify({
+            title: "请求失败",
+            message: response.data,
+            type: "warning",
+            duration: 2000,
+          });
+        }
+      });
+    },
+    handleGetUd() {
+      MessageBox.confirm("是否上传配方?", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        let url = "authdata/gm/udfeedtemplet/push";
+        let data = {
+          pastureId: Cookies.get("pastureid"),
+        };
+        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,
+            });
+          }
+        });
+      });
+    },
+  },
+};
+</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, 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>

Разница между файлами не показана из-за своего большого размера
+ 845 - 133
src/views/formulationPlan/recipeTemplate/index.vue


+ 0 - 3547
src/views/formulationPlan/recipeTemplate/indexhss.vue

@@ -1,3547 +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.source" filterable placeholder="来源" class="filter-item" style="width: 120px;" clearable>
-            <el-option v-for="item in sourceList" :key="item.id" :label="item.name" :value="item.id" />
-          </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 />
-              <!-- <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="form_search">搜索</el-button>
-                </div>
-              </li>
-            </ul>
-          </div>
-          <el-button class="successBorder" @click="form_search">查询</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 && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd">配方上传</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="容重(kg/m³)" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.volume }}</span>
-                <el-input v-if="scope.row.Edit" v-model.trim="scope.row.volume" type="number" 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="130px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.cattleName }}</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.cattle" filterable placeholder="牛群类别" class="filter-item" style="width:95%;padding:10px 0;">
-                  <el-option v-for="item in distCattle" :key="item.value" :label="item.distName" :value="item.distCode" />
-                </el-select>
-              </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="跳转重量域(kg)" min-width="85px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.NoEdit">{{ scope.row.autozone }}</span>
-                <el-input v-if="scope.row.Edit" v-model="scope.row.autozone" type="textarea" :disabled="scope.row.fttype !=='预混配方'" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" />
-              </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>
-              </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" :disabled="row.is_modify !== 1"  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 style="line-height: 25px;border-bottom: 1px solid #000;margin-bottom: 10px;font-size:16px; font-weight: 600;">
-            <span :style="{color: table2.getdataListParm.parammaps.tcolor}">配方名称:{{table2.getdataListParm.parammaps.tname }}</span><span style="margin: 0 60px;">牲畜类别:{{table2.getdataListParm.parammaps.ccname}}</span><span>配方类型:{{table2.getdataListParm.parammaps.fttype}}</span>
-          </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="form_delete2">删除</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="form_search2">搜索</el-button>
-                </div>
-              </li>
-            </ul>
-          </div>
-          <el-button class="successBorder" @click="form_search2">查询</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.0001" 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> -->
-                <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">
-              <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">
-                <el-switch v-model="scope.row.shutdown" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"  />
-              </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="序号11" 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="重量123(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.0001" 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>
-            <!-- TODO: -->
-            <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 label="加料前停机" min-width="70px" align="center">
-              <template slot-scope="scope">
-                <el-switch v-model="scope.row.shutdown" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"  />
-              </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="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>
-
-          <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="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">
-              <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" style="margin-left:10px;">查询</el-button>
-            <el-button class="successBorder" @click="handleDialogRefresh" style="margin-left:10px;">重置</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="容重(kg/m³)" min-width="130px" align="center">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.volume"  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-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="修改用户" width="130px" align="center" prop="empname" />
-            <el-table-column label="饲料名称(单位:kg)" min-width="800px" align="center">
-              <template slot-scope="scope">
-                <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item" style="width:150px;float: left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin: 5px 5px;padding: 0;height: 30px;">
-                  <el-tooltip v-if="element.change== 'red'" placement="top" :open-delay="1000">
-                    <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" :open-delay="1000">
-                    <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: document.documentElement.clientHeight - 265,
-      requestParams: [
-        {"name":"getCowclassList","page":1,"offset":1,"pagecount":50,"returntype":"Map","parammaps":{"pastureid":Cookies.get('pastureid'),"classname":"","parentname":"","enable":1}},
-        // { 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') }},
-        { name: 'getDistCattle', offset: 0, pagecount: 0, parammaps: {}}
-      ],
-      distCattle:[],//牛群类别
-      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' }], // 请选择历史记录时间
-      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: '1',
-            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: {},
-      requestParam3:{},
-      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,
-      ispalyUd: 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: '' }
-      },
-      sourceList: [{ id: '0', name: '自定义' }, { id: '1', name: '集团下发未调整' }, { id: '2', name: '集团下发有调整' }, { id: '3', name: '导入' }]
-    }
-  },
-  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 Cookies.get('url') + '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.getIspalyUd()
-    this.getList()
-    this.getButtons()
-    this.getDownList()
-    this.getIsLockCount()
-  },
-  methods: {
-    getButtons() {
-      const Edit = 'RecipeTemplate'
-      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(4) + '(干物质量:' + 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.livestockTypeList = response.data.getCowclassList.list
-        for(var i=0;i<this.livestockTypeList.length;i++){
-        	this.livestockTypeList[i].label = this.livestockTypeList[i].classname;
-        	this.livestockTypeList[i].value = this.livestockTypeList[i].id;
-        }
-        this.formulaTypeList = response.data.getDictByName2.list
-        this.feedNameList = response.data.getFeedAndPre.list
-        this.distCattle = response.data.getDistCattle.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)
-      })
-    },
-    form_search() {
-      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 = '1'
-      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,'autozone':0, 'tname': '', tcode: '', 'tcolor': '#ccc', 'ccid': '', 'ccname': '', 'fttype': '', 'fttypeid': '','volume':'', 'source': '自定义', 'remark': '','cattle':'' })
-      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
-      if(this.table.temp.volume == '' || this.table.temp.volume == null){
-        this.table.temp.volume = 0
-      }
-      if( isNaN(this.table.temp.autozone) || this.table.temp.autozone == '' || this.table.temp.autozone == undefined){
-        this.table.temp.autozone = 0
-      }
-      this.table.temp.volume = parseFloat(row.volume)
-      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()
-          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)) {
-            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
-      this.table.temp.cattle = row.cattle
-      this.table.temp.autozone = row.autozone
-      if(this.table.temp.volume == '' || this.table.temp.volume == null || this.table.temp.volume == undefined){
-        this.table.temp.volume = 0
-      }
-      if( isNaN(this.table.temp.autozone) || this.table.temp.autozone == '' || this.table.temp.autozone == undefined){
-        this.table.temp.autozone = 0
-      }
-      this.table.temp.volume = parseFloat(row.volume)
-      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 = {}
-      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 = {}
-      this.requestParam.name = 'updateFT'
-      if(this.table.temp.volume == '' || this.table.temp.volume == null || this.table.temp.volume == undefined  ||  isNaN(this.table.temp.volume)){
-        this.table.temp.volume = 0
-      }
-      console.log( this.table.temp.volume,'----')
-      if( isNaN(this.table.temp.autozone) || this.table.temp.autozone == '' || this.table.temp.autozone == undefined){
-        this.table.temp.autozone = 0
-      }
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          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}')
-          this.requestParam3.parammaps.userId = Cookies.get('employeid')
-          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)) {
-            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(() => {
-        console.log(this.table2.list.length)
-        const tabelList= JSON.parse(JSON.stringify(this.table2.list));
-        const List =this.sortObjectsById(tabelList);
-        if(List && List.length>=2 && List[0].id == row.id && List[1].shutdown == 1){
-            this.$message({ type: 'error', message: '需要把后面排序:第一个的‘加料前停机’改为关掉', duration: 3000 })
-            return false;
-          }
-
-        const url = 'authdata/feedtemplet/del'
-        const data = {
-          ftId:row.id,
-          userId:Cookies.get('employeid')
-        }
-        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.getList()
-            this.isDetail = false
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    handleSelectionChange(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    form_delete() {
-      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 = Cookies.get('url') + '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.tcolor = row.tcolor
-          this.table2.getdataListParm.parammaps.tname = row.tname
-          this.table2.getdataListParm.parammaps.ccname = row.ccname
-          this.table2.getdataListParm.parammaps.fttype = row.fttype
-          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 - 230
-          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
-    },
-    form_search2() {
-      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','deviation':'0','islockcount': '0', 'sort': mysort,'shutdown':'0' })
-      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
-      this.table2.temp.deviation = row.deviation
-      this.table2.temp.shutdown = row.shutdown
-      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.table2.temp.deviation === '') {
-        this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
-        return false
-      } 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
-      }
-      // TODO: 临时去掉限制重量
-      // 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
-      } 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
-      } 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.temp.shutdown == '') {
-        this.table2.temp.shutdown = 0
-      }
-      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, 4) // 根据默认参数设置小数位数
-      row.fweight = formatNum(row.fweight, 4)
-      // return
-      // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
-
-      //TODO:
-      // if (this.table2.temp.fweight == 0) {
-      //   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.userId = Cookies.get('employeid')
-      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,
-        deviation: row.deviation,
-        shutdown:  this.table2.temp.shutdown,
-      }}
-      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: dateTime,
-        slid: 0,
-        fid: row.fid,
-        autosecond: row.autosecond,
-        userId: Cookies.get('employeid')
-      }}
-      this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
-        id:this.table2.getdataListParm.parammaps.ftid,
-        createdate:dateTime,
-        userId: Cookies.get('employeid')
-      }}
-      const url = 'authdata/ftdetail/edit'
-      const data = this.requestParam;
-      const tabelList= JSON.parse(JSON.stringify(this.table2.list));
-      const List =this.sortObjectsById(tabelList);
-      if(List && List.length>0 && List[0].shutdown == 1){
-        this.$message({ type: 'error', message: '顺序第一个词料,需要把‘加料前停机’改为关掉', duration: 3000 })
-        return false;
-              //   this.$confirm('第一个词料,需要把‘加料前停机’改为关掉, 是否继续?', '提示', {
-              //   confirmButtonText: '确定',
-              //   cancelButtonText: '取消',
-              //   type: 'warning'
-              // }).then(() => {
-              //   data.data[1].parammaps.shutdown = 0;
-              //   console.log(data,'传的数据---hss');
-              //   this.postTableDate(url,data)
-              // }).catch(() => {
-              //   return false;
-              // });
-        }
-        this.postTableDate(url,data)
-
-    },
-    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)
-      row.autosecond = row.autosecond
-      row.deviation = row.deviation
-      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)
-          console.log(row.autosecond,'======')
-          if(row.autosecond == null || row.autosecond == undefined || isNaN(row.autosecond)){
-            row.autosecond = '0'
-          }
-          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.deviation = row.deviation
-          this.table2.temp.shutdown = row.shutdown
-          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.table2.temp.deviation === '') {
-            this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
-            return false
-          } 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.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
-          }
-          //TODO:
-          //  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
-          } 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.shutdown == '') {
-            this.table2.temp.shutdown = 0
-          }
-          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, 4) // 根据默认参数设置小数位数
-          row.fweight = formatNum(row.fweight, 4)
-          // 检验重量>0
-          // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
-          //TODO:
-          // if (this.table2.temp.fweight == 0) {
-          //   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.userId = Cookies.get('employeid')
-          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: dateTime,
-            slid: this.table2.temp.id,
-            fid: row.fid,
-            autosecond: row.autosecond,
-            userId: Cookies.get('employeid')
-          }}
-          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,
-            deviation:row.deviation,
-            shutdown: this.table2.temp.shutdown,
-          }}
-          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
-          }}
-          this.requestParam.data[5] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
-            id:this.table2.getdataListParm.parammaps.ftid,
-            createdate:dateTime,
-            userId: Cookies.get('employeid')
-          }}
-          const url = 'authdata/ftdetail/edit'
-          const data = this.requestParam;
-          // TODO: 如果排序为1 或者当前数组中只有当前一个新增的值  只能默认当前加料前停机为0
-          // 当用户修改顺序时,把列表进行判断,如果是第一个值,若当前加料前停机状态为开启,则提示用户
-          // 当前加料前停机状态为开,需要关闭才能排序,否就不操作,确认则发给后端
-          const tabelList= JSON.parse(JSON.stringify(this.table2.list));
-          console.log(tabelList,'获取当前数据--hssss')
-          const List =this.sortObjectsById(tabelList);
-          // console.log(tabelList,'排序--hssss');
-          if(List && List.length>0 && List[0].shutdown == 1){
-            this.$message({ type: 'error', message: '顺序第一个词料,需要把‘加料前停机’改为关掉', duration: 3000 })
-            return false;
-              //   this.$confirm('第一个词料,需要把‘加料前停机’改为关掉, 是否继续?', '提示', {
-              //   confirmButtonText: '确定',
-              //   cancelButtonText: '取消',
-              //   type: 'warning'
-              // }).then(() => {
-              //   // debugger
-              //   data.data[1].parammaps.shutdown = 0;
-              //   console.log(data,'传的数据---hss');
-              //   this.postTableDate(url,data)
-              // }).catch(() => {
-              //   return false;
-              // });
-            }
-             this.postTableDate(url,data)
-
-
-        },
-        //  发送数据‘
-        postTableDate(url,data){
-          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 })
-                              }
-                })
-
-
-        },
-        // 排序
-        sortObjectsById(arr) {
-            return arr.sort((a, b) => a.sort - b.sort);
-        },
-    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(() => {
-        const tabelList= JSON.parse(JSON.stringify(this.table2.list));
-        const List =this.sortObjectsById(tabelList);
-        console.log(List,'哈哈哈哈哈')
-        // 若数组只有一个,无需判断.大于等于2个以上则需要判断状态
-        // 若删除第一个,则判断下一个是否是关掉状态,
-        // 若删除第n个,无需判断第一个状态值
-        if(List && List.length>=2 && List[0].id == row.id && List[1].shutdown == 1){
-            this.$message({ type: 'error', message: '需要把后面排序:第一个的‘加料前停机’改为关掉', duration: 3000 })
-            return false;
-          }
-
-        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: dateTime,
-            slid: row.id,
-            fid: row.fid,
-            autosecond: row.autosecond,
-            userId: Cookies.get('employeid')
-          }}
-          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
-          }}
-          this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
-            id:this.table2.getdataListParm.parammaps.ftid,
-            createdate:dateTime,
-            userId: Cookies.get('employeid')
-          }}
-        } else {
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.createdate = dateTime
-          this.requestParam.userId = Cookies.get('employeid')
-          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: dateTime,
-            slid: row.id,
-            fid: row.fid,
-            autosecond: row.autosecond,
-            userId: Cookies.get('employeid')
-          }}
-          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
-          }}
-          this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
-            id:this.table2.getdataListParm.parammaps.ftid,
-            createdate:dateTime,
-            userId: Cookies.get('employeid')
-          }}
-        }
-        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: '已取消删除' })
-      })
-    },
-    handleSelectionChange2(val) {
-      console.log('勾选数据', val)
-      this.selectList2 = val
-    },
-    celldblclick(row, column, cell, event) {
-      console.log(row, '=====')
-      this.handleUpdate2(row)
-    },
-    form_delete2() {
-      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)
-          // 多选的话,则需要把 选中的数组 从tablelist去除,剩余数据 如果有数据,则排序第一个的数据.
-          // 需要判断第一个的状态,如果是开启,则需要让用户修改关闭; TODO:
-          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.userId = Cookies.get('employeid')
-            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: dateTime,
-              slid: '@insertSpotList.id',
-              fid: '@insertSpotList.fid',
-              autosecond: '@insertSpotList.autosecond',
-              userId: Cookies.get('employeid')
-            }}
-            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
-            }}
-            this.requestParam.data[2] = { '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
-            }}
-            this.requestParam.data[3] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
-              id:this.table2.getdataListParm.parammaps.ftid,
-              createdate:dateTime,
-              userId: Cookies.get('employeid')
-            }}
-            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 })
-                  }
-                })
-              }
-            })
-          }
-        })
-      }
-    },
-
-    // 拆分预混料
-    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,volume:'' }]
-                    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,volume:'' }]
-                  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,volume:'' }]
-                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,volume:'' }]
-            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',
-          shutdown: '0',
-          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,
-          volume:this.detail.list2[0].volume
-        }}
-        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',
-          shutdown: '@insertSpotList.shutdown'
-        }}
-        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',
-          shutdown: '0',
-          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 = ''
-    },
-    handleTakeEffect() {
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          let ids = []
-          for (let i = 0; i < this.selectList.length; i++) {
-            ids.push(this.selectList[i].id)
-          }
-          var data = {}
-          data.parammaps = {}
-          data.parammaps.enable = 1
-          data.parammaps.id = ids.toString()
-          var url = 'authdata/feedtemplet/enable'
-          postJson(url,data).then(response => {
-            console.log('生效保存发送参数', data)
-            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(() => {
-          let ids = []
-          for (let i = 0; i < this.selectList.length; i++) {
-            ids.push(this.selectList[i].id)
-          }
-          var data = {}
-          data.parammaps = {}
-          data.parammaps.enable = 0
-          data.parammaps.id = ids.toString()
-          console.log('禁用', data)
-          var url = 'authdata/feedtemplet/enable'
-          postJson(url,data).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()
-            }
-          })
-        })
-      }
-    },
-    getIspalyUd(){
-      let url = 'authdata/GetDataByName'
-      let data = {
-        "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
-        "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
-      }
-      postJson(url,data).then(response => {
-        if (response.msg !== 'fail') {
-          if(response.data.list[0].inforvalue == 0){
-            this.ispalyUd = false
-          }else{
-            this.ispalyUd = true
-          }
-        } else {
-          this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-    handleGetUd(){
-      MessageBox.confirm('是否上传配方?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        let url = 'authdata/gm/udfeedtemplet/push'
-        let data = {
-          pastureId:Cookies.get('pastureid')
-        }
-        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 })
-          }
-        })
-      })
-    }
-  }
-}
-</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>

+ 2 - 2
src/views/formulationPlan/surplusMaterialPlan/index.vue

@@ -357,8 +357,8 @@
         ],
         barsList: [], // 栏舍
         residueDisposalList: [{
-          value: '0',
-          label: '转投剩料'
+          value: '0',         
+          label: '代替日粮或饲料原料'
         }, {
           value: '1',
           label: '继续饲喂'

+ 1175 - 717
src/views/shedProduction/dutyRecord/index.vue

@@ -1,717 +1,1175 @@
-<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.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-select v-model="table.getdataListParm.parammaps.eqclass" placeholder="设备类别" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in equipmentCategoryList" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-input ref="eqcode" v-model="table.getdataListParm.parammaps.eqcode" class="filter-item" placeholder="设备编号" style="width: 120px;" />
-      <el-input ref="driver" v-model="table.getdataListParm.parammaps.driver" class="filter-item" placeholder="驾驶员" style="width: 120px;" />
-      <el-button class="successBorder" @click="form_search">查询</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" icon="el-icon-delete" class="danger" @click="form_delete">删除</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"
-        :max-height="myHeight"
-      >
-        <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="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.operatetime }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="班次" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.times }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="设备类别" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.eqclass }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="设备编号" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.eqcode }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="驾驶员" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.driver }}</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 label="操作" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @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="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-tabs v-model="create.activeName" @tab-click="handleClick">
-          <el-tab-pane label="TMR设备" name="first">
-            <div class="TMR">
-              <div class="table">
-                <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="150px" align="center">
-                    <template slot-scope="scope">
-                      <span>{{ scope.row.timesstr }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="设备类别" min-width="90px" align="center">
-                    <template slot-scope="scope">
-                      <span>{{ scope.row.eqclass }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="设备编号" min-width="100px" align="center">
-                    <template slot-scope="scope">
-                      <span>{{ scope.row.eqcode }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="驾驶员" min-width="90px" align="center">
-                    <template slot-scope="scope">
-                      <el-select v-model="scope.row.driverid" filterable placeholder="驾驶员" class="filter-item" style="width: 100%;padding: 0 10px;" @change="(value)=> {changeDriver(value, scope.row)}">
-                        <el-option v-for="item in driverList" :key="item.id" :label="item.drivername" :value="item.id" />
-                      </el-select>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="生效日期" min-width="90px" align="center">
-                    <template slot-scope="scope">
-                      <el-date-picker v-model="scope.row.operatetime" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="生效日期" :clearable="false" class="filter-item operatetime" style="width: 100%;" @focus="focusOperatetime(scope.row)" @change="changeOperatetime(scope.row)" />
-                    </template>
-                  </el-table-column>
-                </el-table>
-              </div>
-              <div slot="footer" class="dialog-footer" style="bottom: 20px;">
-                <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
-                <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="createData()">确认</el-button>
-              </div>
-            </div>
-          </el-tab-pane>
-          <el-tab-pane label="铲车" name="second">
-            <div class="forklift">
-              <div class="table">
-                <el-table
-                  :key="create.tableKey2"
-                  v-loading="create.listLoading2"
-                  element-loading-text="给我一点时间"
-                  :data="create.list2"
-                  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="150px" align="center">
-                    <template slot-scope="scope">
-                      <span>{{ scope.row.timesstr }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="设备类别" min-width="90px" align="center">
-                    <template slot-scope="scope">
-                      <span>{{ scope.row.eqclass }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="设备编号" min-width="100px" align="center">
-                    <template slot-scope="scope">
-                      <span>{{ scope.row.eqcode }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="驾驶员" min-width="90px" align="center">
-                    <template slot-scope="scope">
-                      <el-select v-model="scope.row.driverid" filterable placeholder="驾驶员" class="filter-item" style="width: 100%;padding: 0 10px;" @change="(value)=> {changeDriver(value, scope.row)}">
-                        <el-option v-for="item in driverList" :key="item.id" :label="item.drivername" :value="item.id" />
-                      </el-select>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="生效日期" min-width="90px" align="center">
-                    <template slot-scope="scope">
-                      <el-date-picker v-model="scope.row.operatetime" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" placeholder="生效日期" class="filter-item operatetime" style="width: 100%;" @focus="focusOperatetime2(scope.row)" @change="changeOperatetime2(scope.row)" />
-                    </template>
-                  </el-table-column>
-                </el-table>
-              </div>
-              <div slot="footer" class="dialog-footer" style="bottom: 20px;">
-                <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
-                <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="createData2()">确认</el-button>
-              </div>
-            </div>
-          </el-tab-pane>
-        </el-tabs>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, PostDataByName, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-import { MessageBox } from 'element-ui'
-var createList = []
-export default {
-  name: 'DutyRecord',
-  components: { Pagination },
-  data() {
-    return {
-      dialogFull: false,
-      isRoleEdit: [],
-      requestParams: [
-        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }},
-        { name: 'getDriverListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
-      ],
-      equipmentCategoryList: [{ id: '1', name: 'TMR设备' }, { id: '2', name: '铲车' }], // 设备类别
-      frequencyList: [], // 班次
-      driverList: [], // 驾驶员
-
-      table: {
-        getdataListParm: {
-          name: 'getDutyrecordList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            barid: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: '',
-            times: '',
-            eqclass: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {}
-      },
-
-      // 新增/编辑
-      create: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{m}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '', times: '' },
-        rules: {},
-        tableKey: 0,
-        list: [],
-        createList: [],
-        total: 0,
-        listLoading: true,
-        getdataListParm: {
-          name: 'geEqListByDplan',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        tableKey2: 0,
-        list2: [],
-        createList2: [],
-        total2: 0,
-        listLoading2: true,
-        getdataListParm2: {
-          name: 'geEqListByDplanCC',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        activeName: 'first'
-      },
-      textMap: {
-        create: '分配'
-      },
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getDutyrecordList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            barid: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: '',
-            times: '',
-            eqclass: ''
-          }
-        },
-        list: []
-      },
-      isokDisable: false,
-      selectList: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-
-  created() {
-    this.getList()
-    this.getDownList()
-    this.getButtons()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'DutyRecord'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        if (response.data.getSysoptEnable.list !== null) {
-          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
-            const obj = {}
-            obj.id = String(i)
-            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { obj.name = '第六班' }
-            this.frequencyList.push(obj)
-          }
-        } else {
-          this.frequencyList = []
-        }
-        this.driverList = response.data.getDriverListEnable.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)
-      })
-    },
-    form_search() {
-      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.times = ''
-      this.table.getdataListParm.parammaps.eqclass = ''
-      this.table.getdataListParm.parammaps.eqcode = ''
-      this.table.getdataListParm.parammaps.driver = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-
-    // 新增
-    handleCreate() {
-      console.log('点击了分配')
-      this.create.dialogStatus = 'create'
-      this.dialogFull = false
-      this.create.dialogFormVisible = true
-      this.getDialogList()
-    },
-    handleClick() {
-      if (this.create.activeName == 'first') {
-        this.getDialogList()
-      } else if (this.create.activeName == 'second') {
-        this.getDialogList2()
-      }
-    },
-    getDialogList() {
-      GetDataByName(this.create.getdataListParm).then(response => {
-        console.log('table数据1', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].driver == undefined || response.data.list[i].driverid == undefined) {
-              this.$set(response.data.list[i], 'driver', '')
-              this.$set(response.data.list[i], 'driverid', '')
-            }
-            this.$set(response.data.list[i], 'sort', 'create' + i)
-          }
-          this.create.list = response.data.list
-        } else {
-          this.create.list = []
-        }
-        setTimeout(() => {
-          this.create.listLoading = false
-        }, 100)
-      })
-    },
-    getDialogList2() {
-      GetDataByName(this.create.getdataListParm2).then(response => {
-        console.log('table2数据', response.data.list)
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].driver == undefined || response.data.list[i].driverid == undefined) {
-              this.$set(response.data.list[i], 'driver', '')
-              this.$set(response.data.list[i], 'driverid', '')
-            }
-            this.$set(response.data.list[i], 'sort', 'create2' + i)
-          }
-          this.create.list2 = response.data.list
-        } else {
-          this.create.list2 = []
-        }
-        setTimeout(() => {
-          this.create.listLoading2 = false
-        }, 100)
-      })
-    },
-    changeDriver(item, row) {
-      row.driver = this.driverList.find(obj => obj.id == item).drivername
-    },
-    focusOperatetime(row) {
-      console.log(row)
-      GetDataByName(this.create.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].driver == undefined || response.data.list[i].driverid == undefined) {
-              this.$set(response.data.list[i], 'driver', '')
-              this.$set(response.data.list[i], 'driverid', '')
-            }
-            this.$set(response.data.list[i], 'sort', 'create' + i)
-          }
-          this.create.createList = [...response.data.list]
-        } else {
-          this.create.createList = []
-        }
-      })
-    },
-    changeOperatetime(row) {
-      console.log(this.create.createList)
-      for (let i = 0; i < this.create.createList.length; i++) {
-        if (row.sort == this.create.createList[i].sort) {
-          if (new Date(row.operatetime) < new Date(this.create.createList[i].operatetime)) {
-            row.operatetime = this.create.createList[i].operatetime
-            this.$message({ type: 'error', message: '生效日期不可小于上次日期', duration: 2000 })
-          }
-        }
-      }
-    },
-    focusOperatetime2(row) {
-      console.log(row)
-      GetDataByName(this.create.getdataListParm2).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].driver == undefined || response.data.list[i].driverid == undefined) {
-              this.$set(response.data.list[i], 'driver', '')
-              this.$set(response.data.list[i], 'driverid', '')
-            }
-            this.$set(response.data.list[i], 'sort', 'create2' + i)
-          }
-          this.create.createList2 = [...response.data.list]
-        } else {
-          this.create.createList2 = []
-        }
-      })
-    },
-    changeOperatetime2(row) {
-      console.log(this.create.createList2)
-      for (let i = 0; i < this.create.createList2.length; i++) {
-        if (row.sort == this.create.createList2[i].sort) {
-          if (new Date(row.operatetime) < new Date(this.create.createList2[i].operatetime)) {
-            row.operatetime = this.create.createList2[i].operatetime
-            this.$message({ type: 'error', message: '生效日期不可小于上次日期', duration: 2000 })
-          }
-        }
-      }
-    },
-    createData() {
-      console.log('点击了新增保存', this.create.list)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-
-      for (var i = 0; i < this.create.list.length; i++) {
-        if (this.create.list[i].driverid == '') {
-          this.create.list.splice(i, 1)
-          i = 0
-        }
-      }
-      for(let i=0;i<this.create.list.length;i++){
-        if(this.create.list[i].operatetime == '' || this.create.list[i].operatetime == undefined){
-          this.$message({ type: 'error', message: '生效日期不可为空', duration: 2000 })
-          return
-        }
-      }
-      console.log('点击了新增保存11', this.create.list)
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.create.list }}
-      this.requestParam.data[0].children = []
-      this.requestParam.data[0].children[0] = { 'name': 'insertDutyrecord', 'type': 'e', 'parammaps': {
-        pastureid: '@insertSpotList.pastureid',
-        eqid: '@insertSpotList.eqid',
-        eqclass: '@insertSpotList.eqclass',
-        eqcode: '@insertSpotList.eqcode',
-        driver: '@insertSpotList.driver',
-        driverid: '@insertSpotList.driverid',
-        times: '@insertSpotList.times',
-        operatetime: '@insertSpotList.operatetime',
-        emp: Cookies.get('employename')
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('分配TMR设备保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          const dutyrecordUniq = new RegExp("key 'dutyrecord-uniq'")
-          if (dutyrecordUniq.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()
-        }
-      })
-    },
-    createData2() {
-      console.log('分配铲车', this.create.list2)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-
-      for (var i = 0; i < this.create.list2.length; i++) {
-        if (this.create.list2[i].driverid == '') {
-          this.create.list2.splice(i, 1)
-          i = 0
-        }
-      }
-
-      console.log('点击了新增保存', this.create.list)
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.create.list2 }}
-      this.requestParam.data[0].children = []
-      this.requestParam.data[0].children[0] = { 'name': 'insertDutyrecord', 'type': 'e', 'parammaps': {
-        pastureid: '@insertSpotList.pastureid',
-        eqid: '@insertSpotList.eqid',
-        eqclass: '@insertSpotList.eqclass',
-        eqcode: '@insertSpotList.eqcode',
-        driver: '@insertSpotList.driver',
-        driverid: '@insertSpotList.driverid',
-        times: '@insertSpotList.times',
-        operatetime: '@insertSpotList.operatetime',
-        emp: Cookies.get('employename')
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('分配TMR设备保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          const dutyrecordUniq = new RegExp("key 'dutyrecord-uniq'")
-          if (dutyrecordUniq.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()
-        }
-      })
-    },
-
-    // 删除
-    handleRowDelete(row) {
-      console.log('点击了行内删除')
-      this.selectList = []
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.selectList = []
-        this.requestParam.name = 'deleteDutyrecord'
-        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: '已取消删除' })
-      })
-    },
-    handleSelectionChange(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择值班记录', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          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': 'deleteDutyrecord', '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()
-            }
-          })
-        })
-      }
-    },
-
-    // 导出
-    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) {
-          this.download.list = response.data.list
-        } else {
-          this.download.list = []
-        }
-        var excelDatas = [
-          {
-            tHeader: ['生效日期', '班次', '设备类别', '设备编号', '驾驶员', '分配人'],
-            filterVal: ['operatetime', 'times', 'eqclass', 'eqcode', 'driver', 'emp'],
-            tableDatas: this.download.list,
-            sheetName: 'Sheet1'
-          }
-        ]
-        json2excel(excelDatas, '值班记录', true, 'xlsx')
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  /deep/ .operatetime {margin-right: 0;}
-</style>
+<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.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-select
+        v-model="table.getdataListParm.parammaps.eqclass"
+        placeholder="设备类别"
+        class="filter-item"
+        style="width: 120px"
+        clearable
+      >
+        <el-option
+          v-for="item in equipmentCategoryList"
+          :key="item.id"
+          :label="item.name"
+          :value="item.name"
+        />
+      </el-select>
+      <el-input
+        ref="eqcode"
+        v-model="table.getdataListParm.parammaps.eqcode"
+        class="filter-item"
+        placeholder="设备编号"
+        style="width: 120px"
+      />
+      <el-input
+        ref="driver"
+        v-model="table.getdataListParm.parammaps.driver"
+        class="filter-item"
+        placeholder="驾驶员"
+        style="width: 120px"
+      />
+      <el-button class="successBorder" @click="form_search">查询</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"
+        icon="el-icon-delete"
+        class="danger"
+        @click="form_delete"
+        >删除</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"
+        :max-height="myHeight"
+      >
+        <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="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.operatetime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="班次" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.times }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="设备类别" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.eqclass }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="设备编号" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.eqcode }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="驾驶员" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.driver }}</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
+          label="操作"
+          align="center"
+          width="50"
+          class-name="small-padding fixed-width"
+          fixed="right"
+        >
+          <template slot-scope="{ row }">
+            <el-button
+              v-if="isRoleEdit"
+              class="miniDanger"
+              icon="el-icon-delete"
+              @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="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-tabs v-model="create.activeName" @tab-click="handleClick">
+          <el-tab-pane label="TMR设备" name="first">
+            <div class="TMR">
+              <div class="table">
+                <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="150px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.timesstr }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="设备类别"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.eqclass }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="设备名称"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.tmrname }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="设备编号"
+                    min-width="100px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.eqcode }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="驾驶员"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <el-select
+                        v-model="scope.row.driverid"
+                        filterable
+                        placeholder="驾驶员"
+                        class="filter-item"
+                        style="width: 100%; padding: 0 10px"
+                        @change="
+                          (value) => {
+                            changeDriver(value, scope.row);
+                          }
+                        "
+                      >
+                        <el-option
+                          v-for="item in driverList"
+                          :key="item.id"
+                          :label="item.drivername"
+                          :value="item.id"
+                        />
+                      </el-select>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="生效日期"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <el-date-picker
+                        v-model="scope.row.operatetime"
+                        type="date"
+                        format="yyyy-MM-dd"
+                        value-format="yyyy-MM-dd"
+                        placeholder="生效日期"
+                        :clearable="false"
+                        class="filter-item operatetime"
+                        style="width: 100%"
+                        @focus="focusOperatetime(scope.row)"
+                        @change="changeOperatetime(scope.row)"
+                      />
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+              <div slot="footer" class="dialog-footer" style="bottom: 20px">
+                <el-button
+                  class="cancelClose"
+                  @click="
+                    create.dialogFormVisible = false;
+                    getList();
+                  "
+                  >关闭</el-button
+                >
+                <el-button
+                  v-if="
+                    create.dialogStatus === 'create' ||
+                    create.dialogStatus === 'update'
+                  "
+                  class="save"
+                  :disabled="isokDisable"
+                  @click="createData()"
+                  >确认</el-button
+                >
+              </div>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="铲车" name="second">
+            <div class="forklift">
+              <div class="table">
+                <el-table
+                  :key="create.tableKey2"
+                  v-loading="create.listLoading2"
+                  element-loading-text="给我一点时间"
+                  :data="create.list2"
+                  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="150px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.timesstr }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="设备类别"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.eqclass }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="设备编号"
+                    min-width="100px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <span>{{ scope.row.eqcode }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="驾驶员"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <el-select
+                        v-model="scope.row.driverid"
+                        filterable
+                        placeholder="驾驶员"
+                        class="filter-item"
+                        style="width: 100%; padding: 0 10px"
+                        @change="
+                          (value) => {
+                            changeDriver(value, scope.row);
+                          }
+                        "
+                      >
+                        <el-option
+                          v-for="item in driverList"
+                          :key="item.id"
+                          :label="item.drivername"
+                          :value="item.id"
+                        />
+                      </el-select>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="生效日期"
+                    min-width="90px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <el-date-picker
+                        v-model="scope.row.operatetime"
+                        type="date"
+                        format="yyyy-MM-dd"
+                        value-format="yyyy-MM-dd"
+                        :clearable="false"
+                        placeholder="生效日期"
+                        class="filter-item operatetime"
+                        style="width: 100%"
+                        @focus="focusOperatetime2(scope.row)"
+                        @change="changeOperatetime2(scope.row)"
+                      />
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+              <div slot="footer" class="dialog-footer" style="bottom: 20px">
+                <el-button
+                  class="cancelClose"
+                  @click="
+                    create.dialogFormVisible = false;
+                    getList();
+                  "
+                  >关闭</el-button
+                >
+                <el-button
+                  v-if="
+                    create.dialogStatus === 'create' ||
+                    create.dialogStatus === 'update'
+                  "
+                  class="save"
+                  :disabled="isokDisable"
+                  @click="createData2()"
+                  >确认</el-button
+                >
+              </div>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  GetDataByName,
+  PostDataByName,
+  ExecDataByConfig,
+  GetDataByNames,
+  checkButtons,
+} from "@/api/common";
+import Cookies from "js-cookie";
+import { parseTime, json2excel } from "@/utils/index.js";
+import Pagination from "@/components/Pagination";
+import { MessageBox } from "element-ui";
+var createList = [];
+export default {
+  name: "DutyRecord",
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        {
+          name: "getSysoptEnable",
+          offset: 0,
+          pagecount: 0,
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+            inforname: "times",
+          },
+        },
+        {
+          name: "getDriverListEnable",
+          offset: 0,
+          pagecount: 0,
+          parammaps: { pastureid: Cookies.get("pastureid") },
+        },
+      ],
+      equipmentCategoryList: [
+        { id: "1", name: "TMR设备" },
+        { id: "2", name: "铲车" },
+      ], // 设备类别
+      frequencyList: [], // 班次
+      driverList: [], // 驾驶员
+
+      table: {
+        getdataListParm: {
+          name: "getDutyrecordList",
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get("pageCount")),
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+            barid: "",
+            startTime: "",
+            stopTime: "",
+            inputDatetime: "",
+            times: "",
+            eqclass: "",
+          },
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {},
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: "",
+        temp: {
+          pastureid: Cookies.get("pastureid"),
+          operatetime: parseTime(new Date(), "{y}-{m}-{d} {h}:{m}"),
+          emp: Cookies.get("employename"),
+          barid: "",
+          barname: "",
+          remain: "",
+          times: "",
+        },
+        rules: {},
+        tableKey: 0,
+        list: [],
+        createList: [],
+        total: 0,
+        listLoading: true,
+        getdataListParm: {
+          name: "geEqListByDplan",
+          page: 1,
+          offset: 1,
+          pagecount: "",
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+          },
+        },
+        tableKey2: 0,
+        list2: [],
+        createList2: [],
+        total2: 0,
+        listLoading2: true,
+        getdataListParm2: {
+          name: "geEqListByDplanCC",
+          page: 1,
+          offset: 1,
+          pagecount: "",
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+          },
+        },
+        activeName: "first",
+      },
+      textMap: {
+        create: "分配",
+      },
+      requestParam: {},
+      download: {
+        getdataListParm: {
+          name: "getDutyrecordList",
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+            barid: "",
+            startTime: "",
+            stopTime: "",
+            inputDatetime: "",
+            times: "",
+            eqclass: "",
+          },
+        },
+        list: [],
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + "px", height: 30 + "px" },
+      cellStyle: { padding: 0 + "px" },
+      myHeight: document.documentElement.clientHeight - 85 - 150 - 45,
+    };
+  },
+
+  created() {
+    this.getList();
+    this.getDownList();
+    this.getButtons();
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = "DutyRecord";
+      const isRoleEdit = checkButtons(
+        JSON.parse(sessionStorage.getItem("buttons")),
+        Edit
+      );
+      this.isRoleEdit = isRoleEdit;
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then((response) => {
+        if (response.data.getSysoptEnable.list !== null) {
+          for (
+            let i = 1;
+            i <= response.data.getSysoptEnable.list[0].inforvalue;
+            i++
+          ) {
+            const obj = {};
+            obj.id = String(i);
+            if (i == 1) {
+              obj.name = "第一班";
+            } else if (i == 2) {
+              obj.name = "第二班";
+            } else if (i == 3) {
+              obj.name = "第三班";
+            } else if (i == 4) {
+              obj.name = "第四班";
+            } else if (i == 5) {
+              obj.name = "第五班";
+            } else if (i == 6) {
+              obj.name = "第六班";
+            }
+            this.frequencyList.push(obj);
+          }
+        } else {
+          this.frequencyList = [];
+        }
+        this.driverList = response.data.getDriverListEnable.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);
+      });
+    },
+    form_search() {
+      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.times = "";
+      this.table.getdataListParm.parammaps.eqclass = "";
+      this.table.getdataListParm.parammaps.eqcode = "";
+      this.table.getdataListParm.parammaps.driver = "";
+      this.table.getdataListParm.parammaps.startTime = "";
+      this.table.getdataListParm.parammaps.stopTime = "";
+      this.table.getdataListParm.parammaps.inputDatetime = "";
+      this.table.getdataListParm.offset = 1;
+      this.getList();
+    },
+
+    // 新增
+    handleCreate() {
+      console.log("点击了分配");
+      this.create.dialogStatus = "create";
+      this.dialogFull = false;
+      this.create.dialogFormVisible = true;
+      this.getDialogList();
+    },
+    handleClick() {
+      if (this.create.activeName == "first") {
+        this.getDialogList();
+      } else if (this.create.activeName == "second") {
+        this.getDialogList2();
+      }
+    },
+    getDialogList() {
+      GetDataByName(this.create.getdataListParm).then((response) => {
+        console.log("table数据1", response.data.list);
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (
+              response.data.list[i].driver == undefined ||
+              response.data.list[i].driverid == undefined
+            ) {
+              this.$set(response.data.list[i], "driver", "");
+              this.$set(response.data.list[i], "driverid", "");
+            }
+            this.$set(response.data.list[i], "sort", "create" + i);
+          }
+          this.create.list = response.data.list;
+        } else {
+          this.create.list = [];
+        }
+        setTimeout(() => {
+          this.create.listLoading = false;
+        }, 100);
+      });
+    },
+    getDialogList2() {
+      GetDataByName(this.create.getdataListParm2).then((response) => {
+        console.log("table2数据", response.data.list);
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (
+              response.data.list[i].driver == undefined ||
+              response.data.list[i].driverid == undefined
+            ) {
+              this.$set(response.data.list[i], "driver", "");
+              this.$set(response.data.list[i], "driverid", "");
+            }
+            this.$set(response.data.list[i], "sort", "create2" + i);
+          }
+          this.create.list2 = response.data.list;
+        } else {
+          this.create.list2 = [];
+        }
+        setTimeout(() => {
+          this.create.listLoading2 = false;
+        }, 100);
+      });
+    },
+    changeDriver(item, row) {
+      row.driver = this.driverList.find((obj) => obj.id == item).drivername;
+    },
+    focusOperatetime(row) {
+      console.log(row);
+      GetDataByName(this.create.getdataListParm).then((response) => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (
+              response.data.list[i].driver == undefined ||
+              response.data.list[i].driverid == undefined
+            ) {
+              this.$set(response.data.list[i], "driver", "");
+              this.$set(response.data.list[i], "driverid", "");
+            }
+            this.$set(response.data.list[i], "sort", "create" + i);
+          }
+          this.create.createList = [...response.data.list];
+        } else {
+          this.create.createList = [];
+        }
+      });
+    },
+    changeOperatetime(row) {
+      console.log(this.create.createList);
+      for (let i = 0; i < this.create.createList.length; i++) {
+        if (row.sort == this.create.createList[i].sort) {
+          if (
+            new Date(row.operatetime) <
+            new Date(this.create.createList[i].operatetime)
+          ) {
+            row.operatetime = this.create.createList[i].operatetime;
+            this.$message({
+              type: "error",
+              message: "生效日期不可小于上次日期",
+              duration: 2000,
+            });
+          }
+        }
+      }
+    },
+    focusOperatetime2(row) {
+      console.log(row);
+      GetDataByName(this.create.getdataListParm2).then((response) => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (
+              response.data.list[i].driver == undefined ||
+              response.data.list[i].driverid == undefined
+            ) {
+              this.$set(response.data.list[i], "driver", "");
+              this.$set(response.data.list[i], "driverid", "");
+            }
+            this.$set(response.data.list[i], "sort", "create2" + i);
+          }
+          this.create.createList2 = [...response.data.list];
+        } else {
+          this.create.createList2 = [];
+        }
+      });
+    },
+    changeOperatetime2(row) {
+      console.log(this.create.createList2);
+      for (let i = 0; i < this.create.createList2.length; i++) {
+        if (row.sort == this.create.createList2[i].sort) {
+          if (
+            new Date(row.operatetime) <
+            new Date(this.create.createList2[i].operatetime)
+          ) {
+            row.operatetime = this.create.createList2[i].operatetime;
+            this.$message({
+              type: "error",
+              message: "生效日期不可小于上次日期",
+              duration: 2000,
+            });
+          }
+        }
+      }
+    },
+    createData() {
+      console.log("点击了新增保存", this.create.list);
+      this.isokDisable = true;
+      setTimeout(() => {
+        this.isokDisable = false;
+      }, 1000);
+
+      for (var i = 0; i < this.create.list.length; i++) {
+        if (this.create.list[i].driverid == "") {
+          this.create.list.splice(i, 1);
+          i = 0;
+        }
+      }
+      for (let i = 0; i < this.create.list.length; i++) {
+        if (
+          this.create.list[i].operatetime == "" ||
+          this.create.list[i].operatetime == undefined
+        ) {
+          this.$message({
+            type: "error",
+            message: "生效日期不可为空",
+            duration: 2000,
+          });
+          return;
+        }
+      }
+      console.log("点击了新增保存11", this.create.list);
+      this.requestParam.common = { returnmap: "0" };
+      this.requestParam.data = [];
+      this.requestParam.data[0] = {
+        name: "insertSpotList",
+        resultmaps: { list: this.create.list },
+      };
+      this.requestParam.data[0].children = [];
+      this.requestParam.data[0].children[0] = {
+        name: "insertDutyrecord",
+        type: "e",
+        parammaps: {
+          pastureid: "@insertSpotList.pastureid",
+          eqid: "@insertSpotList.eqid",
+          eqclass: "@insertSpotList.eqclass",
+          eqcode: "@insertSpotList.eqcode",
+          driver: "@insertSpotList.driver",
+          driverid: "@insertSpotList.driverid",
+          times: "@insertSpotList.times",
+          operatetime: "@insertSpotList.operatetime",
+          emp: Cookies.get("employename"),
+        },
+      };
+      ExecDataByConfig(this.requestParam).then((response) => {
+        console.log("分配TMR设备保存发送参数", this.requestParam);
+        if (response.msg === "fail") {
+          const dutyrecordUniq = new RegExp("key 'dutyrecord-uniq'");
+          if (dutyrecordUniq.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();
+        }
+      });
+    },
+    createData2() {
+      console.log("分配铲车", this.create.list2);
+      this.isokDisable = true;
+      setTimeout(() => {
+        this.isokDisable = false;
+      }, 1000);
+
+      for (var i = 0; i < this.create.list2.length; i++) {
+        if (this.create.list2[i].driverid == "") {
+          this.create.list2.splice(i, 1);
+          i = 0;
+        }
+      }
+
+      console.log("点击了新增保存", this.create.list);
+      this.requestParam.common = { returnmap: "0" };
+      this.requestParam.data = [];
+      this.requestParam.data[0] = {
+        name: "insertSpotList",
+        resultmaps: { list: this.create.list2 },
+      };
+      this.requestParam.data[0].children = [];
+      this.requestParam.data[0].children[0] = {
+        name: "insertDutyrecord",
+        type: "e",
+        parammaps: {
+          pastureid: "@insertSpotList.pastureid",
+          eqid: "@insertSpotList.eqid",
+          eqclass: "@insertSpotList.eqclass",
+          eqcode: "@insertSpotList.eqcode",
+          driver: "@insertSpotList.driver",
+          driverid: "@insertSpotList.driverid",
+          times: "@insertSpotList.times",
+          operatetime: "@insertSpotList.operatetime",
+          emp: Cookies.get("employename"),
+        },
+      };
+      ExecDataByConfig(this.requestParam).then((response) => {
+        console.log("分配TMR设备保存发送参数", this.requestParam);
+        if (response.msg === "fail") {
+          const dutyrecordUniq = new RegExp("key 'dutyrecord-uniq'");
+          if (dutyrecordUniq.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();
+        }
+      });
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log("点击了行内删除");
+      this.selectList = [];
+      MessageBox.confirm("是否确认删除此信息?", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.selectList = [];
+          this.requestParam.name = "deleteDutyrecord";
+          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: "已取消删除" });
+        });
+    },
+    handleSelectionChange(val) {
+      console.log("勾选数据", val);
+      this.selectList = val;
+    },
+    form_delete() {
+      console.log("点击了删除");
+      if (this.selectList.length == 0) {
+        this.$message({
+          type: "error",
+          message: "请选择值班记录",
+          duration: 2000,
+        });
+      } else {
+        MessageBox.confirm(
+          "当前选中" + this.selectList.length + "条信息,是否删除?",
+          {
+            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: "deleteDutyrecord",
+            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();
+            }
+          });
+        });
+      }
+    },
+
+    // 导出
+    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) {
+          this.download.list = response.data.list;
+        } else {
+          this.download.list = [];
+        }
+        var excelDatas = [
+          {
+            tHeader: [
+              "生效日期",
+              "班次",
+              "设备类别",
+              "设备编号",
+              "驾驶员",
+              "分配人",
+            ],
+            filterVal: [
+              "operatetime",
+              "times",
+              "eqclass",
+              "eqcode",
+              "driver",
+              "emp",
+            ],
+            tableDatas: this.download.list,
+            sheetName: "Sheet1",
+          },
+        ];
+        json2excel(excelDatas, "值班记录", true, "xlsx");
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+/deep/ .operatetime {
+  margin-right: 0;
+}
+</style>

+ 1436 - 523
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -1,43 +1,150 @@
 <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.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-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.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
+        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
+        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="form_search">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
     </div>
-    <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="form_delete">删除</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button>
-      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</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>
+    <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="form_delete"
+        >删除</el-button
+      >
+      <el-button
+        v-if="isRoleEdit && sapUpload.isSap"
+        class="success"
+        icon="el-icon-upload2"
+        @click="handleSAPUpload"
+        >SAP上传</el-button
+      >
+      <el-button
+        v-if="isRoleEdit"
+        icon="el-icon-copy-document"
+        class="copy"
+        @click="handleCopy"
+        >复制</el-button
+      >
+      <el-button
+        v-if="dataSynchronization.isDataSynchronization && isRoleEdit"
+        class="success"
+        @click="handleDataUpload"
+        >数据上传</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>
-      <el-dropdown style="float: right;margin-right: 10px;">
+      <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-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="operation" v-else>
-      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
-        <el-button style="float: right;margin-right: 10px;" class="export" icon="el-icon-upload2" @click="handleExport(3)">导出</el-button>
+      <el-button
+        v-if="dataSynchronization.isDataSynchronization && isRoleEdit"
+        class="success"
+        @click="handleDataUpload"
+        >数据上传</el-button
+      >
+      <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'">
+    <div class="table" v-if="record == '0'">
       <el-table
         :key="table.tableKey"
         v-loading="table.listLoading"
@@ -46,7 +153,7 @@
         border
         fit
         highlight-current-row
-        style="width: 100%;"
+        style="width: 100%"
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
@@ -56,27 +163,100 @@
         <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>
+            <span>{{
+              scope.$index + (table.pageNum - 1) * table.pageSize + 1
+            }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="栏舍名称" min-width="150px" align="center" prop="barname" />
-        <el-table-column label="配方名称" min-width="150px" align="center" prop="ftname" />
+        <el-table-column
+          label="栏舍名称"
+          min-width="150px"
+          align="center"
+          prop="barname"
+        />
+        <el-table-column
+          label="配方名称"
+          min-width="150px"
+          align="center"
+          prop="ftname"
+        />
+
         <!-- <el-table-column label="收集" min-width="150px" align="center" prop="timesstr" /> -->
-        <el-table-column label="原剩料所属时间" min-width="150px" align="center" prop="remaindate" />
-        <el-table-column label="剩料量(kg)" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="干物质" min-width="150px" align="center" prop="dry" />
-        <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)" />
+        <el-table-column
+          label="原剩料所属时间"
+          min-width="150px"
+          align="center"
+          prop="remaindate"
+        />
+        <el-table-column
+          label="剩料量(kg)"
+          min-width="150px"
+          align="center"
+          prop="remain"
+        />
+        <el-table-column
+          label="干物质"
+          min-width="150px"
+          align="center"
+          prop="dry"
+        />
+        <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="150px"
+          align="center"
+          prop="useinbar"
+        />
+        <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)"
+            />
             <span v-if="isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="isRoleEdit" :disabled="row.emp == '设备采集'" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button
+              v-if="isRoleEdit"
+              :disabled="row.emp == '设备采集'"
+              class="miniDanger"
+              icon="el-icon-delete"
+              @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" />
+      <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>
@@ -88,47 +268,138 @@
         border
         fit
         highlight-current-row
-        style="width: 98%;"
+        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-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" />
+      <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" v-if='create.dialogFormVisible' width="40%">
+    <el-dialog
+      :fullscreen="dialogFull"
+      :visible.sync="create.dialogFormVisible"
+      :close-on-click-modal="false"
+      v-if="create.dialogFormVisible"
+      width="40%"
+    >
       <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" />
+            <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">
+          <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="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 90%;margin:0 auto 50px">
-          <el-row v-if="create.dialogStatus=='create'">
+        <el-form
+          ref="temp"
+          :rules="create.rules"
+          :model="create.temp"
+          label-position="right"
+          label-width="135px"
+          style="width: 90%; margin: 0 auto 50px"
+        >
+          <el-row v-if="create.dialogStatus == 'create'">
             <el-col :span="20">
               <el-form-item label="栏舍名称:" prop="barid">
-                <el-select ref="barid" v-model="create.temp.barid" :disabled="create.dialogStatus=='update'" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
-                  <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+                <el-select
+                  ref="barid"
+                  v-model="create.temp.barid"
+                  :disabled="create.dialogStatus == 'update'"
+                  filterable
+                  placeholder="栏舍名称"
+                  class="filter-item"
+                  style="width: 100%"
+                  @change="changeBar"
+                >
+                  <el-option
+                    v-for="item in houseNameList"
+                    :key="item.id"
+                    :label="item.bname"
+                    :value="item.id"
+                  />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -136,23 +407,50 @@
           <el-row v-else>
             <el-col :span="20">
               <el-form-item label="栏舍名称:" prop="barname">
-                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
+                <el-input
+                  ref="barname"
+                  v-model="create.temp.barname"
+                  disabled
+                  class="filter-item"
+                  placeholder="barname"
+                />
               </el-form-item>
             </el-col>
           </el-row>
+
           <!-- TODO: -->
-          <el-row >
+          <el-row>
             <el-col :span="20">
-              <el-form-item label="配方名称:" >
-                <el-input  v-model="create.temp.ftname" class="filter-item" placeholder="配方名称"  disabled />
+              <el-form-item label="配方名称:">
+                <el-input
+                  v-model="create.temp.ftname"
+                  class="filter-item"
+                  placeholder="配方名称"
+                  disabled
+                />
               </el-form-item>
             </el-col>
           </el-row>
+          <!--  -->
+
           <el-row>
             <el-col :span="20">
-              <el-form-item label="班次(收集):" >
-                <el-select ref="times" v-model="create.temp.times" filterable placeholder="班次(收集)" :disabled="create.dialogStatus=='update'" class="filter-item" style="width: 100%;">
-                  <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+              <el-form-item label="班次(收集):">
+                <el-select
+                  ref="times"
+                  v-model="create.temp.times"
+                  filterable
+                  placeholder="班次(收集)"
+                  :disabled="create.dialogStatus == 'update'"
+                  class="filter-item"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in frequencyList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -165,9 +463,10 @@
                   v-model="create.temp.remaindate"
                   type="date"
                   value-format="yyyy-MM-dd"
-                  style="width: 100%;"
+                  style="width: 100%"
                   :picker-options="pickerOptions"
-                  placeholder="原剩料所属时间">
+                  placeholder="原剩料所属时间"
+                >
                 </el-date-picker>
               </el-form-item>
             </el-col>
@@ -176,14 +475,26 @@
           <el-row>
             <el-col :span="20">
               <el-form-item label="剩料量:" prop="remain">
-                <el-input ref="remain" v-model="create.temp.remain" class="filter-item" placeholder="剩料量" type="number" />
+                <el-input
+                  ref="remain"
+                  v-model="create.temp.remain"
+                  class="filter-item"
+                  placeholder="剩料量"
+                  type="number"
+                />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="20">
               <el-form-item label="干物质:" prop="dry">
-                <el-input ref="dry" v-model="create.temp.dry" class="filter-item" placeholder="干物质" type="number"  />
+                <el-input
+                  ref="dry"
+                  v-model="create.temp.dry"
+                  class="filter-item"
+                  placeholder="干物质"
+                  type="number"
+                />
               </el-form-item>
             </el-col>
           </el-row>
@@ -191,24 +502,158 @@
           <el-row>
             <el-col :span="20">
               <el-form-item label="收集时间:" prop="operatetime">
-                <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="datetime" placeholder="选择处理时间" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" style="width: 100%;" :clearable="false" />
+                <el-date-picker
+                  v-model="create.temp.operatetime"
+                  :disabled="create.dialogStatus == 'update'"
+                  type="datetime"
+                  placeholder="选择处理时间"
+                  format="yyyy-MM-dd HH:mm"
+                  value-format="yyyy-MM-dd HH:mm"
+                  style="width: 100%"
+                  :clearable="false"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="20">
+              <el-form-item label="转投栏舍:">
+                <el-select
+                  ref="useinbarid"
+                  v-model="create.temp.useinbarid"
+                  filterable
+                  placeholder="转投栏舍:"
+                  class="filter-item"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in houseNameList"
+                    :key="item.id"
+                    :label="item.bname"
+                    :value="item.id"
+                  />
+                </el-select>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="20">
               <el-form-item label="操作人:" prop="emp">
-                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" :disabled="create.dialogStatus=='update'" class="filter-item" style="width: 100%;" @blur="blurEmp">
-                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                <el-select
+                  ref="emp"
+                  v-model="create.temp.emp"
+                  filterable
+                  placeholder="操作人"
+                  :disabled="create.dialogStatus == 'update'"
+                  class="filter-item"
+                  style="width: 100%"
+                  @blur="blurEmp"
+                >
+                  <el-option
+                    v-for="item in create.noteTakerList"
+                    :key="item.myId"
+                    :label="item.emp"
+                    :value="item.emp"
+                  />
                 </el-select>
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
-          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
-          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+          <el-button
+            class="cancelClose"
+            @click="
+              create.dialogFormVisible = false;
+              getList();
+            "
+            >关闭</el-button
+          >
+          <el-button
+            v-if="create.dialogStatus === 'create'"
+            class="save"
+            :disabled="isokDisable"
+            @click="createDataAgain()"
+            >确认新增</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>
+    <!-- / -->
+    <el-dialog
+      :title="textMap[sapUpload.dialogStatus]"
+      :destroy-on-close="true"
+      :visible.sync="sapUpload.dialogFormVisible"
+      :close-on-click-modal="false"
+      width="40%"
+    >
+      <div class="sapUpload">
+        <el-form
+          ref="sapUpload"
+          :rules="sapUpload.rules"
+          :model="sapUpload.temp"
+          label-position="right"
+          label-width="100px"
+          style="width: 100%; margin: 0 auto 50px"
+        >
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="时间:" prop="date">
+                <el-date-picker
+                  v-if="
+                    sapUpload.dialogStatus != 'udload5' &&
+                    sapUpload.dialogStatus != 'udload4'
+                  "
+                  v-model="sapUpload.temp.date"
+                  :clearable="false"
+                  class="filter-item"
+                  type="date"
+                />
+                <el-date-picker
+                  v-else
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  format="yyyy-MM-dd"
+                  value-format="yyyy-MM-dd"
+                  v-model="dateRange"
+                  :clearable="false"
+                  :picker-options="pickerOptionsT"
+                  @change="handleDateChange"
+                  class="filter-item"
+                  type="daterange"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="bottom: 20px">
+          <el-button
+            class="cancelClose"
+            @click="
+              sapUpload.dialogFormVisible = false;
+              getList();
+            "
+            >取消</el-button
+          >
+          <el-button
+            class="save"
+            v-if="sapUpload.dialogStatus == 'sapUpload'"
+            :disabled="isokDisable"
+            @click="sapUploadData()"
+            >确认</el-button
+          >
         </div>
       </div>
     </el-dialog>
@@ -216,704 +661,1172 @@
 </template>
 
 <script>
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson2  } from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-import { MessageBox } from 'element-ui'
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
+import {
+  GetDataByName,
+  PostDataByName,
+  failproccess,
+  ExecDataByConfig,
+  GetDataByNames,
+  checkButtons,
+  postJson,
+  postJson2,
+  getSapRoute,
+} from "@/api/common";
+import Cookies from "js-cookie";
+import { parseTime, json2excel } from "@/utils/index.js";
+import Pagination from "@/components/Pagination";
+import { MessageBox } from "element-ui";
+import axios from "axios";
+import { getToken } from "@/utils/auth";
 export default {
-  name: 'MaterialRemainingRecord',
+  name: "MaterialRemainingRecord",
   components: { Pagination },
   data() {
     return {
-      pickerOptions:{
+      dateRange: [
+        parseTime(new Date(), "{y}-{m}-{d}"),
+        parseTime(new Date(), "{y}-{m}-{d}"),
+      ],
+      pickerOptionsT: {
+        // onPick: this.getPickDateT,
+        disabledDate: this.disabledDateT,
+      },
+      pickDateT: "",
+      sapUpload: {
+        dialogFormVisible: false,
+        dialogStatus: "",
+        temp: {
+          date: parseTime(new Date(), "{y}-{m}-{d}"),
+        },
+        rules: {
+          date: [{ required: true, message: "必填", trigger: "blur" }],
+        },
+        getdataListParm: {
+          name: "getSysoptEnable",
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: "Map",
+          parammaps: {
+            pastureid: Cookies.get("pastureid"),
+            inforname: "xdmysapupload",
+            date: parseTime(new Date(), "{y}-{m}-{d}"),
+          },
+        },
+        isSap: false,
+      },
+      pickerOptions: {
         disabledDate(time) {
-            return time.getTime() > Date.now() - 8.64e6;//如果没有后面的-8.64e6就是不可以选择今天的
-          }
+          return time.getTime() > Date.now() - 8.64e6; //如果没有后面的-8.64e6就是不可以选择今天的
+        },
       },
       dialogFull: false,
       isRoleEdit: [],
       getParmas: {
-          name: 'getFPList',
-          page: 1,
-          offset: 1,
+        name: "getFPList",
+        page: 1,
+        offset: 1,
+        pagecount: 0,
+        returntype: "Map",
+        parammaps: {
+          pastureid: Cookies.get("pastureid"),
+          ftname: "",
+        },
+      },
+      requestParams: [
+        {
+          name: "getBarListEnable",
+          offset: 0,
+          pagecount: 0,
+          parammaps: { pastureid: Cookies.get("pastureid") },
+        },
+        {
+          name: "getSysoptEnable",
+          offset: 0,
           pagecount: 0,
-          returntype: 'Map',
           parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            ftname:"",
-          }
+            pastureid: Cookies.get("pastureid"),
+            inforname: "times",
+          },
+        },
+        {
+          name: "getTMRListEnableType",
+          offset: 0,
+          pagecount: 0,
+          parammaps: { pastureid: Cookies.get("pastureid"), eqtype: "1" },
         },
-      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: 'getTMRListEnableType', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'eqtype': '1' }},
-
       ],
       houseNameList: [], // 栏舍名称
       frequencyList: [], // 收集
-      recordList:[{id:'0',name:'手动记录'},{id:'1',name:'TMR设备自动记录'}],
-      record:'0',
+      recordList: [
+        { id: "0", name: "手动记录" },
+        { id: "1", name: "TMR设备自动记录" },
+      ],
+      record: "0",
       table: {
         getdataListParm: {
-          name: 'getBarfeedremainList',
+          name: "getBarfeedremainList",
           page: 1,
           offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
+          pagecount: parseInt(Cookies.get("pageCount")),
+          returntype: "Map",
           parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            barid: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
+            pastureid: Cookies.get("pastureid"),
+            barid: "",
+            startTime: "",
+            stopTime: "",
+            inputDatetime: "",
+          },
         },
         tableKey: 0,
         list: [],
         total: 0,
         listLoading: true,
         temp: {},
-        tableKey2:0,
+        tableKey2: 0,
         listLoading2: false,
-        list2:[]
+        list2: [],
       },
 
       // 新增/编辑
       create: {
         dialogFormVisible: false,
-        dialogStatus: '',
-        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '',dry:0, times: '0',remaindate:'' },
+        dialogStatus: "",
+        temp: {
+          pastureid: Cookies.get("pastureid"),
+          operatetime: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}"),
+          emp: Cookies.get("employename"),
+          barid: "",
+          barname: "",
+          remain: "",
+          dry: 0,
+          times: "0",
+          remaindate: "",
+          useinbarid: "",
+        },
         rules: {
-          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          remain: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          ftname:[{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+          barid: [
+            {
+              type: "string",
+              required: true,
+              message: "必填",
+              trigger: "blur",
+            },
+          ],
+          remain: [
+            {
+              type: "string",
+              required: true,
+              message: "必填",
+              trigger: "blur",
+            },
+          ],
+          times: [
+            {
+              type: "string",
+              required: true,
+              message: "必填",
+              trigger: "blur",
+            },
+          ],
+          ftname: [
+            {
+              type: "string",
+              required: true,
+              message: "必填",
+              trigger: "blur",
+            },
+          ],
         },
         getdataListParm: {
-          name: 'getBarfeedremainEmpHis',
+          name: "getBarfeedremainEmpHis",
           page: 1,
           offset: 1,
           pagecount: 10,
-          returntype: 'Map',
+          returntype: "Map",
           parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
+            pastureid: Cookies.get("pastureid"),
+          },
         },
-        noteTakerList: [] // 记录人
+        noteTakerList: [], // 记录人
       },
       textMap: {
-        create: '新增',
-        update: '编辑'
+        create: "新增",
+        update: "编辑",
       },
 
       requestParam: {},
       download: {
         getdataListParm: {
-          name: 'getBarfeedremainList',
+          name: "getBarfeedremainList",
           page: 1,
           offset: 1,
           pagecount: 0,
-          returntype: 'Map',
+          returntype: "Map",
           parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            barid: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
+            pastureid: Cookies.get("pastureid"),
+            barid: "",
+            startTime: "",
+            stopTime: "",
+            inputDatetime: "",
+          },
         },
-        list: []
+        list: [],
       },
       dataSynchronization: {
         dialogFormVisible: false,
-        dialogStatus: '',
+        dialogStatus: "",
         getdataListParm: {
-          name: 'getSysoptEnable',
+          name: "getSysoptEnable",
           page: 1,
           offset: 1,
           pagecount: 1,
-          returntype: 'Map',
+          returntype: "Map",
           parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inforname: 'wgSap'
-          }
+            pastureid: Cookies.get("pastureid"),
+            inforname: "wgSap",
+          },
         },
-        isDataSynchronization: false
+        isDataSynchronization: false,
       },
       isokDisable: false,
       selectList: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45,
-      url:'authdata/ImportExcel'
-    }
+      rowStyle: { maxHeight: 30 + "px", height: 30 + "px" },
+      cellStyle: { padding: 0 + "px" },
+      myHeight: document.documentElement.clientHeight - 85 - 150 - 45,
+      url: "authdata/ImportExcel",
+    };
   },
   computed: {
     // 设置请求头
     headers() {
       return {
-        token: getToken()
-      }
+        token: getToken(),
+      };
     },
     uploadData() {
       return {
-        name: 'checkbarname,checktimes,insertBarfeedremainUpload',
-        importParams: '栏舍名称,配方名称,原剩料所属时间,剩料量(kg),干物质,班次收集(一天/第一班/第二班/第三班),收集时间,操作人',
-        sheetname: 'Sheet1',
+        name: "checkbarname,checktimes,insertBarfeedremainUpload",
+        importParams:
+          "栏舍名称,配方名称,原剩料所属时间,剩料量(kg),干物质,班次收集(一天/第一班/第二班/第三班),收集时间,操作人",
+        sheetname: "Sheet1",
         // 登录牧场
-        pastureid: Cookies.get('pastureid'),
+        pastureid: Cookies.get("pastureid"),
         // 日期参数
-        dateParams: '原剩料所属时间',
+        dateParams: "原剩料所属时间",
         // 必填参数
-        requiredParams: '栏舍名称,剩料量(kg),班次收集(一天/第一班/第二班/第三班)',
+        requiredParams:
+          "栏舍名称,剩料量(kg),班次收集(一天/第一班/第二班/第三班)",
         // 为数值的参数
-        numParams: '剩料量(kg)'
-      }
+        numParams: "剩料量(kg)",
+      };
     },
     // 设置上传地址
     uploadExcelUrl() {
       // return Cookies.get('url') + 'authdata/ImportExcel'
-      return Cookies.get('url') + 'authdata/ImportExcel'
-    }
+      return Cookies.get("url") + "authdata/ImportExcel";
+    },
     // let url = 'authdata/ImportExcel';
-
   },
   created() {
-    console.log(document.querySelector("html").getAttribute("domain"),'7777')
-    this.getDataSynchronization()
-    this.getList()
-    this.getDownList()
-    this.getButtons()
+    console.log(document.querySelector("html").getAttribute("domain"), "7777");
+    this.getDataSynchronization();
+    this.getList();
+    this.getDownList();
+    this.getButtons();
+    this.getIsSap();
   },
 
   methods: {
+    disabledDateT(time) {
+      const today = new Date();
+      const oneMonthAgo = new Date();
+      oneMonthAgo.setDate(today.getDate() - 15);
+      console.log(today.getTime(), oneMonthAgo.getTime(), "选择日期----2");
+      // return time.getTime() > today.getTime() || time.getTime() < oneMonthAgo.getTime();
+      return time.getTime() > today.getTime();
+    },
+    checkDateDifference(date1, date2) {
+      const dateObj1 = new Date(date1);
+      const dateObj2 = new Date(date2);
+      const differenceInMs = Math.abs(dateObj2 - dateObj1);
+      const differenceInDays = differenceInMs / (1000 * 60 * 60 * 24);
+      if (differenceInDays > 7) {
+        this.$message.warning("日期范围相隔大于7天,请重新选择!");
+        return false;
+      } else {
+        this.dateRange = [date1, date2];
+      }
+    },
+    handleDateChange(value) {
+      console.log(value, "arr");
+      if (value.length === 2) {
+        this.checkDateDifference(value[0], value[1]);
+      }
+    },
+    sapUploadData() {
+      this.$refs["sapUpload"].validate((valid) => {
+        if (valid) {
+          const url = "authdata/xdmy/sap/leftoverEntry";
+          const data = {
+            // "name":"xdmysapupload",
+            pastureid: Cookies.get("pastureid"),
+            date: parseTime(this.sapUpload.temp.date, "{y}-{m}-{d}"),
+          };
+          postJson(url, data).then((response) => {
+            if (response.msg == "ok") {
+              this.$notify({
+                title: "",
+                message: "成功",
+                type: "success",
+                duration: 2000,
+              });
+              this.sapUpload.dialogFormVisible = false;
+              this.getList();
+            } else {
+              this.$notify({
+                title: "失败",
+                message: response.data,
+                type: "warning",
+                duration: 2000,
+              });
+            }
+          });
+        }
+      });
+    },
+    getIsSap() {
+      GetDataByName(this.sapUpload.getdataListParm).then((response) => {
+        if (response.data.list !== null) {
+          if (response.data.list[0].inforvalue == 1) {
+            this.sapUpload.isSap = true;
+          } else {
+            this.sapUpload.isSap = false;
+          }
+          console.log(this.sapUpload.isSap);
+        }
+      });
+    },
+    handleSAPUpload() {
+      this.sapUpload.dialogStatus = "sapUpload";
+      this.sapUpload.dialogFormVisible = true;
+    },
+
     getDataSynchronization() {
-      GetDataByName(this.dataSynchronization.getdataListParm).then(response => {
-        // console.log(response.data.list[0])
-        if (response.data.list[0].inforvalue == 0) {
-          this.dataSynchronization.isDataSynchronization = false
-        } else {
-          this.dataSynchronization.isDataSynchronization = true
+      GetDataByName(this.dataSynchronization.getdataListParm).then(
+        (response) => {
+          // console.log(response.data.list[0])
+          if (response.data.list[0].inforvalue == 0) {
+            this.dataSynchronization.isDataSynchronization = false;
+          } else {
+            this.dataSynchronization.isDataSynchronization = true;
+          }
         }
-      })
+      );
     },
     getButtons() {
-      const Edit = 'MaterialRemainingRecord'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
+      const Edit = "MaterialRemainingRecord";
+      const isRoleEdit = checkButtons(
+        JSON.parse(sessionStorage.getItem("buttons")),
+        Edit
+      );
+      this.isRoleEdit = isRoleEdit;
     },
     getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.houseNameList = response.data.getBarListEnable.list
-        this.TMRNumberList = response.data.getTMRListEnableType.list
+      GetDataByNames(this.requestParams).then((response) => {
+        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 = {}
-            obj.id = String(i)
-            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { obj.name = '第六班' }
-            this.frequencyList.push(obj)
+          for (
+            let i = 1;
+            i <= response.data.getSysoptEnable.list[0].inforvalue;
+            i++
+          ) {
+            const obj = {};
+            obj.id = String(i);
+            if (i == 1) {
+              obj.name = "第一班";
+            } else if (i == 2) {
+              obj.name = "第二班";
+            } else if (i == 3) {
+              obj.name = "第三班";
+            } else if (i == 4) {
+              obj.name = "第四班";
+            } else if (i == 5) {
+              obj.name = "第五班";
+            } else if (i == 6) {
+              obj.name = "第六班";
+            }
+            this.frequencyList.push(obj);
           }
-          this.frequencyList.unshift({id:'0',name:"一天"})
+          this.frequencyList.unshift({ id: "0", name: "一天" });
         } else {
-          this.frequencyList = [{id:'0',name:"一天"}]
+          this.frequencyList = [{ id: "0", name: "一天" }];
         }
-      })
+      });
     },
     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()
+      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()
+      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
-      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}')
+      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 = ''
+        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)
+      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
+          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.list = [];
         }
         setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
+          this.table.listLoading = false;
+        }, 100);
+      });
     },
-    changeRecord(item){
-      if(item == '0'){
-        this.table.getdataListParm.name = 'getBarfeedremainList'
-      }else{
-        this.table.getdataListParm.name = 'getRemainplanrecord'
+    changeRecord(item) {
+      if (item == "0") {
+        this.table.getdataListParm.name = "getBarfeedremainList";
+      } else {
+        this.table.getdataListParm.name = "getRemainplanrecord";
       }
-      this.table.getdataListParm.offset = 1
-      this.getList()
+      this.table.getdataListParm.offset = 1;
+      this.getList();
     },
     form_search() {
-      console.log('点击了查询')
-      this.table.getdataListParm.offset = 1
-      this.getList()
+      console.log("点击了查询");
+      this.table.getdataListParm.offset = 1;
+      this.getList();
     },
     handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.barid = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.offset = 1
-      this.getList()
+      console.log("点击了重置");
+      this.table.getdataListParm.parammaps.barid = "";
+      this.table.getdataListParm.parammaps.startTime = "";
+      this.table.getdataListParm.parammaps.stopTime = "";
+      this.table.getdataListParm.parammaps.inputDatetime = "";
+      this.table.getdataListParm.offset = 1;
+      this.getList();
     },
 
     // 新增
     resetTemp() {
-      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '',dry:0, times: '0',remaindate:''  }
+      this.create.temp = {
+        pastureid: Cookies.get("pastureid"),
+        operatetime: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}"),
+        emp: Cookies.get("employename"),
+        barid: "",
+        barname: "",
+        remain: "",
+        dry: 0,
+        times: "0",
+        remaindate: "",
+      };
     },
     blurEmp(item) {
-      this.create.temp.emp = item.target.value
+      this.create.temp.emp = item.target.value;
     },
     // 栏舍名称
     changeBar(item) {
-      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname;
-      this.getParmas.parammaps.barid =  item;
+      this.create.temp.barname = this.houseNameList.find(
+        (obj) => obj.id === item
+      ).bname;
+      this.getParmas.parammaps.barid = item;
       this.chooseftname();
     },
     // 根据栏舍选择配方名称
-    chooseftname(){
-      GetDataByName(this.getParmas).then(res=>{
+    chooseftname() {
+      GetDataByName(this.getParmas).then((res) => {
         const { data } = res;
-        const ftname =data.list.length && data.list[0].ftname;
-        this.$set(this.create.temp, 'ftname', ftname)
+        const ftname = data.list.length && data.list[0].ftname;
+        this.$set(this.create.temp, "ftname", ftname);
         // this.create.temp.ftname = ftname;
-        console.log( this.create.temp.ftname,ftname, '配方名字');
-      })
+        console.log(this.create.temp.ftname, ftname, "配方名字");
+      });
     },
 
     getNoteTakerList() {
-      GetDataByName(this.create.getdataListParm).then(response => {
+      GetDataByName(this.create.getdataListParm).then((response) => {
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].myId = i
+            response.data.list[i].myId = i;
           }
-          this.create.noteTakerList = response.data.list
-          console.log('记录人数据', response.data.list)
-          console.log(this.create.noteTakerList)
+          this.create.noteTakerList = response.data.list;
+          console.log("记录人数据", response.data.list);
+          console.log(this.create.noteTakerList);
         } else {
-          this.create.noteTakerList = []
+          this.create.noteTakerList = [];
         }
-      })
+      });
     },
     handleCreate() {
-      console.log('点击了新增', this.create)
+      console.log("点击了新增", this.create);
 
-      this.dialogFull = false
-      this.resetTemp()
-      this.getNoteTakerList()
-      this.create.dialogStatus = 'create'
-      this.create.dialogFormVisible = true
+      this.dialogFull = false;
+      this.resetTemp();
+      this.getNoteTakerList();
+      this.create.dialogStatus = "create";
+      this.create.dialogFormVisible = true;
     },
     createData() {
-      console.log('点击了新增保存')
-      console.log(this.create.temp,'发送数据')
-      this.isokDisable = true
+      console.log("点击了新增保存");
+      console.log(this.create.temp, "发送数据");
+      this.isokDisable = true;
       setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['temp'].validate(valid => {
+        this.isokDisable = false;
+      }, 1000);
+      this.$refs["temp"].validate((valid) => {
         if (valid) {
-          this.isokDisable = true
+          this.isokDisable = true;
           setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          const remain = /^\d+(\.\d{1,2})?$/
+            this.isokDisable = false;
+          }, 1000);
+          const remain = /^\d+(\.\d{1,2})?$/;
           // 剩料量
           if (!remain.test(parseFloat(this.create.temp.remain))) {
-            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
-            return false
+            this.$message({
+              type: "error",
+              message: "剩料量请输入自然数并保留两位小数",
+              duration: 2000,
+            });
+            return false;
+          }
+          if (this.create.temp.dry) {
+            this.create.temp.dry = parseFloat(this.create.temp.dry);
+          } else {
+            this.create.temp.dry = 0;
           }
-          if(this.create.temp.dry){
-            this.create.temp.dry = parseFloat(this.create.temp.dry)
-          }else{
-            this.create.temp.dry = 0
+          this.requestParam.name = "insertBarfeedremain";
+          this.requestParam.parammaps = this.create.temp;
+          if (this.create.temp.emp == "") {
+            this.create.temp.emp = Cookies.get("employename");
           }
-          this.requestParam.name = 'insertBarfeedremain'
-          this.requestParam.parammaps = this.create.temp
-          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
-          PostDataByName(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+          PostDataByName(this.requestParam).then((response) => {
+            console.log("新增保存发送参数", this.requestParam);
+            if (response.msg !== "fail") {
+              this.$notify({
+                title: "成功",
+                message: "保存成功",
+                type: "success",
+                duration: 2000,
+              });
+              this.create.dialogFormVisible = false;
+              this.getList();
             } else {
-              const barid = new RegExp("key 'barid'")
+              const barid = new RegExp("key 'barid'");
               if (barid.test(response.data)) {
-                this.$message({ type: 'error', message: '该栏舍该班次收集今日剩料量已存在,不可重复生成', duration: 2000 })
+                this.$message({
+                  type: "error",
+                  message: "该栏舍该班次收集今日剩料量已存在,不可重复生成",
+                  duration: 2000,
+                });
               } else {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+                this.$notify({
+                  title: "保存失败",
+                  message: response.data,
+                  type: "warning",
+                  duration: 2000,
+                });
               }
             }
-          })
+          });
         }
-      })
+      });
     },
     createDataAgain() {
-      console.log('点击了新增保存',this.create.temp)
-      this.isokDisable = true
+      console.log("点击了新增保存", this.create.temp);
+      this.isokDisable = true;
       setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['temp'].validate(valid => {
+        this.isokDisable = false;
+      }, 1000);
+      this.$refs["temp"].validate((valid) => {
         if (valid) {
-          this.isokDisable = true
+          this.isokDisable = true;
           setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          const remain = /^\d+(\.\d{1,2})?$/
+            this.isokDisable = false;
+          }, 1000);
+          const remain = /^\d+(\.\d{1,2})?$/;
           // 剩料量
           if (!remain.test(parseFloat(this.create.temp.remain))) {
-            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
-            return false
+            this.$message({
+              type: "error",
+              message: "剩料量请输入自然数并保留两位小数",
+              duration: 2000,
+            });
+            return false;
+          }
+          if (this.create.temp.dry) {
+            this.create.temp.dry = parseFloat(this.create.temp.dry);
+          } else {
+            this.create.temp.dry = 0;
           }
-          if(this.create.temp.dry){
-            this.create.temp.dry = parseFloat(this.create.temp.dry)
-          }else{
-            this.create.temp.dry = 0
+          this.requestParam.name = "insertBarfeedremain";
+          this.requestParam.parammaps = this.create.temp;
+          if (this.create.temp.emp == "") {
+            this.create.temp.emp = Cookies.get("employename");
           }
-          this.requestParam.name = 'insertBarfeedremain'
-          this.requestParam.parammaps = this.create.temp
-          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
-          PostDataByName(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.resetTemp()
-              this.getList()
-              this.getNoteTakerList()
+          PostDataByName(this.requestParam).then((response) => {
+            console.log("新增保存发送参数", this.requestParam);
+            if (response.msg !== "fail") {
+              this.$notify({
+                title: "成功",
+                message: "保存成功",
+                type: "success",
+                duration: 2000,
+              });
+              this.resetTemp();
+              this.getList();
+              this.getNoteTakerList();
             } else {
-              const barid = new RegExp("key 'barid'")
+              const barid = new RegExp("key 'barid'");
               if (barid.test(response.data)) {
-                this.$message({ type: 'error', message: '该栏舍该班次收集收集今日剩料量已存在,不可重复生成', duration: 2000 })
+                this.$message({
+                  type: "error",
+                  message: "该栏舍该班次收集收集今日剩料量已存在,不可重复生成",
+                  duration: 2000,
+                });
               } else {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+                this.$notify({
+                  title: "保存失败",
+                  message: response.data,
+                  type: "warning",
+                  duration: 2000,
+                });
               }
             }
-          })
+          });
         }
-      })
+      });
     },
 
     // 编辑
     handleUpdate(row) {
-      console.log('点击了编辑', row)
-      console.log(this.frequencyList,'frequencyList')
-      this.dialogFull = false
-      row.barid = String(row.barid)
-      this.create.temp = Object.assign({}, row)
-      this.create.temp.id = row.id
+      console.log("点击了编辑", row);
+      console.log(this.frequencyList, "frequencyList");
+      this.dialogFull = false;
+      row.barid = String(row.barid);
+      this.create.temp = Object.assign({}, row);
+      this.create.temp.id = row.id;
 
-      this.getNoteTakerList()
-      this.create.dialogStatus = 'update'
-      this.create.dialogFormVisible = true
+      this.getNoteTakerList();
+      this.create.dialogStatus = "update";
+      this.create.dialogFormVisible = true;
     },
     updateData() {
-      this.isokDisable = true
+      this.isokDisable = true;
       setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['temp'].validate(valid => {
+        this.isokDisable = false;
+      }, 1000);
+      this.$refs["temp"].validate((valid) => {
         if (valid) {
-          this.isokDisable = true
+          this.isokDisable = true;
           setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          const remain = /^\d+(\.\d{1,2})?$/
+            this.isokDisable = false;
+          }, 1000);
+          const remain = /^\d+(\.\d{1,2})?$/;
           // 剩料量
           if (!remain.test(parseFloat(this.create.temp.remain))) {
-            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
-            return false
+            this.$message({
+              type: "error",
+              message: "剩料量请输入自然数并保留两位小数",
+              duration: 2000,
+            });
+            return false;
           }
 
-          this.requestParam.name = 'updateBarfeedremain'
-          if(this.create.temp.dry){
-            this.create.temp.dry = parseFloat(this.create.temp.dry)
-          }else{
-            this.create.temp.dry = 0
+          this.requestParam.name = "updateBarfeedremain";
+          if (this.create.temp.dry) {
+            this.create.temp.dry = parseFloat(this.create.temp.dry);
+          } else {
+            this.create.temp.dry = 0;
           }
-          this.requestParam.parammaps = this.create.temp
-          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
-          PostDataByName(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+          this.requestParam.parammaps = this.create.temp;
+          if (this.create.temp.emp == "") {
+            this.create.temp.emp = Cookies.get("employename");
+          }
+          PostDataByName(this.requestParam).then((response) => {
+            console.log("新增保存发送参数", this.requestParam);
+            if (response.msg !== "fail") {
+              this.$notify({
+                title: "成功",
+                message: "保存成功",
+                type: "success",
+                duration: 2000,
+              });
+              this.create.dialogFormVisible = false;
+              this.getList();
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              this.$notify({
+                title: "保存失败",
+                message: response.data,
+                type: "warning",
+                duration: 2000,
+              });
             }
-          })
+          });
         }
-      })
+      });
     },
 
     // 删除
     handleRowDelete(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.selectList = []
-        this.requestParam.name = 'deleteBarfeedremain'
-        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: '已取消删除' })
+      console.log("点击了行内删除");
+      MessageBox.confirm("是否确认删除此信息?", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning",
       })
+        .then(() => {
+          this.selectList = [];
+          this.requestParam.name = "deleteBarfeedremain";
+          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: "已取消删除" });
+        });
     },
     handleSelectionChange(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
+      console.log("勾选数据", val);
+      this.selectList = val;
     },
     form_delete() {
-      console.log('点击了删除')
+      console.log("点击了删除");
       if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择栏舍剩料记录', duration: 2000 })
+        this.$message({
+          type: "error",
+          message: "请选择栏舍剩料记录",
+          duration: 2000,
+        });
       } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          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': 'deleteBarfeedremain', '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 })
+        MessageBox.confirm(
+          "当前选中" + this.selectList.length + "条信息,是否删除?",
+          {
+            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: "deleteBarfeedremain",
+            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()
+              this.$notify({
+                title: "",
+                message: "删除成功",
+                type: "success",
+                duration: 2000,
+              });
+              this.getList();
             }
-          })
-        })
+          });
+        });
       }
     },
     // 复制
     handleCopy() {
-      console.log('点击了复制')
+      console.log("点击了复制");
       if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择栏舍剩料记录', duration: 2000 })
+        this.$message({
+          type: "error",
+          message: "请选择栏舍剩料记录",
+          duration: 2000,
+        });
       } else if (this.selectList.length == 1) {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          this.requestParam.name = 'copybarfeedremain'
-          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
+        MessageBox.confirm("是否确认复制此信息?", {
+          confirmButtonText: "确认",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.requestParam.name = "copybarfeedremain";
+            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();
               }
-              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: '已取消复制' })
-        })
+          .catch(() => {
+            this.$message({ type: "info", message: "已取消复制" });
+          });
       } else {
-        this.$message({ type: 'error', message: '请选择一条栏舍剩料记录', duration: 2000 })
+        this.$message({
+          type: "error",
+          message: "请选择一条栏舍剩料记录",
+          duration: 2000,
+        });
       }
     },
     // 导出
     handleExport(item) {
       if (item == 1) {
-        console.log('点击了导出模板')
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'authdata/barfeedremain/excel' // 请求下载文件的地址
-        console.log(url)
+        console.log("点击了导出模板");
+        console.log("点击了导出模板");
+        const requestParam = this.requestParam;
+        const url = Cookies.get("url") + "authdata/barfeedremain/excel"; // 请求下载文件的地址
+        console.log(url);
         axios({
-          method: 'POST',
+          method: "POST",
           url: url,
           data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
+          headers: { token: getToken(), optname: "insertcustomdoc" },
+          responseType: "blob",
+        }).then((res) => {
+          if (!res) return;
+          this.percentage = 99;
           setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
+            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)
-        })
+            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('点击了导出数据',item,this.record)
-        if(this.record == '0'){
-          this.download.getdataListParm.name = 'getBarfeedremainList'
-        }else{
-          this.download.getdataListParm.name = 'getRemainplanrecord'
+        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}')
-          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        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 = ''
+          this.download.getdataListParm.parammaps.inputDatetime = "";
+          this.download.getdataListParm.parammaps.startTime = "";
+          this.download.getdataListParm.parammaps.stopTime = "";
         }
-        GetDataByName(this.download.getdataListParm).then(response => {
+        GetDataByName(this.download.getdataListParm).then((response) => {
           if (response.data.list !== null) {
-            this.download.list = response.data.list
+            this.download.list = response.data.list;
           } else {
-            this.download.list = []
+            this.download.list = [];
           }
-           if(item== 2){
-              var excelDatas1 = [
-                {
-                  tHeader: ['栏舍名称','配方名称','原剩料所属时间', '剩料量(kg)','干物质', '班次(收集)', '收集时间', '操作人'],
-                  filterVal: ['barname', 'ftname','remaindate','remain','dry', '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')
-           }
-        })
+          if (item == 2) {
+            var excelDatas1 = [
+              {
+                tHeader: [
+                  "栏舍名称",
+                  "配方名称",
+                  "原剩料所属时间",
+                  "剩料量(kg)",
+                  "干物质",
+                  "班次(收集)",
+                  "收集时间",
+                  "操作人",
+                ],
+                filterVal: [
+                  "barname",
+                  "ftname",
+                  "remaindate",
+                  "remain",
+                  "dry",
+                  "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"
+            );
+          }
+        });
       }
     },
 
     beforeImport(file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
+      const isLt2M = file.size / 1024 / 1024 < 2;
       if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 2MB!')
+        this.$message.error("上传文件大小不能超过 2MB!");
       }
-      return isLt2M
+      return isLt2M;
     },
     handleImportSuccess(res, file) {
-      this.getList()
-      if (res.msg === 'ok') {
-        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
+      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' })
-           })
+          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 })
+        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])
+      return jsonData.map((v) =>
+        filterVal.map((j) => {
+          if (j === "timestamp") {
+            return parseTime(v[j]);
           } else {
-            return v[j]
+            return v[j];
           }
         })
-      )
-    },
-    handleDataUpload(){
-      let a = Cookies.get('url')
-      let b = a.search(8081)
-      let c = a.substring(0,a.search(8081)) + '8082'
-      let d = a.substring(0,a.lastIndexOf('/'))
-      console.log(d)
-      let url = ''
-      if(b == -1){
-        url = d + ':8082'
-      }else{
-        url = c
+      );
+    },
+    handleDataUpload() {
+      let a = Cookies.get("url");
+      let b = a.search(8081);
+      let c = a.substring(0, a.search(8081)) + "8082";
+      let d = a.substring(0, a.lastIndexOf("/"));
+      console.log(d);
+      let url = "";
+      if (b == -1) {
+        url = d + ":8082";
+      } else {
+        url = c;
       }
-      console.log(url,'url')
-      let _url = url + '/authdata/surplus/push'
+      console.log(url, "url");
+      let _url = url + "/authdata/surplus/push";
       let data = {
-        date:parseTime(new Date(), '{y}-{m}-{d}'),
-        pastureId:Cookies.get('pastureid')
-      }
-      console.log(_url,'_url')
-      postJson2(_url, data).then(response => {
-        if(response.msg == 'ok'){
-          this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
-        }else{
-          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
+        date: parseTime(new Date(), "{y}-{m}-{d}"),
+        pastureId: Cookies.get("pastureid"),
+      };
+      console.log(_url, "_url");
+      postJson2(_url, data).then((response) => {
+        if (response.msg == "ok") {
+          this.$notify({
+            title: "",
+            message: response.data,
+            type: "success",
+            duration: 2000,
+          });
+        } else {
+          this.$notify({
+            title: "上传失败",
+            message: response.data,
+            type: "warning",
+            duration: 2000,
+          });
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>

Разница между файлами не показана из-за своего большого размера
+ 2745 - 634
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue


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

@@ -48,7 +48,7 @@
             <el-table-column sortable label="撒料量(kg)" align="center" prop="撒料量" />
             <el-table-column sortable label="平均混料时间" align="center" prop="混料时间" />
             <el-table-column sortable label="转投剩料量(kg)"  align="center" prop="转投剩料量" />
-            <el-table-column sortable label="昨日剩料量(kg)" align="center" prop="今日剩料量" />
+            <el-table-column sortable label="剩料量(kg)" align="center" prop="今日剩料量" />
             <el-table-column sortable label="剩料率(%)" align="center" prop="剩料率" />
             <el-table-column sortable label="TMR干物质(%)"  align="center" prop="TMR干物质" />
             <el-table-column sortable label="配方干物质采食量(kg/头)" min-width="80px" align="center" prop="配方干物质采食量" />

+ 16 - 8
src/views/statisticalAnalysis/inventoryManagement/group/index.vue

@@ -116,6 +116,7 @@
           <el-input v-if="tab3.isRadio2" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="栏舍名称" />
           <el-input v-if="tab3.isRadio3" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="日期" />
           <el-input v-if="tab3.isRadio4" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="TMR设备编号" />
+
           <el-button class="successBorder" @click="form_search('third')">查询</el-button>
           <el-button class="export" style="float: right;margin-right: 5px;" @click="handleExport('tab3')">导出</el-button>
         </div>
@@ -188,6 +189,7 @@ export default {
       requestParams: [
         { name: 'getPastureListJT', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), pasturename: '' }}
       ],
+      displayList:[{id:'1',name:'理论'},{id:'2',name:'实际'}],//列表显示
       pastureList: [], // 牧场
       fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
       activeName: 'first',
@@ -260,7 +262,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,
@@ -395,6 +398,7 @@ export default {
       }
     },
     handleExport(item) {
+      console.log("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv")
       if (item == 'tab1') {
         console.log('库存统计导出')
       } else if (item == 'tab2') {
@@ -442,7 +446,7 @@ export default {
               // 进行所有表头的单元格合并
               // const merges = ['A1:A1', 'B1:E1','F1:J1' ];
               const merges = ['A1:A1']
-
+              console.log(data)
               excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
             })
         }
@@ -453,23 +457,27 @@ export default {
         var exportData = []
         var exportTitle1 = [] // 一级标题
         var exportTitle2 = [] // 二级标题
+
         for (let i = 0; i < this.tab3.table.tableConfig.length; i++) {
           exportTitle1.push(this.tab3.table.tableConfig[i].label)
           for (let j = 0; j < this.tab3.table.tableConfig[i].children.length; j++) {
             exportTitle2.push(this.tab3.table.tableConfig[i].children[j].label)
           }
         }
-        console.log('一级标题exportTitle1', exportTitle1)
-        console.log('二级标题exportTitle2', exportTitle2)
+        // console.log('一级标题exportTitle1', exportTitle1)
+        // console.log('二级标题exportTitle2', exportTitle2)
         var headerArr = []// 处理一级标题
         for (let i = 0; i < exportTitle1.length; i++) {
+          console.log(exportTitle1[i],"xxxxxxxxxxxxxxx")
           if (i > 0) {
-            headerArr.push(exportTitle1[i], '')
+            console.log(exportTitle1[i],"ddddddddddd")
+            headerArr.push(exportTitle1[i], '', '')
           } else {
             headerArr.push(exportTitle1[i])
           }
         }
-        console.log('一级表头处理后', headerArr)
+
+        console.log('一级表头处理后111', headerArr)
         var valueArr = [] // 对应字段
         for (let i = 0; i < exportTitle2.length; i++) {
           if (i == 0) {
@@ -478,7 +486,7 @@ export default {
             valueArr.push('a' + [i - 1])
           }
         }
-        console.log('对应字段valueArr', valueArr)
+        // console.log('对应字段valueArr', valueArr)
         if (headerArr.length > 0) {
             import('@/vendor/Export3Excel').then((excel) => {
               const multiHeader = [
@@ -492,7 +500,7 @@ export default {
               // 进行所有表头的单元格合并
               // const merges = ['A1:A1', 'B1:E1','F1:J1' ];
               const merges = ['A1:A1']
-
+              // console.log(data)
               excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '价格分析', merges })
             })
         }

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

@@ -67,6 +67,7 @@
           <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-input v-if="tab2.isRadio7" 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>
@@ -147,6 +148,11 @@
           <el-input v-if="tab3.isRadio2" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="栏舍名称" />
           <el-input v-if="tab3.isRadio3" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="日期" />
           <el-input v-if="tab3.isRadio4" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="TMR设备编号" />
+
+          <el-select v-model="tab3.table.getdataListParm.parammaps.typea" clearable placeholder="列表显示" class="filter-item" style="width: 120px;">
+            <el-option v-for="item in displayList1" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+
           <el-button class="successBorder" @click="form_search('third')">查询</el-button>
           <el-button class="export filter-item1" style="float: right;margin-right: 5px;" icon="el-icon-upload2" @click="handleExport('tab3')">导出</el-button>
         </div>
@@ -238,6 +244,7 @@ export default {
       },
       fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
       displayList:[{id:'1',name:'理论'},{id:'2',name:'实际'}],//列表显示
+      displayList1:[{id:'1',name:'理论'},{id:'2',name:'实际'},{id:'3',name:'理论重量'},{id:'4',name:'实际重量'}],
       isSplitsmallmaterialsList:[{id:'0',name:'拆分'},{id:'1',name:'不拆分'}],
       activeName: 'first',
       tab: {
@@ -299,7 +306,8 @@ export default {
         isRadio3: false,
         isRadio4: false,
         isRadio5: false,
-        isRadio6: false
+        isRadio6: false,
+        isRadio7: false
       },
       tab3: {
         chartDate: [],
@@ -315,7 +323,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,
@@ -337,7 +346,7 @@ export default {
       rowHeight: 30,
       isDispayTable2:false,
       isDispayTable3:false,
-      statisticalTypeList2: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }, { id: '5', name: 'TMR班次' }, { id: '6', name: '车次' }],
+      statisticalTypeList2: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }, { id: '5', name: 'TMR班次' }, { id: '6', name: '车次' }, { id: '7', name: '同步数据' }],
       statisticalTypeList3: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }],
       frequencyList: [], // 班次
       isTable1:true,
@@ -589,6 +598,7 @@ export default {
         this.tab2.isRadio4 = false,
         this.tab2.isRadio5 = false,
         this.tab2.isRadio6 = false,
+        this.tab2.isRadio7 = false,
         this.tab2.table.getdataListParm.name = 'getMaterialAnalysisSC'
         this.tab2.table.getdataListParm.offset = 1
         this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -601,6 +611,7 @@ export default {
         this.tab2.isRadio4 = false,
         this.tab2.isRadio5 = false,
         this.tab2.isRadio6 = false,
+        this.tab2.isRadio7 = false,
         this.tab2.table.getdataListParm.name = 'getMaterialAnalysisLS'
         this.tab2.table.getdataListParm.offset = 1
         this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -613,6 +624,7 @@ export default {
         this.tab2.isRadio4 = false,
         this.tab2.isRadio5 = false,
         this.tab2.isRadio6 = false,
+        this.tab2.isRadio7 = false,
         this.tab2.table.getdataListParm.name = 'getMaterialAnalysisRQ'
         this.tab2.table.getdataListParm.offset = 1
         this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -625,6 +637,7 @@ export default {
         this.tab2.isRadio4 = true,
         this.tab2.isRadio5 = false,
         this.tab2.isRadio6 = false,
+        this.tab2.isRadio7 = false,
         this.tab2.table.getdataListParm.name = 'getMaterialAnalysisTMR'
         this.tab2.table.getdataListParm.offset = 1
         this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -649,11 +662,25 @@ export default {
         this.tab2.isRadio4 = false,
         this.tab2.isRadio5 = false,
         this.tab2.isRadio6 = true,
+        this.tab2.isRadio7 = false,
         this.tab2.table.getdataListParm.name = 'getMaterialAnalysisCC'
         this.tab2.table.getdataListParm.offset = 1
         this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
         this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
         this.getTab2List()
+      } else if (this.tab2.radio == '7') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.isRadio7 = true,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisUD'
+        this.tab2.table.getdataListParm.offset = 1
+        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        this.getTab2List()
       }
     },
     // 价格分析
@@ -1068,11 +1095,21 @@ export default {
         console.log('一级标题exportTitle1', exportTitle1)
         console.log('二级标题exportTitle2', exportTitle2)
         var headerArr = []// 处理一级标题
-        for (let i = 0; i < exportTitle1.length; i++) {
-          if (i > 0) {
-            headerArr.push(exportTitle1[i], '')
-          } else {
-            headerArr.push(exportTitle1[i])
+        if (this.tab3.table.getdataListParm.typea !== '') {
+          for (let i = 0; i < exportTitle1.length; i++) {
+            if (i > 0) {
+              headerArr.push(exportTitle1[i])
+            } else {
+              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])
+            }
           }
         }
         console.log('一级表头处理后', headerArr)

Разница между файлами не показана из-за своего большого размера
+ 1177 - 537
src/views/statisticalAnalysis/processAnalysis/group/index.vue


+ 74 - 6
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -49,6 +49,8 @@
       <!-- 临时注释 -->
       <el-button class="successBorder" @click="form_search">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+      <el-button class="successBorder" @click="handleGetPastureData">牧场数据获取</el-button>
+      <el-button class="export" icon="el-icon-upload2" @click="handleDownLoad">导出</el-button>
     </div>
     <el-row :gutter="10">
       <el-col :span="8">
@@ -623,9 +625,13 @@
 import echarts from 'echarts'
 
 require('echarts/theme/macarons')
-import { GetDataByName, GetReportform, formatNum,processAnalysist,editWeightHL,editWeightSL } from '@/api/common'
+import { GetDataByName, GetReportform, formatNum,processAnalysist,editWeightHL,editWeightSL,getPastureData,processAnalysistDown } from '@/api/common'
 import Cookies from 'js-cookie'
-import { parseTime } from '@/utils/index.js'
+import { parseTime ,json2excel} from '@/utils/index.js'
+import { MessageBox } from 'element-ui';
+import axios from 'axios'
+import { getToken } from '@/utils/auth' // get token from cookie
+
 export default {
   name: 'PastureProcessAnalysis',
   data() {
@@ -812,6 +818,63 @@ export default {
     this.getList()
   },
   methods: {
+
+    // 导出功能
+     handleDownLoad(){
+        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 = ''
+      }
+        const url = Cookies.get('url') + 'authdata/process/excel' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'POST',
+          url: url,
+          data: this.table.getdataListParm,
+          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)
+        })
+     },
+
+
+    // 牧场数据获取
+    handleGetPastureData(){
+      console.log('牧场数据获取')
+
+      getPastureData().then(response => {
+        console.log('请求成功:', response.data);
+        MessageBox.alert('操作成功!牧场数据正在同步到平台数据库,此操作根据不同牧场的数据大小耗时也不同,大约需要5-30分钟', '提示', {
+        confirmButtonText: '关闭',
+        type: 'success',
+        });
+      })
+      .catch(error => {
+        console.error('请求失败:', error);
+      });
+    },
     // 编辑实际重量
     handleClick(row,type){
       this.dialogFormVisible = true;
@@ -822,7 +885,7 @@ export default {
       this.form.userId = Cookies.get('employeid')
       this.form.type = type;
       console.log(row,'实际重量');
-      
+
 
     },
     // 点击确认修改
@@ -838,7 +901,7 @@ export default {
       this.handleEditWgSL(this.form)
      }
     },
-   
+
     // 混料
     async handleEditWgHL(obj){
       const {data} =await editWeightHL(obj);
@@ -862,7 +925,7 @@ export default {
       }
       this.getList4()
       this.dialogFormVisible = false
-   
+
     },
     change_date(e){
       console.log(e)
@@ -1138,9 +1201,14 @@ export default {
     handleRefresh() {
       console.log('点击了重置')
       this.table.getdataListParm.parammaps.fclassid = ''
-      this.table.getdataListParm.parammaps.tmrtname = ''
+      this.table.getdataListParm.parammaps.tmrtname = []
       this.table.getdataListParm.parammaps.iscompleted = ''
       this.table.getdataListParm.parammaps.lpplantype = ''
+      this.table.getdataListParm.parammaps.error = ''
+      this.ccys = false
+      this.table3.getdataListParm.parammaps.error = ''
+      this.table4.getdataListParm.parammaps.error = ''
+
       this.table.getdataListParm.parammaps.startTime = parseTime(new Date(), '{y}-{m}-{d}')
       this.table.getdataListParm.parammaps.stopTime = parseTime(new Date(), '{y}-{m}-{d}')
       this.table.getdataListParm.parammaps.inputDatetime = [new Date(), new Date()]

+ 4 - 0
src/views/systemManagement/boardEchartManagement/index.vue

@@ -574,7 +574,11 @@ export default {
     },
     jumpSee(row) {
       console.log('点击了查看', row)
+      console.log(this.$router.getRoutes()); 
+      // this.$router.push({ path: '/statisticalAnalysis/FormulationEvaluation', query: { tname: row.tname }})
+      // this.$router.push({ path: '/customboard/addboard', params: { id: row.id, isEdit: 'view', isRoleEdit: this.isRoleEdit }})
       this.$router.push({ name: 'Addboard', params: { id: row.id, isEdit: 'view', isRoleEdit: this.isRoleEdit }})
+      // this.$router.push({path:'/Addboard'}) // 跳转
       Cookies.set('AddboardIsEdit', 'view')
       Cookies.set('AddboardIsEditId', row.id)
 

Некоторые файлы не были показаны из-за большого количества измененных файлов