瀏覽代碼

Merge branch 'feature-1021' into release/v1.1.1

Shan9312 1 年之前
父節點
當前提交
9f1341b168
共有 43 個文件被更改,包括 8722 次插入3723 次删除
  1. 1 1
      .env.development
  2. 二進制
      dist-tmr-20240628.zip
  3. 二進制
      dist-tmr-20240711.zip
  4. 二進制
      dist-tmr-20240802-发版本.zip
  5. 二進制
      dist-tmr-20240826.zip
  6. 二進制
      dist-tmr-圣牧-20240809.zip
  7. 二進制
      dist-tmr-测试-20240607.zip
  8. 二進制
      dist-tmr-测试-20240611-2.zip
  9. 二進制
      dist-tmr-测试-20240612.zip
  10. 二進制
      dist-tmr-测试-20240613.zip
  11. 二進制
      dist-tmr-测试-20240617.zip
  12. 二進制
      dist-tmr-测试-20240619.zip
  13. 二進制
      dist-tmr-测试-20240624.zip
  14. 二進制
      dist-tmr-测试-20240710.zip
  15. 二進制
      dist-tmr-测试2-20240619.zip
  16. 二進制
      dist-tmr-测试线-20240603.zip
  17. 二進制
      dist-tmr-测试线-20240607-2.zip
  18. 二進制
      dist.-tmr-测试版-20240611.zip
  19. 500 450
      src/api/common.js
  20. 二進制
      src/assets/dot.jpeg
  21. 162 151
      src/router/index.js
  22. 123 120
      src/store/modules/permission.js
  23. 17 0
      src/styles/element-ui.scss
  24. 6 4
      src/utils/request.js
  25. 26 18
      src/views/basicData/defaultParameter/function/index.vue
  26. 716 714
      src/views/basicData/feedTable/index.vue
  27. 242 0
      src/views/basicData/leftoverManagement/index.vue
  28. 271 0
      src/views/drawDot/index.vue
  29. 477 187
      src/views/formulationPlan/dailyExecutionPlan/index.vue
  30. 11 0
      src/views/formulationPlan/dailyExecutionPlan/revisePlan.vue
  31. 420 422
      src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue
  32. 41 13
      src/views/formulationPlan/dhedFormula/index.vue
  33. 81 2
      src/views/formulationPlan/recipeTemplate/index.vue
  34. 3547 0
      src/views/formulationPlan/recipeTemplate/indexhss.vue
  35. 242 0
      src/views/leftoverManagement/index.vue
  36. 834 773
      src/views/shedProduction/materialRemainingRecord/index.vue
  37. 20 17
      src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue
  38. 46 46
      src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue
  39. 262 259
      src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue
  40. 9 1
      src/views/statisticalAnalysis/processAnalysis/group/index.vue
  41. 142 19
      src/views/statisticalAnalysis/processAnalysis/pasture/index.vue
  42. 513 513
      src/views/systemManagement/user/index.vue
  43. 13 13
      vue.config.js

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ ENV = 'development'
 # VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
 VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 白少后台本地
-# VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
+# VUE_APP_BASE_API = 'http://192.168.1.233/'
 # VUE_APP_BASE_API = 'http://192.168.1.93/'
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

二進制
dist-tmr-20240628.zip


二進制
dist-tmr-20240711.zip


二進制
dist-tmr-20240802-发版本.zip


二進制
dist-tmr-20240826.zip


二進制
dist-tmr-圣牧-20240809.zip


二進制
dist-tmr-测试-20240607.zip


二進制
dist-tmr-测试-20240611-2.zip


二進制
dist-tmr-测试-20240612.zip


二進制
dist-tmr-测试-20240613.zip


二進制
dist-tmr-测试-20240617.zip


二進制
dist-tmr-测试-20240619.zip


二進制
dist-tmr-测试-20240624.zip


二進制
dist-tmr-测试-20240710.zip


二進制
dist-tmr-测试2-20240619.zip


二進制
dist-tmr-测试线-20240603.zip


二進制
dist-tmr-测试线-20240607-2.zip


二進制
dist.-tmr-测试版-20240611.zip


+ 500 - 450
src/api/common.js

@@ -1,450 +1,500 @@
-import request from '@/utils/request'
-import parseTime from '@/utils/index.js'
-
-export function checkDates(data) {
-  return request({
-    url: '/authdata/checkDates',
-    method: 'post',
-    data
-  })
-}
-
-
-
-export function GetDataByName(data) {
-  return request({
-    url: '/authdata/GetDataByName',
-    method: 'post',
-    data
-  })
-}
-
-export function SyncSCJH(data) {
-  return request({
-    url: '/authdata/syncSCJH',
-    method: 'post',
-    data
-  })
-}
-
-
-export function processAnalysist(data) {
-  return request({
-    url: '/authdata/processAnalysist',
-    method: 'post',
-    data
-  })
-}
-
-export function ExeSqlJiade(data) {
-  return request({
-    url: '/authdata/exesql',
-    method: 'post',
-    data
-  })
-}
-export function dashboardListJiade(data) {
-  return request({
-    url: '/authdata/Dashboards',
-    method: 'post',
-    data
-  })
-}
-export function updateDashboardJiade(data) {
-  return request({
-    url: '/authdata/Updatedashboard',
-    method: 'post',
-    data
-  })
-}
-
-export function GetReportform(data) {
-  return request({
-    url: '/authdata/GetReportform',
-    method: 'post',
-    timeout: 600000,
-    data
-  })
-}
-export function requestbyname(data, requestname) {
-  return request({
-    url: '/authdata/' + requestname,
-    method: 'post',
-    data
-  })
-}
-
-export function GetDataByNameXlsx(data) {
-  return request({
-    url: '/authdata/GetDataByName',
-    method: 'post',
-    data,
-    responseType: 'blob'
-  })
-}
-
-export function GetDataByNames(data) {
-  return request({
-    url: '/authdata/GetDataByNames',
-    method: 'post',
-    data
-  })
-}
-
-export function PostDataByName(data) {
-  return request({
-    url: '/authdata/PostDataByName',
-    method: 'post',
-    data
-  })
-}
-export function GetUpkeepPlan(data) {
-  return request({
-    url: '/authdata/GetUpkeepPlan',
-    method: 'post',
-    data
-  })
-}
-export function GetAccount(data) {
-  return request({
-    url: '/authdata/GetAccount',
-    method: 'post',
-    timeout: 600000,
-    data
-  })
-}
-
-
-export function postJson(url,data) {
-  return request({
-    url: url,
-    method: 'post',
-    timeout: 600000,
-    data
-  })
-}
-
-export function postJson2(url,data) {
-  return request({
-    url: url,
-    method: 'post',
-    timeout: 600000,
-    data
-  })
-}
-
-export function getJson(url,data) {
-  return request({
-    url: url + data,
-    method: 'get'
-  })
-}
-
-export function getData(url,data) {
-  return request({
-    url: url,
-    method: 'post',
-    timeout: 600000,
-    data
-  })
-}
-
-export function PostDataByNames(data) {
-  return request({
-    url: '/authdata/PostDataByNames',
-    method: 'post',
-    data
-  })
-}
-
-export function ExecDataByConfig(data) {
-  return request({
-    url: '/authdata/ExecDataByConfig',
-    method: 'post',
-    data
-  })
-}
-
-export function getDorm(data) {
-  return request({
-    url: '/authdata/getDorm',
-    method: 'post',
-    timeout: 6000000,
-    data
-  })
-}
-
-export function removeimage(data) {
-  return request({
-    url: '/authdata/removeimage',
-    method: 'post',
-    data
-  })
-}
-
-export function getRecuData(data) {
-  return request({
-    url: '/authdata/GetRecuDataByName',
-    method: 'post',
-    data
-  })
-}
-export function Autogeneration(data) {
-  return request({
-    url: '/authdata/autogeneration',
-    method: 'post',
-    data
-  })
-}
-export function failproccess(data, notify) {
-  if (data.data.includes('Duplicate')) {
-    notify({
-      title: '失败',
-      message: '不可以录入重复数据',
-      type: 'error',
-      duration: 2000
-    })
-  } else {
-    notify({
-      title: '失败',
-      message: '数据存在错误,请校验好重新录入,不可以录入数据',
-      type: 'error',
-      duration: 2000
-    })
-  }
-}
-
-export function UpdateDataRelation(data) {
-  return request({
-    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
-  for (; i < len; i++) {
-    hash[a[i][id]] = a[i]
-  }
-  for (; j < len; j++) {
-    var aVal = a[j]; var hashVP = hash[aVal[pid]]
-    if (hashVP) {
-      !hashVP[children] && (hashVP[children] = [])
-      hashVP[children].push(aVal)
-    } else {
-      r.push(aVal)
-    }
-  }
-  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
-    }
-  }
-  return false
-}
-
-export function formatJson(filterVal, jsonData) {
-  return jsonData.map(v =>
-    filterVal.map(j => {
-      if (j === 'timestamp') {
-        return parseTime(v[j])
-      } else {
-        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)
-  }
-}
-// 取小数
-// export function formatNum(f, digit) {
-//   var m = Math.pow(10, digit);
-//   return parseInt(f * m, 10) / m;
-// }
-export function formatNum(value, n) {
-  console.log(value, n,'====')
-  var f = Math.round(value*Math.pow(10,n))/Math.pow(10,n);
-  var s = f.toString();
-  var rs = s.indexOf('.');
-  if(rs < 0) {
-    if(n==0){
-      s = s
-    }else{
-      s += '.';
-    }
-  }
-  for(var i = s.length - s.indexOf('.'); i <= n; i++){
-    s += "0";
-  }
-  return s;
-}
-
-export function compareSort(property){
-  return function(a,b){
-    var value1 = a[property];
-    var value2 = b[property];
-    return value1 - value2;
-  }
-}
-
-
-//将日期转换成一年中的第几周
-export function getYearWeek(date) {
-  //按照国际标准
-  let time,
-    week,
-    checkDate = new Date(date);
-  checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
-  time = checkDate.getTime();
-  checkDate.setMonth(0);
-  checkDate.setDate(1);
-  week = Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
-  return week;
-}
-
-//返回格式 2019年第23周,特别注意跨年一周的问题
-export function getYearAndWeek(date, anotherDate) {
-  let week = getYearWeek(date);
-  let year = date.substring(0, 4);
-  let anotherYear = anotherDate.substring(0, 4);
-  //处理跨年特殊日期
-  if (anotherDate > date) {
-    let betweenDay = getBetweenDay(new Date(date), new Date(anotherDate));
-    if (betweenDay == 7 && anotherYear != year) {
-      if (week == 1) {
-        year = parseInt(year) + 1;
-      }
-    }
-  } else {
-    let betweenDay = getBetweenDay(new Date(anotherDate), new Date(date));
-    if (betweenDay == 7 && anotherYear != year) {
-      if (week != 1) {
-        year = parseInt(year) - 1;
-      }
-    }
-  }
-  return `${year}年第${week}周`;
-}
-export function getBetweenDay(beginDate, endDate) {
-  let dateSpan = endDate - beginDate;
-  dateSpan = Math.abs(dateSpan);
-  let days = Math.floor(dateSpan / (24 * 3600 * 1000));
-  return days + 1;
-}
-//获取当前count个周的起止日期,如:count=0 ,就是当前周,-1就是上周,以此类推
-export function getWeekStartAndEnd(count, currentDate) {
-  //起止日期数组
-  let resultArr = new Array();
-  let millisecond = 1000 * 60 * 60 * 24;
-  currentDate = new Date(currentDate.getTime() + millisecond * 7 * count);
-  let week = currentDate.getDay();
-
-  //减去的天数
-  let minusDay = week != 0 ? week - 1 : 6;
-  //获得当前周的第一天
-  let currentWeekFirstDay = new Date(
-    currentDate.getTime() - millisecond * minusDay
-  );
-  //获得当前周的最后一天
-  let currentWeekLastDay = new Date(
-    currentWeekFirstDay.getTime() + millisecond * 6
-  );
-
-  resultArr.push(currentWeekFirstDay.format());
-  resultArr.push(currentWeekLastDay.format());
-  return resultArr;
-}
-Date.prototype.format = function() {
-  let s = "";
-  let mouth =
-    this.getMonth() + 1 >= 10
-      ? this.getMonth() + 1
-      : "0" + (this.getMonth() + 1);
-  let day = this.getDate() >= 10 ? this.getDate() : "0" + this.getDate();
-  s += this.getFullYear() + "-"; // 获取年份。
-  s += mouth + "-"; // 获取月份。
-  s += day; // 获取日。
-  return s; // 返回日期。
-};
-
-/**
- * @param date 传入的日期
- * @param num 加减的天数,加为正,减为负
- * @returns 格式化后的日期
- */
-export function addDays(date, num) {
-  date.setDate(date.getDate() + num);
-  return date.format();
-}
-
-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
-}
-
-// 计算一年中的每一周都是从几号到几号
-// 第一周为1月1日到 本年的 第一个周日
-// 第二周为 本年的 第一个周一 往后推到周日
-// 以此类推 再往后推52周。。。
-// 如果最后一周在12月31日之前,则本年有垮了54周,反之53周
-// 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
-    }
+import request from '@/utils/request'
+import parseTime from '@/utils/index.js'
+
+export function checkDates(data) {
+  return request({
+    url: '/authdata/checkDates',
+    method: 'post',
+    data
+  })
+}
+
+
+
+export function GetDataByName(data) {
+  return request({
+    url: '/authdata/GetDataByName',
+    method: 'post',
+    data
+  })
+}
+
+export function SyncSCJH(data) {
+  return request({
+    url: '/authdata/syncSCJH',
+    method: 'post',
+    data
+  })
+}
+
+
+export function processAnalysist(data) {
+  return request({
+    url: '/authdata/processAnalysist',
+    method: 'post',
+    data
+  })
+}
+
+export function ExeSqlJiade(data) {
+  return request({
+    url: '/authdata/exesql',
+    method: 'post',
+    data
+  })
+}
+export function dashboardListJiade(data) {
+  return request({
+    url: '/authdata/Dashboards',
+    method: 'post',
+    data
+  })
+}
+export function updateDashboardJiade(data) {
+  return request({
+    url: '/authdata/Updatedashboard',
+    method: 'post',
+    data
+  })
+}
+
+export function GetReportform(data) {
+  return request({
+    url: '/authdata/GetReportform',
+    method: 'post',
+    timeout: 600000,
+    data
+  })
+}
+export function requestbyname(data, requestname) {
+  return request({
+    url: '/authdata/' + requestname,
+    method: 'post',
+    data
+  })
+}
+
+export function GetDataByNameXlsx(data) {
+  return request({
+    url: '/authdata/GetDataByName',
+    method: 'post',
+    data,
+    responseType: 'blob'
+  })
+}
+
+export function GetDataByNames(data) {
+  return request({
+    url: '/authdata/GetDataByNames',
+    method: 'post',
+    data
+  })
+}
+
+export function PostDataByName(data) {
+  return request({
+    url: '/authdata/PostDataByName',
+    method: 'post',
+    data
+  })
+}
+export function GetUpkeepPlan(data) {
+  return request({
+    url: '/authdata/GetUpkeepPlan',
+    method: 'post',
+    data
+  })
+}
+export function GetAccount(data) {
+  return request({
+    url: '/authdata/GetAccount',
+    method: 'post',
+    timeout: 600000,
+    data
+  })
+}
+
+
+export function postJson(url,data) {
+  return request({
+    url: url,
+    method: 'post',
+    timeout: 600000,
+    data
+  })
+}
+
+export function postJson2(url,data) {
+  return request({
+    url: url,
+    method: 'post',
+    timeout: 600000,
+    data
+  })
+}
+
+export function getJson(url,data) {
+  return request({
+    url: url + data,
+    method: 'get'
+  })
+}
+
+export function getData(url,data) {
+  return request({
+    url: url,
+    method: 'post',
+    timeout: 600000,
+    data
+  })
+}
+
+export function PostDataByNames(data) {
+  return request({
+    url: '/authdata/PostDataByNames',
+    method: 'post',
+    data
+  })
+}
+
+export function ExecDataByConfig(data) {
+  return request({
+    url: '/authdata/ExecDataByConfig',
+    method: 'post',
+    data
+  })
+}
+
+export function getDorm(data) {
+  return request({
+    url: '/authdata/getDorm',
+    method: 'post',
+    timeout: 6000000,
+    data
+  })
+}
+
+export function removeimage(data) {
+  return request({
+    url: '/authdata/removeimage',
+    method: 'post',
+    data
+  })
+}
+
+export function getRecuData(data) {
+  return request({
+    url: '/authdata/GetRecuDataByName',
+    method: 'post',
+    data
+  })
+}
+export function Autogeneration(data) {
+  return request({
+    url: '/authdata/autogeneration',
+    method: 'post',
+    data
+  })
+}
+export function failproccess(data, notify) {
+  if (data.data.includes('Duplicate')) {
+    notify({
+      title: '失败',
+      message: '不可以录入重复数据',
+      type: 'error',
+      duration: 2000
+    })
+  } else {
+    notify({
+      title: '失败',
+      message: '数据存在错误,请校验好重新录入,不可以录入数据',
+      type: 'error',
+      duration: 2000
+    })
+  }
+}
+
+export function UpdateDataRelation(data) {
+  return request({
+    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
+  for (; i < len; i++) {
+    hash[a[i][id]] = a[i]
+  }
+  for (; j < len; j++) {
+    var aVal = a[j]; var hashVP = hash[aVal[pid]]
+    if (hashVP) {
+      !hashVP[children] && (hashVP[children] = [])
+      hashVP[children].push(aVal)
+    } else {
+      r.push(aVal)
+    }
+  }
+  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
+    }
+  }
+  return false
+}
+
+export function formatJson(filterVal, jsonData) {
+  return jsonData.map(v =>
+    filterVal.map(j => {
+      if (j === 'timestamp') {
+        return parseTime(v[j])
+      } else {
+        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)
+  }
+}
+// 取小数
+// export function formatNum(f, digit) {
+//   var m = Math.pow(10, digit);
+//   return parseInt(f * m, 10) / m;
+// }
+export function formatNum(value, n) {
+  console.log(value, n,'====')
+  var f = Math.round(value*Math.pow(10,n))/Math.pow(10,n);
+  var s = f.toString();
+  var rs = s.indexOf('.');
+  if(rs < 0) {
+    if(n==0){
+      s = s
+    }else{
+      s += '.';
+    }
+  }
+  for(var i = s.length - s.indexOf('.'); i <= n; i++){
+    s += "0";
+  }
+  return s;
+}
+
+export function compareSort(property){
+  return function(a,b){
+    var value1 = a[property];
+    var value2 = b[property];
+    return value1 - value2;
+  }
+}
+
+
+//将日期转换成一年中的第几周
+export function getYearWeek(date) {
+  //按照国际标准
+  let time,
+    week,
+    checkDate = new Date(date);
+  checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+  time = checkDate.getTime();
+  checkDate.setMonth(0);
+  checkDate.setDate(1);
+  week = Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+  return week;
+}
+
+//返回格式 2019年第23周,特别注意跨年一周的问题
+export function getYearAndWeek(date, anotherDate) {
+  let week = getYearWeek(date);
+  let year = date.substring(0, 4);
+  let anotherYear = anotherDate.substring(0, 4);
+  //处理跨年特殊日期
+  if (anotherDate > date) {
+    let betweenDay = getBetweenDay(new Date(date), new Date(anotherDate));
+    if (betweenDay == 7 && anotherYear != year) {
+      if (week == 1) {
+        year = parseInt(year) + 1;
+      }
+    }
+  } else {
+    let betweenDay = getBetweenDay(new Date(anotherDate), new Date(date));
+    if (betweenDay == 7 && anotherYear != year) {
+      if (week != 1) {
+        year = parseInt(year) - 1;
+      }
+    }
+  }
+  return `${year}年第${week}周`;
+}
+export function getBetweenDay(beginDate, endDate) {
+  let dateSpan = endDate - beginDate;
+  dateSpan = Math.abs(dateSpan);
+  let days = Math.floor(dateSpan / (24 * 3600 * 1000));
+  return days + 1;
+}
+//获取当前count个周的起止日期,如:count=0 ,就是当前周,-1就是上周,以此类推
+export function getWeekStartAndEnd(count, currentDate) {
+  //起止日期数组
+  let resultArr = new Array();
+  let millisecond = 1000 * 60 * 60 * 24;
+  currentDate = new Date(currentDate.getTime() + millisecond * 7 * count);
+  let week = currentDate.getDay();
+
+  //减去的天数
+  let minusDay = week != 0 ? week - 1 : 6;
+  //获得当前周的第一天
+  let currentWeekFirstDay = new Date(
+    currentDate.getTime() - millisecond * minusDay
+  );
+  //获得当前周的最后一天
+  let currentWeekLastDay = new Date(
+    currentWeekFirstDay.getTime() + millisecond * 6
+  );
+
+  resultArr.push(currentWeekFirstDay.format());
+  resultArr.push(currentWeekLastDay.format());
+  return resultArr;
+}
+Date.prototype.format = function() {
+  let s = "";
+  let mouth =
+    this.getMonth() + 1 >= 10
+      ? this.getMonth() + 1
+      : "0" + (this.getMonth() + 1);
+  let day = this.getDate() >= 10 ? this.getDate() : "0" + this.getDate();
+  s += this.getFullYear() + "-"; // 获取年份。
+  s += mouth + "-"; // 获取月份。
+  s += day; // 获取日。
+  return s; // 返回日期。
+};
+
+/**
+ * @param date 传入的日期
+ * @param num 加减的天数,加为正,减为负
+ * @returns 格式化后的日期
+ */
+export function addDays(date, num) {
+  date.setDate(date.getDate() + num);
+  return date.format();
+}
+
+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
+}
+
+// 计算一年中的每一周都是从几号到几号
+// 第一周为1月1日到 本年的 第一个周日
+// 第二周为 本年的 第一个周一 往后推到周日
+// 以此类推 再往后推52周。。。
+// 如果最后一周在12月31日之前,则本年有垮了54周,反之53周
+// 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
+    }
+
+
+
+   // 剩料新增
+    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 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 editWeightSL(data) {
+  return request({
+    url: '/authdata/plan2/edit',
+    method: 'POST',
+    data
+  })
+}

二進制
src/assets/dot.jpeg


+ 162 - 151
src/router/index.js

@@ -1,59 +1,59 @@
-import Vue from 'vue'
+import Vue from 'vue'
 import Router from 'vue-router'
-
-
-Vue.use(Router)
-
-/* Layout */
-import Layout from '@/layout'
-
-/**
- * Note: sub-menu only appear when route children.length >= 1
- * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
- *
- * hidden: true                   if set true, item will not show in the sidebar(default is false)
- * alwaysShow: true               if set true, will always show the root menu
- *                                if not set alwaysShow, when item has more than one children route,
- *                                it will becomes nested mode, otherwise not show the root menu
- * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
- * name:'router-name'             the name is used by <keep-alive> (must set!!!)
- * meta : {
-    roles: ['admin','editor']    control the page roles (you can set multiple roles)
-    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
-    icon: 'svg-name'             the icon show in the sidebar
-    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
-    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
-  }
- */
-
-/**
- * constantRoutes
- * 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
-  },
-
-  {
-    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 }
-    }]
+
+
+Vue.use(Router)
+
+/* Layout */
+import Layout from '@/layout'
+
+/**
+ * Note: sub-menu only appear when route children.length >= 1
+ * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
+ *
+ * hidden: true                   if set true, item will not show in the sidebar(default is false)
+ * alwaysShow: true               if set true, will always show the root menu
+ *                                if not set alwaysShow, when item has more than one children route,
+ *                                it will becomes nested mode, otherwise not show the root menu
+ * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
+ * name:'router-name'             the name is used by <keep-alive> (must set!!!)
+ * meta : {
+    roles: ['admin','editor']    control the page roles (you can set multiple roles)
+    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
+    icon: 'svg-name'             the icon show in the sidebar
+    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
+    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
+  }
+ */
+
+/**
+ * constantRoutes
+ * 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
+  },
+
+  {
+    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',
@@ -65,104 +65,115 @@ export const constantRoutes = [
       component: () => import('@/views/changpwd/changpwd/index'),
       meta: { title: '修改密码', icon: '修改密码', affix: false }
     }]
-  }
-]
-
-/**
- * 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'
-    },
-    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 }
-]
-
-const createRouter = () => new Router({
-  // mode: 'history', // require service support
-  scrollBehavior: () => ({ y: 0 }),
-  routes: constantRoutes
-})
-
-const router = createRouter()
-
-// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
-export function resetRouter() {
-  const newRouter = createRouter()
-  router.matcher = newRouter.matcher // reset router
+  },
+  // {
+  //   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'
+    },
+    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 }
+]
+
+const createRouter = () => new Router({
+  // mode: 'history', // require service support
+  scrollBehavior: () => ({ y: 0 }),
+  routes: constantRoutes
+})
+
+const router = createRouter()
+
+// 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 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)
-}
-
-export default router
+}
+
+export default router

+ 123 - 120
src/store/modules/permission.js

@@ -1,107 +1,107 @@
-// import { asyncRoutes, constantRoutes } from '@/router'
-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'
-
-function buildRouter(aMenu) {
-  const aRouter = []
-
-  aMenu.forEach(item => {
-    if (!validatenull(item.component)) {
-      const oRouter = {
-        meta: { 'title': '', 'icon': '' },
-        children: []
-      }
-
-      if (item.component !== 'Iframe') {
-        if (item.component === 'Layout') {
-          oRouter.component = Layout
+// import { asyncRoutes, constantRoutes } from '@/router'
+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'
+
+function buildRouter(aMenu) {
+  const aRouter = []
+
+  aMenu.forEach(item => {
+    if (!validatenull(item.component)) {
+      const oRouter = {
+        meta: { 'title': '', 'icon': '' },
+        children: []
+      }
+
+      if (item.component !== 'Iframe') {
+        if (item.component === 'Layout') {
+          oRouter.component = Layout
         } else {
-          oRouter.component = require('@/views/' + item.component + '.vue').default
-        }
+          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
-        } else {
-          oRouter.path = item.path
-        }
+          oRouter.id = item.id || null
+        if (item.redirect !== '') {
+          oRouter.redirect = item.redirect || null
+          oRouter.path = '/' + item.path
+        } else {
+          oRouter.path = item.path
+        }
         // console.log(item)
         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.breadcrumb = item.breadcrumb || true
-          oRouter.children = validatenull(item.children) ? [] : buildRouter(item.children)
-          aRouter.push(oRouter)
-        }
-      }
-    }
-  })
-
-  return aRouter
-}
-
-/**
- * Use meta.role to determine if the current user has permission
- * @param roles
- * @param route
- */
-function hasPermission(roles, route) {
-  if (route.meta && route.meta.roles) {
-    return roles.some(role => route.meta.roles.includes(role))
-  } else {
-    return true
-  }
-}
-
-/**
- * Filter asynchronous routing tables by recursion
- * @param routes asyncRoutes
- * @param roles
- */
-export function filterAsyncRoutes(routes, roles) {
-  const res = []
-
-  routes.forEach(route => {
-    const tmp = { ...route }
-    if (hasPermission(roles, tmp)) {
-      if (tmp.children) {
-        tmp.children = filterAsyncRoutes(tmp.children, roles)
-      }
-      res.push(tmp)
-    }
-  })
-
-  return res
-}
-
-const state = {
-  routes: [],
-  addRoutes: [],
+          oRouter.meta.icon = item.icon
+          oRouter.meta.title = item.title
+          // oRouter.meta.noCache = item.noCache || false
+          oRouter.meta.noCache = true
+          // oRouter.meta.breadcrumb = item.breadcrumb || true
+          oRouter.children = validatenull(item.children) ? [] : buildRouter(item.children)
+          aRouter.push(oRouter)
+        }
+      }
+    }
+  })
+
+  return aRouter
+}
+
+/**
+ * Use meta.role to determine if the current user has permission
+ * @param roles
+ * @param route
+ */
+function hasPermission(roles, route) {
+  if (route.meta && route.meta.roles) {
+    return roles.some(role => route.meta.roles.includes(role))
+  } else {
+    return true
+  }
+}
+
+/**
+ * Filter asynchronous routing tables by recursion
+ * @param routes asyncRoutes
+ * @param roles
+ */
+export function filterAsyncRoutes(routes, roles) {
+  const res = []
+
+  routes.forEach(route => {
+    const tmp = { ...route }
+    if (hasPermission(roles, tmp)) {
+      if (tmp.children) {
+        tmp.children = filterAsyncRoutes(tmp.children, roles)
+      }
+      res.push(tmp)
+    }
+  })
+
+  return res
+}
+
+const state = {
+  routes: [],
+  addRoutes: [],
   data1: {
-    name: 'getmenu',
-    idname: 'id',
-    parammaps: { id: -1 }
-  }
-}
-
-const mutations = {
+    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)
-  }
-}
-
-const actions = {
-  generateRoutes({ commit }, roles) {
-    return new Promise((resolve, reject) => {
+    // console.log(state,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++){
@@ -115,17 +115,20 @@ const actions = {
             }
           }
           console.log(response.data.list,'==========9999')
-          const menus  = transData(response.data.list, 'id', 'parentId', 'children')
-          // const menus = response.data
-          if (menus.length === 0) {
-            reject('menus data is null1')
+          // const arrRout = response.data.list.filter((item)=>{
+          //     return item.component != 'basicDate/leftoverManagement/index'
+          // })
+          const menus  = transData(response.data.list, 'id', 'parentId', 'children')
+          // const menus = response.data
+          if (menus.length === 0) {
+            reject('menus data is null1')
           }
-          const accessedRoutes = buildRouter(menus)
-          // final add 404
-          accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
-          // commit to stores
-          commit('SET_ROUTES', accessedRoutes)
-          // return for add to router
+          const accessedRoutes = buildRouter(menus)
+          // final add 404
+          accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
+          // commit to stores
+          commit('SET_ROUTES', accessedRoutes)
+          // return for add to router
           resolve(accessedRoutes)
         } else {
           const menus  = []
@@ -140,15 +143,15 @@ const actions = {
           commit('SET_ROUTES', accessedRoutes)
           // return for add to router
           resolve(accessedRoutes)
-        }
-      })
-    })
-  }
-}
-
-export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}
+        }
+      })
+    })
+  }
+}
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}

+ 17 - 0
src/styles/element-ui.scss

@@ -78,3 +78,20 @@
 .el-range-editor.el-input__inner {
   display: inline-flex !important;
 }
+
+//
+
+// 兼容safari列头与td对不齐问题
+// .el-table__header, .el-table__body, .el-table__footer{
+//   width:100% !important;
+//   table-layout: fixed !important;
+// }
+.el-table th .gutter{
+  display: table-cell!important;
+}
+.el-table th .cell{
+  display: table-cell!important;
+}
+.el-table--border th.gutter:last-of-type {
+  display: block!important;
+}

+ 6 - 4
src/utils/request.js

@@ -13,10 +13,10 @@ if (DoMainString) {
 
 var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
 var browserUrl = window.location.hostname
-console.log("========url===",reg.test(browserUrl))
-if (reg.test(browserUrl)){
-  URL = window.location.protocol +"//"+ browserUrl + ":8082"
-}
+// console.log("========url===",reg.test(browserUrl))
+// if (reg.test(browserUrl)){
+//   URL = window.location.protocol +"//"+ browserUrl + ":8082"
+// }
 
 Cookies.set('url',URL)
 console.log(process.env.VUE_APP_BASE_API,'===========URL1111')
@@ -32,10 +32,12 @@ 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')
 
     if (store.getters.token) {
       // let each request carry token

+ 26 - 18
src/views/basicData/defaultParameter/function/index.vue

@@ -1,4 +1,4 @@
-<template>
+<template>
   <div class="app-container" style="width: 90%;">
     <div class="el-icon-info" style="font-size: 30px;float: right;color: #009C69;" @click="handleDescription" />
     <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="250px" style="margin-top: 40px;margin-bottom:30px;">
@@ -182,6 +182,13 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="剩料编码:" prop="excess">
+            <el-input ref="excess" v-model="createTemp.excess" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料编码:" type="text" />
+          </el-form-item>
+        </el-col>
+      </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer" style="bottom: 10px;">
       <el-button v-if="isRoleEdit" class="save" :disabled="isokDisable" @click="handleSave">保存</el-button>
@@ -228,16 +235,16 @@
         <el-button class="cancelClose" @click="description.dialogFormVisible = false; ">关闭</el-button>
       </div>
     </el-dialog>
-  </div>
-</template>
-
+  </div>
+</template>
+
 <script>
-import { GetDataByName, GetDataByNames, failproccess, checkButtons, ExecDataByConfig } from '@/api/common'
+import { GetDataByName, 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: '否' }], // 是否可取前一天计划
@@ -256,8 +263,8 @@ export default {
       dataSynchronizationList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用数据同步
       accuracyList: [{ id: '1', name: '排除允许误差准确率' }, { id: '0', name: '不排除允许误差准确率' }],  //混料准确率
       yhautosecondList:[{ id: '1', name: '禁用' }, { id: '2', name: '3秒' }, { id: '3', name: '6秒' }, { id: '4', name: '9秒' }],  //预混跳转延时
-      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',
@@ -283,14 +290,14 @@ export default {
       isokDisable: false,
       requestParam: {}
 
-    }
-  },
+    }
+  },
   created() {
     this.getList()
     this.getButtons()
     this.getDownList()
-  },
-
+  },
+
   methods: {
     getButtons() {
       const Edit = 'DefaultParameter'
@@ -357,6 +364,7 @@ export default {
         tmrUnder:this.createTemp.tmrUnder,
         yhfeedtemplet:this.createTemp.yhfeedtemplet,
         yhautosecond:this.createTemp.yhautosecond,
+        excess:this.createTemp.excess
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
         pastureid: this.createTemp.pastureid
@@ -405,8 +413,8 @@ export default {
       this.description.dialogStatus = 'description'
       this.description.dialogFormVisible = true
     }
-  }
-}
+  }
+}
 </script>
 <style lang="scss" scoped>
   .app-description{
@@ -415,4 +423,4 @@ export default {
       display:flex;
     }
   }
-</style>
+</style>

File diff suppressed because it is too large
+ 716 - 714
src/views/basicData/feedTable/index.vue


+ 242 - 0
src/views/basicData/leftoverManagement/index.vue

@@ -0,0 +1,242 @@
+<template>
+  <div class="container">
+    <div class="header-box">
+      <p> 剩料计划</p>
+      <el-button type="primary" plain class="add-btn" @click="addBtn">新 增</el-button>
+    </div>
+
+    <div class="table">
+      <el-table
+       element-loading-text="给我一点时间"
+        :data="tableData"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        class="elTable table-fixed"
+        >
+        <el-table-column
+          label="序号"
+          width="60"
+          type="index"
+          >
+        </el-table-column>
+        <el-table-column
+          label="替代方案"
+          prop="surplus"
+          width="180">
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              class="miniSuccess"
+              icon="el-icon-edit-outline"
+              @click="handleEdit(scope.$index, scope.row)"></el-button>
+            <el-button
+              size="mini"
+              type="danger"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.$index, scope.row)"></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- <el-pagination
+      class="page"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :current-page.sync="currentPage1"
+      :page-size="100"
+      layout="total, prev, pager, next"
+      :total="1000">
+    </el-pagination> -->
+     </div>
+
+     <!-- 新增删除提示 -->
+     <el-dialog
+        :title="title"
+        :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">
+              <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>
+        <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>
+        </span>
+      </el-dialog>
+
+  </div>
+</template>
+
+<script>
+  import {
+    GetDataByName,
+    getSurplus,
+    addSurplus,
+    delSurplus
+  } from '@/api/common'
+  import Cookies from 'js-cookie'
+  import {
+    MessageBox
+  } from 'element-ui'
+  export default {
+    name: 'LeftoverManagement',
+    data() {
+      return {
+         pastureId:parseInt(Cookies.get('pastureid')),
+         title:"",
+         leftgetParams:{ // 获取下拉剩料列表
+          name: "getFeedData",          "page": 1,
+          offset: 1,
+          pagecount: "",
+          returntype: "Map",
+          parammaps: {
+          pastureid:  Cookies.get('pastureid'), // "1654779860",
+          fname: ""
+          }
+        },
+        leftList:[],
+        tableData: [],
+        currentPage1: 1,
+        dialogVisible:false,
+        ruleForm: {
+          id: 0,
+          pastureId: Cookies.get('pastureid'),
+          surplus: "",
+          feedId: ""
+        },
+        rules:{
+          surplus: [
+            { required: true, message: '请选择替代方案', trigger: 'change' }
+          ]
+        }
+      }
+    },
+    created() {
+      this.getLeftoverData();
+      this.getLeftTable();
+    },
+    methods: {
+      // 获取剩料列表
+     async getLeftTable(){
+        const {data} = await getSurplus(Cookies.get('pastureid'));
+        console.log(data,'table')
+        this.tableData = data;
+      },
+      // 点击新增按钮
+      addBtn(){
+        this.title ="剩料新增"
+        this.dialogVisible = true;
+        this.ruleForm={
+          id: 0,
+          pastureId: parseInt(Cookies.get('pastureid')),
+          surplus: "",
+          feedId: ""
+        };
+      },
+      // 获取下拉的数据
+      getLeftObj(obj){
+        this.ruleForm.feedId = obj.id;
+        this.ruleForm.surplus = obj.fname;
+        console.log(obj,this.ruleForm,'0000');
+      },
+      // 获取剩料下拉数据
+      async getLeftoverData(){
+        const { data }= await GetDataByName(this.leftgetParams);
+        this.leftList = data.list;
+      },
+
+      // 剩料新增
+      async addLeftData(){
+        const { data }  = await addSurplus(this.ruleForm);
+        if(data == true){
+          this.$message({
+                type: 'success',
+                message: this.title =="剩料新增"?'新增成功':"编辑成功"
+            });
+          this.dialogVisible = false;
+          this.getLeftTable();
+        } else{
+          this.$message({
+                type: 'error',
+                message: data
+            });
+        }
+
+      },
+
+      // 点击编辑
+      handleEdit(index, row) {
+        this.title = "剩料编辑";
+        this.ruleForm = row;
+        this.dialogVisible = true;
+      },
+      // 点击删除
+      handleDelete(index, row) {
+        this.$confirm('确定删除当前剩料信息吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+              delSurplus({id:row.id}).then(res=>{
+                const {data} = res;
+                if(data == true){
+                  this.getLeftTable();
+                  this.$message({
+                    type: 'success',
+                    message: '删除成功!'
+                  });
+                } else {
+                  this.$message({
+                    type: 'error',
+                    message: data
+                  });
+                }
+            })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });
+        })
+      },
+      //
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+      },
+      handleCurrentChange(val) {
+        console.log(`当前页: ${val}`);
+      }
+
+    },
+
+  }
+</script>
+
+<style lang="scss" scoped>
+  .header-box{
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .container{
+    padding: 15px;
+    min-height:600px;
+    margin-left:10px;
+    .add-btn{
+      width:90px;
+      height:40px;
+    }
+    .page{
+      margin-top:20px;
+    }
+  }
+</style>

+ 271 - 0
src/views/drawDot/index.vue

@@ -0,0 +1,271 @@
+<template>
+    <div id="app">
+
+      <!-- 图片区域 -->
+    <div class="box">
+        <div
+        ref="imageArea"
+        class="image-area"
+        @click="handleClick"
+      >
+        <img src="../../assets/dot.jpeg" alt="图片" class="image">
+        <template v-for="shape in shapes">
+          <div
+            v-for="(point, index) in shape.points"
+            :key="`shape-${shape.type}-point-${index}`"
+            :style="getPointStyle(point)"
+            class="point-marker"
+          ></div>
+          <div v-if="shape.type === '1' || shape.type === '2'"
+               :style="getRectangleStyle(shape.points)"
+               class="rectangle"
+          ></div>
+          <polyline v-if="shape.type === '3'"
+                    :points="getLinePoints(shape.points)"
+                    class="3"
+                    fill="none" stroke="red" stroke-width="2"/>
+        </template>
+        </div>
+
+      <!--  -->
+      <div>
+        <h3 style="padding-left: 20px;">鼠标点击获取图形坐标</h3>
+        <el-form :model="formObj" ref="formObj" label-width="120px" class="demo-dynamic">
+          <el-form-item label="区域类型:">
+              <el-radio-group v-model="currentShapeType" @change="changeType">
+                <el-radio label="1">卧床</el-radio>
+                <el-radio label="2">喷淋</el-radio>
+                <el-radio label="3">水槽</el-radio>
+              </el-radio-group>
+          </el-form-item>
+           <!-- 卧床 -->
+          <el-form-item
+            label="卧床(1):"
+            required
+             v-if=" currentShapeType == '1'"
+          >
+            <div v-if="formObj.bed.length>0"  key="1">
+              <div><span style="padding-right: 20px;">左上:{{ `X:${formObj.bed[0]?.x || ''}Y:${formObj.bed[0]?.y || ''}`}}</span>  <span>右上:{{ `X:${formObj.bed[1]?.x || ''}Y:${formObj.bed[1]?.y || ''}`}}</span></div>
+              <div><span style="padding-right: 20px;">左下:{{ `X:${formObj.bed[3]?.x || ''}Y:${formObj.bed[3]?.y || ''}`}}</span> <span>右下:{{ `X:${formObj.bed[2]?.x || ''}Y:${formObj.bed[2]?.y || ''}`}}</span></div>
+            </div>
+          </el-form-item>
+          <el-form-item
+            label="卧床(2):"
+            required
+            v-if=" currentShapeType == '1'"
+          >
+            <div v-if="formObj.bed1.length>0 " key="2">
+              <div><span style="padding-right: 20px;">左上:{{ `X:${formObj.bed1[0]?.x || ''}Y:${formObj.bed1[0]?.y || ''}`}}</span>  <span>右上:{{ `X:${formObj.bed1[1]?.x || ''}Y:${formObj.bed1[1]?.y || ''}`}}</span></div>
+              <div><span style="padding-right: 20px;">左下:{{ `X:${formObj.bed1[3]?.x || ''}Y:${formObj.bed1[3]?.y || ''}`}}</span> <span>右下:{{ `X:${formObj.bed1[2]?.x || ''}Y:${formObj.bed1[2]?.y || ''}`}}</span></div>
+            </div>
+          </el-form-item>
+          <!--喷淋  -->
+          <el-form-item
+            label="喷淋:"
+            required
+                   v-if=" currentShapeType == '2'"
+          >
+            <div v-if="formObj.spray.length>0 && currentShapeType == '2' " key="1">
+              <div><span style="padding-right: 20px;">左上:{{ `X:${formObj.spray[0]?.x || ''}Y:${formObj.spray[0]?.y || ''}`}}</span>  <span>右上:{{ `X:${formObj.spray[1]?.x || ''}Y:${formObj.spray[1]?.y || ''}`}}</span></div>
+              <div><span style="padding-right: 20px;">左下:{{ `X:${formObj.spray[3]?.x || ''}Y:${formObj.spray[3]?.y || ''}`}}</span> <span>右下:{{ `X:${formObj.spray[2]?.x || ''}Y:${formObj.spray[2]?.y || ''}`}}</span></div>
+            </div>
+          </el-form-item>
+          <!--水槽  -->
+          <el-form-item
+            label="水槽:"
+            required
+            v-if=" currentShapeType == '3'"
+          >
+            <div v-if="formObj.sprayList.length>0  " key="1">
+              <div v-for="(item,index) in formObj.sprayList" :key="index"><span style="padding-right: 20px;" >第{{index+1}}点:{{ `X:${item?.x || ''}Y:${item?.y || ''}`}}</span> </div>
+            </div>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="submitForm('formObj')">确认提交</el-button>
+            <el-button @click="handleConfirm">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+  </div>
+     
+  
+      <!-- 显示当前形状的坐标点 -->
+      <pre>{{ shapes }}</pre>
+    </div>
+  </template>
+  
+  <script>
+  export default {
+    data() {
+      return {
+        currentShapeType: '1',
+        shapes: [],
+        currentPoints: [],
+        
+        formObj: {
+          type:'1',
+          bed:[],
+          bed1:[],
+          spray:[],
+          sprayList:[]
+        }
+      };
+    },
+    methods: {
+      changeType(val){
+        this.currentShapeType = val;
+        this.currentPoints = [];
+      },
+      resetShape() {
+        this.currentPoints = [];
+      },
+      handleClick(event) {
+        const rect = this.$refs.imageArea.getBoundingClientRect();
+        const x = event.clientX - rect.left;
+        const y = event.clientY - rect.top;
+        this.currentPoints.push({ x, y });
+        if(this.currentShapeType == '1'){
+            if(this.formObj.bed.length < 4){
+              this.formObj.bed.push({ x, y });
+            }else{
+              this.formObj.bed1.push({ x, y });
+            }
+            console.log( this.formObj.bed,'hss')
+          } else if (this.currentShapeType == '2') {
+            this.formObj.spray=[...this.currentPoints]
+          } else if(this.currentShapeType == '3'){
+            this.formObj.sprayList = [...this.currentPoints]
+          }
+        const requiredPoints = this.getRequiredPointsForShape(this.currentShapeType);
+  
+        if (this.currentPoints.length === requiredPoints) {
+          this.shapes.push({
+            type: this.currentShapeType,
+            points: [...this.currentPoints],
+          });
+         
+          this.currentPoints = [];
+        }
+      },
+      getRequiredPointsForShape(shapeType) {
+        switch (shapeType) {
+          case '1':
+            return 4;
+          case '2':
+            return 4;
+          case '3':
+            return 8; // Example: 10 points for the 3
+          default:
+            return 4;
+        }
+      },
+      getPointStyle(point) {
+        return {
+          top: `${point.y}px`,
+          left: `${point.x}px`,
+          position: 'absolute',
+          width: '10px',
+          height: '10px',
+          backgroundColor: 'blue',
+          borderRadius: '50%',
+        };
+      },
+      getRectangleStyle(points) {
+        if (points.length < 4) return {};
+        const [leftup, leftdown, rightup, rightdown] = points;
+        const width = Math.abs(rightup.x - leftup.x);
+        const height = Math.abs(leftdown.y - rightdown.y);
+        return {
+          top: `${leftup.y}px`,
+          left: `${leftup.x}px`,
+          width: `${width}px`,
+          height: `${height}px`,
+          border: '2px solid red',
+          position: 'absolute',
+        };
+      },
+      getLinePoints(points) {
+        return points.map(point => `${point.x},${point.y}`).join(' ');
+      },
+  // 重置
+  handleConfirm(){
+    this.currentPoints = []
+    this.shapes= []
+    this.currentShapeType = '1';
+    this.formObj ={
+      bed:[],
+      bed1:[],
+      spray:[],
+      sprayList:[]
+    }
+    
+  },
+      // 
+      submitForm(formName) {
+      console.log(this.formObj,'提交')
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            alert('submit!');
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+      },
+      resetForm(formName) {
+        this.$refs[formName].resetFields();
+      },
+      removeDomain(item) {
+        var index = this.formObj.bedList.indexOf(item)
+        if (index !== -1) {
+          this.formObj.bedList.splice(index, 1)
+        }
+      },
+      addDomain() {
+        this.formObj.bedList.push({
+          value: '',
+          key: Date.now()
+        });
+      }
+
+
+    },
+  };
+  </script>
+  
+  <style scoped>
+  .el-button {
+    padding:10px;
+  }
+  .box{ 
+    display: flex;
+    
+  }
+    .image-area {
+    position: relative;
+    width: 100%;
+    height: auto;
+    display: inline-block;
+    width:700px;
+    height:600px;
+  }
+  .image {
+    width: 100%;
+    height: auto;
+  }
+  .rectangle {
+    border: 2px solid red;
+    position: absolute;
+  }
+  .point-marker {
+    position: absolute;
+  }
+  .3 {
+    position: absolute;
+    fill: none;
+    stroke: red;
+    stroke-width: 2px;
+  }
+  </style>
+  

File diff suppressed because it is too large
+ 477 - 187
src/views/formulationPlan/dailyExecutionPlan/index.vue


+ 11 - 0
src/views/formulationPlan/dailyExecutionPlan/revisePlan.vue

@@ -121,6 +121,12 @@ export default {
         this.requestParam.parammaps = {}
         this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
         this.requestParam.parammaps.date = this.date
+        const loading =  this.$loading({
+          lock: true,
+          text: 'Loading',
+          spinner: 'el-icon-loading',
+          background: 'rgba(0, 0, 0, 0.7)'
+        });
         PostDataByName(this.requestParam).then(response => {
           if (response.msg === 'fail') {
             this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
@@ -129,7 +135,12 @@ export default {
             this.closeDialog()
             this.$parent.getList()
           }
+             
+          setTimeout(() => {
+            loading.close()
+          }, 5000);
         })
+
       }).catch(() => {
         this.$message({ type: 'info', message: '已取消应用' })
       })

File diff suppressed because it is too large
+ 420 - 422
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue


+ 41 - 13
src/views/formulationPlan/dhedFormula/index.vue

@@ -273,12 +273,13 @@
       <div class="app-history">
         <div class="search">
           <el-date-picker v-model="history.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
-          <!-- <el-select v-model="history.getdataListParm.parammaps.barid" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
-            <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.id" />
+          <el-select v-model="history.getdataListParm.parammaps.barName" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
+            <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.bname" />
           </el-select>
-          <el-input v-model="history.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" />
-          <el-button class="successBorder" @click="handleHistorySearch">查询</el-button> -->
-          <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
+          <!-- <el-input v-model="history.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" /> -->
+          <el-button class="successBorder" @click="handleHistorySearch">查询</el-button>
+          <el-button class="export" icon="el-icon-upload2"  @click="handleExport(3)">导出</el-button>
+
         </div>
         <div class="table">
           <u-table
@@ -1146,6 +1147,10 @@ export default {
   },
 
   methods: {
+    handleHistorySearch(){
+      this.table
+      this.getDateList()
+    },
     getButtons() {
       const Edit = 'DhedFormula'
       const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
@@ -1681,9 +1686,10 @@ export default {
     // ratio系数
     // ccountratio系数牛头数
     blurCcount(row) { // 实际牛头数
+       console.log(row,'洗漱---')
       if (row.ftid !== '-1' && row.ftid !== '') {
-        row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
-        row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
+        row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid)?.Sfweight || "0.0"
+        row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid)?.SfweightLock || "0.0"
       }
       if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
       if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
@@ -3182,7 +3188,22 @@ export default {
           ]
           json2excel(excelDatas, '栏舍配方导入模板', true, 'xlsx')
         })
-      } else {
+      } else if (item == 3){
+        GetDataByName(this.history.getdataDateParm).then(response => {
+        console.log('历史数据', this.history.list)
+        if (response.data.list !== null) {
+          var excelDatas = [
+              {
+                tHeader: ['栏舍名称','班次', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '班次比例', '班次重量',  '配方重量', '配方干物质', '饲喂干物质量','采样干物质量','日投喂量'],
+                filterVal: ['barname', 'times','softccount', 'ccount', 'ratio', 'ccountratio', 'ptname', 'tratio', 'weight', 'pweight', 'dryweight', 'swdryw', 'cydryw','sumweight'],
+                tableDatas: this.history.list,
+                sheetName: 'Sheet1'
+              }
+            ]
+          json2excel(excelDatas, '历史记录栏舍配方', true, 'xlsx')
+        }
+      })
+      }else {
         console.log('点击了导出数据')
         this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
         GetDataByName(this.download.getdataListParm).then(response => {
@@ -3293,6 +3314,8 @@ export default {
           json2excel(excelDatas, '栏舍配方', true, 'xlsx')
         })
       }
+
+
     },
 
     beforeImport(file) {
@@ -3371,19 +3394,23 @@ export default {
       // row.Edit
     },
     focusData(row){
-      console.log(row,'row')
+      // console.log(row,'row')
       this.oldList.forEach((item,key)=>{
         if(row.id == item.id){
-          this.oldRowList = {...item}
+          this.oldRowList = { ...item }
+          // item = {...row}
         }
       })
-      console.log(this.oldRowList,'row')
+      // console.log(this.oldRowList,'row')
     },
     handle_batchEdit_save(){
+      console.log(this.oldList, 'oldList')
+      console.log(this.table.list, 'this.table.list')
       const arr = this.table.list.filter(item2 => {
-        console.log(item2,'item2')
-          return !this.oldList.some(item1 => item1.r1 === item2.r1 && item1.r2 === item2.r2 && item1.r3 === item2.r3 && item1.r4 === item2.r4 && item1.r5 === item2.r5 && item1.r6 === item2.r6);
+        // console.log(item2,'item2')
+          return !this.oldList.some(item1 => item1.ccount == item2.ccount && item1.r1 === item2.r1 && item1.r2 === item2.r2 && item1.r3 === item2.r3 && item1.r4 === item2.r4 && item1.r5 === item2.r5 && item1.r6 === item2.r6);
       });
+      console.log(arr,'arr')
       const barList = []
       arr.forEach((item)=>{
         let obj = {}
@@ -3400,6 +3427,7 @@ export default {
         obj.times6 = item.r6
         barList.push(obj)
       })
+      console.log(barList,'barList')
       const url = 'authdata/fpdetail/batch/edit'
       let data = {
         pastureId:Cookies.get('pastureid'),

+ 81 - 2
src/views/formulationPlan/recipeTemplate/index.vue

@@ -151,6 +151,15 @@
                 <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)" />
@@ -846,8 +855,9 @@
   </div>
 </template>
 
+
 <script>
-import { GetDataByName, GetDataByNames, PostDataByName, failproccess, checkButtons, postJson, ExecDataByConfig, formatNum } from '@/api/common'
+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'
@@ -856,11 +866,15 @@ 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 {
+      tableData:[],
+      chooseTableData:[],
       dialogFull: false,
       predefineColors: [
         '#E57373', '#F06292', '#BA68C8', '#9575CD', '#7986CB', '#64B5F6', '#4FC3F7', '#4DD0E1', '#4DB6AC', '#81C784', '#AED581', '#DCE775', '#FFF176', '#FFD54F', '#FFB74D', '#FF8A65', '#A1887F', '#E0E0E0', '#90A4AE'
@@ -1175,8 +1189,54 @@ export default {
     this.getButtons()
     this.getDownList()
     this.getIsLockCount()
+    this.getLeftTable();
   },
   methods: {
+      // 获取替代方案的名字
+      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)
@@ -1392,6 +1452,7 @@ export default {
       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
       }
@@ -1433,6 +1494,7 @@ export default {
       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 !== '输入非法字符') {
@@ -1444,6 +1506,7 @@ export default {
     },
     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)
@@ -1486,6 +1549,8 @@ export default {
 
     // 模板编辑
     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 })
@@ -1505,9 +1570,11 @@ export default {
       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) {
-      console.log('点击了编辑保存', row)
+
       this.table.temp.tname = row.tname
       this.table.temp.tcode = row.tcode
       this.table.temp.tcolor = row.tcolor
@@ -1522,6 +1589,9 @@ export default {
       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
       }
@@ -1563,6 +1633,7 @@ export default {
       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 !== '输入非法字符') {
@@ -1582,6 +1653,11 @@ export default {
       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)
@@ -1597,6 +1673,7 @@ export default {
             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')
@@ -2497,6 +2574,7 @@ export default {
 
     // 详情编辑
     handleUpdate2(row) {
+      console.log('hssssssss')
       console.log('详情编辑', row)
       this.dropState = true
       row.isGroupDisabled = false
@@ -3430,6 +3508,7 @@ export default {
   }
 }
 </script>
+
 <style lang="scss" scoped>
   // .search{margin-top:10px;height: 40px;}
   // .operation{height: 50px;}

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

@@ -0,0 +1,3547 @@
+<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>

+ 242 - 0
src/views/leftoverManagement/index.vue

@@ -0,0 +1,242 @@
+<template>
+  <div class="container">
+    <div class="header-box">
+      <p> 剩料计划</p>
+      <el-button type="primary" plain class="add-btn" @click="addBtn">新 增</el-button>
+    </div>
+
+    <div class="table">
+      <el-table
+       element-loading-text="给我一点时间"
+        :data="tableData"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        class="elTable table-fixed"
+        >
+        <el-table-column
+          label="序号"
+          width="60"
+          type="index"
+          >
+        </el-table-column>
+        <el-table-column
+          label="替代方案"
+          prop="surplus"
+          width="180">
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              class="miniSuccess"
+              icon="el-icon-edit-outline"
+              @click="handleEdit(scope.$index, scope.row)"></el-button>
+            <el-button
+              size="mini"
+              type="danger"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.$index, scope.row)"></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- <el-pagination
+      class="page"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :current-page.sync="currentPage1"
+      :page-size="100"
+      layout="total, prev, pager, next"
+      :total="1000">
+    </el-pagination> -->
+     </div>
+
+     <!-- 新增删除提示 -->
+     <el-dialog
+        :title="title"
+        :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">
+              <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>
+        <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>
+        </span>
+      </el-dialog>
+
+  </div>
+</template>
+
+<script>
+  import {
+    GetDataByName,
+    getSurplus,
+    addSurplus,
+    delSurplus
+  } from '@/api/common'
+  import Cookies from 'js-cookie'
+  import {
+    MessageBox
+  } from 'element-ui'
+  export default {
+    name: 'LeftoverManagement',
+    data() {
+      return {
+         pastureId:parseInt(Cookies.get('pastureid')),
+         title:"",
+         leftgetParams:{ // 获取下拉剩料列表
+          name: "getFeedData",          "page": 1,
+          offset: 1,
+          pagecount: "",
+          returntype: "Map",
+          parammaps: {
+          pastureid:  Cookies.get('pastureid'), // "1654779860",
+          fname: ""
+          }
+        },
+        leftList:[],
+        tableData: [],
+        currentPage1: 1,
+        dialogVisible:false,
+        ruleForm: {
+          id: 0,
+          pastureId: Cookies.get('pastureid'),
+          surplus: "",
+          feedId: ""
+        },
+        rules:{
+          surplus: [
+            { required: true, message: '请选择替代方案', trigger: 'change' }
+          ]
+        }
+      }
+    },
+    created() {
+      this.getLeftoverData();
+      this.getLeftTable();
+    },
+    methods: {
+      // 获取剩料列表
+     async getLeftTable(){
+        const {data} = await getSurplus(Cookies.get('pastureid'));
+        console.log(data,'table')
+        this.tableData = data;
+      },
+      // 点击新增按钮
+      addBtn(){
+        this.title ="剩料新增"
+        this.dialogVisible = true;
+        this.ruleForm={
+          id: 0,
+          pastureId: parseInt(Cookies.get('pastureid')),
+          surplus: "",
+          feedId: ""
+        };
+      },
+      // 获取下拉的数据
+      getLeftObj(obj){
+        this.ruleForm.feedId = obj.id;
+        this.ruleForm.surplus = obj.fname;
+        console.log(obj,this.ruleForm,'0000');
+      },
+      // 获取剩料下拉数据
+      async getLeftoverData(){
+        const { data }= await GetDataByName(this.leftgetParams);
+        this.leftList = data.list;
+      },
+
+      // 剩料新增
+      async addLeftData(){
+        const { data }  = await addSurplus(this.ruleForm);
+        if(data == true){
+          this.$message({
+                type: 'success',
+                message: this.title =="剩料新增"?'新增成功':"编辑成功"
+            });
+          this.dialogVisible = false;
+          this.getLeftTable();
+        } else{
+          this.$message({
+                type: 'error',
+                message: data
+            });
+        }
+
+      },
+
+      // 点击编辑
+      handleEdit(index, row) {
+        this.title = "剩料编辑";
+        this.ruleForm = row;
+        this.dialogVisible = true;
+      },
+      // 点击删除
+      handleDelete(index, row) {
+        this.$confirm('确定删除当前剩料信息吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+              delSurplus({id:row.id}).then(res=>{
+                const {data} = res;
+                if(data == true){
+                  this.getLeftTable();
+                  this.$message({
+                    type: 'success',
+                    message: '删除成功!'
+                  });
+                } else {
+                  this.$message({
+                    type: 'error',
+                    message: data
+                  });
+                }
+            })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });
+        })
+      },
+      //
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+      },
+      handleCurrentChange(val) {
+        console.log(`当前页: ${val}`);
+      }
+
+    },
+
+  }
+</script>
+
+<style lang="scss" scoped>
+  .header-box{
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .container{
+    padding: 15px;
+    min-height:600px;
+    margin-left:10px;
+    .add-btn{
+      width:90px;
+      height:40px;
+    }
+    .page{
+      margin-top:20px;
+    }
+  }
+</style>

File diff suppressed because it is too large
+ 834 - 773
src/views/shedProduction/materialRemainingRecord/index.vue


+ 20 - 17
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -725,7 +725,7 @@
             class="elTable table-fixed"
             :height="myHeightSecond"
           >
-            <u-table-column sortable label="日期" min-width="70px" align="center" prop="日期" />
+            <u-table-column sortable label="日期" min-width="70px" :key="Math.random()" align="center" prop="日期" />
             <u-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
             <u-table-column sortable label="操作编号" min-width="70px" align="center" prop="sort" />
             <u-table-column sortable label="车次" min-width="50px" align="center" prop="车次" />
@@ -813,7 +813,7 @@
             class="elTable table-fixed"
             :height="myHeightThird"
           >
-            <u-table-column sortable label="日期" min-width="70px" align="center" prop="日期" />
+            <u-table-column sortable label="日期" min-width="70px" :key="Math.random()" align="center" prop="日期" />
             <u-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
             <u-table-column sortable label="操作编号" min-width="70px" align="center" prop="sort" />
             <u-table-column sortable label="车次" min-width="45px" align="center" prop="车次" />
@@ -845,10 +845,10 @@
       </el-tab-pane>
     </el-tabs>
     <!-- 导出 -->
-    <el-dialog :title="textMap[exportList.dialogStatus]" :visible.sync="exportList.dialogFormVisible" :close-on-click-modal="false" width="20%">
+    <el-dialog :title="textMap[exportList.dialogStatus]" :visible.sync="exportList.dialogFormVisible" :close-on-click-modal="false" width="40%">
     <div>
       <span>导出时间范围:</span>
-      <el-date-picker v-model="exportList.inputDatetime" :clearable="false" style="width: 230px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2" />
+      <el-date-picker v-model="exportList.inputDatetime" :clearable="false" style="width: 280px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2" />
     </div>
     <div slot="footer" class="dialog-footer" style="margin-bottom: 10px;">
       <el-button class="cancelClose" @click="exportList.dialogFormVisible = false">关闭</el-button>
@@ -1419,7 +1419,7 @@ export default {
               pastureid: Cookies.get('pastureid'),
               startTime: parseTime(new Date(), '{y}-{m}-{d}'),
               stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
-              inputDatetime: [new Date(), new Date()],
+              inputDatetime:  [new Date(), new Date()],
               inputDate:null,
               fname: '',
               sort: '',
@@ -1811,7 +1811,7 @@ export default {
       cellStyle: { padding: 0 + 'px' },
       exportList:{
         dialogFormVisible:false,
-        inputDatetime: [new Date(), new Date()]
+        inputDatetime:  [new Date(), new Date()],
       },
       textMap: {
         exportList: '导出',
@@ -2874,10 +2874,10 @@ export default {
         this.getChart4()
         this.getChart5()
         this.getChart6()
-        this.$nextTick(() => {
-          this.$refs.plTable3.doLayout()
-          this.$refs.plTable3.doLayout()
-        })
+        // this.$nextTick(() => {
+        //   this.$refs.plTable3.doLayout()
+        //   // this.$refs.plTable3.doLayout()
+        // })
       } else if (this.activeName == 'second') {
         this.$nextTick(()=>{
             this.myHeightSecond = document.documentElement.clientHeight - 40 - this.$refs.myHeightSecond.offsetHeight - 150
@@ -2893,9 +2893,9 @@ export default {
             this.tab2.table.getdataListParm.parammaps.templetname = ''
             this.getTab2List()
             this.getTMRNameList2()
-            this.$nextTick(() => {
-              this.$refs.plTable3.doLayout()
-            })
+            // this.$nextTick(() => {
+            //   this.$refs.plTable3.doLayout()
+            // })
         })
       } else if (this.activeName == 'third') {
         this.$nextTick(()=>{
@@ -2913,9 +2913,9 @@ export default {
           this.tab3.table.getdataListParm.parammaps.buttontype = ''
           this.getTab3List()
           this.getTMRNameList3()
-          this.$nextTick(() => {
-            this.$refs.plTable3.doLayout()
-          })
+          // this.$nextTick(() => {
+          //   this.$refs.plTable3.doLayout()
+          // })
         })
       }
 
@@ -4732,6 +4732,8 @@ export default {
     handleExport3() {
       this.exportList.dialogFormVisible = true
       this.exportList.dialogStatus = 'exportList'
+      console.log(this.tab3.table.getdataListParm.parammaps.inputDatetime,'999')
+      this.exportList.inputDatetime = this.tab3.table.getdataListParm.parammaps.inputDatetime ||  [new Date(), new Date()]
       // var excelDatasTab3 = [
       //   {
       //     tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
@@ -4758,8 +4760,9 @@ export default {
       data.parammaps.buttontype = this.tab3.table.getdataListParm.parammaps.buttontype
       data.parammaps.templetname = this.tab3.table.getdataListParm.parammaps.templetname
       data.parammaps.isuse = this.tab3.table.getdataListParm.parammaps.isuse
+      data.parammaps.fname = this.tab3.table.getdataListParm.parammaps.fname
       postJson(url,data).then(response => {
-        console.log('混料统计table数据', response.data.list)
+        console.log('hss-撒料', response.data.list)
         var exportList = []
         if (response.data.list !== null) {
           exportList = response.data.list

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

@@ -38,28 +38,28 @@
             class="elTable table-fixed"
             :max-height="myHeight"
           >
-            <el-table-column v-if="tab.isFormulaName" sortable label="配方模板" min-width="70px" align="center" prop="配方模板" />
-            <el-table-column v-if="tab.isHouseName" sortable label="栏舍" min-width="70px" align="center" prop="栏舍" />
-            <el-table-column v-if="tab.isHouseName" sortable label="配方模板" min-width="70px" align="center" prop="配方模板" />
-            <el-table-column v-if="tab.isLivestockType" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
-            <el-table-column sortable label="实际牛头数" min-width="60px" align="center" prop="实际牛头数" />
-            <el-table-column sortable label="应混料量(kg)" min-width="60px" align="center" prop="应混料量" />
-            <el-table-column sortable label="实际混料量(kg)" min-width="70px" align="center" prop="实际混料量" />
-            <el-table-column sortable label="撒料量(kg)" min-width="60px" align="center" prop="撒料量" />
-            <el-table-column sortable label="平均混料时间" min-width="70px" align="center" prop="混料时间" />
-            <el-table-column sortable label="转投剩料量(kg)" min-width="70px" align="center" prop="转投剩料量" />
-            <el-table-column sortable label="昨日剩料量(kg)" min-width="70px" align="center" prop="今日剩料量" />
-            <el-table-column sortable label="剩料率(%)" min-width="60px" align="center" prop="剩料率" />
-            <el-table-column sortable label="TMR干物质(%)" min-width="65px" align="center" prop="TMR干物质" />
+            <el-table-column v-if="tab.isFormulaName" sortable label="配方模板"  align="center" prop="配方模板" />
+            <el-table-column v-if="tab.isHouseName" sortable label="栏舍"  align="center" prop="栏舍" />
+            <el-table-column v-if="tab.isHouseName" sortable label="配方模板" align="center" prop="配方模板" />
+            <el-table-column v-if="tab.isLivestockType" sortable label="牲畜类别" 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="转投剩料量(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="配方干物质采食量" />
             <el-table-column sortable label="实际干物质采食量(kg/头)" min-width="80px" align="center" prop="实际干物质采食量" />
-            <el-table-column sortable label="采食率(%)" min-width="60px" align="center" prop="采食率" />
-            <el-table-column sortable label="配方理论成本" min-width="60px" align="center" prop="feedtempletPrice" />
-            <el-table-column sortable label="配方成本(元/头)" min-width="65px" align="center" prop="配方成本" />
-            <el-table-column sortable label="实际成本(元/头)" min-width="65px" align="center" prop="实际成本" />
-            <el-table-column sortable label="产奶量(kg/头)" min-width="65px" align="center" prop="产奶量" />
-            <el-table-column sortable label="饲料转化率(%)" min-width="60px" align="center" prop="饲料转化率" />
-            <el-table-column sortable label="公斤奶饲料成本" min-width="60px" align="center" prop="公斤奶饲料成本" />
+            <el-table-column sortable label="采食率(%)"  align="center" prop="采食率" />
+            <el-table-column sortable label="配方理论成本"  align="center" prop="feedtempletPrice" />
+            <el-table-column sortable label="配方成本(元/头)" 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="饲料转化率(%)"  align="center" prop="饲料转化率" />
+            <el-table-column sortable label="公斤奶饲料成本"  align="center" prop="公斤奶饲料成本" />
           </el-table>
           <span v-if="tab.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table.total }}条</span>
         </div>
@@ -424,15 +424,15 @@
                 class="elTable table-fixed"
                 height="400px"
               >
-                <el-table-column sortable label="宾州筛" min-width="60px" align="center" prop="barname" />
-                <el-table-column sortable label="第一层重量" min-width="60px" align="center" prop="oneweight" />
-                <el-table-column sortable label="第一层百分比" min-width="60px" align="center" prop="onerate" />
-                <el-table-column sortable label="第二层重量" min-width="60px" align="center" prop="twoweight" />
-                <el-table-column sortable label="第二层百分比" min-width="60px" align="center" prop="tworate" />
-                <el-table-column sortable label="第三层重量" min-width="60px" align="center" prop="threeweight" />
-                <el-table-column sortable label="第三层百分比" min-width="60px" align="center" prop="threerate" />
-                <el-table-column sortable label="第四层重量" min-width="60px" align="center" prop="fourweight" />
-                <el-table-column sortable label="第四层百分比" min-width="60px" align="center" prop="fourrate" />
+                <el-table-column sortable label="宾州筛"  align="center" prop="barname" />
+                <el-table-column sortable label="第一层重量"  align="center" prop="oneweight" />
+                <el-table-column sortable label="第一层百分比"  align="center" prop="onerate" />
+                <el-table-column sortable label="第二层重量"  align="center" prop="twoweight" />
+                <el-table-column sortable label="第二层百分比"  align="center" prop="tworate" />
+                <el-table-column sortable label="第三层重量"  align="center" prop="threeweight" />
+                <el-table-column sortable label="第三层百分比"  align="center" prop="threerate" />
+                <el-table-column sortable label="第四层重量"  align="center" prop="fourweight" />
+                <el-table-column sortable label="第四层百分比"  align="center" prop="fourrate" />
                 <el-table-column sortable label="参考标准" min-width="50px" align="center" prop="standard" />
               </el-table>
             </el-col>
@@ -452,13 +452,13 @@
                 class="elTable table-fixed"
                 height="400px"
               >
-                <el-table-column sortable label="粪便筛" min-width="60px" align="center" prop="barname" />
-                <el-table-column sortable label="第一层重量" min-width="60px" align="center" prop="oneweight" />
-                <el-table-column sortable label="第一层百分比" min-width="60px" align="center" prop="onerate" />
-                <el-table-column sortable label="第二层重量" min-width="60px" align="center" prop="twoweight" />
-                <el-table-column sortable label="第二层百分比" min-width="60px" align="center" prop="tworate" />
-                <el-table-column sortable label="第三层重量" min-width="60px" align="center" prop="threeweight" />
-                <el-table-column sortable label="第三层百分比" min-width="60px" align="center" prop="threerate" />
+                <el-table-column sortable label="粪便筛"  align="center" prop="barname" />
+                <el-table-column sortable label="第一层重量"  align="center" prop="oneweight" />
+                <el-table-column sortable label="第一层百分比"  align="center" prop="onerate" />
+                <el-table-column sortable label="第二层重量"  align="center" prop="twoweight" />
+                <el-table-column sortable label="第二层百分比"  align="center" prop="tworate" />
+                <el-table-column sortable label="第三层重量"  align="center" prop="threeweight" />
+                <el-table-column sortable label="第三层百分比"  align="center" prop="threerate" />
                 <el-table-column sortable label="参考标准" min-width="50px" align="center" prop="standard" />
               </el-table>
             </el-col>
@@ -480,10 +480,10 @@
                 class="elTable table-fixed"
                 height="400px"
               >
-                <el-table-column sortable label="栏舍" min-width="60px" align="center" prop="barname" />
-                <el-table-column sortable label="抽查样本数" min-width="60px" align="center" prop="sumcowcount" />
-                <el-table-column sortable label="单产" min-width="60px" align="center" prop="product" />
-                <el-table-column sortable label="干物质采食量" min-width="60px" align="center" prop="dryweight" />
+                <el-table-column sortable label="栏舍"  align="center" prop="barname" />
+                <el-table-column sortable label="抽查样本数"  align="center" prop="sumcowcount" />
+                <el-table-column sortable label="单产"  align="center" prop="product" />
+                <el-table-column sortable label="干物质采食量"  align="center" prop="dryweight" />
                 <el-table-column sortable label="泌乳天数" min-width="50px" align="center" prop="avgdim" />
                 <el-table-column sortable label="标准分数" min-width="50px" align="center" prop="standardscore" />
                 <el-table-column sortable label="2.5-分(数量、百分比)" min-width="100px" align="center" prop="score25" />
@@ -512,12 +512,12 @@
                 class="elTable table-fixed"
                 height="400px"
               >
-                <el-table-column sortable label="栏舍" min-width="60px" align="center" prop="barname" />
-                <el-table-column sortable label="抽查样本数" min-width="60px" align="center" prop="sumcowcount" />
-                <el-table-column sortable label="单产" min-width="60px" align="center" prop="product" />
-                <el-table-column sortable label="干物质采食量" min-width="60px" align="center" prop="dryweight" />
-                <el-table-column sortable label="泌乳天数" min-width="60px" align="center" prop="avgdim" />
-                <el-table-column sortable label="标准分数" min-width="60px" align="center" prop="standardscore" />
+                <el-table-column sortable label="栏舍"  align="center" prop="barname" />
+                <el-table-column sortable label="抽查样本数"  align="center" prop="sumcowcount" />
+                <el-table-column sortable label="单产"  align="center" prop="product" />
+                <el-table-column sortable label="干物质采食量"  align="center" prop="dryweight" />
+                <el-table-column sortable label="泌乳天数"  align="center" prop="avgdim" />
+                <el-table-column sortable label="标准分数"  align="center" prop="standardscore" />
                 <el-table-column sortable label="1分(数量、百分比)" min-width="90px" align="center" prop="score1" />
                 <el-table-column sortable label="2分(数量、百分比)" min-width="90px" align="center" prop="score2" />
                 <el-table-column sortable label="3分(数量、百分比)" min-width="90px" align="center" prop="score3" />

+ 262 - 259
src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue

@@ -57,9 +57,10 @@
             <el-option v-for="item in statisticalTypeList2" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
           <el-checkbox v-model="tab2.table.getdataListParm.checked" :true-label="1" :false-label="0" style="margin-right:10px;" @change="changeChecked">误差</el-checkbox>
-          <el-select v-model="tab2.table.getdataListParm.parammaps.ftType" placeholder="是否拆分小料" class="filter-item" style="width: 130px;">
-            <el-option v-for="item in isSplitsmallmaterialsList" :key="item.id" :label="item.name" :value="item.id" />
-          </el-select>
+
+          <el-select v-model="tab2.table.getdataListParm.parammaps.ftType" placeholder="是否拆分小料" class="filter-item" style="width: 130px;">
+            <el-option v-for="item in isSplitsmallmaterialsList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <el-input v-if="tab2.isRadio1" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="牲畜类别" />
           <el-input v-if="tab2.isRadio2" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="栏舍名称" />
           <el-input v-if="tab2.isRadio3" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="日期" />
@@ -68,27 +69,28 @@
           <el-input v-if="tab2.isRadio6" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="车次" />
           <el-select v-model="tab2.table.getdataListParm.parammaps.typea" clearable placeholder="列表显示" class="filter-item" style="width: 120px;">
             <el-option v-for="item in displayList" :key="item.id" :label="item.name" :value="item.id" />
-          </el-select>
-          <el-select v-model="tab2.table.getdataListParm.parammaps.times" clearable filterable placeholder="班次" class="filter-item" style="width: 120px;">
-            <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
-          <el-button class="successBorder" @click="form_search('second')">查询</el-button>
+          <el-select v-model="tab2.table.getdataListParm.parammaps.times" clearable filterable placeholder="班次" class="filter-item" style="width: 120px;">
+            <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-checkbox v-model="tab2.table.getdataListParm.premix" :true-label="1" :false-label="0" style="margin-right:10px;" @change="changeChecked">去除预混配方</el-checkbox>
+          <el-button class="successBorder" style="margin-top: 10px;"  @click="form_search('second')">查询</el-button>
           <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handleExport('tab2')">导出</el-button>
           <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handlesWitch()">切换展示</el-button>
-        </div>
-
+        </div>
+
         <div v-if="isTable1">
-        <div v-if="tab2.table.tableConfig.length > 8">
-          <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
-            <!-- 第一个表头 -->
-            <u-table-column v-for="(header1, index1) in tab2.table.tableConfig" :key="'header1-' + index1" :label="header1.label" align="center" :fixed="index1==0" :show-overflow-tooltip="header1.showOverflow" >
-              <!-- 第二个表头 -->
-              <u-table-column v-for="(header2, index2) in header1.children" :key="'header2-' + index2" :label="header2.label" align="center" :fixed="index2==0" :show-overflow-tooltip="header2.showOverflow">
-                <!-- 第三个表头 -->
-                <u-table-column v-for="(header3, index3) in header2.children" :key="'header3-' + index3" :label="header3.label" :prop="header3.prop" align="center">
-                </u-table-column>
-              </u-table-column>
-            </u-table-column>
+        <div v-if="tab2.table.tableConfig.length > 8">
+          <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
+            <!-- 第一个表头 -->
+            <u-table-column v-for="(header1, index1) in tab2.table.tableConfig" :key="'header1-' + index1" :label="header1.label" align="center" :fixed="index1==0" :show-overflow-tooltip="header1.showOverflow" >
+              <!-- 第二个表头 -->
+              <u-table-column v-for="(header2, index2) in header1.children" :key="'header2-' + index2" :label="header2.label" align="center" :fixed="index2==0" :show-overflow-tooltip="header2.showOverflow">
+                <!-- 第三个表头 -->
+                <u-table-column v-for="(header3, index3) in header2.children" :key="'header3-' + index3" :label="header3.label" :prop="header3.prop" align="center">
+                </u-table-column>
+              </u-table-column>
+            </u-table-column>
           </u-table>
           <!-- <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
             <u-table-column v-for="(item,index) in tab2.table.tableConfig" :key="index" :label="item.label" :show-overflow-tooltip="item.showOverflow"  :prop="item.prop" align="center" :fixed="index==0">
@@ -98,17 +100,17 @@
             </u-table-column>
           </u-table> -->
         </div>
-        <div v-else>
-          <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
-            <!-- 第一个表头 -->
-            <u-table-column v-for="(header1, index1) in tab2.table.tableConfig" :key="'header1-' + index1" :label="header1.label" align="center" :fixed="index1==0" :show-overflow-tooltip="header1.showOverflow">
-              <!-- 第二个表头 -->
-              <u-table-column v-for="(header2, index2) in header1.children" :key="'header2-' + index2" :label="header2.label" align="center" :fixed="index2==0" :show-overflow-tooltip="header2.showOverflow">
-                <!-- 第三个表头 -->
-                <u-table-column v-for="(header3, index3) in header2.children" :key="'header3-' + index3" :label="header3.label" :prop="header3.prop" align="center">
-                </u-table-column>
-              </u-table-column>
-            </u-table-column>
+        <div v-else>
+          <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
+            <!-- 第一个表头 -->
+            <u-table-column v-for="(header1, index1) in tab2.table.tableConfig" :key="'header1-' + index1" :label="header1.label" align="center" :fixed="index1==0" :show-overflow-tooltip="header1.showOverflow">
+              <!-- 第二个表头 -->
+              <u-table-column v-for="(header2, index2) in header1.children" :key="'header2-' + index2" :label="header2.label" align="center" :fixed="index2==0" :show-overflow-tooltip="header2.showOverflow">
+                <!-- 第三个表头 -->
+                <u-table-column v-for="(header3, index3) in header2.children" :key="'header3-' + index3" :label="header3.label" :prop="header3.prop" align="center">
+                </u-table-column>
+              </u-table-column>
+            </u-table-column>
           </u-table>
           <!-- <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
             <u-table-column v-for="(item,index) in tab2.table.tableConfig" :key="index" :label="item.label" :show-overflow-tooltip="item.showOverflow"  :prop="item.prop" align="center">
@@ -120,13 +122,13 @@
         </div>
 
         <span v-if="tab2.table.listLoading == false && tab2.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab2.table.total }}条</span>
-        </div>
-        <div v-else>
-          <!-- 新展示 -->
-          <u-table :span-method="objectSpanMethod" ref="plTable22" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
-            <u-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.prop" :label="column.label" align="center"></u-table-column>
-          </u-table>
-        </div>
+        </div>
+        <div v-else>
+          <!-- 新展示 -->
+          <u-table :span-method="objectSpanMethod" ref="plTable22" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
+            <u-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.prop" :label="column.label" align="center"></u-table-column>
+          </u-table>
+        </div>
       </el-tab-pane>
       <el-tab-pane label="价格分析" name="third">
         <div class="search">
@@ -212,30 +214,30 @@ export default {
           }
           return time.getTime() > Date.now()
         }
-      },
-      pickerOptions2: {
-        onPick: ({ maxDate, minDate }) => {
-          this.pickerMinDate = minDate.getTime()
-          if (maxDate) {
-            this.pickerMinDate = ''
-          }
-        },
-        // 限制不能选择今天之后的日期
-        disabledDate: (time) => {
-          if (this.pickerMinDate !== '') {
-            const one = 31 * 24 * 3600 * 1000
-            const minTime = this.pickerMinDate - one
-            let maxTime = this.pickerMinDate + one
-            // if (maxTime > new Date()) {
-            //   maxTime = new Date()
-            // }
-            return time.getTime() < minTime || time.getTime() > maxTime
-          }
-          // return time.getTime() > Date.now()
-        }
+      },
+      pickerOptions2: {
+        onPick: ({ maxDate, minDate }) => {
+          this.pickerMinDate = minDate.getTime()
+          if (maxDate) {
+            this.pickerMinDate = ''
+          }
+        },
+        // 限制不能选择今天之后的日期
+        disabledDate: (time) => {
+          if (this.pickerMinDate !== '') {
+            const one = 31 * 24 * 3600 * 1000
+            const minTime = this.pickerMinDate - one
+            let maxTime = this.pickerMinDate + one
+            // if (maxTime > new Date()) {
+            //   maxTime = new Date()
+            // }
+            return time.getTime() < minTime || time.getTime() > maxTime
+          }
+          // return time.getTime() > Date.now()
+        }
       },
       fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
-      displayList:[{id:'1',name:'理论'},{id:'2',name:'实际'}],//列表显示
+      displayList:[{id:'1',name:'理论'},{id:'2',name:'实际'}],//列表显示
       isSplitsmallmaterialsList:[{id:'0',name:'拆分'},{id:'1',name:'不拆分'}],
       activeName: 'first',
       tab: {
@@ -279,8 +281,8 @@ export default {
               stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
               inputDatetime: [new Date(), new Date()],
               fname: '',
-              typea:'',
-              times:'',
+              typea:'',
+              times:'',
               ftType:'1'
             }
           },
@@ -337,22 +339,22 @@ export default {
       isDispayTable3:false,
       statisticalTypeList2: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }, { id: '5', name: 'TMR班次' }, { id: '6', name: '车次' }],
       statisticalTypeList3: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }],
-      frequencyList: [], // 班次
-      isTable1:true,
-      spanObj: {},
-      mergekeys: ['A', 'B'],
-      tableColumns:[],
-      myData:{},
-      columnsToTotal: ['10-配种']
+      frequencyList: [], // 班次
+      isTable1:true,
+      spanObj: {},
+      mergekeys: ['A', 'B'],
+      tableColumns:[],
+      myData:{},
+      columnsToTotal: ['10-配种']
     }
   },
   created() {
-    this.getTimeFn()
+    this.getTimeFn()
     this.getIsDisplay()
   },
-  methods: {
-    getIsDisplay() {
-      const url = 'authdata/GetDataByName'
+  methods: {
+    getIsDisplay() {
+      const url = 'authdata/GetDataByName'
       const data = {
         name: 'getSysoptEnable',
         page: 1,
@@ -363,33 +365,33 @@ export default {
           pastureid: Cookies.get('pastureid'),
           inforname: 'times'
         }
-      }
-      postJson(url, data).then(response => {
-        console.log(response.data.list[0].inforvalue)
-        if (response.data.list[0].inforvalue == 1) {
-          this.frequencyList = [{ id: 1, name: '第一班' }]
-        } else if (response.data.list[0].inforvalue == 2) {
-          this.frequencyList = [
-            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }
-          ]
-        } else if (response.data.list[0].inforvalue == 3) {
-          this.frequencyList = [
-            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }
-          ]
-        } else if (response.data.list[0].inforvalue == 4) {
-          this.frequencyList = [
-            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }, { id: 4, name: '第四班' }
-          ]
-        }else if (response.data.list[0].inforvalue == 5) {
-          this.frequencyList = [
-            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }, { id: 4, name: '第四班' }, { id: 5, name: '第五班' }
-          ]
-        }else if (response.data.list[0].inforvalue == 6) {
-          this.frequencyList = [
-            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }, { id: 4, name: '第四班' }, { id: 5, name: '第五班' }, { id: 6, name: '第六班' },
-          ]
-        }
-      })
+      }
+      postJson(url, data).then(response => {
+        console.log(response.data.list[0].inforvalue)
+        if (response.data.list[0].inforvalue == 1) {
+          this.frequencyList = [{ id: 1, name: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.frequencyList = [
+            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }
+          ]
+        } else if (response.data.list[0].inforvalue == 3) {
+          this.frequencyList = [
+            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }
+          ]
+        } else if (response.data.list[0].inforvalue == 4) {
+          this.frequencyList = [
+            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }, { id: 4, name: '第四班' }
+          ]
+        }else if (response.data.list[0].inforvalue == 5) {
+          this.frequencyList = [
+            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }, { id: 4, name: '第四班' }, { id: 5, name: '第五班' }
+          ]
+        }else if (response.data.list[0].inforvalue == 6) {
+          this.frequencyList = [
+            { id: 1, name: '第一班' }, { id: 2, name: '第二班' }, { id: 3, name: '第三班' }, { id: 4, name: '第四班' }, { id: 5, name: '第五班' }, { id: 6, name: '第六班' },
+          ]
+        }
+      })
     },
     getTimeFn() {
       const that = this
@@ -497,78 +499,78 @@ export default {
       setTimeout(()=>{
         this.isDispayTable2 = true
         this.$nextTick(() => {
-          let myList = []
-          if(this.isTable1){
-            this.tab2.table.getdataListParm.parammaps.mode = 0
-          }else{
-            this.tab2.table.getdataListParm.parammaps.mode = 1
+          let myList = []
+          if(this.isTable1){
+            this.tab2.table.getdataListParm.parammaps.mode = 0
+          }else{
+            this.tab2.table.getdataListParm.parammaps.mode = 1
           }
-          GetReportform(this.tab2.table.getdataListParm).then(response => {
-            if(this.isTable1){
-              if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
-                this.tab2.table.data = response.data.data
-                response.data.feedcode.push('')
-                response.data.feedcode.unshift('饲料编码')
-                for (let i = 0; i < response.data.list.data2.length; i++) {
-                  // console.log(response.data.list.data2[i],'===label')
-                  for (let j = 0; j < response.data.list.data1.length; j++) {
-                    for (let a = 0; a < response.data.list.data2[i].children.length; a++) {
-                      if (response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == undefined || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == null || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == '') {
-                        response.data.list.data1[j][response.data.list.data2[i].children[a].prop] = 0
-                      }
-                    }
-                  }
-                  if (response.data.list.data2[i].children.length > 1) {
-                    for (let j = 0; j < response.data.list.data2[i].children.length; j++) {
-                      if (response.data.list.data2[i].children[j].label == '理论' || response.data.list.data2[i].children[j].label == '实际') {
-                        this.$set(response.data.list.data2[i].children[j], 'width', '80px')
-                      } else {
-                        this.$set(response.data.list.data2[i].children[j], 'width', '80px')
-                      }
-                    }
-                  } else {
-                    this.$set(response.data.list.data2[i].children[0], 'width', '80px')
-                  }
-                }
-                let list = response.data.list.data2
-                let code = response.data.feedcode
-                const headers = []
-                for(let i=0;i<list.length;i++){
-                  for(let j=0;j<code.length;j++){
-                    if(i== j){
-                      let obj = {
-                        label:code[j],
-                        children:[
-                          list[i]
-                        ]
-                      }
-                      headers.push(obj)
-                    }
-                  }
-                }
-                myList = response.data.list.data1
-                this.tab2.table.list = response.data.list.data1
-                this.tab2.table.tableConfig = headers
-                this.tab2.table.total = response.data.list.data1.length
-
-                console.log('库存统计-用料分析this.tab2.table.data', response.data.data)
-                console.log('库存统计-用料分析this.tab2.table.feedcode', response.data.feedcode)
-                console.log('库存统计-用料分析this.tab2.table.list', response.data.list.data1)
-                console.log('库存统计-用料分析this.tab2.table.tableConfig',response.data.list.data2)
-              } else {
-                myList = []
-                this.tab2.table.list = []
-                this.tab2.table.tableConfig = []
-              }
-
-              console.log(this.tab2.table.list.length)
-              this.$refs.plTable2.reloadData(myList)
-            }else{
-              this.myData = response.data
-              this.tableColumns = response.data.columns;
-              this.tableData = response.data.data;
-              this.$refs.plTable22.reloadData(this.tableData)
-              this.handleSpan()
+          GetReportform(this.tab2.table.getdataListParm).then(response => {
+            if(this.isTable1){
+              if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
+                this.tab2.table.data = response.data.data
+                response.data.feedcode.push('')
+                response.data.feedcode.unshift('饲料编码')
+                for (let i = 0; i < response.data.list.data2.length; i++) {
+                  // console.log(response.data.list.data2[i],'===label')
+                  for (let j = 0; j < response.data.list.data1.length; j++) {
+                    for (let a = 0; a < response.data.list.data2[i].children.length; a++) {
+                      if (response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == undefined || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == null || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == '') {
+                        response.data.list.data1[j][response.data.list.data2[i].children[a].prop] = 0
+                      }
+                    }
+                  }
+                  if (response.data.list.data2[i].children.length > 1) {
+                    for (let j = 0; j < response.data.list.data2[i].children.length; j++) {
+                      if (response.data.list.data2[i].children[j].label == '理论' || response.data.list.data2[i].children[j].label == '实际') {
+                        this.$set(response.data.list.data2[i].children[j], 'width', '80px')
+                      } else {
+                        this.$set(response.data.list.data2[i].children[j], 'width', '80px')
+                      }
+                    }
+                  } else {
+                    this.$set(response.data.list.data2[i].children[0], 'width', '80px')
+                  }
+                }
+                let list = response.data.list.data2
+                let code = response.data.feedcode
+                const headers = []
+                for(let i=0;i<list.length;i++){
+                  for(let j=0;j<code.length;j++){
+                    if(i== j){
+                      let obj = {
+                        label:code[j],
+                        children:[
+                          list[i]
+                        ]
+                      }
+                      headers.push(obj)
+                    }
+                  }
+                }
+                myList = response.data.list.data1
+                this.tab2.table.list = response.data.list.data1
+                this.tab2.table.tableConfig = headers
+                this.tab2.table.total = response.data.list.data1.length
+
+                console.log('库存统计-用料分析this.tab2.table.data', response.data.data)
+                console.log('库存统计-用料分析this.tab2.table.feedcode', response.data.feedcode)
+                console.log('库存统计-用料分析this.tab2.table.list', response.data.list.data1)
+                console.log('库存统计-用料分析this.tab2.table.tableConfig',response.data.list.data2)
+              } else {
+                myList = []
+                this.tab2.table.list = []
+                this.tab2.table.tableConfig = []
+              }
+
+              console.log(this.tab2.table.list.length)
+              this.$refs.plTable2.reloadData(myList)
+            }else{
+              this.myData = response.data
+              this.tableColumns = response.data.columns;
+              this.tableData = response.data.data;
+              this.$refs.plTable22.reloadData(this.tableData)
+              this.handleSpan()
             }
             setTimeout(() => {
               this.tab2.table.listLoading = false
@@ -576,7 +578,7 @@ export default {
           })
         })
       })
-    },
+    },
 
     changeRadio2() {
       console.log(this.tab2.radio)
@@ -862,53 +864,53 @@ export default {
     },
     changeChecked(item) {
       this.form_search('second')
-    },
-    handlesWitch(item){
-      this.isTable1 = !this.isTable1
-        this.getTab2List()
-    },
-    handleSpan() {
-      this.mergekeys.forEach(key => {
-        this.spanObj[key] = []
-        let position = 0
-        this.tableData.forEach((item, index) => {
-          if (index === 0) {
-            this.spanObj[key].push(1)
-            position = 0
-          } else {
-            if (key == 'B') {
-              if (this.tableData[index][key] === this.tableData[index - 1][key] && this.tableData[index]['A'] === this.tableData[index - 1]['A']) {
-                this.spanObj[key][position] += 1
-                this.spanObj[key].push(0)
-              } else {
-                this.spanObj[key].push(1)
-                position = index
-              }
-            } else {
-              if (this.tableData[index][key] === this.tableData[index - 1][key]) {
-                this.spanObj[key][position] += 1
-                this.spanObj[key].push(0)
-              } else {
-                this.spanObj[key].push(1)
-                position = index
-              }
-            }
-          }
-        })
-      })
-    },
-    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      for (let i = 0; i < this.mergekeys.length; i++) {
-        if (column.property === this.mergekeys[i]) {
-          let _row = this.spanObj[this.mergekeys[i]][rowIndex]
-          let _col = _row > 0 ? 1 : 0
-          console.log(_row,'_row1')
-          return {
-            rowspan: _row,
-            colspan: _col
-          }
-        }
-      }
+    },
+    handlesWitch(item){
+      this.isTable1 = !this.isTable1
+        this.getTab2List()
+    },
+    handleSpan() {
+      this.mergekeys.forEach(key => {
+        this.spanObj[key] = []
+        let position = 0
+        this.tableData.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj[key].push(1)
+            position = 0
+          } else {
+            if (key == 'B') {
+              if (this.tableData[index][key] === this.tableData[index - 1][key] && this.tableData[index]['A'] === this.tableData[index - 1]['A']) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.tableData[index][key] === this.tableData[index - 1][key]) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            }
+          }
+        })
+      })
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      for (let i = 0; i < this.mergekeys.length; i++) {
+        if (column.property === this.mergekeys[i]) {
+          let _row = this.spanObj[this.mergekeys[i]][rowIndex]
+          let _col = _row > 0 ? 1 : 0
+          console.log(_row,'_row1')
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
     },
     handleExport(item) {
       if (item == 'tab1') {
@@ -934,7 +936,7 @@ export default {
             excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '库存统计', merges })
           })
         })
-      } else if (item == 'tab2') {
+      } else if (item == 'tab2') {
         if(this.isTable1){
           console.log('用料分析导出数据', this.tab2.table.list)
           console.log('用料分析导出表头', this.tab2.table.tableConfig)
@@ -951,10 +953,10 @@ export default {
           for (let i = 0; i < this.tab2.table.tableConfig.length; i++) {
             exportTitle1.push(this.tab2.table.tableConfig[i].label)
             for (let j = 0; j < this.tab2.table.tableConfig[i].children.length; j++) {
-              exportTitle2.push(this.tab2.table.tableConfig[i].children[j].label)
-              for(let a = 0;a<this.tab2.table.tableConfig[i].children[j].children.length;a++){
-                exportTitle3.push(this.tab2.table.tableConfig[i].children[j].children[a].label)
-                filterValArr.push(this.tab2.table.tableConfig[i].children[j].children[a].prop)
+              exportTitle2.push(this.tab2.table.tableConfig[i].children[j].label)
+              for(let a = 0;a<this.tab2.table.tableConfig[i].children[j].children.length;a++){
+                exportTitle3.push(this.tab2.table.tableConfig[i].children[j].children[a].label)
+                filterValArr.push(this.tab2.table.tableConfig[i].children[j].children[a].prop)
               }
               // filterValArr.push(this.tab2.table.tableConfig[i].children[j].prop)
             }
@@ -971,11 +973,11 @@ export default {
                 headerArr.push(exportTitle1[i], '', '', '')
               } else {
                 headerArr.push(exportTitle1[i])
-              }
-              if (i > 0) {
-                headerArr2.push(exportTitle2[i], '', '', '')
-              } else {
-                headerArr2.push(exportTitle2[i])
+              }
+              if (i > 0) {
+                headerArr2.push(exportTitle2[i], '', '', '')
+              } else {
+                headerArr2.push(exportTitle2[i])
               }
             }
           } else {
@@ -985,11 +987,11 @@ export default {
                   headerArr.push(exportTitle1[i], '')
                 } else {
                   headerArr.push(exportTitle1[i])
-                }
-                if (i > 0) {
-                  headerArr2.push(exportTitle2[i], '')
-                } else {
-                  headerArr2.push(exportTitle2[i])
+                }
+                if (i > 0) {
+                  headerArr2.push(exportTitle2[i], '')
+                } else {
+                  headerArr2.push(exportTitle2[i])
                 }
               }
             }else{
@@ -1005,8 +1007,8 @@ export default {
               const multiHeader = [
                 headerArr
               ]
-              const multiHeader2 = [
-                headerArr2
+              const multiHeader2 = [
+                headerArr2
               ]
               const tHeader = exportTitle3
               const filterVal = filterValArr
@@ -1029,26 +1031,26 @@ export default {
               const merges = []
               excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
             })
-          }
-        }else{
-          var startTime = this.tab2.table.getdataListParm.parammaps.startTime
-          var stopTime = this.tab2.table.getdataListParm.parammaps.stopTime
-          var title = '用料分析-'+startTime+'-' +stopTime
-          var tHeader = []
-          var filterVal = []
-          for (let i = 0; i < this.tableColumns.length; i++) {
-            tHeader.push(this.tableColumns[i].label)
-            filterVal.push(this.tableColumns[i].prop)
-          }
-          var excelDatas = [
-            {
-              tHeader: tHeader,
-              filterVal: filterVal,
-              tableDatas: this.tableData,
-              sheetName: 'Sheet'
-            }
-          ]
-          json2excel(excelDatas, title, true, 'xlsx')
+          }
+        }else{
+          var startTime = this.tab2.table.getdataListParm.parammaps.startTime
+          var stopTime = this.tab2.table.getdataListParm.parammaps.stopTime
+          var title = '用料分析-'+startTime+'-' +stopTime
+          var tHeader = []
+          var filterVal = []
+          for (let i = 0; i < this.tableColumns.length; i++) {
+            tHeader.push(this.tableColumns[i].label)
+            filterVal.push(this.tableColumns[i].prop)
+          }
+          var excelDatas = [
+            {
+              tHeader: tHeader,
+              filterVal: filterVal,
+              tableDatas: this.tableData,
+              sheetName: 'Sheet'
+            }
+          ]
+          json2excel(excelDatas, title, true, 'xlsx')
         }
       } else if (item == 'tab3') {
         console.log('价格分析导出')
@@ -1122,6 +1124,7 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+
   .search{
     margin-bottom:10px;
     .el-radio{margin-right: 10px;}
@@ -1143,8 +1146,8 @@ export default {
   }
   .plTableBox .el-table td.is-hidden>*, .plTableBox .el-table th.is-hidden>*{
     visibility:inherit;
-  }
-  .plTableBox .el-table th>.cell{
-    white-space: pre-wrap;
+  }
+  .plTableBox .el-table th>.cell{
+    white-space: pre-wrap;
   }
 </style>

+ 9 - 1
src/views/statisticalAnalysis/processAnalysis/group/index.vue

@@ -75,7 +75,7 @@
           </div>
         </div>
         <div class="Mixture">
-          <h4>混料详情</h4>
+          <h4>混料详情11</h4>
           <el-table
             :key="table3.tableKey"
             v-loading="table3.listLoading"
@@ -101,6 +101,14 @@
             <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
+            <el-table-column
+              fixed="right"
+              label="操作"
+              width="100">
+              <template slot-scope="scope">
+                <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </el-col>

+ 142 - 19
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -138,10 +138,18 @@
             <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
+            <el-table-column
+              fixed="right"
+              label="操作"
+              width="80px">
+              <template slot-scope="scope">
+                <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </el-col>
-      <!-- 撒料计划 -->
+      <!-- 撒料计划 3-->
       <el-col v-if="isSpreadingPlan" :span="16">
         <div class="title">
           <b>过程详情</b>
@@ -178,7 +186,7 @@
           </div>
         </div>
         <div class="Mixture">
-          <h4>混料详情</h4>
+          <h4>混料详情3</h4>
           <el-table
             :key="table3.tableKey"
             v-loading="table3.listLoading"
@@ -209,11 +217,18 @@
             <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
+            <el-table-column
+              label="操作"
+              width="90px">
+              <template slot-scope="scope"  >
+                <el-button v-if="scope.row.sort != '合计'"   @click="handleClick(scope.row,1)" type="text" size="small">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
 
         <div class="SpreadingMaterials">
-          <h4>撒料详情</h4>
+          <h4>撒料详情3</h4>
           <el-table
             :key="table4.tableKey"
             v-loading="table4.listLoading"
@@ -244,6 +259,13 @@
             <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
+            <el-table-column
+              label="操作"
+              width="90px">
+              <template slot-scope="scope"  >
+                <el-button v-if="scope.row.sort != '合计'"   @click="handleClick(scope.row,2)" type="text" size="small">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
         <div class="ControlChart">
@@ -251,7 +273,7 @@
           <div id="chartLine" style="width: 100%;height:300px;" />
         </div>
       </el-col>
-      <!-- 剩料计划 -->
+      <!-- 剩料计划 2-->
       <el-col v-if="isResidualMaterialPlan" :span="16">
         <div class="title">
           <b>过程详情</b>
@@ -326,7 +348,7 @@
           </el-table>
         </div>
       </el-col>
-      <!-- 撒料计划-混料 -->
+      <!-- 撒料计划-混料 1-->
       <el-col v-if="isSpreadingPlanSH" :span="16">
         <div class="title">
           <b>过程详情</b>
@@ -363,7 +385,7 @@
           </div>
         </div>
         <div class="Mixture">
-          <h4>混料详情</h4>
+          <h4>混料详情1</h4>
           <el-table
             :key="table3.tableKey"
             v-loading="table3.listLoading"
@@ -379,8 +401,8 @@
             max-height="270px"
 
           >
-            <el-table-column label="操作编号" min-width="60px" align="center" prop="sort" />
-            <el-table-column label="饲料名称" min-width="60px" align="center" prop="fname" />
+            <el-table-column  label="操作编号" min-width="60px" align="center" prop="sort" />
+            <el-table-column label="饲料名称" min-width="80px" align="center" prop="fname" />
             <el-table-column label="计划重量" min-width="60px" align="center" prop="lweight" />
             <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus">
               <template slot-scope="{row}">
@@ -395,11 +417,18 @@
             <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
+            <el-table-column
+              label="操作"
+              width="90">
+              <template slot-scope="scope"  >
+                <el-button v-if="scope.row.sort != '合计'"   @click="handleClick(scope.row,1)" type="text" size="small">编辑1</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
 
         <div class="SpreadingMaterials">
-          <h4>撒料详情</h4>
+          <h4>撒料详情1</h4>
           <el-table
             :key="table4.tableKey"
             v-loading="table4.listLoading"
@@ -414,10 +443,10 @@
             class="elTable table-fixed"
             max-height="260px"
           >
-            <el-table-column label="操作编号" min-width="60px" align="center" prop="sort" />
-            <el-table-column label="撒料车辆" min-width="60px" align="center" prop="fname" />
+            <el-table-column label="操作编号"  min-width="60px" align="center" prop="sort" />
+            <el-table-column label="撒料车辆" min-width="80px" align="center" prop="fname" />
             <el-table-column label="计划重量" min-width="60px" align="center" prop="lweight" />
-            <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus">
+            <el-table-column label="实际重量" min-width="70px" align="center" prop="actualweightminus">
               <template slot-scope="{row}">
                 <a v-if="row.actualweightminus == 0" style="color: red;">{{ row.actualweightminus }}</a>
                 <a v-else>{{ row.actualweightminus }}</a>
@@ -430,6 +459,13 @@
             <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
+            <el-table-column
+              label="操作"
+              width="90">
+              <template slot-scope="scope"  >
+                <el-button v-if="scope.row.sort != '合计'"   @click="handleClick(scope.row,2)" type="text" size="small">编辑1</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
         <div class="ControlChart">
@@ -474,7 +510,7 @@
           </div>
         </div>
         <div class="Mixture">
-          <h4>混料详情</h4>
+          <h4>混料详情2</h4>
           <el-table
             :key="table3.tableKey"
             v-loading="table3.listLoading"
@@ -505,11 +541,18 @@
             <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
             <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
+            <el-table-column
+              label="操作"
+              width="90px">
+              <template slot-scope="scope"  >
+                <el-button v-if="scope.row.sort != '合计'"   @click="handleClick(scope.row,1)" type="text" size="small">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
 
         <div class="SpreadingMaterials">
-          <h4>撒料详情</h4>
+          <h4>撒料详情2</h4>
           <el-table
             :key="table4.tableKey"
             v-loading="table4.listLoading"
@@ -527,7 +570,7 @@
             <el-table-column label="操作编号" min-width="70px" align="center" prop="sort" />
             <el-table-column label="撒料车辆" min-width="70px" align="center" prop="fname" />
             <el-table-column label="计划重量" min-width="70px" align="center" prop="lweight" />
-            <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus">
+            <el-table-column label="实际重量" min-width="80px" align="center" prop="actualweightminus">
               <template slot-scope="{row}">
                 <a v-if="row.actualweightminus == 0" style="color: red;">{{ row.actualweightminus }}</a>
                 <a v-else>{{ row.actualweightminus }}</a>
@@ -539,7 +582,14 @@
             <el-table-column label="过程时间" min-width="70px" align="center" prop="proesstime" />
             <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
             <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
-            <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
+            <el-table-column label="结束重量" min-width="80px" align="center" prop="actualweight" />
+            <el-table-column
+              label="操作"
+              width="90px">
+              <template slot-scope="scope"  >
+                <el-button v-if="scope.row.sort != '合计'"   @click="handleClick(scope.row,2)" type="text" size="small">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
         <div class="ControlChart">
@@ -549,6 +599,22 @@
       </el-col>
     </el-row>
 
+    <!-- 修改实际重量 -->
+    <el-dialog title="修改实际重量" :visible.sync="dialogFormVisible" width="40%">
+  <el-form :model="form">
+    <el-form-item label="原实际重量"  label-width="120px">
+      <el-input v-model="form.weightOld" disabled  type="number"></el-input>
+    </el-form-item>
+    <el-form-item label="现实际重量"  label-width="120px">
+      <el-input v-model="form.weight"  type="number"></el-input>
+    </el-form-item>
+  </el-form>
+  <div slot="footer" class="dialog-footer">
+    <el-button style="padding:10px"  @click="dialogFormVisible = false">取 消</el-button>
+    <el-button  style="padding:10px"   type="primary" @click="handleUpdateWg">确 定</el-button>
+  </div>
+</el-dialog>
+
   </div>
 
 </template>
@@ -557,13 +623,18 @@
 import echarts from 'echarts'
 
 require('echarts/theme/macarons')
-import { GetDataByName, GetReportform, formatNum,processAnalysist } from '@/api/common'
+import { GetDataByName, GetReportform, formatNum,processAnalysist,editWeightHL,editWeightSL } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
 export default {
   name: 'PastureProcessAnalysis',
   data() {
     return {
+      dialogFormVisible:false,
+      form:{
+        weightOld:'',
+        weight:""
+      },
       hlwc1:undefined ,
       hlwc2:undefined ,
       hlzq1:undefined ,
@@ -633,7 +704,7 @@ export default {
             pastureid: Cookies.get('pastureid'),
             startTime: parseTime(new Date(), '{y}-{m}-{d}'),
             stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
-            inputDatetime: [new Date(), new Date()],
+            inputDatetime:  [new Date(), new Date()], //['2023-06-05','2023-06-15'],
             iscompleted: '',
             tmrtname: '',
             lpplantype: '',
@@ -741,6 +812,58 @@ export default {
     this.getList()
   },
   methods: {
+    // 编辑实际重量
+    handleClick(row,type){
+      this.dialogFormVisible = true;
+      this.form.weight = row.actualweightminus;
+      this.form.weightOld = row.actualweightminus;
+      this.form.pid =  this.table3.getdataListParm.parammaps.pid;
+      this.form.sort = row.sort;
+      this.form.userId = Cookies.get('employeid')
+      this.form.type = type;
+      console.log(row,'实际重量');
+      
+
+    },
+    // 点击确认修改
+    handleUpdateWg(){
+      if(this.form.weight == this.form.weightOld ){
+        this.dialogFormVisible = false
+        return
+      }
+      // 1:混料 2:撒料
+     if(this.form.type == 1){
+       this.handleEditWgHL(this.form)
+     } else{
+      this.handleEditWgSL(this.form)
+     }
+    },
+   
+    // 混料
+    async handleEditWgHL(obj){
+      const {data} =await editWeightHL(obj);
+      console.log(data,'=====混hss')
+      if(data == true){
+        this.$message({ type: 'success', message: '混料实际重量修改成功', duration: 2000 })
+      } else{
+        this.$message({ type: 'error', message: '修改失败,请重新修改', duration: 2000 })
+      }
+      this.getList3()
+      this.dialogFormVisible = false
+    },
+    // 撒料
+    async handleEditWgSL(obj){
+      const {data} =await editWeightSL(obj);
+      console.log(data,'=====撒hss')
+      if(data == true){
+        this.$message({ type: 'success', message: '撒料实际重量修改成功', duration: 2000 })
+      } else{
+        this.$message({ type: 'error', message: data, duration: 2000 })
+      }
+      this.getList4()
+      this.dialogFormVisible = false
+   
+    },
     change_date(e){
       console.log(e)
       this.getDownList()
@@ -1373,7 +1496,7 @@ export default {
       }
     },
     rowStyle({ row, rowIndex }) {
-        console.log(row, rowIndex,'777777');
+        // console.log(row, rowIndex,'777777');s
         let stylejson = {};
         if (row.abnormal == 1) {
             stylejson.background = "#fb8072";// 背景颜色

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

@@ -1,513 +1,513 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-input v-model="table.getdataListParm.parammaps.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
-      <el-input v-model="table.getdataListParm.parammaps.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
-      <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-      <!-- 临时注释 -->
-      <!-- <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="公众号关注状态" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select> -->
-      <!-- 临时注释 -->
-      <el-button class="successBorder" @click="form_search">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">删除</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="用户名称" min-width="180px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.username }}</span>
-            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.username" placeholder="建议使用手机号" 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="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.empname }}</span>
-            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.empname" placeholder="1-32字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column label="手机号" min-width="180px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.phone }}</span>
-            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.phone" placeholder="请输入11位手机号" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="11" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column label="角色" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
-              <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <!-- 临时注释 -->
-        <!-- <el-table-column label="公众号关注状态" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
-              <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column> -->
-        <!-- 临时注释 -->
-        <el-table-column label="创建时间" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.createdtime }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="创建人" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.createmp }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="是否启用" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <!-- 新增 -->
-            <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
-            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
-            <!-- 扫码接收消息 -->
-            <!-- 临时注释 -->
-            <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleScanningCode(row)">扫码接收消息</a>
-            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-            <!-- 临时注释 -->
-            <!-- 重置密码 -->
-            <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleResetPassword(row)">重置密码</a>
-            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-            <!-- 编辑 -->
-            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
-            <!-- 编辑保存 -->
-            <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" class="miniSuccess" icon="el-icon-folder-checked" @click="updateData(row)" />
-            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-    <el-dialog :title="textMap[QRcode.dialogStatus]" :visible.sync="QRcode.dialogFormVisible" :close-on-click-modal="false" width="50%">
-      <div class="QRcode">
-        <div class="content">
-          <div class="title">
-            <p>微信接收系统待办、预警等消息,必须先扫码关注公众号;</p>
-            <p>请将下方二维码分享给需要接收信息的用户扫码</p>
-          </div>
-          <div style="font-weight: 600;">关注微信:</div>
-          <img :src="imgUrl" alt="">
-        </div>
-        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
-          <el-button class="save" :disabled="isokDisable" @click="QRcode.dialogFormVisible = false;">确认</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, PostDataByName, failproccess, GetDataByNames, ExecDataByConfig, checkButtons } from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'User',
-  components: { Pagination },
-  data() {
-    return {
-      isRoleEdit: [],
-      requestParams: [
-        { name: 'getRoleAll', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
-      ],
-      enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
-      attentionStatusList: [{ id: 1, name: '已关注公众号' }, { id: 0, name: '未关注公众号' }],
-      roleList: [], // 角色
-
-      table: {
-        getdataListParm: {
-          name: 'getuserallL',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            empCode: '',
-            empname: '',
-            enable: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {}
-      },
-      requestParam: {},
-      isokDisable: false,
-      selectList: [],
-      QRcode:{
-        dialogStatus: '',
-        dialogFormVisible:false,
-      },
-      textMap: {
-        QRcode:'提示'
-      },
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      imgUrl:''
-
-    }
-  },
-
-  created() {
-    this.getList()
-    this.getDownList()
-    this.getButtons()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'User'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.roleList = response.data.getRoleAll.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
-        } else {
-          this.table.list = []
-        }
-        this.table.total = response.data.total
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleEnableChange() {
-      console.log('点击了是否启用')
-    },
-
-    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.empCode = ''
-      this.table.getdataListParm.parammaps.empname = ''
-      this.table.getdataListParm.parammaps.enable = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.offset = 1
-      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) {
-          console.log(123)
-          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, 'createdtime': parseTime(new Date(), '{y}-{m}-{d}'), 'createmp': Cookies.get('employename'), 'username': '', 'roleid': '' })
-    },
-    changeRolename(item) {
-      this.table.temp.rolename = this.roleList.find(obj => obj.id === item).rolename
-    },
-    createData(row) {
-      console.log('点击了新增保存', row)
-      this.table.temp.pastureid = Cookies.get('pastureid')
-      this.table.temp.empname = row.empname
-      this.table.temp.username = row.username
-      this.table.temp.phone = row.phone
-      this.table.temp.createmp = row.createmp
-      this.table.temp.enable = row.enable
-      this.table.temp.roleid = row.roleid
-      // 检验用户名称/角色是否为空
-      if (this.table.temp.username == '' && this.table.temp.roleid == '') {
-        this.$message({ type: 'error', message: '用户名称/角色不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.username == '') {
-        this.$message({ type: 'error', message: '用户名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.roleid == '') {
-        this.$message({ type: 'error', message: '角色不能为空', duration: 2000 })
-        return false
-      }
-      // 检验手机号是否为11位数字
-      if (this.table.temp.phone !== undefined && this.table.temp.phone !== '') {
-        const phone = /^\d{11}$/
-        if (!phone.test(this.table.temp.phone)) {
-          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
-          return false
-        }
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam.name = 'createUser'
-      this.table.temp.isgroups = Cookies.get('ispastureuse')
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          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
-      row.roleid = String(row.roleid)
-      this.table.temp.roleid = row.roleid
-      this.table.temp.rolename = row.rolename
-    },
-    updateData(row) {
-      console.log('点击了编辑保存', row)
-      this.table.temp.pastureid = row.pastureid
-      this.table.temp.empname = row.empname
-      this.table.temp.username = row.username
-      this.table.temp.phone = row.phone
-      this.table.temp.createmp = row.createmp
-      this.table.temp.enable = row.enable
-      this.table.temp.roleid = row.roleid
-      this.table.temp.id = row.id
-      // 校验用户名称/角色是否为空
-      if (this.table.temp.username == '' && this.table.temp.roleid == '') {
-        this.$message({ type: 'error', message: '用户名称/角色不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.username == '') {
-        this.$message({ type: 'error', message: '用户名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.roleid == '') {
-        this.$message({ type: 'error', message: '角色不能为空', duration: 2000 })
-        return false
-      }
-      console.log(this.table.temp.phone)
-      // 检验手机号是否为11位数字
-      if (this.table.temp.phone !== undefined && this.table.temp.phone !== '') {
-        const phone = /^\d{11}$/
-        if (!phone.test(this.table.temp.phone)) {
-          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
-          return false
-        }
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam.name = 'updateUser'
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-    updateCancel(row) {
-      console.log('点击了编辑取消')
-      // 编辑false,不可编辑true
-      row.Edit = false
-      row.NoEdit = true
-      // 新增false,编辑true,编辑保存false
-      row.isCreate = false
-      row.isUpdate = true
-      row.isUpdateSave = false
-      this.getList()
-    },
-    handleRowDelete(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.selectList = []
-        this.requestParam.name = 'deleteUser'
-        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('是否确认删除此信息?', {
-          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': 'deleteUser', '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()
-            }
-          })
-        })
-      }
-    },
-    handleResetPassword(row) {
-      MessageBox.confirm('是否确认将此用户密码重置为默认密码123456?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'initPassword'
-        this.requestParam.parammaps = {}
-        this.requestParam.parammaps.pastureid = row.pastureid
-        this.requestParam.parammaps.id = row.id
-        PostDataByName(this.requestParam).then(() => {
-          this.getList()
-          this.resetRequestParam()
-          this.dialogFormVisible = false
-          this.$notify({
-            title: '成功',
-            message: '重置密码成功',
-            type: 'success',
-            duration: 2000
-          })
-        })
-      })
-    },
-    handleScanningCode(row){
-      this.QRcode.dialogStatus = 'QRcode'
-      this.QRcode.dialogFormVisible = true
-      this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_str=tmrwatch.'+ Cookies.get('pastureid')+'.'+ row.username + '.'+row.empname
-      console.log(this.imgUrl)
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-  // .search{margin-top:10px;}
-  .QRcode{display:flex;justify-content: center; align-items:center;}
-  .content{
-    /* margin-top: 100px; */
-    width: 500px;
-  }
-  .content img{
-    max-width:300px;
-
-  }
- </style>
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-input v-model="table.getdataListParm.parammaps.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
+      <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <!-- 临时注释 -->
+      <!-- <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="公众号关注状态" class="filter-item" style="width: 150px;" clearable>
+        <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select> -->
+      <!-- 临时注释 -->
+      <el-button class="successBorder" @click="form_search">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">删除</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="用户名称" min-width="180px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.username }}</span>
+            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.username" placeholder="建议使用手机号" 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="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.empname }}</span>
+            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.empname" placeholder="1-32字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="手机号" min-width="180px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.phone }}</span>
+            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.phone" placeholder="请输入11位手机号" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="11" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="角色" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
+              <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <!-- 临时注释 -->
+        <!-- <el-table-column label="公众号关注状态" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
+              <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column> -->
+        <!-- 临时注释 -->
+        <el-table-column label="创建时间" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.createdtime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建人" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.createmp }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="是否启用" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <!-- 新增 -->
+            <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
+            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+            <!-- 扫码接收消息 -->
+            <!-- 临时注释 -->
+            <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleScanningCode(row)">扫码接收消息</a>
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <!-- 临时注释 -->
+            <!-- 重置密码 -->
+            <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleResetPassword(row)">重置密码</a>
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <!-- 编辑 -->
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <!-- 编辑保存 -->
+            <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" class="miniSuccess" icon="el-icon-folder-checked" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+    <el-dialog :title="textMap[QRcode.dialogStatus]" :visible.sync="QRcode.dialogFormVisible" :close-on-click-modal="false" width="50%">
+      <div class="QRcode">
+        <div class="content">
+          <div class="title">
+            <p>微信接收系统待办、预警等消息,必须先扫码关注公众号;</p>
+            <p>请将下方二维码分享给需要接收信息的用户扫码</p>
+          </div>
+          <div style="font-weight: 600;">关注微信:</div>
+          <img :src="imgUrl" alt="">
+        </div>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
+          <el-button class="save" :disabled="isokDisable" @click="QRcode.dialogFormVisible = false;">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, GetDataByNames, ExecDataByConfig, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'User',
+  components: { Pagination },
+  data() {
+    return {
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getRoleAll', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
+      ],
+      enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
+      attentionStatusList: [{ id: 1, name: '已关注公众号' }, { id: 0, name: '未关注公众号' }],
+      roleList: [], // 角色
+
+      table: {
+        getdataListParm: {
+          name: 'getuserallL',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            empCode: '',
+            empname: '',
+            enable: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+      requestParam: {},
+      isokDisable: false,
+      selectList: [],
+      QRcode:{
+        dialogStatus: '',
+        dialogFormVisible:false,
+      },
+      textMap: {
+        QRcode:'提示'
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      imgUrl:''
+
+    }
+  },
+
+  created() {
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'User'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.roleList = response.data.getRoleAll.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
+        } else {
+          this.table.list = []
+        }
+        this.table.total = response.data.total
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了是否启用')
+    },
+
+    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.empCode = ''
+      this.table.getdataListParm.parammaps.empname = ''
+      this.table.getdataListParm.parammaps.enable = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      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) {
+          console.log(123)
+          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, 'createdtime': parseTime(new Date(), '{y}-{m}-{d}'), 'createmp': Cookies.get('employename'), 'username': '', 'roleid': '' })
+    },
+    changeRolename(item) {
+      this.table.temp.rolename = this.roleList.find(obj => obj.id === item).rolename
+    },
+    createData(row) {
+      console.log('点击了新增保存', row)
+      this.table.temp.pastureid = Cookies.get('pastureid')
+      this.table.temp.empname = row.empname
+      this.table.temp.username = row.username
+      this.table.temp.phone = row.phone
+      this.table.temp.createmp = row.createmp
+      this.table.temp.enable = row.enable
+      this.table.temp.roleid = row.roleid
+      // 检验用户名称/角色是否为空
+      if (this.table.temp.username == '' && this.table.temp.roleid == '') {
+        this.$message({ type: 'error', message: '用户名称/角色不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.username == '') {
+        this.$message({ type: 'error', message: '用户名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.roleid == '') {
+        this.$message({ type: 'error', message: '角色不能为空', duration: 2000 })
+        return false
+      }
+      // 检验手机号是否为11位数字
+      if (this.table.temp.phone !== undefined && this.table.temp.phone !== '') {
+        const phone = /^\d{11}$/
+        if (!phone.test(this.table.temp.phone)) {
+          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'createUser'
+      this.table.temp.isgroups = Cookies.get('ispastureuse')
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          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
+      row.roleid = String(row.roleid)
+      this.table.temp.roleid = row.roleid
+      this.table.temp.rolename = row.rolename
+    },
+    updateData(row) {
+      console.log('点击了编辑保存', row)
+      this.table.temp.pastureid = row.pastureid
+      this.table.temp.empname = row.empname
+      this.table.temp.username = row.username
+      this.table.temp.phone = row.phone
+      this.table.temp.createmp = row.createmp
+      this.table.temp.enable = row.enable
+      this.table.temp.roleid = row.roleid
+      this.table.temp.id = row.id
+      // 校验用户名称/角色是否为空
+      if (this.table.temp.username == '' && this.table.temp.roleid == '') {
+        this.$message({ type: 'error', message: '用户名称/角色不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.username == '') {
+        this.$message({ type: 'error', message: '用户名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.roleid == '') {
+        this.$message({ type: 'error', message: '角色不能为空', duration: 2000 })
+        return false
+      }
+      console.log(this.table.temp.phone)
+      // 检验手机号是否为11位数字
+      if (this.table.temp.phone !== undefined && this.table.temp.phone !== '') {
+        const phone = /^\d{11}$/
+        if (!phone.test(this.table.temp.phone)) {
+          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'updateUser'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateCancel(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.getList()
+    },
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deleteUser'
+        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('是否确认删除此信息?', {
+          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': 'deleteUser', '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()
+            }
+          })
+        })
+      }
+    },
+    handleResetPassword(row) {
+      MessageBox.confirm('是否确认将此用户密码重置为默认密码:  Kpt@.666 ', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'initPassword'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = row.pastureid
+        this.requestParam.parammaps.id = row.id
+        PostDataByName(this.requestParam).then(() => {
+          this.getList()
+          this.resetRequestParam()
+          this.dialogFormVisible = false
+          this.$notify({
+            title: '成功',
+            message: '重置密码成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      })
+    },
+    handleScanningCode(row){
+      this.QRcode.dialogStatus = 'QRcode'
+      this.QRcode.dialogFormVisible = true
+      this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_str=tmrwatch.'+ Cookies.get('pastureid')+'.'+ row.username + '.'+row.empname
+      console.log(this.imgUrl)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+  // .search{margin-top:10px;}
+  .QRcode{display:flex;justify-content: center; align-items:center;}
+  .content{
+    /* margin-top: 100px; */
+    width: 500px;
+  }
+  .content img{
+    max-width:300px;
+
+  }
+ </style>

+ 13 - 13
vue.config.js

@@ -1,6 +1,6 @@
 'use strict'
 const path = require('path')
-const defaultSettings = require('./src/settings.js')
+const defaultSettings = require('./src/settings.js')
 // const TerserPlugin = require('terser-webpack-plugin')
 
 function resolve(dir) {
@@ -47,18 +47,18 @@ module.exports = {
     },
     after: require('./mock/mock-server.js')
   },
-
-  configureWebpack: {
-    // provide the app's title in webpack's name field, so that
-    // it can be accessed in index.html to inject the correct title.
-
-    devtool: 'source-map',
-    name: name,
-    resolve: {
-      alias: {
-        '@': resolve('src')
-      }
-    }
+
+  configureWebpack: {
+    // provide the app's title in webpack's name field, so that
+    // it can be accessed in index.html to inject the correct title.
+
+    devtool: 'source-map',
+    name: name,
+    resolve: {
+      alias: {
+        '@': resolve('src')
+      }
+    }
   },
   chainWebpack(config) {
     config.plugins.delete('preload') // TODO: need test

Some files were not shown because too many files changed in this diff