Selaa lähdekoodia

Signed-off-by: 段小段 <1729609802@qq.com>

段小段 4 vuotta sitten
vanhempi
commit
364641e159
74 muutettua tiedostoa jossa 43797 lisäystä ja 1647 poistoa
  1. 7 6
      .env.development
  2. 868 0
      .svn/pristine/05/0527486f1c969c80bfd0ae159de33957dcd40aa4.svn-base
  3. 775 0
      .svn/pristine/09/09b05632f25444bf03836aa6d34f132316eb6826.svn-base
  4. 507 0
      .svn/pristine/0e/0eaf6cca1cbf4de6b3d4a3df9f928a9366638b41.svn-base
  5. 302 0
      .svn/pristine/10/100e7fa67bc8dc8092a5f7a1c09e06a09af6666a.svn-base
  6. 586 0
      .svn/pristine/2b/2b5c85127eae3c274cc4366befb1d6bee9c4a11d.svn-base
  7. 849 0
      .svn/pristine/3c/3cc303cdbdc2aa3cc3e57a191878fe0e069e10ed.svn-base
  8. 891 0
      .svn/pristine/54/541353afb468a677411538195e245d48cc9a0ec5.svn-base
  9. 3078 0
      .svn/pristine/54/54db4710914d2bb75e20b7b8a34e7ee184484689.svn-base
  10. 944 0
      .svn/pristine/5c/5c6c332e83d8b8c2c098f78ac821456a98f786aa.svn-base
  11. 560 0
      .svn/pristine/6e/6e8f22cd745c4dba5ac5602d78afe032e324b6c0.svn-base
  12. 666 0
      .svn/pristine/74/7428cc119ae68064644029af3e6794e2b1c0a417.svn-base
  13. 3170 0
      .svn/pristine/76/76adcd8b4936f3ab968d84b18a9c232db583a717.svn-base
  14. 299 0
      .svn/pristine/77/77960e2dc87e7e86eb6ff71142bf6cfb95f196d3.svn-base
  15. 256 0
      .svn/pristine/7a/7a9bb26abe982b6c972f274cc4cfb4f57e3b8e53.svn-base
  16. 1504 0
      .svn/pristine/7c/7cce6ff958df28fb88e791d72242236e13684133.svn-base
  17. 1803 0
      .svn/pristine/85/85060546f5129e1c3c01a5bc9feb2f362c802848.svn-base
  18. 407 0
      .svn/pristine/90/9040769de5b70456c102d5c1d0235f2663820f8a.svn-base
  19. 916 0
      .svn/pristine/92/9240a6bde7334db49e0e5f3bc8ea8087981b3bde.svn-base
  20. 917 0
      .svn/pristine/a9/a9ab302d0c3710777b879ba37f1ab212c12ec333.svn-base
  21. 139 0
      .svn/pristine/aa/aa2cca7f6870566f34da5c17570babbdb7c1324d.svn-base
  22. 871 0
      .svn/pristine/aa/aace812bd63d562dafc4b6cf8bc521c6ccee759b.svn-base
  23. 1731 0
      .svn/pristine/ac/acdf987480cf3e4cacfe6204c6356ddceea9acc9.svn-base
  24. 1148 0
      .svn/pristine/b2/b273267010f00738e2ac93dd1159e2d9af155f3c.svn-base
  25. 130 38
      .svn/pristine/b8/b802b35ebeb96ffb9c2bea95065bd42c262d1c2e.svn-base
  26. 964 0
      .svn/pristine/c0/c03b4588dba245e6f0f2625bde30241267670834.svn-base
  27. 478 0
      .svn/pristine/c7/c73b244b0575d96c2359c2ebcd54d8f8a070cd2a.svn-base
  28. 647 0
      .svn/pristine/ca/ca6ebdf2e66217547d612f4e2846c01dd80f1b05.svn-base
  29. 1797 0
      .svn/pristine/cb/cb02ce6f523cbd7a07fdfbbd6f29dd1edc703603.svn-base
  30. 1449 0
      .svn/pristine/e3/e3eb3e4cc40cd9daa8f9af1466a3ff48ade90425.svn-base
  31. 588 0
      .svn/pristine/ee/eee6e6667ea9a0dfef40ff8c72b20e77b77172bf.svn-base
  32. 1971 0
      .svn/pristine/f2/f22fcdf3ff4264253590f6776bb80eb296804d91.svn-base
  33. BIN
      .svn/wc.db
  34. BIN
      dist.zip
  35. 0 12
      src/App.vue
  36. 16 2
      src/api/common.js
  37. 26 8
      src/main.js
  38. 5 0
      src/styles/index.scss
  39. 10 4
      src/views/basicData/feedTable/index.vue
  40. 23 3
      src/views/basicData/forkliftManagement/index.vue
  41. 51 64
      src/views/console/dict/index.vue
  42. 11 0
      src/views/dashboard/pasture/index.vue
  43. 28 0
      src/views/formulationPlan/dailyExecutionPlan/index.vue
  44. 1 1
      src/views/formulationPlan/dailyExecutionPlan/typePage/dhedFormula.vue
  45. 71 30
      src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue
  46. 2 2
      src/views/formulationPlan/dailyExecutionPlan/typePage/premixedPlan.vue
  47. 125 35
      src/views/formulationPlan/dhedFormula/index.vue
  48. 1814 0
      src/views/formulationPlan/materialIssuancePlan/index - 副本.vue
  49. 547 219
      src/views/formulationPlan/materialIssuancePlan/index.vue
  50. 78 6
      src/views/formulationPlan/premixedPlan/index.vue
  51. 3064 0
      src/views/formulationPlan/recipeTemplate/index - 副本 (2).vue
  52. 2961 0
      src/views/formulationPlan/recipeTemplate/index - 副本.vue
  53. 508 363
      src/views/formulationPlan/recipeTemplate/index.vue
  54. 71 3
      src/views/formulationPlan/surplusMaterialPlan/index.vue
  55. 17 17
      src/views/inventoryManagement/laborConsumption/index.vue
  56. 232 0
      src/views/shedProduction/dungScores/historyRecord.vue
  57. 103 29
      src/views/shedProduction/dungScores/index.vue
  58. 235 0
      src/views/shedProduction/fecalScreen/historyRecord.vue
  59. 65 10
      src/views/shedProduction/fecalScreen/index.vue
  60. 311 0
      src/views/shedProduction/formulaDryMatter/historyRecord.vue
  61. 62 10
      src/views/shedProduction/formulaDryMatter/index.vue
  62. 334 0
      src/views/shedProduction/pennsylvaniaSieve/historyRecord.vue
  63. 61 9
      src/views/shedProduction/pennsylvaniaSieve/index.vue
  64. 228 0
      src/views/shedProduction/physicalConditionScore/historyRecord.vue
  65. 103 29
      src/views/shedProduction/physicalConditionScore/index.vue
  66. 184 184
      src/views/statisticalAnalysis/equipmentRunningTrack/index.vue
  67. 28 18
      src/views/statisticalAnalysis/errorAnalysis/group/tab2.vue
  68. 28 18
      src/views/statisticalAnalysis/errorAnalysis/group/tab3.vue
  69. 253 87
      src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue
  70. 408 0
      src/views/statisticalAnalysis/errorAnalysis/pasture/see.vue
  71. 6 2
      src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue
  72. 160 153
      src/views/statisticalAnalysis/inventoryManagement/group/index.vue
  73. 327 264
      src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue
  74. 22 21
      src/views/systemManagement/role/index.vue

+ 7 - 6
.env.development

@@ -1,13 +1,14 @@
 # just a flag
 ENV = 'development'
 
-# base api
+# base api
 # 测试线
-# VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
-# 颛孙洋洋
-VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
-# 刘欢
-# VUE_APP_BASE_API = 'http://192.168.1.55:8084'
+# VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
+# 沙巍
+# VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
+# 白少杰
+VUE_APP_BASE_API = 'http://192.168.1.90:8081/'
+
 #=====
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 868 - 0
.svn/pristine/05/0527486f1c969c80bfd0ae159de33957dcd40aa4.svn-base

@@ -0,0 +1,868 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+      <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+      <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</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" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">导出</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</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="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="班次" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.timesstr }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="鲜样重量(g)" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.freshweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="烘干重量(g)" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.dryweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="理论干物质" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.thoweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="实际干物质" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.actweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作人" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.emp }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作日期" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.operatetime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="70%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 90%;margin:0 auto 50px">
+          <el-row>
+            <el-col v-if="create.dialogStatus=='create'" :span="12">
+              <el-form-item label="栏舍名称:" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
+                  <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-else :span="12">
+              <el-form-item label="栏舍名称:" prop="barname">
+                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="班次:" prop="times">
+                <el-select ref="times" v-model="create.temp.times" :disabled="create.dialogStatus=='update'" filterable placeholder="班次" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="鲜样重量(g):" prop="freshweight">
+                <el-input ref="freshweight" v-model="create.temp.freshweight" class="filter-item" placeholder="最多两位小数" type="number" @blur="blurFreshweight" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="烘干重量(g):" prop="dryweight">
+                <el-input ref="dryweight" v-model="create.temp.dryweight" class="filter-item" placeholder="最多两位小数" type="number" @blur="blurDryweight" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="理论干物质:" prop="thoweight">
+                <span>{{ create.temp.thoweight }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="实际干物质:" prop="actweight">
+                <span>{{ create.temp.actweight }}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="操作人:" prop="emp">
+                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" class="filter-item" style="width: 100%;" @blur="blurEmp">
+                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="操作日期:" prop="operatetime">
+                <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" @change="changeOperatetime" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'FormulaDryMatter',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+      ],
+      houseNameList: [], // 栏舍名称
+      frequencyList: [], // 班次
+
+      table: {
+        getdataListParm: {
+          name: 'getFtdryList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', freshweight: '', dryweight: '', thoweight: '', actweight: '', times: '' },
+        rules: {
+          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          freshweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          dryweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        },
+        // 操作人
+        getdataListParm: {
+          name: 'getFtdryEmpHis',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        // 理论干物质
+        getdataListParm2: {
+          name: 'getFtdrytweight',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            date: ''
+          }
+        },
+        noteTakerList: [] // 记录人
+      },
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
+      download: {
+        getdataListParm: {
+          name: 'getFtdryList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        list: []
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'checkdryfresh,checkbarname,checktimes,insertFtdryUpload',
+        importParams: '栏舍名称,班次,鲜样重量(g),烘干重量(g),操作人,操作日期',
+        sheetname: 'Sheet1',
+        // 登录牧场
+        pastureid: Cookies.get('pastureid'),
+        // 日期参数
+        dateParams: '操作日期',
+        // 必填参数
+        requiredParams: '栏舍名称,班次,鲜样重量(g),烘干重量(g)',
+        // 为数值的参数
+        numParams: '鲜样重量(g),烘干重量(g)'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'FormulaDryMatter'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.houseNameList = response.data.getBarListEnable.list
+        if (response.data.getSysoptEnable.list !== null) {
+          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
+            const obj = {}
+            obj.id = String(i)
+            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }
+            this.frequencyList.push(obj)
+          }
+        } else {
+          this.frequencyList = []
+        }
+      })
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.barid = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    // 新增
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', freshweight: '', dryweight: '', thoweight: '', actweight: '', times: '' }
+    },
+    blurEmp(item) {
+      this.create.temp.emp = item.target.value
+    },
+    // 栏舍名称
+    changeBar(item) {
+      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
+      this.getThoweight()
+    },
+    changeOperatetime() {
+      this.getThoweight()
+    },
+    //  理论干物质
+    getThoweight() {
+      this.create.getdataListParm2.parammaps.date = this.create.temp.operatetime
+      this.create.getdataListParm2.parammaps.barid = this.create.temp.barid
+      GetDataByName(this.create.getdataListParm2).then(response => {
+        if (response.data.list !== null) {
+          this.create.temp.thoweight = response.data.list[0].thoweight
+        } else {
+          this.create.temp.thoweight = 0
+        }
+      })
+    },
+    // 操作人
+    getNoteTakerList() {
+      GetDataByName(this.create.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].myId = i
+          }
+          this.create.noteTakerList = response.data.list
+          console.log('记录人数据', response.data.list)
+          console.log(this.create.noteTakerList)
+        } else {
+          this.create.noteTakerList = []
+        }
+      })
+    },
+    blurFreshweight() {
+      if (this.create.temp.dryweight !== '' && this.create.temp.freshweight !== '') {
+        this.create.temp.actweight = parseFloat(this.create.temp.dryweight) / parseFloat(this.create.temp.freshweight)
+        this.create.temp.actweight = this.create.temp.actweight.toFixed(2)
+      }
+    },
+    blurDryweight() {
+      if (this.create.temp.freshweight !== '' && this.create.temp.dryweight !== '') {
+        this.create.temp.actweight = parseFloat(this.create.temp.dryweight) / parseFloat(this.create.temp.freshweight)
+        this.create.temp.actweight = this.create.temp.actweight.toFixed(2)
+      }
+    },
+    handleCreate() {
+      console.log('点击了新增')
+      this.resetTemp()
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'create'
+      this.create.dialogFormVisible = true
+    },
+    createData() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 鲜样重量/烘干重量
+          if (!weight.test(parseFloat(this.create.temp.freshweight)) || !weight.test(parseFloat(this.create.temp.dryweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+          if (this.create.temp.freshweight !== '' && this.create.temp.dryweight) {
+            if (parseFloat(this.create.temp.dryweight) > parseFloat(this.create.temp.freshweight)) {
+              this.$message({ type: 'error', message: '烘干重量不可大于鲜样重量', duration: 2000 })
+              return false
+            }
+          }
+          this.requestParam.name = 'insertFtdry'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const barid = new RegExp("key 'barid'")
+              if (barid.test(response.data)) {
+                this.$message({ type: 'error', message: '该栏舍该班次今日配方干物质已存在,不可重复生成', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertFtdryHistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createDataAgain() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 鲜样重量/烘干重量
+          if (!weight.test(parseFloat(this.create.temp.freshweight)) || !weight.test(parseFloat(this.create.temp.dryweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+          if (this.create.temp.freshweight !== '' && this.create.temp.dryweight) {
+            if (parseFloat(this.create.temp.dryweight) > parseFloat(this.create.temp.freshweight)) {
+              this.$message({ type: 'error', message: '烘干重量不可大于鲜样重量', duration: 2000 })
+              return false
+            }
+          }
+          this.requestParam.name = 'insertFtdry'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.resetTemp()
+              this.getList()
+              this.getNoteTakerList()
+            } else {
+              const barid = new RegExp("key 'barid'")
+              if (barid.test(response.data)) {
+                this.$message({ type: 'error', message: '该栏舍该班次今日配方干物质已存在,不可重复生成', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log('点击了编辑', row)
+      row.barid = String(row.barid)
+      this.create.temp = Object.assign({}, row)
+      this.create.temp.id = row.id
+
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'update'
+      this.create.dialogFormVisible = true
+    },
+    updateData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 鲜样重量/烘干重量
+          if (!weight.test(parseFloat(this.create.temp.freshweight)) || !weight.test(parseFloat(this.create.temp.dryweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+          if (this.create.temp.freshweight !== '' && this.create.temp.dryweight) {
+            if (parseFloat(this.create.temp.dryweight) > parseFloat(this.create.temp.freshweight)) {
+              this.$message({ type: 'error', message: '烘干重量不可大于鲜样重量', duration: 2000 })
+              return false
+            }
+          }
+          this.requestParam.name = 'updateFtdry'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deleteFtdry'
+        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
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择配方干物质', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteFtdry', '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() {
+      console.log('点击了复制')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择配方干物质', duration: 2000 })
+      } else if (this.selectList.length == 1) {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.requestParam.name = 'copyFtdry'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
+          this.requestParam.parammaps.id = this.selectList[0].id
+          PostDataByName(this.requestParam).then(response => {
+            if (response.msg === 'fail') {
+              const barid = new RegExp("key 'barid'")
+              if (barid.test(response.data)) {
+                this.$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.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '请选择一条配方干物质', duration: 2000 })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/栏舍生产/配方干物质导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '配方干物质导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
+          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.download.getdataListParm.parammaps.inputDatetime = ''
+          this.download.getdataListParm.parammaps.startTime = ''
+          this.download.getdataListParm.parammaps.stopTime = ''
+        }
+        GetDataByName(this.download.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.download.list = response.data.list
+          } else {
+            this.download.list = []
+          }
+          var excelDatas = [
+            {
+              tHeader: ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '理论干物质', '实际干物质', '操作人', '操作日期'],
+              filterVal: ['barname', 'timesstr', 'freshweight', 'dryweight', 'thoweight', 'actweight', 'emp', 'operatetime'],
+              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 = ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '操作人', '操作日期', '错误信息']
+             const filterVal = ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '操作人', '操作日期', 'error_msg']
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '配方干物质导入报错信息', autoWidth: true, bookType: 'xlsx' })
+           })
+        }
+      } else {
+        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+</style>

+ 775 - 0
.svn/pristine/09/09b05632f25444bf03836aa6d34f132316eb6826.svn-base

@@ -0,0 +1,775 @@
+<template>
+  <div class="app-container">
+    <!-- <h1>集团</h1> -->
+    <el-tabs v-model="activeName" @tab-click="handleTabClick">
+      <el-tab-pane label="库存统计" name="first">
+        <div class="search">
+          <el-select v-model="tab.table.getdataListParm.parammaps.pastureid" style="margin-right: 10px;margin-bottom:10px;width: 150px;" filterable placeholder="牧场" class="filter-item" clearable>
+            <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
+          </el-select>
+          <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 250px;margin-bottom:10px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
+          <el-input v-model="tab.table.getdataListParm.parammaps.feedname" class="filter-item" style="width: 245px;margin-bottom:10px;" placeholder="饲料名称" />
+          <el-button class="successBorder" style="margin-left: 10px;margin-bottom:10px;" @click="handleSearch('first')">查询</el-button>
+          <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport(tab1)">导出</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="tab.table.tableKey"
+            v-loading="tab.table.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab.table.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column sortable label="饲料名称" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.feedname }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="期初" min-width="130px" align="center">
+              <el-table-column sortable prop="startsum" align="center" label="期初库存(kg)" min-width="120" />
+              <el-table-column sortable prop="startprice" align="center" label="期初金额(元)" min-width="120" />
+            </el-table-column>
+            <el-table-column label="用量" min-width="110px" align="center">
+              <el-table-column sortable prop="laidsum" align="center" label="入库重量(kg)" min-width="120" />
+              <el-table-column sortable prop="usesumXT" align="center" label="系统出库重量(kg)" min-width="120" />
+              <el-table-column sortable prop="usesumRG" align="center" label="人工用料重量(kg)" min-width="120" />
+              <el-table-column sortable prop="usesumXH" align="center" label="损耗重量(kg)" min-width="120" />
+            </el-table-column>
+            <el-table-column label="期末" min-width="130px" align="center">
+              <el-table-column sortable prop="stopsum" align="center" label="期末库存(kg)" min-width="120" />
+              <el-table-column sortable prop="stopprice" align="center" label="期末金额(元)" min-width="120" />
+            </el-table-column>
+          </el-table>
+          <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getTabList" />
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="用料分析" name="second">
+        <div class="search">
+          <el-select v-model="tab2.table.getdataListParm.parammaps.pastureid" style="margin-right: 10px;margin-bottom:10px;width: 130px;" filterable placeholder="牧场" class="filter-item" clearable>
+            <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
+          </el-select>
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
+          <span style="margin-left: 10px;">统计类型:</span>
+          <el-radio v-model="tab2.radio" label="1" @change="changeRadio2">牲畜类别</el-radio>
+          <el-radio v-model="tab2.radio" label="2" @change="changeRadio2">栏舍名称</el-radio>
+          <el-radio v-model="tab2.radio" label="3" @change="changeRadio2">日期</el-radio>
+          <el-radio v-model="tab2.radio" label="4" @change="changeRadio2">TMR设备编号</el-radio>
+          <el-radio v-model="tab2.radio" label="5" @change="changeRadio2">班次</el-radio>
+          <el-radio v-model="tab2.radio" label="6" @change="changeRadio2">车次</el-radio>
+          <el-input v-if="tab2.isRadio1" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 170px;" placeholder="牲畜类别" />
+          <el-input v-if="tab2.isRadio2" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 170px;" placeholder="栏舍名称" />
+          <el-input v-if="tab2.isRadio3" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 170px;" placeholder="日期" />
+          <el-input v-if="tab2.isRadio4" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 170px;" placeholder="TMR设备编号" />
+          <el-input v-if="tab2.isRadio5" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 170px;" placeholder="班次" />
+          <el-input v-if="tab2.isRadio6" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 170px;" placeholder="车次" />
+          <el-button class="successBorder" @click="handleSearch('second')">查询</el-button>
+          <el-button class="export" style="float: right;margin-right: 5px;" @click="handleExport('tab2')">导出</el-button>
+        </div>
+        <el-table
+          :key="tab2.table.tableKey"
+          v-loading="tab2.table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab2.table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :height="myHeight2"
+          ref="elTable1"
+        >
+          <el-table-column v-for="item in tab2.table.tableConfig" align="center" :label="item.label" :prop="item.prop">
+            <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" align="center" :label="item1.label" :prop="item1.prop">
+              <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :label="item2.label" :prop="item2.prop" />
+            </el-table-column>
+          </el-table-column>
+        </el-table>
+        <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 v-if="tab2.table.list.length==0" style="text-align: center;">暂无数据</div> -->
+      </el-tab-pane>
+      <el-tab-pane label="价格分析" name="third">
+        <div class="search">
+          <el-select v-model="tab3.table.getdataListParm.parammaps.pastureid" style="margin-right: 10px;margin-bottom:10px;width: 150px;" filterable placeholder="牧场" class="filter-item" clearable>
+            <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
+          </el-select>
+          <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled3" @click="handleBefore3" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled3" @click="handleNext3" />
+          <span style="margin-left: 10px;">统计类型:</span>
+          <el-radio v-model="tab3.radio" label="1" @change="changeRadio3">牲畜类别</el-radio>
+          <el-radio v-model="tab3.radio" label="2" @change="changeRadio3">栏舍名称</el-radio>
+          <el-radio v-model="tab3.radio" label="3" @change="changeRadio3">日期</el-radio>
+          <el-radio v-model="tab3.radio" label="4" @change="changeRadio3">TMR设备编号</el-radio>
+          <el-input v-if="tab3.isRadio1" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="牲畜类别" />
+          <el-input v-if="tab3.isRadio2" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="栏舍名称" />
+          <el-input v-if="tab3.isRadio3" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="日期" />
+          <el-input v-if="tab3.isRadio4" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 180px;" placeholder="TMR设备编号" />
+          <el-button class="successBorder" @click="handleSearch('third')">查询</el-button>
+          <el-button class="export" style="float: right;margin-right: 5px;" @click="handleExport('tab3')">导出</el-button>
+        </div>
+        <el-table
+          :key="tab3.table.tableKey"
+          v-loading="tab3.table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab3.table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :height="myHeight2"
+          ref="elTable2"
+        >
+          <el-table-column v-for="item in tab3.table.tableConfig" align="center" :label="item.label" :prop="item.prop">
+            <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" align="center" :label="item1.label" :prop="item1.prop">
+              <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :label="item2.label" :prop="item2.prop" />
+            </el-table-column>
+          </el-table-column>
+        </el-table>
+        <span v-if="tab3.table.listLoading == false && tab3.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
+        <!-- <div v-if="tab3.table.list.length==0" style="text-align: center;">暂无数据</div> -->
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+  </div>
+
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, GetReportform } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'GroupInventoryManagement',
+  components: { Pagination },
+  data() {
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      Beforedisabled2: false,
+      Nextdisabled2: false,
+      pickerMinDate: '',
+      pickerOptions: {
+        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()
+        }
+      },
+      requestParams: [
+        { name: 'getPastureListJT', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), pasturename: '' }}
+      ],
+      pastureList: [], // 牧场
+      fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
+      activeName: 'first',
+      tab: {
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getfsStaticlist',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: '',
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              feedname: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: false
+        }
+      },
+
+      tab2: {
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getMaterialAnalysisSC',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: '',
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              fname: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          tableConfig: [],
+          total: 0,
+          listLoading: false
+        },
+        radio: '1',
+        isRadio1: true,
+        isRadio2: false,
+        isRadio3: false,
+        isRadio4: false,
+        isRadio5: false,
+        isRadio6: false
+      },
+      tab3: {
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getPriceAnalysisSC',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: '',
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              fname: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          tableConfig: [],
+          total: 0,
+          listLoading: false
+        },
+        radio: '1',
+        isRadio1: true,
+        isRadio2: false,
+        isRadio3: false,
+        isRadio4: false
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2:document.documentElement.clientHeight - 85-200
+    }
+  },
+  updated() {
+    this.$refs['elTable1'].doLayout()
+    this.$refs['elTable2'].doLayout()
+  },
+  created() {
+    this.getDownList()
+    this.getTimeFn()
+  },
+
+  methods: {
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.pastureList = response.data.getPastureListJT.list
+        this.tab.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
+        this.getTabList()
+      })
+    },
+    getTimeFn() {
+      const that = this
+      const end = new Date()
+      const start = new Date()
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab2.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab2.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.inputDatetime = [start, end]
+    },
+    handleTabClick() {
+      if (this.activeName == 'first') {
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
+        this.getTabList()
+      } else if (this.activeName == 'second') {
+        console.log(this.pastureList)
+        const start2 = new Date()
+        const end2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab2.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+        this.tab2.table.getdataListParm.parammaps.pastureid = this.pastureList[0].pastureid
+        this.getTab2List()
+      } else if (this.activeName == 'third') {
+        const start3 = new Date()
+        const end3 = new Date()
+        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
+        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab3.table.getdataListParm.parammaps.inputDatetime = [start3, end3]
+        this.tab3.table.getdataListParm.parammaps.pastureid = this.pastureList[0].pastureid
+        this.getTab3List()
+      }
+    },
+    getTabList() {
+      this.tab.table.listLoading = true
+      GetDataByName(this.tab.table.getdataListParm).then(response => {
+        console.log('库存统计table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab.table.list = response.data.list
+          this.tab.table.total = response.data.total
+        } else {
+          this.tab.table.list = []
+        }
+        setTimeout(() => {
+          this.tab.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch(item) {
+      if (item == 'first') {
+        if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.table.getdataListParm.parammaps.startTime = ''
+          this.tab.table.getdataListParm.parammaps.stopTime = ''
+        }
+        this.getTabList()
+      } else if (item == 'second') {
+        if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
+          this.tab2.table.getdataListParm.parammaps.startTime = ''
+          this.tab2.table.getdataListParm.parammaps.stopTime = ''
+        }
+        this.getTab2List()
+      } else if (item == 'third') {
+        if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
+          this.tab3.table.getdataListParm.parammaps.startTime = ''
+          this.tab3.table.getdataListParm.parammaps.stopTime = ''
+        }
+        this.getTab3List()
+      }
+    },
+    handleExport(item) {
+      if (item == 'tab1') {
+        console.log('库存统计导出')
+      } else if (item == 'tab2') {
+        console.log('用料分析导出数据', this.tab2.table.list)
+        console.log('用料分析导出表头', this.tab2.table.tableConfig)
+        var exportData = []
+        var exportTitle1 = [] // 一级标题
+        var exportTitle2 = [] // 二级标题
+        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)
+          }
+        }
+        console.log('一级标题exportTitle1', exportTitle1)
+        console.log('二级标题exportTitle2', exportTitle2)
+        var headerArr = []// 处理一级标题
+        for (let i = 0; i < exportTitle1.length; i++) {
+          if (i > 0) {
+            headerArr.push(exportTitle1[i], '', '', '')
+          } else {
+            headerArr.push(exportTitle1[i])
+          }
+        }
+        console.log('一级表头处理后', headerArr)
+        var valueArr = [] // 对应字段
+        for (let i = 0; i < exportTitle2.length; i++) {
+          if (i == 0) {
+            valueArr.push('A')
+          } else {
+            valueArr.push('a' + [i - 1])
+          }
+        }
+        console.log('对应字段valueArr', valueArr)
+        if (headerArr.length > 0) {
+            import('@/vendor/Export3Excel').then((excel) => {
+              const multiHeader = [
+                headerArr
+              ]
+              const multiHeader2 = []
+              const tHeader = exportTitle2
+              const filterVal = valueArr// 表头所对应的字段,这里未填写
+              const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
+              // const data = [];
+              // 进行所有表头的单元格合并
+              // const merges = ['A1:A1', 'B1:E1','F1:J1' ];
+              const merges = ['A1:A1']
+
+              excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
+            })
+        }
+      } else if (item == 'tab3') {
+        console.log('价格分析导出')
+        console.log('价格分析导出数据', this.tab3.table.list)
+        console.log('价格分析导出表头', this.tab3.table.tableConfig)
+        var exportData = []
+        var exportTitle1 = [] // 一级标题
+        var exportTitle2 = [] // 二级标题
+        for (let i = 0; i < this.tab3.table.tableConfig.length; i++) {
+          exportTitle1.push(this.tab3.table.tableConfig[i].label)
+          for (let j = 0; j < this.tab3.table.tableConfig[i].children.length; j++) {
+            exportTitle2.push(this.tab3.table.tableConfig[i].children[j].label)
+          }
+        }
+        console.log('一级标题exportTitle1', exportTitle1)
+        console.log('二级标题exportTitle2', exportTitle2)
+        var headerArr = []// 处理一级标题
+        for (let i = 0; i < exportTitle1.length; i++) {
+          if (i > 0) {
+            headerArr.push(exportTitle1[i], '')
+          } else {
+            headerArr.push(exportTitle1[i])
+          }
+        }
+        console.log('一级表头处理后', headerArr)
+        var valueArr = [] // 对应字段
+        for (let i = 0; i < exportTitle2.length; i++) {
+          if (i == 0) {
+            valueArr.push('A')
+          } else {
+            valueArr.push('a' + [i - 1])
+          }
+        }
+        console.log('对应字段valueArr', valueArr)
+        if (headerArr.length > 0) {
+            import('@/vendor/Export3Excel').then((excel) => {
+              const multiHeader = [
+                headerArr
+              ]
+              const multiHeader2 = []
+              const tHeader = exportTitle2
+              const filterVal = valueArr// 表头所对应的字段,这里未填写
+              const data = this.tab3.table.list.map(v => filterVal.map(j => v[j]))
+              // const data = [];
+              // 进行所有表头的单元格合并
+              // const merges = ['A1:A1', 'B1:E1','F1:J1' ];
+              const merges = ['A1:A1']
+
+              excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '价格分析', merges })
+            })
+        }
+      }
+    },
+    format(jsonData) { // 数据处理
+      const dataList = []
+      for (let i = 0; i < jsonData.length; i++) {
+        const list = []
+        list.push(jsonData[i].index)
+        list.push(jsonData[i].Personel)
+        list.push(jsonData[i].address)
+        for (let j = 0; j < jsonData[0]['time'].length; j++) {
+          list.push(jsonData[i]['time'][j].morning)
+          list.push(jsonData[i]['time'][j].afternoon)
+        }
+        dataList.push(list)
+      }
+      return dataList
+    },
+    // 用料分析
+    getTab2List() {
+      this.tab2.table.listLoading = true
+      GetReportform(this.tab2.table.getdataListParm).then(response => {
+        if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
+          console.log('库存统计-用料分析', response.data.list)
+          this.tab2.table.list = response.data.list.data1
+          this.tab2.table.tableConfig = response.data.list.data2
+          this.tab2.table.total = response.data.total
+        } else {
+          this.tab2.table.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table.listLoading = false
+        }, 100)
+      })
+    },
+    changeRadio2() {
+      console.log(this.tab2.radio)
+      if (this.tab2.radio == '1') {
+        this.tab2.isRadio1 = true,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisSC'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '2') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = true,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisLS'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '3') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = true,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisRQ'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '4') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = true,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisTMR'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '5') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = true,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisBC'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '6') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = true,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisCC'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      }
+    },
+    // 价格分析
+    getTab3List() {
+      this.tab3.table.listLoading = true
+      GetReportform(this.tab3.table.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list.data1 !== null && response.data.list.data2 !== null) {
+          console.log('库存统计-价格分析', response.data.list)
+          this.tab3.table.list = response.data.list.data1
+          this.tab3.table.tableConfig = response.data.list.data2
+          this.tab3.table.total = response.data.total
+        } else {
+          this.tab3.table.list = []
+        }
+        setTimeout(() => {
+          this.tab3.table.listLoading = false
+        }, 100)
+      })
+    },
+    changeRadio3() {
+      console.log(this.tab3.radio)
+      if (this.tab3.radio == '1') {
+        this.tab3.isRadio1 = true,
+        this.tab3.isRadio2 = false,
+        this.tab3.isRadio3 = false,
+        this.tab3.isRadio4 = false,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisSC'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      } else if (this.tab3.radio == '2') {
+        this.tab3.isRadio1 = false,
+        this.tab3.isRadio2 = true,
+        this.tab3.isRadio3 = false,
+        this.tab3.isRadio4 = false,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisLS'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      } else if (this.tab3.radio == '3') {
+        this.tab3.isRadio1 = false,
+        this.tab3.isRadio2 = false,
+        this.tab3.isRadio3 = true,
+        this.tab3.isRadio4 = false,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisRQ'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      } else if (this.tab3.radio == '4') {
+        this.tab3.isRadio1 = false,
+        this.tab3.isRadio2 = false,
+        this.tab3.isRadio3 = false,
+        this.tab3.isRadio4 = true,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisTMR'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      }
+    },
+
+    handleBefore() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleNext() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleBefore2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop3 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleNext2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop4 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleBefore3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop5 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    handleNext3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop6 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{
+    margin-bottom:10px;
+    .el-radio{margin-right: 10px;}
+    .filter-item1{margin-top: 10px;}
+  }
+</style>

+ 507 - 0
.svn/pristine/0e/0eaf6cca1cbf4de6b3d4a3df9f928a9366638b41.svn-base

@@ -0,0 +1,507 @@
+@import './variables.scss';
+@import './mixin.scss';
+@import './transition.scss';
+@import './element-ui.scss';
+@import './sidebar.scss';
+@import './btn.scss';
+
+body {
+  height: 100%;
+  -moz-osx-font-smoothing: grayscale;
+  -webkit-font-smoothing: antialiased;
+  text-rendering: optimizeLegibility;
+  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+}
+
+label {
+  font-weight: 700;
+}
+
+html {
+  height: 100%;
+  box-sizing: border-box;
+}
+
+#app {
+  height: 100%;
+}
+
+*,
+*:before,
+*:after {
+  box-sizing: inherit;
+}
+
+.no-padding {
+  padding: 0px !important;
+}
+
+.padding-content {
+  padding: 4px 0;
+}
+
+a:focus,
+a:active {
+  outline: none;
+}
+
+a,
+a:focus,
+a:hover {
+  cursor: pointer;
+  color: inherit;
+  text-decoration: none;
+}
+
+div:focus {
+  outline: none;
+}
+
+.fr {
+  float: right;
+}
+
+.fl {
+  float: left;
+}
+
+.pr-5 {
+  padding-right: 5px;
+}
+
+.pl-5 {
+  padding-left: 5px;
+}
+
+.block {
+  display: block;
+}
+
+.pointer {
+  cursor: pointer;
+}
+
+.inlineBlock {
+  display: block;
+}
+
+.clearfix {
+  &:after {
+    visibility: hidden;
+    display: block;
+    font-size: 0;
+    content: " ";
+    clear: both;
+    height: 0;
+  }
+}
+
+aside {
+  background: #eef1f6;
+  padding: 8px 24px;
+  margin-bottom: 20px;
+  border-radius: 2px;
+  display: block;
+  line-height: 32px;
+  font-size: 16px;
+  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
+  color: #2c3e50;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+
+  a {
+    color: #337ab7;
+    cursor: pointer;
+
+    &:hover {
+      color: rgb(32, 160, 255);
+    }
+  }
+}
+
+//main-container全局样式
+.app-container {
+  padding: 10px;
+  background: #fff;
+}
+
+.components-container {
+  margin: 30px 50px;
+  position: relative;
+}
+
+.pagination-container {
+  margin-top: 0px;
+}
+
+.text-center {
+  text-align: center
+}
+
+.sub-navbar {
+  height: 50px;
+  line-height: 50px;
+  position: relative;
+  width: 100%;
+  text-align: right;
+  padding-right: 20px;
+  transition: 600ms ease position;
+  background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
+
+  .subtitle {
+    font-size: 20px;
+    color: #fff;
+  }
+
+  &.draft {
+    background: #d0d0d0;
+  }
+
+  &.deleted {
+    background: #d0d0d0;
+  }
+}
+
+.link-type,
+.link-type:focus {
+  color: #337ab7;
+  cursor: pointer;
+
+  &:hover {
+    color: rgb(32, 160, 255);
+  }
+}
+
+.filter-container {
+  padding-bottom: 10px;
+
+  .filter-item {
+    display: inline-block;
+    vertical-align: middle;
+    margin-bottom: 10px;
+  }
+}
+
+//refine vue-multiselect plugin
+.multiselect {
+  line-height: 16px;
+}
+
+.multiselect--active {
+  z-index: 1000 !important;
+}
+
+/* firefox */
+input {
+    filter: none !important;
+}
+.search{margin-bottom:10px;}
+  .button{
+    height: 50px;
+    .exportTable{
+      float: right;margin-right: 5px;height:30px;width:80px;border:1px solid #d4d4d4;line-height:30px;border-radius:3px;text-align:center;font-size:12px;color:#6b6b6b;
+    }
+  }
+  $color1:#009C69;
+  $color2:#FC2323;
+  $color3:#fff;
+  $color4:#F7BA2A;
+  $color5:#e5f6f0;
+  $color6:#FEF4DC;
+  $color7:#333;
+  $color8:#009A69;
+  $color9:#4DB894;
+  $color10:#D4D4D4;
+  $color11:#6B6B6B;
+  $color12:#CCCCCC;
+  $color13:#666666;
+  $color14:#EDF7F4;
+  $color15:#19B6B1;
+  $color16:#F4F4F5;
+  $color17:#01BE80;
+  $color18:#F65242;
+  // .el-dialog__body{padding: 30px 0!important;}
+  .el-dialog__header{border-bottom: 1px solid $color1;}
+  .dialog-footer{
+    position: relative;height: 30px;
+    // border-top: 1px solid $color1;height: 30px;
+    // 保存+取消
+    .save {position: absolute;top: 10px;right: 20px;}
+    .cancelClose {position: absolute;top: 10px;right: 130px;}
+    .warning{position: absolute;top: 10px;right: 130px;}
+    // 单取消
+    .cancelClose1{position: absolute;top: 10px;right: 20px;}
+    // 小保存+小取消
+    .miniPrimary{position: absolute;top: 10px;right: 20px;}
+    .downminCancel{position: absolute;top: 10px;right: 80px;}
+    // :nth-child(2) button{position: absolute;top: 10px;right: 50px;}
+  }
+  // 颜色选择器
+  .el-color-dropdown__btn{color: $color8;border:none;background: none;}
+  .el-color-dropdown__btn:focus{ color: $color8;border:none;background: none;}
+  .el-color-dropdown__btn:hover{color: $color8;border:none;background: none;}
+  .el-button.is-plain:focus, .el-button.is-plain:hover{color: $color8;border:none;background: none;}
+  .app-main{background: #fff;}
+  // 时间范围选中后
+  .el-date-table td.end-date span, .el-date-table td.start-date span{ background-color: $color1; }
+  // 时间范围小图标
+  .el-date-editor .el-range__icon{ color: $color1; }
+  .el-input__icon{ color: $color1; }
+  .el-range-editor.is-active, .el-range-editor.is-active:hover{border-color: $color1;}
+  // 当前时间默认颜色
+  .el-date-table td.today span{ color: $color1; }
+  // 鼠标悬停颜色
+  .el-date-table td.available:hover{ color: $color1; }
+  .el-date-table td.current:not(.disabled) span{ background-color: $color1; }
+  // 下拉框小图标
+  .el-select .el-input .el-select__caret{ color: $color1; }
+  .el-select .el-input.is-focus .el-input__inner{border-color: $color1;}
+  .el-select .el-input__inner:focus{border-color: $color1;}
+  .el-input.is-active .el-input__inner, .el-input__inner:focus{border-color: $color1;}
+  .el-select-dropdown__item.selected{ color: $color1; }
+  .el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color: $color1;}
+  // table全选
+  .el-checkbox__input.is-checked .el-checkbox__inner{ background-color: $color1; border-color: $color1; }
+  .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner { background-color: $color1; border-color: $color1; }
+  .el-checkbox__input.is-checked+.el-checkbox__label{ color: $color1; }
+  // 单选按钮
+  .el-radio__input.is-checked .el-radio__inner{ background-color: $color1; border-color: $color1; }
+  .el-radio__input.is-checked+.el-radio__label{ color: $color1; }
+  .el-radio__inner:hover{border-color: $color1;}
+  // table
+
+  .el-table{font-size: 12px;color:$color7;}
+  .el-table--border:after, .el-table--group:after, .el-table:before { background-color: $color15!important; }
+  .el-table--border, .el-table--group { border-color: $color15!important; }
+  .el-table--border th, .el-table--border th.gutter:last-of-type { border-bottom: 1px solid $color15!important; }
+  .el-table--border td, .el-table--border th { border-right: 1px solid $color15!important; }
+  .el-table td, .el-table th.is-leaf { border-bottom: 1px solid $color15!important; }
+  .el-table td,.building-top .el-table th.is-leaf { border-bottom:  1px solid $color15!important; }
+  .fixed-width{border-bottom: $color15!important ;}
+  .el-table__fixed-right{height: 100%!important;border-bottom:  1px solid $color15!important;}
+  .el-table__fixed{height: 100%!important;border-bottom:  1px solid $color15!important;}
+  .el-table__footer{border-top:  1px solid $color15!important;}
+  .has-gutter tr th{background-color: $color14!important;}
+  .el-table tr th.is-leaf{background-color: $color14!important;}
+  .el-table__fixed-right-patch{background-color: $color14!important;}
+  .el-table .cell{line-height: 18px!important;}
+  // 修改合计在滚动条上方
+  // .el-table { overflow-x: auto; }
+  // .el-table__header-wrapper, .el-table__body-wrapper, .el-table__footer-wrapper { overflow: visible; }
+  // .el-table::after { position: relative; }
+  // .el-table--scrollable-x .el-table__body-wrapper { overflow: visible; }
+  // .el-table__body{
+  //   width: 100%;
+  //   table-layout: fixed !important;
+  // }
+  .operation{margin-top: 10px;height: 44px;}
+  .fixed-width button{vertical-align: middle;}
+  .fixed-width button{padding: 0 0;}
+  // 恢复默认
+  .warning{background: #F7BA2A; border-color:#F7BA2A; color: #fff;min-width:100px;height: 40px;}
+  .warning:focus, .warning:hover{ color: #fff; border-color: #F7BA2A; background-color: #F7BA2A; min-width:100px;height: 40px}
+
+  // 新增/资料库/初始化库存/新增入库单
+  .el-button{padding: 0px 10px;font-size: 16px;}
+  .success{
+    background: $color3; border-color: $color3; color: $color7;height: 34px; line-height:34px;
+    i{color: $color1;}
+  }
+  .success:focus{ background: $color3; border-color: $color3; color: $color7;height: 34px; line-height:34px;}
+  .success:hover{ color: $color1; border-color: $color1; background-color: $color5; height: 34px;line-height:34px;}
+  // 复制
+  .copy{
+    background: $color3; border-color: $color3; color: $color7;height: 34px; line-height:34px;
+    i{color: $color4;}
+  }
+  .copy:focus{ background: $color3; border-color: $color3; color: $color7;height: 34px; line-height:34px;}
+  .copy:hover{ color: $color4; border-color: $color4; background-color: $color6; height: 34px;line-height:34px;}
+  // 删除
+  .danger{
+    height: 34px;line-height:34px;background: $color3; border-color: $color3;
+    i{color: $color2;}
+  }
+  .danger:focus{height: 34px;line-height:34px;background: $color3; border-color: $color3; color: $color2;}
+  .danger:hover{height: 34px;background: rgba(252,48,47,.1); border-color: $color2; color: $color2;}
+
+  // 小编辑/小保存/下拉搜索按钮/拆分预混料
+  .miniSuccess{ color: $color7;font-size:18px;border:none;background: none;}
+  .miniSuccess:focus{ color: $color7;font-size:18px;border:none;background: none;}
+  .miniSuccess:hover{color: $color1;font-size:18px;border:none;background: none;}
+  // 校正
+  .correcting{color: $color8;font-size:12px;}
+  .correcting:focus{color: $color8;font-size:12px;}
+  .correcting:hover{color: $color8;font-size:12px;}
+  // 小删除
+  .miniDanger{color: $color2;font-size:18px;border:none;background: none;}
+  .miniDanger:focus{color: $color2;font-size:18px;border:none;background: none;}
+  .miniDanger:hover{color: $color2;font-size:18px;border:none;background: none;}
+
+  // 小取消
+  .minCancel{color: $color2;font-size:18px;border:none;background: none;}
+  .minCancel:focus{color: $color2;font-size:18px;border:none;background: none;}
+  .minCancel:hover{ color: $color2;font-size:18px;border:none;background: none;}
+ // 查询/重置
+  .successBorder{background: $color8; border-color: $color8; color: $color3;height:38px;padding:0 15px;font-size:14px;}
+  .successBorder:focus{background: $color8; border-color: $color8; color: $color3;height:38px;padding:0 15px;font-size:14px;}
+  .successBorder:hover{background:$color9; border-color: $color9; color: $color3;height:38px;padding:0 15px;font-size:14px;}
+  // 查看
+  .miniPrimary{ background: $color8; border-color: $color8; color: $color3;padding: 7px 10px !important;font-size:14px;min-width:60px;}
+  .miniPrimary:focus{background: $color8; border-color: $color8; color: $color3;padding: 7px 10px !important;font-size:14px;min-width:60px;}
+  .miniPrimary:hover{color: $color3; border-color: $color9; background-color: $color9;padding: 7px 10px !important;font-size:14px;min-width:60px;}
+  // 顺序保存
+  .sortCancel{ background: $color3; border-color: $color3; color: $color13;height: 34px; line-height:34px;}
+  .sortCancel:focus{ background: $color3; border-color: $color12; color: $color13;height: 34px; line-height:34px;}
+  .sortCancel:hover{ color: $color13; border-color: $color12; background-color: $color3; height: 34px;line-height:34px;}
+  // 下拉取消
+  .downminCancel{background: $color3; border-color: $color12; color: $color13;padding: 7px 10px;font-size:14px;min-width:60px;}
+  .downminCancel:focus{background: $color3; border-color: $color12; color: $color13;padding: 7px 10px;font-size:14px;min-width:60px;}
+  .downminCancel:hover{ color: $color13; border-color: $color12; background-color: $color3; padding: 7px 10px;font-size:14px;min-width:60px;}
+  // 弹出小框取消跟确认
+  .el-message-box__btns .el-button{padding: 9px 15px!important;}
+  .el-message-box__btns .el-button--default:hover{color: $color8; border-color: $color8; background-color:$color3; padding: 9px 19px;}
+  .el-message-box__btns .el-button--primary{color: $color3; border-color: $color8; background-color: $color8; padding: 9px 19px;}
+  .el-message-box__btns .el-button--primary:hover{color: $color3; border-color: $color9; background-color: $color9; padding: 9px 19px;}
+  // 隐藏
+  .hide{background: $color3; border-color: $color10; color: $color11;height:38px;}
+  .hide:focus{background: $color3; border-color: $color10; color: $color11;height:38px;}
+  .hide:hover{background:$color16; border-color: $color10; color: $color11;height:38px;}
+  // 放大
+  .hide2{background: $color3; border-color: $color10; color: $color11;height:38px;}
+  .hide2:focus{background: $color3; border-color: $color10; color: $color11;height:38px;}
+  .hide2:hover{background:$color16; border-color: $color10; color: $color11;height:38px;}
+  // 导出
+  .export{background: $color3; border-color: $color10; color: $color11;min-width:100px;height: 38px;margin-right: 10px;}
+  .export:focus{background: $color3; border-color: $color10; color: $color11;min-width:100px;height: 38px;margin-right: 10px;}
+  .export:hover{ color: $color11; border-color: $color10; background-color: $color16; min-width:100px;height: 38px;margin-right: 10px;}
+  // 导入
+  .import{background: $color3; border-color: $color10; color: $color11;min-width:100px;height: 38px;}
+  .import:focus{background: $color3; border-color: $color10; color: $color11;min-width:100px;height: 38px;}
+  .import:hover{ color: $color11; border-color: $color10; background-color: $color16; min-width:100px;height: 38px;}
+
+  // 切换表格
+  .exportTable{ height:30px;width:80px;border:1px solid $color10;line-height:30px;border-radius:3px;text-align:center;font-size:12px;color:#6b6b6b;}
+  .exportTable:focus{background: $color3; border-color: $color10; color: $color11;height:30px;width:80px;}
+  .exportTable:hover{ color: $color11; border-color: $color10; background-color: $color16; height:30px;width:80px;}
+  // 取消/关闭
+  .cancelClose{background: $color3; border-color: $color12; color: $color13;min-width:100px;height: 38px;}
+  .cancelClose:focus, .cancelClose:hover{ color: $color13; border-color: $color12; background-color: $color3; min-width:100px;height: 38px}
+
+  .cancelClose1{background: $color3; border-color: $color12; color: $color13;min-width:100px;height: 38px;}
+  .cancelClose1:focus, .cancelClose1:hover{ color: $color13; border-color: $color12; background-color: $color3; min-width:100px;height: 38px}
+  // 确认
+  .save{background: $color8; border-color: $color8; color: $color3;min-width:100px;height: 38px;}
+  .save:focus{background: $color8; border-color: $color8; color: $color3;min-width:100px;height: 38px;}
+  .save:hover{background:$color9; border-color: $color9; color: $color3;min-width:100px;height: 38px;}
+
+  // 仪表盘编辑
+  .el-button--text{color: $color1!important;}
+  // 仪表盘添加筛选条件
+  .save.is-disabled, .save.is-disabled:focus, .save.is-disabled:hover{background:  $color1!important;color:$color3 ; }
+  .visualize-card div i{ color: #009A69 !important; }
+  // 间隔线
+  .centerSpan{padding: 0 5px 0 8px;color: $color12;}
+  // 时间快捷键左右
+  .elIconArrowLeft{margin-right: -5px;margin-top:1px;padding: 11px 11px !important;color:$color1;background:$color3;border-color:$color10;}
+  .elIconArrowLeft:focus{margin-right: -5px;margin-top:1px;padding: 11px 11px !important;color:$color1;background:$color3;border-color:$color10;}
+  .elIconArrowLeft:hover{margin-right: -5px;margin-top:1px;padding: 11px 11px !important;color:$color1;background:$color16;border-color:$color10;}
+  .elIconArrowRight{margin-right: 5px;margin-top:1px;padding: 11px 11px !important;color:$color1;background:$color3;border-color:$color10;}
+  .elIconArrowRight:focus{margin-right: 5px;margin-top:1px;padding: 11px 11px !important;color:$color1;background:$color3;border-color:$color10;}
+  .elIconArrowRight:hover{margin-right: 5px;margin-top:1px;padding: 11px 11px !important;color:$color1;background:$color16;border-color:$color10;}
+  // 关闭窗口
+  .el-message-box__headerbtn:focus .el-message-box__close, .el-message-box__headerbtn:hover .el-message-box__close{color:$color1;}
+  .el-dialog__headerbtn:focus .el-dialog__close, .el-dialog__headerbtn:hover .el-dialog__close{color:$color1;}
+  // tab切换
+  .el-tabs__item.is-active { color: $color1; }
+  .el-tabs__active-bar{background-color: $color1;}
+  .el-tabs__item:hover{color: $color1;}
+  .el-tabs__item{font-size: 16px;}
+
+  .el-radio-button__orig-radio:checked+.el-radio-button__inner{ background-color:$color1;border-color:$color1; }
+  .el-radio-button__inner:hover{color: $color1;}
+
+  .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color: $color1;}
+  .el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color: $color1;}
+  // 给我一点时间
+  .el-loading-spinner .el-loading-text{color: $color1;}
+  .el-loading-spinner .path{stroke:$color1;}
+  // 菜单-树
+  .el-tag{background-color:$color5;border-color:$color1;color:$color1;}
+  // 启用
+  .el-switch.is-checked .el-switch__core{ border-color:$color17!important;background-color:$color17!important; }
+  .el-switch__core{ border-color:$color18!important;background-color:$color18!important; }
+  // 分页
+  .el-pagination.is-background .el-pager li:not(.disabled).active{background-color:$color1; }
+  .el-pagination.is-background .el-pager li:not(.disabled).active:hover{color: #fff; }
+  .el-pagination.is-background .el-pager li:not(.disabled):hover{color: $color1;}
+  body .el-table th.gutter{ display: table-cell!important; }
+  body .el-table tr.gutter{ display: table-cell!important; }
+  // 顶部tab切换
+  .tags-view-container .tags-view-wrapper .tags-view-item.active{ background-color:$color1 !important;border-color: $color1!important; }
+  // 右侧下拉
+  .el-dropdown-menu__item:focus, .el-dropdown-menu__item:not(.is-disabled):hover{color:$color1 !important;}
+  // .gutter { display: block !important; width: 17px !important; }
+  // .el-table{ min-height: 290px !important; }
+  .down{
+    width: 40px;color:red!important;height: 40px;float: right;
+    transform:rotate(7deg);
+    -ms-transform:rotate(180deg); 	/* IE 9 */
+    -moz-transform:rotate(180deg); 	/* Firefox */
+    -webkit-transform:rotate(180deg); /* Safari 和 Chrome */
+    -o-transform:rotate(180deg);
+  }
+
+  .el-menu-item.is-active{
+    color:$menuActiveBg !important;
+  }
+
+.el-dialog__header {
+  padding: 15px 20px 15px;
+}
+.el-dialog__headerbtn{
+  top: 15px;
+}
+
+/*dialog header*/
+.el-dialog__header{
+  // background: #e3eaed;
+}
+.avue-crud__dialog__header {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-box-align: center;
+  -ms-flex-align: center;
+  align-items: center;
+  -webkit-box-pack: justify;
+  -ms-flex-pack: justify;
+  justify-content: space-between;
+}
+.el-dialog__title {
+  color: rgba(0,0,0,.85);
+  font-weight: 500;
+  word-wrap: break-word;
+}
+.avue-crud__dialog__menu {
+  padding-right: 20px;
+  float: left;
+  position: relative;
+}
+.avue-crud__dialog__menu svg {
+  color: #909399;
+  position: absolute;
+  width: 10px !important;
+  height: 10px !important;
+  top: -8px;
+  right: 25px;
+}
+.avue-crud__dialog__menu .svg-icon{
+
+}
+.el-icon-full-screen{
+  cursor: pointer;
+}
+.el-icon-full-screen:before {
+  content: "\e719";
+}
+

+ 302 - 0
.svn/pristine/10/100e7fa67bc8dc8092a5f7a1c09e06a09af6666a.svn-base

@@ -0,0 +1,302 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-select v-model="table.getdataListParm.parammaps.pastureid" placeholder="牧场" class="filter-item" style="width: 120px;">
+        <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
+      </el-select>
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
+      <el-button style="float: left;" class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
+      <el-button style="float: left;" class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
+      <el-input v-model="table.getdataListParm.parammaps.tmrtname" style="width: 130px;" placeholder="TMR名称" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.projname" style="width: 130px;" placeholder="车次" class="filter-item" clearable />
+      <el-select v-model="table.getdataListParm.parammaps.times" style="width: 150px;" filterable placeholder="班次" class="filter-item" clearable>
+        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-input v-model="table.getdataListParm.parammaps.templetname" style="width: 130px;" placeholder="配方名称" class="filter-item" clearable />
+      <el-select v-model="table.getdataListParm.parammaps.buttontype" filterable placeholder="跳转方式" class="filter-item" clearable>
+        <el-option v-for="item in jumpModeList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-select v-model="table.getdataListParm.parammaps.isuse" style="width: 130px;" filterable placeholder="上传状态" class="filter-item" clearable>
+        <el-option v-for="item in isuseList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+      <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport">导出</el-button>
+    </div>
+
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :height="myHeight2"
+      >
+        <el-table-column label="牧场" min-width="90px" align="center" prop="牧场" />
+        <el-table-column label="日期" min-width="70px" align="center" prop="日期" />
+        <el-table-column label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+        <el-table-column label="车次" min-width="50px" align="center" prop="车次" />
+        <el-table-column label="班次" min-width="50px" align="center" prop="班次" />
+        <el-table-column label="配方名称" min-width="90px" align="center" prop="配方名称" />
+        <el-table-column label="饲料" min-width="70px" align="center" prop="饲料" />
+        <el-table-column label="理论重量" min-width="55px" align="center" prop="理论重量" />
+        <el-table-column label="实际重量" min-width="55px" align="center" prop="实际重量" />
+        <el-table-column label="误差值" min-width="45px" align="center" prop="误差值" />
+        <el-table-column label="准确率" min-width="45px" align="center" prop="准确率" />
+        <el-table-column label="计划时间" min-width="55px" align="center" prop="计划时间" />
+        <el-table-column label="开始时间" min-width="55px" align="center" prop="开始时间" />
+        <el-table-column label="结束时间" min-width="55px" align="center" prop="结束时间" />
+        <el-table-column label="搅拌时间" min-width="55px" align="center" prop="搅拌时间" />
+        <el-table-column label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+        <el-table-column label="开始重量" min-width="55px" align="center" prop="开始重量" />
+        <el-table-column label="结束重量" min-width="55px" align="center" prop="结束重量" />
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts'
+
+require('echarts/theme/macarons')
+import { GetDataByName, GetReportform, GetDataByNames } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'Tab2',
+  components: { Pagination },
+  data() {
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      pickerMinDate: '',
+      pickerOptions: {
+        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()
+        }
+      },
+      requestParams: [
+        { name: 'getPastureListJT', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), pasturename: '' }}
+      ],
+      pastureList: [], // 牧场
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      frequencyList: [],
+      jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }],
+      isuseList: [{ id: '0', name: '未完成' }, { id: '2', name: '部分完成' }, { id: '1', name: '全部完成' }],
+      table: {
+        getdataListParm: {
+          name: 'getStatisticsHL',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+            stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+            inputDatetime: [new Date(), new Date()],
+            tmrtname: '',
+            projname: '',
+            times: '',
+            buttontype: '',
+            templetname: ''
+          }
+        },
+        tableKey: 1,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2:document.documentElement.clientHeight - 85-210
+    }
+  },
+  created() {
+    this.getTimeFn()
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  activated() {
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  methods: {
+    getTimeFn() {
+      const that = this
+      const start = new Date()
+      const end = new Date()
+      const start2 = new Date()
+      const end2 = new Date()
+      start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+      end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+      that.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+      that.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        if (response.data.list[0].inforvalue == 1) {
+          this.frequencyList = [{ id: '1', name: '第一班' }]
+          this.frequencyList = [{ id: '1', name: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+          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: '第三班' }]
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+          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: '第四班' }]
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+        }
+      })
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.pastureList = response.data.getPastureListJT.list
+        this.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
+        this.getList()
+      })
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('混料统计table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      this.table.getdataListParm.name = 'getStatisticsHL'
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        console.log(this.table.getdataListParm.parammaps.inputDatetime)
+        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() {
+      this.table.getdataListParm.parammaps.tmrtname = ''
+      this.table.getdataListParm.parammaps.projname = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.templetname = ''
+      this.table.getdataListParm.parammaps.buttontype = ''
+      this.getList()
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getList()
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getList()
+    },
+    handleExport() {
+      var excelDatasTab2 = [
+        {
+          tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', ' 跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          tableDatas: this.table.list,
+          sheetName: '混料统计'
+        }
+      ]
+      json2excel(excelDatasTab2, '混料统计', true, 'xlsx')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+</style>

+ 586 - 0
.svn/pristine/2b/2b5c85127eae3c274cc4366befb1d6bee9c4a11d.svn-base

@@ -0,0 +1,586 @@
+<template>
+  <div>
+    <div class="operation">
+      <el-button class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate">新增车次</el-button>
+      <el-button class="danger" icon="el-icon-delete" style="float: left;" @click="handleDelete">减少车次</el-button>
+    </div>
+    <div class="search" />
+
+    <div class="table">
+      <el-table
+        id="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"
+        row-key="id"
+        @selection-change="handleSelect"
+      >
+        <el-table-column type="selection" min-width="50" />
+        <el-table-column label="车次" min-width="85px" 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.trim="scope.row.sort" type="number" style="width:80%;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.ftname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeformulaName(value, scope.row)}">
+              <el-option v-for="item in formulaNameList" :key="item.id" :label="item.tname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="TMR编号" prop="weight" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.tmrcode }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" filterable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeTMRNumber(value, scope.row)}">
+              <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.tname" :value="item.id" />
+            </el-select>
+          </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.times }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.times" filterable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeTimes(value, scope.row)}">
+              <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="撒料计划车次跟随" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.lppcode }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.lppid" filterable clearable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeCarFollow(value, scope.row)}">
+              <el-option v-for="item in carFollowList" :key="item.id" :label="item.lppcode" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="生效" min-width="80px" 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="时间" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ptime }}</span>
+            <el-time-picker v-if="scope.row.Edit" v-model="scope.row.ptime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="单车操作重量" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.maxweight }}</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.operateweight }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.operateweight" type="number" style="width:80%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" min-width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="row.isCreate" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
+            <span v-if="row.isCreate" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="row.isUpdate" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    </span>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
+import Sortable from 'sortablejs'
+import Pagination from '@/components/Pagination'
+import Cookies from 'js-cookie'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'PremixedPlan',
+  components: { Pagination },
+  props: {
+    show: { type: Boolean, default: false }, // 弹框可见标志
+    parentDate: { type: String, defalut: '' }
+  },
+  data() {
+    return {
+      date: '',
+      requestParams: [
+        { name: 'getTMRYHList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getFTYHList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+      ],
+      formulaNameList: [], // 配方名称
+      TMRNumberList: [], // TMR编号
+
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      frequencyList: [], // 班次
+      getCarFollowParm: {
+        name: 'getLPPCodeListdate',
+        offset: 0,
+        pagecount: 0,
+        parammaps: {
+          pastureid: Cookies.get('pastureid'),
+          times: ''
+        }
+      },
+      carFollowList: [], // 发料计划车次跟随
+
+      table: {
+        getdataListParm: {
+          name: 'getPremixplanListdate',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true
+      },
+      selectList: [],
+      isokDisable: false,
+      requestParam: {},
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      dropState: false
+    }
+  },
+  watch: {
+    // 监听show,visible 随着show变化而变化
+    show: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log('newVal-show', newVal)
+      }
+    },
+    parentDate: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log('newVal-show', newVal)
+        this.date = newVal
+      }
+    }
+  },
+  created() {
+    this.getDownList()
+    this.getIsDisplay()
+    this.getList()
+  },
+  methods: {
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.TMRNumberList = response.data.getTMRYHList.list
+        this.formulaNameList = response.data.getFTYHList.list
+      })
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        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: '第四班' }]
+        }
+      })
+    },
+    getList() {
+      this.table.listLoading = true
+      this.table.getdataListParm.parammaps.date = this.date
+      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], 'groupEdit', 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.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.rowDrop()
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    // 配方名称
+    changeformulaName(item, row) {
+      row.ftname = this.formulaNameList.find(obj => obj.id == item).tname
+    },
+    // TMR编号
+    changeTMRNumber(item, row) {
+      row.tmrcode = this.TMRNumberList.find(obj => obj.id == item).tname
+      row.maxweight = this.TMRNumberList.find(obj => obj.id == item).maxstirfeed
+    },
+    // 撒料计划车次跟随列表
+    changeCarFollow(item, row) {
+      if (item == '') {
+        row.lppcode = ''
+      } else {
+        row.lppcode = this.carFollowList.find(obj => obj.id == item).lppcode
+      }
+    },
+    // 班次
+    changeTimes(item, row) {
+      console.log(item, row)
+      this.getCarFollowParm.parammaps.times = item
+      this.getCarFollowList(row)
+    },
+    // 撒料计划车次跟随列表
+    getCarFollowList(row) {
+      this.getCarFollowParm.parammaps.date = this.date
+      GetDataByName(this.getCarFollowParm).then(response => {
+        console.log('撒料计划车次跟随列表数据', response.data.list)
+        if (response.data.list !== null) {
+          this.carFollowList = response.data.list
+          row.lppid = this.carFollowList[0].id
+          row.lppcode = this.carFollowList[0].lppcode
+        }
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了生效')
+    },
+    // 行拖拽
+    rowDrop() {
+      console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
+      const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
+      const that = this
+      var sortable = Sortable.create(tbody, {
+        disabled: that.dropState,
+        onChoose({ newIndex, oldIndex }) {
+          if (that.dropState == true) {
+            sortable.destroy()
+          }
+        },
+        onEnd({ newIndex, oldIndex }) {
+          const currRow = that.table.list.splice(oldIndex, 1)[0]
+          that.table.list.splice(newIndex, 0, currRow)
+          console.log('索引', newIndex)
+          console.log('拖动数据', currRow)
+          console.log('上', that.table.list[newIndex - 1])
+          console.log('下', that.table.list[newIndex + 1])
+        }
+      })
+    },
+
+    // 模板新增
+    handleCreate() {
+      this.dropState = true
+      console.log('点击了新增车次')
+      // 编辑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
+        }
+      }
+      var sort = 1
+      if (this.table.list.length > 0) {
+        sort = parseInt(this.table.list[this.table.list.length - 1].sort) + 1
+      } else {
+        sort = 1
+      }
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': sort, 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'ptime': '', 'maxweight': '', 'operateweight': '' })
+    },
+    createData(row) {
+      console.log('点击了新增保存', row)
+
+      if (row.sort == '' && row.ftid == '' && row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '车次/配方名称/TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.ftid == '' && row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '配方名称/TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.sort == '' || row.sort == 0) {
+        this.$message({ type: 'error', message: '车次不能为空且大于0', duration: 2000 })
+        return false
+      } else if (row.ftid == '') {
+        this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '') {
+        this.$message({ type: 'error', message: 'TMR编号不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      } else if (row.operateweight == '') {
+        this.$message({ type: 'error', message: '混料重量不能为空', duration: 2000 })
+        return false
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort !== '') {
+          if (row.sort == this.table.list[i].sort) {
+            if (row.myId !== this.table.list[i].myId) {
+              this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+              return false
+            }
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (row.sort !== '') {
+        if (!isInteger.test(parseFloat(row.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'insertPremixplandate'
+      row.date = this.date
+      this.requestParam.parammaps = row
+      this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createCancel(row) {
+      console.log('点击了新增取消')
+      this.dropState = false
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.myId === this.table.list[i].myId) {
+          var listIndex = this.table.list.indexOf(this.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.table.list.splice(listIndex, 1)
+          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.lppid = String(row.lppid)
+      if (row.times == '第一班') {
+        this.getCarFollowParm.parammaps.times = '1'
+        row.times = '1'
+      } else if (row.times == '第二班') {
+        this.getCarFollowParm.parammaps.times = '2'
+        row.times = '2'
+      } else if (row.times == '第三班') {
+        this.getCarFollowParm.parammaps.times = '3'
+        row.times = '3'
+      } else if (row.times == '第四班') {
+        this.getCarFollowParm.parammaps.times = '4'
+        row.times = '4'
+      }
+      console.log(row)
+      GetDataByName(this.getCarFollowParm).then(response => {
+        console.log('撒料计划车次跟随列表数据', response.data.list)
+        if (response.data.list !== null) {
+          this.carFollowList = response.data.list
+        }
+      })
+      this.dropState = true
+    },
+    updateData(row) {
+      console.log('点击了编辑保存', row)
+      if (row.ftid == '' && row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '配方名称/TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.ftid == '') {
+        this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '') {
+        this.$message({ type: 'error', message: 'TMR编号不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      } else if (row.operateweight == '') {
+        this.$message({ type: 'error', message: '混料重量不能为空', duration: 2000 })
+        return false
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort == this.table.list[i].sort) {
+          if (row.id !== this.table.list[i].id) {
+            this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+            return false
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (row.sort !== '') {
+        if (!isInteger.test(parseFloat(row.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+      if (row.sort == '' || row.sort == 0) {
+        this.$message({ type: 'error', message: '车次不能为空且大于0', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'updatePremixplandate'
+      row.date = this.date
+      this.requestParam.parammaps = row
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateCancel(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.getList()
+      this.dropState = false
+    },
+
+    handleSelect(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    // 行内删除
+    handleRowDelete(row) {
+      console.log(row, '点击了行删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.name = 'deletePremixplandate'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = row.pastureid
+        this.requestParam.parammaps.id = row.id
+        this.requestParam.parammaps.date = this.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.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+    // 减少车次
+    handleDelete() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deletePremixplandate', 'type': 'e', 'parammaps': {
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid',
+            date: this.date
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('删除保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    }
+
+  }
+}
+</script>

+ 849 - 0
.svn/pristine/3c/3cc303cdbdc2aa3cc3e57a191878fe0e069e10ed.svn-base

@@ -0,0 +1,849 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName" @tab-click="handleTabClick">
+      <el-tab-pane label="库存统计" name="first">
+        <div class="search">
+          <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 250px;margin-bottom:10px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" style="float: left;" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" style="float: left;" @click="handleNext" />
+          <el-input v-model="tab.table.getdataListParm.parammaps.feedname" class="filter-item" style="float: left;width: 245px;margin-bottom:10px;" placeholder="饲料名称" />
+          <el-button class="successBorder" style="float: left;margin-left: 10px;margin-bottom:10px;" @click="handleSearch('first')">查询</el-button>
+          <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" icon="el-icon-upload2" @click="handleExport('tab1')">导出</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="tab.table.tableKey"
+            v-loading="tab.table.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab.table.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column sortable label="饲料名称" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.feedname }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="期初" min-width="130px" align="center">
+              <el-table-column sortable prop="startsum" align="center" label="期初库存(kg)" min-width="120" />
+              <el-table-column sortable prop="startprice" align="center" label="期初金额(元)" min-width="120" />
+            </el-table-column>
+            <el-table-column label="用量" min-width="110px" align="center">
+              <el-table-column sortable prop="laidsum" align="center" label="入库重量(kg)" min-width="120" />
+              <el-table-column sortable prop="usesumXT" align="center" label="系统出库重量(kg)" min-width="120" />
+              <el-table-column sortable prop="usesumRG" align="center" label="人工用料重量(kg)" min-width="120" />
+              <el-table-column sortable prop="usesumXH" align="center" label="损耗重量(kg)" min-width="120" />
+            </el-table-column>
+            <el-table-column label="期末" min-width="130px" align="center">
+              <el-table-column sortable prop="stopsum" align="center" label="期末库存(kg)" min-width="120" />
+              <el-table-column sortable prop="stopprice" align="center" label="期末金额(元)" min-width="120" />
+            </el-table-column>
+          </el-table>
+          <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getTabList" />
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="用料分析" name="second">
+        <div class="search">
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 245px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
+          <span style="margin-left: 10px;">统计类型:</span>
+          <el-radio v-model="tab2.radio" label="1" @change="changeRadio2">牲畜类别</el-radio>
+          <el-radio v-model="tab2.radio" label="2" @change="changeRadio2">栏舍名称</el-radio>
+          <el-radio v-model="tab2.radio" label="3" @change="changeRadio2">日期</el-radio>
+          <el-radio v-model="tab2.radio" label="4" @change="changeRadio2">TMR设备编号</el-radio>
+          <el-radio v-model="tab2.radio" label="5" @change="changeRadio2">班次</el-radio>
+          <el-radio v-model="tab2.radio" label="6" @change="changeRadio2">车次</el-radio>
+          <el-checkbox v-model="tab2.table.getdataListParm.checked" :true-label="1" :false-label="0" style="margin-right:10px;" @change="changeChecked">误差</el-checkbox>
+          <br>
+          <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="日期" />
+          <el-input v-if="tab2.isRadio4" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="TMR设备编号" />
+          <el-input v-if="tab2.isRadio5" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="班次" />
+          <el-input v-if="tab2.isRadio6" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="车次" />
+          <el-button class="successBorder" @click="handleSearch('second')">查询</el-button>
+          <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handleExport('tab2')">导出</el-button>
+        </div>
+
+        <el-table
+          :key="tab2.table.tableKey"
+          ref="elTable1"
+          v-loading="tab2.table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab2.table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight2"
+        >
+          <el-table-column v-for="(item,key) in tab2.table.tableConfig" :key="key" align="center" :label="item.label" :prop="item.prop" :fixed="key==0">
+            <el-table-column v-for="(item1,key1) in item.children" v-if="item.children || item.children.length>0" :key="key1" align="center" :label="item1.label" :prop="item1.prop" :min-width="item1.width">
+              <el-table-column v-for="(item2,key2) in item1.children" v-if="item1.children || item1.children.length>0" :key="key2" :label="item2.label" :prop="item2.prop" />
+            </el-table-column>
+          </el-table-column>
+        </el-table>
+        <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>
+      </el-tab-pane>
+      <el-tab-pane label="价格分析" name="third">
+        <div class="search">
+          <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" style="width: 250px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled3" @click="handleBefore3" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled3" @click="handleNext3" />
+          <span style="margin-left: 10px;">统计类型:</span>
+          <el-radio v-model="tab3.radio" label="1" @change="changeRadio3">牲畜类别</el-radio>
+          <el-radio v-model="tab3.radio" label="2" @change="changeRadio3">栏舍名称</el-radio>
+          <el-radio v-model="tab3.radio" label="3" @change="changeRadio3">日期</el-radio>
+          <el-radio v-model="tab3.radio" label="4" @change="changeRadio3">TMR设备编号</el-radio>
+          <el-input v-if="tab3.isRadio1" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="牲畜类别" />
+          <el-input v-if="tab3.isRadio2" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="栏舍名称" />
+          <el-input v-if="tab3.isRadio3" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="日期" />
+          <el-input v-if="tab3.isRadio4" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="TMR设备编号" />
+          <el-button class="successBorder" @click="handleSearch('third')">查询</el-button>
+          <el-button class="export filter-item1" style="float: right;margin-right: 5px;" icon="el-icon-upload2" @click="handleExport('tab3')">导出</el-button>
+        </div>
+        <el-table
+          :key="tab3.table.tableKey"
+          ref="elTable2"
+          v-loading="tab3.table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab3.table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight2"
+        >
+          <el-table-column v-for="(item,key) in tab3.table.tableConfig" :key="key" align="center" :label="item.label" :prop="item.prop" :fixed="key==0">
+            <el-table-column v-for="(item1,key1) in item.children" v-if="item.children || item.children.length>0" :key="key1" align="center" :label="item1.label" :prop="item1.prop" :min-width="item1.width">
+              <el-table-column v-for="(item2,key2) in item1.children" v-if="item1.children || item1.children.length>0" :key="key2" :label="item2.label" :prop="item2.prop" />
+            </el-table-column>
+          </el-table-column>
+        </el-table>
+        <span v-if="tab3.table.listLoading == false && tab3.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+  </div>
+
+</template>
+
+<script>
+import { GetDataByName, GetReportform } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { json2excel, export_json_to_excel } from '@/utils/index.js'
+export default {
+  name: 'PastureInventoryManagement',
+  components: { Pagination },
+  data() {
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      Beforedisabled2: false,
+      Nextdisabled2: false,
+      Beforedisabled3: false,
+      Nextdisabled3: false,
+      pickerMinDate: '',
+      pickerOptions: {
+        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': '管理员' }] }],
+      activeName: 'first',
+      tab: {
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getfsStaticlist',
+            page: 1,
+            offset: 1,
+            pagecount: parseInt(Cookies.get('pageCount')),
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              feedname: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: false
+        }
+      },
+
+      tab2: {
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getMaterialAnalysisSC',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            checked: 0,
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              fname: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          tableConfig: [],
+          data: [],
+          total: 0,
+          listLoading: false
+        },
+        radio: '1',
+        isRadio1: true,
+        isRadio2: false,
+        isRadio3: false,
+        isRadio4: false,
+        isRadio5: false,
+        isRadio6: false
+      },
+      tab3: {
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getPriceAnalysisSC',
+            page: 1,
+            offset: 1,
+            pagecount: parseInt(Cookies.get('pageCount')),
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              fname: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          tableConfig: [],
+          total: 0,
+          listLoading: false
+        },
+        radio: '1',
+        isRadio1: true,
+        isRadio2: false,
+        isRadio3: false,
+        isRadio4: false
+      },
+      downLoad: {},
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2: document.documentElement.clientHeight - 85 - 200
+
+    }
+  },
+
+  updated() {
+    this.$refs['elTable1'].doLayout()
+    this.$refs['elTable2'].doLayout()
+  },
+  created() {
+    this.getTabList()
+    this.getTimeFn()
+  },
+  methods: {
+    getTimeFn() {
+      const that = this
+      const start = new Date()
+      const end = new Date()
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab2.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab2.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+    },
+    handleTabClick() {
+      if (this.activeName == 'first') {
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
+        this.getTabList()
+      } else if (this.activeName == 'second') {
+        const start2 = new Date()
+        const end2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab2.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+        this.getTab2List()
+      } else if (this.activeName == 'third') {
+        const start3 = new Date()
+        const end3 = new Date()
+        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
+        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab3.table.getdataListParm.parammaps.inputDatetime = [start3, end3]
+        this.getTab3List()
+      }
+    },
+    getTabList() {
+      this.tab.table.listLoading = true
+      GetDataByName(this.tab.table.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          console.log('库存统计table数据', response.data.list)
+          this.tab.table.list = response.data.list
+          this.tab.table.total = response.data.total
+        } else {
+          this.tab.table.list = []
+        }
+        setTimeout(() => {
+          this.tab.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch(item) {
+      if (item == 'first') {
+        if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.table.getdataListParm.parammaps.startTime = ''
+          this.tab.table.getdataListParm.parammaps.stopTime = ''
+        }
+        this.getTabList()
+      } else if (item == 'second') {
+        if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
+          this.tab2.table.getdataListParm.parammaps.startTime = ''
+          this.tab2.table.getdataListParm.parammaps.stopTime = ''
+        }
+        this.getTab2List()
+      } else if (item == 'third') {
+        if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
+          this.tab3.table.getdataListParm.parammaps.startTime = ''
+          this.tab3.table.getdataListParm.parammaps.stopTime = ''
+        }
+        this.getTab3List()
+      }
+    },
+
+    // 用料分析
+    getTab2List() {
+      this.tab2.table.listLoading = true
+      GetReportform(this.tab2.table.getdataListParm).then(response => {
+        if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
+          this.tab2.table.data = response.data.data
+
+          for (let i = 0; i < response.data.list.data2.length; i++) {
+            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')
+            }
+          }
+          this.tab2.table.list = response.data.list.data1
+          this.tab2.table.tableConfig = response.data.list.data2
+          this.tab2.table.total = response.data.list.data1.length
+          console.log('库存统计-用料分析this.tab2.table.data', response.data.data)
+          console.log('库存统计-用料分析this.tab2.table.list', response.data.list.data1)
+          console.log('库存统计-用料分析this.tab2.table.tableConfig', response.data.data2)
+        } else {
+          this.tab2.table.list = []
+          this.tab2.table.data = []
+        }
+        console.log(this.tab2.table.list.length)
+        setTimeout(() => {
+          this.tab2.table.listLoading = false
+        }, 100)
+      })
+    },
+    changeRadio2() {
+      console.log(this.tab2.radio)
+      if (this.tab2.radio == '1') {
+        this.tab2.isRadio1 = true,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisSC'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '2') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = true,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisLS'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '3') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = true,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisRQ'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '4') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = true,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisTMR'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '5') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = true,
+        this.tab2.isRadio6 = false,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisBC'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      } else if (this.tab2.radio == '6') {
+        this.tab2.isRadio1 = false,
+        this.tab2.isRadio2 = false,
+        this.tab2.isRadio3 = false,
+        this.tab2.isRadio4 = false,
+        this.tab2.isRadio5 = false,
+        this.tab2.isRadio6 = true,
+        this.tab2.table.getdataListParm.name = 'getMaterialAnalysisCC'
+        this.tab2.table.getdataListParm.offset = 1
+        this.getTab2List()
+      }
+    },
+    // 价格分析
+    getTab3List() {
+      this.tab3.table.listLoading = true
+      GetReportform(this.tab3.table.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list.data1 !== null && response.data.list.data2 !== null) {
+          console.log('库存统计-价格分析', response.data.list)
+          for (let i = 0; i < response.data.list.data2.length; i++) {
+            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')
+            }
+          }
+          this.tab3.table.list = response.data.list.data1
+          this.tab3.table.tableConfig = response.data.list.data2
+          this.tab3.table.total = response.data.list.data1.length
+        } else {
+          this.tab3.table.list = []
+        }
+        setTimeout(() => {
+          this.tab3.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleBefore() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleNext() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleBefore2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop3 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleNext2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop4 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleBefore3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop5 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    handleNext3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop6 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    changeRadio3() {
+      console.log(this.tab3.radio)
+      if (this.tab3.radio == '1') {
+        this.tab3.isRadio1 = true,
+        this.tab3.isRadio2 = false,
+        this.tab3.isRadio3 = false,
+        this.tab3.isRadio4 = false,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisSC'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      } else if (this.tab3.radio == '2') {
+        this.tab3.isRadio1 = false,
+        this.tab3.isRadio2 = true,
+        this.tab3.isRadio3 = false,
+        this.tab3.isRadio4 = false,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisLS'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      } else if (this.tab3.radio == '3') {
+        this.tab3.isRadio1 = false,
+        this.tab3.isRadio2 = false,
+        this.tab3.isRadio3 = true,
+        this.tab3.isRadio4 = false,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisRQ'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      } else if (this.tab3.radio == '4') {
+        this.tab3.isRadio1 = false,
+        this.tab3.isRadio2 = false,
+        this.tab3.isRadio3 = false,
+        this.tab3.isRadio4 = true,
+        this.tab3.table.getdataListParm.name = 'getPriceAnalysisTMR'
+        this.tab3.table.getdataListParm.offset = 1
+        this.getTab3List()
+      }
+    },
+    changeChecked(item) {
+      this.handleSearch('second')
+    },
+    handleExport(item) {
+      if (item == 'tab1') {
+        console.log('库存统计导出')
+        this.downLoad.getdataListParm = {}
+        this.downLoad.getdataListParm.name = 'getfsStaticlist'
+        this.downLoad.getdataListParm.pagecount = ''
+        this.downLoad.getdataListParm.parammaps = this.tab.table.getdataListParm.parammaps
+        GetDataByName(this.downLoad.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.$nextTick(() => {
+              this.downLoad.list = response.data.list
+            })
+          } else {
+            this.downLoad.list = []
+          }
+          import('@/vendor/Export5Excel').then(excel => {
+            const multiHeader = [['饲料名称', '期初', '', '用量', '', '', '', '期末', '']]
+            const multiHeader2 = [['', '期初库存(kg)', '期初金额(元)', '入库重量(kg)', '系统出库重量(kg)', '人工用料重量(kg)', '损耗重量', '期末库存(kg)', '期末金额(元)']]
+            const filterVal = ['feedname', 'startsum', 'startprice', 'laidsum', 'usesumXT', 'usesumRG', 'usesumXH', 'stopsum', 'stopprice']
+            const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
+            const merges = ['A1:A2', 'B1:C1', 'D1:G1', 'H1:I1']
+            excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '库存统计', merges })
+          })
+        })
+      } else if (item == 'tab2') {
+        console.log('用料分析导出数据', this.tab2.table.list)
+        console.log('用料分析导出表头', this.tab2.table.tableConfig)
+        console.log(this.tab2.table.getdataListParm.checked, 'checked')
+        var exportData = []
+        var exportTitle1 = [] // 一级标题
+        var exportTitle2 = [] // 二级标题
+        var filterValArr = []
+        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)
+            filterValArr.push(this.tab2.table.tableConfig[i].children[j].prop)
+          }
+        }
+        console.log('一级标题exportTitle1', exportTitle1)
+        console.log('二级标题exportTitle2', exportTitle2)
+        console.log('对应字段filterValArr', filterValArr)
+        var headerArr = []// 处理一级标题
+        if (this.tab2.table.getdataListParm.checked == 1) {
+          for (let i = 0; i < exportTitle1.length; i++) {
+            if (i > 0) {
+              headerArr.push(exportTitle1[i], '', '', '')
+            } else {
+              headerArr.push(exportTitle1[i])
+            }
+          }
+        } else {
+          for (let i = 0; i < exportTitle1.length; i++) {
+            if (i > 0) {
+              headerArr.push(exportTitle1[i], '')
+            } else {
+              headerArr.push(exportTitle1[i])
+            }
+          }
+        }
+        console.log('一级表头处理后', headerArr)
+        // var valueArr = [] // 对应字段
+        // for (let i = 0; i < exportTitle2.length; i++) {
+        //   if (i == 0) {
+        //     valueArr.push('A')
+        //   } else {
+        //     valueArr.push('a' + [i - 1])
+        //   }
+        // }
+        // console.log('对应字段valueArr', valueArr)
+        if (headerArr.length > 0) {
+          import('@/vendor/Export3Excel').then((excel) => {
+            const multiHeader = [
+              headerArr
+            ]
+            const multiHeader2 = []
+            const tHeader = exportTitle2
+            const filterVal = filterValArr
+            const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
+            // const data = []
+            const merges = ['A1:A1']
+            excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
+          })
+        }
+      } else if (item == 'tab3') {
+        console.log('价格分析导出')
+        console.log('价格分析导出数据', this.tab3.table.list)
+        console.log('价格分析导出表头', this.tab3.table.tableConfig)
+        var exportData = []
+        var exportTitle1 = [] // 一级标题
+        var exportTitle2 = [] // 二级标题
+        for (let i = 0; i < this.tab3.table.tableConfig.length; i++) {
+          exportTitle1.push(this.tab3.table.tableConfig[i].label)
+          for (let j = 0; j < this.tab3.table.tableConfig[i].children.length; j++) {
+            exportTitle2.push(this.tab3.table.tableConfig[i].children[j].label)
+          }
+        }
+        console.log('一级标题exportTitle1', exportTitle1)
+        console.log('二级标题exportTitle2', exportTitle2)
+        var headerArr = []// 处理一级标题
+        for (let i = 0; i < exportTitle1.length; i++) {
+          if (i > 0) {
+            headerArr.push(exportTitle1[i], '')
+          } else {
+            headerArr.push(exportTitle1[i])
+          }
+        }
+        console.log('一级表头处理后', headerArr)
+        var valueArr = [] // 对应字段
+        for (let i = 0; i < exportTitle2.length; i++) {
+          if (i == 0) {
+            valueArr.push('A')
+          } else {
+            valueArr.push('a' + [i - 1])
+          }
+        }
+        console.log('对应字段valueArr', valueArr)
+        if (headerArr.length > 0) {
+          import('@/vendor/Export3Excel').then((excel) => {
+            const multiHeader = [
+              headerArr
+            ]
+            const multiHeader2 = []
+            const tHeader = exportTitle2
+            const filterVal = valueArr// 表头所对应的字段,这里未填写
+            const data = this.tab3.table.list.map(v => filterVal.map(j => v[j]))
+            // const data = [];
+            // 进行所有表头的单元格合并
+            // const merges = ['A1:A1', 'B1:E1','F1:J1' ];
+            const merges = ['A1:A1']
+
+            excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '价格分析', merges })
+          })
+        }
+      }
+    },
+    format(jsonData) { // 数据处理
+      const dataList = []
+      for (let i = 0; i < jsonData.length; i++) {
+        const list = []
+        list.push(jsonData[i].index)
+        list.push(jsonData[i].Personel)
+        list.push(jsonData[i].address)
+        for (let j = 0; j < jsonData[0]['time'].length; j++) {
+          list.push(jsonData[i]['time'][j].morning)
+          list.push(jsonData[i]['time'][j].afternoon)
+        }
+        dataList.push(list)
+      }
+      return dataList
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{
+    margin-bottom:10px;
+    .el-radio{margin-right: 10px;}
+    .filter-item1{margin-top: 10px;}
+  }
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  // .el-radio{margin-right: 20px;}
+</style>

+ 891 - 0
.svn/pristine/54/541353afb468a677411538195e245d48cc9a0ec5.svn-base

@@ -0,0 +1,891 @@
+<template>
+  <div class="app-container">
+    <div class="operation">
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate">新增车次</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleDelete">减少车次</el-button>
+      <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder">更改顺序</el-button>
+      <div v-else style="float: left;margin-left: 10px;">
+        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
+        <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
+      </div>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">生效</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用</el-button>
+      <el-button class="import" style="float: right;" @click="handleHistoryRecords">历史记录</el-button>
+    </div>
+    <div class="search" />
+    <div class="table">
+      <el-table
+        id="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"
+        row-key="id"
+        @selection-change="handleSelect"
+      >
+        <el-table-column type="selection" min-width="50" />
+        <el-table-column label="车次" min-width="110px" 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.trim="scope.row.sort" type="number" style="width:80%;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.ftname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeformulaName(value, scope.row)}">
+              <el-option v-for="item in formulaNameList" :key="item.id" :label="item.tname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="TMR编号" prop="weight" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.tmrcode }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" filterable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeTMRNumber(value, scope.row)}">
+              <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="班次" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.times }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.times" filterable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeTimes(value, scope.row)}">
+              <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="撒料计划车次跟随" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.lppcode }}</span>
+            <el-select v-if="scope.row.Edit" ref="test" v-model="scope.row.lppid" filterable clearable placeholder="" class="filter-item" style="width:80%;padding:10px 0;" @change="(value)=> {changeCarFollow(value, scope.row)}">
+              <el-option v-for="item in carFollowList" :key="item.id" :label="item.lppcode" :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.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="时间" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ptime }}</span>
+            <el-time-picker v-if="scope.row.Edit" v-model="scope.row.ptime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
+          </template>
+        </el-table-column> -->
+        <el-table-column label="最大搅拌量(KG)" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.maxweight }}</span>
+          </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.operateweight }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.operateweight" type="number" style="width:80%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
+            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="history.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[history.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-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-button class="successBorder" @click="handleApplication">应用</el-button> -->
+        </div>
+        <div class="table">
+          <el-table
+            :key="history.tableKey"
+            v-loading="history.listLoading"
+            element-loading-text="给我一点时间"
+            :data="history.list"
+            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">
+                <span>{{ scope.row.sort }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="配方名称" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ftname }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="TMR编号" prop="weight" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.tmrcode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="班次" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.times }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="发料计划车次跟随" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.lppcode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="生效" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
+              </template>
+            </el-table-column>
+            <el-table-column label="时间" min-width="180px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ptime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="最大搅拌量(KG)" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.maxweight }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="混料重量" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.operateweight }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+          <pagination v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="history.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, PostDataByName, failproccess, ExecDataByConfig, checkButtons } from '@/api/common'
+import Sortable from 'sortablejs'
+import Pagination from '@/components/Pagination'
+import Cookies from 'js-cookie'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'PremixedPlan',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getTMRYHList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getFTYHList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+      ],
+      formulaNameList: [], // 配方名称
+      TMRNumberList: [], // TMR编号
+
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      frequencyList: [], // 班次
+      getCarFollowParm: {
+        name: 'getLPPCodeList',
+        offset: 0,
+        pagecount: 0,
+        parammaps: {
+          pastureid: Cookies.get('pastureid'),
+          times: ''
+        }
+      },
+      carFollowList: [], // 发料计划车次跟随
+
+      table: {
+        getdataListParm: {
+          name: 'getPremixplanList',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true
+      },
+      history: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {},
+        rules: {},
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+
+        getdataDateParm: {
+          name: 'getPPMaxDate',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        getdataListParm: {
+          name: 'getPremixplanListDate',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: ''
+          }
+        }
+      },
+      textMap: {
+        history: '历史记录'
+      },
+      selectList: [],
+      isokDisable: false,
+      requestParam: {},
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      dropState: false,
+      isOrder: true
+    }
+  },
+  created() {
+    this.getButtons()
+    this.getList()
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  methods: {
+    getButtons() {
+      const Edit = 'PremixedPlan'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.TMRNumberList = response.data.getTMRYHList.list
+        this.formulaNameList = response.data.getFTYHList.list
+      })
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        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: '第四班' }]
+        }
+      })
+    },
+    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], 'groupEdit', 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.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    // 配方名称
+    changeformulaName(item, row) {
+      row.ftname = this.formulaNameList.find(obj => obj.id == item).tname
+    },
+    // TMR编号
+    changeTMRNumber(item, row) {
+      row.tmrcode = this.TMRNumberList.find(obj => obj.id == item).tname
+      row.maxweight = this.TMRNumberList.find(obj => obj.id == item).maxstirfeed
+    },
+    // 撒料计划车次跟随列表
+    changeCarFollow(item, row) {
+      console.log(item, row)
+      if (item == '') {
+        row.lppcode = ''
+      } else {
+        row.lppcode = this.carFollowList.find(obj => obj.id == item).lppcode
+        this.$forceUpdate()
+      }
+    },
+    // 班次
+    changeTimes(item, row) {
+      console.log(item, row)
+      this.getCarFollowParm.parammaps.times = item
+      this.getCarFollowList(row)
+      this.$forceUpdate()
+    },
+    // 撒料计划车次跟随列表
+    getCarFollowList(row) {
+      GetDataByName(this.getCarFollowParm).then(response => {
+        console.log('撒料计划车次跟随列表数据', response.data.list)
+        if (response.data.list !== null) {
+          this.carFollowList = response.data.list
+          row.lppid = this.carFollowList[0].id
+          row.lppcode = this.carFollowList[0].lppcode
+        } else {
+          this.carFollowList = []
+          row.lppid = ''
+          row.lppcode = ''
+        }
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了生效')
+    },
+    handleChangeOrder() {
+      this.isOrder = false
+      this.rowDrop()
+    },
+    saveChangeOrder() {
+      // 保存顺序
+      var sortArr = []
+      for (let i = 0; i < this.table.list.length; i++) {
+        var obj = {}
+        obj.sort = i + 1
+        obj.id = this.table.list[i].id
+        obj.pastureid = this.table.list[i].pastureid
+        sortArr.push(obj)
+      }
+      console.log(sortArr, 'sortArr=====')
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortArr }}
+      this.requestParam.data[0].children = []
+      this.requestParam.data[0].children[0] = { 'name': 'updatePremixplanSort', 'type': 'e', 'parammaps': {
+        id: '@insertSpotList.id',
+        pastureid: '@insertSpotList.pastureid',
+        sort: '@insertSpotList.sort'
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('顺序切换保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.isOrder = true
+        }
+      })
+    },
+    cancelChangeOrder() {
+      // 取消顺序
+      this.getList()
+      this.isOrder = true
+    },
+    // 行拖拽
+    rowDrop() {
+      console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
+      const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
+      const that = this
+      var sortable = Sortable.create(tbody, {
+        disabled: that.dropState,
+        onChoose({ newIndex, oldIndex }) {
+          if (that.dropState == true) {
+            sortable.destroy()
+          }
+        },
+        onEnd({ newIndex, oldIndex }) {
+          const currRow = that.table.list.splice(oldIndex, 1)[0]
+          that.table.list.splice(newIndex, 0, currRow)
+          console.log('索引', newIndex)
+          console.log('拖动数据', currRow)
+          console.log('上', that.table.list[newIndex - 1])
+          console.log('下', that.table.list[newIndex + 1])
+        }
+      })
+    },
+
+    // 模板新增
+    handleCreate() {
+      this.dropState = true
+      console.log('点击了新增车次')
+      // 编辑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
+        }
+      }
+      var sort = 1
+      if (this.table.list.length > 0) {
+        sort = parseInt(this.table.list[this.table.list.length - 1].sort) + 1
+      } else {
+        sort = 1
+      }
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': sort, 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'ptime': '', 'maxweight': '', 'operateweight': '' })
+    },
+    createData(row) {
+      console.log('点击了新增保存', row)
+      if (row.ptime == null || row.ptime == null) {
+        row.ptime = ''
+      }
+      if (row.sort == '' && row.ftid == '' && row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '车次/配方名称/TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.ftid == '' && row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '配方名称/TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.sort == '' || row.sort == 0) {
+        this.$message({ type: 'error', message: '车次不能为空且大于0', duration: 2000 })
+        return false
+      } else if (row.ftid == '') {
+        this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '') {
+        this.$message({ type: 'error', message: 'TMR编号不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      } else if (row.operateweight == '') {
+        this.$message({ type: 'error', message: '混料重量不能为空', duration: 2000 })
+        return false
+      }
+
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort !== '') {
+          if (row.sort == this.table.list[i].sort) {
+            if (row.myId !== this.table.list[i].myId) {
+              this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+              return false
+            }
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (row.sort !== '') {
+        if (!isInteger.test(parseFloat(row.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'insertPremixplan'
+      this.requestParam.parammaps = row
+      this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createCancel(row) {
+      console.log('点击了新增取消')
+      this.dropState = false
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.myId === this.table.list[i].myId) {
+          var listIndex = this.table.list.indexOf(this.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.table.list.splice(listIndex, 1)
+          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.lppid = String(row.lppid)
+      if (row.times == '第一班') {
+        this.getCarFollowParm.parammaps.times = '1'
+        row.times = '1'
+      } else if (row.times == '第二班') {
+        this.getCarFollowParm.parammaps.times = '2'
+        row.times = '2'
+      } else if (row.times == '第三班') {
+        this.getCarFollowParm.parammaps.times = '3'
+        row.times = '3'
+      } else if (row.times == '第四班') {
+        this.getCarFollowParm.parammaps.times = '4'
+        row.times = '4'
+      }
+
+      GetDataByName(this.getCarFollowParm).then(response => {
+        console.log('撒料计划车次跟随列表数据', response.data.list)
+        if (response.data.list !== null) {
+          this.carFollowList = response.data.list
+        }
+      })
+      if (row.lppcode == undefined) {
+        this.$set(row, 'lppid', '')
+      }
+      this.dropState = true
+    },
+    updateData(row) {
+      console.log('点击了编辑保存', row)
+      if (row.ptime == null || row.ptime == 'null') {
+        row.ptime = ''
+      }
+      if (row.ftid == '' && row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '配方名称/TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '' && row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '' && row.operateweight == '') {
+        this.$message({ type: 'error', message: '班次/混料重量不能为空', duration: 2000 })
+        return false
+      } else if (row.ftid == '') {
+        this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '') {
+        this.$message({ type: 'error', message: 'TMR编号不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      } else if (row.operateweight == '') {
+        this.$message({ type: 'error', message: '混料重量不能为空', duration: 2000 })
+        return false
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort == this.table.list[i].sort) {
+          if (row.id !== this.table.list[i].id) {
+            this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+            return false
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (row.sort !== '') {
+        if (!isInteger.test(parseFloat(row.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+      if (row.sort == '' || row.sort == 0) {
+        this.$message({ type: 'error', message: '车次不能为空且大于0', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'updatePremixplan'
+      this.requestParam.parammaps = row
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateCancel(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.getList()
+      this.dropState = false
+    },
+
+    handleSelect(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+
+    // 历史记录
+    handleHistoryRecords() {
+      console.log('点击了历史记录')
+      this.dialogFull = false
+      this.history.dialogStatus = 'history'
+      this.history.dialogFormVisible = true
+      this.getDateList()
+    },
+    // 历史时间
+    getDateList() {
+      GetDataByName(this.history.getdataDateParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.history.getdataListParm.parammaps.date = response.data.list[0].maxdate
+          this.getHistoryList()
+        } else {
+          this.history.getdataListParm.parammaps.date = ''
+        }
+      })
+    },
+    changeDate() {
+      this.getHistoryList()
+    },
+    // 应用
+    handleApplication() {
+      console.log('点击了应用')
+      MessageBox.confirm('是否确认将' + this.history.getdataListParm.parammaps.date + '的数据应用到当前?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'applyFPdate'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
+        this.requestParam.parammaps.date = this.history.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.getHistoryIsDisplay()
+            this.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消应用' })
+      })
+    },
+    getHistoryList() {
+      this.history.listLoading = true
+      GetDataByName(this.history.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          console.log('table数据', response.data.list)
+          this.history.list = response.data.list
+          this.history.pageNum = response.data.pageNum
+          this.history.pageSize = response.data.pageSize
+          this.history.total = response.data.total
+        } else {
+          this.history.list = []
+        }
+        setTimeout(() => {
+          this.history.listLoading = false
+        }, 100)
+      })
+    },
+    // 行内删除
+    handleRowDelete(row) {
+      console.log(row, '点击了行删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.name = 'deletePremixplan'
+        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: '已取消删除' })
+      })
+    },
+    // 减少车次
+    handleDelete() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deletePremixplan', '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()
+            }
+          })
+        })
+      }
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 1
+          }
+          console.log('生效', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updatePremixplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('生效保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDisable() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 0
+          }
+          console.log('禁用', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updatePremixplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('禁用保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    }
+  }
+}
+
+</script>
+
+<style lang="scss" scoped>
+  .search{clear: both;}
+  .table{margin-top:10px;}
+  /deep/ .el-time-panel__btn{
+    height: 26px !important;
+  }
+</style>

+ 3078 - 0
.svn/pristine/54/54db4710914d2bb75e20b7b8a34e7ee184484689.svn-base

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

+ 944 - 0
.svn/pristine/5c/5c6c332e83d8b8c2c098f78ac821456a98f786aa.svn-base

@@ -0,0 +1,944 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+      <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">导出</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="栏舍名称" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="标准分数(分)" min-width="65x" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.standardscore }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="牛头数(头)" min-width="65x" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.cowsum }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="评分" align="center">
+          <el-table-column label="2.75分-(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score25 }}({{ scope.row.score25rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="2.75分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score275 }}({{ scope.row.score275rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="3分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score3 }}({{ scope.row.score3rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="3.25分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score325 }}({{ scope.row.score325rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="3.5分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score35 }}({{ scope.row.score35rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="3.75分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score375 }}({{ scope.row.score375rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="4分+(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score4 }}({{ scope.row.score4rate }}%)</span>
+            </template>
+          </el-table-column>
+        </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.emp }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作日期" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.operatetime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 100%;margin:0 auto 50px">
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">栏舍信息</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col v-if="create.dialogStatus=='create'" :span="6">
+              <el-form-item label="栏舍名称:" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" :disabled="create.dialogStatus == 'update'" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
+                  <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-else :span="6">
+              <el-form-item label="栏舍名称:" prop="barname">
+                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">评分</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="标准分数(分):" prop="standardscore">
+                <el-input ref="standardscore" v-model="create.temp.standardscore" class="filter-item" style="width: 100%;" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="牛头数(头):" prop="cowsum">
+                <el-input ref="cowsum" v-model="create.temp.cowsum" class="filter-item" style="width: 100%;" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="2.75分-:" prop="score25">
+                <el-input ref="score25" v-model="create.temp.score25" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="2.75分:" prop="score275">
+                <el-input ref="score275" v-model="create.temp.score275" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="3分:" prop="score3">
+                <el-input ref="score3" v-model="create.temp.score3" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="3.25分:" prop="score325">
+                <el-input ref="score325" v-model="create.temp.score325" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="3.5分:" prop="score35">
+                <el-input ref="score35" v-model="create.temp.score35" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="3.75分:" prop="score375">
+                <el-input ref="score375" v-model="create.temp.score375" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="4分+:" prop="score4">
+                <el-input ref="score4" v-model="create.temp.score4" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">操作详情</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="操作人:" prop="emp">
+                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" class="filter-item" style="width: 100%;" @blur="blurEmp">
+                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="操作日期:" prop="operatetime">
+                <el-date-picker v-model="create.temp.operatetime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" @change="changeOperatetime" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="create.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="1-255字符" maxlength="255" class="filter-item" style="width: 100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'PhysicalConditionScore',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+      ],
+      houseNameList: [], // 栏舍名称
+      frequencyList: [], // 班次
+
+      table: {
+        getdataListParm: {
+          name: 'getBodyscoreList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', standardscore: '', cowsum: '', score25: '', score275: '', score3: '', score325: '', score35: '', score375: '', score4: '', remark: '', ftid: '', ftname: '' },
+        rules: {
+          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score25: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score275: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score3: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score325: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score35: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score375: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score4: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        },
+        // 操作人
+        getdataListParm: {
+          name: 'getBodyscoreEmpHis',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        // 体况评分参数
+        getdataListParm2: {
+          name: 'getDungAndBodyScore',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            date: ''
+          }
+        },
+        noteTakerList: [] // 记录人
+      },
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
+      download: {
+        getdataListParm: {
+          name: 'getBodyscoreList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        list: []
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'checkbarname,insertBodyscoreUpload',
+        importParams: '栏舍名称,2.75-分(头),2.75分(头),3分(头),3.25分(头),3.5分(头),3.75分(头),4+分(头),备注,操作人,操作日期',
+        sheetname: 'Sheet1',
+        // 登录牧场
+        pastureid: Cookies.get('pastureid'),
+        // 日期参数
+        dateParams: '操作日期',
+        // 必填参数
+        requiredParams: '栏舍名称,2.75-分(头),2.75分(头),3分(头),3.25分(头),3.5分(头),3.75分(头),4+分(头)',
+        // 为数值的参数
+        numParams: '2.75-分(头),2.75分(头),3分(头),3.25分(头),3.5分(头),3.75分(头),4+分(头)'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.getButtons()
+    this.getList()
+    this.getDownList()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'PhysicalConditionScore'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.houseNameList = response.data.getBarListEnable.list
+        if (response.data.getSysoptEnable.list !== null) {
+          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
+            const obj = {}
+            obj.id = String(i)
+            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }
+            this.frequencyList.push(obj)
+          }
+        } else {
+          this.frequencyList = []
+        }
+      })
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'score25rate', (parseFloat(response.data.list[i].score25) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score275rate', (parseFloat(response.data.list[i].score275) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score3rate', (parseFloat(response.data.list[i].score3) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score325rate', (parseFloat(response.data.list[i].score325) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score35rate', (parseFloat(response.data.list[i].score35) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score375rate', (parseFloat(response.data.list[i].score375) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score4rate', (100 - response.data.list[i].score25rate - response.data.list[i].score275rate - response.data.list[i].score3rate - response.data.list[i].score325rate - response.data.list[i].score35rate - response.data.list[i].score375rate).toFixed(2))
+          }
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.barid = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    // 新增
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', standardscore: '', cowsum: '', score25: '', score275: '', score3: '', score325: '', score35: '', score375: '', score4: '', remark: '', ftid: '', ftname: '' }
+    },
+    blurEmp(item) {
+      this.create.temp.emp = item.target.value
+    },
+    // 栏舍名称
+    changeBar(item) {
+      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
+      this.getRange()
+    },
+    changeOperatetime() {
+      this.getRange()
+    },
+    //  粪便评分参数
+    getRange() {
+      this.create.getdataListParm2.parammaps.date = this.create.temp.operatetime
+      this.create.getdataListParm2.parammaps.barid = this.create.temp.barid
+      GetDataByName(this.create.getdataListParm2).then(response => {
+        if (response.data.list !== null) {
+          this.create.temp.standardscore = response.data.list[0].bodystandard
+          this.create.temp.ftid = response.data.list[0].ftid
+          this.create.temp.ftname = response.data.list[0].ftname
+        } else {
+          this.create.temp.standardscore = ''
+          this.create.temp.ftid = ''
+          this.create.temp.ftname = ''
+        }
+      })
+    },
+    // 操作人
+    getNoteTakerList() {
+      GetDataByName(this.create.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].myId = i
+          }
+          this.create.noteTakerList = response.data.list
+          console.log('记录人数据', response.data.list)
+          console.log(this.create.noteTakerList)
+        } else {
+          this.create.noteTakerList = []
+        }
+      })
+    },
+    blurScore() {
+      if (this.create.temp.score25 !== '' && this.create.temp.score275 !== '' && this.create.temp.score3 !== '' && this.create.temp.score325 !== '' && this.create.temp.score35 !== '' && this.create.temp.score375 !== '' && this.create.temp.score4 !== '') {
+        this.create.temp.cowsum = parseInt(this.create.temp.score25) + parseInt(this.create.temp.score275) + parseInt(this.create.temp.score3) + parseInt(this.create.temp.score325) + parseInt(this.create.temp.score35) + parseInt(this.create.temp.score375) + parseInt(this.create.temp.score4)
+      }
+    },
+    handleCreate() {
+      console.log('点击了新增')
+      this.resetTemp()
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'create'
+      this.create.dialogFormVisible = true
+    },
+    createData() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const score = /^\d*$/
+          // 2.5分-/2.75分/3分/3.25分/3.5分/3.75分/4分+
+          if (!score.test(parseFloat(this.create.temp.score25)) || !score.test(parseFloat(this.create.temp.score275)) || !score.test(parseFloat(this.create.temp.score3)) || !score.test(parseFloat(this.create.temp.score325)) || !score.test(parseFloat(this.create.temp.score35)) || !score.test(parseFloat(this.create.temp.score375)) || !score.test(parseFloat(this.create.temp.score4))) {
+            this.$message({ type: 'error', message: '牛头数请输入大于等于0的整数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertBodyscore'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertDungandbodyhistory2'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.create.temp.species = 'tkpf'
+      this.create.temp.fourrate = ''
+      this.create.temp.fourweight = ''
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createDataAgain() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const score = /^\d*$/
+          // 2.5分-/2.75分/3分/3.25分/3.5分/3.75分/4分+
+          if (!score.test(parseFloat(this.create.temp.score25)) || !score.test(parseFloat(this.create.temp.score275)) || !score.test(parseFloat(this.create.temp.score3)) || !score.test(parseFloat(this.create.temp.score325)) || !score.test(parseFloat(this.create.temp.score35)) || !score.test(parseFloat(this.create.temp.score375)) || !score.test(parseFloat(this.create.temp.score4))) {
+            this.$message({ type: 'error', message: '牛头数请输入大于等于0的整数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertBodyscore'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.resetTemp()
+              this.getList()
+              this.getNoteTakerList()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log('点击了编辑', row)
+      row.barid = String(row.barid)
+      row.score25 = String(row.score25)
+      row.score275 = String(row.score275)
+      row.score3 = String(row.score3)
+      row.score325 = String(row.score325)
+      row.score35 = String(row.score35)
+      row.score375 = String(row.score375)
+      row.score4 = String(row.score4)
+      this.create.temp = Object.assign({}, row)
+      this.create.temp.id = row.id
+
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'update'
+      this.create.dialogFormVisible = true
+    },
+    updateData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const score = /^\d*$/
+          // 2.5分-/2.75分/3分/3.25分/3.5分/3.75分/4分+
+          if (!score.test(parseFloat(this.create.temp.score25)) || !score.test(parseFloat(this.create.temp.score275)) || !score.test(parseFloat(this.create.temp.score3)) || !score.test(parseFloat(this.create.temp.score325)) || !score.test(parseFloat(this.create.temp.score35)) || !score.test(parseFloat(this.create.temp.score375)) || !score.test(parseFloat(this.create.temp.score4))) {
+            this.$message({ type: 'error', message: '牛头数请输入大于等于0的整数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'updateBodyscore'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deleteBodyscore'
+        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
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择体况评分', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteBodyscore', '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() {
+      console.log('点击了复制')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择体况评分', duration: 2000 })
+      } else if (this.selectList.length == 1) {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.requestParam.name = 'copyBodyscore'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
+          this.requestParam.parammaps.id = this.selectList[0].id
+          PostDataByName(this.requestParam).then(response => {
+            if (response.msg === 'fail') {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ 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.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '请选择一条体况评分', duration: 2000 })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/栏舍生产/体况评分导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '体况评分导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
+          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.download.getdataListParm.parammaps.inputDatetime = ''
+          this.download.getdataListParm.parammaps.startTime = ''
+          this.download.getdataListParm.parammaps.stopTime = ''
+        }
+        GetDataByName(this.download.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.download.list = response.data.list
+          } else {
+            this.download.list = []
+          }
+          var excelDatas = [
+            {
+              tHeader: ['栏舍名称', '标准分数(分)', '牛头数(头)', '2.75-分(头)', '2.75分(头)', '3分(头)', '3.25分(头)', '3.5分(头)', '3.75分(头)', '4+分(头)', '备注', '操作人', '操作日期'],
+              filterVal: ['barname', 'standardscore', 'cowsum', 'score25', 'score275', 'score3', 'score325', 'score35', 'score375', 'score4', 'remark', 'emp', 'operatetime'],
+              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 = [
+               '栏舍名称', '2.75-分(头)', '2.75分(头)', '3分(头)', '3.25分(头)', '3.5分(头)', '3.75分(头)', '4+分(头)', '备注', '操作人', '操作日期', '错误信息'
+             ]
+             const filterVal = [
+               '栏舍名称', '2.75-分(头)', '2.75分(头)', '3分(头)', '3.25分(头)', '3.5分(头)', '3.75分(头)', '4+分(头)', '备注', '操作人', '操作日期', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '体况评分导入报错信息', autoWidth: true, bookType: 'xlsx' })
+           })
+        }
+      } else {
+        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+</style>

+ 560 - 0
.svn/pristine/6e/6e8f22cd745c4dba5ac5602d78afe032e324b6c0.svn-base

@@ -0,0 +1,560 @@
+<template>
+  <div class="app-container">
+    <!-- <h1>牧场</h1> -->
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" />
+      <el-select v-model="table.getdataListParm.parammaps.lpplantype" placeholder="设备类型" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in equipmentTypeList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <el-row :gutter="20">
+      <el-col :span="8">
+        <h4>设备列表</h4>
+        <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"
+            :height="table1Height"
+            @row-click="rowClick1"
+          >
+            <el-table-column label="设备类型" min-width="90px" align="center" prop="field1" />
+            <el-table-column label="设备名称" min-width="80px" align="center" prop="field2" />
+            <el-table-column label="GPS设备名称" min-width="90px" align="center" prop="field3" />
+            <el-table-column label="总时长(分钟)" min-width="100px" align="center" prop="field4" />
+          </el-table>
+        </div>
+        <h4>设备详情</h4>
+        <div class="table">
+          <el-table
+            :key="table2.tableKey"
+            v-loading="table2.listLoading"
+            element-loading-text="给我一点时间"
+            :data="table2.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :height="table1Height"
+            @row-click="rowClick2"
+          >
+            <el-table-column label="设备名称" min-width="90px" align="center" prop="field1" />
+            <el-table-column label="开始时间" min-width="80px" align="center" prop="field2" />
+            <el-table-column label="结束时间" min-width="90px" align="center" prop="field3" />
+            <el-table-column label="时长(分钟)" min-width="100px" align="center" prop="field4" />
+          </el-table>
+        </div>
+      </el-col>
+      <el-col :span="16" class="map">
+        <h4>设备轨迹图</h4>
+        <div v-if="isShow" style="text-align: center;line-height: 400px;">设备轨迹图加载失败,请刷新加载设备轨迹图</div>
+        <div v-else id="yzMap" style="min-height: 400px;" />
+      </el-col>
+    </el-row>
+
+  </div>
+
+</template>
+
+<script>
+import MapInit from '@/components/show/MapInit.js'
+import { GetDataByName } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+export default {
+  name: 'EquipmentRunningTrack',
+  data() {
+    return {
+      equipmentTypeList: [{ id: 0, name: '自走式TMR' }, { id: 1, name: '撒料设备TMR' }, { id: 2, name: '铲车' }, { id: 3, name: '推料车' }, { id: 4, name: '推粪车' }],
+      // TMR设备列表
+      table: {
+        getdataListParm: {
+          name: 'getprocessAnalysis',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: parseTime(new Date(), '{y}-{m}-{d}'),
+            iscompleted: '',
+            tmrtname: '',
+            lpplantype: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true
+      },
+      table2: {
+        getdataListParm: {
+          name: 'getprocessAnalysisStr',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            id: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true
+      },
+      table3: {
+        getdataListParm: {
+          name: 'getprocessAnalysisStr',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            id: ''
+          }
+        },
+        tableKey: 0,
+        // initializationMap: [116.40769, 39.91945],
+        // startLngLatMap: [116.380967, 39.953285],
+        // endLngLatMap: [116.424374, 39.914668],
+        initializationMap: '',
+        startLngLatMap: '',
+        endLngLatMap: '',
+        pointsList: [],
+        total: 0,
+        listLoading: true
+      },
+      table1Height: (document.documentElement.clientHeight - 85 - 250) / 2,
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      map: '', drivingRoute: '',
+      zoom: 16.5,
+      startIcon: 'http://lbs.tianditu.gov.cn/images/bus/start.png',	// 起点图标
+      endIcon: 'http://lbs.tianditu.gov.cn/images/bus/end.png', // 终点图标
+      line: null,
+      points: [],
+      isShow: false
+    }
+  },
+  created() {
+    this.getList()
+    console.log(document.documentElement.clientHeight - 85 - 250)
+  },
+  methods: {
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('TMR设备列表table数据', response.data.list)
+        // if (response.data.list !== null) {
+        //   this.table.list = response.data.list
+        // } else {
+        //   this.table.list = []
+        // }
+        this.table.list = [
+          { 'field1': '自走式TMR', 'field2': '1', 'field3': '自走式GPS', 'field4': '100', 'id': '1' },
+          { 'field1': '铲车', 'field2': '1号铲车', 'field3': '铲车GPS', 'field4': '60', 'id': '2' }
+        ]
+        this.table2.getdataListParm.parammaps.id = this.table.list[0].id
+        this.getList2()
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    rowClick1(row, column, event) {
+      if (row.id == '1') {
+        this.table2.getdataListParm.parammaps.id = '1'
+      } else {
+        this.table2.getdataListParm.parammaps.id = '2'
+      }
+      this.getList2()
+    },
+
+    getList2() {
+      this.table2.listLoading = false
+      GetDataByName(this.table2.getdataListParm).then(response => {
+        console.log('过程详情table数据', response.data.list)
+        // if (response.data.list !== null) {
+        //   this.table2.list = response.data.list
+        // } else {
+        //   this.table2.list = []
+        // }
+        if (this.table2.getdataListParm.parammaps.id == '1') {
+          this.table2.list = [
+            { 'field1': '1', 'field2': '05:29:43', 'field3': '05:37:47', 'field4': '8', 'id': '1' },
+            { 'field1': '1', 'field2': '05:37:50', 'field3': '05:40:33', 'field4': '2.6', 'id': '2' }
+          ]
+        } else {
+          this.table2.list = [
+            { 'field1': '1号铲车', 'field2': '09:01:28', 'field3': '09:04:42', 'field4': '3.2', 'id': '3' }
+          ]
+        }
+        this.table3.getdataListParm.parammaps.id = this.table2.list[0].id
+        this.getList3()
+        setTimeout(() => {
+          this.table2.listLoading = false
+        }, 100)
+      })
+    },
+    rowClick2(row, column, event) {
+      if (row.id == '1') {
+        this.table3.getdataListParm.parammaps.id = '1'
+      } else if (row.id == '2') {
+        this.table3.getdataListParm.parammaps.id = '2'
+      } else {
+        this.table3.getdataListParm.parammaps.id = '3'
+      }
+      if (this.table3.getdataListParm.parammaps.id == '1') {
+        this.table3.initializationMap = [117.88, 33.82]
+        this.table3.pointsList = [
+          { 'longitude': 117.8826770, 'latitude': 33.8208131 },
+          { 'longitude': 117.8826372, 'latitude': 33.8213032 },
+          { 'longitude': 117.8826971, 'latitude': 33.8217033 },
+          { 'longitude': 117.8827081, 'latitude': 33.8220751 },
+          { 'longitude': 117.8829982, 'latitude': 33.8220152 },
+          { 'longitude': 117.8831583, 'latitude': 33.8220853 },
+          { 'longitude': 117.8833981, 'latitude': 33.8221151 },
+          { 'longitude': 117.8835982, 'latitude': 33.8219852 },
+          { 'longitude': 117.8839703, 'latitude': 33.8220433 },
+          { 'longitude': 117.8838709, 'latitude': 33.8222431 },
+          { 'longitude': 117.8840024, 'latitude': 33.8225752 },
+          { 'longitude': 117.8837024, 'latitude': 33.8226553 },
+          { 'longitude': 117.8833024, 'latitude': 33.8225956 },
+          { 'longitude': 117.8830024, 'latitude': 33.8226556 },
+          { 'longitude': 117.8827133, 'latitude': 33.8226505 },
+          { 'longitude': 117.8826033, 'latitude': 33.8218505 },
+          { 'longitude': 117.8825471, 'latitude': 33.8208586 }
+        ]
+
+        // this.table3.startLngLatMap = [117.892022, 33.824756]
+        // this.table3.endLngLatMap = [117.891159, 33.826252]
+      } else if (this.table3.getdataListParm.parammaps.id == '2') {
+        this.table3.initializationMap = [117.88, 33.82]
+        this.table3.pointsList = [
+          { 'longitude': 117.8826684, 'latitude': 33.8220995 },
+          { 'longitude': 117.8823899, 'latitude': 33.8222107 },
+          { 'longitude': 117.882071, 'latitude': 33.822077 },
+          { 'longitude': 117.8819408, 'latitude': 33.8221457 },
+          { 'longitude': 117.881294, 'latitude': 33.8222307 },
+          { 'longitude': 117.881294, 'latitude': 33.8226243 },
+          { 'longitude': 117.8814287, 'latitude': 33.8232728 },
+          { 'longitude': 117.8816937, 'latitude': 33.8231791 },
+          { 'longitude': 117.8819363, 'latitude': 33.8232328 },
+          { 'longitude': 117.8822417, 'latitude': 33.8232791 },
+          { 'longitude': 117.882592, 'latitude': 33.8231304 },
+          { 'longitude': 117.8827448, 'latitude': 33.8227855 },
+          { 'longitude': 117.8826549, 'latitude': 33.8224481 },
+          { 'longitude': 117.8826819, 'latitude': 33.822092 }
+        ]
+      } else {
+        this.table3.initializationMap = [117.88, 33.82]
+        this.table3.pointsList = [
+          { 'longitude': 117.8828031, 'latitude': 33.823599 },
+          { 'longitude': 117.8830906, 'latitude': 33.8236015 },
+          { 'longitude': 117.8832433, 'latitude': 33.8235127 },
+          { 'longitude': 117.8834544, 'latitude': 33.8235777 },
+          { 'longitude': 117.8836161, 'latitude': 33.823509 },
+          { 'longitude': 117.8838079, 'latitude': 33.8235015 },
+          { 'longitude': 117.8840159, 'latitude': 33.823554 },
+          { 'longitude': 117.8840248, 'latitude': 33.8232528 },
+          { 'longitude': 117.8838048, 'latitude': 33.8233503 },
+          { 'longitude': 117.8835532, 'latitude': 33.8233128 },
+          { 'longitude': 117.8833511, 'latitude': 33.8233703 },
+          { 'longitude': 117.8831162, 'latitude': 33.8233639 },
+          { 'longitude': 117.8828225, 'latitude': 33.8234215 },
+          { 'longitude': 117.8825822, 'latitude': 33.8234577 },
+          { 'longitude': 117.8825022, 'latitude': 33.8234077 },
+          { 'longitude': 117.8821698, 'latitude': 33.8234015 },
+          { 'longitude': 117.881797, 'latitude': 33.8235052 },
+          { 'longitude': 117.8815096, 'latitude': 33.8234865 },
+          { 'longitude': 117.8813659, 'latitude': 33.8235952 },
+          { 'longitude': 117.8813614, 'latitude': 33.8237577 },
+          { 'longitude': 117.8816353, 'latitude': 33.8237002 },
+          { 'longitude': 117.8820108, 'latitude': 33.8236552 },
+          { 'longitude': 117.8821708, 'latitude': 33.8237152 },
+          { 'longitude': 117.8822708, 'latitude': 33.8236152 },
+          { 'longitude': 117.8824708, 'latitude': 33.8236152 },
+          { 'longitude': 117.8825531, 'latitude': 33.8235588 },
+          { 'longitude': 117.8828031, 'latitude': 33.8236088 }
+        ]
+        // this.table3.startLngLatMap = [117.754060, 33.505650]
+        // this.table3.endLngLatMap = [117.728130, 33.603550]
+      }
+      // this.getList3()
+      MapInit.init().then(
+        T => {
+          this.isShow = false
+          this.T = T
+          this.map = new T.Map('yzMap', config) // /初始化地图对象
+          const ctrl = new T.Control.MapType()
+          this.map.addControl(ctrl)
+          this.map.centerAndZoom(new T.LngLat(this.table3.initializationMap[0], this.table3.initializationMap[1]), this.zoom) // 初始化
+          var config = {
+            policy: 0	// 驾车策略
+            // onSearchComplete: this.searchResult	// 检索完成后的回调函数
+          }
+
+          console.log(this.map, '=========this.map')
+          // var map = this.map
+          // this.map.disableDrag()
+          // setTimeout(() => {
+          //   alert('可以拖拽地图了')
+          //   this.map.enableDrag()
+          // }, 2000)
+          this.map.setMapType(TMAP_HYBRID_MAP)
+          this.points = []
+          for (let i = 0; i < this.table3.pointsList.length; i++) {
+            this.points.push(new T.LngLat(this.table3.pointsList[i].longitude, this.table3.pointsList[i].latitude))
+          }
+          // 创建线对象
+          this.line = new T.Polyline(this.points, {
+            color: 'red'
+          })
+          // 向地图上添加线
+          this.map.addOverLay(this.line)
+          // this.drivingRoute = new T.DrivingRoute(this.map, config)
+          // this.searchDrivingRoute()
+          // this.map.enableInertia()
+        }).catch(error => {
+        console.log(error, '666')
+        this.isShow = true
+      })
+    },
+    getList3() {
+      this.table3.listLoading = false
+      GetDataByName(this.table3.getdataListParm).then(response => {
+        // if (response.data.list !== null) {
+        //   this.table2.list = response.data.list
+        // } else {
+        //   this.table2.list = []
+        // }
+
+        if (this.table3.getdataListParm.parammaps.id == '1') {
+          this.table3.initializationMap = [117.88199, 33.82250]
+          this.table3.pointsList = [
+            { 'longitude': 117.8826770, 'latitude': 33.8208131 },
+            { 'longitude': 117.8826372, 'latitude': 33.8213032 },
+            { 'longitude': 117.8826971, 'latitude': 33.8217033 },
+            { 'longitude': 117.8827081, 'latitude': 33.8220751 },
+            { 'longitude': 117.8829982, 'latitude': 33.8220152 },
+            { 'longitude': 117.8831583, 'latitude': 33.8220853 },
+            { 'longitude': 117.8833981, 'latitude': 33.8221151 },
+            { 'longitude': 117.8835982, 'latitude': 33.8219852 },
+            { 'longitude': 117.8839703, 'latitude': 33.8220433 },
+            { 'longitude': 117.8838709, 'latitude': 33.8222431 },
+            { 'longitude': 117.8840024, 'latitude': 33.8225752 },
+            { 'longitude': 117.8837024, 'latitude': 33.8226553 },
+            { 'longitude': 117.8833024, 'latitude': 33.8225956 },
+            { 'longitude': 117.8830024, 'latitude': 33.8226556 },
+            { 'longitude': 117.8827133, 'latitude': 33.8226505 },
+            { 'longitude': 117.8826033, 'latitude': 33.8218505 },
+            { 'longitude': 117.8825471, 'latitude': 33.8208586 }
+          ]
+
+          // this.table3.startLngLatMap = [117.892022, 33.824756]
+          // this.table3.endLngLatMap = [117.891159, 33.826252]
+        } else if (this.table3.getdataListParm.parammaps.id == '2') {
+          this.table3.initializationMap = [117.88, 33.82]
+          this.table3.pointsList = [
+            { 'longitude': 117.8826684, 'latitude': 33.8220995 },
+            { 'longitude': 117.8823899, 'latitude': 33.8222107 },
+            { 'longitude': 117.882071, 'latitude': 33.822077 },
+            { 'longitude': 117.8819408, 'latitude': 33.8221457 },
+            { 'longitude': 117.881294, 'latitude': 33.8222307 },
+            { 'longitude': 117.881294, 'latitude': 33.8226243 },
+            { 'longitude': 117.8814287, 'latitude': 33.8232728 },
+            { 'longitude': 117.8816937, 'latitude': 33.8231791 },
+            { 'longitude': 117.8819363, 'latitude': 33.8232328 },
+            { 'longitude': 117.8822417, 'latitude': 33.8232791 },
+            { 'longitude': 117.882592, 'latitude': 33.8231304 },
+            { 'longitude': 117.8827448, 'latitude': 33.8227855 },
+            { 'longitude': 117.8826549, 'latitude': 33.8224481 },
+            { 'longitude': 117.8826819, 'latitude': 33.822092 }
+          ]
+        } else {
+          this.table3.initializationMap = [117.88, 33.82]
+          this.table3.pointsList = [
+            { 'longitude': 117.8828031, 'latitude': 33.823599 },
+            { 'longitude': 117.8830906, 'latitude': 33.8236015 },
+            { 'longitude': 117.8832433, 'latitude': 33.8235127 },
+            { 'longitude': 117.8834544, 'latitude': 33.8235777 },
+            { 'longitude': 117.8836161, 'latitude': 33.823509 },
+            { 'longitude': 117.8838079, 'latitude': 33.8235015 },
+            { 'longitude': 117.8840159, 'latitude': 33.823554 },
+            { 'longitude': 117.8840248, 'latitude': 33.8232528 },
+            { 'longitude': 117.8838048, 'latitude': 33.8233503 },
+            { 'longitude': 117.8835532, 'latitude': 33.8233128 },
+            { 'longitude': 117.8833511, 'latitude': 33.8233703 },
+            { 'longitude': 117.8831162, 'latitude': 33.8233639 },
+            { 'longitude': 117.8828225, 'latitude': 33.8234215 },
+            { 'longitude': 117.8825822, 'latitude': 33.8234577 },
+            { 'longitude': 117.8825022, 'latitude': 33.8234077 },
+            { 'longitude': 117.8821698, 'latitude': 33.8234015 },
+            { 'longitude': 117.881797, 'latitude': 33.8235052 },
+            { 'longitude': 117.8815096, 'latitude': 33.8234865 },
+            { 'longitude': 117.8813659, 'latitude': 33.8235952 },
+            { 'longitude': 117.8813614, 'latitude': 33.8237577 },
+            { 'longitude': 117.8816353, 'latitude': 33.8237002 },
+            { 'longitude': 117.8820108, 'latitude': 33.8236552 },
+            { 'longitude': 117.8821708, 'latitude': 33.8237152 },
+            { 'longitude': 117.8822708, 'latitude': 33.8236152 },
+            { 'longitude': 117.8824708, 'latitude': 33.8236152 },
+            { 'longitude': 117.8825531, 'latitude': 33.8235588 },
+            { 'longitude': 117.8828031, 'latitude': 33.8236088 }
+          ]
+          // this.table3.startLngLatMap = [117.754060, 33.505650]
+          // this.table3.endLngLatMap = [117.728130, 33.603550]
+        }
+
+        this.roadMap()
+        // setTimeout(() => {
+        //   this.table3.listLoading = false
+        // }, 100)
+      })
+    },
+
+    roadMap() {
+      MapInit.init().then(
+        T => {
+          this.isShow = false
+          this.T = T
+          this.map = new T.Map('yzMap', config) // /初始化地图对象
+          const ctrl = new T.Control.MapType()
+          this.map.addControl(ctrl)
+          this.map.centerAndZoom(new T.LngLat(this.table3.initializationMap[0], this.table3.initializationMap[1]), this.zoom) // 初始化
+          var config = {
+            policy: 0	// 驾车策略
+            // onSearchComplete: this.searchResult	// 检索完成后的回调函数
+          }
+
+          // var map = this.map
+          this.map.disableDrag()
+          // setTimeout(() => {
+          //   alert('可以拖拽地图了')
+          //   this.map.enableDrag()
+          // }, 2000)
+          this.map.setMapType(TMAP_HYBRID_MAP)
+          this.points = []
+          for (let i = 0; i < this.table3.pointsList.length; i++) {
+            this.points.push(new T.LngLat(this.table3.pointsList[i].longitude, this.table3.pointsList[i].latitude))
+          }
+          // 创建线对象
+          this.line = new T.Polyline(this.points, {
+            color: 'red'
+          })
+          // 向地图上添加线
+          this.map.addOverLay(this.line)
+          // this.drivingRoute = new T.DrivingRoute(this.map, config)
+          // this.searchDrivingRoute()
+          // this.map.enableInertia()
+          // console.log(JSON.stringify(this.map), '=========this.map')
+        }).catch(error => {
+        console.log(error, '666')
+        this.isShow = true
+      })
+    },
+    getDistance(points) {
+      var r = 0
+      for (var k = 0; k < points.length - 1; k++) {
+        r += points[k].distanceTo(points[k + 1])
+      }
+      return r
+    }
+
+    // searchDrivingRoute() {
+    //   this.map.clearOverLays()
+    //   var startLngLat = new T.LngLat(this.table3.pointsList[0].longitude, this.table3.pointsList[0].latitude)
+    //   var endLngLat = new T.LngLat(this.table3.pointsList[this.table3.pointsList.length - 1].longitude, this.table3.pointsList[this.table3.pointsList.length - 1].latitude)
+    //   console.log(this.table3.pointsList, 'this.table3.pointsList====')
+    //   // 驾车路线搜索
+    //   this.drivingRoute.search(startLngLat, endLngLat)
+    //   this.drivingRoute.search(startLngLat, endLngLat)
+    // },
+    // createRoute(lnglats, lineColor) {
+    //   var _CarTrack = new T.CarTrack(this.map, {
+    //     interval: 20,
+    //     speed: 10,
+    //     dynamicLine: false,
+    //     Datas: lnglats,
+    //     polylinestyle: { color: '#2C64A7', width: 5, opacity: 0.9 }
+    //   })
+    //   _CarTrack.start()
+    // },
+    // createStartMarker(result) {
+    //   var startMarker = new T.Marker(result.getStart(), {
+    //     icon: new T.Icon({
+    //       iconUrl: this.startIcon,
+    //       iconSize: new T.Point(44, 34),
+    //       iconAnchor: new T.Point(12, 31)
+    //     })
+    //   })
+    //   this.map.addOverLay(startMarker)
+    //   var endMarker = new T.Marker(result.getEnd(), {
+    //     icon: new T.Icon({
+    //       iconUrl: this.endIcon,
+    //       iconSize: new T.Point(44, 34),
+    //       iconAnchor: new T.Point(12, 31)
+    //     })
+    //   })
+    //   this.map.addOverLay(endMarker)
+    // },
+    // searchResult(result) {
+    //   console.log(result, 'result====')
+    //   // 添加起始点
+    //   this.createStartMarker(result)
+    //   // 获取方案个数
+    //   var routes = result.getNumPlans()
+    //   console.log(routes, 'routes==')
+    //   for (var i = 0; i < routes; i++) {
+    //     // 获得单条驾车方案结果对象
+    //     var plan = result.getPlan(i)
+    //     console.log(plan, 'plan')
+    //     var that = this
+    //     that.createRoute(plan.getPath())
+    //   }
+    // }
+
+  }
+}
+
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+  .detail{
+    height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
+    .detail-t{margin-top: 10px;}
+    .detail-b{margin-bottom: 10px;}
+  }
+  .map{position: relative;min-height: 480px;}
+   #yzMap {
+    width: 95%;
+    height: 100%;
+    position: absolute;
+  }
+</style>

+ 666 - 0
.svn/pristine/74/7428cc119ae68064644029af3e6794e2b1c0a417.svn-base

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

+ 3170 - 0
.svn/pristine/76/76adcd8b4936f3ab968d84b18a9c232db583a717.svn-base

@@ -0,0 +1,3170 @@
+<template>
+  <div class="app-container1">
+    <el-tabs v-model="activeName" @tab-click="handleTabClick">
+      <el-tab-pane label="汇总统计" name="first">
+        <div class="search">
+          <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
+          <span style="margin-left: 10px;">统计类型:</span>
+          <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方名称</el-radio>
+          <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍名称</el-radio>
+          <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
+          <el-radio v-model="tab.radio" label="4" @change="changeRadio">车次</el-radio>
+          <el-radio v-model="tab.radio" label="5" @change="changeRadio">TMR名称</el-radio>
+          <el-checkbox v-model="tab.checked" style="margin-right: 10px;" @change="changeChecked">按日期统计</el-checkbox>
+          <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="配方名称" />
+          <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="栏舍名称" />
+          <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="牲畜名称" />
+          <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.projname" class="filter-item" style="width: 100px;" placeholder="车次" />
+          <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.times" class="filter-item" style="width: 100px;" placeholder="班次" />
+          <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 100px;" placeholder="TMR名称" />
+          <el-button class="successBorder" @click="handleSearch">查询</el-button>
+          <el-button class="export" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
+          <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
+        </div>
+        <div id="table" class="table">
+          <h4>混料</h4>
+          <el-table
+            :key="tab.table.tableKey"
+            v-loading="tab.table.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab.table.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight2"
+          >
+            <el-table-column v-if="tab.checked" :key="0" sortable label="日期" min-width="70px" align="center" prop="计划时间" />
+            <el-table-column v-if="tab.isFormulaName" :key="1" sortable label="配方名称" min-width="70px" align="center" prop="配方名称" />
+            <el-table-column v-if="tab.isHouseName" :key="2" sortable label="栏舍名称" min-width="70px" align="center" prop="栏舍名称" />
+            <el-table-column v-if="tab.isLivestockType" :key="3" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
+            <el-table-column v-if="tab.isTrainNumber" :key="4" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTrainNumber" :key="5" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="6" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="7" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column v-if="tab.isTMRName" :key="8" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTMRName" :key="9" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTMRName" :key="10" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTMRName" :key="11" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column :key="12" sortable label="理论重量" min-width="60px" align="center" prop="理论重量" />
+            <el-table-column :key="13" sortable label="实际重量" min-width="60px" align="center" prop="实际重量" />
+            <el-table-column :key="14" sortable label="计划混料操作数" min-width="60px" align="center" prop="计划混料操作数" />
+            <el-table-column :key="15" sortable label="已混料操作数" min-width="50px" align="center" prop="已混料操作数" />
+            <el-table-column :key="16" sortable label="混料操作率" min-width="60px" align="center" prop="混料操作率" />
+            <el-table-column :key="17" sortable label="混料误差值" min-width="60px" align="center" prop="混料误差值" />
+            <el-table-column :key="18" sortable label="混料准确率" min-width="60px" align="center" prop="混料准确率" />
+            <el-table-column v-if="tab.isTrainNumber" :key="19" sortable label="混料时间" min-width="70px" align="center" prop="混料时间" />
+            <el-table-column v-if="tab.isTrainNumber" :key="20" sortable label="等待时间" min-width="70px" align="center" prop="等待时间" />
+            <el-table-column :key="21" sortable label="混料自动跳转次数" min-width="65px" align="center" prop="混料自动跳转次数" />
+            <el-table-column :key="22" sortable label="混料手动跳转次数" min-width="65px" align="center" prop="混料手动跳转次数" />
+            <el-table-column :key="23" sortable label="取消次数" min-width="70px" align="center" prop="取消次数" />
+            <el-table-column :key="24" sortable label="混料正确数" min-width="70px" align="center" prop="混料正确数" />
+            <el-table-column :key="25" sortable label="混料正确率" min-width="70px" align="center" prop="混料正确率" />
+            <el-table-column :key="26" sortable label="去除取消正确率" min-width="60px" align="center" prop="去除取消正确率" />
+            <el-table-column :key="27" sortable label="标准差" min-width="60px" align="center" prop="方差" />
+            <el-table-column :key="28" align="center" width="70" label="操作" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
+              </template>
+            </el-table-column>
+          </el-table>
+          <span v-if="tab.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table.total }}条</span>
+          <h4>撒料</h4>
+          <el-table
+            :key="tab.table2.tableKey"
+            v-loading="tab.table2.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab.table2.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight2"
+          >
+            <el-table-column v-if="tab.checked" :key="0" sortable label="日期" min-width="70px" align="center" prop="计划时间" />
+            <el-table-column v-if="tab.isFormulaName" :key="1" sortable label="配方名称" min-width="70px" align="center" prop="配方名称" />
+            <el-table-column v-if="tab.isHouseName" :key="2" sortable label="栏舍名称" min-width="70px" align="center" prop="栏舍名称" />
+            <el-table-column v-if="tab.isLivestockType" :key="3" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
+            <el-table-column v-if="tab.isTrainNumber" :key="4" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="5" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="6" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTrainNumber" :key="7" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column v-if="tab.isTMRName" :key="8" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTMRName" :key="9" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTMRName" :key="10" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTMRName" :key="11" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column :key="12" sortable label="理论重量" min-width="60px" align="center" prop="理论重量" />
+            <el-table-column :key="13" sortable label="实际重量" min-width="60px" align="center" prop="实际重量" />
+            <el-table-column :key="14" sortable label="计划撒料操作数" min-width="60px" align="center" prop="计划撒料操作数" />
+            <el-table-column :key="15" sortable label="已撒料操作数" min-width="50px" align="center" prop="已撒料操作数" />
+            <el-table-column :key="16" sortable label="撒料操作率" min-width="60px" align="center" prop="撒料操作率" />
+            <el-table-column :key="17" sortable label="撒料误差值" min-width="60px" align="center" prop="撒料误差值" />
+            <el-table-column :key="18" sortable label="撒料准确率" min-width="60px" align="center" prop="撒料准确率" />
+            <el-table-column v-if="tab.isTrainNumber" :key="19" sortable label="撒料时间" min-width="70px" align="center" prop="撒料时间" />
+            <el-table-column v-if="tab.isTrainNumber" :key="20" sortable label="等待时间" min-width="70px" align="center" prop="等待时间" />
+            <el-table-column :key="21" sortable label="撒料自动跳转次数" width="65px" align="center" prop="撒料自动跳转次数" />
+            <el-table-column :key="22" sortable label="撒料手动跳转次数" width="65px" align="center" prop="撒料手动跳转次数" />
+            <el-table-column :key="23" sortable label="取消次数" min-width="70px" align="center" prop="取消次数" />
+            <el-table-column :key="24" sortable label="撒料正确数" min-width="70px" align="center" prop="撒料正确数" />
+            <el-table-column :key="25" sortable label="撒料正确率" min-width="70px" align="center" prop="撒料正确率" />
+            <el-table-column :key="26" sortable label="去除取消正确率" min-width="65px" align="center" prop="去除取消正确率" />
+            <el-table-column :key="27" sortable label="标准差" min-width="60px" align="center" prop="方差" />
+            <el-table-column :key="28" align="center" width="70" label="操作" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
+              </template>
+            </el-table-column>
+          </el-table>
+          <span v-if="tab.table2.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table2.total }}条</span>
+        </div>
+        <div id="AnalysisChart" class="AnalysisChart">
+          <el-row :gutter="10">
+            <el-col :span="24" style="margin-bottom: 10px;margin-top: 10px;">
+              <span>图表查询时间:</span>
+              <el-date-picker v-model="tab.chartDate" :clearable="false" style="margin-left: 10px;width: 250px;margin-right: 10px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
+              <el-button class="successBorder" @click="handleChartDate">确认</el-button>
+              <svg-icon icon-class="Up" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpTop" />
+            </el-col>
+          </el-row>
+          <el-row :gutter="10" class="dashboard-editor-container">
+            <!-- 计划统计 -->
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4>计划统计</h4>
+                <div v-if="tab.chart2.isChart" class="button">
+                  <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" @change="changeChartDate('chart2')" />
+                  <div class="exportTable" @click="handleExport('chart2')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart2')">切换表格</div>
+                </div>
+                <div v-if="tab.chart2.isChart" id="chartLine2" style="width:100%;height:400px;background: #fff;" />
+                <div v-if="tab.chart2.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart2')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart2')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart2.table.tableKey"
+                    v-loading="tab.chart2.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart2.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="85px" align="center" prop="日期" />
+                    <el-table-column label="计划执行重量(kg)" sortable min-width="80px" align="center" prop="实际量" />
+                    <el-table-column label="配方理论重量(kg)" sortable min-width="80px" align="center" prop="理论量" />
+                    <el-table-column label="计划准确率" sortable min-width="85px" align="center" prop="field1" />
+                    <el-table-column label="计划取消重量(kg)" sortable min-width="80px" align="center" prop="计划取消重量" />
+                    <el-table-column label="计划准确率(去除取消重量)" sortable min-width="100px" align="center" prop="field3" />
+                    <el-table-column label="计划正确数" sortable min-width="85px" align="center" prop="正确数" />
+                    <el-table-column label="计划数" sortable min-width="60px" align="center" prop="计划数" />
+                    <el-table-column label="计划正确率" sortable min-width="75px" align="center" prop="field2" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+            <!-- 配方准确率 -->
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4>配方准确率</h4>
+                <div v-if="tab.chart1.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart1.getdataListParm.parammaps.statisticsList" :option="tab.chart1.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart1" />
+                  <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width: 245px;" class="inputDatetime filter-item" :clearable="false" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart1')" />
+                  <div class="exportTable" @click="handleExport('chart1')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart1')">切换表格</div>
+                </div>
+                <div v-if="tab.chart1.isChart" id="chartLine1" style="width:100%;height:400px;" />
+                <div v-if="tab.chart1.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart1')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart1')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart1.table.tableKey"
+                    v-loading="tab.chart1.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart1.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
+                    <el-table-column label="配方名称" sortable min-width="90px" align="center" prop="名称" />
+                    <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
+                    <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
+                    <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="10" class="dashboard-editor-container">
+            <!-- 牛群准确率 -->
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4>牛群准确率</h4>
+                <div v-if="tab.chart3.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart3.getdataListParm.parammaps.statisticsList" :option="tab.chart3.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart3" />
+                  <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width: 245px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart3')" />
+                  <div class="exportTable" @click="handleExport('chart3')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart3')">切换表格</div>
+                </div>
+                <div v-if="tab.chart3.isChart" id="chartLine3" style="width:100%;height:400px;" />
+                <div v-if="tab.chart3.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart3')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart3')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart3.table.tableKey"
+                    v-loading="tab.chart3.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart3.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
+                    <el-table-column label="牲畜类别" sortable min-width="90px" align="center" prop="名称" />
+                    <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
+                    <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
+                    <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+            <!-- 车辆准确率(重量) -->
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4>车辆准确率(重量)</h4>
+                <div v-if="tab.chart4.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart4.getdataListParm.parammaps.statisticsList" :option="tab.chart4.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart4" />
+                  <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 245px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart4')" />
+                  <div class="exportTable" @click="handleExport('chart4')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart4')">切换表格</div>
+                </div>
+                <div v-if="tab.chart4.isChart" id="chartLine4" style="width:100%;height:400px;" />
+                <div v-if="tab.chart4.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart4')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart4')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart4.table.tableKey"
+                    v-loading="tab.chart4.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart4.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
+                    <el-table-column label="车次" sortable min-width="90px" align="center" prop="名称" />
+                    <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
+                    <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
+                    <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
+
+          <el-row :gutter="10" class="dashboard-editor-container">
+            <!-- 混料统计 -->
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4>混料统计</h4>
+                <div v-if="tab.chart5.isChart" class="button">
+                  <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart5')" />
+                  <div class="exportTable" @click="handleExport('chart5')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart5')">切换表格</div>
+                </div>
+                <div v-if="tab.chart5.isChart" id="chartLine5" class="button" style="width:100%;height:400px;" />
+                <div v-if="tab.chart5.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart5')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart5')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart5.table.tableKey"
+                    v-loading="tab.chart5.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart5.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="100px" align="center" prop="日期" />
+                    <el-table-column label="自动跳转次数" sortable min-width="130px" align="center" prop="field1" />
+                    <el-table-column label="手动跳转次数" sortable min-width="130px" align="center" prop="field2" />
+                    <el-table-column label="自动跳转理论重量" sortable min-width="110px" align="center" prop="理论自动" />
+                    <el-table-column label="自动跳转实际重量" sortable min-width="110px" align="center" prop="实际自动" />
+                    <el-table-column label="自动跳转准确率" sortable min-width="110px" align="center" prop="field3" />
+                    <el-table-column label="手动跳转理论重量" sortable min-width="110px" align="center" prop="理论手动" />
+                    <el-table-column label="手动跳转实际重量" sortable min-width="110px" align="center" prop="实际手动" />
+                    <el-table-column label="手动跳转准确率" sortable min-width="110px" align="center" prop="field4" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+            <!-- 混料计划取消次数 -->
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4>混料计划取消次数</h4>
+                <div v-if="tab.chart6.isChart" class="button">
+                  <el-date-picker v-model="tab.chart6.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart6')" />
+                  <div class="exportTable" @click="handleExport('chart6')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart6')">切换表格</div>
+                </div>
+                <div v-if="tab.chart6.isChart" id="chartLine6" style="width:100%;height:400px;" />
+                <div v-if="tab.chart6.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart6')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart6')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart6.table.tableKey"
+                    v-loading="tab.chart6.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart6.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+                    <el-table-column label="混料计划取消次数" sortable min-width="110px" align="center" prop="field1" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
+
+          <el-row :gutter="10" class="dashboard-editor-container" style="margin-bottom: 30px;">
+            <!-- 栏舍撒料时间统计 -->
+            <el-col :span="24">
+              <div class="grid-content">
+                <h4>栏舍撒料时间统计</h4>
+                <div v-if="tab.chart7.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart7.getdataListParm.parammaps.statisticsLis" :option="tab.chart7.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart7" />
+                  <el-date-picker v-model="tab.chart7.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart7')" />
+                  <div class="exportTable" @click="handleExport('chart7')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart7')">切换表格</div>
+                </div>
+                <div v-if="tab.chart7.isChart" id="chartLine7" style="width:100%;height:400px;" />
+                <div v-if="tab.chart7.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart7')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart7')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart7.table.tableKey"
+                    v-loading="tab.chart7.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart7.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="400"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+                    <el-table-column label="栏舍" sortable min-width="110px" align="center" prop="fname" />
+                    <el-table-column label="撒料时间" sortable min-width="110px" align="center" prop="撒料时间" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="混料统计" name="second">
+        <div class="search">
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
+          <!-- <el-button class="el-icon-arrow-left elIconArrowLeft" style="float: left;" :disabled="Beforedisabled2" @click="handleBefore2" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" style="float: left;" :disabled="Nextdisabled2" @click="handleNext2" /> -->
+          <el-input v-model="tab2.table.getdataListParm.parammaps.tmrtname" style="width: 130px;" placeholder="TMR名称" class="filter-item" clearable />
+          <el-input v-model="tab2.table.getdataListParm.parammaps.projname" style="width: 130px;" placeholder="车次" class="filter-item" clearable />
+          <el-select v-model="tab2.table.getdataListParm.parammaps.times" style="width: 110px;" filterable placeholder="班次" class="filter-item" clearable>
+            <el-option v-for="item in tab2.frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-input v-model="tab2.table.getdataListParm.parammaps.templetname" style="width: 130px;" placeholder="配方名称" class="filter-item" clearable />
+          <el-select v-model="tab2.table.getdataListParm.parammaps.buttontype" style="width: 130px;" filterable placeholder="跳转方式" class="filter-item" clearable>
+            <el-option v-for="item in tab2.jumpModeList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-select v-model="tab2.table.getdataListParm.parammaps.isuse" style="width: 130px;" filterable placeholder="上传状态" class="filter-item" clearable>
+            <el-option v-for="item in tab2.isuseList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
+          <el-button style="float: right;margin-right: 10px;margin-bottom:10px;" class="export" icon="el-icon-upload2" @click="handleExport2">导出</el-button>
+        </div>
+
+        <div class="table">
+          <el-table
+            :key="tab2.table.tableKey"
+            v-loading="tab2.table.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab2.table.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight2"
+          >
+            <el-table-column sortable label="日期" min-width="70px" align="center" prop="日期" />
+            <el-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column sortable label="车次" min-width="50px" align="center" prop="车次" />
+            <el-table-column sortable label="班次" min-width="50px" align="center" prop="班次" />
+            <el-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
+            <el-table-column sortable label="饲料" min-width="70px" align="center" prop="饲料" />
+            <el-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
+            <el-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
+            <el-table-column sortable label="误差值" min-width="45px" align="center" prop="误差值" />
+            <el-table-column sortable label="准确率" min-width="45px" align="center" prop="准确率" />
+            <el-table-column sortable label="计划时间" min-width="55px" align="center" prop="计划时间" />
+            <el-table-column sortable label="开始时间" min-width="55px" align="center" prop="开始时间" />
+            <el-table-column sortable label="结束时间" min-width="55px" align="center" prop="结束时间" />
+            <el-table-column sortable label="搅拌时间" min-width="55px" align="center" prop="搅拌时间" />
+            <el-table-column sortable label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+            <el-table-column sortable label="开始重量" min-width="55px" align="center" prop="开始重量" />
+            <el-table-column sortable label="结束重量" min-width="55px" align="center" prop="结束重量" />
+          </el-table>
+          <span v-if="tab2.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab2.table.total }}条</span>
+          <!-- <pagination v-show="tab2.table.total>=0" :total="tab2.table.total" :page.sync="tab2.table.getdataListParm.offset" :limit.sync="tab2.table.getdataListParm.pagecount" @pagination="getTab2List" /> -->
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="撒料统计" name="third">
+        <div class="search">
+          <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
+          <!-- <el-button class="el-icon-arrow-left elIconArrowLeft" style="float: left;" :disabled="Beforedisabled3" @click="handleBefore3" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" style="float: left;" :disabled="Nextdisabled3" @click="handleNext3" /> -->
+          <el-input v-model="tab3.table.getdataListParm.parammaps.tmrtname" style="width: 110px;" placeholder="TMR名称" class="filter-item" clearable />
+          <el-input v-model="tab3.table.getdataListParm.parammaps.projname" style="width: 110px;" placeholder="车次" class="filter-item" clearable />
+          <el-select v-model="tab3.table.getdataListParm.parammaps.times" style="width: 100px;" filterable placeholder="班次" class="filter-item" clearable>
+            <el-option v-for="item in tab3.frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-input v-model="tab3.table.getdataListParm.parammaps.templetname" style="width: 110px;" placeholder="配方名称" class="filter-item" clearable />
+          <el-input v-model="tab3.table.getdataListParm.parammaps.fname" style="width: 110px;" placeholder="栏舍名称" class="filter-item" clearable />
+          <el-select v-model="tab3.table.getdataListParm.parammaps.buttontype" style="width: 110px;" filterable placeholder="跳转方式" class="filter-item" clearable>
+            <el-option v-for="item in tab3.jumpModeList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-select v-model="tab3.table.getdataListParm.parammaps.isuse" style="width: 130px;" filterable placeholder="上传状态" class="filter-item" clearable>
+            <el-option v-for="item in tab3.isuseList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-button class="successBorder" @click="handleSearch3">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh3">重置</el-button>
+          <el-button style="float: right;margin-right: 10px;margin-bottom:10px;" class="export" icon="el-icon-upload2" @click="handleExport3">导出</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="tab3.table.tableKey"
+            v-loading="tab3.table.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab3.table.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight2"
+          >
+            <el-table-column sortable label="日期" min-width="70px" align="center" prop="日期" />
+            <el-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column sortable label="车次" min-width="45px" align="center" prop="车次" />
+            <el-table-column sortable label="班次" min-width="45px" align="center" prop="班次" />
+            <el-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
+            <el-table-column sortable label="栏舍" min-width="90px" align="center" prop="栏舍" />
+            <el-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
+            <el-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
+            <el-table-column sortable label="误差值" min-width="45px" align="center" prop="误差值" />
+            <el-table-column sortable label="准确率" min-width="45px" align="center" prop="准确率" />
+            <el-table-column sortable label="开始时间" min-width="55px" align="center" prop="开始时间" />
+            <el-table-column sortable label="结束时间" min-width="55px" align="center" prop="结束时间" />
+            <el-table-column sortable label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+            <el-table-column sortable label="开始重量" min-width="55px" align="center" prop="开始重量" />
+            <el-table-column sortable label="结束重量" min-width="55px" align="center" prop="结束重量" />
+          </el-table>
+          <span v-if="tab3.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
+          <pagination v-show="tab3.table.total>=0" :total="tab3.table.total" :page.sync="tab3.table.getdataListParm.offset" :limit.sync="tab3.table.getdataListParm.pagecount" @pagination="getTab3List" />
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+    <!-- 查看 -->
+    <See :show.sync="isShowDialog" :row-pid="rowPid" :title-fname="titlefname" />
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts'
+import See from './see.vue'
+require('echarts/theme/macarons')
+import { GetDataByName, GetReportform } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import mySelect from '@/components/mySelect'
+export default {
+  name: 'PastureErrorAnalysis',
+  components: { Pagination, mySelect, See },
+  data() {
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      Beforedisabled2: false,
+      Nextdisabled2: false,
+      Beforedisabled3: false,
+      Nextdisabled3: false,
+      pickerOptions: {
+        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()
+        }
+      },
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      activeName: 'first',
+      tab: {
+        radio: '1',
+        isFormulaName: true, // 配方名称
+        isHouseName: false, // 栏舍名称
+        isLivestockType: false, // 牲畜类别
+        isTrainNumber: false, // 车次
+        isTMRName: false, // TMR名称
+        checked: false, // 按日期统计
+        table: {
+          getdataListParm: {
+            name: 'getAccuracyHFT',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              fname: '',
+              sort: '',
+              times: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+
+        table2: {
+          getdataListParm: {
+            name: 'getAccuracySFT',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              fname: '',
+              sort: '',
+              times: ''
+            }
+          },
+          tableKey: 2,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        chartDate: [],
+        // 配方准确率
+        chart1: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllFT',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart1Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+
+        // 计划统计
+        chart2: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllJH',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        // 牛群准确率
+        chart3: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllNQ',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart1Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        // 车辆准确率(重量)
+        chart4: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllCC',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart4Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        // 混料统计
+        chart5: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllHL',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        // 混料计划取消次数
+        chart6: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllQX',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        // 栏舍撒料时间统计
+        chart7: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllLS',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart7Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        }
+
+      },
+
+      tab2: {
+        table: {
+          getdataListParm: {
+            name: 'getStatisticsHL',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              tmrtname: '',
+              projname: '',
+              times: '',
+              buttontype: '',
+              templetname: '',
+              isuse: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        frequencyList: [],
+        jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }],
+        isuseList: [{ id: '0', name: '未完成' }, { id: '2', name: '部分完成' }, { id: '1', name: '全部完成' }]
+      },
+      tab3: {
+        table: {
+          getdataListParm: {
+            name: 'getStatisticsSL',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
+              tmrtname: '',
+              projname: '',
+              times: '',
+              templetname: '',
+              fname: '',
+              buttontype: '',
+              isuse: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        frequencyList: [],
+        jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }],
+        isuseList: [{ id: '0', name: '未完成' }, { id: '2', name: '部分完成' }, { id: '1', name: '全部完成' }]
+      },
+      titlefname: '',
+      rowPid: '',
+      isShowDialog: false,
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2: document.documentElement.clientHeight - 85 - 210
+    }
+  },
+  created() {
+    console.log(this.isShowDialog, 'this.isShowDialog')
+    this.getTimeFn()
+    this.getIsDisplay()
+    this.getTabList()
+    this.getTabList2()
+    this.getChart1()
+    this.getChart2()
+    this.getChart3()
+    this.getChart4()
+    this.getChart5()
+    this.getChart6()
+    this.getChart7()
+  },
+  mounted() {},
+  methods: {
+    getTimeFn() {
+      const that = this
+      const start = new Date()
+      const end = new Date()
+      const start2 = new Date()
+      const end2 = new Date()
+      start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+      end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+      // that.tab.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
+      // that.tab.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+      that.tab.table2.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.tab.table2.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+      // that.tab2.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
+      // that.tab2.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+      // that.tab3.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
+      // that.tab3.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
+
+      // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 10)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart6.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart6.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart6.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart6.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart7.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart7.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart7.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart7.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        if (response.data.list[0].inforvalue == 1) {
+          this.tab2.frequencyList = [{ id: '1', name: '第一班' }]
+          this.tab3.frequencyList = [{ id: '1', name: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+          this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+        } else if (response.data.list[0].inforvalue == 3) {
+          this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+          this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+        } else if (response.data.list[0].inforvalue == 4) {
+          this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+          this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+        }
+      })
+    },
+    // 导出
+    handleDownload() {
+      if (this.tab.checked == true) {
+        if (this.tab.radio == '1') {
+          var excelDatas = [
+            {
+              tHeader: ['日期', '配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '混料正确数', '混料正确率', '去除取消正确率', '标准差'],
+              filterVal: ['计划时间', '配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '混料正确数', '混料正确率', '去除取消正确率', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['日期', '配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '撒料正确数', '撒料正确率', '去除取消正确率', '标准差'],
+              filterVal: ['计划时间', '配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '撒料正确数', '撒料正确率', '去除取消正确率', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas, '准确性分析—汇总统计', true, 'xlsx')
+        } else if (this.tab.radio == '2') {
+          var excelDatas2 = [
+            {
+              tHeader: ['日期', '栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['计划时间', '栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['日期', '栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['计划时间', '栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas2, '汇总统计-栏舍名称', true, 'xlsx')
+        } else if (this.tab.radio == '3') {
+          var excelDatas3 = [
+            {
+              tHeader: ['日期', '牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['计划时间', '牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['日期', '牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['计划时间', '牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas3, '汇总统计-牲畜类别', true, 'xlsx')
+        } else if (this.tab.radio == '4') {
+          var excelDatas4 = [
+            {
+              tHeader: ['日期', '车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['计划时间', '车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['日期', '车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['计划时间', '车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas4, '汇总统计-车次', true, 'xlsx')
+        }
+      } else {
+        if (this.tab.radio == '1') {
+          var excelDatas = [
+            {
+              tHeader: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas, '准确性分析—汇总统计', true, 'xlsx')
+        } else if (this.tab.radio == '2') {
+          var excelDatas2 = [
+            {
+              tHeader: ['栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas2, '汇总统计-栏舍名称', true, 'xlsx')
+        } else if (this.tab.radio == '3') {
+          var excelDatas3 = [
+            {
+              tHeader: ['牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas3, '汇总统计-牲畜类别', true, 'xlsx')
+        } else if (this.tab.radio == '4') {
+          var excelDatas4 = [
+            {
+              tHeader: ['车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料时间', '等待时间', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料时间', '等待时间', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table.list,
+              sheetName: '混料'
+            },
+            {
+              tHeader: ['车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料时间', '等待时间', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '标准差'],
+              filterVal: ['车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料时间', '等待时间', '撒料自动跳转次数', '撒料手动跳转次数', '取消次数', '方差'],
+              tableDatas: this.tab.table2.list,
+              sheetName: '撒料'
+            }
+          ]
+          json2excel(excelDatas4, '汇总统计-车次', true, 'xlsx')
+        }
+      }
+    },
+    // 切换Tab
+    handleTabClick() {
+      if (this.activeName == 'first') {
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
+        this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        // this.tab.table.getdataListParm.parammaps.inputDatetime = []
+        this.tab.table2.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab.table2.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        this.tab.table.getdataListParm.parammaps.fname = ''
+        this.tab.table.getdataListParm.parammaps.sort = ''
+        this.tab.table.getdataListParm.parammaps.times = ''
+
+        this.tab.table2.getdataListParm.parammaps.fname = ''
+        this.tab.table2.getdataListParm.parammaps.sort = ''
+        this.tab.table2.getdataListParm.parammaps.times = ''
+        this.getTabList()
+        this.getTabList2()
+        this.getChart1()
+        this.getChart2()
+        this.getChart3()
+        this.getChart4()
+        this.getChart5()
+        this.getChart6()
+        this.getChart7()
+      } else if (this.activeName == 'second') {
+        const start2 = new Date()
+        const end2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab2.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.tmrtname = ''
+        this.tab2.table.getdataListParm.parammaps.projname = ''
+        this.tab2.table.getdataListParm.parammaps.times = ''
+        this.tab2.table.getdataListParm.parammaps.buttontype = ''
+        this.tab2.table.getdataListParm.parammaps.templetname = ''
+        this.getTab2List()
+      } else if (this.activeName == 'third') {
+        const start3 = new Date()
+        const end3 = new Date()
+        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
+        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab3.table.getdataListParm.parammaps.inputDatetime = [start3, end3]
+        this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+
+        this.tab3.table.getdataListParm.parammaps.tmrtname = ''
+        this.tab3.table.getdataListParm.parammaps.projname = ''
+        this.tab3.table.getdataListParm.parammaps.times = ''
+        this.tab3.table.getdataListParm.parammaps.templetname = ''
+        this.tab3.table.getdataListParm.parammaps.buttontype = ''
+        this.getTab3List()
+      }
+    },
+    // 切换统计类型
+    changeRadio() {
+      console.log(this.tab.radio)
+      this.tab.table.getdataListParm.parammaps.sort = ''
+      this.tab.table.getdataListParm.parammaps.times = ''
+      this.tab.table.getdataListParm.parammaps.fname = ''
+      this.tab.table2.getdataListParm.parammaps.sort = ''
+      this.tab.table2.getdataListParm.parammaps.times = ''
+      this.tab.table2.getdataListParm.parammaps.fname = ''
+      if (this.tab.checked == true) {
+        if (this.tab.radio == '1') {
+          console.log('配方名称')
+          this.tab.isFormulaName = true
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHFTDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySFTDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.getTabList2()
+        } else if (this.tab.radio == '2') {
+          console.log('栏舍名称')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = true
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHNSDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySNSDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.getTabList2()
+        } else if (this.tab.radio == '3') {
+          console.log(' 牲畜类别')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = true
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHSCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySSCDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '4') {
+          console.log('车次')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHCCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySCCDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('TMR名称')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCLDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        }
+      } else {
+        if (this.tab.radio == '1') {
+          console.log('配方名称')
+          this.tab.isFormulaName = true
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHFT'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySFT'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.getTabList2()
+        } else if (this.tab.radio == '2') {
+          console.log('栏舍名称')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = true
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHNS'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySNS'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.getTabList2()
+        } else if (this.tab.radio == '3') {
+          console.log(' 牲畜类别')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = true
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHSC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySSC'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '4') {
+          console.log('车次')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHCC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySCC'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('TMR名称')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCL'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        }
+      }
+    },
+    // 按日期统计
+    changeChecked() {
+      console.log(this.tab.checked)
+      this.handleSearch()
+    },
+    // 汇总统计/混料
+    getTabList() {
+      this.tab.table.listLoading = true
+      GetDataByName(this.tab.table.getdataListParm).then(response => {
+        console.log('汇总统计/混料table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab.table.list = response.data.list
+          this.tab.table.total = response.data.total
+        } else {
+          this.tab.table.list = []
+        }
+        setTimeout(() => {
+          this.tab.table.listLoading = false
+        }, 100)
+      })
+    },
+    // 汇总统计/撒料
+    getTabList2() {
+      this.tab.table2.listLoading = true
+      GetDataByName(this.tab.table2.getdataListParm).then(response => {
+        console.log('汇总统计/撒料table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab.table2.list = response.data.list
+          this.tab.table2.total = response.data.total
+        } else {
+          this.tab.table2.list = []
+        }
+        setTimeout(() => {
+          this.tab.table2.listLoading = false
+        }, 100)
+      })
+    },
+    // 查询
+    handleSearch() {
+      console.log(this.tab.checked)
+      if (this.tab.checked == true) {
+        if (this.tab.radio == '1') {
+          console.log('配方名称/查询111')
+          this.tab.isFormulaName = true
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHFTDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySFTDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '2') {
+          console.log('栏舍名称/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = true
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHNSDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySNSDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '3') {
+          console.log(' 牲畜类别/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = true
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHSCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySSCDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '4') {
+          console.log('车次/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHCCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySCCDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+          this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
+          this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('TMR名称/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCLDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+          this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
+          this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        }
+      } else {
+        if (this.tab.radio == '1') {
+          console.log('配方名称/查询')
+          this.tab.isFormulaName = true
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHFT'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySFT'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '2') {
+          console.log('栏舍名称/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = true
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHNS'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySNS'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '3') {
+          console.log(' 牲畜类别/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = true
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHSC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySSC'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '4') {
+          console.log('车次/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
+          this.tab.table.getdataListParm.name = 'getAccuracyHCC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySCC'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+
+          this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+          this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
+          this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('tmr名称/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCL'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+
+          this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+          this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
+          this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        }
+      }
+      this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+    },
+    handleBefore() {
+      this.$forceUpdate()
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+      this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+      this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+      this.getTabList2()
+    },
+    handleNext() {
+      this.$forceUpdate()
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+      this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+      this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+      this.getTabList2()
+    },
+    handleBefore2() {
+      this.$forceUpdate()
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop3 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleNext2() {
+      console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime, 'inputDatetime前')
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop4 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
+        console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime, 'inputDatetime后')
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleBefore3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
+        this.$forceUpdate()
+        if (stop5 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    handleNext3() {
+      this.$forceUpdate()
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
+        this.$forceUpdate()
+        if (stop6 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    // 快速跳转到图表
+    handleQuickJumpChart() {
+      var myHeight = document.getElementById('table').offsetHeight + 120
+      window.scrollTo(myHeight, myHeight)
+    },
+    // 快速回到顶部
+    handleQuickJumpTop() {
+      window.scrollTo(0, 0)
+    },
+    // 图表总查询
+    handleChartDate() {
+      console.log('点击了确认时间')
+      MessageBox.confirm('是否调整以下所有图表查询时间?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        var that = this
+        var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
+        var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
+        that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart1.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart1()
+        that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart2.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart2()
+        that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart3.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart3()
+        that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart4.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart4()
+        that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart5.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart5()
+        that.tab.chart6.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart6.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart6.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart6()
+        that.tab.chart7.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart7.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart7.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart7()
+      })
+    },
+
+    // 配方准确率
+    changeStatisticChart1(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart1.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart1.chart1Data3[j])
+          }
+        }
+      }
+      this.tab.chart1.chartLine_data.data3 = arrData3
+      this.tab.chart1.chartLine_data.data1 = this.tab.chart1.getdataListParm.parammaps.statisticsList
+      this.roadChartLine1(this.tab.chart1.chartLine_data)
+    },
+
+    getChart1() {
+      this.tab.chart1.listLoading = true
+      GetReportform(this.tab.chart1.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            for (let i = 0; i < response.data.data.length; i++) {
+              if (response.data.data[i].准确率 !== '' && response.data.data[i].准确率 !== undefined) {
+                response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率) + '%'
+              }
+              if (response.data.data[i].理论量 !== '' && response.data.data[i].理论量 !== undefined) {
+                response.data.data[i].理论量 = parseFloat(response.data.data[i].理论量)
+              }
+              if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
+                response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
+              }
+            }
+          }
+
+          this.tab.chart1.table.list = response.data.data
+          this.tab.chart1.chartLine_data = response.data.list
+          this.tab.chart1.statisticsList = []
+          this.tab.chart1.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart1.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart1.statisticsList.push(obj)
+          }
+
+          console.log(this.tab.chart1.statisticsList, '配 方准确率下拉内容')
+          this.tab.chart1.chart1Data3 = response.data.list.data3
+          this.tab.chart1.total = response.data.total
+          console.log('配方准确率表数据', this.tab.chart1.table.list)
+          console.log('配方准确率图数据', this.tab.chart1.chartLine_data)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
+              if (j == myId) {
+                this.tab.chart1.chart1Data3[j].checkedState = true
+                arrData3.push(this.tab.chart1.chart1Data3[j])
+              }
+            }
+          }
+          this.tab.chart1.chartLine_data.data3 = arrData3
+          this.tab.chart1.chartLine_data.data1 = this.tab.chart1.getdataListParm.parammaps.statisticsList
+          this.roadChartLine1(this.tab.chart1.chartLine_data)
+        } else {
+          this.tab.chart1.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart1.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine1(chartLine_data) {
+      if (this.tab.chart1.chartLine != null) {
+        this.tab.chart1.chartLine.dispose()
+      }
+      this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: {
+          type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
+        },
+        series: (function() {
+          var serie = []
+          for (var i = 0; i < chartLine_data.data3.length; i++) {
+            var item = {
+              name: chartLine_data.data1[i],
+              type: 'line',
+              data: chartLine_data.data3[i].data
+            }
+            serie.push(item)
+          }
+          return serie
+        }())
+      }
+      this.tab.chart1.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart1.chartLine.resize()
+      }
+    },
+
+    // 计划统计
+    getChart2() {
+      this.tab.chart2.listLoading = true
+      GetReportform(this.tab.chart2.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
+              response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
+            }
+            if (response.data.data[i].理论量 !== '' && response.data.data[i].理论量 !== undefined) {
+              response.data.data[i].理论量 = parseFloat(response.data.data[i].理论量)
+            }
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+            if (response.data.data[i].计划取消重量 !== '' && response.data.data[i].计划取消重量 !== undefined) {
+              response.data.data[i].计划取消重量 = parseFloat(response.data.data[i].计划取消重量)
+            }
+            if (response.data.data[i].field3 !== '' && response.data.data[i].field3 !== undefined) {
+              response.data.data[i].field3 = parseFloat(response.data.data[i].field3)
+            }
+            if (response.data.data[i].正确数 !== '' && response.data.data[i].正确数 !== undefined) {
+              response.data.data[i].正确数 = parseFloat(response.data.data[i].正确数)
+            }
+            if (response.data.data[i].计划数 !== '' && response.data.data[i].计划数 !== undefined) {
+              response.data.data[i].计划数 = parseFloat(response.data.data[i].计划数)
+            }
+            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+            }
+          }
+          this.tab.chart2.table.list = response.data.data
+          this.tab.chart2.chartLine_data = response.data.list
+          this.tab.chart2.total = response.data.total
+          console.log('计划统计图数据', this.tab.chart2.chartLine_data)
+          console.log('计划统计表数据', this.tab.chart2.table.list)
+          this.roadChartLine2(this.tab.chart2.chartLine_data)
+        } else {
+          this.tab.chart2.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart2.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine2(chartLine_data) {
+      if (this.tab.chart2.chartLine != null) {
+        this.tab.chart2.chartLine.dispose()
+      }
+      this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'],
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
+        yAxis: {
+          type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
+        },
+        series: [
+          { name: '计划准确率', type: 'line', data: chartLine_data.data2 },
+          { name: '计划正确率', type: 'line', data: chartLine_data.data3 },
+          { name: '计划准确率(去除取消重量)', type: 'line', data: chartLine_data.data4 }
+        ]
+      }
+      this.tab.chart2.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart2.chartLine.resize()
+      }
+    },
+
+    // 牛群准确率
+    changeStatisticChart3(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart3.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart3.chart3Data3[j])
+          }
+        }
+      }
+      this.tab.chart3.chartLine_data.data3 = arrData3
+      this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
+      this.roadChartLine3(this.tab.chart3.chartLine_data)
+    },
+    getChart3() {
+      this.tab.chart3.listLoading = true
+      GetReportform(this.tab.chart3.getdataListParm).then(response => {
+        if (response.data.data !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].理论量 !== '' && response.data.data[i].理论量 !== undefined) {
+              response.data.data[i].理论量 = parseFloat(response.data.data[i].理论量)
+            }
+            if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
+              response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
+            }
+            if (response.data.data[i].准确率 !== '' && response.data.data[i].准确率 !== undefined) {
+              response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率) + '%'
+            }
+          }
+          this.tab.chart3.table.list = response.data.data
+          this.tab.chart3.chartLine_data = response.data.list
+          this.tab.chart3.total = response.data.total
+          this.tab.chart3.statisticsList = []
+          this.tab.chart3.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart3.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart3.statisticsList.push(obj)
+          }
+          this.tab.chart3.chart3Data3 = response.data.list.data3
+          this.tab.chart3.total = response.data.total
+          console.log('牛群准确率图数据', this.tab.chart3.chartLine_data)
+          console.log('牛群准确率表数据', this.tab.chart3.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart3.chart3Data3[j])
+              }
+            }
+          }
+          this.tab.chart3.chartLine_data.data3 = arrData3
+          this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
+          this.roadChartLine3(this.tab.chart3.chartLine_data)
+        } else {
+          this.tab.chart3.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart3.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine3(chartLine_data) {
+      if (this.tab.chart3.chartLine != null) {
+        this.tab.chart3.chartLine.dispose()
+      }
+      this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: {
+          type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
+        },
+        series: (function() {
+          var serie = []
+          for (var i = 0; i < chartLine_data.data3.length; i++) {
+            var item = {
+              name: chartLine_data.data1[i],
+              type: 'line',
+              data: chartLine_data.data3[i].data
+            }
+            serie.push(item)
+          }
+          return serie
+        }())
+      }
+      this.tab.chart3.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart3.chartLine.resize()
+      }
+    },
+
+    // 车辆准确率(重量)
+    changeStatisticChart4(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart4.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart4.chart4Data3[j])
+          }
+        }
+      }
+      this.tab.chart4.chartLine_data.data3 = arrData3
+      this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
+      this.roadChartLine4(this.tab.chart4.chartLine_data)
+    },
+    getChart4() {
+      this.tab.chart4.listLoading = true
+      GetReportform(this.tab.chart4.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].理论量 !== '' && response.data.data[i].理论量 !== undefined) {
+              response.data.data[i].理论量 = parseFloat(response.data.data[i].理论量)
+            }
+            if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
+              response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
+            }
+            if (response.data.data[i].准确率 !== '' && response.data.data[i].准确率 !== undefined) {
+              response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率) + '%'
+            }
+          }
+          this.tab.chart4.table.list = response.data.data
+          this.tab.chart4.chartLine_data = response.data.list
+          this.tab.chart4.total = response.data.total
+          this.tab.chart4.statisticsList = []
+          this.tab.chart4.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart4.statisticsList.push(obj)
+          }
+          this.tab.chart4.chart4Data3 = response.data.list.data3
+          this.tab.chart4.total = response.data.total
+          console.log('车辆准确率(重量)图', this.tab.chart4.chartLine_data)
+          console.log('车辆准确率(重量)表', this.tab.chart4.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart4.chart4Data3[j])
+              }
+            }
+          }
+          this.tab.chart4.chartLine_data.data3 = arrData3
+          this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
+          this.roadChartLine4(this.tab.chart4.chartLine_data)
+        } else {
+          this.tab.chart4.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart4.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine4(chartLine_data) {
+      if (this.tab.chart4.chartLine != null) {
+        this.tab.chart4.chartLine.dispose()
+      }
+      this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: {
+          type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
+        },
+        series: (function() {
+          var serie = []
+          for (var i = 0; i < chartLine_data.data3.length; i++) {
+            var item = {
+              name: chartLine_data.data1[i],
+              type: 'line',
+              data: chartLine_data.data3[i].data
+            }
+            serie.push(item)
+          }
+          return serie
+        }())
+      }
+      this.tab.chart4.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart4.chartLine.resize()
+      }
+    },
+
+    // 混料统计
+    getChart5() {
+      this.tab.chart5.listLoading = true
+      GetReportform(this.tab.chart5.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+            }
+            if (response.data.data[i].理论自动 !== '' && response.data.data[i].理论自动 !== undefined) {
+              response.data.data[i].理论自动 = parseFloat(response.data.data[i].理论自动)
+            }
+            if (response.data.data[i].实际自动 !== '' && response.data.data[i].实际自动 !== undefined) {
+              response.data.data[i].实际自动 = parseFloat(response.data.data[i].实际自动)
+            }
+            if (response.data.data[i].field3 !== '' && response.data.data[i].field3 !== undefined) {
+              response.data.data[i].field3 = parseFloat(response.data.data[i].field3)
+            }
+            if (response.data.data[i].理论手动 !== '' && response.data.data[i].理论手动 !== undefined) {
+              response.data.data[i].理论手动 = parseFloat(response.data.data[i].理论手动)
+            }
+            if (response.data.data[i].实际手动 !== '' && response.data.data[i].实际手动 !== undefined) {
+              response.data.data[i].实际手动 = parseFloat(response.data.data[i].实际手动)
+            }
+            if (response.data.data[i].field4 !== '' && response.data.data[i].field4 !== undefined) {
+              response.data.data[i].field4 = parseFloat(response.data.data[i].field4)
+            }
+          }
+          this.tab.chart5.table.list = response.data.data
+          this.tab.chart5.chartLine_data = response.data.list
+          this.tab.chart5.total = response.data.total
+          console.log('混料统计图', this.tab.chart5.chartLine_data)
+          console.log('混料统计表', this.tab.chart5.table.list)
+          this.roadChartLine5(this.tab.chart5.chartLine_data)
+        } else {
+          this.tab.chart5.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart5.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine5(chartLine_data) {
+      if (this.tab.chart5.chartLine != null) {
+        this.tab.chart5.chartLine.dispose()
+      }
+      this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
+      var option = {
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            crossStyle: {
+              color: '#999'
+            }
+          }
+        },
+        toolbox: {
+          feature: {}
+        },
+        legend: {
+          data: ['自动跳转次数', '手动跳转次数', '自动跳转准确率', '手动跳转准确率']
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        xAxis: [
+          {
+            type: 'category',
+            data: chartLine_data.data1,
+            axisPointer: {
+              type: 'shadow'
+            }
+          }
+        ],
+        yAxis: [
+          {
+            splitLine: { show: false }, type: 'value',
+            name: '跳转次数',
+            axisLabel: {
+              formatter: '{value}'
+            }
+          },
+          {
+            splitLine: { show: false }, type: 'value',
+            name: '混料准确率',
+            min: 0,
+            max: 100,
+            interval: 10,
+            axisLabel: {
+              formatter: '{value} %'
+            }
+          }
+        ],
+        series: [
+          {
+            name: '自动跳转次数',
+            type: 'bar',
+            data: chartLine_data.data2
+          },
+          {
+            name: '手动跳转次数',
+            type: 'bar',
+            data: chartLine_data.data3
+          },
+          {
+            name: '自动跳转准确率',
+            type: 'line',
+            yAxisIndex: 1,
+            data: chartLine_data.data4
+          },
+          {
+            name: '手动跳转准确率',
+            type: 'line',
+            yAxisIndex: 1,
+            data: chartLine_data.data5
+          }
+        ]
+      }
+      this.tab.chart5.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart5.chartLine.resize()
+      }
+    },
+
+    // 混料计划取消次数
+    getChart6() {
+      this.tab.chart6.listLoading = true
+      GetReportform(this.tab.chart6.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+          }
+          this.tab.chart6.table.list = response.data.data
+          this.tab.chart6.chartLine_data = response.data.list
+          this.tab.chart6.total = response.data.total
+          console.log('混料计划取消次数图', this.tab.chart6.chartLine_data)
+          console.log('混料计划取消次数表', this.tab.chart6.table.list)
+          this.roadChartLine6(this.tab.chart6.chartLine_data)
+        } else {
+          this.tab.chart6.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart6.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine6(chartLine_data) {
+      if (this.tab.chart6.chartLine != null) {
+        this.tab.chart6.chartLine.dispose()
+      }
+      this.tab.chart6.chartLine = echarts.init(document.getElementById('chartLine6'))
+      var option = {
+        color: ['#3398DB'],
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: { // 坐标轴指示器,坐标轴触发有效
+            type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
+          }
+        },
+        legend: {
+          data: ['取消次数'],
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        xAxis: [
+          {
+            name: '日期',
+            type: 'category',
+            data: chartLine_data.data1,
+            axisTick: {
+              alignWithLabel: true
+            }
+          }
+        ],
+        yAxis: [
+          {
+            name: '次数',
+            interval: 1, // 会出现负数刻度
+            min: 0,
+            type: 'value'
+          }
+        ],
+        series: [
+          {
+            name: '取消次数',
+            type: 'bar',
+            barWidth: '60%',
+            data: chartLine_data.data2
+          }
+        ]
+      }
+      this.tab.chart6.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart6.chartLine.resize()
+      }
+    },
+
+    // 栏舍撒料时间统计
+    changeStatisticChart7(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart4.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart7.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart7.statisticsList.find(obj => obj.name == this.tab.chart7.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart7.chart7Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart7.chart7Data3[j])
+          }
+        }
+      }
+      this.tab.chart7.chartLine_data.data3 = arrData3
+      this.tab.chart7.chartLine_data.data1 = this.tab.chart7.getdataListParm.parammaps.statisticsList
+      this.roadChartLine7(this.tab.chart7.chartLine_data)
+    },
+    getChart7() {
+      this.tab.chart7.listLoading = true
+      GetReportform(this.tab.chart7.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            // 撒料时间
+            var b = []
+            for (let j = 0; j <= response.data.data[i].准确率.length; j++) {
+              // console.log(response.data.data[i].准确率)
+              if (response.data.data[i].准确率.charAt(j) == '.') {
+                b[j] = response.data.data[i].准确率.replace('.', ':')
+              }
+            }
+            response.data.data[i].准确率 = b[b.length - 1]
+            response.data.data[i].撒料时间 = response.data.data[i].准确率
+          }
+          this.tab.chart7.table.list = response.data.data
+          this.tab.chart7.chartLine_data = response.data.list
+          this.tab.chart7.statisticsList = []
+          this.tab.chart7.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart7.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart7.statisticsList.push(obj)
+          }
+          this.tab.chart7.chart7Data3 = response.data.list.data3
+          this.tab.chart7.total = response.data.total
+          console.log('栏舍撒料时间统计图', this.tab.chart7.chartLine_data)
+          console.log('栏舍撒料时间统计表', this.tab.chart7.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart7.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart7.statisticsList.find(obj => obj.name == this.tab.chart7.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart7.chart7Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart7.chart7Data3[j])
+              }
+            }
+          }
+          this.tab.chart7.chartLine_data.data3 = arrData3
+          this.tab.chart7.chartLine_data.data1 = this.tab.chart7.getdataListParm.parammaps.statisticsList
+          this.roadChartLine7(this.tab.chart7.chartLine_data)
+        } else {
+          this.tab.chart7.list = []
+        }
+        setTimeout(() => {
+          this.tab.chart7.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine7(chartLine_data) {
+      if (this.tab.chart7.chartLine != null) {
+        this.tab.chart7.chartLine.dispose()
+      }
+      this.tab.chart7.chartLine = echarts.init(document.getElementById('chartLine7'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis',
+          formatter: function(params) {
+            // console.log(params)
+            var tip = params[0].name
+            for (let i = 0; i < params.length; i++) {
+              var b = []
+              // var str = params[i].value
+              for (let j = 0; j <= params[i].value.length; j++) {
+                if (params[i].value !== '') {
+                  if (params[i].value.charAt(j) == '.') {
+                    b[j] = params[i].value.replace('.', ':')
+                  }
+                } else {
+                  b[j] = ''
+                }
+              }
+              tip += '<br>' + params[i].seriesName + ': ' + b[b.length - 1]
+            }
+            return tip
+          }
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: [{
+          type: '',
+          name: '时间',
+          mix: 0,
+          max: 24,
+          interval: 2,
+          axisLabel: {
+            formatter: function(value) {
+              var texts = []
+              if (value < 10) {
+                texts.push('0' + value + ':00')
+              } else {
+                texts.push(value + ':00')
+              }
+              return texts
+            }
+          }
+        }],
+        series: (function() {
+          var serie = []
+          for (var i = 0; i < chartLine_data.data3.length; i++) {
+            var item = {
+              name: chartLine_data.data1[i],
+              type: 'line',
+              data: chartLine_data.data3[i].data
+            }
+            serie.push(item)
+          }
+          return serie
+        }())
+      }
+      this.tab.chart7.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart7.chartLine.resize()
+      }
+    },
+    // 时间
+    changeChartDate(item) {
+      console.log(item)
+      if (item == 'chart1') {
+        if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart1()
+        } else {
+          this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart1.getdataListParm.parammaps.startTime = ''
+          this.tab.chart1.getdataListParm.parammaps.stopTime = ''
+          this.getChart1()
+        }
+      } else if (item == 'chart2') {
+        if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart2()
+        } else {
+          this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart2.getdataListParm.parammaps.startTime = ''
+          this.tab.chart2.getdataListParm.parammaps.stopTime = ''
+          this.getChart2()
+        }
+      } else if (item == 'chart3') {
+        if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart3()
+        } else {
+          this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart3.getdataListParm.parammaps.startTime = ''
+          this.tab.chart3.getdataListParm.parammaps.stopTime = ''
+          this.getChart3()
+        }
+      } else if (item == 'chart4') {
+        if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart4()
+        } else {
+          this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart4.getdataListParm.parammaps.startTime = ''
+          this.tab.chart4.getdataListParm.parammaps.stopTime = ''
+          this.getChart4()
+        }
+      } else if (item == 'chart5') {
+        if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart5()
+        } else {
+          this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart5.getdataListParm.parammaps.startTime = ''
+          this.tab.chart5.getdataListParm.parammaps.stopTime = ''
+          this.getChart5()
+        }
+      } else if (item == 'chart6') {
+        if (this.tab.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart6.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart6.getdataListParm.parammaps.startTime = parseTime(this.tab.chart6.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart6.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart6.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart6()
+        } else {
+          this.tab.chart6.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart6.getdataListParm.parammaps.startTime = ''
+          this.tab.chart6.getdataListParm.parammaps.stopTime = ''
+          this.getChart6()
+        }
+      } else if (item == 'chart7') {
+        if (this.tab.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart7.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart7.getdataListParm.parammaps.startTime = parseTime(this.tab.chart7.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart7.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart7.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart7()
+        } else {
+          this.tab.chart7.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart7.getdataListParm.parammaps.startTime = ''
+          this.tab.chart7.getdataListParm.parammaps.stopTime = ''
+          this.getChart7()
+        }
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 'chart1') {
+        console.log('配方准确率导出')
+        var excelDatasTabChart1 = [
+          {
+            tHeader: ['日期', '配方名称', '计划重量(kg)', '实际重量(kg)', '准确率'],
+            filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
+            tableDatas: this.tab.chart1.table.list,
+            sheetName: '配方准确率'
+          }
+        ]
+        json2excel(excelDatasTabChart1, '配方准确率', true, 'xlsx')
+      } else if (item == 'chart2') {
+        console.log('计划统计导出')
+        var excelDatasTabChart2 = [
+          {
+            tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
+            filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
+            tableDatas: this.tab.chart2.table.list,
+            sheetName: '计划统计'
+          }
+        ]
+        json2excel(excelDatasTabChart2, '计划统计', true, 'xlsx')
+      } else if (item == 'chart3') {
+        console.log('牛群准确率导出')
+        var excelDatasTabChart3 = [
+          {
+            tHeader: ['日期', '牲畜类别', '计划重量(kg)', '实际重量(kg)', '准确率'],
+            filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
+            tableDatas: this.tab.chart3.table.list,
+            sheetName: '牛群准确率'
+          }
+        ]
+        json2excel(excelDatasTabChart3, '牛群准确率', true, 'xlsx')
+      } else if (item == 'chart4') {
+        console.log('车辆准确率(重量)导出')
+        var excelDatasTabChart4 = [
+          {
+            tHeader: ['日期', '车次', '计划重量(kg)', '实际重量(kg)', '准确率'],
+            filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
+            tableDatas: this.tab.chart4.table.list,
+            sheetName: '车辆准确率(重量)'
+          }
+        ]
+        json2excel(excelDatasTabChart4, '车辆准确率(重量)', true, 'xlsx')
+      } else if (item == 'chart5') {
+        console.log('混料统计导出')
+        var excelDatasTabChart5 = [
+          {
+            tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
+            filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
+            tableDatas: this.tab.chart5.table.list,
+            sheetName: '混料统计'
+          }
+        ]
+        json2excel(excelDatasTabChart5, '混料统计', true, 'xlsx')
+      } else if (item == 'chart6') {
+        console.log('混料计划取消次数导出')
+        var excelDatasTabChart6 = [
+          {
+            tHeader: ['日期', '混料计划取消次数'],
+            filterVal: ['日期', 'field1'],
+            tableDatas: this.tab.chart6.table.list,
+            sheetName: '混料计划取消次数'
+          }
+        ]
+        json2excel(excelDatasTabChart6, '混料计划取消次数', true, 'xlsx')
+      } else if (item == 'chart7') {
+        console.log('栏舍撒料时间统计导出')
+        var excelDatasTabChart7 = [
+          {
+            tHeader: ['日期', '栏舍', '撒料时间'],
+            filterVal: ['日期', 'fname', '准确率'],
+            tableDatas: this.tab.chart7.table.list,
+            sheetName: '栏舍撒料时间统计'
+          }
+        ]
+        json2excel(excelDatasTabChart7, '栏舍撒料时间统计', true, 'xlsx')
+      }
+    },
+    // 切换表格
+    handleTable(item) {
+      // 显示切换表格
+      if (item == 'chart1') {
+        console.log('配方准确率表格')
+        this.tab.chart1.isTable = true
+        this.tab.chart1.isChart = false
+      } else if (item == 'chart2') {
+        console.log('计划统计表格')
+        this.tab.chart2.isTable = true
+        this.tab.chart2.isChart = false
+      } else if (item == 'chart3') {
+        console.log('牛群准确率表格')
+        this.tab.chart3.isTable = true
+        this.tab.chart3.isChart = false
+      } else if (item == 'chart4') {
+        console.log('车辆准确率(重量)表格')
+        this.tab.chart4.isTable = true
+        this.tab.chart4.isChart = false
+      } else if (item == 'chart5') {
+        console.log('混料统计表格')
+        this.tab.chart5.isTable = true
+        this.tab.chart5.isChart = false
+      } else if (item == 'chart6') {
+        console.log('混料计划取消次数表格')
+        this.tab.chart6.isTable = true
+        this.tab.chart6.isChart = false
+      } else if (item == 'chart7') {
+        console.log('栏舍撒料时间统计表格')
+        this.tab.chart7.isTable = true
+        this.tab.chart7.isChart = false
+      }
+    },
+    // 切换图表
+    handleChart(item) {
+      // 显示切换图表
+      if (item == 'chart1') {
+        console.log('配方准确率图表')
+        this.tab.chart1.isTable = false
+        this.tab.chart1.isChart = true
+        this.getChart1()
+      } else if (item == 'chart2') {
+        console.log('计划统计图表')
+        this.tab.chart2.isTable = false
+        this.tab.chart2.isChart = true
+        this.getChart2()
+      } else if (item == 'chart3') {
+        console.log('牛群准确率图表')
+        this.tab.chart3.isTable = false
+        this.tab.chart3.isChart = true
+        this.getChart3()
+      } else if (item == 'chart4') {
+        console.log('车辆准确率(重量)图表')
+        this.tab.chart4.isTable = false
+        this.tab.chart4.isChart = true
+        this.getChart4()
+      } else if (item == 'chart5') {
+        console.log('混料统计图表')
+        this.tab.chart5.isTable = false
+        this.tab.chart5.isChart = true
+        this.getChart5()
+      } else if (item == 'chart6') {
+        console.log('混料计划取消次数图表')
+        this.tab.chart6.isTable = false
+        this.tab.chart6.isChart = true
+        this.getChart6()
+      } else if (item == 'chart7') {
+        console.log('栏舍撒料时间统计图表')
+        this.tab.chart7.isTable = false
+        this.tab.chart7.isChart = true
+        this.getChart7()
+      }
+    },
+
+    // 混料统计
+    getTab2List() {
+      this.tab2.table.listLoading = true
+      GetDataByName(this.tab2.table.getdataListParm).then(response => {
+        console.log('混料统计table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab2.table.list = response.data.list
+          this.tab2.table.total = response.data.total
+        } else {
+          this.tab2.table.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch2() {
+      this.tab2.table.getdataListParm.name = 'getStatisticsHL'
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime)
+        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
+        this.tab2.table.getdataListParm.parammaps.startTime = ''
+        this.tab2.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.tab2.table.getdataListParm.offset = 1
+      this.getTab2List()
+    },
+    handleRefresh2() {
+      this.tab2.table.getdataListParm.parammaps.tmrtname = ''
+      this.tab2.table.getdataListParm.parammaps.projname = ''
+      this.tab2.table.getdataListParm.parammaps.times = ''
+      this.tab2.table.getdataListParm.parammaps.templetname = ''
+      this.tab2.table.getdataListParm.parammaps.buttontype = ''
+      this.getTab2List()
+    },
+    handleExport2() {
+      var excelDatasTab2 = [
+        {
+          tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', ' 跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          tableDatas: this.tab2.table.list,
+          sheetName: '混料统计'
+        }
+      ]
+      json2excel(excelDatasTab2, '混料统计', true, 'xlsx')
+    },
+    // 撒料统计
+    getTab3List() {
+      this.tab3.table.listLoading = true
+      GetDataByName(this.tab3.table.getdataListParm).then(response => {
+        console.log('撒料统计table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab3.table.list = response.data.list
+          this.tab3.table.total = response.data.total
+        } else {
+          this.tab3.table.list = []
+        }
+        setTimeout(() => {
+          this.tab3.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch3() {
+      this.tab3.table.getdataListParm.name = 'getStatisticsSL'
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
+        this.tab3.table.getdataListParm.parammaps.startTime = ''
+        this.tab3.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.tab3.table.getdataListParm.offset = 1
+      this.getTab3List()
+    },
+    handleRefresh3() {
+      this.tab3.table.getdataListParm.parammaps.tmrtname = ''
+      this.tab3.table.getdataListParm.parammaps.projname = ''
+      this.tab3.table.getdataListParm.parammaps.times = ''
+      this.tab3.table.getdataListParm.parammaps.templetname = ''
+      this.tab3.table.getdataListParm.parammaps.buttontype = ''
+      this.tab3.table.getdataListParm.parammaps.fname = ''
+      this.getTab3List()
+    },
+    handleExport3() {
+      var excelDatasTab3 = [
+        {
+          tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          tableDatas: this.tab3.table.list,
+          sheetName: '撒料统计'
+        }
+      ]
+      json2excel(excelDatasTab3, '撒料统计', true, 'xlsx')
+    },
+    handleSee(row) {
+      if (this.tab.radio == 1) {
+        this.titlefname = '准确性详情——配方名称:' + row.配方名称
+      } else if (this.tab.radio == 2) {
+        this.titlefname = '准确性详情——栏舍名称:' + row.栏舍名称
+      } else if (this.tab.radio == 3) {
+        this.titlefname = '准确性详情——牲畜类别:' + row.栏舍名称
+      } else if (this.tab.radio == 4) {
+        this.titlefname = '准确性详情——车次:' + row.车次
+      } else if (this.tab.radio == 5) {
+        this.titlefname = '准确性详情——TMR名称:' + row.TMR名称
+      }
+      console.log(row, 'row')
+      this.rowPid = row.pid
+      this.isShowDialog = true
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{
+    .el-radio{margin-right: 10px;}
+  }
+  .button{
+    height: 50px;
+    .exportTable{float: right;margin-right: 5px;}
+  }
+  .app-container1{padding-left: 10px;background-color: #F4F4F4;}
+  .dashboard-editor-container {
+    background-color: #F4F4F4;
+    .grid-content{
+      background-color:#fff;padding: 0 10px;
+      h4{text-align: center;line-height: 50px;}
+    }
+  }
+  .table{margin-bottom: 50px;}
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+</style>

+ 299 - 0
.svn/pristine/77/77960e2dc87e7e86eb6ff71142bf6cfb95f196d3.svn-base

@@ -0,0 +1,299 @@
+<template>
+  <div class="app-content">
+    <div class="search">
+      <el-select v-model="table.getdataListParm.parammaps.pastureid" placeholder="牧场" class="filter-item" style="width: 120px;">
+        <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
+      </el-select>
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
+      <el-button style="float: left;" :disabled="Beforedisabled" class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+      <el-button style="float: left;" :disabled="Nextdisabled" class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+      <el-input v-model="table.getdataListParm.parammaps.tmrtname" style="width: 110px;" placeholder="TMR名称" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.projname" style="width: 110px;" placeholder="车次" class="filter-item" clearable />
+      <el-select v-model="table.getdataListParm.parammaps.times" style="width: 100px;" filterable placeholder="班次" class="filter-item" clearable>
+        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-input v-model="table.getdataListParm.parammaps.templetname" style="width: 110px;" placeholder="配方名称" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.fname" style="width: 110px;" placeholder="栏舍名称" class="filter-item" clearable />
+      <el-select v-model="table.getdataListParm.parammaps.buttontype" style="width: 110px;" filterable placeholder="跳转方式" class="filter-item" clearable>
+        <el-option v-for="item in jumpModeList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-select v-model="table.getdataListParm.parammaps.isuse" style="width: 130px;" filterable placeholder="上传状态" class="filter-item" clearable>
+        <el-option v-for="item in isuseList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+      <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport">导出</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :height="myHeight2"
+      >
+        <el-table-column label="牧场" min-width="55px" align="center" prop="牧场" />
+        <el-table-column label="日期" min-width="55px" align="center" prop="日期" />
+        <el-table-column label="TMR名称" min-width="55px" align="center" prop="TMR名称" />
+        <el-table-column label="车次" min-width="55px" align="center" prop="车次" />
+        <el-table-column label="班次" min-width="55px" align="center" prop="班次" />
+        <el-table-column label="配方名称" min-width="55px" align="center" prop="配方名称" />
+        <el-table-column label="栏舍" min-width="55px" align="center" prop="栏舍" />
+        <el-table-column label="理论重量" min-width="55px" align="center" prop="理论重量" />
+        <el-table-column label="实际重量" min-width="55px" align="center" prop="实际重量" />
+        <el-table-column label="误差值" min-width="55px" align="center" prop="误差值" />
+        <el-table-column label="准确率" min-width="55px" align="center" prop="准确率" />
+        <el-table-column label="开始时间" min-width="55px" align="center" prop="开始时间" />
+        <el-table-column label="结束时间" min-width="55px" align="center" prop="结束时间" />
+        <!-- <el-table-column label="搅拌时间" min-width="70px" align="center" prop="搅拌时间" /> -->
+        <el-table-column label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+        <el-table-column label="开始重量" min-width="55px" align="center" prop="开始重量" />
+        <el-table-column label="结束重量" min-width="55px" align="center" prop="结束重量" />
+      </el-table>
+      <!-- <pagination v-show="tab3.table.total>=0" :total="tab3.table.total" :page.sync="tab3.table.getdataListParm.offset" :limit.sync="tab3.table.getdataListParm.pagecount" @pagination="getTab3List" /> -->
+    </div>
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts'
+
+require('echarts/theme/macarons')
+import { GetDataByName, GetReportform, GetDataByNames } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'Tab2',
+  components: { Pagination },
+  data() {
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      pickerMinDate: '',
+      pickerOptions: {
+        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()
+        }
+      },
+      requestParams: [
+        { name: 'getPastureListJT', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), pasturename: '' }}
+      ],
+      pastureList: [], // 牧场
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }],
+      frequencyList: [],
+      isuseList: [{ id: '0', name: '未完成' }, { id: '2', name: '部分完成' }, { id: '1', name: '全部完成' }],
+      table: {
+        getdataListParm: {
+          name: 'getStatisticsSL',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+            stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+            inputDatetime: [new Date(), new Date()],
+            tmrtname: '',
+            projname: '',
+            times: '',
+            templetname: '',
+            fname: '',
+            buttontype: '',
+            isuse: ''
+          }
+        },
+        tableKey: 1,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2:document.documentElement.clientHeight - 85-210
+    }
+  },
+  create() {
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  activated() {
+    this.getTimeFn()
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  methods: {
+    getTimeFn() {
+      const that = this
+      const start = new Date()
+      const end = new Date()
+      const start2 = new Date()
+      const end2 = new Date()
+      start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+      end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+      that.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
+      that.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
+      that.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        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: '第四班' }]
+        }
+      })
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.pastureList = response.data.getPastureListJT.list
+        this.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
+        this.getList()
+      })
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('撒料统计table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      this.table.getdataListParm.name = 'getStatisticsSL'
+      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() {
+      this.table.getdataListParm.parammaps.tmrtname = ''
+      this.table.getdataListParm.parammaps.projname = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.templetname = ''
+      this.table.getdataListParm.parammaps.buttontype = ''
+      this.table.getdataListParm.parammaps.fname = ''
+      this.getList()
+    },
+    handleExport() {
+      var excelDatasTab3 = [
+        {
+          tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量', '搅拌时间'],
+          tableDatas: this.tab3.table.list,
+          sheetName: '撒料统计'
+        }
+      ]
+      json2excel(excelDatasTab3, '撒料统计', true, 'xlsx')
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getList()
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getList()
+    }
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+</style>

+ 256 - 0
.svn/pristine/7a/7a9bb26abe982b6c972f274cc4cfb4f57e3b8e53.svn-base

@@ -0,0 +1,256 @@
+import request from '@/utils/request'
+import parseTime from '@/utils/index.js'
+
+export function GetDataByName(data) {
+  return request({
+    url: '/authdata/GetDataByName',
+    method: 'post',
+    data
+  })
+}
+
+export function GETNurJudge(data) {
+  return request({
+    url: '/authdata/GETNurJudge',
+    method: 'post',
+    data
+  })
+}
+
+export function GETNurJudgeRport(data) {
+  return request({
+    url: '/authdata/GETNurJudgeRport',
+    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',
+    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 GetArrList(data) {
+  return request({
+    url: '/authdata/GetArrList',
+    method: 'post',
+    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 compareSort(property){
+  return function(a,b){
+    var value1 = a[property];
+    var value2 = b[property];
+    return value1 - value2;
+  }
+}

+ 1504 - 0
.svn/pristine/7c/7cce6ff958df28fb88e791d72242236e13684133.svn-base

@@ -0,0 +1,1504 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-input v-model="table.getdataListParm.parammaps.fname" placeholder="饲料名称" style="width: 130px;" class="filter-item" clearable />
+      <el-select v-model="table.getdataListParm.parammaps.fclassid" filterable placeholder="饲料类别" class="filter-item" style="width: 150px;" clearable>
+        <el-option v-for="item in feedTypeList" :key="item.id" :label="item.mixname" :value="item.id" />
+      </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 feedSourcesList" :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 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="table.getdataListParm.parammaps.allowratio"type="text" style="width: 245px;" /></li>
+          <li><a>跳转重量域</a><el-input v-model="table.getdataListParm.parammaps.autozone" type="text" style="width: 245px;" /></li>
+          <li>
+            <a>跳转延时</a>
+            <el-select v-model="table.getdataListParm.parammaps.autosecond" filterable placeholder="跳转延时" class="filter-item" style="width: 245px;" clearable>
+              <el-option v-for="item in jumpDelayList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </li>
+          <li>
+            <div style="float: right;">
+              <el-button class="downminCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
+              <el-button class="miniPrimary" @click="handleSearch">搜索</el-button>
+            </div>
+          </li>
+        </ul>
+      </div>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
+      <el-button class="success" icon="el-icon-receiving" @click="handleFeedBank">饲料库</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" fixed="left" />
+        <el-table-column label="序号" align="center" type="index" width="50px" fixed="left">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="饲料名称" min-width="80px" align="center" fixed="left">
+          <template slot-scope="scope">
+            <span>{{ scope.row.fname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="饲料分类" min-width="80px" align="center" fixed="left">
+          <template slot-scope="scope">
+            <span>{{ scope.row.fclass }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="唯一编码" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.feedcode }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="饲料来源" min-width="80px" 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.printgroup }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column v-if="isInforvalue" label="小料秤" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.smtmrname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="允许误差数(kg)" min-width="85px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.allowratio }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="包装单位重量(kg)" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.unitweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="单价" min-width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.uprice }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="跳转重量域(kg)" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.autozone }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="跳转延时" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.autosecondname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="确认开始" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.confirmstartname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="继电器位置" min-width="60px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.trgaddress }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="无上域" min-width="60px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.jmp == 0">否</span>
+            <span v-else>是</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="备用字段01" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.backup1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="备用字段02" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.backup2 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="备用字段03" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.backup3 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="是否启用" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <a class="correcting" @click="handleNutritive (row)">营养价值</a>
+            <span class="centerSpan">|</span>
+            <a v-if="isRoleEdit" class="correcting" @click="handleRelation(row)">关联</a>
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" icon="el-icon-delete" class="miniDanger" @click="handleRowDelete(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 160px;text-align: right;">基础信息</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="饲料名称:" prop="fname">
+                <el-input ref="fname" v-model="create.temp.fname" class="filter-item" placeholder="请输入饲料名称" type="textarea" :autosize="{ minRows:1}" maxlength="32" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="饲料类别:" prop="fclassid">
+                <el-select v-model="create.temp.fclassid" filterable placeholder="饲料类别" class="filter-item" style="width: 100%;" @change="changeFeedList">
+                  <el-option v-for="item in feedTypeList" :key="item.id" :label="item.mixname" :value="item.id" />
+                </el-select>
+
+              </el-form-item></el-col>
+            <el-col :span="6">
+              <el-form-item label="唯一编码:" prop="feedcode">
+                <el-input ref="feedcode" v-model="create.temp.feedcode" class="filter-item" placeholder="请输入唯一编码" type="text" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="饲料来源:" prop="source">
+                <el-input ref="source" v-model="create.temp.source" class="filter-item" disabled placeholder="用户自定义" type="text" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="计划类型:" prop="printgroupid">
+                <el-select v-model="create.temp.printgroupid" filterable placeholder="计划类型" class="filter-item" style="width: 100%;" @change="changePlanList">
+                  <el-option v-for="item in planTypeList" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="包装单位重量(kg):" prop="unitweight">
+                <el-input ref="unitweight" v-model="create.temp.unitweight" class="filter-item" placeholder="正整数" type="number" style="width: 100%;" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="单价:" prop="uprice">
+                <el-input ref="uprice" v-model="create.temp.uprice" v-limit class="filter-item" placeholder="最多俩位小数" type="number" step="0.01" style="width: 100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 160px;text-align: right;">搅拌参数</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="允许误差数(kg):" prop="allowratio">
+                <el-input ref="allowratio" v-model="create.temp.allowratio" class="filter-item" placeholder="正整数" type="text" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="跳转重量域(kg):" prop="autozone">
+                <el-input ref="autozone" v-model="create.temp.autozone" :disabled="create.temp.autosecond=='0'" class="filter-item" placeholder="0-50之间的整数" type="text" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="跳转延时:" prop="autosecond">
+                <el-select v-model="create.temp.autosecond" filterable placeholder="跳转延时" class="filter-item" style="width: 100%;" @change="changeAutosecond">
+                  <el-option v-for="item in jumpDelayList" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="确认开始:" prop="confirmstart">
+                <el-select v-model="create.temp.confirmstart" filterabler placeholde="确认开始" class="filter-item" style="width: 100%;" @change="changeConfirmstart">
+                  <el-option v-for="item in confirmStartList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="是否启用:" prop="enable">
+                <el-select v-model="create.temp.enable" filterable placeholder="是否启用" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="继电器位置:" prop="trgaddress">
+                <el-input ref="trgaddress" v-model="create.temp.trgaddress" class="filter-item" placeholder="继电器位置" type="number" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="isInforvalue" :span="6">
+              <el-form-item label="小料秤:" prop="smtmrid">
+                <el-select v-model="create.temp.smtmrid" filterable placeholder="小料秤" clearable class="filter-item" style="width: 100%;" @change="changeSmallMaterial">
+                  <el-option v-for="item in smallMaterialList" :key="item.id" :label="item.tname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="无上域:" prop="jmp">
+                <el-select v-model="create.temp.jmp" placeholder="无上域" class="filter-item" style="width: 100%;" @change="changeSmallMaterial">
+                  <el-option v-for="item in jmpList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <h3 style="width: 160px;text-align: right;">备用字段</h3>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="备用字段01:" prop="backup1">
+                <el-input ref="backup1" v-model="create.temp.backup1" class="filter-item" placeholder="备用字段01" type="text" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="备用字段02:" prop="backup2">
+                <el-input ref="backup2" v-model="create.temp.backup2" class="filter-item" placeholder="备用字段02" type="text" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="备用字段03:" prop="backup3">
+                <el-input ref="backup3" v-model="create.temp.backup3" class="filter-item" placeholder="备用字段03" type="text" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 饲料库 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="feedBank.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[feedBank.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <div class="search">
+          <el-input v-model="feedBank.getdataListParm.parammaps.fname" placeholder="饲料名称" style="width: 130px;" class="filter-item" clearable />
+          <el-select v-model="feedBank.getdataListParm.parammaps.statue" filterabler placeholder="关联状态" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in associationStatusList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-button class="successBorder" @click="handleFeedBankSearch">查询</el-button>
+          <el-button class="successBorder" @click="handleFeedBankRefresh">重置</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="feedBank.tableKey"
+            v-loading="feedBank.listLoading"
+            element-loading-text="给我一点时间"
+            :data="feedBank.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;margin: 0 auto 50px;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column label="序号" align="center" type="index" width="50px" />
+            <el-table-column label="来源" min-width="50" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.sources }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="中国饲料号" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.feedcode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="饲料名称" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.fname }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="价格" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.price }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="样品说明" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.remark }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="干物质(DM%)" min-width="65px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.dry }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="淀粉(%DM)" min-width="59px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.starch }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="粗蛋白(CP%DM)" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.cp }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="钙(Ca%DM)" min-width="85px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ca }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="磷(P%DM)" min-width="85px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.p }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="产奶净能(%DM)" min-width="75px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.n }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="脂肪(%DM)" min-width="59px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.fat }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="ADF(%DM)" min-width="60px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.adf }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="NDF(%DM)" min-width="60px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ndf }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="NDIP%" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ndip }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="粗灰分(Ash%)" min-width="65px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ash }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="粗料" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.iscu }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="关联状态" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.statue==0">否</span>
+                <span v-if="scope.row.statue==1">是</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="feedBank.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 关联 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="relation.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[relation.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <div class="search">
+          <el-input v-model="relation.getdataListParm.parammaps.fname" placeholder="饲料名称" style="width: 130px;" class="filter-item" clearable />
+          <el-button class="successBorder" @click="handleRelationSearch">查询</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="relation.tableKey"
+            v-loading="relation.listLoading"
+            element-loading-text="给我一点时间"
+            :data="relation.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;margin: 0 auto 50px;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column label="序号" align="center" type="index" width="50px" />
+            <el-table-column label="来源" min-width="50" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.sources }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="中国饲料号" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.feedcode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="饲料名称" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.fname }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="价格" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.price }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="样品说明" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.remark }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="干物质(DM%)" min-width="65px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.dry }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="淀粉(%DM)" min-width="59px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.starch }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="粗蛋白(CP%DM)" min-width="75px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.cp }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="钙(Ca%DM)" min-width="83px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ca }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="磷(P%DM)" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.p }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="产奶净能(%DM)" min-width="75px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.n }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="脂肪(%DM)" min-width="59px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.fat }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="ADF(%DM)" min-width="60px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.adf }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="NDF(%DM)" min-width="60px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ndf }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="NDIP%" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ndip }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="粗灰分(Ash%)" min-width="65px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.ash }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="粗料" min-width="50px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.iscu }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" min-width="50px" align="center" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <a v-if="row.statueRelation == '1'" class="correcting" :disabled="isokDisable" @click="disassociateData(row)">取消关联</a>
+                <a v-if="row.statueRelation == '0'" class="correcting" :disabled="isokDisable" @click="relationData(row)">关联</a>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="relation.dialogFormVisible = false;getList() ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 营养价值 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="nutritive.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[nutritive.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="nutritive.rules" :model="nutritive.temp" label-position="right" label-width="160px" style="width: 100%;margin:0 auto 50px">
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="干物质(DM%):" prop="dry">
+                <el-input ref="dry" v-model="nutritive.temp.dry" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入干物质" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="淀粉(%DM):" prop="starch">
+                <el-input ref="starch" v-model="nutritive.temp.starch" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入淀粉" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="粗蛋白(CP%DM):" prop="cp">
+                <el-input ref="cp" v-model="nutritive.temp.cp" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入粗蛋白" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="钙(Ca%DM):" prop="ca">
+                <el-input ref="ca" v-model="nutritive.temp.ca" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入钙" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="磷(P%DM):" prop="p">
+                <el-input ref="p" v-model="nutritive.temp.p" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入磷" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="产奶净能(%DM):" prop="n">
+                <el-input ref="n" v-model="nutritive.temp.n" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入产奶净能" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="脂肪(%DM):" prop="fat">
+                <el-input ref="fat" v-model="nutritive.temp.fat" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入脂肪" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="ADF(%DM):" prop="adf">
+                <el-input ref="adf" v-model="nutritive.temp.adf" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入ADF" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="NDF(%DM):" prop="ndf">
+                <el-input ref="ndf" v-model="nutritive.temp.ndf" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入NDF" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="NDIP(%):" prop="ndip">
+                <el-input ref="ndip" v-model="nutritive.temp.ndip" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入NDIP" type="number" step="0.01" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="粗灰分(Ash%):" prop="ash">
+                <el-input ref="ash" v-model="nutritive.temp.ash" v-limit :disabled="isRoleEdit==false" class="filter-item" placeholder="请输入粗灰分" type="number" min="0.00" step="0.01" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="nutritive.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="nutritive.dialogStatus==='nutritive' && isRoleEdit" class="save" :disabled="isokDisable" @click="nutritiveData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'FeedTable',
+  components: { Pagination },
+  directives: {
+    limit: {
+      // 指令的定义
+      update: function(el) {
+        el.onkeypress = function(e) {
+          var code = e.charCode
+          if (code != 0) {
+            if (!String.fromCharCode(code).match(/[0-9\.]/)) {
+              return false
+            }
+          }
+        }
+        el.addEventListener('textInput', function(e) {
+          e.target.value = e.target.value.replace(/[^0-9\.]/g, '')
+        })
+        el.onkeyup = function(e) {
+          e.target.value = e.target.value.replace(/[^0-9\.]/g, '')
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      dialogFull: false,
+      isInforvalue: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] },
+        { name: 'getFeedclassByBig', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['计划类型'] },
+        { name: 'getTMRListEnableTypeFeed', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '4' }}
+      ],
+      requestParams2: {
+        name: 'getSysoptEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), inforname: 'isSmallMaterial' }
+      },
+      enableList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用
+      feedSourcesList: [{ id: '0', name: '系统内置' }, { id: '1', name: '用户自定义' }], // 饲料来源
+      confirmStartList: [{ id: '0', name: '禁用' }, { id: '1', name: '启用' }], // 确认开始
+      associationStatusList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 关联状态
+      jumpDelayList: [], // 跳转延时
+      feedTypeList: [], // 饲料分类
+      planTypeList: [], // 计划类型
+      smallMaterialList: [], // 小料秤
+      jmpList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 无上域
+      table: {
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        getdataListParm: {
+          name: 'getFeedList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            fname: '',
+            fclassid: '',
+            source: '',
+            autozone: '',
+            autosecond: '',
+            allowratio: '',
+            printgroup: '',
+            enable: ''
+          }
+        }
+      },
+
+      // 多项搜索显示隐藏
+      arrowDown: true,
+      arrowUp: false,
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '' },
+        rules: {
+          fname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          fclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          feedcode: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        }
+      },
+
+      // 饲料库
+      feedBank: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {},
+        rules: {},
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        getdataListParm: {
+          name: 'getFeednurList',
+          page: 1,
+          offset: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            fname: '',
+            statue: ''
+          }
+        }
+      },
+      // 关联
+      relation: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {},
+        rules: {},
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        getdataListParm: {
+          name: 'getFeednurRelation',
+          page: 1,
+          offset: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            fname: ''
+          }
+        }
+      },
+
+      // 营养价值
+      nutritive: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {},
+        rules: {}
+      },
+
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        feedBank: '饲料库',
+        relation: '关联',
+        nutritive: '营养价值'
+      },
+
+      isokDisable: false,
+      selectList: [],
+      requestParam: {},
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+
+    }
+  },
+  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
+        }
+      }
+    })
+  },
+  created() {
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+    this.getInforvalueList()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'FeedTable'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+
+    getInforvalueList() {
+      GetDataByName(this.requestParams2).then(response => {
+        if (response.data !== null) {
+          if (response.data.list[0].inforvalue == 0) {
+            this.isInforvalue = false
+          } else {
+            this.isInforvalue = true
+          }
+        } else {
+          this.isInforvalue = false
+        }
+      })
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.jumpDelayList = response.data.getDictByName.list
+        this.feedTypeList = response.data.getFeedclassByBig.list
+        this.planTypeList = response.data.getDictByName2.list
+        this.smallMaterialList = response.data.getTMRListEnableTypeFeed.list
+      })
+    },
+
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+      this.arrowDown = true
+      this.arrowUp = false
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.fname = ''
+      this.table.getdataListParm.parammaps.fclassid = ''
+      this.table.getdataListParm.parammaps.source = ''
+      this.table.getdataListParm.parammaps.autozone = ''
+      this.table.getdataListParm.parammaps.autosecond = ''
+      this.table.getdataListParm.parammaps.allowratio = ''
+      this.table.getdataListParm.parammaps.printgroup = ''
+      this.table.getdataListParm.parammaps.enable = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '', jmp: '0' }
+    },
+    // 计划类型
+    changePlanList(item) {
+      console.log(item,'======')
+      this.create.temp.printgroup = this.planTypeList.find(obj => obj.value === item).label
+    },
+    // 饲料类型
+    changeFeedList(item) {
+      this.create.temp.fclass = this.feedTypeList.find(obj => obj.id === item).mixname
+    },
+    // 跳转延时
+    changeAutosecond(item) {
+      this.create.temp.autosecondname = this.jumpDelayList.find(obj => obj.value === item).label
+    },
+    // 确认开始
+    changeConfirmstart(item) {
+      this.create.temp.confirmstartname = this.confirmStartList.find(obj => obj.id === item).name
+    },
+    changeSmallMaterial(item) {
+      if (item !== '') {
+        this.create.temp.smtmrname = this.smallMaterialList.find(obj => obj.id === item).tname
+      } else {
+        this.create.temp.smtmrname = ''
+      }
+    },
+    // 新增
+    handleCreate() {
+      console.log('点击了新增')
+      this.resetTemp()
+      this.dialogFull = false
+      this.create.dialogStatus = 'create'
+      this.create.dialogFormVisible = true
+    },
+    createData() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          const unitweight = /^[1-9]\d*$/
+          if (this.create.temp.unitweight !== '') {
+            if (!unitweight.test(parseFloat(this.create.temp.unitweight))) {
+              this.$message({ type: 'error', message: '包装单位重量请输入正整数', duration: 2000 })
+              return false
+            }
+          }
+          const uprice = /^\d+(\.\d{1,2})?$/
+          if (this.create.temp.uprice !== '') {
+            if (!uprice.test(parseFloat(this.create.temp.uprice))) {
+              this.$message({ type: 'error', message: '单价请保留两位小数', duration: 2000 })
+              return false
+            }
+          }
+          if (this.create.temp.autozone !== '') {
+            const autozone = /^([0-9]|(1[0-9]|2[0-9]|3[0-9]|4[0-9]|(50)))$/
+            if (!autozone.test(parseFloat(this.create.temp.autozone))) {
+              this.$message({ type: 'error', message: '跳转重量域请输入大于等于0小于等于50的整数', duration: 2000 })
+              return false
+            }
+          } else {
+            this.create.temp.autozone = '0'
+          }
+          if (this.create.temp.trgaddress.length > 8) {
+            this.$message({ type: 'error', message: '继电器位置请输入1-8位数字', duration: 2000 })
+            return false
+          }
+          const allowratio = /^[0-9]\d*$/
+          if (this.create.temp.allowratio !== '') {
+            if (!allowratio.test(parseFloat(this.create.temp.allowratio))) {
+              this.$message({ type: 'error', message: '允许误差数请输入大于等于0的整数', duration: 2000 })
+              return false
+            }
+          }
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          this.requestParam.name = 'insertFeed'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.allowratio == '') { this.create.temp.allowratio = '0' }
+          if (this.create.temp.uprice == '') { this.create.temp.uprice = '0' }
+          if (this.create.temp.unitweight == '') { this.create.temp.unitweight = '0' }
+          if (this.create.temp.autozone == '') { this.create.temp.autozone = '0' }
+          if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.create.dialogFormVisible = false
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
+              if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
+              if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
+              if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
+              if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
+            }
+          })
+        }
+      })
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log('点击了编辑', row)
+      this.create.dialogStatus = 'update'
+      this.dialogFull = false
+      this.create.dialogFormVisible = true
+      row.fclassid = String(row.fclassid)
+      row.printgroupid = String(row.printgroupid)
+      row.autosecond = String(row.autosecond)
+      row.confirmstart = String(row.confirmstart)
+      row.enable = String(row.enable)
+      row.jmp = String(row.jmp)
+      if (row.printgroupid !== '') {
+        row.printgroup = this.planTypeList.find(obj => obj.value == row.printgroupid).label
+      }
+
+      this.create.temp = Object.assign({}, row)
+      if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
+      if (this.create.temp.uprice == '0.00') { this.create.temp.uprice = '' }
+      if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
+      if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
+      if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
+      if (this.create.temp.smtmrid == '-1') { this.create.temp.smtmrid = '' }
+      console.log(row,'=====')
+    },
+    updateData() {
+      console.log('点击了编辑保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          const unitweight = /^[1-9]\d*$/
+          if (this.create.temp.unitweight !== '') {
+            if (!unitweight.test(parseFloat(this.create.temp.unitweight))) {
+              this.$message({ type: 'error', message: '包装单位重量请输入正整数', duration: 2000 })
+              return false
+            }
+          }
+          const uprice = /^\d+(\.\d{1,2})?$/
+          if (this.create.temp.uprice !== '') {
+            if (!uprice.test(parseFloat(this.create.temp.uprice))) {
+              this.$message({ type: 'error', message: '单价请保留两位小数', duration: 2000 })
+              return false
+            }
+          }
+          if (this.create.temp.autozone !== '') {
+            const autozone = /^([0-9]|(1[0-9]|2[0-9]|3[0-9]|4[0-9]|(50)))$/
+            if (!autozone.test(parseFloat(this.create.temp.autozone))) {
+              this.$message({ type: 'error', message: '跳转重量域请输入大于等于0小于等于50的整数', duration: 2000 })
+              return false
+            }
+          } else {
+            this.create.temp.autozone = '0'
+          }
+
+          if (this.create.temp.trgaddress.length > 8) {
+            this.$message({ type: 'error', message: '继电器位置请输入1-8位数字', duration: 2000 })
+            return false
+          }
+          const allowratio = /^[0-9]\d*$/
+          if (this.create.temp.allowratio !== '') {
+            if (!allowratio.test(parseFloat(this.create.temp.allowratio))) {
+              this.$message({ type: 'error', message: '允许误差数请输入大于等于0的整数', duration: 2000 })
+              return false
+            }
+          }
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          this.requestParam.name = 'updateFeed'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.allowratio == '') { this.create.temp.allowratio = '0' }
+          if (this.create.temp.uprice == '') { this.create.temp.uprice = '0' }
+          if (this.create.temp.unitweight == '') { this.create.temp.unitweight = '0' }
+          if (this.create.temp.autozone == '') { this.create.temp.autozone = '0' }
+          if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
+
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.create.dialogFormVisible = false
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
+              if (this.create.temp.uprice == '0') { this.create.temp.uprice = '' }
+              if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
+              if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
+              if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
+            }
+          })
+        }
+      })
+    },
+
+    // 饲料库
+    handleFeedBank() {
+      console.log('点击了饲料库')
+      this.dialogFull = false
+      this.feedBank.dialogStatus = 'feedBank'
+      this.feedBank.dialogFormVisible = true
+      this.getFeedBankList()
+    },
+    getFeedBankList() {
+      this.feedBank.listLoading = true
+      GetDataByName(this.feedBank.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.feedBank.list = response.data.list
+          this.feedBank.pageNum = response.data.pageNum
+          this.feedBank.pageSize = response.data.pageSize
+          this.feedBank.total = response.data.total
+        } else {
+          this.feedBank.list = []
+        }
+        setTimeout(() => {
+          this.feedBank.listLoading = false
+        }, 100)
+      })
+    },
+    handleFeedBankSearch() {
+      console.log('点击了饲料库搜索')
+      this.getFeedBankList()
+      this.feedBank.getdataListParm.offset = 1
+    },
+    handleFeedBankRefresh() {
+      console.log('点击了饲料库重置')
+      this.feedBank.getdataListParm.parammaps.fname = ''
+      this.feedBank.getdataListParm.parammaps.statue = ''
+      this.getFeedBankList()
+    },
+
+    // 关联
+    handleRelation(row) {
+      console.log('点击了关联')
+      this.dialogFull = false
+      this.relation.dialogStatus = 'relation'
+      this.relation.dialogFormVisible = true
+      this.relation.temp = Object.assign({}, row)
+      this.relation.getdataListParm.parammaps.fid = this.relation.temp.id
+      this.getRelationList()
+    },
+    getRelationList() {
+      this.relation.listLoading = true
+      GetDataByName(this.relation.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.relation.list = response.data.list
+          this.relation.pageNum = response.data.pageNum
+          this.relation.pageSize = response.data.pageSize
+          this.relation.total = response.data.total
+        } else {
+          this.relation.list = []
+        }
+        setTimeout(() => {
+          this.relation.listLoading = false
+        }, 100)
+      })
+    },
+    handleRelationSearch() {
+      console.log('点击了关联搜索')
+      this.relation.getdataListParm.offset = 1
+      this.getRelationList()
+    },
+    disassociateData(row) {
+      console.log('点击了取消关联')
+      MessageBox.confirm('是否确认取消关联?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.isokDisable = true
+        setTimeout(() => {
+          this.isokDisable = false
+        }, 1000)
+        this.requestParam.name = 'updateFeedrelation'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = this.relation.temp.pastureid
+        this.requestParam.parammaps.fid = this.relation.temp.id
+        this.requestParam.parammaps.id = row.id
+        PostDataByName(this.requestParam).then(response => {
+          console.log('取消关联保存发送参数', this.requestParam)
+          if (response.msg !== 'fail') {
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.getRelationList()
+            this.getList()
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消' })
+      })
+    },
+    relationData(row) {
+      console.log('点击了关联保存')
+      MessageBox.confirm('是否确认关联?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.isokDisable = true
+        setTimeout(() => {
+          this.isokDisable = false
+        }, 1000)
+        this.requestParam.name = 'insertFeednur'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = this.relation.temp.pastureid
+        this.requestParam.parammaps.fid = this.relation.temp.id
+        this.requestParam.parammaps.fname = this.relation.temp.fname
+        this.requestParam.parammaps.feedcode = this.relation.temp.feedcode
+        this.requestParam.parammaps.price = row.price
+        this.requestParam.parammaps.remark = row.remark
+        this.requestParam.parammaps.dry = row.dry
+        this.requestParam.parammaps.starch = row.starch
+        this.requestParam.parammaps.cp = row.cp
+        this.requestParam.parammaps.ca = row.ca
+        this.requestParam.parammaps.p = row.p
+        this.requestParam.parammaps.n = row.n
+        this.requestParam.parammaps.fat = row.fat
+        this.requestParam.parammaps.adf = row.adf
+        this.requestParam.parammaps.ndf = row.ndf
+        this.requestParam.parammaps.ndip = row.ndip
+        this.requestParam.parammaps.ash = row.ash
+        this.requestParam.parammaps.fpercent = row.fpercent
+        this.requestParam.parammaps.iscu = row.iscu
+        this.requestParam.parammaps.feednurid = row.id
+        PostDataByName(this.requestParam).then(response => {
+          console.log('关联保存发送参数', this.requestParam)
+          if (response.msg !== 'fail') {
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.getRelationList()
+            this.getList()
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消' })
+      })
+    },
+    // 营养价值
+    handleNutritive(row) {
+      console.log('点击了营养价值', row)
+      this.dialogFull = false
+      this.nutritive.dialogStatus = 'nutritive'
+      this.nutritive.dialogFormVisible = true
+      this.nutritive.temp = Object.assign({}, row)
+    },
+    nutritiveData() {
+      console.log('点击了营养价值保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      if (this.nutritive.temp.dry == undefined) { this.$set(this.nutritive.temp, 'dry', '') }
+      if (this.nutritive.temp.starch == undefined) { this.$set(this.nutritive.temp, 'starch', '') }
+      if (this.nutritive.temp.cp == undefined) { this.$set(this.nutritive.temp, 'cp', '') }
+      if (this.nutritive.temp.ca == undefined) { this.$set(this.nutritive.temp, 'ca', '') }
+      if (this.nutritive.temp.p == undefined) { this.$set(this.nutritive.temp, 'p', '') }
+      if (this.nutritive.temp.n == undefined) { this.$set(this.nutritive.temp, 'n', '') }
+      if (this.nutritive.temp.fat == undefined) { this.$set(this.nutritive.temp, 'fat', '') }
+      if (this.nutritive.temp.adf == undefined) { this.$set(this.nutritive.temp, 'adf', '') }
+      if (this.nutritive.temp.ndf == undefined) { this.$set(this.nutritive.temp, 'ndf', '') }
+      if (this.nutritive.temp.ndip == undefined) { this.$set(this.nutritive.temp, 'ndip', '') }
+      if (this.nutritive.temp.ash == undefined) { this.$set(this.nutritive.temp, 'ash', '') }
+      var positiveNumber = /^\d+(\.\d{1,2})?$/
+      if (this.nutritive.temp.dry !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.dry))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+      console.log(this.nutritive.temp.starch)
+      if (this.nutritive.temp.starch !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.starch))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.cp !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.cp))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.ca !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.ca))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.p !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.p))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.n !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.n))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.fat !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.fat))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.adf !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.adf))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.ndf !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.ndf))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.ndip !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.ndip))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+
+      if (this.nutritive.temp.ash !== '') {
+        if (!positiveNumber.test(parseFloat(this.nutritive.temp.ash))) {
+          this.$message({ type: 'error', message: '请输入自然数,最多保留俩位小数', duration: 2000 })
+          return false
+        }
+      }
+      this.requestParam.name = 'insertFeednur'
+      this.requestParam.parammaps = {}
+      this.requestParam.parammaps.pastureid = this.nutritive.temp.pastureid
+      this.requestParam.parammaps.fid = this.nutritive.temp.id
+      this.requestParam.parammaps.fname = this.nutritive.temp.fname
+      this.requestParam.parammaps.feedcode = this.nutritive.temp.feedcode
+      this.requestParam.parammaps.price = this.nutritive.temp.uprice
+      this.requestParam.parammaps.remark = this.nutritive.temp.remark
+      this.requestParam.parammaps.dry = this.nutritive.temp.dry
+      this.requestParam.parammaps.starch = this.nutritive.temp.starch
+      this.requestParam.parammaps.cp = this.nutritive.temp.cp
+      this.requestParam.parammaps.ca = this.nutritive.temp.ca
+      this.requestParam.parammaps.p = this.nutritive.temp.p
+      this.requestParam.parammaps.n = this.nutritive.temp.n
+      this.requestParam.parammaps.fat = this.nutritive.temp.fat
+      this.requestParam.parammaps.adf = this.nutritive.temp.adf
+      this.requestParam.parammaps.ndf = this.nutritive.temp.ndf
+      this.requestParam.parammaps.ndip = this.nutritive.temp.ndip
+      this.requestParam.parammaps.ash = this.nutritive.temp.ash
+      this.requestParam.parammaps.fpercent = this.nutritive.temp.fpercent
+      this.requestParam.parammaps.iscu = this.nutritive.temp.iscu
+      this.requestParam.parammaps.feednurid = '-1'
+      PostDataByName(this.requestParam).then(response => {
+        console.log('关联保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.nutritive.dialogFormVisible = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+
+    // 行内删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
+        this.requestParam.data[0] = { 'name': 'checkDeleteFeed', 'type': 'v', 'parammaps': {
+          'pastureid': row.pastureid,
+          'id': row.id
+        }}
+        this.requestParam.data[1] = { 'name': 'deleteFeed', 'type': 'e', 'parammaps': {
+          'pastureid': row.pastureid,
+          'id': row.id
+        }}
+        ExecDataByConfig(this.requestParam).then(response => {
+          console.log('删除保存发送参数', this.requestParam)
+          if (response.msg === 'fail') {
+            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+            this.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+    handleSelectionChange(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    // 多项删除
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择饲料表信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.requestParam = {}
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'checkDeleteFeed', 'type': 'v', 'parammaps': {
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          this.requestParam.data[0].children[1] = { 'name': 'deleteFeed', '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()
+            }
+          })
+        })
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{margin-top:10px;}
+  .table{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{
+      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;}
+      }
+    }
+  }
+ </style>

+ 1803 - 0
.svn/pristine/85/85060546f5129e1c3c01a5bc9feb2f362c802848.svn-base

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

+ 407 - 0
.svn/pristine/90/9040769de5b70456c102d5c1d0235f2663820f8a.svn-base

@@ -0,0 +1,407 @@
+<template>
+
+  <el-row :gutter="5" style="margin-top:5px;margin-left:5px;">
+    <el-col :span="5">
+      <el-card class="box-card">
+        <div slot="header" class="clearfix" style="text-align: right; ">
+          <el-row :gutter="2" style="margin-top:5px; margin-left:5px;">
+            <el-col :span="12" style="text-align: left; vertical-align:middle; font-size: 20px">  <span>字典分类 </span></el-col>
+            <el-col :span="6"> <el-col :span="6">  <el-button type="warning" icon="el-icon-edit-outline" size="mini" @click="jump" /></el-col>
+            </el-col>
+            <el-col :span="6">  <el-button type="primary" icon="el-icon-refresh" size="mini" /></el-col>
+          </el-row>
+        </div>
+        <div class="component-item">
+          <el-tree
+            ref="tree"
+            class="filter-tree"
+            :data="parent"
+            :props="defaultProps"
+            default-expand-all
+            @node-click="handleNodeClick"
+          />
+        </div>
+      </el-card>
+    </el-col>
+    <el-col :span="19">
+      <div class="app-container">
+        <div class="filter-container">
+          <el-button class="success" style="margin-left: 10px;" icon="el-icon-plus" @click="handleCreate"> 新增 </el-button>
+        </div>
+        <el-table
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable"
+          row-key="id"
+          default-expand-all
+          :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+        >
+          <el-table-column label="名称" header-align="center" width="150px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.label }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="值" min-width="150px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.value }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="顺序" min-width="150px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.orderby }}</span>
+            </template>
+          </el-table-column>
+          <!--           <el-table-column label="是否牧场" min-width="150px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <el-switch
+                v-model="scope.row.isPasture"
+                :active-value="1"
+                :inactive-value="0"
+                @change="handleEnableChange(scope.$index, scope.row)"
+              />
+            </template>
+          </el-table-column> -->
+          <el-table-column label="启用" min-width="150px" header-align="center" 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"
+                @change="handleEnableChange(scope.$index, scope.row)"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" header-align="center" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <el-button class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+              <el-button v-if="row.status!='已删'" class="miniDanger" icon="el-icon-delete" @click="handleDelete(row)" />
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
+
+        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
+          <div>
+            <el-form
+              ref="dataForm"
+              v-enterToNext="true"
+              :rules="rules"
+              :model="deptform"
+              label-position="left"
+              label-width="100px"
+              style="width: 600px; margin-left:50px;"
+            >
+              <el-form-item label="名称" prop="label">
+                <el-input
+                  ref="label"
+                  v-model="deptform.label"
+                />
+              </el-form-item>
+              <el-form-item label="值" prop="value">
+                <el-input
+                  ref="value"
+                  v-model="deptform.value"
+                />
+              </el-form-item>
+              <el-form-item label="顺序" prop="orderby">
+                <el-input
+                  ref="orderby"
+                  v-model="deptform.orderby"
+                />
+              </el-form-item>
+              <!--   <el-form-item label="是否牧场" prop="isPasture">
+                <el-input
+                  ref="isPasture"
+                  v-model="deptform.isPasture"
+                />
+              </el-form-item> -->
+              <el-form-item label="启用" prop="enable">
+                <el-switch
+                  ref="enable"
+                  v-model="deptform.enable"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  :active-value="1"
+                  :inactive-value="0"
+                />
+              </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+              <el-button v-if="dialogStatus==='create'" class="save" @click="createData_again()"> 确认新增 </el-button>
+              <el-button class="save" @click="dialogStatus==='create'?createData():updateData()"> 确认 </el-button>
+              <el-button class="cancelClose1" @click="dialogFormVisible = false"> 关闭 </el-button>
+            </div>
+          </div>
+        </el-dialog>
+      </div>
+    </el-col>
+  </el-row>
+
+</template>
+
+<script>
+import waves from '@/directive/waves' // waves directive
+import enterToNext from '@/directive/enterToNext' // enterToNext directive
+import { PostDataByName, GetDataByName, getRecuData } from '@/api/common'
+import { isIntegerZero } from '@/utils/validate'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'Dict',
+  components: { Pagination },
+  directives: { waves, enterToNext },
+  data() {
+    return {
+      defaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      dictid: 0,
+      list: [],
+      total: 0,
+      listLoading: true,
+      requestParam: {
+        name: '',
+        params: []
+      },
+      deptform: {
+        label: '',
+        value: '',
+        orderby: '',
+        enable: '',
+        pid: ''
+      },
+      getdataListParm: { name: 'getDictList',
+        offset: 1,
+        pagecount: 8,
+        params: [] },
+      getRecuListParm: { name: 'getDictclass',
+        idname: 'id',
+        params: [-1] },
+      rules: {
+        label: [{ type: 'string', required: true, message: '名称必填', trigger: 'change' }],
+        value: [{ type: 'string', required: true, message: '只必填', trigger: 'change' }],
+        orderby: [{ validator: isIntegerZero, trigger: 'blur' }]
+      },
+      dialogFormVisible: false,
+      parentDeptVisible: true,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '新增'
+      },
+      parent: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    jump() {
+      this.$router.push('/console/menu')
+    // 传递的参数用{{ $route.query.goodsId }}获取
+    //  this.$router.push({ path: '/cart?goodsId=12' })
+    // this.$router.go(-2)
+    // 后退两步
+    },
+
+    handleNodeClick(data) {
+      if (data.children.length === 0) {
+        this.listLoading = true
+        this.dictid = data.id
+        this.getdataListParm.params = [data.id, data.id]
+        GetDataByName(this.getdataListParm).then(response => {
+          this.list = response.data.list
+          this.total = response.data.total
+          // Just to simulate the time of the request
+          setTimeout(() => {
+            this.listLoading = false
+          }, 100)
+        })
+      }
+    },
+    getDownList() {
+      getRecuData(this.getRecuListParm).then(response => {
+        this.parent = response.data
+      })
+    },
+    getList() {
+      this.listLoading = true
+      this.getDownList()
+      GetDataByName(this.getdataListParm).then(response => {
+        this.list = response.data.list
+        this.total = response.data.total
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    resetRequestParam() {
+      this.deptform.id = ''
+      this.deptform.pid = ''
+      this.deptform.label = ''
+      this.deptform.value = ''
+      this.deptform.orderby = '0'
+      this.deptform.enable = '1'
+    },
+    handleCreate() {
+      this.resetRequestParam()
+      this.dialogStatus = 'create'
+      this.deptform.orderby = '0'
+      this.deptform.enable = 1
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+        this.$refs['label'].focus()
+      })
+    },
+    createData() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'insertDictList'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.deptform.label
+          this.requestParam.params[1] = this.deptform.value
+          this.requestParam.params[2] = this.deptform.orderby
+          this.requestParam.params[3] = this.deptform.enable
+          this.requestParam.params[4] = this.dictid
+          PostDataByName(this.requestParam).then(() => {
+            this.getList()
+            this.dialogFormVisible = false
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    createData_again() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'insertDictList'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.deptform.label
+          this.requestParam.params[1] = this.deptform.value
+          this.requestParam.params[2] = this.deptform.orderby
+          this.requestParam.params[3] = this.deptform.enable
+          this.requestParam.params[4] = this.dictid
+          PostDataByName(this.requestParam).then(() => {
+            this.$nextTick(() => {
+              this.$refs['label'].focus()
+            })
+            this.getList()
+            this.resetRequestParam()
+            this.deptform.orderby = '0'
+            this.deptform.enable = 1
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.deptform.id = row.id
+      this.deptform.label = row.label
+      this.deptform.value = row.value
+      this.deptform.orderby = row.orderby
+      this.deptform.enable = row.enable
+      this.deptform.pid = row.pid
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+        this.$refs['label'].focus()
+      })
+    },
+    updateData() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'updateDictList'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.deptform.label
+          this.requestParam.params[1] = this.deptform.value
+          this.requestParam.params[2] = this.deptform.orderby
+          this.requestParam.params[3] = this.deptform.enable
+          this.requestParam.params[4] = this.dictid
+          this.requestParam.params[5] = this.deptform.id
+          PostDataByName(this.requestParam).then(() => {
+            this.getList()
+            this.resetRequestParam()
+            this.dialogFormVisible = false
+            this.$notify({
+              title: '成功',
+              message: '修改成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+
+    handleEnableChange(index, row) {
+      this.requestParam.name = 'updateDictList'
+      this.requestParam.params = []
+      this.requestParam.params[0] = row.label
+      this.requestParam.params[1] = row.value
+      this.requestParam.params[2] = row.orderby
+      this.requestParam.params[3] = row.enable
+      this.requestParam.params[4] = this.dictid
+      this.requestParam.params[5] = row.id
+      PostDataByName(this.requestParam).then(() => {
+        this.$notify({
+          title: '成功',
+          message: '修改成功',
+          type: 'success',
+          duration: 2000
+        })
+      })
+    },
+    handleDelete(row) {
+      MessageBox.confirm('名称:' + row.label, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'deleteDictList'
+        this.requestParam.params = []
+        this.requestParam.params[0] = row.id
+        PostDataByName(this.requestParam).then(() => {
+          this.getList()
+          this.resetRequestParam()
+          this.dialogFormVisible = false
+          this.$notify({
+            title: '成功',
+            message: '删除成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    }
+  }
+}
+</script>

+ 916 - 0
.svn/pristine/92/9240a6bde7334db49e0e5f3bc8ea8087981b3bde.svn-base

@@ -0,0 +1,916 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+      <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+      <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</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" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">导出</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</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="40" />
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="栏舍名称" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="班次" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.times }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="第一层" align="center">
+          <el-table-column prop="onerate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="oneweight" label="重量(g)" min-width="65px" align="center" />
+        </el-table-column>
+        <el-table-column label="第二层" align="center">
+          <el-table-column prop="tworate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="twoweight" label="重量(g)" min-width="65px" align="center" />
+        </el-table-column>
+        <el-table-column label="第三层" align="center">
+          <el-table-column prop="threerate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="threeweight" label="重量(g)" min-width="65px" align="center" />
+        </el-table-column>
+        <el-table-column label="第四层" align="center">
+          <el-table-column prop="fourrate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="fourweight" label="重量(g)" min-width="65px" align="center" />
+        </el-table-column>
+        <el-table-column label="备注" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.remark }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作人" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.emp }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作日期" min-width="85px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.operatetime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="70" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 100%;margin:0 auto 50px">
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">栏舍信息</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col v-if="create.dialogStatus=='create'" :span="6">
+              <el-form-item label="栏舍名称:" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
+                  <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-else :span="6">
+              <el-form-item label="栏舍名称:" prop="barname">
+                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="班次:" prop="times">
+                <el-select ref="times" v-model="create.temp.times" :disabled="create.dialogStatus=='update'" filterable placeholder="班次" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">重量比例</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="第一层重量(g):" prop="oneweight">
+                <el-input ref="oneweight" v-model="create.temp.oneweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="第二层重量(g):" prop="twoweight">
+                <el-input ref="twoweight" v-model="create.temp.twoweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="第三层重量(g):" prop="threeweight">
+                <el-input ref="threeweight" v-model="create.temp.threeweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="第四层重量(g):" prop="fourweight">
+                <el-input ref="fourweight" v-model="create.temp.fourweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="第一层比例 (%):">
+                <span>{{ create.temp.onerate }}</span>
+                <span>{{ create.temp.onerange }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="第二层比例 (%):">
+                <span>{{ create.temp.tworate }}</span>
+                <span>{{ create.temp.tworange }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="第三层比例 (%):">
+                <span>{{ create.temp.threerate }}</span>
+                <span>{{ create.temp.threerange }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="第四层比例 (%):">
+                <span>{{ create.temp.fourrate }}</span>
+                <span>{{ create.temp.fourrange }}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">操作详情</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="操作人:" prop="emp">
+                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" class="filter-item" style="width: 100%;" @blur="blurEmp">
+                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="操作日期:" prop="operatetime">
+                <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" @change="changeOperatetime" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="create.temp.remark" class="filter-item" placeholder="1-255字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" style="width: 100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'PennsylvaniaSieve',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+      ],
+      houseNameList: [], // 栏舍名称
+      frequencyList: [], // 班次
+
+      table: {
+        getdataListParm: {
+          name: 'getPennsieveList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', oneweight: '', twoweight: '', threeweight: '', fourweight: '', onerate: '', tworate: '', threerate: '', fourrate: '', tworange: '', threerange: '', fourrange: '', remark: '', ccid: '', ccname: '' },
+        rules: {
+          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          oneweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          twoweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          threeweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          fourweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        },
+        // 操作人
+        getdataListParm: {
+          name: 'getPennsieveEmpHis',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        // 宾州筛范围
+        getdataListParm2: {
+          name: 'getPennsieveRange',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            date: ''
+          }
+        },
+        noteTakerList: [] // 记录人
+      },
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
+      download: {
+        getdataListParm: {
+          name: 'getPennsieveList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        list: []
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'checkbarname,checktimes,insertPennsieveUpload',
+        importParams: '栏舍名称,班次,第一层重量(g),第二层重量(g),第三层重量(g),第四层重量(g),备注,操作人,操作日期',
+        sheetname: 'Sheet1',
+        // 登录牧场
+        pastureid: Cookies.get('pastureid'),
+        // 日期参数
+        dateParams: '操作日期',
+        // 必填参数
+        requiredParams: '栏舍名称,班次,第一层重量(g),第二层重量(g),第三层重量(g),第四层重量(g)',
+        // 为数值的参数
+        numParams: '第一层重量(g),第二层重量(g),第三层重量(g),第四层重量(g)'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'PennsylvaniaSieve'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.houseNameList = response.data.getBarListEnable.list
+        if (response.data.getSysoptEnable.list !== null) {
+          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
+            const obj = {}
+            obj.id = String(i)
+            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }
+            this.frequencyList.push(obj)
+          }
+        } else {
+          this.frequencyList = []
+        }
+      })
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.barid = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    // 新增
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', oneweight: '', twoweight: '', threeweight: '', fourweight: '', onerate: '', tworate: '', threerate: '', fourrate: '', tworange: '', threerange: '', fourrange: '', remark: '', ccid: '', ccname: '' }
+    },
+    blurEmp(item) {
+      this.create.temp.emp = item.target.value
+    },
+    // 栏舍名称
+    changeBar(item) {
+      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
+      this.getRange()
+    },
+    changeOperatetime() {
+      this.getRange()
+    },
+    //  宾州筛范围
+    getRange() {
+      this.create.getdataListParm2.parammaps.date = this.create.temp.operatetime
+      this.create.getdataListParm2.parammaps.barid = this.create.temp.barid
+      GetDataByName(this.create.getdataListParm2).then(response => {
+        if (response.data.list !== null) {
+          this.create.temp.onerange = response.data.list[0].oneRange
+          this.create.temp.tworange = response.data.list[0].twoRange
+          this.create.temp.threerange = response.data.list[0].threeRange
+          this.create.temp.fourrange = response.data.list[0].fourRange
+          this.create.temp.ccid = response.data.list[0].ccid
+          this.create.temp.ccname = response.data.list[0].ccname
+        } else {
+          this.create.temp.onerange = ''
+          this.create.temp.tworange = ''
+          this.create.temp.threerange = ''
+          this.create.temp.fourrange = ''
+          this.create.temp.ccid = ''
+          this.create.temp.ccname = ''
+        }
+      })
+    },
+    // 操作人
+    getNoteTakerList() {
+      GetDataByName(this.create.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].myId = i
+          }
+          this.create.noteTakerList = response.data.list
+          console.log('记录人数据', response.data.list)
+          console.log(this.create.noteTakerList)
+        } else {
+          this.create.noteTakerList = []
+        }
+      })
+    },
+
+    blurWeight() {
+      if (this.create.temp.oneweight && this.create.temp.twoweight && this.create.temp.threeweight && this.create.temp.fourweight) {
+        const weightSum = parseFloat(this.create.temp.oneweight) + parseFloat(this.create.temp.twoweight) + parseFloat(this.create.temp.threeweight) + parseFloat(this.create.temp.fourweight)
+        this.create.temp.onerate = (parseFloat(this.create.temp.oneweight) / weightSum * 100).toFixed(2)
+        this.create.temp.tworate = (parseFloat(this.create.temp.twoweight) / weightSum * 100).toFixed(2)
+        this.create.temp.threerate = (parseFloat(this.create.temp.threeweight) / weightSum * 100).toFixed(2)
+        this.create.temp.fourrate = (100 - this.create.temp.onerate - this.create.temp.tworate - this.create.temp.threerate).toFixed(2)
+        this.create.temp.onerate = String(this.create.temp.onerate)
+        this.create.temp.tworate = String(this.create.temp.tworate)
+        this.create.temp.threerate = String(this.create.temp.threerate)
+        this.create.temp.fourrate = String(this.create.temp.fourrate)
+      }
+    },
+
+    handleCreate() {
+      console.log('点击了新增')
+      this.resetTemp()
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'create'
+      this.create.dialogFormVisible = true
+    },
+    createData() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 第一层重量
+          if (!weight.test(parseFloat(this.create.temp.oneweight)) || !weight.test(parseFloat(this.create.temp.twoweight)) || !weight.test(parseFloat(this.create.temp.threeweight)) || !weight.test(parseFloat(this.create.temp.fourweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertPennsieve'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const checkStr = new RegExp('Duplicate entry :btop')
+              if (checkStr.test(response.data)) {
+                this.$notify({ title: '保存失败', message: '同一栏舍同一班次不可重复录入', type: 'warning', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertPennsieveHistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createDataAgain() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 第一层重量
+          if (!weight.test(parseFloat(this.create.temp.oneweight)) || !weight.test(parseFloat(this.create.temp.twoweight)) || !weight.test(parseFloat(this.create.temp.threeweight)) || !weight.test(parseFloat(this.create.temp.fourweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertPennsieve'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.resetTemp()
+              this.getList()
+              this.getNoteTakerList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log('点击了编辑', row)
+      // row.times
+      if (row.times == '第一班') {
+        row.times = '1'
+      } else if (row.times == '第二班') {
+        row.times = '2'
+      } else if (row.times == '第三班') {
+        row.times = '3'
+      } else if (row.times == '第四班') {
+        row.times = '4'
+      }
+      row.barid = String(row.barid)
+      this.create.temp = Object.assign({}, row)
+      this.create.temp.id = row.id
+
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'update'
+      this.create.dialogFormVisible = true
+    },
+    updateData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 第一层重量
+          if (!weight.test(parseFloat(this.create.temp.oneweight)) || !weight.test(parseFloat(this.create.temp.twoweight)) || !weight.test(parseFloat(this.create.temp.threeweight)) || !weight.test(parseFloat(this.create.temp.fourweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'updatePennsieve'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deletePennsieve'
+        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
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择宾州筛', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deletePennsieve', '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() {
+      console.log('点击了复制')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择宾州筛', duration: 2000 })
+      } else if (this.selectList.length == 1) {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.requestParam.name = 'copyPennsieve'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
+          this.requestParam.parammaps.id = this.selectList[0].id
+          PostDataByName(this.requestParam).then(response => {
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '请选择一条宾州筛', duration: 2000 })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/栏舍生产/宾州筛导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '宾州筛导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
+          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.download.getdataListParm.parammaps.inputDatetime = ''
+          this.download.getdataListParm.parammaps.startTime = ''
+          this.download.getdataListParm.parammaps.stopTime = ''
+        }
+        GetDataByName(this.download.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.download.list = response.data.list
+          } else {
+            this.download.list = []
+          }
+          var excelDatas = [
+            {
+              tHeader: ['栏舍名称', '班次', '第一层比例(%)', '第一层重量(g)', '第二层比例(%)', '第二层重量(g)', '第三层比例(%)', '第三层重量(g)', '第四层比例(%)', '第四层重量(g)', '备注', '操作人', '操作日期'],
+              filterVal: ['barname', 'times', 'onerate', 'oneweight', 'tworate', 'twoweight', 'threerate', 'threeweight', 'fourrate', 'fourweight', 'remark', 'emp', 'operatetime'],
+              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 = [
+               '栏舍名称', '班次', '第一层重量(g)', '第二层重量(g)', '第三层重量(g)', '第四层重量(g)', '备注', '操作人', '操作日期', '错误信息'
+             ]
+             const filterVal = [
+               '栏舍名称', '班次', '第一层重量(g)', '第二层重量(g)', '第三层重量(g)', '第四层重量(g)', '备注', '操作人', '操作日期', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '宾州筛导入报错信息', autoWidth: true, bookType: 'xlsx' })
+           })
+        }
+      } else {
+        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+</style>

+ 917 - 0
.svn/pristine/a9/a9ab302d0c3710777b879ba37f1ab212c12ec333.svn-base

@@ -0,0 +1,917 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+      <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">导出</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</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="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="标准分数(分)" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.standardscore }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="牛头数(头)" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.cowsum }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="评分" align="center">
+          <el-table-column label="1分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score1 }}({{ scope.row.score1rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="2分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score2 }}({{ scope.row.score2rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="3分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score3 }}({{ scope.row.score3rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="4分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score4 }}({{ scope.row.score4rate }}%)</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="5分(头)" min-width="65px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.score5 }}({{ scope.row.score5rate }}%)</span>
+            </template>
+          </el-table-column>
+        </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.emp }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作日期" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.operatetime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 100%;margin:0 auto 50px">
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">栏舍信息</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col v-if="create.dialogStatus=='create'" :span="6">
+              <el-form-item label="栏舍名称:" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
+                  <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-else :span="12">
+              <el-form-item label="栏舍名称:" prop="barname">
+                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">评分</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="标准分数(分):" prop="standardscore">
+                <el-input ref="standardscore" v-model="create.temp.standardscore" class="filter-item" style="width: 100%;" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="牛头数(头):" prop="cowsum">
+                <el-input ref="cowsum" v-model="create.temp.cowsum" class="filter-item" style="width: 100%;" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="1分" prop="score1">
+                <el-input ref="score1" v-model="create.temp.score1" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="2分" prop="score2">
+                <el-input ref="score2" v-model="create.temp.score2" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="3分" prop="score3">
+                <el-input ref="score3" v-model="create.temp.score3" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="4分" prop="score4">
+                <el-input ref="score4" v-model="create.temp.score4" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="5分" prop="score5">
+                <el-input ref="score5" v-model="create.temp.score5" class="filter-item" placeholder="牛头数" type="number" style="width: 100%;" @blur="blurScore" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">操作详情</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="操作人:" prop="emp">
+                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" class="filter-item" style="width: 100%;" @blur="blurEmp">
+                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="操作日期:" prop="operatetime">
+                <el-date-picker v-model="create.temp.operatetime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" @change="changeOperatetime" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="create.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="1-255字符" maxlength="255" class="filter-item" style="width: 100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'DungScores',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+      ],
+      houseNameList: [], // 栏舍名称
+      frequencyList: [], // 班次
+
+      table: {
+        getdataListParm: {
+          name: 'getDungscoreList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', standardscore: '', cowsum: '', score1: '', score2: '', score3: '', score4: '', score5: '', remark: '', ftid: '', ftname: '' },
+        rules: {
+          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score1: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score2: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score3: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score4: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          score5: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        },
+        // 操作人
+        getdataListParm: {
+          name: 'getDungscoreEmpHis',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        // 粪便评分参数
+        getdataListParm2: {
+          name: 'getDungAndBodyScore',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            date: ''
+          }
+        },
+        noteTakerList: [] // 记录人
+      },
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
+      download: {
+        getdataListParm: {
+          name: 'getDungscoreList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        list: []
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'checkbarname,insertDungscoreUpload',
+        importParams: '栏舍名称,1分(头),2分(头),3分(头),4分(头),5分(头),备注,操作人,操作日期',
+        sheetname: 'Sheet1',
+        // 登录牧场
+        pastureid: Cookies.get('pastureid'),
+        // 日期参数
+        dateParams: '操作日期',
+        // 必填参数
+        requiredParams: '栏舍名称,1分(头),2分(头),3分(头),4分(头),5分(头)',
+        // 为数值的参数
+        numParams: '1分(头),2分(头),3分(头),4分(头),5分(头)'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'DungScores'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.houseNameList = response.data.getBarListEnable.list
+        if (response.data.getSysoptEnable.list !== null) {
+          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
+            const obj = {}
+            obj.id = String(i)
+            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }
+            this.frequencyList.push(obj)
+          }
+        } else {
+          this.frequencyList = []
+        }
+      })
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = this.table.getdataListParm.parammaps.inputDatetime[0] - 3600 * 1000 * 24
+        var stop = this.table.getdataListParm.parammaps.inputDatetime[1] - 3600 * 1000 * 24
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = this.table.getdataListParm.parammaps.inputDatetime[0] + 3600 * 1000 * 24
+        var stop = this.table.getdataListParm.parammaps.inputDatetime[1] + 3600 * 1000 * 24
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'score1rate', (parseFloat(response.data.list[i].score1) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score2rate', (parseFloat(response.data.list[i].score2) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score3rate', (parseFloat(response.data.list[i].score3) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score4rate', (parseFloat(response.data.list[i].score4) / parseFloat(response.data.list[i].cowsum) * 100).toFixed(2))
+            this.$set(response.data.list[i], 'score5rate', (100 - response.data.list[i].score1rate - response.data.list[i].score2rate - response.data.list[i].score3rate - response.data.list[i].score4rate).toFixed(2))
+          }
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.barid = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    // 新增
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', standardscore: '', cowsum: '', score1: '', score2: '', score3: '', score4: '', score5: '', remark: '', ftid: '', ftname: '' }
+    },
+    blurEmp(item) {
+      this.create.temp.emp = item.target.value
+    },
+    // 栏舍名称
+    changeBar(item) {
+      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
+      this.getRange()
+    },
+    changeOperatetime() {
+      this.getRange()
+    },
+    //  粪便评分参数
+    getRange() {
+      this.create.getdataListParm2.parammaps.date = this.create.temp.operatetime
+      this.create.getdataListParm2.parammaps.barid = this.create.temp.barid
+      GetDataByName(this.create.getdataListParm2).then(response => {
+        if (response.data.list !== null) {
+          this.create.temp.standardscore = response.data.list[0].dungstandard
+          this.create.temp.ftid = response.data.list[0].ftid
+          this.create.temp.ftname = response.data.list[0].ftname
+        } else {
+          this.create.temp.standardscore = ''
+          this.create.temp.ftid = ''
+          this.create.temp.ftname = ''
+        }
+      })
+    },
+    // 操作人
+    getNoteTakerList() {
+      GetDataByName(this.create.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].myId = i
+          }
+          this.create.noteTakerList = response.data.list
+          console.log('记录人数据', response.data.list)
+          console.log(this.create.noteTakerList)
+        } else {
+          this.create.noteTakerList = []
+        }
+      })
+    },
+    blurScore() {
+      if (this.create.temp.score1 !== '' && this.create.temp.score2 !== '' && this.create.temp.score3 !== '' && this.create.temp.score4 !== '' && this.create.temp.score5 !== '') {
+        this.create.temp.cowsum = parseInt(this.create.temp.score1) + parseInt(this.create.temp.score2) + parseInt(this.create.temp.score3) + parseInt(this.create.temp.score4) + parseInt(this.create.temp.score5)
+      }
+    },
+    handleCreate() {
+      console.log('点击了新增')
+      this.resetTemp()
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'create'
+      this.create.dialogFormVisible = true
+    },
+    createData() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const score = /^\d*$/
+          // 1分/2分/3分/4分/5分
+          if (!score.test(parseFloat(this.create.temp.score1)) || !score.test(parseFloat(this.create.temp.score2)) || !score.test(parseFloat(this.create.temp.score3)) || !score.test(parseFloat(this.create.temp.score4)) || !score.test(parseFloat(this.create.temp.score5))) {
+            this.$message({ type: 'error', message: '牛头数请输入大于等于0的整数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertDungscore'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertDungandbodyhistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.create.temp.species = 'fppf'
+      this.create.temp.fourrate = ''
+      this.create.temp.fourweight = ''
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createDataAgain() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const score = /^\d*$/
+          // 1分/2分/3分/4分/5分
+          if (!score.test(parseFloat(this.create.temp.score1)) || !score.test(parseFloat(this.create.temp.score2)) || !score.test(parseFloat(this.create.temp.score3)) || !score.test(parseFloat(this.create.temp.score4)) || !score.test(parseFloat(this.create.temp.score5))) {
+            this.$message({ type: 'error', message: '牛头数请输入大于等于0的整数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertDungscore'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.resetTemp()
+              this.getList()
+              this.getNoteTakerList()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log('点击了编辑', row)
+      row.barid = String(row.barid)
+      row.score1 = String(row.score1)
+      row.score2 = String(row.score2)
+      row.score3 = String(row.score3)
+      row.score4 = String(row.score4)
+      row.score5 = String(row.score5)
+      this.create.temp = Object.assign({}, row)
+      this.create.temp.id = row.id
+
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'update'
+      this.create.dialogFormVisible = true
+    },
+    updateData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const score = /^\d*$/
+          // 1分/2分/3分/4分/5分
+          if (!score.test(parseFloat(this.create.temp.score1)) || !score.test(parseFloat(this.create.temp.score2)) || !score.test(parseFloat(this.create.temp.score3)) || !score.test(parseFloat(this.create.temp.score4)) || !score.test(parseFloat(this.create.temp.score5))) {
+            this.$message({ type: 'error', message: '牛头数请输入大于等于0的整数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'updateDungscore'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deleteDungscore'
+        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
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择粪便评分', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteDungscore', '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() {
+      console.log('点击了复制')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择粪便评分', duration: 2000 })
+      } else if (this.selectList.length == 1) {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.requestParam.name = 'copyDungscore'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
+          this.requestParam.parammaps.id = this.selectList[0].id
+          PostDataByName(this.requestParam).then(response => {
+            if (response.msg === 'fail') {
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ 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.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '请选择一条粪便评分', duration: 2000 })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/栏舍生产/粪便评分导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '粪便评分导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
+          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.download.getdataListParm.parammaps.inputDatetime = ''
+          this.download.getdataListParm.parammaps.startTime = ''
+          this.download.getdataListParm.parammaps.stopTime = ''
+        }
+        GetDataByName(this.download.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.download.list = response.data.list
+          } else {
+            this.download.list = []
+          }
+          var excelDatas = [
+            {
+              tHeader: ['栏舍名称', '标准分数(分)', '牛头数(头)', '1分(头)', '2分(头)', '3分(头)', '4分(头)', '5分(头)', '备注', '操作人', '操作日期'],
+              filterVal: ['barname', 'standardscore', 'cowsum', 'score1', 'score2', 'score3', 'score4', 'score5', 'remark', 'emp', 'operatetime'],
+              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 = [
+               '栏舍名称', '1分(头)', '2分(头)', '3分(头)', '4分(头)', '5分(头)', '备注', '操作人', '操作日期', '错误信息'
+             ]
+             const filterVal = [
+               '栏舍名称', '1分(头)', '2分(头)', '3分(头)', '4分(头)', '5分(头)', '备注', '操作人', '操作日期', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '粪便评分导入报错信息', autoWidth: true, bookType: 'xlsx' })
+           })
+        }
+      } else {
+        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+</style>

+ 139 - 0
.svn/pristine/aa/aa2cca7f6870566f34da5c17570babbdb7c1324d.svn-base

@@ -0,0 +1,139 @@
+<template>
+  <div id="app">
+    <router-view v-if="isRouterAlive" />
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'App',
+  provide() {
+    return {
+      reload: this.reload
+    }
+  },
+  data() {
+    return {
+      isRouterAlive: true
+    }
+  },
+  methods: {
+    reload() {
+      this.isRouterAlive = false
+      this.$nextTick(() => {
+        this.isRouterAlive = true
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+// 弹窗最小高度
+.dialogMinHeight{
+  min-height: 450px;
+}
+.filter-container .filter-item{
+  margin-right: 3px;
+}
+.fixed-width .el-button--mini{
+  margin-right: 3px;
+}
+.el-date-editor.el-input{
+  margin-right: 3px;
+}
+
+.el-autocomplete-suggestion li{
+  padding:0 3px!important;
+}
+.filter-item .el-input__inner{
+  width: 100%;
+}
+// body .el-table th.gutter {
+//     display: table-cell !important
+// }
+
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+  -webkit-appearance: none;
+}
+input[type="number"]{
+  -moz-appearance: textfield;
+}
+.search .filter-item{
+  margin-right: 5px;
+}
+// 开始日期结束日期
+.inputDatetime .el-range-separator{ padding: 0; margin: 0 10px; }
+
+.recipeTemplate{
+  position: absolute;
+  width: 120px;
+  height: 120px;
+  right: -50px;
+  top: -0px;
+  margin: 0;
+  background: url(assets/images/sanjiao.png) no-repeat;
+  right: -50px;
+  top: 0;
+  margin: 0;
+  p{
+    position: absolute;
+    z-index: 1;
+    color: #fff;
+    right: 40px;
+    top: 15px;
+    width: 70px;
+    -webkit-transform: rotate(45deg);
+    -moz-transform: rotate(45deg);
+    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);/*ie*/
+    font-size: 12px;
+  }
+}
+.recipeTemplateF{
+  position: absolute;
+  width: 120px;
+  height: 120px;
+  z-index: 3;
+  right: -50px;
+  top: -0px;
+  margin: 0;
+  background: url(assets/images/sanjiao.png) no-repeat;
+  right: -50px;
+  top: 0;
+  margin: 0;
+  p{
+    position: absolute;
+    z-index: 1;
+    color: #fff;
+    right: 40px;
+    top: 15px;
+    width: 70px;
+    -webkit-transform: rotate(45deg);
+    -moz-transform: rotate(45deg);
+    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);/*ie*/
+    font-size: 12px;
+  }
+}
+.contentOperation{
+  position: absolute;
+  width: 120px;
+  height: 120px;
+  right: -49px;
+  top: 0px;
+  margin: 0;
+  background: url(assets/images/sanjiao.png) no-repeat;
+  p{
+    position: absolute;
+    z-index: 1;
+    color: #fff;
+    right: 35px;
+    top: 17px;
+    width: 70px;
+    -webkit-transform: rotate(45deg);
+    -moz-transform: rotate(45deg);
+    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);/*ie*/
+    font-size: 12px;
+  }
+}
+
+</style>

+ 871 - 0
.svn/pristine/aa/aace812bd63d562dafc4b6cf8bc521c6ccee759b.svn-base

@@ -0,0 +1,871 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+      <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">导出</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="栏舍名称" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="第一层" align="center">
+          <el-table-column prop="onerate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="oneweight" label="重量(g)" min-width="65px" align="center" />
+        </el-table-column>
+        <el-table-column label="第二层" align="center">
+          <el-table-column prop="tworate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="twoweight" label="重量(g)" min-width="65px" align="center" />
+        </el-table-column>
+        <el-table-column label="第三层" align="center">
+          <el-table-column prop="threerate" label="比例(%)" min-width="65px" align="center" />
+          <el-table-column prop="threeweight" label="重量(g)" min-width="65px" align="center" />
+        </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.emp }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作日期" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.operatetime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-add">
+        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 100%;margin:0 auto 50px">
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">栏舍信息</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col v-if="create.dialogStatus=='create'" :span="8">
+              <el-form-item label="栏舍名称:" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
+                  <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-else :span="8">
+              <el-form-item label="栏舍名称:" prop="barname">
+                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">重量比例</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="第一层重量(g):" prop="oneweight">
+                <el-input ref="oneweight" v-model="create.temp.oneweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="第二层重量(g):" prop="twoweight">
+                <el-input ref="twoweight" v-model="create.temp.twoweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="第三层重量(g):" prop="threeweight">
+                <el-input ref="threeweight" v-model="create.temp.threeweight" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" style="width: 100%;" @blur="blurWeight" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="第一层比例 (%):">
+                <span>{{ create.temp.onerate }}</span>
+                <span>{{ create.temp.onerange }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="第二层比例 (%):">
+                <span>{{ create.temp.tworate }}</span>
+                <span>{{ create.temp.tworange }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="第三层比例 (%):">
+                <span>{{ create.temp.threerate }}</span>
+                <span>{{ create.temp.threerange }}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <h3 style="width: 150px;text-align: right;">操作详情</h3>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="操作人:" prop="emp">
+                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" class="filter-item" style="width: 100%;" @blur="blurEmp">
+                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="操作日期:" prop="operatetime">
+                <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" @change="changeOperatetime" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="create.temp.remark" class="filter-item" placeholder="1-255字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" style="width: 100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'FecalScreen',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+      ],
+      houseNameList: [], // 栏舍名称
+      frequencyList: [], // 班次
+
+      table: {
+        getdataListParm: {
+          name: 'getDungsieveList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', oneweight: '', twoweight: '', threeweight: '', onerate: '', tworate: '', threerate: '', tworange: '', threerange: '', remark: '', ccid: '', ccname: '' },
+        rules: {
+          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          oneweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          twoweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          threeweight: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        },
+        // 操作人
+        getdataListParm: {
+          name: 'getDungsieveEmpHis',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        // 宾州筛范围
+        getdataListParm2: {
+          name: 'getDungsieveRange',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            date: ''
+          }
+        },
+        noteTakerList: [] // 记录人
+      },
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
+      download: {
+        getdataListParm: {
+          name: 'getDungsieveList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            times: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        list: []
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'checkbarname,insertDungsieveUpload',
+        importParams: '栏舍名称,第一层重量(g),第二层重量(g),第三层重量(g),备注,操作人,操作日期',
+        sheetname: 'Sheet1',
+        // 登录牧场
+        pastureid: Cookies.get('pastureid'),
+        // 日期参数
+        dateParams: '操作日期',
+        // 必填参数
+        requiredParams: '栏舍名称,第一层重量(g),第二层重量(g),第三层重量(g)',
+        // 为数值的参数
+        numParams: '第一层重量(g),第二层重量(g),第三层重量(g)'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'FecalScreen'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.houseNameList = response.data.getBarListEnable.list
+        if (response.data.getSysoptEnable.list !== null) {
+          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
+            const obj = {}
+            obj.id = String(i)
+            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }
+            this.frequencyList.push(obj)
+          }
+        } else {
+          this.frequencyList = []
+        }
+      })
+    },
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        this.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.barid = ''
+      this.table.getdataListParm.parammaps.times = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    // 新增
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', times: '', oneweight: '', twoweight: '', threeweight: '', onerate: '', tworate: '', threerate: '', tworange: '', threerange: '', remark: '', ccid: '', ccname: '' }
+    },
+    blurEmp(item) {
+      this.create.temp.emp = item.target.value
+    },
+    // 栏舍名称
+    changeBar(item) {
+      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
+      this.getRange()
+    },
+    changeOperatetime() {
+      this.getRange()
+    },
+    //  粪便筛范围
+    getRange() {
+      this.create.getdataListParm2.parammaps.date = this.create.temp.operatetime
+      this.create.getdataListParm2.parammaps.barid = this.create.temp.barid
+      GetDataByName(this.create.getdataListParm2).then(response => {
+        if (response.data.list !== null) {
+          this.create.temp.onerange = response.data.list[0].oneRange
+          this.create.temp.tworange = response.data.list[0].twoRange
+          this.create.temp.threerange = response.data.list[0].threeRange
+          this.create.temp.ccid = response.data.list[0].ccid
+          this.create.temp.ccname = response.data.list[0].ccname
+        } else {
+          this.create.temp.onerange = ''
+          this.create.temp.tworange = ''
+          this.create.temp.threerange = ''
+          this.create.temp.ccid = ''
+          this.create.temp.ccname = ''
+        }
+      })
+    },
+    // 操作人
+    getNoteTakerList() {
+      GetDataByName(this.create.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].myId = i
+          }
+          this.create.noteTakerList = response.data.list
+          console.log('记录人数据', response.data.list)
+          console.log(this.create.noteTakerList)
+        } else {
+          this.create.noteTakerList = []
+        }
+      })
+    },
+
+    blurWeight() {
+      if (this.create.temp.oneweight && this.create.temp.twoweight && this.create.temp.threeweight) {
+        const weightSum = parseFloat(this.create.temp.oneweight) + parseFloat(this.create.temp.twoweight) + parseFloat(this.create.temp.threeweight)
+        this.create.temp.onerate = (parseFloat(this.create.temp.oneweight) / weightSum * 100).toFixed(2)
+        this.create.temp.tworate = (parseFloat(this.create.temp.twoweight) / weightSum * 100).toFixed(2)
+        this.create.temp.threerate = (100 - this.create.temp.onerate - this.create.temp.tworate).toFixed(2)
+      }
+    },
+
+    handleCreate() {
+      console.log('点击了新增')
+      this.resetTemp()
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'create'
+      this.create.dialogFormVisible = true
+    },
+    createData() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 第一层重量
+          if (!weight.test(parseFloat(this.create.temp.oneweight)) || !weight.test(parseFloat(this.create.temp.twoweight)) || !weight.test(parseFloat(this.create.temp.threeweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertDungsieve'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+            } else {
+              const checkStr = new RegExp('Duplicate entry :pbto')
+              if (checkStr.test(response.data)) {
+                this.$notify({ title: '保存失败', message: '同一栏舍不可重复录入', type: 'warning', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
+            }
+          })
+        }
+      })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertDungHistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.create.temp.species = 'fps'
+      this.create.temp.fourrate = ''
+      this.create.temp.fourweight = ''
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createDataAgain() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 第一层重量
+          if (!weight.test(parseFloat(this.create.temp.oneweight)) || !weight.test(parseFloat(this.create.temp.twoweight)) || !weight.test(parseFloat(this.create.temp.threeweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'insertDungsieve'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.resetTemp()
+              this.getList()
+              this.getNoteTakerList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log('点击了编辑', row)
+      row.barid = String(row.barid)
+      this.create.temp = Object.assign({}, row)
+      this.create.temp.id = row.id
+
+      this.getNoteTakerList()
+      this.dialogFull = false
+      this.create.dialogStatus = 'update'
+      this.create.dialogFormVisible = true
+    },
+    updateData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          const weight = /^\d+(\.\d{1,2})?$/
+          // 第一层重量
+          if (!weight.test(parseFloat(this.create.temp.oneweight)) || !weight.test(parseFloat(this.create.temp.twoweight)) || !weight.test(parseFloat(this.create.temp.threeweight))) {
+            this.$message({ type: 'error', message: '重量不可小于0,最多保留俩位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'updateDungsieve'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.saveData()
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deleteDungsieve'
+        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
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择粪便筛', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteDungsieve', '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() {
+      console.log('点击了复制')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择粪便筛', duration: 2000 })
+      } else if (this.selectList.length == 1) {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.requestParam.name = 'copyDungsieve'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
+          this.requestParam.parammaps.id = this.selectList[0].id
+          PostDataByName(this.requestParam).then(response => {
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '请选择一条粪便筛', duration: 2000 })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/栏舍生产/粪便筛导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '粪便筛导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
+          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } else {
+          this.download.getdataListParm.parammaps.inputDatetime = ''
+          this.download.getdataListParm.parammaps.startTime = ''
+          this.download.getdataListParm.parammaps.stopTime = ''
+        }
+        GetDataByName(this.download.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.download.list = response.data.list
+          } else {
+            this.download.list = []
+          }
+          var excelDatas = [
+            {
+              tHeader: ['栏舍名称', '第一层比例(%)', '第一层重量(g)', '第二层比例(%)', '第二层重量(g)', '第三层比例(%)', '第三层重量(g)', '备注', '操作人', '操作日期'],
+              filterVal: ['barname', 'onerate', 'oneweight', 'tworate', 'twoweight', 'threerate', 'threeweight', 'remark', 'emp', 'operatetime'],
+              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 = [
+               '栏舍名称', '第一层重量(g)', '第二层重量(g)', '第三层重量(g)', '备注', '操作人', '操作日期', '错误信息'
+             ]
+             const filterVal = [
+               '栏舍名称', '第一层重量(g)', '第二层重量(g)', '第三层重量(g)', '备注', '操作人', '操作日期', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '粪便筛导入报错信息', autoWidth: true, bookType: 'xlsx' })
+           })
+        }
+      } else {
+        this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+</style>

+ 1731 - 0
.svn/pristine/ac/acdf987480cf3e4cacfe6204c6356ddceea9acc9.svn-base

@@ -0,0 +1,1731 @@
+<template>
+  <div class="app-container1">
+    <el-tabs v-model="activeName" @tab-click="handleTabClick">
+      <el-tab-pane label="效率统计" name="first">
+        <div class="search">
+          <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+          <span style="margin-left: 10px;">统计类型:</span>
+          <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
+          <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
+          <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
+          <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 245px;" placeholder="配方模板" />
+          <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.barname" class="filter-item" style="width: 150px;" placeholder="栏舍" />
+          <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 150px;" placeholder="配方模板" />
+          <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.cowclass" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />
+          <el-button class="successBorder" @click="handleSearch">查询</el-button>
+          <el-button class="export" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
+          <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
+        </div>
+        <div id="table" class="table">
+          <el-table
+            :key="tab.table.tableKey"
+            v-loading="tab.table.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab.table.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight"
+          >
+            <el-table-column 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 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="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>
+          <span v-if="tab.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table.total }}条</span>
+          <!-- <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getTabList" /> -->
+        </div>
+        <div class="AnalysisChart">
+          <el-row :gutter="10">
+            <el-col :span="24" style="margin-top: 10px;">
+              <span>图表查询时间:</span>
+              <el-date-picker v-model="tab.chartDate" :clearable="false" style="margin-left: 10px;width: 250px;margin-right: 10px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
+              <el-button class="successBorder" @click="handleChartDate">确认</el-button>
+              <svg-icon icon-class="Up" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpTop" />
+            </el-col>
+          </el-row>
+          <el-row :gutter="10" class="dashboard-editor-container">
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4 style="text-align:center;">泌乳牛干物质采食量</h4>
+                <div v-if="tab.chart1.isChart" class="button">
+                  <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart1')" />
+                  <div class="exportTable" @click="handleExport('chart1')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart1')">切换表格</div>
+                </div>
+                <div v-if="tab.chart1.isChart" id="chartLine1" style="width:100%;height:430px;" />
+                <div v-if="tab.chart1.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart1')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart1')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart1.table.tableKey"
+                    v-loading="tab.chart1.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart1.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="430"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+                    <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
+                    <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4 style="text-align:center;">牛栏剩料率</h4>
+                <div v-if="tab.chart2.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart2.getdataListParm.parammaps.statisticsList" :option="tab.chart2.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart2" />
+                  <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" style="width: 245px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart2')" />
+                  <div class="exportTable" @click="handleExport('chart2')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart2')">切换表格</div>
+                </div>
+                <div v-if="tab.chart2.isChart" id="chartLine2" style="width:100%;height:430px;" />
+                <div v-if="tab.chart2.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart2')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart2')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart2.table.tableKey"
+                    v-loading="tab.chart2.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart2.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="430"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+                    <el-table-column label="栏舍名称" sortable min-width="110px" align="center" prop="名称" />
+                    <el-table-column label="剩料量" sortable min-width="110px" align="center" prop="剩料量" />
+                    <el-table-column label="撒料量" sortable min-width="110px" align="center" prop="撒料量" />
+                    <el-table-column label="剩料率" sortable min-width="110px" align="center" prop="准确率" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="10" class="dashboard-editor-container">
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4 style="text-align:center;">混料时间统计</h4>
+                <div v-if="tab.chart3.isChart" class="button">
+                  <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart3')" />
+                  <div class="exportTable" @click="handleExport('chart3')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart3')">切换表格</div>
+                </div>
+                <div v-if="tab.chart3.isChart" id="chartLine3" style="width:100%;height:430px;" />
+                <div v-if="tab.chart3.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart3')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart3')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart3.table.tableKey"
+                    v-loading="tab.chart3.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart3.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="430"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
+                    <el-table-column sortable label="混料时间(分钟)" min-width="110px" align="center" prop="field1" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+            <el-col :span="12">
+              <div class="grid-content">
+                <h4 style="text-align:center;">转化率</h4>
+                <div v-if="tab.chart4.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart4.getdataListParm.parammaps.statisticsList" :option="tab.chart4.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart4" />
+                  <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" style="width: 245px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart4')" />
+                  <div class="exportTable" @click="handleExport('chart4')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart4')">切换表格</div>
+                </div>
+                <div v-if="tab.chart4.isChart" id="chartLine4" style="width:100%;height:430px;" />
+                <div v-if="tab.chart4.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart4')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart4')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart4.table.tableKey"
+                    v-loading="tab.chart4.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart4.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="430"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
+                    <el-table-column sortable label="配方名称" min-width="110px" align="center" prop="名称" />
+                    <el-table-column sortable label="饲料转化率" min-width="110px" align="center" prop="准确率" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
+
+          <el-row :gutter="10" class="dashboard-editor-container" style="margin-bottom: 30px;">
+            <el-col :span="24">
+              <div class="grid-content">
+                <h4 style="text-align:center;">成本分析</h4>
+                <div v-if="tab.chart5.isChart" class="button">
+                  <my-select ref="tenantselect" :model="tab.chart5.getdataListParm.parammaps.statisticsList" :option="tab.chart5.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart5" />
+                  <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart5')" />
+                  <div class="exportTable" @click="handleExport('chart5')">导出</div>
+                  <div class="exportTable" @click="handleTable('chart5')">切换表格</div>
+                </div>
+                <div v-if="tab.chart5.isChart" id="chartLine5" style="width:100%;height:430px;" />
+                <div v-if="tab.chart5.isTable" class="table">
+                  <div class="button">
+                    <div class="exportTable" @click="handleExport('chart5')">导出</div>
+                    <div class="exportTable" @click="handleChart('chart5')">切换图表</div>
+                  </div>
+                  <el-table
+                    :key="tab.chart5.table.tableKey"
+                    v-loading="tab.chart5.table.listLoading"
+                    element-loading-text="给我一点时间"
+                    :data="tab.chart5.table.list"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                    height="430"
+                    :row-style="rowStyle"
+                    :cell-style="cellStyle"
+                    class="elTable table-fixed"
+                  >
+                    <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
+                    <el-table-column sortable label="牲畜类别" min-width="110px" align="center" prop="名称" />
+                    <el-table-column sortable label="公斤奶饲料成本(元)" min-width="110px" align="center" prop="准确率" />
+                  </el-table>
+                </div>
+              </div>
+            </el-col>
+
+          </el-row>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="牛群评估" name="second">
+        <div class="search">
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" />
+          <!-- <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore2" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext2" /> -->
+        </div>
+        <div class="table">
+          <el-row :gutter="10">
+            <el-col :span="12">
+              <h4 style="text-align:center;">宾州筛分析</h4>
+              <el-table
+                :key="tab2.table.tableKey"
+                v-loading="tab2.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="tab2.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                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="参考标准" min-width="50px" align="center" prop="standard" />
+              </el-table>
+            </el-col>
+            <el-col :span="12">
+              <h4 style="text-align:center;">粪便筛分析</h4>
+              <el-table
+                :key="tab2.table2.tableKey"
+                v-loading="tab2.table2.listLoading"
+                element-loading-text="给我一点时间"
+                :data="tab2.table2.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                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="50px" align="center" prop="standard" />
+              </el-table>
+            </el-col>
+          </el-row>
+          <el-row :gutter="10">
+            <el-col :span="12">
+              <h4 style="text-align:center;">BCS评分</h4>
+              <el-table
+                :key="tab2.table3.tableKey"
+                v-loading="tab2.table3.listLoading"
+                element-loading-text="给我一点时间"
+                :data="tab2.table3.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                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="50px" align="center" prop="avgdim" />
+                <el-table-column sortable label="标准分数" min-width="50px" align="center" prop="standardscore" />
+                <el-table-column sortable label="2.75-分(数量、百分比)" min-width="100px" align="center" prop="score25" />
+                <el-table-column sortable label="2.75分(数量、百分比)" min-width="100px" align="center" prop="score275" />
+                <el-table-column sortable label="3分(数量、百分比)" min-width="90px" align="center" prop="score3" />
+                <el-table-column sortable label="3.25分(数量、百分比)" min-width="100px" align="center" prop="score325" />
+                <el-table-column sortable label="3.5分(数量、百分比)" min-width="100px" align="center" prop="score35" />
+                <el-table-column sortable label="3.75分(数量、百分比)" min-width="100px" align="center" prop="score375" />
+                <el-table-column sortable label="4+分(数量、百分比)" min-width="100px" align="center" prop="score4" />
+              </el-table>
+            </el-col>
+            <!-- 粪便评分 -->
+            <el-col :span="12">
+              <h4 style="text-align:center;">粪便评分</h4>
+              <el-table
+                :key="tab2.table4.tableKey"
+                v-loading="tab2.table4.listLoading"
+                element-loading-text="给我一点时间"
+                :data="tab2.table4.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                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="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" />
+                <el-table-column sortable label="4分(数量、百分比)" min-width="90px" align="center" prop="score4" />
+                <el-table-column sortable label="5分(数量、百分比)" min-width="90px" align="center" prop="score5" />
+              </el-table>
+            </el-col>
+          </el-row>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+
+</template>
+
+<script>
+import echarts from 'echarts'
+
+require('echarts/theme/macarons')
+import { GetDataByName, GetReportform } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import mySelect from '@/components/mySelect'
+export default {
+  name: 'PastureFeedingEfficiency',
+  components: { Pagination, mySelect },
+  data() {
+    return {
+      pickerMinDate: '',
+      pickerOptions: {
+        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()
+        }
+      },
+      activeName: 'first',
+      tab: {
+        radio: '1',
+        isFormulaName: true, // 配方名称
+        isHouseName: false, // 栏舍名称
+        isLivestockType: false, // 牲畜类别
+        chartDate: [],
+        table: {
+          getdataListParm: {
+            name: 'getFeedEfficiencyFT',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              date: parseTime(new Date(), '{y}-{m}-{d}'),
+              ftname: '',
+              barname: '',
+              cowclass: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        chart1: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getFeedEffMR',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+
+        chart2: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getFeedEffSL',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart2Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+
+        chart3: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getFeedEffHL',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+
+        chart4: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getFeedEffZH',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart4Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+
+        chart5: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getFeedEffCBFT',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart5Data3: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        }
+      },
+
+      tab2: {
+        table: {
+          getdataListParm: {
+            name: 'getAssessCowPenn',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              date: parseTime(new Date(), '{y}-{m}-{d}')
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        table2: {
+          getdataListParm: {
+            name: 'getAssessCowDung',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              date: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        table3: {
+          getdataListParm: {
+            name: 'getAssessBodyscore',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              date: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        table4: {
+          getdataListParm: {
+            name: 'getAssessDungscore',
+            page: 1,
+            offset: 1,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              date: ''
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        }
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight: document.documentElement.clientHeight - 85 - 210
+    }
+  },
+
+  created() {
+    this.getTabList()
+    this.getTimeFn()
+    this.getChart1()
+    this.getChart2()
+    this.getChart3()
+    this.getChart4()
+    this.getChart5()
+  },
+  mounted() {
+
+  },
+  methods: {
+    getTimeFn() {
+      const that = this
+      const end = new Date()
+      const start = new Date()
+      const start2 = new Date()
+      start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 10)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+
+      that.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
+
+      // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.tab.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+    },
+    // 导出
+    handleDownload() {
+      if (this.tab.radio == '1') {
+        var excelDatas = [
+          {
+            tHeader: ['配方模板', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '平均混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干物质采食量(kg/头)', '实际干物质采食量(kg/头)', '采食率(%)', '配方成本(元/头 )', '实际成本(元/ 头)', '产奶量(kg /头)', '饲料转化率', '公斤奶饲料成本'],
+            filterVal: ['配方模板', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', '采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
+            tableDatas: this.tab.table.list,
+            sheetName: '配方'
+          }
+        ]
+        json2excel(excelDatas, '效率统计-配方', true, 'xlsx')
+      } else if (this.tab.radio == '2') {
+        var excelDatas2 = [
+          {
+            tHeader: ['栏舍', '配方模板', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '平均混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干物质采食量(kg/头)', ' 实际干物质采食量( kg/头)', '采食率 (%)', '配方成本( 元/头)', '实际成本 (元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
+            filterVal: ['栏舍', '配方模板', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', '采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
+            tableDatas: this.tab.table.list,
+            sheetName: '栏舍'
+          }
+        ]
+        json2excel(excelDatas2, '效率统计-栏舍', true, 'xlsx')
+      } else if (this.tab.radio == '3') {
+        var excelDatas3 = [
+          {
+            tHeader: ['牲畜类别', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '平均混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方 物质采食量(kg/ 头)', '实际干物质采 食量(kg/头)', ' 采食率(%)', '配方 成本(元/头)', '实际成本(元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
+            filterVal: ['牲畜类别', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', ' 采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
+            tableDatas: this.tab.table.list,
+            sheetName: '牲畜类别'
+          }
+        ]
+        json2excel(excelDatas3, '效率统计-牲畜类别', true, 'xlsx')
+      }
+    },
+    // Tab切换
+    handleTabClick() {
+      if (this.activeName == 'first') {
+        const start2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
+        this.getTabList()
+        this.getChart1()
+        this.getChart2()
+        this.getChart3()
+        this.getChart4()
+        this.getChart5()
+      } else if (this.activeName == 'second') {
+        const start2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        this.tab2.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
+        this.getTab2List()
+        this.getTab2List2()
+        this.getTab2List3()
+        this.getTab2List4()
+      }
+    },
+    // 切换统计类型
+    changeRadio() {
+      console.log(this.tab.radio)
+      if (this.tab.radio == '1') {
+        console.log('配方名称')
+        this.tab.isFormulaName = true
+        this.tab.isHouseName = false
+        this.tab.isLivestockType = false
+        this.tab.table.getdataListParm.parammaps.ftname = ''
+        this.tab.table.getdataListParm.parammaps.barname = ''
+        this.tab.table.getdataListParm.parammaps.ftname = ''
+        this.tab.table.getdataListParm.parammaps.cowclass = ''
+        this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
+        this.getTabList()
+        this.tab.chart5.statisticsList = []
+        this.tab.chart5.getdataListParm.name = 'getFeedEffCBFT'
+        this.getChart5()
+        this.tab.chart4.getdataListParm.name = 'getFeedEffZH'
+        this.getChart4()
+      } else if (this.tab.radio == '2') {
+        console.log('栏舍名称')
+        this.tab.isFormulaName = false
+        this.tab.isHouseName = true
+        this.tab.isLivestockType = false
+        this.tab.table.getdataListParm.parammaps.ftname = ''
+        this.tab.table.getdataListParm.parammaps.barname = ''
+        this.tab.table.getdataListParm.parammaps.ftname = ''
+        this.tab.table.getdataListParm.parammaps.cowclass = ''
+        this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
+        this.getTabList()
+        this.tab.chart5.statisticsList = []
+        this.tab.chart5.getdataListParm.name = 'getFeedEffCBLS'
+        this.getChart5()
+        this.tab.chart4.getdataListParm.name = 'getFeedEffZHLS'
+        this.getChart4()
+      } else if (this.tab.radio == '3') {
+        console.log(' 牲畜类别')
+        this.tab.isFormulaName = false
+        this.tab.isHouseName = false
+        this.tab.isLivestockType = true
+        this.tab.table.getdataListParm.parammaps.ftname = ''
+        this.tab.table.getdataListParm.parammaps.barname = ''
+        this.tab.table.getdataListParm.parammaps.ftname = ''
+        this.tab.table.getdataListParm.parammaps.cowclass = ''
+        this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
+        this.getTabList()
+        this.tab.chart5.statisticsList = []
+        this.tab.chart5.getdataListParm.name = 'getFeedEffCB'
+        this.getChart5()
+        this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
+        this.getChart4()
+      }
+    },
+
+    // 效率统计
+    getTabList() {
+      this.tab.table.listLoading = true
+      GetDataByName(this.tab.table.getdataListParm).then(response => {
+        console.log('汇总统计/混料table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab.table.list = response.data.list
+          this.tab.table.total = response.data.total
+        } else {
+          this.tab.table.list = []
+        }
+        setTimeout(() => {
+          this.tab.table.listLoading = false
+        }, 100)
+      })
+    },
+    // 查询
+    handleSearch() {
+      if (this.tab.radio == '1') {
+        console.log('配方名称/查询')
+        this.tab.isFormulaName = true
+        this.tab.isHouseName = false
+        this.tab.isLivestockType = false
+        this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
+        this.getTabList()
+      } else if (this.tab.radio == '2') {
+        console.log('栏舍名称/查询')
+        this.tab.isFormulaName = false
+        this.tab.isHouseName = true
+        this.tab.isLivestockType = false
+        this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
+        this.getTabList()
+      } else if (this.tab.radio == '3') {
+        console.log(' 牲畜类别/查询')
+        this.tab.isFormulaName = false
+        this.tab.isHouseName = false
+        this.tab.isLivestockType = true
+        this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
+        this.getTabList()
+      }
+    },
+    handleBefore() {
+      if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {
+        this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)
+        var start = new Date(this.tab.table.getdataListParm.parammaps.date.setDate(this.tab.table.getdataListParm.parammaps.date.getDate() - 1))
+        this.tab.table.getdataListParm.parammaps.date = parseTime(start, '{y}-{m}-{d}')
+        this.getTabList()
+      }
+    },
+    handleNext() {
+      if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {
+        this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.date.setDate(this.tab.table.getdataListParm.parammaps.date.getDate() + 1))
+        this.tab.table.getdataListParm.parammaps.date = parseTime(stop, '{y}-{m}-{d}')
+        this.getTabList()
+      }
+    },
+    handleBefore2() {
+      if (this.tab2.table.getdataListParm.parammaps.date !== '' && this.tab2.table.getdataListParm.parammaps.date !== null) {
+        this.tab2.table.getdataListParm.parammaps.date = new Date(this.tab2.table.getdataListParm.parammaps.date)
+        var start = new Date(this.tab2.table.getdataListParm.parammaps.date.setDate(this.tab2.table.getdataListParm.parammaps.date.getDate() - 1))
+        this.tab2.table.getdataListParm.parammaps.date = parseTime(start, '{y}-{m}-{d}')
+        this.getTab2List()
+        this.getTab2List2()
+        this.getTab2List3()
+        this.getTab2List4()
+      }
+    },
+    handleNext2() {
+      if (this.tab2.table.getdataListParm.parammaps.date !== '' && this.tab2.table.getdataListParm.parammaps.date !== null) {
+        this.tab2.table.getdataListParm.parammaps.date = new Date(this.tab2.table.getdataListParm.parammaps.date)
+        var stop = new Date(this.tab2.table.getdataListParm.parammaps.date.setDate(this.tab2.table.getdataListParm.parammaps.date.getDate() + 1))
+        this.tab2.table.getdataListParm.parammaps.date = parseTime(stop, '{y}-{m}-{d}')
+        this.getTab2List()
+        this.getTab2List2()
+        this.getTab2List3()
+        this.getTab2List4()
+      }
+    },
+    // 快速跳转到图表
+    handleQuickJumpChart() {
+      var myHeight = document.getElementById('table').offsetHeight + 120
+      window.scrollTo(myHeight, myHeight)
+    },
+    // 快速回到顶部
+    handleQuickJumpTop() {
+      window.scrollTo(0, 0)
+    },
+    // 图表总查询
+    handleChartDate() {
+      console.log('点击了确认时间')
+      MessageBox.confirm('是否调整以下所有图表查询时间?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        var that = this
+        var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
+        var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
+        that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart1.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart1()
+        that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart2.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart2()
+        that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart3.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart3()
+        that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart4.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart4()
+        that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
+        that.tab.chart5.getdataListParm.parammaps.startTime = startTime
+        that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
+        that.getChart5()
+      })
+    },
+    // 泌乳牛干物质采食量
+    getChart1() {
+      this.tab.chart1.listLoading = true
+      GetReportform(this.tab.chart1.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null && response.data.data !== null) {
+          console.log('泌乳牛干物质采食量图表数据', response.data.list)
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+            }
+          }
+          this.tab.chart1.table.list = response.data.data
+          this.tab.chart1.chartLine_data = response.data.list
+          // this.tab.chart1.total = response.data.total
+        } else {
+          this.tab.chart1.list = []
+          this.tab.chart1.chartLine_data = {}
+        }
+        this.roadChartLine1(this.tab.chart1.chartLine_data)
+        setTimeout(() => {
+          this.tab.chart1.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine1(chartLine_data) {
+      console.log(chartLine_data, '000007777')
+      if (this.tab.chart1.chartLine != null) {
+        this.tab.chart1.chartLine.dispose()
+      }
+      this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
+      var option = {
+        tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
+        legend: { data: ['泌乳牛干物质采食量', '泌乳牛产奶量'], right: 10 },
+        grid: { top: '20%', left: '8%', right: '8%', containLabel: true },
+        xAxis: [{ type: 'category', data: chartLine_data.data1 }],
+        yAxis: [
+          { splitLine: { show: false }, type: 'value', name: '泌乳牛干物质\n采食量', axisLabel: { formatter: '{value} ' }},
+          { splitLine: { show: false }, type: 'value', name: '泌乳牛产奶量', axisLabel: { formatter: '{value} ' }}
+        ],
+        series: [
+          { name: '泌乳牛干物质采食量', type: 'bar', itemStyle: { normal: { color: '#61a5e8' }}, data: chartLine_data.data2 },
+          { name: '泌乳牛产奶量', type: 'line', itemStyle: { normal: { color: '#ff2d2d' }}, yAxisIndex: 1, data: chartLine_data.data3 }
+        ]
+      }
+      this.tab.chart1.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart1.chartLine.resize()
+      }
+    },
+
+    // 牛栏剩料率
+    changeStatisticChart2(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart2.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart2.chart2Data3[j])
+          }
+        }
+      }
+      this.tab.chart2.chartLine_data.data3 = arrData3
+      this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
+      this.roadChartLine2(this.tab.chart2.chartLine_data)
+    },
+
+    // 牛栏剩料率
+    getChart2() {
+      this.tab.chart2.listLoading = true
+      GetReportform(this.tab.chart2.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null && response.data.data !== null) {
+          console.log('牛栏剩料率图表数据', response.data.list)
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].剩料量 !== '' && response.data.data[i].剩料量 !== undefined) {
+              response.data.data[i].剩料量 = parseFloat(response.data.data[i].剩料量)
+            }
+            if (response.data.data[i].撒料量 !== '' && response.data.data[i].撒料量 !== undefined) {
+              response.data.data[i].撒料量 = parseFloat(response.data.data[i].撒料量)
+            }
+            if (response.data.data[i].准确率 !== '' && response.data.data[i].准确率 !== undefined) {
+              response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率)
+            }
+          }
+          this.tab.chart2.table.list = response.data.data
+          this.tab.chart2.chartLine_data = response.data.list
+          this.tab.chart2.total = response.data.total
+          this.tab.chart2.statisticsList = []
+          this.tab.chart2.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart2.statisticsList.push(obj)
+          }
+          this.tab.chart2.chart2Data3 = response.data.list.data3
+          this.tab.chart2.total = response.data.total
+          console.log('牛栏剩料率图数据', this.tab.chart2.chartLine_data)
+          console.log('牛栏剩料率表数据', this.tab.chart2.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart2.chart2Data3[j])
+              }
+            }
+          }
+          this.tab.chart2.chartLine_data.data3 = arrData3
+          this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
+        } else {
+          this.tab.chart2.list = []
+          this.tab.chart2.chartLine_data = {}
+        }
+        this.roadChartLine2(this.tab.chart2.chartLine_data)
+        setTimeout(() => {
+          this.tab.chart2.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine2(chartLine_data) {
+      if (this.tab.chart2.chartLine != null) {
+        this.tab.chart2.chartLine.dispose()
+      }
+      this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '3%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: {
+          type: 'value', name: '剩料率', axisLabel: { formatter: '{value} %' }
+        },
+        series: (function() {
+          var serie = []
+          if (chartLine_data.data3 !== undefined) {
+            for (var i = 0; i < chartLine_data.data3.length; i++) {
+              var item = {
+                name: chartLine_data.data1[i],
+                type: 'line',
+                data: chartLine_data.data3[i].data
+              }
+              serie.push(item)
+            }
+          }
+          return serie
+        }())
+      }
+      this.tab.chart2.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart2.chartLine.resize()
+      }
+    },
+
+    // 混料时间统计
+    getChart3() {
+      this.tab.chart3.listLoading = true
+      GetReportform(this.tab.chart3.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('混料时间统计图表数据', response.data.list)
+          this.tab.chart3.table.list = response.data.data
+          this.tab.chart3.chartLine_data = response.data.list
+          this.tab.chart3.total = response.data.total
+          this.tab.chart3.total = response.data.total
+        } else {
+          this.tab.chart3.list = []
+          this.tab.chart3.chartLine_data = {}
+        }
+        this.roadChartLine3(this.tab.chart3.chartLine_data)
+        setTimeout(() => {
+          this.tab.chart3.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine3(chartLine_data) {
+      if (this.tab.chart3.chartLine != null) {
+        this.tab.chart3.chartLine.dispose()
+      }
+      this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: ['混料时间'],
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
+        yAxis: {
+          type: 'value', name: '分钟',
+          axisLabel: {
+            formatter: '{value}min'
+          }
+        },
+        series: [
+          {
+            name: '混料时间',
+            type: 'line',
+            stack: '总量',
+            data: chartLine_data.data2
+          }
+        ]
+      }
+      this.tab.chart3.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart3.chartLine.resize()
+      }
+    },
+
+    // 转化率
+    changeStatisticChart4(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart4.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart4.chart4Data3[j])
+          }
+        }
+      }
+      this.tab.chart4.chartLine_data.data3 = arrData3
+      this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
+      this.roadChartLine4(this.tab.chart4.chartLine_data)
+    },
+    getChart4() {
+      this.tab.chart4.listLoading = true
+      GetReportform(this.tab.chart4.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('转化率图表数据', response.data.list)
+          this.tab.chart4.table.list = response.data.data
+          this.tab.chart4.chartLine_data = response.data.list
+          this.tab.chart4.total = response.data.total
+          this.tab.chart4.statisticsList = []
+          this.tab.chart4.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart4.statisticsList.push(obj)
+          }
+          this.tab.chart4.chart4Data3 = response.data.list.data3
+          this.tab.chart4.total = response.data.total
+          console.log('转化率图数据', this.tab.chart4.chartLine_data)
+          console.log('转化率表数据', this.tab.chart4.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart4.chart4Data3[j])
+              }
+            }
+          }
+          this.tab.chart4.chartLine_data.data3 = arrData3
+          this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
+        } else {
+          this.tab.chart4.list = []
+          this.tab.chart4.chartLine_data = {}
+        }
+        this.roadChartLine4(this.tab.chart4.chartLine_data)
+        setTimeout(() => {
+          this.tab.chart4.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine4(chartLine_data) {
+      if (this.tab.chart4.chartLine != null) {
+        this.tab.chart4.chartLine.dispose()
+      }
+      this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '3%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: {
+          type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
+        },
+        series: (function() {
+          var serie = []
+          if (chartLine_data.data3 !== undefined) {
+            for (var i = 0; i < chartLine_data.data3.length; i++) {
+              var item = {
+                name: chartLine_data.data1[i],
+                type: 'line',
+                data: chartLine_data.data3[i].data
+              }
+              serie.push(item)
+            }
+          }
+          return serie
+        }())
+      }
+      this.tab.chart4.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart4.chartLine.resize()
+      }
+    },
+
+    // 成本分析
+    changeStatisticChart5(arr) {
+      var arr1 = []
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] !== 'all') {
+          arr1.push(arr[i])
+        }
+      }
+      this.tab.chart5.getdataListParm.parammaps.statisticsList = arr1
+      var arrData3 = []
+      for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
+        const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
+        for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
+          if (j == myId) {
+            arrData3.push(this.tab.chart5.chart5Data3[j])
+          }
+        }
+      }
+      this.tab.chart5.chartLine_data.data3 = arrData3
+      this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
+      this.roadChartLine5(this.tab.chart5.chartLine_data)
+    },
+    getChart5() {
+      this.tab.chart5.listLoading = true
+      GetReportform(this.tab.chart5.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('转化率图表数据', response.data.list)
+          this.tab.chart5.table.list = response.data.data
+          this.tab.chart5.chartLine_data = response.data.list
+          this.tab.chart5.total = response.data.total
+          this.tab.chart5.statisticsList = []
+          this.tab.chart5.getdataListParm.parammaps.statisticsList = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            if (i < 10) {
+              this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
+            }
+            var obj = {}
+            obj.id = i
+            obj.name = response.data.list.data1[i]
+            this.tab.chart5.statisticsList.push(obj)
+          }
+          this.tab.chart5.chart5Data3 = response.data.list.data3
+          this.tab.chart5.total = response.data.total
+          console.log('转化率图数据', this.tab.chart5.chartLine_data)
+          console.log('转化率表数据', this.tab.chart5.table.list)
+          var arrData3 = []
+          for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
+            const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
+            for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
+              if (j == myId) {
+                arrData3.push(this.tab.chart5.chart5Data3[j])
+              }
+            }
+          }
+          this.tab.chart5.chartLine_data.data3 = arrData3
+          this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
+        } else {
+          this.tab.chart5.list = []
+        }
+        this.roadChartLine5(this.tab.chart5.chartLine_data)
+        setTimeout(() => {
+          this.tab.chart5.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine5(chartLine_data) {
+      if (this.tab.chart5.chartLine != null) {
+        this.tab.chart5.chartLine.dispose()
+      }
+      this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: chartLine_data.data1,
+          right: 10
+        },
+        grid: {
+          top: '20%',
+          left: '5%',
+          right: '8%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
+        yAxis: {
+          type: 'value', name: '公斤奶饲料成本(元)'
+        },
+        series: (function() {
+          var serie = []
+          if (chartLine_data.data3 !== undefined) {
+            for (var i = 0; i < chartLine_data.data3.length; i++) {
+              var item = {
+                name: chartLine_data.data1[i],
+                type: 'line',
+                data: chartLine_data.data3[i].data
+              }
+              serie.push(item)
+            }
+          }
+          return serie
+        }())
+      }
+      this.tab.chart5.chartLine.setOption(option)
+      window.onresize = function() {
+        this.tab.chart5.chartLine.resize()
+      }
+    },
+
+    // 时间
+    changeChartDate(item) {
+      console.log(item)
+      if (item == 'chart1') {
+        if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart1()
+        } else {
+          this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart1.getdataListParm.parammaps.startTime = ''
+          this.tab.chart1.getdataListParm.parammaps.stopTime = ''
+          this.getChart1()
+        }
+      } else if (item == 'chart2') {
+        if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart2()
+        } else {
+          this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart2.getdataListParm.parammaps.startTime = ''
+          this.tab.chart2.getdataListParm.parammaps.stopTime = ''
+          this.getChart2()
+        }
+      } else if (item == 'chart3') {
+        if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart3()
+        } else {
+          this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart3.getdataListParm.parammaps.startTime = ''
+          this.tab.chart3.getdataListParm.parammaps.stopTime = ''
+          this.getChart3()
+        }
+      } else if (item == 'chart4') {
+        if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart4()
+        } else {
+          this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart4.getdataListParm.parammaps.startTime = ''
+          this.tab.chart4.getdataListParm.parammaps.stopTime = ''
+          this.getChart4()
+        }
+      } else if (item == 'chart5') {
+        if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
+          this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          this.getChart5()
+        } else {
+          this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
+          this.tab.chart5.getdataListParm.parammaps.startTime = ''
+          this.tab.chart5.getdataListParm.parammaps.stopTime = ''
+          this.getChart5()
+        }
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 'chart1') {
+        console.log('泌乳牛干物质采食量导出')
+        var excelDatasTabChart1 = [
+          {
+            tHeader: ['日期', '泌乳牛采食量', '泌乳牛产奶量'],
+            filterVal: ['日期', 'field1', 'field2'],
+            tableDatas: this.tab.chart1.table.list,
+            sheetName: '泌乳牛采食量'
+          }
+        ]
+        json2excel(excelDatasTabChart1, '泌乳牛采食量', true, 'xlsx')
+      } else if (item == 'chart2') {
+        console.log('牛栏剩料率导出')
+        var excelDatasTabChart2 = [
+          {
+            tHeader: ['日期', '栏舍名称', '剩料量', '撒料量', '剩料率'],
+            filterVal: ['日期', '名称', '剩料量', '撒料量', '准确率'],
+            tableDatas: this.tab.chart2.table.list,
+            sheetName: '牛栏剩料率'
+          }
+        ]
+        json2excel(excelDatasTabChart2, '牛栏剩料率', true, 'xlsx')
+      } else if (item == 'chart3') {
+        console.log('混料时间统计导出')
+        var excelDatasTabChart3 = [
+          {
+            tHeader: ['日期', '混料时间(分钟)'],
+            filterVal: ['日期', 'field1'],
+            tableDatas: this.tab.chart3.table.list,
+            sheetName: '混料时间统计'
+          }
+        ]
+        json2excel(excelDatasTabChart3, '混料时间统计', true, 'xlsx')
+      } else if (item == 'chart4') {
+        console.log('转化率导出')
+        var excelDatasTabChart4 = [
+          {
+            tHeader: ['日期', '配方名称', '饲料转化率'],
+            filterVal: ['日期', '名称', '准确率'],
+            tableDatas: this.tab.chart4.table.list,
+            sheetName: '转化率统计'
+          }
+        ]
+        json2excel(excelDatasTabChart4, '转化率', true, 'xlsx')
+      } else if (item == 'chart5') {
+        console.log('成本分析导出')
+        var excelDatasTabChart5 = [
+          {
+            tHeader: ['日期', '牲畜类别', '公斤奶饲料成本(元)'],
+            filterVal: ['日期', '名称', '准确率'],
+            tableDatas: this.tab.chart5.table.list,
+            sheetName: '成本分析'
+          }
+        ]
+        json2excel(excelDatasTabChart5, '成本分析', true, 'xlsx')
+      }
+    },
+    // 切换表格
+    handleTable(item) {
+      // 显示切换表格
+      if (item == 'chart1') {
+        console.log('泌乳牛采食量表格')
+        this.tab.chart1.isTable = true
+        this.tab.chart1.isChart = false
+      } else if (item == 'chart2') {
+        console.log('牛栏剩料率表格')
+        this.tab.chart2.isTable = true
+        this.tab.chart2.isChart = false
+      } else if (item == 'chart3') {
+        console.log('混料时间统计表格')
+        this.tab.chart3.isTable = true
+        this.tab.chart3.isChart = false
+      } else if (item == 'chart4') {
+        console.log('转化率表格')
+        this.tab.chart4.isTable = true
+        this.tab.chart4.isChart = false
+      } else if (item == 'chart5') {
+        console.log('成本分析表格')
+        this.tab.chart5.isTable = true
+        this.tab.chart5.isChart = false
+      }
+    },
+    // 切换图表
+    handleChart(item) {
+      // 显示切换图表
+      if (item == 'chart1') {
+        console.log('泌乳牛采食量图表')
+        this.tab.chart1.isTable = false
+        this.tab.chart1.isChart = true
+        this.getChart1()
+      } else if (item == 'chart2') {
+        console.log('牛栏剩料率图表')
+        this.tab.chart2.isTable = false
+        this.tab.chart2.isChart = true
+        this.getChart2()
+      } else if (item == 'chart3') {
+        console.log('混料时间统计图表')
+        this.tab.chart3.isTable = false
+        this.tab.chart3.isChart = true
+        this.getChart3()
+      } else if (item == 'chart4') {
+        console.log('转化率图表')
+        this.tab.chart4.isTable = false
+        this.tab.chart4.isChart = true
+        this.getChart4()
+      } else if (item == 'chart5') {
+        console.log('成本分析图表')
+        this.tab.chart5.isTable = false
+        this.tab.chart5.isChart = true
+        this.getChart5()
+      }
+    },
+    // 切换tab2日期
+    changeTab2Date() {
+      this.getTab2List()
+      this.getTab2List2()
+      this.getTab2List3()
+      this.getTab2List4()
+    },
+    // 宾州筛分析
+    getTab2List() {
+      this.tab2.table.listLoading = true
+      GetDataByName(this.tab2.table.getdataListParm).then(response => {
+        console.log('宾州筛分析table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab2.table.list = response.data.list
+          this.tab2.table.total = response.data.total
+        } else {
+          this.tab2.table.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    // 粪便筛分析
+    getTab2List2() {
+      this.tab2.table2.listLoading = true
+      this.tab2.table2.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
+      GetDataByName(this.tab2.table2.getdataListParm).then(response => {
+        console.log('粪便筛分析table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab2.table2.list = response.data.list
+          this.tab2.table2.total = response.data.total
+        } else {
+          this.tab2.table2.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table2.listLoading = false
+        }, 100)
+      })
+    },
+
+    // BCS评分
+    getTab2List3() {
+      this.tab2.table3.listLoading = true
+      this.tab2.table3.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
+      GetDataByName(this.tab2.table3.getdataListParm).then(response => {
+        console.log('BCS评分table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab2.table3.list = response.data.list
+          this.tab2.table3.total = response.data.total
+        } else {
+          this.tab2.table3.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table3.listLoading = false
+        }, 100)
+      })
+    },
+
+    // 粪便评分
+    getTab2List4() {
+      this.tab2.table4.listLoading = true
+      this.tab2.table4.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
+      GetDataByName(this.tab2.table4.getdataListParm).then(response => {
+        console.log('成本分析table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab2.table4.list = response.data.list
+          this.tab2.table4.total = response.data.total
+        } else {
+          this.tab2.table4.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table4.listLoading = false
+        }, 100)
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .button{
+    height: 50px;
+    .exportTable{float: right;margin-right: 5px;}
+  }
+  .app-container1{padding-left: 10px;background-color: #F4F4F4;}
+  .dashboard-editor-container {
+    background-color: #F4F4F4;
+    .grid-content{
+      background-color:#fff;padding: 0 10px;
+      h4{text-align: center;line-height: 50px;}
+    }
+  }
+</style>

+ 1148 - 0
.svn/pristine/b2/b273267010f00738e2ac93dd1159e2d9af155f3c.svn-base

@@ -0,0 +1,1148 @@
+<template>
+  <div class="app-container">
+    <div class="operation">
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate">新增车次</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleDelete">减少车次</el-button>
+      <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">校验</el-button>
+      <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder">更改顺序</el-button>
+      <div v-else style="float: left;margin-left: 10px;">
+        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
+        <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
+      </div>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">生效</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用</el-button>
+      <el-button class="import" style="float: right;" @click="handleHistoryRecords">历史记录</el-button>
+    </div>
+    <div class="search" />
+
+    <div class="table">
+      <el-table
+        id="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"
+        row-key="id"
+        @selection-change="handleSelect"
+      >
+        <el-table-column type="selection" min-width="50" />
+        <el-table-column label="车次" min-width="80px" 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" type="number" style="width:95%;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.qstr }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.barid" multiple filterable placeholder="栏舍名称" class="filter-item" style="width:95%;padding:10px 0;" @change="changeBars">
+              <el-option v-for="item in barsList" :key="item.id" :label="item.bname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="TMR编号" prop="weight" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.tmrcode }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeTMRNumber(value, scope.row)}">
+              <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="生效" min-width="70px" 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="班次" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.times }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.times" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeTimes(value, scope.row)}">
+              <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="撒料计划车次跟随" min-width="90px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.lppcode }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.lppid" filterable clearable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeCarFollow(value, scope.row)}">
+              <el-option v-for="item in carFollowList" :key="item.id" :label="item.lppcode" :value="item.id" />
+            </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.rtime }}</span>
+            <el-time-picker v-if="scope.row.Edit" v-model="scope.row.rtime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
+          </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.treatmethod }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.treatmethod" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeResidueDisposal(value, scope.row)}">
+              <el-option v-for="item in residueDisposalList" :key="item.value" :label="item.label" :value="item.label" />
+            </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.hstr }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.useinbarid" :disabled="scope.row.treatmethod == '继续饲喂'" multiple filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="changeTransferbars">
+              <el-option v-for="item in transferbarsList" :key="item.id" :label="item.bname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
+            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
+    </div>
+
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="history.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[history.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-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-button class="successBorder" @click="handleApplication">应用</el-button> -->
+        </div>
+        <div class="table">
+          <el-table
+            :key="history.tableKey"
+            v-loading="history.listLoading"
+            element-loading-text="给我一点时间"
+            :data="history.list"
+            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">
+                <span>{{ scope.row.sort }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="栏舍" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.qstr }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="TMR编号" prop="weight" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.tmrcode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="生效" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
+              </template>
+            </el-table-column>
+            <el-table-column label="班次" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.times }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="发料计划车次跟随" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.lppcode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="时间" min-width="180px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.rtime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="剩料处理方式" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.treatmethod }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="转投栏舍" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.hstr }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+          <pagination v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" />
+        </div>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button class="cancelClose cancelClose1" @click="history.dialogFormVisible = false; ">关闭</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 校验 -->
+    <el-dialog :title="textMap[check.dialogStatus]" :destroy-on-close="true" :visible.sync="check.dialogFormVisible" :close-on-click-modal="false" width="30%">
+      <div class="check">
+        <p v-if="check.temp.isDistribution == '0'">当前有栏舍未分配,建议及时进行分配,未分配栏舍如下:</p>
+        <p v-else>已分配完:当前栏舍已分配完善</p>
+        {{ check.temp.bnames }}
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
+        <el-button class="save" @click="check.dialogFormVisible=false;">确认</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, PostDataByName, failproccess, ExecDataByConfig, checkButtons } from '@/api/common'
+import Pagination from '@/components/Pagination'
+import Sortable from 'sortablejs'
+import Cookies from 'js-cookie'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'SurplusMaterialPlan',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getTMRYHList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+      ],
+      barsList: [], // 栏舍
+      residueDisposalList: [{ value: '0', label: '转投剩料' }, { value: '1', label: '继续饲喂' }], // 剩料处理方式
+      TMRNumberList: [], // TMR编号
+      barsNamesIdTempArr: [],
+      useinbarNamesIdTempArr: [],
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      frequencyList: [], // 班次
+      getCarFollowParm: {
+        name: 'getLPPCodeList',
+        offset: 0,
+        pagecount: 0,
+        parammaps: {
+          pastureid: Cookies.get('pastureid'),
+          times: ''
+        }
+      },
+      carFollowList: [], // 发料计划车次跟随
+      getTransferbarsParm: {
+        name: 'getBarListEnable',
+        offset: 0,
+        pagecount: 0,
+        parammaps: {
+          pastureid: Cookies.get('pastureid'),
+          times: ''
+        }
+      },
+      transferbarsList: [], // 转头栏舍
+      table: {
+        getdataListParm: {
+          name: 'getRemainplanList',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {},
+        temp2: {}
+      },
+      history: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {},
+        rules: {},
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+
+        getdataDateParm: {
+          name: 'getRPMaxDate',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        getdataListParm: {
+          name: 'getRemainplanListDate',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: ''
+          }
+        }
+      },
+      check: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        getCheckParm: {
+          name: 'checkRemainplan',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        temp: {
+          bnames: '',
+          isDistribution: ''
+        }
+      },
+      textMap: {
+        history: '历史记录',
+        check: '提示'
+      },
+      requestParam: {},
+      selectList: [],
+      isokDisable: false,
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      dropState: false,
+      isOrder: true
+    }
+  },
+  created() {
+    this.getButtons()
+    this.getList()
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  methods: {
+    getButtons() {
+      const Edit = 'SurplusMaterialPlan'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.barsList = response.data.getBarListEnable.list
+        this.TMRNumberList = response.data.getTMRYHList.list
+      })
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        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: '第四班' }]
+        }
+      })
+    },
+    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], 'groupEdit', 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) // 编辑保存
+          }
+          var arr = response.data.list
+
+          arr.map(function(i, j) {
+            // console.log(i, '====')
+            if (i.qstrids) {
+              return i.barid = i.qstrids.split(',')
+            } else {
+              return i.barid = []
+            }
+          })
+
+          arr.map(function(i, j) {
+            if (i.hstrids) {
+              return i.useinbarid = i.hstrids.split(',')
+            } else {
+              return i.useinbarid = []
+            }
+          })
+          this.table.list = arr
+          // this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          // this.rowDrop()
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了生效')
+    },
+    handleChangeOrder() {
+      this.isOrder = false
+      this.rowDrop()
+    },
+    saveChangeOrder() {
+      // 保存顺序
+      var sortArr = []
+      for (let i = 0; i < this.table.list.length; i++) {
+        var obj = {}
+        obj.sort = i + 1
+        obj.id = this.table.list[i].id
+        obj.pastureid = this.table.list[i].pastureid
+        sortArr.push(obj)
+      }
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortArr }}
+      this.requestParam.data[0].children = []
+      this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanSort', 'type': 'e', 'parammaps': {
+        id: '@insertSpotList.id',
+        pastureid: '@insertSpotList.pastureid',
+        sort: '@insertSpotList.sort'
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('顺序切换保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.isOrder = true
+        }
+      })
+    },
+    cancelChangeOrder() {
+      // 取消顺序
+      this.getList()
+      this.isOrder = true
+    },
+    // 行拖拽
+    rowDrop() {
+      console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
+      const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
+      const that = this
+      var sortable = Sortable.create(tbody, {
+        disabled: that.dropState,
+        onChoose({ newIndex, oldIndex }) {
+          if (that.dropState == true) {
+            sortable.destroy()
+          }
+        },
+        onEnd({ newIndex, oldIndex }) {
+          const currRow = that.table.list.splice(oldIndex, 1)[0]
+          that.table.list.splice(newIndex, 0, currRow)
+          console.log('索引', newIndex)
+          console.log('拖动数据', currRow)
+          console.log('上', that.table.list[newIndex - 1])
+          console.log('下', that.table.list[newIndex + 1])
+        }
+      })
+    },
+
+    // 模板新增
+    handleCreate() {
+      console.log('点击了新增车次')
+      // 编辑true/不可编辑false
+      // 新增操true,编辑false,编辑保存false
+      this.dropState = true
+      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
+        }
+      }
+      var sort = 1
+      if (this.table.list.length > 0) {
+        sort = parseInt(this.table.list[this.table.list.length - 1].sort) + 1
+      } else {
+        sort = 1
+      }
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': sort, 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'rtime': '', barid: '', 'treatmethod': '', 'useinbar': '', 'useinbarid': '' })
+      console.log(this.table.list)
+    },
+    // 栏舍
+    changeBars(val) {
+      console.log('点击了栏舍', val)
+      var arr = []
+      this.barsList.forEach(function(i) {
+        val.forEach(function(j) {
+          if (i.id == j) { arr.push(i) }
+        })
+      })
+      console.log('点击了栏舍', arr)
+      this.table.temp.barid = arr
+      this.barsNamesIdTempArr = arr
+      this.$forceUpdate()
+    },
+    // TMR编号
+    changeTMRNumber(item, row) {
+      row.tmrcode = this.TMRNumberList.find(obj => obj.id == item).tname
+    },
+    // 撒料计划车次跟随列表
+    changeCarFollow(item, row) {
+      if (item == '') {
+        row.lppcode = ''
+      } else {
+        row.lppcode = this.carFollowList.find(obj => obj.id == item).lppcode
+      }
+    },
+    // 班次
+    changeTimes(item, row) {
+      console.log(item, row)
+      this.getCarFollowParm.parammaps.times = item
+      this.getCarFollowList(row)
+    },
+    // 撒料计划车次跟随列表
+    getCarFollowList(row) {
+      GetDataByName(this.getCarFollowParm).then(response => {
+        console.log('撒料计划车次跟随列表数据', response.data.list)
+        if (response.data.list !== null) {
+          this.carFollowList = response.data.list
+          row.lppid = this.carFollowList[0].id
+          row.lppcode = this.carFollowList[0].lppcode
+        }
+      })
+    },
+    changeResidueDisposal(item, row) {
+      console.log(item, row)
+      this.getCarFollowParm.parammaps.times = item
+      this.getTransferbarsList()
+    },
+    getTransferbarsList() {
+      GetDataByName(this.getTransferbarsParm).then(response => {
+        if (response.data.list !== null) {
+          this.transferbarsList = response.data.list
+        }
+      })
+    },
+    // 转头栏舍
+    changeTransferbars(val) {
+      console.log('点击了转头栏舍', val)
+      var arr2 = []
+      this.transferbarsList.forEach(function(i) {
+        val.forEach(function(j) {
+          if (i.id == j) { arr2.push(i) }
+        })
+      })
+      this.table.temp2.useinbar = arr2
+      this.useinbarNamesIdTempArr = arr2
+      this.$forceUpdate()
+    },
+
+    createData(row) {
+      console.log('点击了新增保存', row)
+      if (row.rtime == null || row.rtime == 'null') {
+        row.rtime = ''
+      }
+      if (row.sort == '' && row.barid == '' && row.tmrid == '' && row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: '车次/栏舍/TMR编号/班次/剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.barid == '' && row.tmrid == '' && row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: '栏舍/TMR编号/班次/剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '' && row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: '班次/剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.sort == '' || row.sort == 0) {
+        this.$message({ type: 'error', message: '车次不能为空且大于0', duration: 2000 })
+        return false
+      } else if (row.barid == '') {
+        this.$message({ type: 'error', message: '栏舍不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '') {
+        this.$message({ type: 'error', message: 'TMR编号不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      } else if (row.treatmethod == '') {
+        this.$message({ type: 'error', message: '剩料处理方式不能为空', duration: 2000 })
+        return false
+      }
+      if (row.treatmethod !== '' && row.treatmethod == '转投剩料') {
+        if (row.useinbarid == '') {
+          this.$message({ type: 'error', message: '转投栏舍不能为空', duration: 2000 })
+          return false
+        }
+      }
+      if (row.treatmethod !== '' && row.treatmethod == '继续饲喂') {
+        row.useinbarid = '0'
+      }
+      if (row.rtime == '' || row.rtime == null) {
+        row.rtime = ''
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort == this.table.list[i].sort) {
+          if (row.myId !== this.table.list[i].myId) {
+            this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+            return false
+          }
+        }
+      }
+
+      var isInteger = /^\d+$/
+      if (row.sort !== '') {
+        if (!isInteger.test(parseFloat(row.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'insertRemainplan', 'type': 'e', 'parammaps': {
+        pastureid: Cookies.get('pastureid'),
+        sort: row.sort,
+        tmrid: row.tmrid,
+        tmrcode: row.tmrcode,
+        enable: row.enable,
+        times: row.times,
+        lppid: row.lppid,
+        lppcode: row.lppcode,
+        rtime: row.rtime,
+        treatmethod: row.treatmethod
+      }}
+      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.barsNamesIdTempArr }}
+      this.requestParam.data[1].children = []
+      this.requestParam.data[1].children[0] = { 'name': 'insertRpdetail', 'type': 'e', 'parammaps': {
+        pastureid: Cookies.get('pastureid'),
+        bigid: '@insertRemainplan.LastInsertId',
+        barid: '@insertSpotList.id',
+        bar: '@insertSpotList.bname',
+        type: 0
+      }}
+      this.requestParam.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.useinbarNamesIdTempArr }}
+      this.requestParam.data[2].children = []
+      this.requestParam.data[2].children[0] = { 'name': 'insertRpdetail', 'type': 'e', 'parammaps': {
+        pastureid: Cookies.get('pastureid'),
+        bigid: '@insertRemainplan.LastInsertId',
+        barid: '@insertSpotList2.id',
+        bar: '@insertSpotList2.bname',
+        type: 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 {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        }
+      })
+    },
+    createCancel(row) {
+      console.log('点击了新增取消')
+      this.dropState = false
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.myId === this.table.list[i].myId) {
+          var listIndex = this.table.list.indexOf(this.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.table.list.splice(listIndex, 1)
+          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
+        }
+      }
+      console.log(row, '=========')
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 新增false,编辑false,编辑保存true
+      row.isCreate = false
+      row.isUpdate = false
+      row.isUpdateSave = true
+      row.temp = {}
+      row.temp2 = {}
+      if (row.useinbarid == '0') { row.useinbarid = [] }
+      if (row.barid == undefined) { row.barid = [] }
+      if (row.tmrid == undefined) { row.tmrid = '' }
+      if (row.times == undefined) { row.times = '' }
+
+      if (row.treatmethod == undefined) { row.treatmethod = '' }
+      // this.getCarFollowParm.parammaps.times = row.times
+      if (row.times == '第一班') {
+        this.getCarFollowParm.parammaps.times = 1
+        row.times = '1'
+      } else if (row.times == '第二班') {
+        this.getCarFollowParm.parammaps.times = 2
+        row.times = '2'
+      } else if (row.times == '第三班') {
+        this.getCarFollowParm.parammaps.times = 3
+        row.times = '3'
+      } else if (row.times == '第四班') {
+        this.getCarFollowParm.parammaps.times = 4
+        row.times = '4'
+      } else if (row.times == '第五班') {
+        this.getCarFollowParm.parammaps.times = 5
+        row.times = '5'
+      }
+      GetDataByName(this.getCarFollowParm).then(response => {
+        console.log('撒料计划车次跟随列表数据', response.data.list)
+        if (response.data.list !== null) {
+          this.carFollowList = response.data.list
+        }
+      })
+      console.log(row, '====')
+      if (row.lppcode == undefined) {
+        this.$set(row, 'lppid', '')
+      }
+
+      this.getTransferbarsList()
+      // row.barid = row.qstrids.split(',')
+      // row.useinbarid = row.hstrids.split(',')
+      var arr3 = []
+      for (let i = 0; i < row.barid.length; i++) {
+        arr3.push(this.barsList.find(obj => obj.id == row.barid[i]))
+      }
+      this.barsNamesIdTempArr = arr3
+      var arr4 = []
+      setTimeout(() => {
+        for (let i = 0; i < row.useinbarid.length; i++) {
+          arr4.push(this.transferbarsList.find(obj => obj.id == row.useinbarid[i]))
+        }
+      }, 500)
+      this.useinbarNamesIdTempArr = arr4
+      console.log(this.useinbarNamesIdTempArr, 'this.useinbarNamesIdTempArr')
+      this.dropState = true
+    },
+    updateData(row) {
+      console.log('点击了编辑保存', row)
+      console.log(this.useinbarNamesIdTempArr, 'this.useinbarNamesIdTempArr========')
+      if (row.rtime == null || row.rtime == 'null') {
+        row.rtime = ''
+      }
+      if (row.barid == '' && row.tmrid == '' && row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: '栏舍/TMR编号/班次/剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '' && row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '' && row.treatmethod == '') {
+        this.$message({ type: 'error', message: '班次/混剩料处理方式不能为空', duration: 2000 })
+        return false
+      } else if (row.barid == '') {
+        this.$message({ type: 'error', message: '栏舍不能为空', duration: 2000 })
+        return false
+      } else if (row.tmrid == '') {
+        this.$message({ type: 'error', message: 'TMR编号不能为空', duration: 2000 })
+        return false
+      } else if (row.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      } else if (row.treatmethod == '') {
+        this.$message({ type: 'error', message: '剩料处理方式不能为空', duration: 2000 })
+        return false
+      }
+      if (row.treatmethod !== '' && row.treatmethod == '转投剩料') {
+        if (row.useinbarid == '') {
+          this.$message({ type: 'error', message: '转投栏舍不能为空', duration: 2000 })
+          return false
+        }
+      }
+      if (row.treatmethod !== '' && row.treatmethod == '继续饲喂') {
+        row.useinbarid = '0'
+      }
+      if (row.rtime == '' || row.rtime == null) {
+        row.rtime = ''
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort == this.table.list[i].sort) {
+          if (row.id !== this.table.list[i].id) {
+            this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+            return false
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (row.sort !== '') {
+        if (!isInteger.test(parseFloat(row.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+      if (row.sort == '' || row.sort == 0) {
+        this.$message({ type: 'error', message: '车次不能为空且大于0', duration: 2000 })
+        return false
+      }
+      if (row.times == '第一班') {
+        row.times = 1
+      } else if (row.times == '第二班') {
+        row.times = 2
+      } else if (row.times == '第三班') {
+        row.times = 3
+      } else if (row.times == '第四班') {
+        row.times = 4
+      } else if (row.times == '第五班') {
+        row.times = 5
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'updateRemainplan', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        id: row.id,
+        sort: row.sort,
+        tmrid: row.tmrid,
+        tmrcode: row.tmrcode,
+        enable: row.enable,
+        times: row.times,
+        lppid: row.lppid,
+        lppcode: row.lppcode,
+        rtime: row.rtime,
+        treatmethod: row.treatmethod
+      }}
+      this.requestParam.data[1] = { 'name': 'deleteRpdetail', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        bigid: row.id
+      }}
+      this.requestParam.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.barsNamesIdTempArr }}
+      this.requestParam.data[2].children = []
+      this.requestParam.data[2].children[0] = { 'name': 'insertRpdetail', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        bigid: row.id,
+        barid: '@insertSpotList2.id',
+        bar: '@insertSpotList2.bname',
+        type: 0
+      }}
+      this.requestParam.data[3] = { 'name': 'insertSpotList3', 'resultmaps': { 'list': this.useinbarNamesIdTempArr }}
+      this.requestParam.data[3].children = []
+      this.requestParam.data[3].children[0] = { 'name': 'insertRpdetail', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        bigid: row.id,
+        barid: '@insertSpotList3.id',
+        bar: '@insertSpotList3.bname',
+        type: 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 {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        }
+      })
+      // this.requestParam.name = 'updateRemainplan'
+      // this.requestParam.parammaps = row
+      // this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
+      // PostDataByName(this.requestParam).then(response => {
+      //   console.log('新增保存发送参数', this.requestParam)
+      //   if (response.msg !== 'fail') {
+      //     this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+      //     this.getList()
+      //     this.dropState = false
+      //   } else {
+      //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+      //   }
+      // })
+    },
+    updateCancel(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.getList()
+      this.dropState = false
+    },
+
+    handleSelect(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    // 行内删除
+    handleRowDelete(row) {
+      console.log(row, '点击了行删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.name = 'deleteRemainplan'
+        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: '已取消删除' })
+      })
+    },
+    // 减少车次
+    handleDelete() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteRemainplan', '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()
+            }
+          })
+        })
+      }
+    },
+    // 校验
+    handleCheck() {
+      console.log('点击了校验')
+      this.check.dialogStatus = 'check'
+      this.check.dialogFormVisible = true
+      this.getCheckList()
+    },
+    getCheckList() {
+      GetDataByName(this.check.getCheckParm).then(response => {
+        if (response.data.list[0].bnames !== undefined) {
+          this.check.temp.isDistribution = 0
+          this.check.temp.bnames = response.data.list[0].bnames
+        } else {
+          this.check.temp = {}
+          this.check.temp.isDistribution = 1
+        }
+      })
+    },
+    // 历史记录
+    handleHistoryRecords() {
+      console.log('点击了历史记录')
+      this.dialogFull = false
+      this.history.dialogStatus = 'history'
+      this.history.dialogFormVisible = true
+      this.getDateList()
+    },
+    // 历史时间
+    getDateList() {
+      GetDataByName(this.history.getdataDateParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.history.getdataListParm.parammaps.date = response.data.list[0].maxdate
+          this.getHistoryList()
+        } else {
+          this.history.getdataListParm.parammaps.date = ''
+        }
+      })
+    },
+    changeDate() {
+      this.getHistoryList()
+    },
+    // 应用
+    handleApplication() {
+      console.log('点击了应用')
+      MessageBox.confirm('是否确认将' + this.history.getdataListParm.parammaps.date + '的数据应用到当前?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'applyFPdate'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
+        this.requestParam.parammaps.date = this.history.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.getHistoryIsDisplay()
+            this.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消应用' })
+      })
+    },
+    getHistoryList() {
+      this.history.listLoading = true
+      GetDataByName(this.history.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          console.log('table数据', response.data.list)
+          this.history.list = response.data.list
+          this.history.pageNum = response.data.pageNum
+          this.history.pageSize = response.data.pageSize
+          this.history.total = response.data.total
+        } else {
+          this.history.list = []
+        }
+        setTimeout(() => {
+          this.history.listLoading = false
+        }, 100)
+      })
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 1
+          }
+          console.log('生效', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('生效保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDisable() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 0
+          }
+          console.log('禁用', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('禁用保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    }
+
+  }
+}
+
+</script>
+
+<style lang="scss" scoped>
+  .search{clear: both;}
+  .table{margin-top:10px;}
+</style>

+ 130 - 38
src/views/formulationPlan/dhedFormula/index - 副本.vue → .svn/pristine/b8/b802b35ebeb96ffb9c2bea95065bd42c262d1c2e.svn-base

@@ -1,7 +1,16 @@
 <template>
   <div class="app-container">
     <div class="operation">
-      <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleNutritional">营养评估</el-button>
+      <!-- 临时隐藏 -->
+      <!-- <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleNutritional">营养评估</el-button> -->
+      <!-- 临时隐藏 -->
+      <div class="search">
+        <el-select v-model="table.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>
+        <el-input v-model="table.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" />
+        <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      </div>
       <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleDryMatterRegulation">干物质调节</el-button>
       <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
@@ -30,45 +39,43 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
+        :max-height="myHeight"
         @header-click="headerClick"
         @cell-click="cellClick"
         @selection-change="handleSelect"
+        @cell-dblclick="celldblclick"
       >
         <el-table-column type="selection" width="50" />
-        <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
+        <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left" />
         <el-table-column label="栏舍名称" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left">
           <template slot-scope="scope">
             <span>{{ scope.row.barname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="软件牛头数" min-width="70px" align="center">
+        <el-table-column :key="2" label="软件牛头数" min-width="70px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.softccount }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="实际牛头数" min-width="90px" align="center">
+        <el-table-column :key="3" label="实际牛头数" min-width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcount(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="系数(%)" min-width="85px" align="center">
+        <el-table-column :key="4" label="系数(%)" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurRatio(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="系数头数" min-width="85px" align="center">
+        <el-table-column :key="5" label="系数头数" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="配方模板" min-width="130px" align="center">
+        <el-table-column :key="6" label="配方模板" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
             <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="配方模板" class="filter-item" style="width:99%;" @change="(value)=> {changeRecipeTemplate(value, scope.row)}">
@@ -76,7 +83,7 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isPtsfname" :key="8" label="补料配方" min-width="130px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="7" label="补料配方" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
             <el-select v-if="scope.row.Edit" v-model="scope.row.ptsfid" clearable filterable placeholder="补料配方" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
@@ -84,18 +91,24 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="9" label="第一班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="10" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW(scope.row)" @focus="focusW(scope.row)" />
           </template>
         </el-table-column>
+        <el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw1 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+          </template>
+        </el-table-column>
         <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
@@ -108,56 +121,84 @@
             <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW2(scope.row)" @focus="focusW2(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="13" label="第三班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw2 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="14" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW3(scope.row)" @focus="focusW3(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="15" label="第四班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw3 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="16" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW4(scope.row)" @focus="focusW4(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column :key="17" label="总比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="120px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.sumr }}</span>
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw4 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <!-- <el-table-column :key="22" label="投喂量" min-width="80px" align="center">
+        <el-table-column :key="20" label="饲喂总比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.feedweight }}</span>
+            <span>{{ scope.row.sumr }}</span>
           </template>
-        </el-table-column> -->
-        <el-table-column :key="18" label="日投喂量" min-width="70px" align="center">
+        </el-table-column>
+        <el-table-column :key="21" label="饲喂投喂量" min-width="80px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.dailyWeight }}</span>
+            <span>{{ scope.row.todayweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="19" label="配方重量" min-width="70px" align="center">
+        <el-table-column :key="22" label="饲喂配方重量" min-width="70px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.ftweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isPtsfname" :key="20" label="补料重量" min-width="100px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="23" label="补料配方重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.supplyweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="21" label="配方干物质" min-width="70px" align="center">
+        <!-- <el-table-column :key="22" label="投喂量" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.feedweight }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column v-if="table.isPtsfname" :key="24" label="补料投喂量" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.todaysupplement }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :key="25" label="日投喂量" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.todayfeed }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :key="26" label="配方干物质" min-width="70px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.dryweight }}</span>
           </template>
@@ -171,7 +212,7 @@
           </template>
         </el-table-column>
       </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+      <!-- <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" /> -->
     </div>
     <!-- 历史记录 -->
     <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="history.dialogFormVisible" :close-on-click-modal="false" width="90%">
@@ -190,6 +231,11 @@
       <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>
+          <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> -->
         </div>
         <div class="table">
@@ -728,11 +774,13 @@ export default {
       requestParams: [
         { name: 'getFTSWList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
-        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
       ],
       recipeTemplateList: [], // 配方模板
       feedingFormulaList: [], // 补料配方
       livestockTypeList: [], // 类别
+      barList: [],
       rules: {
         cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
       },
@@ -741,11 +789,14 @@ export default {
           name: 'getFPList',
           page: 1,
           offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
+          // pagecount: parseInt(Cookies.get('pageCount')),
+          pagecount: '',
           returntype: 'Map',
           parammaps: {
             pastureid: Cookies.get('pastureid'),
-            enable: ''
+            enable: '',
+            barid: '',
+            tname: ''
           }
         },
         tableKey: 0,
@@ -916,7 +967,9 @@ export default {
           returntype: 'Map',
           parammaps: {
             pastureid: Cookies.get('pastureid'),
-            date: ''
+            date: '',
+            barid: '',
+            tname: ''
           }
         },
         isPtsfname: false, // 补料配方/补料重量
@@ -986,7 +1039,8 @@ export default {
       isShowDialog: false,
       isokDisable: false,
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight: document.documentElement.clientHeight - 85 - 140
     }
   },
   computed: {
@@ -1032,6 +1086,7 @@ export default {
         this.recipeTemplateList = response.data.getFTSWList.list
         this.feedingFormulaList = response.data.getFTBLList.list
         this.livestockTypeList = response.data.getCowclassListEnable.list
+        this.barList = response.data.getBarListEnable.list
         this.getIsDisplay()
       })
     },
@@ -1174,6 +1229,24 @@ export default {
                 response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
               }
             }
+            if (response.data.list[i].bw1 == undefined) {
+              this.$set(response.data.list[i], 'bw1', '')
+            }
+            if (response.data.list[i].bw2 == undefined) {
+              this.$set(response.data.list[i], 'bw2', '')
+            }
+            if (response.data.list[i].bw3 == undefined) {
+              this.$set(response.data.list[i], 'bw3', '')
+            }
+            if (response.data.list[i].bw4 == undefined) {
+              this.$set(response.data.list[i], 'bw4', '')
+            }
+            if (response.data.list[i].supplement !== undefined) {
+              var supplementArr = response.data.list[i].supplement.split(',')
+              for (let j = 0; j < supplementArr.length; j++) {
+                response.data.list[i]['bw' + supplementArr[j].split(':')[0]] = supplementArr[j].split(':')[2]
+              }
+            }
           }
           // console.log(response.data.list, sumr)
           for (let i = 0; i < response.data.list.length; i++) {
@@ -1213,7 +1286,9 @@ export default {
         }, 100)
       })
     },
-
+    handleSearch() {
+      this.getList()
+    },
     renderHeader(h, { column, $index }) { // h即为cerateElement的简写,具体可看vue官方文档
       return h(
         'div',
@@ -1285,7 +1360,7 @@ export default {
     changeRecipeTemplate(item, row) {
       row.myccname = this.recipeTemplateList.find(obj => obj.id == item).ccname
       if (row.bigcowclass !== row.myccname) {
-        this.$message({ type: 'warning', message: '所选配方模板与栏舍对应牲畜类别不一致', duration: 2000 })
+        this.$message({ type: 'warning', message: '所选配方模板牲畜类别与栏舍对应牲畜类别不一致', duration: 2000 })
       }
       console.log(row.supplyweight, 'row.supplyweight')
       row.ftname = this.recipeTemplateList.find(obj => obj.id == item).tname
@@ -4070,6 +4145,10 @@ export default {
       this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
       row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
     },
+    celldblclick(row, column, cell, event) {
+      console.log(row, '=====')
+      this.handleUpdate(row)
+    },
     // 编辑
     handleUpdate(row) {
       console.log(row)
@@ -4105,6 +4184,10 @@ export default {
       if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
       if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
       if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
+      if (row.bw1 == 'NaN') { this.$set(row, 'bw1', 0) }
+      if (row.bw2 == 'NaN') { this.$set(row, 'bw2', 0) }
+      if (row.bw3 == 'NaN') { this.$set(row, 'bw3', 0) }
+      if (row.bw4 == 'NaN') { this.$set(row, 'bw4', 0) }
       var arr = []
       for (let i = 1; i <= this.table.RWLength; i++) {
         var obj = {}
@@ -4120,7 +4203,10 @@ export default {
           obj['ptsid'] = '-1'
         }
         obj['weight'] = row['w' + i]
+        obj['supplement'] = row['bw' + i]
         obj['tratio'] = Math.round(row['r' + i])
+        obj['todaysupplement'] = row.todaysupplement
+        obj['todayweight'] = row.todayweight
         arr.push(obj)
       }
       if (this.table.isPtsfname == 0) {
@@ -4279,6 +4365,7 @@ export default {
         ccountradio: row.ccountratio,
         ptid: '@insertSpotList.ptid',
         ptsid: '@insertSpotList.ptsid',
+        supplement: '@insertSpotList.supplement',
         feedweight: row.feedweight,
         supplyweight: row.supplyweight,
         ratio: row.ratio
@@ -5003,7 +5090,7 @@ export default {
           ]
           var excelDatas = [
             {
-              tHeader: ['栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', '第四班比例(%)'],
+              tHeader: ['栏舍名称', '实际牛头数', '系数(%)', '配方模板', '补料配方', '第一班比例(%)', '第二班比例(%)', '第三班比例(%)', '第四班比例(%)'],
               filterVal: ['barname', '', '', '', '', '', '', '', ''],
               tableDatas: this.download.list,
               sheetName: 'Sheet1'
@@ -5149,8 +5236,13 @@ export default {
       this.isShowDialog = true
       this.$refs.mychild.getBalconicFormula()
       this.$refs.mychild.restTemp()
+    },
+    blurBw(row) {
+      console.log(row)
+    },
+    focusBw(row) {
+      console.log(row)
     }
-
   }
 }
 </script>

+ 964 - 0
.svn/pristine/c0/c03b4588dba245e6f0f2625bde30241267670834.svn-base

@@ -0,0 +1,964 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-input v-model="table.getdataListParm.parammaps.rolename" placeholder="角色名称" style="width: 180px;" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.createmp" 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 ref="inputDatetime" v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="handleDelete">删除</el-button>
+    </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="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.rolename" 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.remark }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.remark" 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="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.createdtime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建人" min-width="150px" 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="180" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <!-- 页面权限 -->
+            <a v-if="row.NoEdit && isRoleEdit" class="correcting" @click="handleRole(row)">页面权限</a>
+            <span v-if="row.NoEdit && isRoleEdit" class="centerSpan">|</span>
+            <!-- 新增 -->
+            <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="createData(row)" />
+            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-close" class="minCancel" @click="createCancel(row)" />
+            <!-- 编辑 -->
+            <el-button v-if="row.isUpdate && isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate && isRoleEdit" icon="el-icon-delete" class="miniDanger" @click="handleRowDelete(row)" />
+            <!-- 编辑保存 -->
+            <el-button v-if="row.isUpdateSave && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave && isRoleEdit" icon="el-icon-close" class="minCancel" @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 :fullscreen="dialogFull" :visible.sync="role.dialogFormVisible" :close-on-click-modal="false" width="70%">
+      <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[role.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="role-details inside-base">
+        <div class="inside-base-main clearfix">
+          <div class="inside-base-cont">
+            <div class="role-cont clearfix">
+              <div>
+                <el-table
+                  ref="table"
+                  :data="tableData"
+                  style="width: 100%;margin-bottom: 20px;"
+                  row-key="id"
+                  border
+                  :indent="10"
+                  :select-on-indeterminate="true"
+                  :default-expand-all="false"
+                  show-checkbox
+                  :checked-keys="defaultCheckedKeys"
+                  :tree-props="{children: 'childList', hasChildren: 'hasChildren'}"
+                >
+                  <el-table-column header-align="center" prop="name" label="页面" />
+                  <el-table-column header-align="center" label="查看" :render-header="renderSeeHeader">
+                    <template slot-scope="scope">
+                      <el-checkbox v-model="scope.row.fnCheck.seebutton" :indeterminate="scope.row.indeterminate.seebutton" label="查看" @change="fnCheckEv(scope, 'seebutton')" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column header-align="center" label="编辑" :render-header="renderEditHeader">
+                    <template slot-scope="scope">
+                      <el-checkbox v-model="scope.row.fnCheck.editbutton" :indeterminate="scope.row.indeterminate.editbutton" label="编辑" @change="fnCheckEv(scope, 'editbutton')" />
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
+          <el-button class="cancelClose" @click="role.dialogFormVisible = false;getList(); ">取消</el-button>
+          <el-button v-if="role.dialogStatus==='role'" class="save" :disabled="isokDisable" @click="roleData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, transData, 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: 'Role',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
+
+      table: {
+        getdataListParm: {
+          name: 'getRoleList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            rolename: '',
+            createmp: '',
+            enable: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+      requestParam: {},
+      selectList: [],
+      role: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {}
+      },
+      // parentType: [],
+      getRecuListParm: {
+        name: 'getMenuByRole',
+        parammaps: {
+          pastureid: Cookies.get('pastureid')
+        }
+      },
+      tableData: [],
+      defaultCheckedKeys: [],
+      // tableData: [
+      //   {
+      //     id: 1, page: '配方计划', pageCheck: false,
+      //     fnList: ['查看', '编辑'],
+      //     fnCheck: { see: false, edit: false },
+      //     childList: [
+      //       { p_id: 1, id: 31, page: '配方模板', pageCheck: false, fnList: ['查看', '编辑'], fnCheck: { see: false, edit: false }},
+      //       { p_id: 1, id: 32, page: '栏舍配方', pageCheck: false, fnList: ['查看', '编辑'], fnCheck: { see: false, edit: false }}
+      //     ]
+      //   }, {
+      //     id: 2, page: '栏舍生产', pageCheck: false,
+      //     fnList: ['查看', '编辑'],
+      //     fnCheck: { see: false, edit: false },
+      //     childList: [
+      //       { p_id: 2, id: 33, page: '栏舍产奶量', pageCheck: false, fnList: ['查看', '编辑'], fnCheck: { see: false, edit: false }},
+      //       { p_id: 2, id: 34, page: '栏舍剩料量', pageCheck: false, fnList: ['查看', '编辑'], fnCheck: { see: false, edit: false }}
+      //     ]
+      //   }
+      // ],
+      isokDisable: false,
+      textMap: {
+        role: '权限管理'
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+
+    }
+  },
+
+  created() {
+    this.getList()
+    this.getButtons()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'Role'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    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 = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了是否启用')
+    },
+    handleConfirmStartChange() {
+      console.log('点击了确认开始')
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.rolename = ''
+      this.table.getdataListParm.parammaps.createmp = ''
+      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() {
+      console.log('点击了新增')
+      // 编辑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, 'confirmStart': 1, 'createdtime': parseTime(new Date(), '{y}-{m}-{d}'), 'createmp': Cookies.get('employename'), 'rolename': '' })
+    },
+    createData(row) {
+      console.log('点击了新增保存', row)
+      this.table.temp.pastureid = Cookies.get('pastureid')
+      this.table.temp.empname = row.empname
+      this.table.temp.rolename = row.rolename
+      this.table.temp.enable = row.enable
+      this.table.temp.remark = row.remark
+      this.table.temp.createmp = row.createmp
+      // 检验角色名称/角色是否为空
+      if (this.table.temp.rolename == '') {
+        this.$message({ type: 'error', message: '角色名称不能为空', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'createRole'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const isRepeat = new RegExp('Duplicate entry')
+          if (isRepeat.test(response.data)) {
+            this.$message({ type: 'error', message: '角色名称不可重复', duration: 2000 })
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        }
+      })
+    },
+    createCancel(row) {
+      console.log('点击了新增取消')
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.myId === this.table.list[i].myId) {
+          var listIndex = this.table.list.indexOf(this.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.table.list.splice(listIndex, 1)
+          return
+        }
+      }
+    },
+    handleUpdate(row) {
+      console.log('点击了编辑')
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (this.table.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 新增false,编辑false,编辑保存true
+      row.isCreate = false
+      row.isUpdate = false
+      row.isUpdateSave = true
+    },
+    updateData(row) {
+      console.log('点击了编辑保存', row)
+      this.table.temp.pastureid = Cookies.get('pastureid')
+      this.table.temp.id = row.id
+      this.table.temp.empname = row.empname
+      this.table.temp.rolename = row.rolename
+      this.table.temp.enable = row.enable
+      this.table.temp.remark = row.remark
+      // 检验角色名称/角色是否为空
+      if (this.table.temp.rolename == '') {
+        this.$message({ type: 'error', message: '角色名称不能为空', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'updateRole'
+      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(() => {
+        console.log(this.selectList)
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
+        this.requestParam.data[0] = { 'name': 'checkDeleteRole', 'type': 'v', 'parammaps': {
+          'pastureid': row.pastureid,
+          'id': row.id
+        }}
+        this.requestParam.data[1] = { 'name': 'deleteRole', 'type': 'e', 'parammaps': {
+          'pastureid': row.pastureid,
+          'id': row.id
+        }}
+        ExecDataByConfig(this.requestParam).then(response => {
+          console.log('删除保存发送参数', this.requestParam)
+          if (response.msg === 'fail') {
+            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+            this.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+    handleSelectionChange(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择角色信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('是否确认删除此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          for (let i = 0; i < this.selectList.length; i++) {
+            this.requestParam.data[i] = { 'name': 'checkDeleteRole', 'type': 'v', 'parammaps': {
+              'pastureid': this.selectList[i].pastureid,
+              'id': this.selectList[i].id
+            }}
+          }
+          this.requestParam.data[this.selectList.length] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[this.selectList.length].children = []
+          this.requestParam.data[this.selectList.length].children[0] = { 'name': 'deleteRole', 'type': 'e', 'parammaps': {
+            'pastureid': '@insertSpotList.pastureid',
+            'id': '@insertSpotList.id'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('删除保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleRole(row) {
+      this.role.temp = Object.assign({}, row)
+      console.log('点击了行内页面权限')
+      this.dialogFull = false
+      this.role.dialogStatus = 'role'
+      this.role.dialogFormVisible = true
+      this.tableData = []
+      this.getRecuListParm.parammaps.roleid = row.id
+      this.getRoleList()
+    },
+    getRoleList() {
+      GetDataByName(this.getRecuListParm).then(response => {
+        if (response.data.list !== null) {
+          this.tableData = transData(response.data.list, 'id', 'pid', 'children')
+          console.log(this.tableData)
+          this.tableData.forEach((item, i) => {
+            item.childList = item.children
+            this.$set(item, 'fnCheck', {})
+            this.$set(item, 'indeterminate', { 'seebutton': false, 'editbutton': false })
+            if (item.seebutton == 1) { this.$set(item.fnCheck, 'seebutton', true) } else if (item.seebutton == 0) { this.$set(item.fnCheck, 'seebutton', false) } else if (item.seebutton == 2) { this.$set(item.indeterminate, 'seebutton', true) } else if (item.seebutton == 3) { this.$set(item.indeterminate, 'seebutton', false) }
+            if (item.editbutton == 1) { this.$set(item.fnCheck, 'editbutton', true) } else if (item.editbutton == 0) { this.$set(item.fnCheck, 'editbutton', false) } else if (item.seebutton == 2) { this.$set(item.indeterminate, 'editbutton', true) } else if (item.seebutton == 3) { this.$set(item.indeterminate, 'editbutton', false) }
+            if (item.seebutton == 2) { this.$set(item.indeterminate, 'seebutton', true) } else if (item.seebutton == 0) { this.$set(item.indeterminate, 'seebutton', false) }
+            if (item.editbutton == 3) { this.$set(item.indeterminate, 'editbutton', true) } else if (item.editbutton == 0) { this.$set(item.indeterminate, 'editbutton', false) }
+            if (item.childList !== undefined && item.childList.length > 0) {
+              item.childList.forEach((item, i) => {
+                this.$set(item, 'fnCheck', {})
+                this.$set(item, 'indeterminate', { 'seebutton': false, 'editbutton': false })
+                if (item.seebutton == 1) { this.$set(item.fnCheck, 'seebutton', true) } else if (item.seebutton == 0) { this.$set(item.fnCheck, 'seebutton', false) }
+                if (item.editbutton == 1) { this.$set(item.fnCheck, 'editbutton', true) } else if (item.editbutton == 0) { this.$set(item.fnCheck, 'editbutton', false) }
+              })
+            }
+          })
+          console.log(this.tableData)
+        }
+      })
+    },
+    // 查找父级函数
+    getParent(data2, nodeId2) {
+      var arrRes = []
+      if (data2.length === 0) {
+        if (nodeId2) {
+          arrRes.push(data2)
+        }
+        return arrRes
+      }
+      const rev = (data, nodeId) => {
+        for (var i = 0, length = data.length; i < length; i++) {
+          const node = data[i]
+          if (node.id === nodeId) {
+            arrRes.push(node)
+            rev(data2, node.pid)
+            break
+          } else {
+            if (node.childList) {
+              rev(node.childList, nodeId)
+            }
+          }
+        }
+        return arrRes
+      }
+      arrRes = rev(data2, nodeId2)
+      return arrRes
+    },
+
+    /**
+    * 功能选择
+    */
+    // 子选框事件
+    fnCheckEv(scope, type) {
+      // 如果有子项,则子项的选框选择跟当前一致
+      if (scope.row.childList) {
+        console.log(scope.row)
+        this.handleFnAll(scope.row, scope.row.fnCheck[type], scope.row.indeterminate[type], type)
+      }
+      // 查找父级选框
+      this.getParent(this.tableData, scope.row.id).forEach((item, i) => {
+        // console.log(item)
+        if (type == 'seebutton') {
+          if (!item.childList) {
+            console.log(item)
+            item.fnCheck[type] = scope.row.fnCheck[type]
+          } else {
+            let num = 0
+            item.childList.forEach((item, i) => {
+              if (item.fnCheck[type] === true) {
+                num += 1
+              }
+            })
+            if (num === item.childList.length) {
+              console.log(item)
+              item.fnCheck[type] = true
+              item.indeterminate[type] = false
+            } else {
+              item.fnCheck[type] = false
+              item.fnCheck['editbutton'] = false
+              const childListArr = []
+              const childEditListArr = []
+              console.log(item.childList)
+              item.childList.forEach((item, index) => {
+                console.log(item) // d打印正常
+                console.log(item.fnCheck) // d打印正常
+                // console.log(item.fnCheck['editbutton'])//错误?
+                console.log(item.fnCheck.editbutton)// 错误?
+                childListArr.push(item.fnCheck[type])
+                childEditListArr.push(item.fnCheck['editbutton'])
+              })
+
+              console.log(childEditListArr)
+              if (childListArr.includes(true)) {
+                item.indeterminate[type] = true
+                item.fnCheck['editbutton'] = false
+                console.log(childEditListArr)
+                if (childEditListArr.includes(true)) { // 判断编辑子级是否有true
+                  item.indeterminate['editbutton'] = true
+                } else {
+                  item.indeterminate['editbutton'] = false
+                }
+                if (item.childList.length > 0) {
+                  item.childList.forEach((item, i) => {
+                    if (item.fnCheck['editbutton'] === false) {
+                      item.fnCheck['editbutton'] = false
+                    } else {
+                      item.fnCheck['editbutton'] = item.fnCheck[type]
+                    }
+                  })
+                }
+              } else {
+                item.indeterminate[type] = false
+                console.log(item)
+                // item.indeterminate['editbutton'] = false
+                const editArr = []
+                if (item.childList.length > 0) {
+                  item.childList.forEach((item, i) => {
+                    item.fnCheck['editbutton'] = item.fnCheck[type]
+                    editArr.push(item.fnCheck['editbutton'])
+                  })
+                }
+                if (editArr.includes(true)) { // 判断编辑子级是否有true
+                  item.indeterminate['editbutton'] = true
+                } else {
+                  item.indeterminate['editbutton'] = false
+                }
+              }
+            }
+          }
+        } else if (type == 'editbutton') {
+          if (!item.childList) {
+            item.fnCheck[type] = scope.row.fnCheck[type]
+          } else {
+            let num = 0
+            item.childList.forEach((item, i) => {
+              if (item.fnCheck[type] === true) {
+                num += 1
+              }
+            })
+            if (num === item.childList.length) {
+              item.fnCheck[type] = true
+              item.fnCheck['seebutton'] = true
+              item.indeterminate[type] = false
+              item.indeterminate['seebutton'] = false
+              item.childList.forEach((item, i) => { // 编辑时,选中编辑的同时,选中查看
+                console.log(item)
+                if (item.fnCheck['seebutton'] === false) { // 查看未选中时,选中编辑可控制查看
+                  item.fnCheck['seebutton'] = item.fnCheck['editbutton']
+                }
+              })
+              console.log(item)
+            } else {
+              console.log(item)
+              item.fnCheck[type] = false
+              console.log(item.fnCheck['seebutton'])
+              if (item.fnCheck['seebutton'] === false) { // 查看未选中时,选中编辑可控制查看
+                item.fnCheck['seebutton'] = false
+              }
+              const childListArr = []
+              for (let i = 0; i < item.childList.length; i++) {
+                childListArr.push(item.childList[i].fnCheck[type])
+              }
+              childListArr.includes(true)
+              if (childListArr.includes(true)) {
+                if (item.fnCheck['seebutton'] === false) {
+                  item.indeterminate['seebutton'] = true
+                }
+                item.indeterminate[type] = true
+              } else {
+                // if (item.fnCheck['seebutton'] === false) {
+                //    item.indeterminate['seebutton'] = false
+                // }
+
+                item.indeterminate[type] = false
+              }
+              // item.indeterminate[type] = true
+              item.childList.forEach((item, i) => { // 编辑时,选中编辑的同时,选中查看
+                if (item.fnCheck['seebutton'] === false) {
+                  item.fnCheck['seebutton'] = item.fnCheck['editbutton']
+                }
+              })
+              console.log(item)
+            }
+          }
+        }
+      })
+    },
+    handleFnAll(row, fnCheck, indeterminate, type) {
+      console.log(row, fnCheck, indeterminate, type)
+      row.fnCheck[type] = fnCheck
+      if (row.childList) {
+        const that = this
+        row.childList.forEach((element, i) => {
+          row.indeterminate[type] = false
+          console.log(fnCheck, indeterminate)
+          // console.log(element, row.childList[i], fnCheck, indeterminate, type)
+          that.handleFnAll(row.childList[i], fnCheck, indeterminate, type)
+        })
+      }
+    },
+    /**
+    * 权限选择
+    */
+    // 权限:全部、自己
+    // 子选框事件
+    dataCheckEv(scope, type) {
+      console.log(scope)
+      const temp = scope.row.dataCheck[type]
+      console.log(scope, type)
+      for (const x in scope.row.dataCheck) {
+        scope.row.dataCheck[x] = false
+      }
+      scope.row.dataCheck[type] = temp
+      // 如果有子项,则子项的选框选择跟当前一致
+      if (scope.row.childList) {
+        this.handleDataAll(scope.row, scope.row.dataCheck[type], type)
+      }
+      // 查找父级选框
+      this.getParent(this.tableData, scope.row.id).forEach((item, i) => {
+        console.log(item, '==============674')
+        for (const x in item.dataCheck) {
+          item.dataCheck[x] = false
+        }
+        if (!item.childList) {
+          console.log(item, '==============679')
+          item.dataCheck[type] = temp
+        } else {
+          var num = 0
+          item.childList.forEach((item, i) => {
+            if (item.dataCheck[type] === true) {
+              num += 1
+            }
+          })
+          if (num === item.childList.length) {
+            console.log(item, '==============689')
+            item.dataCheck[type] = true
+          } else {
+            console.log(item, '==============691')
+            item.dataCheck[type] = false
+          }
+        }
+      })
+    },
+    handleDataAll(row, dataCheck, type) {
+      for (const x in row.dataCheck) {
+        row.dataCheck[x] = false
+      }
+      row.dataCheck[type] = dataCheck
+      if (row.childList) {
+        console.log(row, dataCheck, type)
+        const that = this
+        row.childList.forEach((element, i) => {
+          that.handleDataAll(row.childList[i], dataCheck, type)
+        })
+      } else {
+        console.log(row, dataCheck, type)
+      }
+    },
+    renderSeeHeader(h, { column }) {
+      return h(
+        'div',
+        [
+          h('span', column.label),
+          h('el-checkbox', {
+            style: 'display:inline-flex;margin-left:5px;',
+            on: {
+              change: ($event, column) => this.selectSee($event, column, 'see') // 选中事件 $event, column,这里$event=true,column是input的dom当在select里打印的时候
+            }
+          })
+        ]
+      )
+    },
+    renderEditHeader(h, { column }) {
+      return h(
+        'div',
+        [
+          h('span', column.label),
+          h('el-checkbox', {
+            style: 'display:inline-flex;margin-left:5px;',
+            on: {
+              change: ($event, column) => this.selectEdit($event, column, 'edit') // 选中事件 $event, column,这里$event=true,column是input的dom当在select里打印的时候
+            }
+          })
+        ]
+      )
+    },
+    selectSee(obj, $event = this.targetEv, title) {
+      const _this = this
+      if ($event) {
+        this.targetEv = $event // 这里是获取当前点击的input的dom元素赋值给this.targetEv,方便提交后初始化使用
+      }
+      if (obj === true) {
+        this.flag = false
+      } else {
+        this.flag = true
+      }
+      this.targetEv.target.checked = obj
+      this.targetEv.target.parentNode.className = obj ? 'el-checkbox__input is-checked' : 'el-checkbox__input'
+      _this.tableData.forEach((item, index) => {
+        _this.$set(_this.tableData[index], 'check', obj.toString())
+        if (title === 'see') {
+          if (obj === true) {
+            item.fnCheck['seebutton'] = true
+            if (item.childList.length > 0) {
+              item.childList.forEach((item, index) => {
+                item.fnCheck['seebutton'] = true
+              })
+            }
+          } else {
+            item.fnCheck['seebutton'] = false
+            if (item.childList.length > 0) {
+              item.childList.forEach((item, index) => {
+                item.fnCheck['seebutton'] = false
+              })
+            }
+          }
+        }
+      })
+    },
+    selectEdit(obj, $event = this.targetEv, title) {
+      const _this = this
+      if ($event) {
+        this.targetEv = $event // 这里是获取当前点击的input的dom元素赋值给this.targetEv,方便提交后初始化使用
+      }
+      console.log('进来就错了', obj)
+      if (obj === true) {
+        this.flag = false
+      } else {
+        this.flag = true
+      }
+      this.targetEv.target.checked = obj
+      this.targetEv.target.parentNode.className = obj ? 'el-checkbox__input is-checked' : 'el-checkbox__input'
+      _this.tableData.forEach((item, index) => {
+        _this.$set(_this.tableData[index], 'check', obj.toString())
+        if (title === 'edit') {
+          if (obj === true) {
+            item.fnCheck['editbutton'] = true
+            if (item.fnCheck['seebutton'] === false) {
+              item.fnCheck['seebutton'] = true
+            }
+            if (item.childList.length > 0) {
+              item.childList.forEach((item, index) => {
+                item.fnCheck['editbutton'] = true
+                if (item.fnCheck['seebutton'] === false) {
+                  item.fnCheck['seebutton'] = true
+                }
+              })
+            }
+          } else {
+            item.fnCheck['editbutton'] = false
+            if (item.childList.length > 0) {
+              item.childList.forEach((item, index) => {
+                item.fnCheck['editbutton'] = false
+              })
+            }
+          }
+        }
+      })
+    },
+    roleData(row) {
+      console.log('点击了权限确认', this.tableData)
+      // console.log('点击了权限确认', JSON.stringify(this.tableData))
+      const dataAll = []
+      const dataArr = []
+      const dataArr2 = []
+      this.tableData.forEach((item, index) => {
+        if (item.fnCheck.seebutton === true) { item.seebutton = 1 } else { item.seebutton = 0 }
+        if (item.fnCheck.editbutton === true) { item.editbutton = 1 } else { item.editbutton = 0 }
+        if (item.indeterminate.seebutton === true) { item.seebutton = 2 }
+        if (item.indeterminate.editbutton === true) { item.editbutton = 3 }
+        if (item.childList.length > 0) {
+          item.childList.forEach((item, index) => {
+            if (item.fnCheck.seebutton === true) { item.seebutton = 1 } else { item.seebutton = 0 }
+            if (item.fnCheck.editbutton === true) { item.editbutton = 1 } else { item.editbutton = 0 }
+            dataArr2.push({ 'menuid': item.menu_id, 'seebutton': item.seebutton, 'editbutton': item.editbutton })
+          })
+        }
+        dataArr.push({ 'menuid': item.menu_id, 'seebutton': item.seebutton, 'editbutton': item.editbutton })
+      })
+      dataArr.forEach((item, index) => {
+        dataAll.push({ 'menuid': item.menuid, 'seebutton': item.seebutton, 'editbutton': item.editbutton })
+      })
+      dataArr2.forEach((item, index) => {
+        dataAll.push({ 'menuid': item.menuid, 'seebutton': item.seebutton, 'editbutton': item.editbutton })
+      })
+
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': dataAll }}
+      this.requestParam.data[0].children = []
+      this.requestParam.data[0].children[0] = { 'name': 'insertRolemenu', 'type': 'e', 'parammaps': {
+        pastureid: this.role.temp.pastureid,
+        roleid: this.role.temp.id,
+        menuid: '@insertSpotList.menuid',
+        seebutton: '@insertSpotList.seebutton',
+        editbutton: '@insertSpotList.editbutton'
+      }}
+      console.log(JSON.stringify(this.requestParam),'this.requestParam')
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('权限菜单保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          this.role.dialogFormVisible = false
+          this.getList()
+        }
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{margin-top:10px;}
+  .table{margin-top:10px;}
+  .inside-base {
+    position: relative;
+  }
+
+  .inside-base-main {
+    width: 100%;
+    background: #ffffff;
+    // box-shadow: 0px 0px 10px 0px rgba(231,232,238,1);
+    border-radius: 4px;
+    margin-bottom: 30px;
+  }
+
+  // 中间内容
+  .inside-base-cont {
+    margin: 0 20px;
+  }
+
+  .role-cont {
+    position: relative;
+    font-size: 16px;
+    color: #333333;
+    line-height: 40px;
+    > span {
+      width: 90px;
+      height: 40px;
+      text-align: right;
+      float: left;
+      margin-right: 10px;
+      margin-bottom: 20px;
+    }
+    > div {
+      position: relative;
+      width: 100%;
+      float: left;
+      margin-bottom: 20px;
+      >>> .el-input__inner {
+        width: 320px;
+      }
+    }
+  }
+  .check-page-all {
+    position: absolute;
+    top: 13px;
+    left: 11px;
+    z-index: 99;
+  }
+
+  /* element-ui css */
+  .inside-base {
+    >>> .el-input__inner {
+      font-size: 16px;
+      color: #333333;
+    }
+  }
+</style>

+ 478 - 0
.svn/pristine/c7/c73b244b0575d96c2359c2ebcd54d8f8a070cd2a.svn-base

@@ -0,0 +1,478 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-input v-model="table.getdataListParm.parammaps.Code" placeholder="设备编号" style="width: 180px;" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.name" placeholder="设备名称" style="width: 180px;" class="filter-item" clearable />
+      <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>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
+    </div>
+    <div class="table">
+      <el-form ref="form" :rules="table.rules" :model="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 v-if="table.pageNum">{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+              <span v-else>1</span>
+            </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.tclassname }}</span>
+              <el-select v-if="scope.row.Edit" v-model="scope.row.tclassid" @change="changeTclass">
+                <el-option v-for="item in equipmentTypeList" :key="item.id" :label="item.label" :value="item.id" />
+              </el-select>
+            </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.Code }}</span>
+              <el-input v-if="scope.row.Edit" v-model="scope.row.Code" placeholder="1-32个字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:80%;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.name }}</span>
+              <el-input v-if="scope.row.Edit" v-model="scope.row.name" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:80%;padding:10px 0;" maxlength="32" />
+            </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.infoCode }}</span>
+              <el-input v-if="scope.row.Edit" v-model="scope.row.infoCode" type="number" step="0.01" style="width:80%;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.remark }}</span>
+              <el-input v-if="scope.row.Edit" v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" />
+            </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="80" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <!-- 新增 -->
+              <el-button v-if="row.isCreate" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
+              <span v-if="row.isCreate" class="centerSpan">|</span>
+              <el-button v-if="row.isCreate" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+              <!-- 编辑 -->
+              <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+              <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+              <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+              <!-- 编辑保存 -->
+              <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
+              <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+              <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+  </div>
+
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'ForkliftManagement',
+  components: { Pagination },
+  data() {
+    return {
+      isRoleEdit: [],
+      enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }],
+      equipmentTypeList: [{ id: '0', name: '设备' }, { id: '6', name: '推料车' }, { id: '7', name: '推粪车' }],
+      getdownListParm: {
+        name: 'getDictByName',
+        page: 1,
+        offset: 1,
+        pagecount: '',
+        returntype: 'Map',
+        parammaps: {
+          dictname: '其他设备管理'
+        }
+      },
+      table: {
+        rules: {
+          name: { type: 'string', required: true, message: '必填字段', trigger: 'change' }
+        },
+        getdataListParm: {
+          name: 'getTmrEquipment',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureId: Cookies.get('pastureid'),
+            Code: '',
+            tclassname: '',
+            enable: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+      requestParam: {},
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+
+    }
+  },
+
+  created() {
+    this.getList()
+    this.getButtons()
+    this.getDownList()
+  },
+
+  methods: {
+    getDownList() {
+      GetDataByName(this.getdownListParm).then(response => {
+        this.equipmentTypeList = response.data.list
+      })
+    },
+    getButtons() {
+      const Edit = 'ForkliftManagement'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('table数据', response.data.list)
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'Edit', false) // 编辑
+            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
+            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
+            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
+            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
+          }
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了是否启用')
+    },
+    changeTclass(item) {
+      this.table.temp.tclassname = this.equipmentTypeList.find(obj => obj.id == item).name
+      console.log(this.table.temp)
+    },
+    handleSearch() {
+      console.log('点击了查询')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.Code = ''
+      this.table.getdataListParm.parammaps.name = ''
+      this.table.getdataListParm.parammaps.enable = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    handleCreate() {
+      console.log('点击了新增')
+      // 编辑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, 'Code': '', 'name': '', 'infoCode': '' })
+    },
+    createData(row) {
+      console.log('点击了新增保存')
+      this.table.temp.pastureId = Cookies.get('pastureid')
+      this.table.temp.Code = row.Code
+      this.table.temp.name = row.name
+      this.table.temp.infoCode = row.infoCode
+      this.table.temp.enable = row.enable
+      this.table.temp.remark = row.remark
+      this.table.temp.tclassid = row.tclassid
+      if (this.table.temp.tclassid == '' && this.table.temp.Code == '' && this.table.temp.name == '' && this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '设备类型/设备编号/设备名称/数据采集卡编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.Code == '' && this.table.temp.name == '' && this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '设备编号/设备名称/数据采集卡编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.name == '' && this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '设备名称/数据采集卡编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.tclassid == '') {
+        this.$message({ type: 'error', message: '设备类型不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.name == '') {
+        this.$message({ type: 'error', message: '设备名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.Code == '') {
+        this.$message({ type: 'error', message: '设备编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '数据采集卡编号不能为空', duration: 2000 })
+        return false
+      }
+      const infoCode = /^([0-9]|(1[0-5]))$/
+      if (!infoCode.test(parseInt(this.table.temp.infoCode))) {
+        this.$message({ type: 'error', message: '数据采集卡请输入0-15之间整数', duration: 2000 })
+        return false
+      }
+
+      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
+      console.log(this.table.temp.Code)
+      if (pattern.test(this.table.temp.Code)) {
+        this.$message({ type: 'error', message: '设备编号不可输入特殊字符', duration: 2000 })
+        return false
+      }
+      if (pattern.test(this.table.temp.name)) {
+        this.$message({ type: 'error', message: '设备名称不可输入特殊字符', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'insertTmrEquipment'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const isRepeat = new RegExp('Duplicate entry :code')
+          const isRepeat2 = new RegExp('Duplicate entry :infocode')
+          if (isRepeat.test(response.data)) {
+            this.$notify({ type: 'error', message: '设备编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          if (isRepeat2.test(response.data)) {
+            this.$notify({ type: 'error', message: '数据采集编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          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
+    },
+    updateData(row) {
+      console.log('点击了编辑保存')
+      this.table.temp.pastureId = Cookies.get('pastureid')
+      this.table.temp.Code = row.Code
+      this.table.temp.name = row.name
+      this.table.temp.infoCode = row.infoCode
+      this.table.temp.enable = row.enable
+      this.table.temp.remark = row.remark
+      this.table.temp.tclassid = row.tclassid
+      this.table.temp.tclassname = row.tclassname
+      this.table.temp.id = row.id
+      if (this.table.temp.tclassid == '' && this.table.temp.Code == '' && this.table.temp.name == '' && this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '设备类型/设备编号/设备名称/数据采集卡编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.Code == '' && this.table.temp.name == '' && this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '设备编号/设备名称/数据采集卡编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.name == '' && this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '设备名称/数据采集卡编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.tclassid == '') {
+        this.$message({ type: 'error', message: '设备类型不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.name == '') {
+        this.$message({ type: 'error', message: '设备名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.Code == '') {
+        this.$message({ type: 'error', message: '设备编号不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.infoCode == '') {
+        this.$message({ type: 'error', message: '数据采集卡编号不能为空', duration: 2000 })
+        return false
+      }
+      const infoCode = /^([0-9]|(1[0-5]))$/
+      if (!infoCode.test(parseInt(this.table.temp.infoCode))) {
+        this.$message({ type: 'error', message: '数据采集卡请输入0-15之间整数', duration: 2000 })
+        return false
+      }
+
+      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
+      console.log(this.table.temp.Code)
+      if (pattern.test(this.table.temp.Code)) {
+        this.$message({ type: 'error', message: '设备编号不可输入特殊字符', duration: 2000 })
+        return false
+      }
+      if (pattern.test(this.table.temp.name)) {
+        this.$message({ type: 'error', message: '设备名称不可输入特殊字符', duration: 2000 })
+        return false
+      }
+
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'updateTmrEquipment'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const isRepeat = new RegExp('Duplicate entry :code')
+          const isRepeat2 = new RegExp('Duplicate entry :infocode')
+          if (isRepeat.test(response.data)) {
+            this.$notify({ type: 'error', message: '设备编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          if (isRepeat2.test(response.data)) {
+            this.$notify({ type: 'error', message: '数据采集编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          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 = {}
+        this.requestParam.name = 'deleteTmrEquipment'
+        this.requestParam.parammaps = {}
+        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
+    },
+    handleDelete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择设备信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam = {}
+          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': 'deleteTmrEquipment', 'type': 'e', 'parammaps': {
+            id: '@insertSpotList.id'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('删除保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{margin-top:10px;}
+  .table{margin-top:10px;}
+</style>

+ 647 - 0
.svn/pristine/ca/ca6ebdf2e66217547d612f4e2846c01dd80f1b05.svn-base

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

+ 1797 - 0
.svn/pristine/cb/cb02ce6f523cbd7a07fdfbbd6f29dd1edc703603.svn-base

@@ -0,0 +1,1797 @@
+<template>
+  <div ref="dashboardEditor" class="dashboard-editor-container">
+    <div class="dashboard" style="margin-bottom: 10px;">
+      <div class="dashboard-l">
+        <div class="row1">
+          <div class="row1-t">
+            <div class="row1-t-l">
+              <div class="img-l" />
+              <span class="content">暂无消息通知</span>
+              <!-- <div class="img-r" /> -->
+            </div>
+            <div class="row1-t-r">{{ date }}</div>
+          </div>
+          <div class="row1-c">
+            <div class="row1-c-l">
+              <div class="title1">
+                <div class="img-title">
+                  <img src="../../../assets/images/index/l1.png">
+                </div>
+                <span class="content">混料准确率</span>
+              </div>
+              <div class="row1-c-l-c">
+                <span>
+                  <b>{{ row1.list.yesRateHL }}</b>
+                  <br>昨日
+                </span>
+              </div>
+              <div class="row1-c-l-b">
+                <div><span>近30天混料准确率:</span><b>{{ row1.list.monRateHL }}</b></div>
+              </div>
+            </div>
+            <div class="row1-c-r">
+              <div class="title1">
+                <div class="img-title">
+                  <img src="../../../assets/images/index/l4.png">
+                </div>
+                <span class="content">撒料准确率</span>
+              </div>
+              <div class="row1-c-l-c">
+                <span>
+                  <b>{{ row1.list.yesRateSL }}</b>
+                  <br>昨日
+                </span>
+              </div>
+              <div class="row1-c-l-b">
+                <div><span>近30天撒料准确率:</span><b>{{ row1.list.monRateSL }}</b></div>
+              </div>
+            </div>
+          </div>
+          <div class="row1-b">
+            <div class="row1-b-l">
+              <div class="title1">
+                <div class="img-title">
+                  <img src="../../../assets/images/index/l3.png">
+                </div>
+                <span class="content">撒料正确率</span>
+              </div>
+              <div class="row1-c-l-c">
+                <span>
+                  <b>{{ row1.list.yesRateSLR }}</b>
+                  <br>昨日
+                </span>
+              </div>
+              <div class="row1-c-l-b">
+                <div><span>近30天撒料正确率:</span><b>{{ row1.list.monRateSLR }}</b></div>
+              </div>
+            </div>
+            <div class="row1-b-r">
+              <div class="title1">
+                <div class="img-title">
+                  <img src="../../../assets/images/index/l2.png">
+                </div>
+                <span class="content">撒料偏差</span>
+              </div>
+              <div class="row1-c-l-c">
+                <span>
+                  <b>{{ row1.list.temtime }}</b>
+                  <br>昨日
+                </span>
+              </div>
+              <div class="row1-c-l-b">
+                <div><span>近30天撒料偏差:</span><b>{{ row1.list.montime }}</b>分钟</div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="row2">
+          <div class="title">
+            <div class="img-title" />
+            <span class="content">今日计划统计</span>
+          </div>
+          <div class="todayPlan">
+            <div>
+              <div id="row2chartLine1" style="height: 185px;" />
+              <div class="bottom">
+                <div class="bottom-l">
+                  <div class="bottom-l-t">
+                    <b>{{ row2.chart1.chartLine_data.data1 }}</b>次
+                  </div>
+                  <div class="bottom-l-b">
+                    完成车次
+                  </div>
+                </div>
+                <div class="bottom-r">
+                  <div class="bottom-r-t">
+                    <b>{{ row2.chart1.chartLine_data.data2 }}</b>次
+                  </div>
+                  <div class="bottom-r-b">
+                    计划车次
+                  </div>
+                </div>
+              </div>
+            </div>
+            <div>
+              <div id="row2chartLine2" style="height: 185px;" />
+              <div class="bottom">
+                <div class="bottom-l">
+                  <div class="bottom-l-t">
+                    <b>{{ row2.chart2.chartLine_data.data1 }}</b>kg
+                  </div>
+                  <div class="bottom-l-b">
+                    完成重量
+                  </div>
+                </div>
+                <div class="bottom-r">
+                  <div class="bottom-r-t">
+                    <b>{{ row2.chart2.chartLine_data.data2 }}</b>kg
+                  </div>
+                  <div class="bottom-r-b">
+                    计划重量
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+
+        <div class="row3" style="position: relative;">
+          <div class="title">
+            <div class="img-title" />
+            <span class="content">成本统计</span>
+          </div>
+          <div v-if="row4.chart1.isChart" class="button">
+            <div class="exportTable" @click="handleExport('row4chartLine1')">导出</div>
+            <div class="exportTable" @click="handleTable('row4chartLine1')">切换表格</div>
+          </div>
+          <div v-if="row4.chart1.isChart" id="row4chartLine1" v-loading="row4.chart1.listLoading" style="background: #fff;height:310px;" />
+          <div v-if="row4.chart1.isTable" class="table" style="position: absolute;width: 100%;">
+            <div class="button">
+              <div class="exportTable" @click="handleExport('row4chartLine1')">导出</div>
+              <div class="exportTable" @click="handleChart('row4chartLine1')">切换图表</div>
+            </div>
+            <el-table
+              :key="row4.chart1.table.tableKey"
+              v-loading="row4.chart1.table.listLoading"
+              element-loading-text="给我一点时间"
+              :data="row4.chart1.table.list"
+              border
+              fit
+              highlight-current-row
+              style="width: 100%;margin-top: 10px;"
+              height="300"
+              :row-style="rowStyle"
+              :cell-style="cellStyle"
+              class="elTable table-fixed"
+            >
+              <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+              <el-table-column label="单头牛饲料成本" sortable min-width="110px" align="center" prop="field2" />
+              <el-table-column label="公斤奶饲料成本(元)" sortable min-width="120px" align="center" prop="field1" />
+            </el-table>
+          </div>
+        </div>
+      </div>
+      <div class="dashboard-r">
+        <div class="row1">
+          <div class="title">
+            <div class="img-title" />
+            <span class="content">实时监控</span>
+          </div>
+          <div v-if="carLength>0" id="row2chartLine3" ref="row2chartLine3" style="height: 260px;" />
+          <div v-else style="height: 260px;text-align: center;line-height: 260px;">当前无正在进行中车次 </div>
+          <div class="carsLength">当前车辆:<span>{{ carLength }}</span></div>
+          <div id="car" ref="car" v-loading="row2.chart3.listLoading2" class="car">
+            <div ref="iconLeft" class="iconLeft" @click="handleLeft">
+              <img v-if="row2.chart3.isLeft" src="../../../assets/images/index/row-r3.png" class="img-title">
+              <img v-if="row2.chart3.isLeftA" src="../../../assets/images/index/row-r2.png" class="img-title">
+            </div>
+            <div id="carList" ref="carList" class="carList">
+              <div v-for="(item,index) in list" ref="listW" :key="index" class="listW">
+                <div ref="list" class="list" :style="{'background': item.background,'color':item.color,'borderColor':item.borderColor}" @click="handleList(index,item)">
+                  <div class="list-t">
+                    <div class="list-t-t">
+                      <el-tooltip :content="item.tname" placement="top">
+                        <span>车辆:{{ item.tname }}</span>
+                      </el-tooltip>
+                    </div>
+                    <div class="list-t-t">
+                      <el-tooltip :content="item.fname" placement="top">
+                        <span v-if="item.inorout == 0">饲料:{{ item.fname }}</span>
+                        <span v-if="item.inorout == 1">栏舍:{{ item.fname }}</span>
+                      </el-tooltip>
+                    </div>
+                    <div class="list-t-t">
+                      <el-tooltip :content="item.remark" placement="top">
+                        <span>描述:{{ item.remark }}</span>
+                      </el-tooltip>
+                    </div>
+                  </div>
+
+                  <div class="list-b">
+                    <div class="list-b-l">
+                      <div class="left">
+                        <div class="num"><b>{{ item.doneweight }}</b>Kg</div>
+                        <div class="weight">完成重量</div>
+                      </div>
+                      <div class="right" />
+                    </div>
+                    <div class="list-b-l">
+                      <div class="left">
+                        <div class="num"><b>{{ item.leftweight }}</b>Kg</div>
+                        <div class="weight">剩余重量</div>
+                      </div>
+                      <div class="right" />
+                    </div>
+                    <div class="list-b-l">
+                      <div class="left">
+                        <div class="num"><b>{{ item.nowweight }}</b>Kg</div>
+                        <div class="weight">车辆当前载重</div>
+                      </div>
+                      <div class="right" />
+                    </div>
+                    <div class="list-b-l">
+                      <div class="left">
+                        <div class="num"><b>{{ item.lweight }}</b>Kg</div>
+                        <div class="weight">计划重量</div>
+                      </div>
+                      <div class="right" />
+                    </div>
+                    <div class="list-b-l">
+                      <div class="left">
+                        <div class="num"><b>{{ item.donerate }}</b></div>
+                        <div class="weight">完成度</div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <div v-if="item.isChecked" ref="checked" class="img-checked" />
+              </div>
+            </div>
+            <div ref="iconRight" class="iconRight" @click="handleRight">
+              <img v-if="row2.chart3.isRightA" src="../../../assets/images/index/row-r5.png" class="img-title">
+              <img v-if="row2.chart3.isRight" src="../../../assets/images/index/row-r4.png" class="img-title">
+            </div>
+          </div>
+
+        </div>
+        <div class="row2">
+          <div class="row2-l" style="position: relative;">
+            <div class="title">
+              <div class="img-title" />
+              <span class="content">计划统计</span>
+            </div>
+            <div v-if="row3.chart1.isChart" class="button">
+              <div class="exportTable" @click="handleExport('row3chartLine1')">导出</div>
+              <div class="exportTable" @click="handleTable('row3chartLine1')">切换表格</div>
+            </div>
+            <div v-if="row3.chart1.isChart" id="row3chartLine1" v-loading="row3.chart1.listLoading" style="background: #fff;height:310px;" />
+            <div v-if="row3.chart1.isTable" class="table" style="position: absolute;width: 100%;">
+              <div class="button">
+                <div class="exportTable" @click="handleExport('row3chartLine1')">导出</div>
+                <div class="exportTable" @click="handleChart('row3chartLine1')">切换图表</div>
+              </div>
+              <el-table
+                :key="row3.chart1.table.tableKey"
+                v-loading="row3.chart1.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="row3.chart1.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;margin-top: 10px;"
+                height="300"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="日期" sortable min-width="85px" align="center" prop="日期" />
+                <el-table-column label="计划执行重量(kg)" sortable min-width="90px" align="center" prop="实际量" />
+                <el-table-column label="配方理论重量(kg)" sortable min-width="90px" align="center" prop="理论量" />
+                <el-table-column label="计划准确率" sortable min-width="85px" align="center" prop="field1" />
+                <el-table-column label="计划取消重量(kg)" sortable min-width="90px" align="center" prop="计划取消重量" />
+                <el-table-column label="计划准确率(去除取消重量)" sortable min-width="100px" align="center" prop="field3" />
+                <el-table-column label="计划正确数" sortable min-width="85px" align="center" prop="正确数" />
+                <el-table-column label="计划数" sortable min-width="85px" align="center" prop="计划数" />
+                <el-table-column label="计划正确率" sortable min-width="75px" align="center" prop="field2" />
+              </el-table>
+            </div>
+          </div>
+          <div class="row2-r" style="position: relative;">
+            <div class="title">
+              <div class="img-title" />
+              <span class="content">泌乳牛干物质采食量</span>
+            </div>
+            <div v-if="row3.chart2.isChart" class="button">
+              <div class="exportTable" @click="handleExport('row3chartLine2')">导出</div>
+              <div class="exportTable" @click="handleTable('row3chartLine2')">切换表格</div>
+            </div>
+            <div v-if="row3.chart2.isChart" id="row3chartLine2" v-loading="row3.chart2.listLoading" style="background: #fff;height:310px;" />
+            <div v-if="row3.chart2.isTable" class="table" style="position: absolute;width: 100%;">
+              <div class="button">
+                <div class="exportTable" @click="handleExport('row3chartLine2')">导出</div>
+                <div class="exportTable" @click="handleChart('row3chartLine2')">切换图表</div>
+              </div>
+              <el-table
+                :key="row3.chart2.table.tableKey"
+                v-loading="row3.chart2.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="row3.chart2.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;margin-top: 10px;"
+                height="300"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+                <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
+                <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
+              </el-table>
+            </div>
+          </div>
+        </div>
+        <div class="row3">
+          <div class="row3-l" style="position: relative;">
+            <div class="title">
+              <div class="img-title" />
+              <span class="content">混料实际重量统计</span>
+            </div>
+            <div v-if="row4.chart2.isChart" class="button">
+              <div class="exportTable" @click="handleExport('row4chartLine2')">导出</div>
+              <div class="exportTable" @click="handleTable('row4chartLine2')">切换表格</div>
+            </div>
+            <div v-if="row4.chart2.isChart" id="row4chartLine2" v-loading="row4.chart2.listLoading" style="background: #fff;height:310px;" />
+            <div v-if="row4.chart2.isTable" class="table" style="position: absolute;width:100%;">
+              <div class="button">
+                <div class="exportTable" @click="handleExport('row4chartLine2')">导出</div>
+                <div class="exportTable" @click="handleChart('row4chartLine2')">切换图表</div>
+              </div>
+              <el-table
+                :key="row4.chart2.table.tableKey"
+                v-loading="row4.chart2.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="row4.chart2.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;margin-top: 10px;"
+                height="300"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
+                <el-table-column label="重量" sortable min-width="110px" align="center" prop="field1" />
+              </el-table>
+            </div>
+          </div>
+          <div class="row3-r">
+            <div class="title">
+              <div class="img-title" />
+              <span class="content">库存预警</span>
+              <a style="float: right;color: #009C69;font-size: 12px;margin-right: 10px;" @click="handleMore">查看更多 &nbsp;>></a>
+            </div>
+            <div id="table" style="height: 330px;background: #fff;">
+              <el-table
+                :key="row4.table.tableKey"
+                v-loading="row4.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="row4.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 98%;background: #fff;margin-top: 10px;"
+                height="320"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="序号" type="index" min-width="80px" align="center" />
+                <el-table-column label="饲料名称" min-width="80px" align="center" prop="feedname" />
+                <el-table-column label="库存量(kg)" min-width="70px" align="center" prop="stockweight" />
+                <el-table-column label="剩余使用天数" min-width="80px" align="center" prop="ldays" />
+              </el-table>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetReportform } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import echarts from 'echarts'
+import { json2excel } from '@/utils/index.js'
+
+require('echarts/theme/macarons')
+// var myKey = 0
+var that = this
+var carIndex = 0 // 判断是否大于当前车辆数
+var index = 0 // 判断当前跳到第几个车辆
+var timer = null
+export default {
+  name: 'PastureDashboard',
+  inject: ['reload'],
+  data() {
+    return {
+      val: '这是值1',
+      date: parseTime(new Date(), '{y}-{m}-{d}'),
+      list: [],
+      news: 1,
+      carLength: 0, // 车辆
+      myKey: 0, // 轮播Key值
+      row1: {
+        getdataListParm: {
+          name: 'getHomepageStr',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        listLoading: true,
+        list: ''
+      },
+      row2: {
+        chart1: {
+          chartLine: null,
+          chartLine_data: {}
+        },
+        chart2: {
+          chartLine: null,
+          chartLine_data: {}
+        },
+        chart3: {
+          isLeft: true,
+          isRight: true,
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getHomeprocessAnalysis',
+            page: 1,
+            offset: 1,
+            pagecount: 2,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              id: '',
+              pid: ''
+            }
+          },
+          list: [],
+          total: 0,
+          listLoading: true,
+          pageNum: '',
+          pages: '',
+          getdataListParmList: {
+            name: 'getHomepageLBList',
+            page: 1,
+            offset: 1,
+            pagecount: 2,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid')
+            }
+          },
+          list2: [],
+          total2: 0,
+          listLoading2: true,
+          pageNum2: '',
+          pages2: ''
+        }
+      },
+      row3: {
+        chartDate: [],
+        chart1: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuracyAllJH',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        chart2: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getFeedEffMR',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        }
+      },
+      row4: {
+        chartDate: [],
+        chart1: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getHomepageCB',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        chart2: {
+          chartLine: null,
+          chartLine_data: {},
+          getdataListParm: {
+            name: 'getAccuraaActHL',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()]
+            }
+          },
+          list: [],
+          total: 0,
+          listLoading: true,
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        },
+        table: {
+          getdataListParm: {
+            name: 'getFsWarnList',
+            page: 1,
+            offset: 1,
+            pagecount: 5,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid')
+            }
+          },
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        }
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      timer: null,
+      clickKey: 0,
+      isClick: false
+    }
+  },
+  watch: {
+    isClick: {
+      handler(newName, oldName) {
+        if (newName == true) {
+          setTimeout(() => {
+            this.timer = setInterval(this.autoPlay, 15000)
+          }, 20000)
+        }
+      },
+      immediate: true
+    }
+  },
+  created() {
+    // this.reload()
+    this.getCarLength()
+    this.getChart3List()
+    this.getTimeFn()
+    this.getList()
+
+    this.getChart4()
+    this.getChart5()
+    this.getChart6()
+    this.getChart7()
+    this.getTable8()
+  },
+  mounted() {
+    this.timer = null
+    this.timer = setInterval(this.autoPlay, 15000)
+  },
+  destroyed() {
+    clearInterval(this.timer)
+  },
+  methods: {
+    getTimeFn() {
+      // this.reload()
+      const that = this
+      const end = new Date()
+      const start = new Date()
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 20)
+      that.row3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.row3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.row3.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.row3.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.row3.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.row3.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.row3.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.row3.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.row3.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.row3.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.row4.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.row4.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.row4.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.row4.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.row4.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.row4.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+
+      that.row4.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
+      that.row4.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
+      that.row4.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.row4.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+    },
+    getList() {
+      this.row1.listLoading = true
+      GetDataByName(this.row1.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('row1数据', response.data.list)
+          if (response.data.list[0].monRateHL == undefined) { response.data.list[0].monRateHL = '' }
+          if (response.data.list[0].monRateSL == undefined) { response.data.list[0].monRateSL = '' }
+          if (response.data.list[0].monRateSLR == undefined) { response.data.list[0].monRateSLR = '' }
+          if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
+          if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
+          if (response.data.list[0].yesRateSL == undefined) { response.data.list[0].yesRateSL = '' }
+          if (response.data.list[0].yesRateSLR == undefined) { response.data.list[0].yesRateSLR = '' }
+          if (response.data.list[0].temtime == undefined) { response.data.list[0].temtime = '' }
+          if (response.data.list[0].montime == undefined) { response.data.list[0].montime = '' }
+          this.row1.list = response.data.list[0]
+          this.row2.chart1.chartLine_data.data1 = parseFloat(response.data.list[0].doneTimes)
+          this.row2.chart1.chartLine_data.data2 = parseFloat(response.data.list[0].planTimes)
+          this.row2.chart2.chartLine_data.data1 = parseFloat(response.data.list[0].doneWeight)
+          this.row2.chart2.chartLine_data.data2 = parseFloat(response.data.list[0].planWeight)
+
+          this.roadChartLine1(this.row2.chart1.chartLine_data)
+          this.roadChartLine2(this.row2.chart2.chartLine_data)
+        } else {
+          this.row1.list.data1.monRateHL = ''
+          this.row1.list.data1.monRateSL = ''
+          this.row1.list.data1.monRateSLR = ''
+          this.row1.list.data1.yesRateHL = ''
+          this.row1.list.data1.yesRateSL = ''
+          this.row1.list.data1.yesRateSLR = ''
+          this.row1.list.data1.temtime = ''
+          this.row1.list.data1.montime = ''
+          this.row2.chart1.chartLine_data.data1 = ''
+          this.row2.chart1.chartLine_data.data2 = ''
+          this.row2.chart2.chartLine_data.data1 = ''
+          this.row2.chart2.chartLine_data.data2 = ''
+        }
+        setTimeout(() => {
+          this.row1.listLoading = false
+        }, 100)
+      })
+    },
+    // 今日计划统计-完成车次
+    roadChartLine1(chartLine_data) {
+      console.log('chartLine_data', chartLine_data)
+      if (this.row2.chart1.chartLine != null) {
+        this.row2.chart1.chartLine.dispose()
+      }
+      this.row2.chart1.chartLine = echarts.init(document.getElementById('row2chartLine1'))
+      if (chartLine_data.data2 == 0 || chartLine_data.data1 == 0) {
+        chartLine_data.data1 = 0
+        chartLine_data.data2 = 100
+      }
+      var option = {
+        title: { show: true, x: 'center', textStyle: { fontSize: '15', color: 'green', fontWeight: 'bold' }},
+        tooltip: { show: false, trigger: 'item', formatter: '{a} <br/>{b}: {c} ({d}%)' },
+        color: ['#1bbe89', '#e4e7ec'],
+        series: [{
+          name: '任务进度', type: 'pie', radius: ['80%', '70%'], avoidLabelOverlap: false, hoverAnimation: false, labelLine: { normal: { show: false }},
+          data: [{
+            value: chartLine_data.data1, name: '车次完成率', selected: false, // 单个扇区的标签配置
+            label: { normal: { show: true, position: 'center', fontSize: 20, formatter: '{b}\n{d}%' }}
+          }, {
+            value: chartLine_data.data2 - chartLine_data.data1,
+            label: { normal: { show: false }
+            }
+          }]
+        }]
+      }
+      this.row2.chart1.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row2.chart1.chartLine.resize()
+      }
+      var that = this
+      that.row2.chart1.chartLine.on('mouseover', e => {
+        const op = that.row2.chart1.chartLine.getOption()
+        that.row2.chart1.chartLine.dispatchAction({
+          type: 'downplay',
+          seriesIndex: 0,
+          dataIndex: e.dataIndex,
+          color: e.color
+        })
+        that.row2.chart1.chartLine.setOption(op, true)
+      })
+    },
+    // 今日计划统计-完成重量
+    roadChartLine2(chartLine_data) {
+      if (this.row2.chart2.chartLine != null) {
+        this.row2.chart2.chartLine.dispose()
+      }
+      this.row2.chart2.chartLine = echarts.init(document.getElementById('row2chartLine2'))
+      if (chartLine_data.data2 == 0 || chartLine_data.data1 == 0) {
+        chartLine_data.data1 = 0
+        chartLine_data.data2 = 100
+      }
+      var option = {
+        title: { show: true, x: 'center', textStyle: { fontSize: '15', color: 'green', fontWeight: 'bold' }},
+        tooltip: { show: false, trigger: 'item', formatter: '{a} <br/>{b}: {c} ({d}%)' },
+        series: [{
+          name: '任务进度', type: 'pie', radius: ['80%', '70%'], avoidLabelOverlap: false, hoverAnimation: false,
+          labelLine: { normal: { show: false }},
+          data: [{
+            value: chartLine_data.data1, name: '重量完成率', selected: false, label: { normal: { show: true, position: 'center', fontSize: 20, formatter: '{b}\n{d}%' }}
+          }, {
+            value: chartLine_data.data2 - chartLine_data.data1, label: { normal: { show: false }}
+          }]
+        }],
+        color: ['#529ae4', '#e4e7ec']
+      }
+      this.row2.chart2.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row2.chart2.chartLine.resize()
+      }
+      var that = this
+      that.row2.chart2.chartLine.on('mouseover', e => {
+        const op = that.row2.chart2.chartLine.getOption()
+        that.row2.chart2.chartLine.dispatchAction({
+          type: 'downplay',
+          seriesIndex: 0,
+          dataIndex: e.dataIndex,
+          color: e.color
+        })
+        that.row2.chart2.chartLine.setOption(op, true)
+      })
+    },
+
+    // 实时监控
+    getChart3() {
+      this.row2.chart3.listLoading = true
+      GetReportform(this.row2.chart3.getdataListParm).then(response => {
+        console.log('实时监控数据', response.data.list)
+        if (response.data !== null && response.data.list !== null) {
+          var evenNumbers = []// 偶数
+          var oddNumbers = []// 奇数
+          for (let i = 0; i < response.data.list.data4.length; i++) {
+            if (i == 0) {
+              oddNumbers.push(response.data.list.data4[i])
+            } else {
+              if (i % 2 == 0) {
+                evenNumbers.push(response.data.list.data4[i])
+              } else {
+                oddNumbers.push(response.data.list.data4[i])
+              }
+            }
+          }
+          response.data.list.data4 = oddNumbers
+          response.data.list.data5 = evenNumbers
+          this.row2.chart3.chartLine_data = response.data.list
+          this.row2.chart3.total = response.data.total
+          this.row2.chart3.pageNum = response.data.pageNum
+          this.row2.chart3.pages = response.data.pages
+          this.roadChartLine3(this.row2.chart3.chartLine_data)
+        } else {
+          this.row2.chart3.list = []
+          this.row2.chart3.chartLine_data = []
+          this.roadChartLine3(this.row2.chart3.chartLine_data)
+        }
+        setTimeout(() => {
+          this.row2.chart3.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine3(chartLine_data) {
+      console.log(chartLine_data, 'chartLine_data666')
+      if (this.row2.chart3.chartLine != null) {
+        this.row2.chart3.chartLine.dispose()
+      }
+      this.row2.chart3.chartLine = echarts.init(document.getElementById('row2chartLine3'))
+      var option = {
+        title: {
+          text: '',
+          subtext: ''
+        },
+        color: ['#38c193', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
+        grid: {
+          bottom: '10%'
+        },
+        legend: [{
+          itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
+          data: [{ name: '设计重量' }, { name: '实际重量' }]
+        }, {
+          itemWidth: 15, itemHeight: 15, right: '0', textStyle: { fontSize: 12 },
+          data: [{ name: '开始重量', icon: 'image://https://kptyun.cn:8081/file/pic/3.png' }, { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' }]
+        }],
+        tooltip: {
+          trigger: 'axis'
+        },
+        calculable: true,
+        yAxis: [
+          { type: 'value', name: '重量(kg)', splitLine: { show: false }, axisLabel: { show: true, textStyle: { color: '#666' }}}
+        ],
+        xAxis: [
+          { type: 'category', splitLine: { show: false }, name: '时间', data: chartLine_data.data1, axisLabel: { show: true, textStyle: { color: '#666' }}}
+        ],
+        series: [
+          { symbol: 'none', name: '实际重量', type: 'line', symbolSize: 4, data: chartLine_data.data3, smooth: true, barWidth: '37', itemStyle: { normal: { lineStyle: { color: '#38c193' }}}},
+          { symbol: 'none', name: '设计重量', type: 'line', symbolSize: 4, barWidth: '37', data: chartLine_data.data2, itemStyle: { normal: { lineStyle: { color: '#5199e5' }}}},
+          { name: '开始重量', symbol: 'image://https://kptyun.cn:8081/file/pic/3.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
+          { name: '结束重量', symbol: 'image://https://kptyun.cn:8081/file/pic/4.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
+        ]
+      }
+      this.row2.chart3.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row2.chart3.chartLine.resize()
+      }
+    },
+    getCarLength() {
+      this.row2.chart3.listLoading2 = true
+      this.row2.chart3.getdataListParmList.pagecount = 0
+      GetDataByName(this.row2.chart3.getdataListParmList).then(response => {
+        if (response.data.list !== null) {
+          this.carLength = response.data.total
+        } else {
+          this.carLength = 0
+        }
+        setTimeout(() => {
+          this.row2.chart3.listLoading2 = false
+        }, 100)
+      })
+    },
+    // 图三轮询列表
+    getChart3List() {
+      this.row2.chart3.listLoading2 = true
+      this.row2.chart3.getdataListParmList.pagecount = 2
+      GetDataByName(this.row2.chart3.getdataListParmList).then(response => {
+        if (response.data.list !== null) {
+          this.$set(response.data.list[0], 'background', '#f3f9f7')
+          this.$set(response.data.list[0], 'borderColor', '#009d6a')
+          this.$set(response.data.list[0], 'isChecked', true)
+          if (response.data.list.length > 1) {
+            this.$set(response.data.list[1], 'background', '#f9f9f9')
+            this.$set(response.data.list[1], 'borderColor', '#f9f9f9')
+            this.$set(response.data.list[1], 'isChecked', false)
+          }
+          this.list = response.data.list
+          this.row2.chart3.getdataListParm.parammaps.pid = this.list[this.myKey].pid
+          this.row2.chart3.getdataListParm.parammaps.id = this.list[this.myKey].id
+          this.getChart3()
+          this.row2.chart3.pageNum2 = response.data.pageNum
+          this.row2.chart3.pages2 = response.data.pages
+        } else {
+          this.row2.chart3.list2 = []
+        }
+        if (response.data.pageNum == 1) {
+          if (response.data.total > 2) {
+            this.row2.chart3.isLeftA = false
+            this.row2.chart3.isLeft = true
+            this.row2.chart3.isRightA = true
+            this.row2.chart3.isRight = false
+          } else {
+            this.row2.chart3.isLeftA = false
+            this.row2.chart3.isLeft = true
+            this.row2.chart3.isRightA = true
+            this.row2.chart3.isRight = false
+          }
+        } else {
+          if (response.data.pageNum * response.data.pageSize > response.data.total || response.data.pageNum * response.data.pageSize == response.data.total) {
+            this.row2.chart3.isLeftA = true
+            this.row2.chart3.isLeft = false
+            this.row2.chart3.isRightA = false
+            this.row2.chart3.isRight = true
+          } else {
+            this.row2.chart3.isLeftA = true
+            this.row2.chart3.isLeft = false
+            this.row2.chart3.isRightA = true
+            this.row2.chart3.isRight = false
+          }
+        }
+        setTimeout(() => {
+          this.row2.chart3.listLoading2 = false
+        }, 100)
+      })
+    },
+    // 向左切换
+    handleLeft() {
+      console.log('左')
+      if (this.row2.chart3.isLeftA == false) {
+        console.log('前边没有啦')
+      } else {
+        console.log(this.row2.chart3.getdataListParmList.offset)
+        this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
+        this.getChart3List()
+      }
+    },
+    // 向右切换
+    handleRight() {
+      if (this.row2.chart3.isRightA == false) {
+        console.log('后边没有啦')
+      } else {
+        this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset + 1
+        console.log(this.row2.chart3.getdataListParmList.offset)
+        this.getChart3List()
+      }
+    },
+    handleList(key, item) {
+      console.log(item, key)
+      this.isClick = true
+      this.clickKey = key
+      clearInterval(this.timer)
+      for (let i = 0; i < this.list.length; i++) {
+        if (key == i) {
+          this.$set(this.list[i], 'background', '#f3f9f7')
+          this.$set(this.list[i], 'borderColor', '#009d6a')
+          this.$set(this.list[i], 'isChecked', true)
+        } else {
+          this.$set(this.list[i], 'background', '#f9f9f9')
+          this.$set(this.list[i], 'borderColor', '#f9f9f9')
+          this.$set(this.list[i], 'isChecked', false)
+        }
+      }
+      this.row2.chart3.getdataListParm.parammaps.pid = this.list[key].pid
+      this.row2.chart3.getdataListParm.parammaps.id = this.list[key].id
+      this.getChart3()
+      // this.timer = null
+      // clearInterval(this.timer)
+      // setTimeout(() => {
+      //   this.timer = null
+      //   this.timer = setInterval(this.autoPlay, 15000)
+      // }, 20000)
+    },
+    autoPlay() {
+      if (this.list[0].isChecked == true) {
+        if (this.list.length > 1) {
+          this.$set(this.list[1], 'background', '#f3f9f7')
+          this.$set(this.list[1], 'borderColor', '#009d6a')
+          this.$set(this.list[1], 'isChecked', true)
+          this.$set(this.list[0], 'background', '#f9f9f9')
+          this.$set(this.list[0], 'borderColor', '#f9f9f9')
+          this.$set(this.list[0], 'isChecked', false)
+          this.row2.chart3.getdataListParm.parammaps.pid = this.list[1].pid
+          this.row2.chart3.getdataListParm.parammaps.id = this.list[1].id
+          this.getChart3()
+        } else {
+          if (this.row2.chart3.isRightA == false && this.row2.chart3.isLeftA == true) {
+            this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
+            this.getChart3List()
+          }
+        }
+      } else {
+        if (this.row2.chart3.isRightA == true) {
+          this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset + 1
+          console.log(this.row2.chart3.getdataListParmList.offset)
+          this.getChart3List()
+        } else {
+          if (this.row2.chart3.isLeftA == true) {
+            this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
+            console.log(this.row2.chart3.getdataListParmList.offset)
+            this.getChart3List()
+          } else {
+            this.$set(this.list[0], 'background', '#f3f9f7')
+            this.$set(this.list[0], 'borderColor', '#009d6a')
+            this.$set(this.list[0], 'isChecked', true)
+            this.$set(this.list[1], 'background', '#f9f9f9')
+            this.$set(this.list[1], 'borderColor', '#f9f9f9')
+            this.$set(this.list[1], 'isChecked', false)
+            this.row2.chart3.getdataListParm.parammaps.pid = this.list[0].pid
+            this.row2.chart3.getdataListParm.parammaps.id = this.list[0].id
+            this.getChart3()
+          }
+        }
+      }
+    },
+
+    // 计划统计
+    getChart4() {
+      this.row3.chart1.listLoading = true
+      GetReportform(this.row3.chart1.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('计划统计数据', response.data.list)
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
+              response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
+            }
+            if (response.data.data[i].理论量 !== '' && response.data.data[i].理论量 !== undefined) {
+              response.data.data[i].理论量 = parseFloat(response.data.data[i].理论量)
+            }
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+            if (response.data.data[i].计划取消重量 !== '' && response.data.data[i].计划取消重量 !== undefined) {
+              response.data.data[i].计划取消重量 = parseFloat(response.data.data[i].计划取消重量)
+            }
+            if (response.data.data[i].field3 !== '' && response.data.data[i].field3 !== undefined) {
+              response.data.data[i].field3 = parseFloat(response.data.data[i].field3)
+            }
+            if (response.data.data[i].正确数 !== '' && response.data.data[i].正确数 !== undefined) {
+              response.data.data[i].正确数 = parseFloat(response.data.data[i].正确数)
+            }
+            if (response.data.data[i].计划数 !== '' && response.data.data[i].计划数 !== undefined) {
+              response.data.data[i].计划数 = parseFloat(response.data.data[i].计划数)
+            }
+            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+            }
+          }
+          this.row3.chart1.table.list = response.data.data
+          console.log(this.row3.chart1.table.list, '123')
+          this.row3.chart1.chartLine_data = response.data.list
+          this.row3.chart1.total = response.data.total
+        } else {
+          this.row3.chart1.list = []
+          this.row3.chart1.chartLine_data = []
+          this.row3.chart1.chartLine_data.data1 = []
+        }
+        if (this.row3.chart1.chartLine_data.data1.length == 0) {
+          this.row3.chart1.chartLine_data.title = '暂无数据'
+        } else {
+          this.row3.chart1.chartLine_data.title = ''
+        }
+        this.roadChartLine4(this.row3.chart1.chartLine_data)
+        setTimeout(() => {
+          this.row3.chart1.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine4(chartLine_data) {
+      if (this.row3.chart1.chartLine != null) {
+        this.row3.chart1.chartLine.dispose()
+      }
+      this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
+      var option = {
+        title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
+        tooltip: { trigger: 'axis' },
+        color: ['#1abd88', '#549be9', '#fd8d75'],
+        legend: {
+          data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'],
+          top: 10, itemHeight: 7, itemWidth: 15, textStyle: { fontSize: 12 }
+        },
+        grid: {
+          top: '20%',
+          left: '10%',
+          right: '10%',
+          bottom: '10%',
+          containLabel: true
+        },
+        toolbox: {
+          show: true,
+          right: '2%',
+          feature: {}
+        },
+        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
+        yAxis: {
+          type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
+        },
+        series: [
+          { name: '计划准确率', type: 'line', symbol: 'none', smooth: true, itemStyle: { normal: { lineStyle: { color: '#1abd88' }}}, data: chartLine_data.data2 },
+          { name: '计划正确率', type: 'line', symbol: 'none', smooth: true, itemStyle: { normal: { lineStyle: { color: '#549be9' }}}, data: chartLine_data.data3 },
+          { name: '计划准确率(去除取消重量)', type: 'line', symbol: 'none', smooth: true, itemStyle: { normal: { lineStyle: { color: '#fd8d75' }}}, data: chartLine_data.data4 }
+        ]
+      }
+      this.row3.chart1.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row3.chart1.chartLine.resize()
+      }
+    },
+    // 泌乳牛干物质采食量
+    getChart5() {
+      this.row3.chart2.listLoading = true
+      GetReportform(this.row3.chart2.getdataListParm).then(response => {
+        console.log('泌乳牛干物质采食量数据', response)
+        if (response.data !== null && response.data.list !== null) {
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+            }
+          }
+          this.row3.chart2.table.list = response.data.data
+          this.row3.chart2.chartLine_data = response.data.list
+          this.row3.chart2.total = response.data.total
+        } else {
+          this.row3.chart2.list = []
+          this.row3.chart2.chartLine_data = []
+          this.row3.chart2.chartLine_data.data1 = []
+        }
+        if (this.row3.chart2.chartLine_data.data1.length == 0) {
+          this.row3.chart2.chartLine_data.title = '暂无数据'
+        } else {
+          this.row3.chart2.chartLine_data.title = ''
+        }
+        this.roadChartLine5(this.row3.chart2.chartLine_data)
+        setTimeout(() => {
+          this.row3.chart2.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine5(chartLine_data) {
+      if (this.row3.chart2.chartLine != null) {
+        this.row3.chart2.chartLine.dispose()
+      }
+      this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
+      var option = {
+        title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
+        tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
+        grid: { top: '20%', left: '8%', right: '10%', bottom: '10%', containLabel: true },
+        legend: { data: ['泌乳牛干物质采食量', '泌乳牛产奶量'], right: 10, itemHeight: 7, itemWidth: 15 },
+        xAxis: [{ type: 'category', data: chartLine_data.data1 }],
+        yAxis: [{
+          splitLine: { show: false }, type: 'value', name: '泌乳牛干\n物质采食量', axisLabel: { formatter: '{value} ' }
+        }, {
+          splitLine: { show: false }, type: 'value', name: '泌乳牛产奶量', axisLabel: { formatter: '{value} ' }
+        }],
+        series: [{
+          name: '泌乳牛干物质采食量', type: 'bar', barWidth: 5, itemStyle: { barBorderRadius: [18, 18, 0, 0], normal: { color: '#5199e5' }}, data: chartLine_data.data2
+        }, {
+          name: '泌乳牛产奶量', type: 'line', barWidth: 5,
+          itemStyle: { barBorderRadius: [18, 18, 0, 0], normal: { color: '#36c293' }}, yAxisIndex: 1, data: chartLine_data.data3
+        }]
+      }
+      this.row3.chart2.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row3.chart2.chartLine.resize()
+      }
+    },
+
+    // 成本统计
+    getChart6() {
+      this.row4.chart1.table.listLoading = true
+      this.row4.chart1.listLoading = true
+      GetReportform(this.row4.chart1.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('成本统计数据', response.data.data)
+          console.log('成本统计数据', response.data.list)
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
+              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
+            }
+          }
+          this.row4.chart1.table.list = response.data.data
+          this.row4.chart1.chartLine_data = response.data.list
+          this.row4.chart1.total = response.data.total
+        } else {
+          this.row4.chart1.list = []
+          this.row4.chart1.chartLine_data = []
+          this.row4.chart1.chartLine_data.data1 = []
+        }
+        if (this.row4.chart1.chartLine_data.data1.length == 0) {
+          this.row4.chart1.chartLine_data.title = '暂无数据'
+        } else {
+          this.row4.chart1.chartLine_data.title = ''
+        }
+        this.roadChartLine6(this.row4.chart1.chartLine_data)
+        setTimeout(() => {
+          this.row4.chart1.listLoading = false
+          this.row4.chart1.table.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine6(chartLine_data) {
+      if (this.row4.chart1.chartLine != null) {
+        this.row4.chart1.chartLine.dispose()
+      }
+      console.log(chartLine_data, '===666')
+      this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
+      var option = {
+        title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
+        grid: { left: '10%', right: '12%', bottom: '3%', containLabel: true },
+        tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
+        legend: { data: ['公斤奶饲料成本', '单头牛饲料成本'], itemHeight: 7, itemWidth: 15 },
+        xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }, name: '日期' }],
+        yAxis: [{
+          splitLine: { show: false }, type: 'value', name: '公斤奶\n饲料成本(元)', axisLabel: { formatter: '{value}' }
+        }, {
+          splitLine: { show: false }, type: 'value', name: '单头牛\n饲料成本(元)', axisLabel: { formatter: '{value}' }
+        }
+        ],
+        series: [{
+          name: '公斤奶饲料成本', type: 'bar', itemStyle: { normal: { color: '#1abd88' }}, data: chartLine_data.data2
+        }, {
+          name: '单头牛饲料成本', type: 'line', yAxisIndex: 1, itemStyle: { normal: { color: '#ff8d78' }}, data: chartLine_data.data3
+        }]
+      }
+      this.row4.chart1.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row4.chart1.chartLine.resize()
+      }
+    },
+
+    // 混料实际重量统计
+    getChart7() {
+      this.row4.chart2.listLoading = true
+      GetReportform(this.row4.chart2.getdataListParm).then(response => {
+        if (response.data !== null && response.data.list !== null) {
+          console.log('混料实际重量统计数据', response.data.list)
+          for (let i = 0; i < response.data.data.length; i++) {
+            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
+              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
+            }
+          }
+          this.row4.chart2.table.list = response.data.data
+          this.row4.chart2.chartLine_data = response.data.list
+          this.row4.chart2.total = response.data.total
+        } else {
+          this.row4.chart2.list = []
+          this.row4.chart2.chartLine_data = []
+          this.row4.chart2.chartLine_data.data1 = []
+        }
+        if (this.row4.chart2.chartLine_data.data1.length == 0) {
+          this.row4.chart2.chartLine_data.title = '暂无数据'
+        } else {
+          this.row4.chart2.chartLine_data.title = ''
+        }
+        this.roadChartLine7(this.row4.chart2.chartLine_data)
+        setTimeout(() => {
+          this.row4.chart2.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine7(chartLine_data) {
+      if (this.row4.chart2.chartLine != null) {
+        this.row4.chart2.chartLine.dispose()
+      }
+      this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
+      var option = {
+        title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
+        grid: { left: '10%', right: '10%', bottom: '3%', containLabel: true },
+        tooltip: { trigger: 'axis' },
+        legend: { data: [''] },
+        xAxis: [{ type: 'category', data: chartLine_data.data1, name: '日期' }],
+        yAxis: [
+          { type: 'value', name: '重量(kg)', axisLabel: { formatter: '{value}' }}
+        ],
+        series: [{
+          name: '重量', type: 'bar', stack: '广告', itemStyle: { normal: { color: '#36C293' }}, data: chartLine_data.data2
+        }]
+      }
+      this.row4.chart2.chartLine.setOption(option)
+      window.onresize = function() {
+        this.row4.chart2.chartLine.resize()
+      }
+    },
+
+    getTable8() {
+      this.row4.table.listLoading = true
+      GetDataByName(this.row4.table.getdataListParm).then(response => {
+        console.log('库存预警table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.row4.table.list = response.data.list
+          this.row4.table.total = response.data.total
+        } else {
+          this.row4.table.list = []
+        }
+        setTimeout(() => {
+          this.row4.table.listLoading = false
+        }, 100)
+      })
+    },
+    // 更多
+    handleMore() {
+      // this.$router.push({ path: '/inventoryManagement/Warning' })
+      this.$router.push({ name: 'Warning', params: { jmp: 'jmp' }})
+    },
+    // 导出
+    handleExport(item) {
+      console.log(item)
+      // 计划统计
+      if (item == 'row3chartLine1') {
+        console.log(this.row3.chart1.table.list)
+        var excelDatasTabChart1 = [
+          {
+            tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
+            filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
+            tableDatas: this.row3.chart1.table.list,
+            sheetName: '计划统计'
+          }
+        ]
+        json2excel(excelDatasTabChart1, '计划统计', true, 'xlsx')
+      } else if (item == 'row3chartLine2') {
+        // 泌乳牛采食量
+        var excelDatasTabChart2 = [
+          {
+            tHeader: ['日期', '泌乳牛采食量(kg)', '泌乳牛产奶量(kg)'],
+            filterVal: ['日期', 'field1', 'field2'],
+            tableDatas: this.row3.chart2.table.list,
+            sheetName: '泌乳牛采食量'
+          }
+        ]
+        json2excel(excelDatasTabChart2, '泌乳牛采食量', true, 'xlsx')
+      } else if (item == 'row4chartLine1') {
+        // 成本统计
+        console.log('成本统计')
+        // var excelDatasTabChart2 = [
+        //   {
+        //     tHeader: ['日期', '泌乳牛采食量(kg)', '泌乳牛产奶量(kg)'],
+        //     filterVal: ['日期', 'field1', 'field2'],
+        //     tableDatas: this.row3.chart2.table.list,
+        //     sheetName: '泌乳牛采食量'
+        //   }
+        // ]
+        // json2excel(excelDatasTabChart2, '泌乳牛采食量', true, 'xlsx')
+      } else if (item == 'row4chartLine2') {
+        console.log('混料实际重量统计')
+        var excelDatasTabChart4 = [
+          {
+            tHeader: ['日期', '重量'],
+            filterVal: ['日期', 'field1'],
+            tableDatas: this.row4.chart2.table.list,
+            sheetName: '混料实际重量统计'
+          }
+        ]
+        json2excel(excelDatasTabChart4, '混料实际重量统计', true, 'xlsx')
+      }
+    },
+
+    handleTable(item) {
+      console.log(item)
+      if (item == 'row3chartLine1') {
+        console.log('计划统计表格')
+        this.row3.chart1.isTable = true
+        this.row3.chart1.isChart = false
+      } else if (item == 'row3chartLine2') {
+        console.log('泌乳牛采食量表格')
+        this.row3.chart2.isTable = true
+        this.row3.chart2.isChart = false
+      } else if (item == 'row4chartLine1') {
+        console.log('成本统计表格')
+        this.row4.chart1.isTable = true
+        this.row4.chart1.isChart = false
+      } else if (item == 'row4chartLine2') {
+        console.log('混料实际重量统计表格')
+        this.row4.chart2.isTable = true
+        this.row4.chart2.isChart = false
+      }
+    },
+    handleChart(item) {
+      console.log(item)
+      // 显示切换图表
+      if (item == 'row3chartLine1') {
+        console.log('计划统计图表')
+        this.row3.chart1.isTable = false
+        this.row3.chart1.isChart = true
+        this.getChart4()
+      } else if (item == 'row3chartLine2') {
+        console.log('泌乳牛采食量图表')
+        this.row3.chart2.isTable = false
+        this.row3.chart2.isChart = true
+        this.getChart5()
+      } else if (item == 'row4chartLine1') {
+        console.log('成本统计图表')
+        this.row4.chart1.isTable = false
+        this.row4.chart1.isChart = true
+        this.getChart6()
+      } else if (item == 'row4chartLine2') {
+        console.log('混料实际重量统计图表')
+        this.row4.chart2.isTable = false
+        this.row4.chart2.isChart = true
+        this.getChart7()
+      }
+    }
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .Title{
+    padding-left: 10px;border-radius: 10px;margin-top: 20px;background: #fff;height:40px;font-size:20px;line-height:40px;text-align: left;font-weight: 600;color:#333333;
+  }
+  .dashboard-editor-container {
+    background-color: #F4F4F4;
+    min-height: 100vh;
+    .news{
+      width: 70%;
+      height: 30px;
+      background: #fff;
+      margin: 0 auto;
+      border-radius: 10px;
+      text-align: center;
+      line-height: 30px;
+      color: red;
+      b{color: #000;}
+    }
+
+    .bottom{
+      padding:0 30px;
+      h4{text-align: right;}
+      .grid-content{
+        background: #fff;height: 90px;
+        border-radius: 10px;
+      }
+      .one{
+        border: 1px solid #82CBB3;height: 90px;
+        .Left{
+          float: left;
+          width: 65px;
+          text-align: center;
+          i{font-size: 36px;color:#82CBB3;line-height: 90px;}
+        }
+        .Right{
+          float: left;
+          margin-top:15px;
+          height: 60px;
+          font-weight: 600;
+          font-size: 14px;
+          line-height: 30px;
+          span{
+            display: inline-block;
+            width: 130px;
+            text-align: right;
+          }
+        }
+      }
+      .two{
+        border: 1px solid #FF9900;
+        .Left{
+          float: left;
+          width: 65px;
+          text-align: center;
+          i{font-size: 36px;color:#FF9900;line-height: 90px;}
+        }
+        .Right{
+          float: left;
+          margin-top:15px;
+          height: 60px;
+          font-weight: 600;
+          font-size: 14px;
+          line-height: 30px;
+          span{
+            display: inline-block;
+            width: 130px;
+            text-align: right;
+          }
+        }
+      }
+      .three{
+        border: 1px solid #0099FF;
+        .Left{
+          float: left;
+          width: 65px;
+          text-align: center;
+          i{font-size: 36px;color:#0099FF;line-height: 90px;}
+        }
+        .Right{
+          float: left;
+          height: 60px;
+          font-weight: 600;
+          font-size: 14px;
+          line-height: 30px;
+          margin-top:15px;
+          span{
+            display: inline-block;
+            width: 130px;
+            text-align: right;
+          }
+        }
+      }
+      .four{
+        border: 1px solid #FF5C5C;
+        .Left{
+          float: left;
+          width: 55px;
+          text-align: center;
+          i{font-size: 36px;color:#FF5C5C;line-height: 90px;}
+        }
+        .Right{
+          float: left;
+          flex: 1;
+          height: 60px;
+          font-weight: 600;
+          font-size: 14px;
+          line-height: 30px;
+          margin-top:15px;
+          span{
+            display: inline-block;
+            width: 150px;
+            text-align: right;
+          }
+        }
+      }
+
+      .car{
+        width:100%;height:150px;
+         display:flex;
+        display: -webkit-flex;
+        -webkit-flex-direction:row;
+        i{font-size: 50px;width:50px;display: block;line-height: 150px;}
+        .carList{
+          flex:1;height: 130px;
+          .list{
+            height: 130px;color: #fff;
+            // box-shadow: #000 0px 0px 10px;
+            // border-radius: 10px;
+            .list-l{
+              p{
+                padding-left:10px;font-size:13px;line-height: 16px; text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
+              }
+            }
+            .list-r{
+              p{
+                font-size:13px;line-height: 16px;text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+</style>
+
+<style>
+  .app-main{background:#f5f5f5;}
+</style>
+<style lang="scss" scoped>
+
+  .dashboard-editor-container{padding-left: 10px;background: #f5f5f5;padding-bottom: 10px;}
+  // 公共
+  .img-t{position: absolute;left: 0;right: 0;margin: 30px auto;width: 31%;height: 31%;background-size: 100% 100%;}
+  .row1-c-l-c{
+    margin: 30px auto;border: 1px solid #eee;height: 40%;width: 50%;border-radius: 50%;text-align: center;display:table;
+    span{
+      height:100%;display:table-cell;vertical-align: middle;font-size:14px;color: #009C69;
+      b{padding-bottom: 10px;font-size: 16px;}
+    }
+  }
+  .row1-c-l-b{
+    width: 100%;text-align: center;display:table;font-size: 12px;
+    // div{
+    //   font-size: 12px;height:100%;display:table-cell;vertical-align: middle;color: #323232;padding: 0 10px;width: 100%;
+    //   span{text-align: right;width: 75%;display: block;float: left;}
+    //   b{float: left;display: block;width: 25%;}
+    // }
+  }
+  .title{
+    height: 36px;padding-top: 7px;line-height: 36px;position: relative;
+    .img-title{
+      position: absolute;top: 10px; right:10px;bottom:0;left:20px;width: 30px;height: 30px;background: url(../../../assets/images/index/row-bg3.png) no-repeat;
+    }
+    .content{font-size: 18px;position: absolute;top: 7px;left: 55px;}
+  }
+  .title1{
+    height: 36px;padding-top: 7px;line-height: 36px;position: relative;
+
+    .img-title{
+      position: absolute;top: 10px; right:10px;bottom:0;left:10px;
+      width: 25px;height: 25px;
+      img{width: 25px;height: 25px;}
+    }
+    .content{font-size: 16px;position: absolute;top: 7px;left: 40px;}
+  }
+  .button{
+    height: 30px;
+    .exportTable{float: right;margin-right: 5px;}
+  }
+  .dashboard{
+    display: flex;margin-top: 10px;
+    .dashboard-l{
+      // width: 540px;
+      width: 30%;
+      .row1{
+        height: 520px;
+        .row1-t{
+          background: #fff; height: 50px; color: #f28b46;
+          .row1-t-l{
+            .img-l{float:left;padding: 16px 10px 16px 20px;width: 18px;height: 18px;background: url(../../../assets/images/index/row-bg2.png) no-repeat;background-position: 0 8px;}
+            .content{float:left;width: 54%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 14px;line-height: 50px;padding-left: 3px;}
+            .img-r{float:left;padding: 16px 0 16px 17px;width: 30px;height: 15px;background: url(../../../assets/images/index/row-bg2.png) no-repeat;background-position: 0 -24px;}
+          }
+          .row1-t-r{padding-right: 20px;text-align: right;line-height: 50px;}
+        }
+
+        .row1-c{
+          display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;margin-top: 10px;
+          .row1-c-l{
+            background: #fff;width:49%;height:225px;border-radius:3px;margin-right: 1%;position: relative;
+            .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t1.png) no-repeat; background-size: 100% 100%;}
+          }
+          .row1-c-r{
+            background: #fff;width:49%;height:225px;border-radius:3px;position: relative;
+            .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t2.png) no-repeat; background-size: 100% 100%;}
+          }
+        }
+        .row1-b{
+          display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;margin-top: 10px;
+          .row1-b-l{
+            background: #fff;width:49%;height:225px;border-radius:3px;margin-right:1%;position: relative;
+            .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t4.png) no-repeat; background-size: 100% 100%;}
+          }
+          .row1-b-r{
+            background: #fff;width:49%;height:225px;border-radius:3px;position: relative;
+            .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t3.png) no-repeat; background-size: 100% 100%;}
+          }
+        }
+      }
+
+      .row2{
+        margin-top:10px;height: 375px;background: #fff;
+        .img-title{background-position: 0 0;}
+        .todayPlan{
+          display: flex; flex-direction: row;margin-top: 10px;
+          div{
+            flex: 1;position: relative;
+            .bottom{
+              width: 99%;height: 70px;background: #f9f9f9;margin: 30px auto 5px;display: flex; flex-direction: row;text-align: center;
+              div{
+                flex: 1;height: 42px;color: #333333;
+              }
+              .bottom-l{
+                border-right: 1px solid #e0e0e0;margin-top: 15px;width: 100%;
+                .bottom-l-t{
+                  height: 30px;
+                  b{font-size: 18px;}
+                }
+                .bottom-l-b{font-size: 12px;}
+              }
+              .bottom-r{
+                margin-top: 15px;width: 100%;
+                .bottom-r-t{height: 30px;padding-left: 10px;}
+                .bottom-r-b{padding-left: 10px;font-size: 12px;}
+              }
+            }
+          }
+        }
+      }
+      .row3{
+        margin-top:10px;height: 375px;background: #fff;
+        .img-title{background-position: 0 -90px;}
+      }
+    }
+    .dashboard-r{
+      margin-left: 10px;flex:1;
+      .row1{
+        height: 520px;background: #fff;
+        .img-title{background-position: 0 -240px;}
+        #row2chartLine3{height: 270px;margin-top: 10px;}
+        .carsLength{
+          padding: 13px 0 0 22px;line-height: 38px;font-size: 18px;font-weight: 700;
+        }
+        .car{
+          height: 140px;position: relative;
+          .iconLeft{width:32px;height:32px;position:absolute;top:46px;left:15px; z-index:1;}
+          .iconRight{width:32px;height:32px;position:absolute;top:46px;right: 20px ;z-index:1;}
+          .carList{
+            padding:0 30px;height: 120px;overflow: hidden;display: flex;
+            .listW{
+              background: #f3f9f7;
+              float: left;
+              // flex: 1 1;
+              margin: 0 5px;position: relative;width: 50%;
+              .list{
+                width: 100%;height: 100%;border-radius: 5px;border:1px solid #000;
+                .list-t{
+                  display: flex;border-bottom: 1px solid #f1f1f1;
+                  .list-t-t{
+                    flex: 1 1;width: 0;font-size: 12px;line-height: 22px;padding: 25px 5px 15px;text-align: center;
+                    span{ display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+                  }
+                }
+                .list-b{
+                  display: flex; text-align: center;margin-top: 14px;color: #323232;
+                  .list-b-l{
+                    flex: 1;width: 0; height: 40px; position: relative;
+                    .left{
+                      .num{
+                        font-size: 12px;
+                        b{font-size: 12px;}
+                      }
+                      .weight{font-size: 12px;}
+                    }
+                    .right{
+                      height: 30px;width: 1px;background: #e0e0e0;position: absolute;right: 0;top: 0;bottom: 0;margin-top:auto;margin-bottom:auto
+                    }
+                  }
+                }
+              }
+              .img-checked{width: 30px;height: 28px;position: absolute;top: 0;right: 0;background: url(../../../assets/images/index/row-r6.png);}
+            }
+          }
+        }
+      }
+
+      .row2{
+        margin-top:10px;height: 375px;
+        display: flex; flex-direction: row;
+        .row2-l{
+          margin-right: 10px; background: #fff;height:375px;border-radius:3px;flex: 1;
+          .img-title{background-position: 0 -30px;}
+        }
+        .row2-r{
+           background: #fff;height:375px;border-radius:3px;flex: 1;
+          .img-title{background-position: 0 -60px;}
+        }
+      }
+
+      .row3{
+        margin-top:10px;height: 375px;
+        display: flex; flex-direction: row;
+        .row3-l{
+          margin-right: 10px; background: #fff;height:375px;border-radius:3px;flex: 1;
+          .img-title{background-position: 0 -120px;}
+        }
+        .row3-r{
+           background: #fff;height:375px;border-radius:3px;flex: 1;
+          .img-title{background-position: 0 -150px;}
+        }
+      }
+
+    }
+  }
+</style>

+ 1449 - 0
.svn/pristine/e3/e3eb3e4cc40cd9daa8f9af1466a3ff48ade90425.svn-base

@@ -0,0 +1,1449 @@
+<template>
+  <div class="app-container">
+    <div class="menuList">
+      <div class="menuList-t">
+        <div class="menuList-t-l">
+          <span>班次:</span>
+          <el-radio-group v-model="menuRadio" size="small" @change="changeMenu">
+            <el-radio-button v-if="maxTime.isTime1" label="一班">一班</el-radio-button>
+            <el-radio-button v-if="maxTime.isTime2" label="二班">二班</el-radio-button>
+            <el-radio-button v-if="maxTime.isTime3" label="三班">三班</el-radio-button>
+            <el-radio-button v-if="maxTime.isTime4" label="四班">四班</el-radio-button>
+          </el-radio-group>
+        </div>
+        <div class="menuList-t-r">
+          <div v-if="!isBarracks" class="menuList-t-r-l" @click="clickBarracks(2);">栏舍计划统计-展开<i class="el-icon-arrow-down" /></div>
+          <div v-if="isBarracks" class="menuList-t-r-r" @click="clickBarracks(1);">栏舍计划统计-收起<i class="el-icon-arrow-up" /></div>
+          <div v-if="isBarracks" class="columnHouse">
+            <div class="smallTable">
+              <el-table
+                :list-loading="smallMenu.listLoading"
+                element-loading-text="给我一点时间"
+                :data="smallMenu.list"
+                :row-style="rowStyle2"
+                :cell-style="cellStyle2"
+                :header-row-style="headerRowStyle2"
+                :header-cell-style="headerCellStyle2"
+                show-summary
+                sum-text="总栏舍"
+              >
+                <el-table-column label="配方/班次" min-width="80px" align="center" prop="tname" />
+                <el-table-column label="总数" min-width="50px" align="center" prop="usedsum" />
+                <el-table-column v-if="maxTime.isTime1" label="第一班未分配" min-width="105px" align="center" prop="onetime" />
+                <el-table-column v-if="maxTime.isTime2" label="第二班未分配" min-width="105px" align="center" prop="twotime" />
+                <el-table-column v-if="maxTime.isTime3" label="第三班未分配" min-width="105px" align="center" prop="threetime" />
+                <el-table-column v-if="maxTime.isTime4" label="第四班未分配" min-width="105px" align="center" prop="fourtime" />
+              </el-table>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="menuList-b">
+        <ul v-loading="listLoadingTimes" class="draggableList">
+          <li v-for="element in MenuList" :key="element.arrid">
+            <span v-if="element.isShowTitle" class="draggableTitle">{{ element.ftname }}:</span>
+            <draggable id="1" data-source="juju1" :list="element.arrList" class="list-group1" draggable=".item" group="a" :move="move" @change="changeLog" @start="start" @end="end">
+              <div v-for="item in element.arrList" :key="item.id" class="list-group-item1 item" style="width: 88px;float: left;margin:5px 5px;height: 36px;">
+                <div style="position: relative;">
+                  <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;" :style="{'background':item.background}">
+                    <div slot="content">{{ item.barname }}</div>
+                    <div class="draggableName">{{ item.barname }}</div>
+                  </el-tooltip>
+                  <div class="draggableWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
+
+                    <!-- <span v-if="item.isfill==1" style="background: #009C69;color:#fff;position: absolute;left: 0;top: 18px;">补</span> -->
+                    {{ item.weight }}
+                  </div>
+                </div>
+              </div>
+            </draggable>
+          </li>
+        </ul>
+      </div>
+    </div>
+
+    <div class="operation" style="width: 100%; border-top: 2px solid #d8dce5; box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04)">
+      <el-button class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次</el-button>
+      <el-button class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">减少车次</el-button>
+    </div>
+
+    <div class="table">
+      <el-table
+        id="table"
+        :key="table.tableKey"
+        ref="table"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        highlight-current-row
+        style="width: 100%;"
+        :height="height"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        row-key="id"
+        @selection-change="handleSelect"
+      >
+        <el-table-column type="selection" width="50" />
+        <el-table-column label="车次" width="75px" 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" type="number" placeholder="车次" class="filter-item" style="display: inline-block;width: 95%;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="TMR编号" width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.tmrname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" placeholder="TMR编号" class="filter-item" style="width:95%;" @change="(value)=> {changeTMRNumber(value, scope.row)}">
+              <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="描述" width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.display }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="描述" maxlength="255" class="filter-item" style="display: inline-block;width: 95%;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="生效" width="90px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.sel" :disabled="scope.row.NoEdit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleTakeEffectChange(scope.$index, scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column label="班次" width="90px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.timesstr }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.times" :disabled="scope.row.Disabled" placeholder="班次" class="filter-item" style="width:95%;">
+              <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="时间" width="110px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.begintime }}</span>
+            <el-time-picker v-if="scope.row.Edit" v-model="scope.row.begintime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="最大重量" width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.maxweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="合计重量" width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.sumweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="模板配方" width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" :disabled="scope.row.Disabled" placeholder="模板配方" class="filter-item" style="width:95%;" @change="(value)=> {changeTemplateFormulation(value, scope.row)}">
+              <el-option v-for="item in templateFormulationList" :key="item.id" :label="item.tname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="是否提前小料拆分" width="150px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.issplit" :disabled="scope.row.NoEdit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleIssplitChange(scope.$index, scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column label="撒料" width="950px" align="center">
+          <template slot-scope="scope">
+            <draggable id="2" data-source="juju" :list="scope.row.arrList" class="list-group2" draggable=".item" group="a" :move="move2" @change="changeLog2(scope.row)" @start="start2" @end="end2(scope.row)">
+              <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item">
+                <div class="arr-l" :style="{'background':element.tbackground}">
+                  <div class="arr-l-t">
+                    <div class="arr-l-t-t" />
+                    <el-select v-model="element.tmrid" placeholder="撒料设备" class="arr-l-t-b el-icon-arrow-down" @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}">
+                      <el-option v-for="item in equipmentList" :key="item.id" :disabled="table.myTemp.isUpdateSave || scope.row.havebutton == 1" :label="item.tmrmix" :value="item.id" />
+                    </el-select>
+                  </div>
+                  <div class="arr-l-b">
+                    <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
+                      <div slot="content">{{ element.tmrname }}</div>
+                      <div class="tmrname">{{ element.tmrname }}</div>
+                    </el-tooltip>
+                  </div>
+                  <!-- <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div> -->
+                </div>
+                <div class="arr-r">
+                  <div class="arr-r-l">
+                    <el-tooltip placement="top">
+                      <div slot="content">{{ element.barname }}</div>
+                      <div class="barname">{{ element.barname }}</div>
+                    </el-tooltip>
+                  </div>
+                  <div class="arr-r-c">-</div>
+                  <div class="arr-r-r">
+                    <el-tooltip v-show="!element.isWeight" placement="top">
+                      <div slot="content">{{ element.weight }}</div>
+                      <div class="weight" @dblclick="dbclickWeight(element,scope.row)">{{ element.weight }}</div>
+                    </el-tooltip>
+                    <el-tooltip v-show="element.isWeight" placement="top">
+                      <div slot="content">{{ element.weight }}</div>
+                      <input ref="weight" v-model="element.weight" v-focus="element.focusState" type="number" placeholder="重量" step="0.01" class="filter-item2" style="display: inline-block;width: 95%;border: 1px solid #e6e6e6;" @blur="(value)=> {blurWeight(scope.row,element.fttype,element.id)}">
+                    </el-tooltip>
+                  </div>
+                </div>
+                <div class="arr-t" :style="{'background':element.background}">
+                  <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element,scope.row)" />
+                </div>
+              </div>
+            </draggable>
+          </template>
+        </el-table-column>
+
+        <el-table-column align="center" width="100" label="操作" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="row.isCreate" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
+            <span v-if="row.isCreate" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="row.isUpdate" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetArrList, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
+import draggable from 'vuedraggable'
+import Sortable from 'sortablejs'
+import Cookies from 'js-cookie'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'MaterialIssuancePlan',
+  display: 'Two list header slot',
+  order: 14,
+  components: { draggable },
+  directives: {
+    focus: {
+      update: function(el, { value }) {
+        if (value) {
+          el.focus()
+        }
+      }
+    }
+  },
+  props: {
+    show: { type: Boolean, default: false }, // 弹框可见标志
+    parentDate: { type: String, defalut: '' }
+  },
+  data() {
+    return {
+      date: '',
+      isBarracks: false,
+      requestParams: {
+        name: 'getTMRListEnableType', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
+      },
+      requestParams2: {
+        name: 'getTMRListEnableTypeAll', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '1' }
+      },
+      requestParams3: {
+        name: 'getFTSWList', offset: 0, parammaps: { pastureid: Cookies.get('pastureid') }
+      },
+      equipmentList: [], // 撒料设备
+      TMRNumberList: [], // TMR编号
+      frequencyList: [], // 班次
+      templateFormulationList: [], // 模板配方
+
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        },
+        // 班次
+        isTime1: false,
+        isTime2: false,
+        isTime3: false,
+        isTime4: false
+      },
+
+      table: {
+        getdataListParm: {
+          name: 'getLppListdate',
+          name1: 'getLppdListdate',
+          page: 1,
+          offset: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        list: [],
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        tabClickIndex: null, // 点击的单元格
+        tabClickLabel: '', // 当前点击的列名
+        temp: {},
+        move1: '',
+        changeList: [],
+        startObj: {},
+        isGoing: false,
+        myTemp: {}
+      },
+      selectList: [], // 选中数据
+
+      // 班次
+      menuRadio: '一班',
+      MenuList: [], // 配单列表
+      getdataListParmTimes: {
+        name: 'geFTListByFPdate',
+        name1: 'geFTListByFPDetaildate',
+        page: 1,
+        offset: 1,
+        returntype: 'Map',
+        parammaps: {
+          pastureid: Cookies.get('pastureid'),
+          times: '1'
+        }
+      },
+      listLoadingTimes: false,
+
+      // 栏舍统计
+      isLeftButton: true, // 向左
+      isRightButton: false, // 向右
+      rowStyle2: { maxHeight: 20 + 'px', height: 20 + 'px' },
+      cellStyle2: { padding: 0 + 'px' },
+      headerRowStyle2: { maxHeight: 20 + 'px', height: 20 + 'px' },
+      headerCellStyle2: { padding: 0 + 'px' },
+      smallMenu: {
+        getdataListParm: {
+          name: 'getLppUseSUMListdate',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        list: []
+      },
+      // 自动生成
+      automaticGeneration: {
+        dialogFormVisible: false,
+        dialogStatus: ''
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      textMap: {
+        automaticGeneration: '提示',
+        historyRecord: '历史记录'
+      },
+      isokDisable: false,
+      requestParam: {},
+      height: document.body.clientHeight - 255 - 50, // table高度
+      // height: document.body.clientHeight - 450 - 50, // table高度
+      rowStyle: { maxHeight: 45 + 'px', height: 40 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      dropState: false
+    }
+  },
+  watch: {
+    // 监听show,visible 随着show变化而变化
+    show: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log('newVal-show', newVal)
+      }
+    },
+    parentDate: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log('newVal-show', newVal)
+        this.date = newVal
+      }
+    }
+  },
+  created() {
+    this.getIsDisplay()
+    this.getDownList()
+  },
+  methods: {
+    clickBarracks(item) {
+      this.isBarracks = !this.isBarracks
+    },
+    // 下拉列表
+    getDownList() {
+      GetDataByName(this.requestParams).then(response => {
+        if (response.data !== null) {
+          this.TMRNumberList = response.data.list
+        } else {
+          this.TMRNumberList = []
+        }
+      })
+      GetDataByName(this.requestParams2).then(response => {
+        if (response.data !== null) {
+          this.equipmentList = response.data.list
+        } else {
+          this.equipmentList = []
+        }
+      })
+      GetDataByName(this.requestParams3).then(response => {
+        if (response.data !== null) {
+          this.templateFormulationList = response.data.list
+        } else {
+          this.templateFormulationList = []
+        }
+      })
+    },
+
+    // 显示班次
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        console.log(response.data.list[0].inforvalue)
+        if (response.data.list[0].inforvalue == 1) {
+          this.frequencyList = [{ id: '1', name: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+        } else if (response.data.list[0].inforvalue == 3) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+        } else if (response.data.list[0].inforvalue == 4) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+        }
+        if (response.data.list !== null) {
+          if (response.data.list[0].inforvalue == 1) {
+            this.maxTime.isTime1 = true
+            this.maxTime.isTime2 = false
+            this.maxTime.isTime3 = false
+            this.maxTime.isTime4 = false
+          } else if (response.data.list[0].inforvalue == 2) {
+            this.maxTime.isTime1 = true
+            this.maxTime.isTime2 = true
+            this.maxTime.isTime3 = false
+            this.maxTime.isTime4 = false
+          } else if (response.data.list[0].inforvalue == 3) {
+            this.maxTime.isTime1 = true
+            this.maxTime.isTime2 = true
+            this.maxTime.isTime3 = true
+            this.maxTime.isTime4 = false
+          } else if (response.data.list[0].inforvalue == 4) {
+            this.maxTime.isTime1 = true
+            this.maxTime.isTime2 = true
+            this.maxTime.isTime3 = true
+            this.maxTime.isTime4 = true
+          }
+        } else {
+          this.maxTime.isTime1 = false
+          this.maxTime.isTime2 = false
+          this.maxTime.isTime3 = false
+          this.maxTime.isTime4 = false
+        }
+      })
+      this.getList()
+      this.getSmallMenuList() // 栏舍统计
+      this.getTimesList() // 班次
+    },
+
+    // 头部班次
+    getTimesList() {
+      this.listLoadingTimes = true
+      this.getdataListParmTimes.parammaps.date = this.date
+      GetArrList(this.getdataListParmTimes).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'isShowTitle', true)
+            if (response.data.list[i].arrList == null) {
+              this.$set(response.data.list[i], 'isShowTitle', false)
+            } else {
+              for (let j = 0; j < response.data.list[i].arrList.length; j++) {
+                this.$set(response.data.list[i].arrList[j], 'background2', this.colorRgb(response.data.list[i].arrList[j].background))
+              }
+            }
+          }
+          this.MenuList = response.data.list
+        } else {
+          this.MenuList = []
+        }
+        setTimeout(() => {
+          this.listLoadingTimes = false
+        }, 100)
+      })
+    },
+    colorRgb(sColor) {
+      sColor = sColor.toLowerCase()
+      var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
+      // 如果是16进制颜色
+      if (sColor && reg.test(sColor)) {
+        if (sColor.length === 4) {
+          var sColorNew = '#'
+          for (var i = 1; i < 4; i += 1) {
+            sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
+          }
+          sColor = sColorNew
+        }
+        // 处理六位的颜色值
+        var sColorChange = []
+        for (var i = 1; i < 7; i += 2) {
+          sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
+        }
+        return sColorChange.join(',')
+      }
+      return 'rgba(' + sColorChange.join(',') + ')'
+    },
+    // 切换班次
+    changeMenu(val) {
+      console.log(val)
+      if (this.menuRadio === '一班') {
+        this.getdataListParmTimes.parammaps.times = '1'
+        this.getTimesList()
+      } else if (this.menuRadio === '二班') {
+        this.getdataListParmTimes.parammaps.times = '2'
+        this.getTimesList()
+        this.MenuList = this.twoMenuList
+      } else if (this.menuRadio === '三班') {
+        this.getdataListParmTimes.parammaps.times = '3'
+        this.getTimesList()
+      } else if (this.menuRadio === '四班') {
+        this.getdataListParmTimes.parammaps.times = '4'
+        this.getTimesList()
+      }
+    },
+
+    // 右侧栏舍统计
+    getSmallMenuList() {
+      this.smallMenu.listLoading = true
+      this.smallMenu.getdataListParm.parammaps.date = this.date
+      GetDataByName(this.smallMenu.getdataListParm).then(response => {
+        console.log('smallMenu数据', response.data.list)
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].onetime == undefined) { this.$set(response.data.list[i], 'onetime', 0) } else { response.data.list[i].onetime = parseFloat(response.data.list[i].onetime) }
+            if (response.data.list[i].twotime == undefined) { this.$set(response.data.list[i], 'twotime', 0) } else { response.data.list[i].twotime = parseFloat(response.data.list[i].twotime) }
+            if (response.data.list[i].threetime == undefined) { this.$set(response.data.list[i], 'threetime', 0) } else { response.data.list[i].threetime = parseFloat(response.data.list[i].threetime) }
+            if (response.data.list[i].fourtime == undefined) { this.$set(response.data.list[i], 'fourtime', 0) } else { response.data.list[i].fourtime = parseFloat(response.data.list[i].fourtime) }
+            this.$set(response.data.list[i], 'usedsum', response.data.list[i].onetime + response.data.list[i].twotime + response.data.list[i].threetime + response.data.list[i].fourtime)
+            this.$set(response.data.list[i], 'all', '')
+          }
+          this.smallMenu.list = response.data.list
+          this.smallMenu.total = response.data.total
+        } else {
+          this.smallMenu.list = []
+        }
+
+        setTimeout(() => {
+          this.smallMenu.listLoading = false
+        }, 100)
+      })
+    },
+
+    // table
+    getList() {
+      this.table.listLoading = true
+      this.table.getdataListParm.parammaps.date = this.date
+      GetArrList(this.table.getdataListParm).then(response => {
+        if (response.data !== null) {
+          console.log('table数据', response.data.list)
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'Edit', false) // 编辑
+            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
+            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
+            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
+            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
+            this.$set(response.data.list[i], 'Disabled', true) // 班次/模板配方不可输入
+
+            if (response.data.list[i].arrList == null) {
+              this.$set(response.data.list[i], 'Disabled', false)
+              this.$set(response.data.list[i], 'arrList', [])
+            } else {
+              for (let j = 0; j < response.data.list[i].arrList.length; j++) {
+                this.$set(response.data.list[i].arrList[j], 'isWeight', false)
+                this.$set(response.data.list[i].arrList[j], 'focusState', false)
+              }
+            }
+          }
+          this.table.list = response.data.list
+          this.rowDrop()
+          this.table.changeList = []
+          this.table.startObj = {}
+          if (response.data.total) {
+            this.table.total = response.data.total
+          }
+        } else {
+          this.table.list = []
+        }
+
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    // 行拖拽
+    rowDrop() {
+      console.log(document.querySelector('#table .el-table__body-wrapper tbody'))
+      const tbody = document.querySelector('#table .el-table__body-wrapper tbody')
+      const that = this
+      var sortable = Sortable.create(tbody, {
+        disabled: that.dropState,
+        onChoose({ newIndex, oldIndex }) {
+          if (that.dropState == true) {
+            sortable.destroy()
+          }
+        },
+        onEnd({ newIndex, oldIndex }) {
+          const currRow = that.table.list.splice(oldIndex, 1)[0]
+          that.table.list.splice(newIndex, 0, currRow)
+          console.log('索引', newIndex)
+          console.log('拖动数据', currRow)
+          console.log('上', that.table.list[newIndex - 1])
+          console.log('下', that.table.list[newIndex + 1])
+        }
+      })
+    },
+
+    // TMR编号
+    changeTMRNumber(item, row) {
+      row.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
+      row.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
+    },
+    // 配方模板
+    changeTemplateFormulation(item, row) {
+      row.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
+    },
+    // 增加车次
+    handleCreate() {
+      console.log(this.table.list)
+      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
+        }
+      }
+      if (this.table.list.length == 0) {
+        this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'tmrname': '', 'tmrid': '', 'sort': 1, 'sel': 1, 'issplit': 1, 'times': '', 'display': '', 'begintime': '', 'ftname': '', 'ftid': '', 'sumweight': '', 'sumcowcount': '', 'maxweight': '', 'arrList': [] })
+      } else {
+        this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'tmrname': '', 'tmrid': '', 'sort': parseInt(this.table.list[this.table.list.length - 1].sort) + 1, 'sel': 1, 'issplit': 1, 'times': '', 'display': '', 'begintime': '', 'ftname': '', 'ftid': '', 'sumweight': '', 'sumcowcount': '', 'maxweight': '', 'arrList': [] })
+      }
+      // this.$refs.box.scrollTop = 0
+      this.$refs.table.bodyWrapper.scrollTop = 0
+      this.dropState = true
+    },
+    createData(row) {
+      console.log('点击了新增保存', row)
+      this.table.temp.pastureid = Cookies.get('pastureid')
+      this.table.temp.tmrname = row.tmrname
+      this.table.temp.tmrid = row.tmrid
+      this.table.temp.sort = row.sort
+      this.table.temp.sel = row.sel
+      this.table.temp.issplit = row.issplit
+      this.table.temp.times = row.times
+      this.table.temp.display = row.display
+      this.table.temp.begintime = row.begintime
+      this.table.temp.ftname = row.ftname
+      this.table.temp.ftid = row.ftid
+      this.table.temp.sumweight = 0
+      this.table.temp.maxweight = row.maxweight
+      this.table.temp.date = this.date
+
+      if (this.table.temp.sort == '' && this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: '车次/TMR编号/班次/模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.times == '' && this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: '班次/模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: '模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.times == '') {
+        this.$message({ type: 'error', message: '班次不能为空', duration: 2000 })
+        return false
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort == this.table.list[i].sort) {
+          if (row.myId !== this.table.list[i].myId) {
+            this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+            return false
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (this.table.temp.sort !== '') {
+        if (!isInteger.test(parseFloat(this.table.temp.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.name = 'insertLppdate'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    createCancel(row) {
+      console.log('点击了新增取消')
+      this.dropState = false
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.myId === this.table.list[i].myId) {
+          var listIndex = this.table.list.indexOf(this.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.table.list.splice(listIndex, 1)
+          return
+        }
+      }
+    },
+
+    // 编辑
+    handleUpdate(row) {
+      console.log(row, '点击了行编辑')
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (this.table.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 新增false,编辑false,编辑保存true
+      row.isCreate = false
+      row.isUpdate = false
+      row.isUpdateSave = true
+      row.times = String(row.times)
+      if (row.sort == undefined) { row.sort = '' }
+      if (row.tmrid == undefined || row.tmrname == undefined) {
+        row.tmrid = ''
+        row.tmrname = ''
+      }
+      if (row.display == undefined) { row.display = '' }
+      if (row.times == undefined) { row.times = '' }
+      if (row.begintime == undefined) { row.begintime = '' }
+      if (row.ftid == undefined || row.ftname == undefined) {
+        row.ftid = ''
+        row.ftname = ''
+      }
+      this.dropState = true
+      this.table.myTemp = Object.assign({}, row)
+    },
+    updateData(row) {
+      console.log('点击了编辑保存', row)
+      row.isUpdateSave = false
+      this.table.myTemp = Object.assign({}, row)
+      this.table.temp.pastureid = row.pastureid
+      this.table.temp.id = row.id
+      this.table.temp.tmrname = row.tmrname
+      this.table.temp.tmrid = row.tmrid
+      this.table.temp.sort = row.sort
+      this.table.temp.sel = row.sel
+      this.table.temp.issplit = row.issplit
+      this.table.temp.times = row.times
+      this.table.temp.display = row.display
+      this.table.temp.begintime = row.begintime
+      this.table.temp.ftname = row.ftname
+      this.table.temp.ftid = row.ftid
+      this.table.temp.sumweight = row.sumweight
+      this.table.temp.sumcowcount = row.sumcowcount
+      this.table.temp.maxweight = row.maxweight
+      this.table.temp.date = this.date
+
+      if (this.table.temp.sort == '' && this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: '车次/TMR编号/班次/模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.tmrid == '' && this.table.temp.times == '' && this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: 'TMR编号/班次/模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.times == '' && this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: '班次/模板配方不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.ftid == '') {
+        this.$message({ type: 'error', message: '模板配方不能为空', duration: 2000 })
+        return false
+      }
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.sort == this.table.list[i].sort) {
+          if (row.id !== this.table.list[i].id) {
+            this.$message({ type: 'error', message: '车次不可重复', duration: 2000 })
+            return false
+          }
+        }
+      }
+      var isInteger = /^\d+$/
+      if (this.table.temp.sort !== '') {
+        if (!isInteger.test(parseFloat(this.table.temp.sort))) {
+          this.$message({ type: 'error', message: '车次请输入整数', duration: 2000 })
+          return false
+        }
+      }
+
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.name = 'updateLppdate'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('编辑保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.dropState = false
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateCancel(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.dropState = false
+      this.table.myTemp = Object.assign({}, row)
+    },
+
+    // 配方
+    changeLog: function(evt) {
+      console.log('change1', evt)
+    },
+    start(evt) {
+      console.log('start1', evt)
+      this.$set(this.table.startObj, 'from', evt.from.className)
+      this.$set(this.table.startObj, 'to', evt.from.className)
+    },
+    end(evt) {
+      console.log('end1', evt)
+    },
+    move(evt, originalEvent) {
+      if (originalEvent.target.className === 'list-group-item1 item' || originalEvent.target.className === 'draggableWeight') {
+        return false
+      }
+      console.log(evt)
+      this.table.move1 = evt.draggedContext.element
+    },
+
+    start2(evt) {
+      console.log('start2', evt)
+      this.$set(this.table.startObj, 'from', evt.from.className)
+      this.$set(this.table.startObj, 'to', evt.from.className)
+    },
+    move2(evt, originalEvent) {
+      // console.log(evt, originalEvent)
+      if (originalEvent.target.className === 'list-group-item1 item' || originalEvent.target.className === 'draggableWeight') {
+        return false
+      }
+      this.table.move1 = evt.draggedContext.element
+    },
+    end2(evt) {
+      // console.log(evt)
+      console.log('end2', evt)
+    },
+    // 撒料位
+    changeLog2(evt) {
+      // console.log(this.table.startObj)
+      console.log(evt, 'evt-----')
+      if (evt.havebutton == 1) {
+        this.$message({ type: 'error', message: '该车次计划已执行,不允许修改', duration: 2000 })
+        this.getTimesList()
+        this.getSmallMenuList()
+        this.getList()
+        return false
+      }
+      this.table.changeList.push(evt)
+      evt = this.table.changeList[0]
+      if (evt.arrList.length == 1) {
+        evt.arrList[0].sort = 0
+      } else if (evt.arrList.length > 1) {
+        for (let i = 0; i < evt.arrList.length; i++) {
+          if (evt.arrList[i].id == this.table.move1.id && evt.arrList[i].fttype == this.table.move1.fttype) {
+            if (evt.arrList[i - 1] == undefined) {
+              evt.arrList[i].sort = 0
+              evt.sort = 0
+            } else {
+              evt.arrList[i].sort = parseFloat(evt.arrList[i - 1].sort) + 1
+              evt.sort = parseFloat(evt.arrList[i - 1].sort) + 1
+            }
+          }
+        }
+      }
+      console.log(evt.arrList, '==========1')
+      console.log(evt, '==========2')
+      if (this.table.startObj.from == 'list-group1' && this.table.startObj.to == 'list-group1') {
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
+        this.requestParam.data[0] = { 'name': 'checkLLPDetailInsertdate', 'type': 'v', 'parammaps': {
+          pastureid: this.table.move1.pastureid,
+          barid: this.table.move1.barid,
+          lppid: evt.id,
+          times: evt.times,
+          ftid: this.table.move1.ftid,
+          ptsid: this.table.move1.ptsid,
+          ptid: this.table.move1.ptid,
+          fttype: this.table.move1.fttype,
+          timesTem: this.table.move1.times,
+          date: this.date
+        }}
+        this.requestParam.data[1] = { 'name': 'updateLpplandtlSortsdate', 'type': 'e', 'parammaps': {
+          pastureid: evt.pastureid,
+          sort: evt.sort,
+          lppid: evt.id,
+          date: this.date
+        }}
+        this.requestParam.data[2] = { 'name': 'insertLppddate', 'type': 'e', 'parammaps': {
+          pastureid: evt.pastureid,
+          lppid: evt.id,
+          barid: this.table.move1.barid,
+          barname: this.table.move1.barname,
+          fpdid: this.table.move1.id,
+          fttype: this.table.move1.fttype,
+          lweight: this.table.move1.weight,
+          sort: evt.sort,
+          tmrid: evt.tmrid,
+          tmrname: evt.tmrname,
+          background: this.table.move1.background,
+          ccountradio: this.table.move1.ccountradio,
+          cowcount: this.table.move1.cowcount,
+          date: this.date
+        }}
+        this.requestParam.data[3] = { 'name': 'updateFpdetailUsedate', 'type': 'e', 'parammaps': {
+          pastureid: this.table.move1.pastureid,
+          id: this.table.move1.id,
+          fttype: this.table.move1.fttype,
+          lweight: this.table.move1.weight,
+          date: this.date
+        }}
+
+        console.log('撒料位上-下新增', this.requestParam)
+        ExecDataByConfig(this.requestParam).then(response => {
+          console.log('撒料位新增保存发送参数', this.requestParam)
+          if (response.msg === 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            this.getTimesList()
+            this.getSmallMenuList()
+            this.getList()
+          } else {
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+            this.getList()
+            this.getSmallMenuList()
+          }
+        })
+      } else if (this.table.startObj.from == 'list-group2' && this.table.startObj.to == 'list-group2') {
+        if (this.table.changeList.length == 1) {
+          this.requestParam = {}
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'checkLLPDetailInsertdate', 'type': 'v', 'parammaps': {
+            pastureid: this.table.move1.pastureid,
+            barid: this.table.move1.barid,
+            lppid: evt.id,
+            times: evt.times,
+            ftid: this.table.move1.ftid,
+            ptsid: this.table.move1.ptsid,
+            ptid: this.table.move1.ptid,
+            fttype: this.table.move1.fttype,
+            timesTem: evt.times,
+            date: this.date
+          }}
+          this.requestParam.data[1] = { 'name': 'updateLpplandtlSortsdate', 'type': 'e', 'parammaps': {
+            pastureid: evt.pastureid,
+            sort: evt.sort,
+            lppid: evt.id,
+            date: this.date
+          }}
+          this.requestParam.data[2] = { 'name': 'deleteLppddate', 'type': 'e', 'parammaps': {
+            pastureid: evt.pastureid,
+            id: this.table.move1.id,
+            date: this.date
+          }}
+          this.requestParam.data[3] = { 'name': 'insertLppddate', 'type': 'e', 'parammaps': {
+            pastureid: evt.pastureid,
+            lppid: evt.id,
+            barid: this.table.move1.barid,
+            barname: this.table.move1.barname,
+            fpdid: this.table.move1.fpdid,
+            fttype: this.table.move1.fttype,
+            lweight: this.table.move1.weight,
+            sort: evt.sort,
+            tmrid: evt.tmrid,
+            tmrname: evt.tmrname,
+            background: this.table.move1.background,
+            ccountradio: this.table.move1.ccountradio,
+            cowcount: this.table.move1.cowcount,
+            date: this.date
+          }}
+          console.log('撒料位下-下新增', this.requestParam)
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('撒料位新增保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              this.getTimesList()
+              this.getSmallMenuList()
+              this.getList()
+            } else {
+              this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+              this.getSmallMenuList()
+            }
+          })
+        } else if (this.table.changeList.length == 1) {
+          if (this.table.isGoing == true) {
+            console.log(11111)
+            this.requestParam.common = { 'returnmap': '0' }
+            this.requestParam.data = []
+            this.requestParam.data[0] = { 'name': 'checkLLPDetailInsertdate', 'type': 'e', 'parammaps': {
+              pastureid: evt.pastureid,
+              sort: evt.sort,
+              lppid: evt.id,
+              date: this.date
+            }}
+            this.requestParam.data[1] = { 'name': 'deleteLppddate', 'type': 'e', 'parammaps': {
+              pastureid: evt.pastureid,
+              id: this.table.move1.id,
+              date: this.date
+            }}
+            this.requestParam.data[2] = { 'name': 'insertLppddate', 'type': 'e', 'parammaps': {
+              pastureid: evt.pastureid,
+              lppid: evt.id,
+              barid: this.table.move1.barid,
+              barname: this.table.move1.barname,
+              fpdid: this.table.move1.id,
+              fttype: this.table.move1.fttype,
+              lweight: this.table.move1.weight,
+              sort: evt.sort,
+              tmrid: evt.tmrid,
+              tmrname: evt.tmrname,
+              background: this.table.move1.background,
+              date: this.date
+            }}
+            this.requestParam.data[3] = { 'name': 'updateFpdetailUsedate', 'type': 'e', 'parammaps': {
+              pastureid: this.table.move1.pastureid,
+              id: this.table.move1.id,
+              fttype: this.table.move1.fttype,
+              statue: 1,
+              date: this.date
+            }}
+
+            console.log('撒料位新增', this.requestParam)
+            ExecDataByConfig(this.requestParam).then(response => {
+              console.log('撒料位新增保存发送参数', this.requestParam)
+              if (response.msg === 'fail') {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+                this.getTimesList()
+                this.getList()
+              } else {
+                this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+                this.getList()
+              }
+            })
+            this.table.isGoing = false
+          } else {
+            this.table.isGoing = true
+          }
+        }
+      }
+    },
+
+    // 编辑-撒料设备
+    changeEquipment(item, row, fttype, myid) {
+      var objList = {}
+      for (let i = 0; i < row.arrList.length; i++) {
+        row.arrList[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
+        if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
+          objList = row.arrList[i]
+        }
+        if (row.tmrid == row.arrList[i].tmrid) {
+          if (row.tmrid !== item) {
+            this.$message({ type: 'warning', message: '混料设备不可与其它撒料设备同时选择', duration: 2000 })
+            this.getList()
+            return false
+          }
+        } else {
+          if (row.tmrid == item) {
+            this.$message({ type: 'warning', message: '混料设备不可与其它撒料设备同时选择', duration: 2000 })
+            this.getList()
+            return false
+          }
+        }
+      }
+      console.log(row)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'updateLppddate', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        lppid: row.id,
+        barid: objList.barid,
+        barname: objList.barname,
+        fpdid: objList.fpdid,
+        fttype: objList.fttype,
+        lweight: objList.weight,
+        sort: objList.sort,
+        tmrid: objList.tmrid,
+        tmrname: objList.tmrname,
+        background: objList.background,
+        id: objList.id,
+        date: this.date
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('编辑保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.getTimesList()
+        }
+      })
+    },
+    dbclickWeight(row, row2) {
+      console.log(row2, 'row2')
+      if (row2.havebutton == 1) {
+        return false
+      }
+      if (this.table.myTemp.isUpdateSave == true) {
+        return false
+      }
+      console.log(row)
+      row.isWeight = true
+      row.focusState = true
+      this.dropState = true
+      this.myStart2 = false
+      this.myMove2 = false
+      this.myEnd2 = false
+    },
+    // 编辑-重量
+    blurWeight(row, fttype, myid) {
+      var objList = {}
+      for (let i = 0; i < row.arrList.length; i++) {
+        if (row.arrList[i].fttype == fttype && row.arrList[i].id == myid) {
+          objList = row.arrList[i]
+        }
+      }
+      if (objList.weight == '') { objList.weight = 0 }
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'checkFPdLeftWdate', 'type': 'v', 'parammaps': {
+        pastureid: objList.pastureid,
+        fpdid: objList.fpdid,
+        fttype: objList.fttype,
+        lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight)),
+        date: this.date
+      }}
+      this.requestParam.data[1] = { 'name': 'updateLppddate', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        lppid: row.id,
+        barid: objList.barid,
+        barname: objList.barname,
+        fpdid: objList.fpdid,
+        fttype: objList.fttype,
+        lweight: objList.weight,
+        sort: objList.sort,
+        tmrid: objList.tmrid,
+        tmrname: objList.tmrname,
+        background: objList.background,
+        id: objList.id,
+        date: this.date
+      }}
+      this.requestParam.data[2] = { 'name': 'updateFpdetailUsedate', 'type': 'e', 'parammaps': {
+        pastureid: objList.pastureid,
+        id: objList.fpdid,
+        fttype: objList.fttype,
+        lweight: String(parseFloat(objList.weight) - parseFloat(objList.lweight)),
+        date: this.date
+      }}
+
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('编辑保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          this.getList()
+          this.getTimesList()
+        } else {
+          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.getTimesList()
+        }
+      })
+    },
+    handleTakeEffectChange() {
+      console.log('点击了生效')
+    },
+    handleIssplitChange() {
+      console.log('是否提前小料拆分')
+    },
+
+    // 撒料位删除
+    handleFLDelete(ele, row) {
+      if (row.havebutton == 1) {
+        return false
+      }
+      if (this.table.myTemp.isUpdateSave == true) {
+        return false
+      }
+      console.log(ele, row, '点击了撒料删除')
+      this.selectList = []
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'deleteLppddate', 'type': 'e', 'parammaps': {
+        pastureid: ele.pastureid,
+        id: ele.id,
+        date: this.date
+      }}
+      this.requestParam.data[1] = { 'name': 'updateFpdetailUsedate', 'type': 'e', 'parammaps': {
+        pastureid: ele.pastureid,
+        id: ele.fpdid,
+        fttype: ele.fttype,
+        lweight: '-' + parseFloat(ele.weight),
+        date: this.date
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('删除保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.getTimesList()
+        }
+      })
+    },
+
+    handleSelect(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    // 减少车次
+    handleReduceTrains() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次', duration: 2000 })
+        return false
+      } else {
+        // 减少对应车次
+        for (let i = 0; i < this.selectList.length; i++) {
+          if (this.selectList[i].arrList.length > 0) {
+            this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
+            return false
+          }
+        }
+        MessageBox.confirm('是否确认删除此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam = {}
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotListdate', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteLppdate', 'type': 'e', 'parammaps': {
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid',
+            date: this.date
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('删除保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+
+    // 行内删除
+    handleRowDelete(row) {
+      console.log(row, '点击了行删除')
+      if (row.arrList.length == 0) {
+        MessageBox.confirm('是否确认删除此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          this.selectList = []
+          this.requestParam = {}
+          this.requestParam.name = 'deleteLppdate'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = row.pastureid
+          this.requestParam.parammaps.id = row.id
+          this.requestParam.parammaps.date = this.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.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
+        return false
+      }
+    },
+    handleLeftButton() { // 向左
+      this.isLeftButton = false
+      this.isRightButton = true
+      this.$refs.listR.style.width = '46%'
+      this.$refs.listR.style.zIndex = 4
+      this.getSmallMenuList()
+    },
+    handleRightButton() { // 向右
+      this.isLeftButton = true
+      this.isRightButton = false
+      this.$refs.list.style.zIndex = 1
+      this.$refs.listR.style.width = '50px'
+      this.$refs.listR.style.zIndex = 1
+      this.$nextTick(() => {
+        this.$refs.listRight.style.zIndex = 1
+        this.$refs.listRight2.style.zIndex = 1
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+  /deep/ :focus {
+    outline: 0;
+  }
+  :focus-visible {
+    outline: 0 !important;
+  }
+  // 下拉框
+  .filter-item2 .el-input--suffix .el-input__inner{
+    height: 30px !important;
+    font-size: 8px;
+    padding: 0 2px;
+  }
+  .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon{
+    line-height: 30px !important;
+  }
+  // 输入框
+  .filter-item2 .el-input__inner{
+    height: 30px !important;
+    font-size: 8px;
+    padding: 0 2px;
+  }
+</style>
+
+<style lang="scss">
+ .menuList{
+    height: 190px;background: red;border-bottom: 2px solid #d8dce5; box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
+    .menuList-t{
+      height: 60px;background: #fff;display: flex;justify:center;align-items:center;display:-webkit-flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;
+      .menuList-t-l{}
+      .menuList-t-r{
+        display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;position: relative;
+        .menuList-t-r-l{
+          margin-right:10px;cursor:pointer;width:150px;height: 20px;line-height:20px; text-align: center; background: rgba(25, 138, 244, 0); border: 1px solid #1BBD89; border-radius: 2px;font-size:12px;color: #1BBD89;
+        }
+        .menuList-t-r-r{
+          margin-right:10px;cursor:pointer;width:150px;height: 20px;line-height:20px; text-align: center; background: rgba(25, 138, 244, 0); border: 1px solid #1BBD89; border-radius: 2px;font-size:12px;color: #1BBD89;
+        }
+        .columnHouse{
+          width:650px;background: #fff; box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.04), 0 0 6px 6px rgba(0, 0, 0, 0.04);position: absolute;right: 0;top: 25px;z-index: 5;
+          .el-table {
+            height: 250px;
+            overflow: auto;
+          }
+        }
+      }
+
+    }
+    .menuList-b{
+      height: 130px;background: #fff;position: relative;
+      ::-webkit-scrollbar{ width: 7px; height: 7px; background-color: #F5F5F5; }
+      ::-webkit-scrollbar-track { box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); border-radius: 10px; background-color: #F5F5F5; }
+      ::-webkit-scrollbar-thumb{ border-radius: 10px; box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); background-color: #c8c8c8; }
+      .draggableList{position: absolute;width: 100%;margin: 0 0; height: 130px; list-style: none;padding:0 0;overflow: auto;font-size: 12px;
+        .draggableTitle{float: left;width: 105px;white-space: nowrap;overflow: hidden; text-overflow: ellipsis;margin:5px 5px;border-radius: 7px;text-align: center;color:#000;height: 36px;line-height: 36px;}
+        li{
+          text-align: center;color:#fff;
+          .draggableName{display:block;width: 100%;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
+        }
+      }
+    }
+  }
+  .list-group2{
+    .list-group-item2{
+      width: 220px;height: 50px;overflow: hidden; float: left;margin: 5px 5px;position: relative;
+      .arr-t{height: 50px;border-radius:5px 5px;}
+      .arr-l{
+        float: left;width: 60px;height: 50px;overflow: hidden;border-radius:5px 50% 50% 5px;
+        .arr-l-t{
+          position: relative;
+          .arr-l-t-t{
+            width: 0;height: 0; border-top: 26px solid #3479f2; border-right: 26px solid transparent;
+          }
+          .arr-l-t-b{
+            position: absolute;top: 4px;left: 1px;color: #fff;width: 10px; height: 10px;
+            .el-input--suffix{
+              opacity:0;
+              .el-input__inner{height: 10px;}
+            }
+          }
+        }
+
+        .arr-l-b{
+          width: 45px;position: absolute;top: 15px;left: 10px;color: #333;font-size: 12px;
+          .tmrname{width: 100%;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
+        }
+      }
+      .arr-c{position: absolute;top: 0px;left: 0;}
+      .arr-r{
+        float: right;width: 160px;height: 50px;overflow: hidden;line-height: 50px;
+        .arr-r-l{
+          float: left;width: 85px;
+          .barname{width: 100%;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
+        }
+        .arr-r-c{float: left;width: 10px;}
+        .arr-r-r{
+          float: left;width: 65px;
+          .weight{width: 100%;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
+        }
+      }
+    }
+  }
+</style>
+<style>
+  .draggableWeight{display:block;line-height: 18px;height: 18px; color: #000; width: 100%; margin: 0 auto;}
+</style>

+ 588 - 0
.svn/pristine/ee/eee6e6667ea9a0dfef40ff8c72b20e77b77172bf.svn-base

@@ -0,0 +1,588 @@
+<template>
+  <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"
+        :span-method="objectSpanMethod"
+      >
+        <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
+        <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" class-name="small-padding fixed-width" fixed="left" />
+        <el-table-column :key="4" label="软件牛头数" prop="softccount" min-width="70px" align="center" />
+        <el-table-column :key="5" label="实际牛头数" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcount(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column :key="6" label="系数(%)" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurRatio(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column :key="7" label="系数头数" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column :key="8" label="配方模板" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ptname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.ptid" filterable placeholder="配方模板" class="filter-item" style="width:99%;" @change="(value)=> {changeRecipeTemplate(value, scope.row)}">
+              <el-option v-for="item in recipeTemplateList" :key="item.id" :label="item.tname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column v-if="table.isPtsfname" :key="9" label="补料配方" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.ptsname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.ptsid" clearable filterable placeholder="补料配方" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
+              <el-option v-for="item in feedingFormulaList" :key="item.id" :label="item.tname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column :key="10" label="班次比例(%)" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.tratio }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.tratio" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurTratio(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column :key="11" label="班次重量" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.weight" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurWeight(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column :key="12" label="配方重量" prop="pweight" min-width="85px" align="center" />
+        <el-table-column v-if="table.isPtsfname" :key="13" label="补料重量" prop="ptweight" min-width="85px" align="center" />
+        <el-table-column :key="14" label="配方干物质量" prop="dryweight" min-width="85px" align="center" />
+        <el-table-column :key="15" label="饲喂干物质量" prop="swdryw" min-width="85px" align="center" />
+        <el-table-column :key="16" label="采样干物质量" prop="cydryw" min-width="85px" align="center" />
+        <el-table-column :key="17" label="日投喂量" prop="sumweight" min-width="85px" align="center" />
+        <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <el-button v-if="row.isUpdateSave" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination2 v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GETNurJudge, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum } from '@/api/common'
+import Pagination2 from '@/components/Pagination2'
+import { parseTime, json2excel, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import Cookies from 'js-cookie'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'DhedFormula',
+  inject: ['reload'],
+  components: { Pagination2 },
+  props: {
+    show: { type: Boolean, default: false },
+    parentDate: {
+      type: String,
+      defalut: ''
+    }
+  },
+  data() {
+    return {
+      date: '',
+      requestParams: [
+        { name: 'getFTSWList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+      ],
+      recipeTemplateList: [], // 配方模板
+      feedingFormulaList: [], // 补料配方
+      livestockTypeList: [], // 类别
+      rules: {
+        cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+      },
+      table: {
+        getdataListParm: {
+          name: 'getPlanModifyFPlist',
+          page: 1,
+          offset: 1,
+          pagecount: 12,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {},
+        rwList: [],
+        isPtsfname: false, // 补料配方/补料重量
+        getdataListParm2: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'isEnableSupplyFeed'
+          }
+        }
+      },
+      requestParam: {},
+      spanObj: {},
+      mergekeys: ['barname', 'sumweight'],
+      isokDisable: false,
+      rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  watch: {
+    show: {
+      immediate: true,
+      handler(show) {
+        this.visible = show
+      }
+    },
+    parentDate: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log(newVal, oldVal, 'newVal,oldVal')
+        this.date = newVal
+      }
+    }
+  },
+  created() {
+    this.getIsDisplay()
+    this.getDownList()
+  },
+  methods: {
+    // 下拉
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.recipeTemplateList = response.data.getFTSWList.list
+        this.feedingFormulaList = response.data.getFTBLList.list
+        this.livestockTypeList = response.data.getCowclassListEnable.list
+      })
+    },
+    // 补料是否显示
+    getIsDisplay() {
+      GetDataByName(this.table.getdataListParm2).then(response => {
+        console.log(response.data.list[0].inforvalue)
+        if (response.data.list !== null) {
+          if (response.data.list[0].inforvalue == 0) {
+            this.table.isPtsfname = false
+          } else {
+            this.table.isPtsfname = true
+          }
+        }
+      })
+      this.getList()
+    },
+    getList() {
+      this.table.listLoading = true
+      this.table.getdataListParm.parammaps.date = this.date
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'Edit', false) // 编辑
+            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
+            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
+            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
+            if (response.data.list[i].ptid == undefined || response.data.list[i].ptname == '') {
+              this.$set(response.data.list[i], 'ptid', '')
+              this.$set(response.data.list[i], 'ptname', '')
+            }
+            if (response.data.list[i].ratio == undefined) {
+              this.$set(response.data.list[i], 'ratio', '')
+            }
+            if (response.data.list[i].ccount == undefined) {
+              this.$set(response.data.list[i], 'ccount', '')
+            }
+            if (response.data.list[i].ccountratio == undefined) {
+              this.$set(response.data.list[i], 'ccountratio', '')
+            }
+          }
+          this.table.list = response.data.list
+          console.log(this.table.list, 'this.table.list')
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+          this.handleSpan()
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSpan() {
+      this.mergekeys.forEach(key => {
+        this.spanObj[key] = []
+        let position = 0
+        this.table.list.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj[key].push(1)
+            position = 0
+          } else {
+            if (key == 'sumweight') {
+              if (this.table.list[index][key] === this.table.list[index - 1][key] && this.table.list[index]['barname'] === this.table.list[index - 1]['barname']) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.table.list[index][key] === this.table.list[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]) {
+          const _row = this.spanObj[this.mergekeys[i]][rowIndex]
+          const _col = _row > 0 ? 1 : 0
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
+    },
+    handleUpdate(row) {
+      console.log(row)
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (this.table.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 编辑false,编辑保存true
+      row.isUpdate = false
+      row.isUpdateSave = true
+      if (row.ptsfid == '-1') {
+        row.ptsfid = ''
+      }
+      row.ptsfid = String(row.ptsfid)
+      this.table.temp.ptid = row.ptid
+      this.table.temp.ptname = row.ptname
+      this.table.temp.ptsfid = row.ptsfid
+      this.table.temp.ptsfname = row.ptsfname
+      // row.sumweight = ''
+      row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ptid).Sfweight// Sfweight
+      // SfweightLock
+      row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ptid).SfweightLock
+    },
+    // 实际牛头数
+    blurCcount(row) {
+      if (row.ccount !== '' && row.ratio !== '') {
+        row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, 2)
+      } else if (row.ratio !== '' && row.ccountratio !== '') {
+        row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, 2)
+      } else if (row.ccount !== '' || row.ratio !== '') {
+        row.ccountratio = ''
+      }
+      if (this.table.isPtsfname == false) {
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // 软件牛头数softccount实际牛头数ccount系数(%)ratio系数头数ccountratio
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          // row.weight = formatNum(parseFloat(row.pweight) * (parseFloat(row.tratio) / 100), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum(parseFloat(row.pweight) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      } else {
+        if (row.supplyweight == 'NaN' || row.supplyweight == undefined || row.supplyweight == 'undefined') {
+          row.supplyweight = 0
+        }
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          // row.weight = formatNum((parseFloat(row.pweight) + parseFloat(row.supplyweight)) * (parseFloat(row.tratio) / 100), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum((parseFloat(row.pweight) + parseFloat(row.supplyweight)) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      }
+      this.getSumWeight(row)
+    },
+    // 系数
+    blurRatio(row) {
+      if (row.ccount !== '' && row.ratio !== '') {
+        row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, 2)
+      } else if (row.ccount !== '' && row.ccountratio !== '') {
+        row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), 2)
+      } else if (row.ccount !== '' || row.ccountratio !== '') {
+        row.ratio = ''
+      }
+      if (this.table.isPtsfname == false) {
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum(parseFloat(row.pweight) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      } else {
+        if (row.supplyweight == 'NaN' || row.supplyweight == undefined || row.supplyweight == 'undefined') {
+          row.supplyweight = 0
+        }
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum((parseFloat(row.pweight) + parseFloat(row.supplyweight)) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      }
+      this.getSumWeight(row)
+    },
+    // 系数头数
+    // 系数头数=实际牛头数*系数*100%;
+    blurCcountratio(row) {
+      if (row.ccountratio !== '' && row.ccount !== '' && row.ratio !== '') {
+        row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), 2)
+      } else if (row.ccount !== '' && row.ratio !== '') {
+        row.ccountratio = formatNum(parseFloat(row.ccount) * parseFloat(row.ratio) / 100, 2)
+      } else if (row.ccountratio !== '' && row.ccount !== '') {
+        row.ratio = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ccount), 2)
+      } else if (row.ccountratio !== '' && row.ratio !== '') {
+        row.ccount = formatNum(parseFloat(row.ccountratio) * 100 / parseFloat(row.ratio) / 100, 2)
+      }
+      if (this.table.isPtsfname == false) {
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum(parseFloat(row.pweight) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      } else {
+        if (row.supplyweight == 'NaN' || row.supplyweight == undefined || row.supplyweight == 'undefined') {
+          row.supplyweight = 0
+        }
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum((parseFloat(row.pweight) + parseFloat(row.supplyweight)) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      }
+      this.getSumWeight(row)
+    },
+
+    getSumWeight(row) {
+      var barArr = []
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.barid == this.table.list[i].barid) {
+          barArr.push(this.table.list[i].weight)
+        }
+      }
+      // console.log(barArr, 'barArr')
+      var sumw = 0
+      for (let i = 0; i < barArr.length; i++) {
+        sumw += parseFloat(barArr[i])
+      }
+      // console.log(sumw, 'sumw')
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.barid == this.table.list[i].barid) {
+          this.table.list[i].sumweight = formatNum(sumw, 2)
+        }
+      }
+    },
+
+    // 配方模板
+    changeRecipeTemplate(item, row) {
+      row.ptname = this.recipeTemplateList.find(obj => obj.id == item).tname
+      // Sfweight
+      row.Sfweight = this.recipeTemplateList.find(obj => obj.id == item).Sfweight// Sfweight
+      // SfweightLock
+      row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == item).SfweightLock// SfweightLock
+      console.log('Sfweight', row.Sfweight)
+      console.log('SfweightLock', row.SfweightLock)
+
+      if (this.table.isPtsfname == false) {
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.weight = formatNum(parseFloat(row.pweight) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      } else {
+        if (row.supplyweight == 'NaN' || row.supplyweight == undefined || row.supplyweight == 'undefined') {
+          row.supplyweight = 0
+        }
+        if (row.Sfweight !== '' && row.ccountratio !== '' && row.SfweightLock !== '' && row.ccount) {
+          // row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccountratio) + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+          row.pweight = formatNum(parseFloat(row.Sfweight) * parseFloat(row.ccount) * parseFloat(row.ratio) / 100 + parseFloat(row.SfweightLock) * parseFloat(row.ccount), 2)
+
+          row.weight = formatNum((parseFloat(row.pweight) + parseFloat(row.supplyweight)) * (parseFloat(row.tratio) / 100), 2)
+        } else {
+          row.pweight = 0
+          row.weight = 0
+        }
+      }
+      this.getSumWeight(row)
+    },
+    // 班次比例
+    blurTratio(row) {
+      if (row.pweight !== '' && row.tratio !== '') {
+        row.weight = formatNum(parseFloat(row.pweight) * parseFloat(row.tratio) / 100, 2)
+      } else {
+        row.weight = 0
+      }
+      this.getSumWeight(row)
+    },
+    // 班次重量
+    blurWeight(row) {
+      if (row.weight !== '' && row.pweight !== '' && row.ratio !== '') {
+        // row.tratio = formatNum(parseFloat(row.weight) / parseFloat(row.pweight) * parseFloat(row.ratio), 0)
+        // row.tratio = formatNum(parseFloat(row.pweight) / parseFloat(row.weight), 0)
+        row.tratio = formatNum(parseFloat(row.weight) / parseFloat(row.pweight) * 100, 0)
+      } else {
+        row.tratio = 0
+      }
+    },
+    updateData(row) {
+      console.log(row, '编辑保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 5000)
+      const positiveInteger = /^[1-9]\d*$/
+      if (row.ccount !== '') {
+        if (!positiveInteger.test(parseFloat(row.ccount))) {
+          this.$message({ type: 'error', message: '实际牛头数请输入正整数', duration: 2000 })
+          return false
+        }
+      } else {
+        this.$message({ type: 'error', message: '实际牛头数不能为空', duration: 2000 })
+      }
+      const positiveNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
+      if (row.ratio !== '') {
+        if (!positiveNumber.test(parseFloat(row.ratio))) {
+          this.$message({ type: 'error', message: '系数请输入正数', duration: 2000 })
+          return false
+        }
+      } else {
+        this.$message({ type: 'error', message: '系数不能为空', duration: 2000 })
+      }
+      if (row.ccountratio !== '') {
+        if (!positiveNumber.test(parseFloat(row.ccountratio))) {
+          this.$message({ type: 'error', message: '系数头数请输入正数', duration: 2000 })
+          return false
+        }
+      } else {
+        this.$message({ type: 'error', message: '系数头数不能为空', duration: 2000 })
+      }
+
+      if (row.tratio == '') {
+        console.log(row.tratio, '========33')
+        row.tratio = 0
+      }
+      if (isNaN(row.tratio)) {
+        console.log(row.tratio, '========44')
+        row.tratio = 0
+      }
+      if (row.weight == '') {
+        console.log(row.weight, '========11')
+        row.weight = 0
+      }
+      if (isNaN(row.weight)) {
+        console.log(row.weight, '========22')
+        row.weight = 0
+      }
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'updatePlanModifyFPlist', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        date: this.date,
+        id: row.id,
+        ptweight: row.ptweight,
+        pweight: row.pweight,
+        weight: row.weight,
+        tratio: row.tratio,
+        cowcount: row.ccount,
+        ccountradio: row.ratio,
+        ptid: row.ptid,
+        ptsid: row.ptsid
+      }}
+      this.requestParam.data[1] = { 'name': 'updateLPPbyFPChangedate', 'type': 'e', 'parammaps': {
+        pastureid: row.pastureid,
+        fpid: row.fpid,
+        date: this.date,
+        timesin: row.timesin
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        if (response.msg === 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        }
+      })
+    },
+    updateCancel(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 编辑true,编辑保存false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      console.log(this.table.getdataListParm.offset)
+      this.table.getdataListParm.offset = this.table.getdataListParm.offset
+      this.getList()
+    }
+
+  }
+}
+</script>
+<style>

+ 1971 - 0
.svn/pristine/f2/f22fcdf3ff4264253590f6776bb80eb296804d91.svn-base

@@ -0,0 +1,1971 @@
+<template>
+  <div class="app-container">
+    <!-- 配方模板表 -->
+    <div ref="template" class="template">
+      <div class="recipeTemplate">
+        <p>日执行计划</p>
+      </div>
+      <div class="search">
+        <el-date-picker v-model="table.getdataListParm.parammaps.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDate" />
+        <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
+        <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
+        <el-select v-model="table.getdataListParm.parammaps.lpplantype" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;" @change="changePlanType">
+          <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
+        </el-select>
+        <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable @change="changeFrequency">
+          <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+        <el-select v-model="table.getdataListParm.parammaps.printType" filterable placeholder="打印类型" class="filter-item" :clearable="false" style="width: 120px;">
+          <el-option v-for="item in printingTypeList" :key="item.value" :label="item.lable" :value="item.value" />
+        </el-select>
+        <el-select v-model="table.getdataListParm.parammaps.plandimen" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" :clearable="false">
+          <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.lable" :value="item.value" />
+        </el-select>
+        <el-select v-model="table.getdataListParm.parammaps.enable3" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" :clearable="false">
+          <el-option v-for="item in exportTypeList" :key="item.value" :label="item.lable" :value="item.value" />
+        </el-select>
+        <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
+      </div>
+      <div class="operation" style="margin-bottom: 10px;">
+        <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新生成</el-button>
+        <el-button v-if="isRoleEdit" class="success" icon="el-icon-edit-outline" @click="handleRevisePlan">修改计划</el-button>
+        <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制计划</el-button>
+        <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" class="success" @click="handleChangeOrder">更改顺序</el-button>
+        <div v-else style="margin-left: 10px;display: inline-block;">
+          <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
+          <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
+        </div>
+        <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
+      </div>
+      <!-- 日执行计划 -->
+      <div class="table">
+        <el-table
+          id="table1"
+          ref="parent"
+          :key="table.tableKey"
+          v-loading="table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 98%;"
+          row-key="sort"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :row-class-name="tableRowClassName"
+          :height="370"
+          @row-click="tableRowClick"
+        >
+          <el-table-column label="序号" align="center" prop="sort" width="50px" />
+          <el-table-column label="计划名称" min-width="90px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.projname }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
+          <el-table-column label="TMR编号" min-width="90px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.tmrtname }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="驾驶员" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.driver }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="已执行" min-width="70px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.havebutton == 0">否</span>
+              <span v-else>是</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="班次" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.times }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="理论量" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.lweight }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="启用" min-width="70px" align="center">
+            <template slot-scope="scope">
+              <el-switch v-if="dataDisabled == false" v-model="scope.row.enable" :disabled="scope.row.havebutton == 1" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
+              <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
+            </template>
+          </el-table-column>
+          <el-table-column label="时间" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.plantime }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="配方名称" min-width="100px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.ftname }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="牛头数" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.cowcount }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="描述" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.display }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="发料位" min-width="80px" align="left">
+            <template slot-scope="scope">
+              <span>{{ scope.row.barnames }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" width="100" label="操作" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <el-button class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            </template>
+          </el-table-column>
+        </el-table>
+        <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
+      </div>
+    </div>
+
+    <!-- 预混料 -->
+    <div v-if="table3.getdataListParm.parammaps.lpplantype == 4" class="content">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <div class="table2">
+            <div class="contentOperation">
+              <p>计划详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table2.tableKey"
+                v-loading="table2.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table2.list"
+                fit
+                border
+                highlight-current-row
+                style="width: 100%;"
+                height="450"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="操作序号" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.sort }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.fname }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- 撒料 -->
+    <div v-if="table3.getdataListParm.parammaps.lpplantype == 0" class="content">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <div class="table2">
+            <div class="contentOperation">
+              <p>计划详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table2.tableKey"
+                v-loading="table2.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table2.list"
+                fit
+                border
+                highlight-current-row
+                style="width: 100%;"
+                height="450"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="操作序号" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.sort }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.fname }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="12">
+          <div class="table3">
+            <div class="contentOperation">
+              <p>栏舍详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table3.tableKey"
+                v-loading="table3.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table3.list"
+                height="450"
+                fit
+                border
+                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">
+                    <span>{{ scope.row.sort }}</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="weight" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- 剩料 -->
+    <div v-if="table3.getdataListParm.parammaps.lpplantype == 3" class="content">
+      <el-row :gutter="20">
+        <el-col :span="12"><div class="table2">
+          <div class="contentOperation">
+            <p>计划详情</p>
+          </div>
+          <div class="content-table">
+            <el-table
+              :key="table2.tableKey"
+              v-loading="table2.listLoading"
+              element-loading-text="给我一点时间"
+              :data="table2.list"
+              fit
+              border
+              highlight-current-row
+              style="width: 100%;"
+              height="450"
+              :row-style="rowStyle"
+              :cell-style="cellStyle"
+              class="elTable table-fixed"
+            >
+              <el-table-column label="操作序号" min-width="130px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.sort }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="取料栏舍" prop="fname" min-width="130px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.fname }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="处理方式" prop="useinbar" min-width="130px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.useinbar }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </div>
+        </el-col>
+        <el-col :span="12">
+          <div class="table3">
+            <div class="contentOperation">
+              <p>栏舍详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table3.tableKey"
+                v-loading="table3.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table3.list"
+                height="450"
+                fit
+                border
+                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">
+                    <span>{{ scope.row.sort }}</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>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- 撒料计划-混料 -->
+    <div v-if="table3.getdataListParm.parammaps.lpplantype == 1 || table3.getdataListParm.parammaps.lpplantype == 5" class="content">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <div class="table2">
+            <div class="contentOperation">
+              <p>计划详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table2.tableKey"
+                v-loading="table2.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table2.list"
+                fit
+                border
+                highlight-current-row
+                style="width: 100%;"
+                height="450"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="操作序号" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.sort }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.fname }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="12">
+          <div class="table3">
+            <div class="contentOperation">
+              <p>栏舍详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table3.tableKey"
+                v-loading="table3.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table3.list"
+                height="450"
+                fit
+                border
+                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">
+                    <span>{{ scope.row.sort }}</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)" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- 撒料计划-撒料 -->
+    <div v-if="table3.getdataListParm.parammaps.lpplantype == 2" class="content">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <div class="table3">
+            <div class="contentOperation">
+              <p>栏舍详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table3.tableKey"
+                v-loading="table3.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table3.list"
+                height="450"
+                fit
+                border
+                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">
+                    <span>{{ scope.row.sort }}</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)" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="12">
+          <div class="table2">
+            <div class="contentOperation">
+              <p>计划详情</p>
+            </div>
+            <div class="content-table">
+              <el-table
+                :key="table2.tableKey"
+                v-loading="table2.listLoading"
+                element-loading-text="给我一点时间"
+                :data="table2.list"
+                fit
+                border
+                highlight-current-row
+                style="width: 100%;"
+                height="450"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="操作序号" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.sort }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="栏舍名称" prop="fname" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.fname }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.weight }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- 新生成 -->
+    <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="30%">
+      <div class="newGeneration">
+        <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
+          <el-row v-if="newGeneration.dialogStatus== 'newGeneration'">
+            <el-col :span="24">
+              <el-form-item label="时间范围:" prop="inputDatetime">
+                <el-date-picker v-model="newGeneration.temp.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" :picker-options="pickerOptions2" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row v-else>
+            <el-col :span="24">
+              <el-form-item label="时间范围:" prop="copyInputDatetime">
+                <el-date-picker v-model="newGeneration.temp.copyInputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="bottom:10px">
+          <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
+          <el-button v-if="newGeneration.dialogStatus== 'newGeneration'" class="save" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
+          <el-button v-else class="save" :disabled="isokDisable" @click="copyData()">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 正在同步中 -->
+    <el-dialog :destroy-on-close="true" :visible.sync="dataSynchronization.dialogFormVisible" :close-on-click-modal="false" width="30%">
+      <div class="dataSynchronization" style="text-align: center;font-size: 18px;">
+        <i class="el-icon-loading" />
+        <span>正在同步</span>
+        <div slot="footer" class="dialog-footer" style="bottom:10px">
+          <el-button class="miniPrimary" @click="dataSynchronization.dialogFormVisible = false;">确认</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 修改计划 -->
+    <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons } from '@/api/common'
+import RevisePlan from './revisePlan.vue'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Cookies from 'js-cookie'
+import Sortable from 'sortablejs'
+import { MessageBox } from 'element-ui'
+export default {
+  name: 'DailyExecutionPlan',
+  components: {
+    RevisePlan
+  },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      dataDisabled: false,
+      requestParams: [
+        // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
+      ],
+      planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
+      printingTypeList: [{ lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
+      frequencyList: [], // 班次
+      planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
+      exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '累加投料', value: '1' }, { lable: '撒料简打', value: '2' }, { lable: '投撒料简打', value: '3' }, { lable: '投撒料累加', value: '4' }, { lable: '包装简打', value: '5' }, { lable: '实发简打', value: '6' }], // 导出类型
+      // 班次
+      maxTime: {
+        getMaxTimesParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'times'
+          }
+        }
+      },
+      isOrder: true,
+      table: {
+        getdataListParm: {
+          name: 'getDownloadedplanList',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            mydate: parseTime(new Date(), '{y}-{m}-{d}'),
+            times: '',
+            lpplantype: '',
+            printType: '',
+            plandimen: '0',
+            enable3: '0'
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: false
+      },
+
+      // 计划内容操作详情
+      table2: {
+        getdataListParm: {
+          name: 'getDownloadplandtl1ListV2',
+          page: 1,
+          offset: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: '',
+            id: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: false
+      },
+
+      // 计划内容 舍栏详情
+      table3: {
+        getdataListParm: {
+          name: 'getDownloadplandt2ListV2',
+          page: 1,
+          offset: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: '',
+            id: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: false
+      },
+      // 新生成
+      newGeneration: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        getdataListParm: {
+          name: 'checkLLPIsDistribution',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        temp: {
+          inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
+        },
+        rules: {
+          inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }],
+          copyInputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }]
+        }
+      },
+      pickerMinDate: '',
+      pickerOptions: {
+        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
+            const maxTime = this.pickerMinDate + one
+            return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
+          }
+          return time.getTime() < Date.now() - 8.64e7
+        }
+      },
+      pickerOptions2: {
+        onPick: ({ maxDate, minDate }) => {
+          this.pickerMinDate = minDate.getTime()
+          if (maxDate) {
+            this.pickerMinDate = ''
+          }
+        },
+        disabledDate: (time) => {
+          if (this.pickerMinDate !== '') {
+            const one = 14 * 24 * 3600 * 1000
+            const minTime = this.pickerMinDate
+            const maxTime = this.pickerMinDate + one
+            return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
+          }
+          return time.getTime() < Date.now() - 8.64e7
+        }
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      dataSynchronization: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        getdataListParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'isDataSync'
+          }
+        },
+        isDataSynchronization: false
+      },
+      textMap: {
+        newGeneration: '新生成',
+        historyRecord: '历史记录',
+        revisePlan: '修改计划',
+        copy: '复制计划'
+      },
+      isokDisable: false,
+      requestParam: {},
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      isShowDialog: false,
+      activeName: '栏舍配方',
+      parentDate: '',
+      downLoad: {
+        getdataListParm: {
+          name: '',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: ''
+          }
+        },
+        list: [],
+        labelList: []
+      }
+    }
+  },
+
+  created() {
+    this.parentDate = this.table.getdataListParm.parammaps.mydate
+    console.log(this.parentDate, 'this.parentDate')
+    this.getDataSynchronization()
+    this.getButtons()
+    this.getList()
+    this.getDownList()
+    this.getIsDisplay()
+  },
+  mounted() {
+    this.table.getdataListParm.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
+  },
+  methods: {
+    getButtons() {
+      const Edit = 'DailyExecutionPlan'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDataSynchronization() {
+      GetDataByName(this.dataSynchronization.getdataListParm).then(response => {
+        console.log(response.data.list[0])
+        if (response.data.list[0].inforvalue == 0) {
+          this.dataSynchronization.isDataSynchronization = false
+        } else {
+          this.dataSynchronization.isDataSynchronization = true
+        }
+      })
+    },
+    getIsDisplay() {
+      GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
+        console.log(response.data.list[0].inforvalue)
+        if (response.data.list[0].inforvalue == 1) {
+          this.frequencyList = [{ id: '1', name: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+        } else if (response.data.list[0].inforvalue == 3) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+        } else if (response.data.list[0].inforvalue == 4) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+        }
+      })
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        // this.livestockTypeList = response.data.getDictByName.list
+      })
+    },
+    // -------------------日执行计划-----------------------------
+    handleBefore() {
+      if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
+        this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
+        var start = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() - 1))
+        // var start = this.table.getdataListParm.parammaps.mydate - 1
+        this.table.getdataListParm.parammaps.mydate = parseTime(start, '{y}-{m}-{d}')
+        // this.$forceUpdate()
+        this.parentDate = this.table.getdataListParm.parammaps.mydate
+        this.getList()
+      }
+      var d = this.table.getdataListParm.parammaps.mydate
+      var curDate = parseTime(new Date(), '{y}-{m}-{d}')
+      if (d < curDate) {
+        this.dataDisabled = true
+      } else {
+        this.dataDisabled = false
+      }
+      console.log(this.dataDisabled)
+    },
+    handleNext() {
+      if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
+        this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
+        var stop = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() + 1))
+        this.table.getdataListParm.parammaps.mydate = parseTime(stop, '{y}-{m}-{d}')
+        this.parentDate = this.table.getdataListParm.parammaps.mydate
+        this.getList()
+      }
+      var d = this.table.getdataListParm.parammaps.mydate
+      var curDate = parseTime(new Date(), '{y}-{m}-{d}')
+      if (d < curDate) {
+        this.dataDisabled = true
+      } else {
+        this.dataDisabled = false
+      }
+      console.log(this.dataDisabled)
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          // var obj = { 'id': '580999', 'havebutton': '0', 'lpplantype': 2, 'pid': '3283220207862547456', 'times': '第二班', 'projname': '2.666' }
+          // response.data.list[6] = obj
+          this.getIsColor(response.data.list)
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+          console.log('计划类型', response.data.list[0].lpplantype)
+          if (response.data.list[0].lpplantype == 0) {
+            // 撒料
+            this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+            this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+            this.table2.getdataListParm.parammaps.useinbartype = ''
+            this.table3.getdataListParm.parammaps.useinbartype = ''
+            this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table2.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
+            this.getList2()
+            this.getList3()
+          } else if (response.data.list[0].lpplantype == 1) {
+            // 撒料计划-混料
+            this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+            this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+            this.table2.getdataListParm.parammaps.useinbartype = ''
+            this.table3.getdataListParm.parammaps.useinbartype = ''
+            this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table2.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
+            this.getList2()
+            this.getList3()
+          } else if (response.data.list[0].lpplantype == 2) {
+            // 撒料计划-撒料
+            this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
+            this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
+            this.table2.getdataListParm.parammaps.useinbartype = ''
+            this.table3.getdataListParm.parammaps.useinbartype = ''
+            this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table2.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
+            this.getList2()
+            this.getList3()
+          } else if (response.data.list[0].lpplantype == 3) {
+            // 剩料
+            this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
+            this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+            this.table2.getdataListParm.parammaps.useinbartype = 0
+            this.table3.getdataListParm.parammaps.useinbartype = 1
+            this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table2.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
+            this.getList2()
+            this.getList3()
+          } else if (response.data.list[0].lpplantype == 4) {
+            // 预混
+            this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+            this.table2.getdataListParm.parammaps.useinbartype = ''
+            this.table3.getdataListParm.parammaps.useinbartype = ''
+            this.table2.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
+            this.getList2()
+          } else if (response.data.list[0].lpplantype == 5) {
+            // 预称重计划
+            this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+            this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+            this.table2.getdataListParm.parammaps.useinbartype = ''
+            this.table3.getdataListParm.parammaps.useinbartype = ''
+            this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+            this.table2.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.id = response.data.list[0].id
+            this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
+            this.getList2()
+            this.getList3()
+          }
+        } else {
+          this.table.list = []
+          this.table3.getdataListParm.parammaps.lpplantype = ''
+          this.table2.getdataListParm.parammaps.id = ''
+          this.table3.getdataListParm.parammaps.id = ''
+          // this.getList2()
+          // this.getList3()
+          this.table2.list = []
+          this.table3.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleEnableChange(row) {
+      this.requestParam.name = 'updatedownloadenable'
+      this.requestParam.parammaps = {}
+      this.requestParam.parammaps.pastureid = row.pastureid
+      this.requestParam.parammaps.id = row.id
+      this.requestParam.parammaps.enable = row.enable
+      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()
+        }
+      })
+    },
+    getIsColor(arr) {
+      var map = {}
+      var dest = []
+      for (var i = 0; i < arr.length; i++) {
+        var ai = arr[i]
+        if (!map[ai.pid]) {
+          dest.push({
+            pid: ai.pid,
+            data: [ai]
+          })
+          map[ai.pid] = ai
+        } else {
+          for (var j = 0; j < dest.length; j++) {
+            var dj = dest[j]
+            if (dj.pid == ai.pid) {
+              dj.data.push(ai)
+              break
+            }
+          }
+        }
+      }
+      console.log(dest)
+      var newArr1 = []
+      for (var i = 0; i < dest.length; i++) {
+        var newArr = dest[i].data
+        for (var j = 0; j < dest[i].data.length; j++) {
+          dest[i].data[j].isColor = i
+          newArr1.push(dest[i].data[j])
+        }
+      }
+      console.log(newArr1)
+      this.table.list = newArr1
+    },
+    tableRowClassName({ row }) {
+      if (row.isColor % 2 == 0) {
+        return 'warning-row'
+      } else {
+        return 'success-row'
+      }
+    },
+    lpplantype: function(cellValue) {
+      if (cellValue.lpplantype == 0) {
+        return '撒料计划'
+      } else if (cellValue.lpplantype == 1) {
+        return '撒料计划-混料'
+      } else if (cellValue.lpplantype == 2) {
+        return '撒料计划-撒料'
+      } else if (cellValue.lpplantype == 3) {
+        return '剩料计划'
+      } else if (cellValue.lpplantype == 4) {
+        return '预混计划'
+      } else if (cellValue.lpplantype == 5) {
+        return '预称重计划'
+      }
+    },
+    changeDate(val) {
+      console.log('选择了日期', val)
+      this.getList()
+      // this.getList2()
+      // this.getList3()
+      var d = this.table.getdataListParm.parammaps.mydate
+      var curDate = parseTime(new Date(), '{y}-{m}-{d}')
+      if (d < curDate) {
+        this.dataDisabled = true
+      } else {
+        this.dataDisabled = false
+      }
+      console.log(this.dataDisabled)
+      this.parentDate = this.table.getdataListParm.parammaps.mydate
+      console.log(this.parentDate, 'this.parentDate')
+    },
+    changePlanType(val) {
+      console.log('选择了计划类型', val)
+      this.getList()
+      this.getList2()
+      this.getList3()
+    },
+    changeFrequency(val) {
+      console.log('选择了班次', val)
+      this.getList()
+      this.getList2()
+      this.getList3()
+    },
+
+    // 日执行计划行点击
+    tableRowClick(row, column, event) {
+      console.log(row, column, event)
+      console.log('点击计划类型', row.lpplantype)
+      // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
+      if (row.lpplantype == 0) {
+        // 撒料
+        this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+        this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table2.getdataListParm.parammaps.useinbartype = ''
+        this.table3.getdataListParm.parammaps.useinbartype = ''
+        this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table2.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
+        this.getList2()
+        this.getList3()
+      } else if (row.lpplantype == 1) {
+        // 撒料计划-混料
+        this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+        this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table2.getdataListParm.parammaps.useinbartype = ''
+        this.table3.getdataListParm.parammaps.useinbartype = ''
+        this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table2.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
+        this.getList2()
+        this.getList3()
+      } else if (row.lpplantype == 2) {
+        // 撒料计划-撒料
+        this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
+        this.table2.getdataListParm.parammaps.useinbartype = ''
+        this.table3.getdataListParm.parammaps.useinbartype = ''
+        this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table2.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
+        this.getList2()
+        this.getList3()
+        console.log(this.table3.getdataListParm.parammaps.lpplantype)
+      } else if (row.lpplantype == 3) {
+        // 剩料
+        this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table2.getdataListParm.parammaps.useinbartype = 0
+        this.table3.getdataListParm.parammaps.useinbartype = 1
+        this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table2.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
+        this.getList2()
+        this.getList3()
+      } else if (row.lpplantype == 4) {
+        // 预混
+        this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+        this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table2.getdataListParm.parammaps.useinbartype = ''
+        this.table3.getdataListParm.parammaps.useinbartype = ''
+        this.table2.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
+        this.getList2()
+      } else if (row.lpplantype == 5) {
+        // 预称重计划
+        this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
+        this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
+        this.table2.getdataListParm.parammaps.useinbartype = ''
+        this.table3.getdataListParm.parammaps.useinbartype = ''
+        this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+        this.table2.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.id = row.id
+        this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
+        this.getList2()
+        this.getList3()
+      }
+      this.$forceUpdate()
+    },
+
+    // 计划内容操作详情
+    getList2() {
+      this.table2.listLoading = true
+      this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+
+      GetDataByName(this.table2.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table2.list = response.data.list
+          // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
+          if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
+            const arr = []
+            var a = 0
+            let b = this.table2.list[0].sort
+            let c = 0
+            for (let i = 0; i < this.table2.list.length; i++) {
+              if (b !== parseInt(this.table2.list[i].sort)) {
+                b = this.table2.list[i].sort
+                arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
+                a = 0
+              }
+              a = a + parseFloat(this.table2.list[i].weight)
+              c = c + parseFloat(this.table2.list[i].weight)
+              arr.push(this.table2.list[i])
+            }
+            arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
+            arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
+            this.table2.list = arr
+          }
+          if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
+            const arr = []
+            var aa = 0
+            let bb = this.table2.list[0].sort
+            let cc = 0
+            for (let i = 0; i < this.table2.list.length; i++) {
+              if (bb !== parseInt(this.table2.list[i].sort)) {
+                bb = this.table2.list[i].sort
+                aa = 0
+              }
+              aa = aa + parseFloat(this.table2.list[i].weight)
+              cc = cc + parseFloat(this.table2.list[i].weight)
+              arr.push(this.table2.list[i])
+            }
+            arr.push({ 'sort': '总计', 'weight': cc.toFixed(parseInt(Cookies.get('decimal'))) })
+            this.table2.list = arr
+            console.log('this.table2.list', this.table2.list)
+            console.log(this.table3.getdataListParm.parammaps.lpplantype)
+          }
+
+          console.log(this.table2.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)
+      })
+    },
+
+    // 计划内容栏舍详情
+    getList3() {
+      this.table3.listLoading = true
+      this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+
+      GetDataByName(this.table3.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table3.list = response.data.list
+          if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
+            const arr = []
+            var a = 0
+            let b = this.table3.list[0].sort
+            let c = 0
+            for (let i = 0; i < this.table3.list.length; i++) {
+              if (b !== parseInt(this.table3.list[i].sort)) {
+                b = this.table3.list[i].sort
+                a = 0
+              }
+              a = a + parseFloat(this.table3.list[i].weight)
+              c = c + parseFloat(this.table3.list[i].weight)
+              arr.push(this.table3.list[i])
+            }
+            arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
+            this.table3.list = arr
+          }
+          this.table3.pageNum = response.data.pageNum
+          this.table3.pageSize = response.data.pageSize
+          this.table3.total = response.data.total
+        } else {
+          this.table3.list = []
+        }
+        setTimeout(() => {
+          this.table3.listLoading = false
+        }, 100)
+      })
+    },
+
+    // 新生成
+    handleCreate() {
+      console.log('点击了新生成')
+      this.newGeneration.temp.inputDatetime = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
+      this.newGeneration.dialogStatus = 'newGeneration'
+      this.newGeneration.dialogFormVisible = true
+
+      GetDataByName(this.newGeneration.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          if (response.data.list[0].vmsg == '存在未分配') {
+            this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
+          }
+        }
+      })
+    },
+    DateDiff(sDate1, sDate2) {
+      console.log(sDate1, sDate2)
+      var aDate, oDate1, oDate2, iDays
+      aDate = sDate1.split('-')
+      oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
+      aDate = sDate2.split('-')
+      oDate2 = new Date(aDate[0], aDate[1], aDate[2])
+      iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
+      this.newGeneration.temp.days = parseInt(iDays) + 1
+      return iDays
+    },
+    newGenerationData() {
+      console.log('点击了新生成保存', this.newGeneration.temp)
+      this.isokDisable = true
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.newGeneration.temp.startTime = parseTime(this.newGeneration.temp.inputDatetime[0], '{y}-{m}-{d}')
+          this.newGeneration.temp.stopTime = parseTime(this.newGeneration.temp.inputDatetime[1], '{y}-{m}-{d}')
+          this.DateDiff(this.newGeneration.temp.stopTime, this.newGeneration.temp.startTime)
+          this.requestParam = {}
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'checkDLPIsStart', 'type': 'v', 'parammaps': {
+            pastureid: Cookies.get('pastureid'),
+            startTime: this.newGeneration.temp.startTime
+          }}
+          this.requestParam.data[1] = { 'name': 'checkPreMixStorage', 'type': 'e', 'parammaps': {
+            pastureid: Cookies.get('pastureid'),
+            days: this.newGeneration.temp.days
+          }}
+          this.requestParam.data[2] = { 'name': 'createdownloadedplan', 'type': 'e', 'parammaps': {
+            pastureid: Cookies.get('pastureid'),
+            startTime: this.newGeneration.temp.startTime,
+            stopTime: this.newGeneration.temp.stopTime
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('新生成保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              this.isokDisable = false
+            } else {
+              this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+              this.newGeneration.dialogFormVisible = false
+              this.getList()
+              this.isokDisable = false
+            }
+          })
+        }
+      })
+    },
+
+    // 修改计划
+    handleRevisePlan(data) {
+      this.dialogFull = false
+      var arr = []
+      if (this.table.list.length > 0) {
+        for (let i = 0; i < this.table.list.length; i++) {
+          if (this.table.list[i].havebutton == 1) {
+            arr.push(this.table.list[i])
+          }
+        }
+      }
+      if (arr.length !== this.table.list.length) {
+        console.log('点击了修改计划1', this.activeName)
+        this.isShowDialog = true
+        this.activeName = '栏舍配方'
+        console.log('点击了修改计划2', this.activeName)
+      } else {
+        this.$message({ type: 'error', message: '当前日期不可修改计划,请重新选择日期' })
+      }
+    },
+
+    handleExport() {
+      this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
+      this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
+      this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
+      this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
+      this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
+      var exportTitle = ''
+      if (this.table.getdataListParm.parammaps.plandimen == '1') {
+        if (this.table.getdataListParm.parammaps.enable3 == '0') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
+          this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
+          this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
+        } else {
+          this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
+        }
+      } else {
+        if (this.table.getdataListParm.parammaps.enable3 == '0') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
+          this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
+          this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
+        } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
+          this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
+        } else {
+          this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
+          exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
+        }
+      }
+      GetReportform(this.downLoad.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.downLoad.labelList = []
+          var filterValArr = []
+          for (let i = 0; i < response.data.list.data1.length; i++) {
+            this.downLoad.labelList.push(response.data.list.data1[i].label)
+            filterValArr.push(response.data.list.data1[i].prop)
+          }
+          this.downLoad.list = response.data.list.data2
+        } else {
+          this.downLoad.list = []
+        }
+        var multiHeaderArr = []
+        for (let i = 0; i < this.downLoad.labelList.length; i++) {
+          if (i == 0) {
+            multiHeaderArr.push(exportTitle)
+          } else {
+            multiHeaderArr.push('')
+          }
+        }
+        import('@/vendor/Export5Excel').then(excel => {
+          const multiHeader = [
+            multiHeaderArr
+          ]
+          const multiHeader2 = [
+            this.downLoad.labelList
+          ]
+          const filterVal = filterValArr
+          const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
+          const merges = []
+          excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: exportTitle, merges })
+        })
+      })
+    },
+
+    rowDrop() {
+      console.log(document.querySelector('#table1 .el-table__body-wrapper tbody'))
+      const tbody = document.querySelector('#table1 .el-table__body-wrapper tbody')
+      // this.sorTable()
+      const that = this
+      var sortable = Sortable.create(tbody, {
+        disabled: that.dropState,
+        onChoose({ newIndex, oldIndex }) {
+          console.log(that.isOrder, 'that.isOrder == false')
+          console.log(that.dropState, 'that.dropState')
+          if (that.dropState == true || that.isOrder == true) {
+            sortable.destroy()
+          }
+        },
+        onEnd(evt) {
+          var tableList = [...that.table.list] // 保留拖动前数据
+          const targetRow = that.table.list.splice(evt.oldIndex, 1)[0] // 拖动数据
+          const targetRow2 = that.table.list[evt.newIndex] // 拖动后下方数据
+          const targetRow3 = that.table.list[evt.newIndex - 1] // 拖动后上方数据
+          console.log(targetRow, 'targetRow')
+          console.log(targetRow2, 'targetRow2')
+          console.log(targetRow3, 'targetRow3')
+          that.table.list.splice(evt.newIndex, 0, targetRow)
+          // ==========
+          // 已执行的计划不可拖动
+          if (targetRow.havebutton == 1) {
+            that.$nextTick(() => {
+              that.$set(that.table, 'list', tableList)
+            })
+            that.$message({ type: 'error', message: '因已执行的计划不可调整顺序', duration: 2000 })
+            return false
+          }
+          // 相同班次之间可以拖动
+          if (targetRow2 !== undefined && targetRow3 !== undefined) {
+            if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
+              that.$nextTick(() => {
+                that.$set(that.table, 'list', tableList)
+              })
+              that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
+              return false
+            }
+          } else if (targetRow2 !== undefined && targetRow3 == undefined) {
+            if (targetRow.times !== targetRow2.times) {
+              that.$nextTick(() => {
+                that.$set(that.table, 'list', tableList)
+              })
+              that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
+              return false
+            }
+          } else if (targetRow2 == undefined && targetRow3 !== undefined) {
+            if (targetRow.times !== targetRow3.times) {
+              that.$nextTick(() => {
+                that.$set(that.table, 'list', tableList)
+              })
+              that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
+              return false
+            }
+          }
+          // 撒料计划0,
+          // 撒料计划-混料1
+          // 撒料计划-撒料2
+          // 剩料计划3
+          // 预混计划4
+          // 预称重计划5
+          if (targetRow.lpplantype == 1) { // 拖动数据为撒料计划-混料
+            if (targetRow2 == undefined) {
+              that.$nextTick(() => {
+                that.$set(that.table, 'list', tableList)
+              })
+            } else if (targetRow2 !== undefined && targetRow2.pid == targetRow.pid) {
+              that.$nextTick(() => {
+                that.$set(that.table, 'list', tableList)
+              })
+            } else {
+              var pidArr = [] // pid相同的值
+              var pidArr1 = [] //
+              var index // 索引
+              for (let i = 0; i < tableList.length; i++) {
+                if (tableList[i].pid == targetRow.pid) {
+                  pidArr.push(tableList[i])
+                } else {
+                  pidArr1.push(tableList[i])
+                }
+              }
+              // 找到对应上方pid 的ID
+              // 比如说id 580243 找到对应的索引
+              if (targetRow3 !== undefined) {
+                for (let i = 0; i < pidArr1.length; i++) {
+                  if (pidArr1[i].id == targetRow3.id) {
+                    index = i
+                  }
+                }
+              } else {
+                for (let i = 0; i < pidArr1.length; i++) {
+                  if (pidArr1[i].id == targetRow2.id) {
+                    index = i - 1
+                  }
+                }
+              }
+              pidArr1.splice(index + 1, 0, ...pidArr)
+              console.log(pidArr1)
+              that.$nextTick(() => {
+                that.table.list = pidArr1
+              })
+            }
+            if (targetRow2 !== undefined && targetRow3 !== undefined) {
+              if (targetRow2.pid == targetRow3.pid) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
+                return false
+              }
+            }
+          } else if (targetRow.lpplantype == 5) { // 拖动数据为预称重计划
+            if (targetRow2 !== undefined) {
+              console.log(targetRow3, targetRow2, 'zhidao')
+              if (targetRow3 !== undefined) {
+                if (targetRow3.pid !== targetRow.pid && targetRow2.pid !== targetRow.pid) {
+                  that.$nextTick(() => {
+                    that.$set(that.table, 'list', tableList)
+                  })
+                  that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
+                  return false
+                } else {
+                  console.log('wojinlaile', targetRow2, targetRow)
+                  if (targetRow3.lpplantype == 0 && targetRow2.pid !== targetRow.pid) {
+                    that.$nextTick(() => {
+                      that.$set(that.table, 'list', tableList)
+                    })
+                    that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
+                    return false
+                  }
+                  if (targetRow2.lpplantype !== 5 && targetRow3.lpplantype !== 5) {
+                    that.$nextTick(() => {
+                      that.$set(that.table, 'list', tableList)
+                    })
+                    that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
+                    return false
+                  }
+                }
+              } else {
+                if (targetRow2.pid !== targetRow.pid) {
+                  that.$nextTick(() => {
+                    that.$set(that.table, 'list', tableList)
+                  })
+                  that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
+                  return false
+                } else {
+                  if (targetRow2.pid !== targetRow.pid) {
+                    that.$nextTick(() => {
+                      that.$set(that.table, 'list', tableList)
+                    })
+                    that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
+                    return false
+                  }
+                }
+              }
+            } else {
+              if (targetRow2 == undefined) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
+                return false
+              } else if (targetRow3.pid !== targetRow.pid) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
+                return false
+              } else {
+                if (targetRow3.lpplantype == 0) {
+                  that.$nextTick(() => {
+                    that.$set(that.table, 'list', tableList)
+                  })
+                  that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
+                  return false
+                }
+              }
+            }
+
+            if (targetRow2 !== undefined && targetRow3 !== undefined) {
+              if (targetRow2.pid !== targetRow.pid && targetRow3.pid !== targetRow.pid) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
+                return false
+              } else if (targetRow3.pid == targetRow.pid && (targetRow3.lpplantype == 1 || targetRow3.lpplantype == 2)) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
+                return false
+              }
+            }
+          } else if (targetRow.lpplantype == 2) { // 拖动数据为撒料计划-撒料
+            if (targetRow2 == undefined) {
+              if (targetRow3.pid !== targetRow.pid) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
+                return false
+              }
+            } else {
+              if (targetRow2.lpplantype == 1 && (targetRow2.pid == targetRow.pid || targetRow2 == undefined)) {
+                // 拖动数据下方为撒料计划-混料时且pid相同,不可拖动,提示
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至撒料计划-混料上方', duration: 2000 })
+                return false
+              } else if (targetRow.lpplantype == 2 && (targetRow2.pid == targetRow.pid || targetRow3.pid == targetRow.pid || targetRow2 == undefined || targetRow3 == undefined)) {
+                console.log('正常拖动')
+              } else {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
+                return false
+              }
+            }
+            if (targetRow2 !== undefined && targetRow3 !== undefined) {
+              if (targetRow2.pid == targetRow3.pid) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
+                return false
+              }
+            }
+          } else if (targetRow.lpplantype == 0) { // 拖动数据为撒料计划
+            console.log('遍历有相同的pid,一起跟着拖动3')
+            var pidArr = [] // pid相同的值
+            var pidArr1 = [] //
+            var index // 索引
+            for (let i = 0; i < tableList.length; i++) {
+              if (tableList[i].pid == targetRow.pid) {
+                pidArr.push(tableList[i])
+              } else {
+                pidArr1.push(tableList[i])
+              }
+            }
+            if (pidArr.length > 0) {
+              // 找到对应上方pid 的ID
+              // 比如说id 580243 找到对应的索引
+              if (targetRow3 !== undefined) {
+                for (let i = 0; i < pidArr1.length; i++) {
+                  if (pidArr1[i].id == targetRow3.id) {
+                    index = i
+                  }
+                }
+              } else {
+                for (let i = 0; i < pidArr1.length; i++) {
+                  if (pidArr1[i].id == targetRow2.id) {
+                    index = i - 1
+                  }
+                }
+              }
+              pidArr1.splice(index + 1, 0, ...pidArr)
+              console.log(pidArr1)
+              that.$nextTick(() => {
+                that.table.list = pidArr1
+              })
+            }
+            if (targetRow2 !== undefined && targetRow3 !== undefined) {
+              if (targetRow2.pid == targetRow3.pid) {
+                that.$nextTick(() => {
+                  that.$set(that.table, 'list', tableList)
+                })
+                that.$message({ type: 'error', message: '不可拖动至其他计划中间;', duration: 2000 })
+                return false
+              }
+            }
+          } else if (targetRow.lpplantype == 3 || targetRow.lpplantype == 4) {
+            if (targetRow2 !== undefined && targetRow3 !== undefined) {
+              if (targetRow2.pid == targetRow3.pid) {
+                if (targetRow2.lpplantype == 5 && targetRow3.lpplantype == 5) {
+                  that.$nextTick(() => {
+                    that.$set(that.table, 'list', tableList)
+                  })
+                  that.$message({ type: 'error', message: '不可拖动至预称重计划跟预称重计划之间', duration: 2000 })
+                  return false
+                } else if (targetRow.pid == targetRow2.pid && targetRow.lpplantype == 3 && targetRow2.lpplantype == 3 || targetRow.pid == targetRow3.pid && targetRow.lpplantype == 3 && targetRow3.lpplantype == 3) {
+                  console.log('剩料之间可以互相拖动')
+                  console.log(tableList)
+                } else {
+                  that.$nextTick(() => {
+                    that.$set(that.table, 'list', tableList)
+                  })
+                  // 撒料计划0,
+                  // 撒料计划-混料1
+                  // 撒料计划-撒料2
+                  // 剩料计划3
+                  // 预混计划4
+                  // 预称重计划5
+                  if (targetRow3.lpplantype == 0) {
+                    that.$set(targetRow3, 'mylpplantype', '撒料计划')
+                  } else if (targetRow3.lpplantype == 1) {
+                    that.$set(targetRow3, 'mylpplantype', '撒料计划-混料')
+                  } else if (targetRow3.lpplantype == 2) {
+                    that.$set(targetRow3, 'mylpplantype', '撒料计划-撒料')
+                  } else if (targetRow3.lpplantype == 3) {
+                    that.$set(targetRow3, 'mylpplantype', '剩料计划')
+                  } else if (targetRow3.lpplantype == 4) {
+                    that.$set(targetRow3, 'mylpplantype', '预混计划')
+                  } else if (targetRow3.lpplantype == 5) {
+                    that.$set(targetRow3, 'mylpplantype', '预称重计划')
+                  }
+                  if (targetRow2.lpplantype == 0) {
+                    that.$set(targetRow2, 'mylpplantype', '撒料计划')
+                  } else if (targetRow2.lpplantype == 1) {
+                    that.$set(targetRow2, 'mylpplantype', '撒料计划-混料')
+                  } else if (targetRow2.lpplantype == 2) {
+                    that.$set(targetRow2, 'mylpplantype', '撒料计划-撒料')
+                  } else if (targetRow2.lpplantype == 3) {
+                    that.$set(targetRow2, 'mylpplantype', '剩料计划')
+                  } else if (targetRow2.lpplantype == 4) {
+                    that.$set(targetRow2, 'mylpplantype', '预混计划')
+                  } else if (targetRow2.lpplantype == 5) {
+                    that.$set(targetRow2, 'mylpplantype', '预称重计划')
+                  }
+                  var message = '不可拖动至' + targetRow3.mylpplantype + '跟' + targetRow2.mylpplantype + '之间'
+                  that.$message({ type: 'error', message: message, duration: 2000 })
+                  return false
+                }
+              }
+            }
+            // ========
+            // var pidArr = [] // pid相同的值
+            // var pidArr1 = [] //
+            // var index // 索引
+            // for (let i = 0; i < tableList.length; i++) {
+            //   if (tableList[i].pid == targetRow.pid) {
+            //     pidArr.push(tableList[i])
+            //   } else {
+            //     pidArr1.push(tableList[i])
+            //   }
+            // }
+            // if (pidArr.length > 0) {
+            //   // 找到对应上方pid 的ID
+            //   // 比如说id 580243 找到对应的索引
+            //   if (targetRow3 !== undefined) {
+            //     for (let i = 0; i < pidArr1.length; i++) {
+            //       if (pidArr1[i].id == targetRow3.id) {
+            //         index = i
+            //       }
+            //     }
+            //   } else {
+            //     for (let i = 0; i < pidArr1.length; i++) {
+            //       if (pidArr1[i].id == targetRow2.id) {
+            //         index = i - 1
+            //       }
+            //     }
+            //   }
+            //   pidArr1.splice(index + 1, 0, ...pidArr)
+            //   console.log(pidArr1)
+            //   that.$nextTick(() => {
+            //     that.table.list = pidArr1
+            //   })
+            // }
+            // if (targetRow2 !== undefined && targetRow3 !== undefined) {
+            //   if (targetRow2.pid == targetRow3.pid) {
+            //     that.$nextTick(() => {
+            //       that.$set(that.table, 'list', tableList)
+            //     })
+            //     that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间9999', duration: 2000 })
+            //     return false
+            //   }
+            // }
+          }
+
+          // ===
+        }
+      })
+    },
+    // 复制
+    handleCopy() {
+      if (this.table.list.length > 0) {
+        this.newGeneration.temp = {}
+        this.newGeneration.dialogStatus = 'copy'
+        this.newGeneration.dialogFormVisible = true
+      } else {
+        this.$message({ type: 'error', message: '当前无计划可复制' })
+      }
+    },
+    copyData() {
+      console.log(this.newGeneration.temp.copyInputDatetime)
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 5000)
+      this.$refs['temp'].validate(valid => {
+        if (valid) {
+          this.requestParam.name = 'copydownloadedplan'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
+          this.requestParam.parammaps.date = this.table.getdataListParm.parammaps.mydate
+          this.requestParam.parammaps.startTime = parseTime(this.newGeneration.temp.copyInputDatetime[0], '{y}-{m}-{d}')
+          this.requestParam.parammaps.stopTime = parseTime(this.newGeneration.temp.copyInputDatetime[1], '{y}-{m}-{d}')
+          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.newGeneration.dialogFormVisible = false
+              this.getList()
+            }
+          })
+        }
+      })
+    },
+    handleChangeOrder() {
+      // 拖动顺序
+      this.isOrder = false
+      this.rowDrop()
+    },
+    saveChangeOrder() {
+      // 保存顺序
+      var sortList = []
+      for (let i = 0; i < this.table.list.length; i++) {
+        var obj = {}
+        obj.sort = i
+        obj.pastureid = this.table.list[i].pastureid
+        obj.id = this.table.list[i].id
+        sortList.push(obj)
+      }
+      console.log(sortList)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortList }}
+      this.requestParam.data[0].children = []
+      this.requestParam.data[0].children[0] = { 'name': 'updatedownloadesort', 'type': 'e', 'parammaps': {
+        id: '@insertSpotList.id',
+        pastureid: '@insertSpotList.pastureid',
+        sort: '@insertSpotList.sort'
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('顺序切换保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
+          this.getList()
+          this.isOrder = true
+        }
+      })
+    },
+    cancelChangeOrder() {
+      // 取消顺序
+      this.getList()
+      this.isOrder = true
+    },
+    handleDataSynchronization() {
+      MessageBox.confirm('是否确认同步数据?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.requestParam = {}
+        this.requestParam.pastureid = Cookies.get('pastureid')
+        // this.$alert('正在同步', { confirmButtonText: '确定' })
+        this.dataSynchronization.dialogFormVisible = true
+        getDorm(this.requestParam).then(response => {
+          console.log(response)
+          if (response.msg == 'ok') {
+            this.dataSynchronization.dialogFormVisible = false
+            this.$notify({ title: '同步成功', message: '同步成功', type: 'success', duration: 2000 })
+          } else {
+            this.$notify({ title: '同步失败', message: response.data, type: 'warning', duration: 2000 })
+            this.dataSynchronization.dialogFormVisible = false
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消数据同步' })
+      })
+    },
+    handleRowDelete(row) {
+      console.log('删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.name = 'delDownloadedplan'
+        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: '已取消删除' })
+      })
+    }
+
+  }
+}
+</script>
+<style>
+  .el-table .warning-row {
+    background: oldlace;
+  }
+
+  .el-table .success-row {
+    background: #f0f9eb;
+  }
+</style>
+<style lang="scss" scoped>
+  .app-container{background: #fff;}
+  .operation{}
+  .search{margin-top:10px;}
+  .table{margin-bottom:20px;}
+
+  .template{
+    background: #fff;
+    position: relative;
+  }
+
+  .table2{
+    // float: left;width: 50%;
+    background: #fff;
+    position: relative;
+    .content-table{margin-top: 20px;}
+    .contentOperation{right: -50px;z-index: 1;}
+  }
+  .table3{
+    // float: left;width: 50%;
+    background: #fff;
+    position: relative;
+    .content-table{margin-top: 20px;}
+    .contentOperation{right: -50px;z-index: 1;}
+  }
+ </style>

BIN
.svn/wc.db


BIN
dist.zip


+ 0 - 12
src/App.vue

@@ -28,18 +28,6 @@ export default {
 }
 </script>
 <style lang="scss">
-// .table-fixed {
-//   /deep/ .el-table__fixed-right {
-//     height: 100% !important; //设置高优先,以覆盖内联样式
-//   }
-
-//   /deep/ .el-table__fixed {
-//     height: 100% !important; //设置高优先,以覆盖内联样式
-//   }
-// }
-// .el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right{
-//   height: 100% !important;
-// }
 // 弹窗最小高度
 .dialogMinHeight{
   min-height: 450px;

+ 16 - 2
src/api/common.js

@@ -110,7 +110,15 @@ export function GetArrList(data) {
     method: 'post',
     data
   })
-}
+}
+export function spillage(data) {
+  return request({
+    url: '/authdata/spillage',
+    method: 'post',
+    data
+  })
+}
+
 export function PostDataByNames(data) {
   return request({
     url: '/authdata/PostDataByNames',
@@ -151,7 +159,13 @@ export function getRecuData(data) {
     data
   })
 }
-
+export function Autogeneration(data) {
+  return request({
+    url: '/authdata/autogeneration',
+    method: 'post',
+    data
+  })
+}
 export function failproccess(data, notify) {
   if (data.data.includes('Duplicate')) {
     notify({

+ 26 - 8
src/main.js

@@ -12,7 +12,9 @@ import iconfont from './assets/iconfont/iconfont.css'
 import '@/styles/index.scss' // global css
 
 import * as Sentry from '@sentry/browser'
-import { Vue as VueIntegration } from '@sentry/integrations'
+import {
+  Vue as VueIntegration
+} from '@sentry/integrations'
 
 import App from './App'
 import store from './store'
@@ -42,10 +44,13 @@ if (process.env.NODE_ENV !== 'development') {
   Sentry.init({
     release: 'vislib@' + process.env.npm_package_version,
     dsn: 'https://9d8ee0ea1a2749949dd1e641b0f7c071@o286322.ingest.sentry.io/5217806',
-    integrations: [new VueIntegration({ Vue, attachProps: true })]
+    integrations: [new VueIntegration({
+      Vue,
+      attachProps: true
+    })]
   })
-}
-
+}
+
 
 store.commit('app/SET_LANG', 'CN')
 Vue.use(VueRouter)
@@ -57,10 +62,10 @@ Vue.use(ElementUI, {
 Object.keys(filters).forEach(key => {
   Vue.filter(key, filters[key])
 })
-
-import echarts from 'echarts'
-Vue.use(echarts)
-// Vue.prototype.$echarts = echarts
+
+import echarts from 'echarts'
+Vue.use(echarts)
+// Vue.prototype.$echarts = echarts
 
 new Vue({
   el: '#app',
@@ -68,4 +73,17 @@ new Vue({
   store,
   i18n,
   render: h => h(App)
+})
+
+Vue.directive('loadmore', {
+  bind(el, binding) {
+    const selectWrap = el.querySelector('.el-table__body-wrapper')
+    selectWrap.addEventListener('scroll', function() {
+      let sign = 0
+      const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
+      if (scrollDistance <= sign) {
+        binding.value()
+      }
+    })
+  }
 })

+ 5 - 0
src/styles/index.scss

@@ -366,6 +366,10 @@ input {
   .hide{background: $color3; border-color: $color10; color: $color11;height:38px;}
   .hide:focus{background: $color3; border-color: $color10; color: $color11;height:38px;}
   .hide:hover{background:$color16; border-color: $color10; color: $color11;height:38px;}
+  // 放大
+  .hide2{background: $color3; border-color: $color10; color: $color11;height:38px;}
+  .hide2:focus{background: $color3; border-color: $color10; color: $color11;height:38px;}
+  .hide2:hover{background:$color16; border-color: $color10; color: $color11;height:38px;}
   // 导出
   .export{background: $color3; border-color: $color10; color: $color11;min-width:100px;height: 38px;margin-right: 10px;}
   .export:focus{background: $color3; border-color: $color10; color: $color11;min-width:100px;height: 38px;margin-right: 10px;}
@@ -500,3 +504,4 @@ input {
 .el-icon-full-screen:before {
   content: "\e719";
 }
+

+ 10 - 4
src/views/basicData/feedTable/index.vue

@@ -929,7 +929,8 @@ export default {
       this.create.temp = { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '', jmp: '0' }
     },
     // 计划类型
-    changePlanList(item) {
+    changePlanList(item) {
+      console.log(item,'======')
       this.create.temp.printgroup = this.planTypeList.find(obj => obj.value === item).label
     },
     // 饲料类型
@@ -1042,7 +1043,10 @@ export default {
       row.autosecond = String(row.autosecond)
       row.confirmstart = String(row.confirmstart)
       row.enable = String(row.enable)
-      row.jmp = String(row.jmp)
+      row.jmp = String(row.jmp)
+      if (row.printgroupid !== '') {
+        row.printgroup = this.planTypeList.find(obj => obj.value == row.printgroupid).label
+      }
 
       this.create.temp = Object.assign({}, row)
       if (this.create.temp.allowratio == '0') { this.create.temp.allowratio = '' }
@@ -1050,7 +1054,8 @@ export default {
       if (this.create.temp.unitweight == '0') { this.create.temp.unitweight = '' }
       if (this.create.temp.autozone == '0') { this.create.temp.autozone = '' }
       if (this.create.temp.trgaddress == '0') { this.create.temp.trgaddress = '' }
-      if (this.create.temp.smtmrid == '-1') { this.create.temp.smtmrid = '' }
+      if (this.create.temp.smtmrid == '-1') { this.create.temp.smtmrid = '' }
+      console.log(row,'=====')
     },
     updateData() {
       console.log('点击了编辑保存')
@@ -1105,7 +1110,8 @@ export default {
           if (this.create.temp.uprice == '') { this.create.temp.uprice = '0' }
           if (this.create.temp.unitweight == '') { this.create.temp.unitweight = '0' }
           if (this.create.temp.autozone == '') { this.create.temp.autozone = '0' }
-          if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
+          if (this.create.temp.trgaddress == '') { this.create.temp.trgaddress = '0' }
+
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {

+ 23 - 3
src/views/basicData/forkliftManagement/index.vue

@@ -284,8 +284,18 @@ export default {
         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 :code')
+          const isRepeat2 = new RegExp('Duplicate entry :infocode')
+          if (isRepeat.test(response.data)) {
+            this.$notify({ type: 'error', message: '设备编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          if (isRepeat2.test(response.data)) {
+            this.$notify({ type: 'error', message: '数据采集编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         }
       })
     },
@@ -377,7 +387,17 @@ export default {
         if (response.msg !== 'fail') {
           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
           this.getList()
-        } else {
+        } else {
+          const isRepeat = new RegExp('Duplicate entry :code')
+          const isRepeat2 = new RegExp('Duplicate entry :infocode')
+          if (isRepeat.test(response.data)) {
+            this.$notify({ type: 'error', message: '设备编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
+          if (isRepeat2.test(response.data)) {
+            this.$notify({ type: 'error', message: '数据采集编号不可重复,请重新录入', duration: 2000 })
+            return false
+          }
           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         }
       })

+ 51 - 64
src/views/console/dict/index.vue

@@ -82,77 +82,64 @@
           </el-table-column>
           <el-table-column label="操作" header-align="center" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
             <template slot-scope="{row}">
-              <el-button type="primary" size="mini" @click="handleUpdate(row)">
-                编辑
-              </el-button>
-              <el-button v-if="row.status!='已删'" size="mini" type="danger" @click="handleDelete(row)">
-                删除
-              </el-button>
+              <el-button class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+              <el-button v-if="row.status!='已删'" class="miniDanger" icon="el-icon-delete" @click="handleDelete(row)" />
             </template>
           </el-table-column>
         </el-table>
         <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
 
         <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
-          <el-form
-            ref="dataForm"
-            v-enterToNext="true"
-            :rules="rules"
-            :model="deptform"
-            label-position="left"
-            label-width="100px"
-            style="width: 600px; margin-left:50px;"
-          >
-            <el-form-item label="名称" prop="label">
-              <el-input
-                ref="label"
-                v-model="deptform.label"
-              />
-            </el-form-item>
-            <el-form-item label="值" prop="value">
-              <el-input
-                ref="value"
-                v-model="deptform.value"
-              />
-            </el-form-item>
-            <el-form-item label="顺序" prop="orderby">
-              <el-input
-                ref="orderby"
-                v-model="deptform.orderby"
-              />
-            </el-form-item>
-            <!--   <el-form-item label="是否牧场" prop="isPasture">
-              <el-input
-                ref="isPasture"
-                v-model="deptform.isPasture"
-              />
-            </el-form-item> -->
-            <el-form-item label="启用" prop="enable">
-              <el-switch
-                ref="enable"
-                v-model="deptform.enable"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="1"
-                :inactive-value="0"
-              />
-            </el-form-item>
-          </el-form>
-          <div slot="footer" class="dialog-footer">
-            <el-button
-              v-if="dialogStatus==='create'"
-              ref="createb"
-              type="success"
-              @click="createData_again()"
+          <div>
+            <el-form
+              ref="dataForm"
+              v-enterToNext="true"
+              :rules="rules"
+              :model="deptform"
+              label-position="left"
+              label-width="100px"
+              style="width: 600px; margin-left:50px;"
             >
-              确认新增
-            </el-button>
-            <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
-              确认
-            </el-button>
-            <el-button @click="dialogFormVisible = false">
-              关闭
-            </el-button>
+              <el-form-item label="名称" prop="label">
+                <el-input
+                  ref="label"
+                  v-model="deptform.label"
+                />
+              </el-form-item>
+              <el-form-item label="值" prop="value">
+                <el-input
+                  ref="value"
+                  v-model="deptform.value"
+                />
+              </el-form-item>
+              <el-form-item label="顺序" prop="orderby">
+                <el-input
+                  ref="orderby"
+                  v-model="deptform.orderby"
+                />
+              </el-form-item>
+              <!--   <el-form-item label="是否牧场" prop="isPasture">
+                <el-input
+                  ref="isPasture"
+                  v-model="deptform.isPasture"
+                />
+              </el-form-item> -->
+              <el-form-item label="启用" prop="enable">
+                <el-switch
+                  ref="enable"
+                  v-model="deptform.enable"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  :active-value="1"
+                  :inactive-value="0"
+                />
+              </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+              <el-button v-if="dialogStatus==='create'" class="save" @click="createData_again()"> 确认新增 </el-button>
+              <el-button class="save" @click="dialogStatus==='create'?createData():updateData()"> 确认 </el-button>
+              <el-button class="cancelClose1" @click="dialogFormVisible = false"> 关闭 </el-button>
+            </div>
           </div>
         </el-dialog>
       </div>

+ 11 - 0
src/views/dashboard/pasture/index.vue

@@ -1386,6 +1386,17 @@ export default {
         //   }
         // ]
         // json2excel(excelDatasTabChart2, '泌乳牛采食量', true, 'xlsx')
+      } else if (item == 'row4chartLine2') {
+        console.log('混料实际重量统计')
+        var excelDatasTabChart4 = [
+          {
+            tHeader: ['日期', '重量'],
+            filterVal: ['日期', 'field1'],
+            tableDatas: this.row4.chart2.table.list,
+            sheetName: '混料实际重量统计'
+          }
+        ]
+        json2excel(excelDatasTabChart4, '混料实际重量统计', true, 'xlsx')
       }
     },
 

+ 28 - 0
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -121,6 +121,11 @@
             <template slot-scope="scope">
               <span>{{ scope.row.barnames }}</span>
             </template>
+          </el-table-column>
+          <el-table-column align="center" width="100" label="操作" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <el-button class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            </template>
           </el-table-column>
         </el-table>
         <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
@@ -1901,6 +1906,29 @@ export default {
       }).catch(() => {
         this.$message({ type: 'info', message: '已取消数据同步' })
       })
+    },
+    handleRowDelete(row) {
+      console.log('删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam = {}
+        this.requestParam.name = 'delDownloadedplan'
+        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: '已取消删除' })
+      })
     }
 
   }

+ 1 - 1
src/views/formulationPlan/dailyExecutionPlan/typePage/dhedFormula.vue

@@ -77,7 +77,7 @@
         <el-table-column :key="17" label="日投喂量" prop="sumweight" min-width="85px" align="center" />
         <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
-            <el-button v-if="row.isUpdate" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
             <el-button v-if="row.isUpdateSave" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @click="updateData(row)" />
             <span v-if="row.isUpdateSave" class="centerSpan">|</span>
             <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />

+ 71 - 30
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -44,11 +44,17 @@
             <span v-if="element.isShowTitle" class="draggableTitle">{{ element.ftname }}:</span>
             <draggable id="1" data-source="juju1" :list="element.arrList" class="list-group1" draggable=".item" group="a" :move="move" @change="changeLog" @start="start" @end="end">
               <div v-for="item in element.arrList" :key="item.id" class="list-group-item1 item" style="width: 88px;float: left;margin:5px 5px;height: 36px;">
-                <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;" :style="{'background':item.background}">
-                  <div slot="content">{{ item.barname }}</div>
-                  <div class="draggableName">{{ item.barname }}</div>
-                </el-tooltip>
-                <div class="draggableWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }"> {{ item.weight }} </div>
+                <div style="position: relative;">
+                  <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;" :style="{'background':item.background}">
+                    <div slot="content">{{ item.barname }}</div>
+                    <div class="draggableName">{{ item.barname }}</div>
+                  </el-tooltip>
+                  <div class="draggableWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
+
+                    <!-- <span v-if="item.isfill==1" style="background: #009C69;color:#fff;position: absolute;left: 0;top: 18px;">补</span> -->
+                    {{ item.weight }}
+                  </div>
+                </div>
               </div>
             </draggable>
           </li>
@@ -150,7 +156,7 @@
                   <div class="arr-l-t">
                     <div class="arr-l-t-t" />
                     <el-select v-model="element.tmrid" placeholder="撒料设备" class="arr-l-t-b el-icon-arrow-down" @change="(value)=> {changeEquipment(value, scope.row,element.fttype,element.id)}">
-                      <el-option v-for="item in equipmentList" :key="item.id" :label="item.tmrmix" :value="item.id" />
+                      <el-option v-for="item in equipmentList" :key="item.id" :disabled="table.myTemp.isUpdateSave || scope.row.havebutton == 1" :label="item.tmrmix" :value="item.id" />
                     </el-select>
                   </div>
                   <div class="arr-l-b">
@@ -159,6 +165,7 @@
                       <div class="tmrname">{{ element.tmrname }}</div>
                     </el-tooltip>
                   </div>
+                  <!-- <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div> -->
                 </div>
                 <div class="arr-r">
                   <div class="arr-r-l">
@@ -171,7 +178,7 @@
                   <div class="arr-r-r">
                     <el-tooltip v-show="!element.isWeight" placement="top">
                       <div slot="content">{{ element.weight }}</div>
-                      <div class="weight" @dblclick="dbclickWeight(element)">{{ element.weight }}</div>
+                      <div class="weight" @dblclick="dbclickWeight(element,scope.row)">{{ element.weight }}</div>
                     </el-tooltip>
                     <el-tooltip v-show="element.isWeight" placement="top">
                       <div slot="content">{{ element.weight }}</div>
@@ -192,9 +199,9 @@
             <el-button v-if="row.isCreate" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
             <span v-if="row.isCreate" class="centerSpan">|</span>
             <el-button v-if="row.isCreate" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
-            <el-button v-if="row.isUpdate" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
             <span v-if="row.isUpdate" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdate" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
             <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
             <span v-if="row.isUpdateSave" class="centerSpan">|</span>
             <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
@@ -288,7 +295,8 @@ export default {
         move1: '',
         changeList: [],
         startObj: {},
-        isGoing: false
+        isGoing: false,
+        myTemp: {}
       },
       selectList: [], // 选中数据
 
@@ -347,8 +355,8 @@ export default {
       },
       isokDisable: false,
       requestParam: {},
-      // height: document.body.clientHeight - 255 - 50, // table高度
-      height: document.body.clientHeight - 450 - 50, // table高度
+      height: document.body.clientHeight - 255 - 50, // table高度
+      // height: document.body.clientHeight - 450 - 50, // table高度
       rowStyle: { maxHeight: 45 + 'px', height: 40 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       dropState: false
@@ -745,9 +753,12 @@ export default {
         row.ftname = ''
       }
       this.dropState = true
+      this.table.myTemp = Object.assign({}, row)
     },
     updateData(row) {
       console.log('点击了编辑保存', row)
+      row.isUpdateSave = false
+      this.table.myTemp = Object.assign({}, row)
       this.table.temp.pastureid = row.pastureid
       this.table.temp.id = row.id
       this.table.temp.tmrname = row.tmrname
@@ -822,6 +833,7 @@ export default {
       row.isUpdate = true
       row.isUpdateSave = false
       this.dropState = false
+      this.table.myTemp = Object.assign({}, row)
     },
 
     // 配方
@@ -864,6 +876,13 @@ export default {
     changeLog2(evt) {
       // console.log(this.table.startObj)
       console.log(evt, 'evt-----')
+      if (evt.havebutton == 1) {
+        this.$message({ type: 'error', message: '该车次计划已执行,不允许修改', duration: 2000 })
+        this.getTimesList()
+        this.getSmallMenuList()
+        this.getList()
+        return false
+      }
       this.table.changeList.push(evt)
       evt = this.table.changeList[0]
       if (evt.arrList.length == 1) {
@@ -1111,6 +1130,22 @@ export default {
         }
       })
     },
+    dbclickWeight(row, row2) {
+      console.log(row2, 'row2')
+      if (row2.havebutton == 1) {
+        return false
+      }
+      if (this.table.myTemp.isUpdateSave == true) {
+        return false
+      }
+      console.log(row)
+      row.isWeight = true
+      row.focusState = true
+      this.dropState = true
+      this.myStart2 = false
+      this.myMove2 = false
+      this.myEnd2 = false
+    },
     // 编辑-重量
     blurWeight(row, fttype, myid) {
       var objList = {}
@@ -1175,6 +1210,12 @@ export default {
 
     // 撒料位删除
     handleFLDelete(ele, row) {
+      if (row.havebutton == 1) {
+        return false
+      }
+      if (this.table.myTemp.isUpdateSave == true) {
+        return false
+      }
       console.log(ele, row, '点击了撒料删除')
       this.selectList = []
       this.requestParam = {}
@@ -1299,30 +1340,30 @@ export default {
   }
 }
 </script>
-
+
 <style lang="scss">
   /deep/ :focus {
     outline: 0;
   }
   :focus-visible {
     outline: 0 !important;
-  }
-  // 下拉框
-  .filter-item2 .el-input--suffix .el-input__inner{
-    height: 30px !important;
-    font-size: 8px;
-    padding: 0 2px;
-  }
-  .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon{
-    line-height: 30px !important;
-  }
-  // 输入框
-  .filter-item2 .el-input__inner{
-    height: 30px !important;
-    font-size: 8px;
-    padding: 0 2px;
-  }
-</style>
+  }
+  // 下拉框
+  .filter-item2 .el-input--suffix .el-input__inner{
+    height: 30px !important;
+    font-size: 8px;
+    padding: 0 2px;
+  }
+  .filter-item2 .el-input--suffix .el-input__suffix .el-input__suffix-inner .el-input__icon{
+    line-height: 30px !important;
+  }
+  // 输入框
+  .filter-item2 .el-input__inner{
+    height: 30px !important;
+    font-size: 8px;
+    padding: 0 2px;
+  }
+</style>
 
 <style lang="scss">
  .menuList{

+ 2 - 2
src/views/formulationPlan/dailyExecutionPlan/typePage/premixedPlan.vue

@@ -89,9 +89,9 @@
             <el-button v-if="row.isCreate" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
             <span v-if="row.isCreate" class="centerSpan">|</span>
             <el-button v-if="row.isCreate" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
-            <el-button v-if="row.isUpdate" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
             <span v-if="row.isUpdate" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdate" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+            <el-button v-if="row.isUpdate" :disabled="row.havebutton == 1" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
             <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
             <span v-if="row.isUpdateSave" class="centerSpan">|</span>
             <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />

+ 125 - 35
src/views/formulationPlan/dhedFormula/index.vue

@@ -4,6 +4,13 @@
       <!-- 临时隐藏 -->
       <!-- <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleNutritional">营养评估</el-button> -->
       <!-- 临时隐藏 -->
+      <div class="search">
+        <el-select v-model="table.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>
+        <el-input v-model="table.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" />
+        <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      </div>
       <el-button v-if="isRoleEdit" class="successBorder" style="float: left;" @click="handleDryMatterRegulation">干物质调节</el-button>
       <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
@@ -32,45 +39,43 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
+        :max-height="myHeight"
         @header-click="headerClick"
         @cell-click="cellClick"
         @selection-change="handleSelect"
+        @cell-dblclick="celldblclick"
       >
         <el-table-column type="selection" width="50" />
-        <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
+        <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left" />
         <el-table-column label="栏舍名称" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left">
           <template slot-scope="scope">
             <span>{{ scope.row.barname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="软件牛头数" min-width="70px" align="center">
+        <el-table-column :key="2" label="软件牛头数" min-width="70px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.softccount }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="实际牛头数" min-width="90px" align="center">
+        <el-table-column :key="3" label="实际牛头数" min-width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcount(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="系数(%)" min-width="85px" align="center">
+        <el-table-column :key="4" label="系数(%)" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurRatio(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="系数头数" min-width="85px" align="center">
+        <el-table-column :key="5" label="系数头数" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column label="配方模板" min-width="130px" align="center">
+        <el-table-column :key="6" label="配方模板" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
             <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="配方模板" class="filter-item" style="width:99%;" @change="(value)=> {changeRecipeTemplate(value, scope.row)}">
@@ -78,7 +83,7 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isPtsfname" :key="8" label="补料配方" min-width="130px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="7" label="补料配方" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
             <el-select v-if="scope.row.Edit" v-model="scope.row.ptsfid" clearable filterable placeholder="补料配方" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
@@ -86,18 +91,24 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="9" label="第一班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="10" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="120px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW(scope.row)" @focus="focusW(scope.row)" />
           </template>
         </el-table-column>
+        <el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw1 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+          </template>
+        </el-table-column>
         <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
@@ -110,56 +121,84 @@
             <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW2(scope.row)" @focus="focusW2(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="13" label="第三班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw2 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="14" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="120px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW3(scope.row)" @focus="focusW3(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="15" label="第四班比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="120px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw3 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:95%;padding:10px 0;" @blur="blurR(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="16" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="120px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW4(scope.row)" @focus="focusW4(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column :key="17" label="总比例(%)" min-width="80px" align="center">
+        <el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="120px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.sumr }}</span>
+            <span v-if="scope.row.NoEdit">{{ scope.row.bw4 }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <!-- <el-table-column :key="22" label="投喂量" min-width="80px" align="center">
+        <el-table-column :key="20" label="饲喂总比例(%)" min-width="80px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.feedweight }}</span>
+            <span>{{ scope.row.sumr }}</span>
           </template>
-        </el-table-column> -->
-        <el-table-column :key="18" label="日投喂量" min-width="70px" align="center">
+        </el-table-column>
+        <el-table-column :key="21" label="饲喂投喂量" min-width="80px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.dailyWeight }}</span>
+            <span>{{ scope.row.todayweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="19" label="配方重量" min-width="70px" align="center">
+        <el-table-column :key="22" label="饲喂配方重量" min-width="70px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.ftweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isPtsfname" :key="20" label="补料重量" min-width="100px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="23" label="补料配方重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.supplyweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="21" label="配方干物质" min-width="70px" align="center">
+        <!-- <el-table-column :key="22" label="投喂量" min-width="80px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.feedweight }}</span>
+          </template>
+        </el-table-column> -->
+        <el-table-column v-if="table.isPtsfname" :key="24" label="补料投喂量" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.todaysupplement }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :key="25" label="日投喂量" min-width="70px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.todayfeed }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :key="26" label="配方干物质" min-width="70px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.dryweight }}</span>
           </template>
@@ -173,7 +212,7 @@
           </template>
         </el-table-column>
       </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+      <!-- <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" /> -->
     </div>
     <!-- 历史记录 -->
     <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="history.dialogFormVisible" :close-on-click-modal="false" width="90%">
@@ -192,6 +231,11 @@
       <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>
+          <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> -->
         </div>
         <div class="table">
@@ -730,11 +774,13 @@ export default {
       requestParams: [
         { name: 'getFTSWList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
-        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
       ],
       recipeTemplateList: [], // 配方模板
       feedingFormulaList: [], // 补料配方
       livestockTypeList: [], // 类别
+      barList: [],
       rules: {
         cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
       },
@@ -743,11 +789,14 @@ export default {
           name: 'getFPList',
           page: 1,
           offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
+          // pagecount: parseInt(Cookies.get('pageCount')),
+          pagecount: '',
           returntype: 'Map',
           parammaps: {
             pastureid: Cookies.get('pastureid'),
-            enable: ''
+            enable: '',
+            barid: '',
+            tname: ''
           }
         },
         tableKey: 0,
@@ -918,7 +967,9 @@ export default {
           returntype: 'Map',
           parammaps: {
             pastureid: Cookies.get('pastureid'),
-            date: ''
+            date: '',
+            barid: '',
+            tname: ''
           }
         },
         isPtsfname: false, // 补料配方/补料重量
@@ -988,7 +1039,8 @@ export default {
       isShowDialog: false,
       isokDisable: false,
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight: document.documentElement.clientHeight - 85 - 140
     }
   },
   computed: {
@@ -1034,6 +1086,7 @@ export default {
         this.recipeTemplateList = response.data.getFTSWList.list
         this.feedingFormulaList = response.data.getFTBLList.list
         this.livestockTypeList = response.data.getCowclassListEnable.list
+        this.barList = response.data.getBarListEnable.list
         this.getIsDisplay()
       })
     },
@@ -1176,6 +1229,24 @@ export default {
                 response.data.list[i]['w' + timesoptArr[j].split(':')[0]] = timesoptArr[j].split(':')[2]
               }
             }
+            if (response.data.list[i].bw1 == undefined) {
+              this.$set(response.data.list[i], 'bw1', '')
+            }
+            if (response.data.list[i].bw2 == undefined) {
+              this.$set(response.data.list[i], 'bw2', '')
+            }
+            if (response.data.list[i].bw3 == undefined) {
+              this.$set(response.data.list[i], 'bw3', '')
+            }
+            if (response.data.list[i].bw4 == undefined) {
+              this.$set(response.data.list[i], 'bw4', '')
+            }
+            if (response.data.list[i].supplement !== undefined) {
+              var supplementArr = response.data.list[i].supplement.split(',')
+              for (let j = 0; j < supplementArr.length; j++) {
+                response.data.list[i]['bw' + supplementArr[j].split(':')[0]] = supplementArr[j].split(':')[2]
+              }
+            }
           }
           // console.log(response.data.list, sumr)
           for (let i = 0; i < response.data.list.length; i++) {
@@ -1215,7 +1286,9 @@ export default {
         }, 100)
       })
     },
-
+    handleSearch() {
+      this.getList()
+    },
     renderHeader(h, { column, $index }) { // h即为cerateElement的简写,具体可看vue官方文档
       return h(
         'div',
@@ -4072,6 +4145,10 @@ export default {
       this.$set(row, 'dailyWeight', parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4))
       row.dailyWeight = formatNum(row.dailyWeight, parseInt(Cookies.get('decimal')))
     },
+    celldblclick(row, column, cell, event) {
+      console.log(row, '=====')
+      this.handleUpdate(row)
+    },
     // 编辑
     handleUpdate(row) {
       console.log(row)
@@ -4107,6 +4184,10 @@ export default {
       if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
       if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
       if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
+      if (row.bw1 == 'NaN') { this.$set(row, 'bw1', 0) }
+      if (row.bw2 == 'NaN') { this.$set(row, 'bw2', 0) }
+      if (row.bw3 == 'NaN') { this.$set(row, 'bw3', 0) }
+      if (row.bw4 == 'NaN') { this.$set(row, 'bw4', 0) }
       var arr = []
       for (let i = 1; i <= this.table.RWLength; i++) {
         var obj = {}
@@ -4122,7 +4203,10 @@ export default {
           obj['ptsid'] = '-1'
         }
         obj['weight'] = row['w' + i]
+        obj['supplement'] = row['bw' + i]
         obj['tratio'] = Math.round(row['r' + i])
+        obj['todaysupplement'] = row.todaysupplement
+        obj['todayweight'] = row.todayweight
         arr.push(obj)
       }
       if (this.table.isPtsfname == 0) {
@@ -4281,6 +4365,7 @@ export default {
         ccountradio: row.ccountratio,
         ptid: '@insertSpotList.ptid',
         ptsid: '@insertSpotList.ptsid',
+        supplement: '@insertSpotList.supplement',
         feedweight: row.feedweight,
         supplyweight: row.supplyweight,
         ratio: row.ratio
@@ -5151,8 +5236,13 @@ export default {
       this.isShowDialog = true
       this.$refs.mychild.getBalconicFormula()
       this.$refs.mychild.restTemp()
+    },
+    blurBw(row) {
+      console.log(row)
+    },
+    focusBw(row) {
+      console.log(row)
     }
-
   }
 }
 </script>

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

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

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 547 - 219
src/views/formulationPlan/materialIssuancePlan/index.vue


+ 78 - 6
src/views/formulationPlan/premixedPlan/index.vue

@@ -8,6 +8,8 @@
         <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
       </div>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">生效</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用</el-button>
       <el-button class="import" style="float: right;" @click="handleHistoryRecords">历史记录</el-button>
     </div>
     <div class="search" />
@@ -72,13 +74,13 @@
             <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="时间" min-width="130px" align="center">
+        <!-- <el-table-column label="时间" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ptime }}</span>
             <el-time-picker v-if="scope.row.Edit" v-model="scope.row.ptime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
           </template>
-        </el-table-column>
-        <el-table-column label="单车操作重量" min-width="110px" align="center">
+        </el-table-column> -->
+        <el-table-column label="最大搅拌量(KG)" min-width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.maxweight }}</span>
           </template>
@@ -173,7 +175,7 @@
                 <span>{{ scope.row.ptime }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="单车操作重量" min-width="130px" align="center">
+            <el-table-column label="最大搅拌量(KG)" min-width="130px" align="center">
               <template slot-scope="scope">
                 <span>{{ scope.row.maxweight }}</span>
               </template>
@@ -392,6 +394,10 @@ export default {
           this.carFollowList = response.data.list
           row.lppid = this.carFollowList[0].id
           row.lppcode = this.carFollowList[0].lppcode
+        } else {
+          this.carFollowList = []
+          row.lppid = ''
+          row.lppcode = ''
         }
       })
     },
@@ -412,12 +418,13 @@ export default {
         obj.pastureid = this.table.list[i].pastureid
         sortArr.push(obj)
       }
+      console.log(sortArr, 'sortArr=====')
       this.requestParam = {}
       this.requestParam.common = { 'returnmap': '0' }
       this.requestParam.data = []
       this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortArr }}
       this.requestParam.data[0].children = []
-      this.requestParam.data[0].children[0] = { 'name': 'updateLppSort', 'type': 'e', 'parammaps': {
+      this.requestParam.data[0].children[0] = { 'name': 'updatePremixplanSort', 'type': 'e', 'parammaps': {
         id: '@insertSpotList.id',
         pastureid: '@insertSpotList.pastureid',
         sort: '@insertSpotList.sort'
@@ -803,8 +810,73 @@ export default {
           })
         })
       }
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 1
+          }
+          console.log('生效', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updatePremixplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('生效保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDisable() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 0
+          }
+          console.log('禁用', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updatePremixplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('禁用保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
     }
-
   }
 }
 

+ 3064 - 0
src/views/formulationPlan/recipeTemplate/index - 副本 (2).vue

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

+ 2961 - 0
src/views/formulationPlan/recipeTemplate/index - 副本.vue

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

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 508 - 363
src/views/formulationPlan/recipeTemplate/index.vue


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

@@ -9,6 +9,8 @@
         <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
       </div>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">生效</el-button>
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用</el-button>
       <el-button class="import" style="float: right;" @click="handleHistoryRecords">历史记录</el-button>
     </div>
     <div class="search" />
@@ -74,12 +76,12 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column label="时间" min-width="130px" align="center">
+        <!-- <el-table-column label="时间" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.rtime }}</span>
             <el-time-picker v-if="scope.row.Edit" v-model="scope.row.rtime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column label="剩料处理方式" min-width="130px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.treatmethod }}</span>
@@ -453,7 +455,7 @@ export default {
       this.requestParam.data = []
       this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortArr }}
       this.requestParam.data[0].children = []
-      this.requestParam.data[0].children[0] = { 'name': 'updateLppSort', 'type': 'e', 'parammaps': {
+      this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanSort', 'type': 'e', 'parammaps': {
         id: '@insertSpotList.id',
         pastureid: '@insertSpotList.pastureid',
         sort: '@insertSpotList.sort'
@@ -1067,6 +1069,72 @@ export default {
           this.history.listLoading = false
         }, 100)
       })
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 1
+          }
+          console.log('生效', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('生效保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDisable() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 0
+          }
+          console.log('禁用', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('禁用保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
     }
 
   }

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

@@ -96,18 +96,18 @@
 
     <!-- 新增/编辑 -->
     <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="80%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[create.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
       <div class="app-add">
         <el-form ref="createTemp" :rules="create.rules" :model="create.createTemp" label-position="right" label-width="150px" style="width: 90%;height:300px;margin:0 auto 50px">
           <el-row>
@@ -137,7 +137,7 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="牲畜类别:" prop="cowclassid">
-                <el-input v-if="create.dialogStatus==='see'" ref="cowclass" v-model="create.createTemp.cowclass" disabled class="filter-item" placeholder="请选择牲畜类别" type="text" disabled />
+                <el-input v-if="create.dialogStatus==='see'" ref="cowclass" v-model="create.createTemp.cowclass" disabled class="filter-item" placeholder="请选择牲畜类别" type="text" disabled />
                 <el-select v-else v-model="create.createTemp.cowclassid" filterable placeholder="请选择牲畜类别" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus==='see' || create.createTemp.usetype=='损耗'" @change="changeLivestock">
                   <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.id" />
                 </el-select>
@@ -192,7 +192,7 @@ export default {
   name: 'LaborConsumption',
   components: { Pagination },
   data() {
-    return {
+    return {
       dialogFull: false,
       isRoleEdit: [],
       requestParams: [
@@ -390,7 +390,7 @@ export default {
       this.table.getdataListParm.parammaps.ischarge = ''
       this.table.getdataListParm.parammaps.usetype = ''
       this.table.getdataListParm.parammaps.feedname = ''
-      this.table.getdataListParm.parammaps.cowclassid = ''
+      this.table.getdataListParm.parammaps.cowclassid = ''
       this.getList()
     },
 
@@ -458,7 +458,7 @@ export default {
     },
     handleCreate() {
       console.log('点击了新增')
-      this.create.dialogStatus = 'create'
+      this.create.dialogStatus = 'create'
       this.dialogFull = false
       this.create.dialogFormVisible = true
       this.$nextTick(() => {
@@ -534,7 +534,7 @@ export default {
     handleSee(row) {
       this.$nextTick(() => {
         this.$refs.createTemp.resetFields()
-      })
+      })
       this.dialogFull = false
       this.create.dialogStatus = 'see'
       this.create.dialogFormVisible = true

+ 232 - 0
src/views/shedProduction/dungScores/historyRecord.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="app-table">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.changetime" class="filter-item" type="date" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="年/月/日" />
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+      >
+        <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+        <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" />
+        <el-table-column :key="3" label="标准分数(分)" prop="standardscore" min-width="90px" align="center" />
+        <el-table-column :key="4" label="牛头数(分)" prop="cowsum" min-width="90px" align="center" />
+        <el-table-column :key="5" label="评分" min-width="90px" align="center">
+          <el-table-column label="1分 (头)" prop="onescore" min-width="90px" align="center" />
+          <el-table-column label="2分(头)" prop="twoscore" min-width="90px" align="center" />
+          <el-table-column label="3分(头)" prop="threescore" min-width="90px" align="center" />
+          <el-table-column label="4分(头)" prop="fourscore" min-width="90px" align="center" />
+          <el-table-column label="5分(头)" prop="fivescore" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="6" label="操作" prop="operation" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <a class="correcting" @click="handleSeeHistory (row)">{{ row.operation }}</a>
+          </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 :visible.sync="seeHistory.dialogFormVisible" append-to-body :title="textMap[seeHistory.dialogStatus]" :close-on-click-modal="false" width="90%">
+      <div class="seeHistory">
+        <div class="search">
+          <el-date-picker v-model="seeHistory.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="seeHistory.tableKey"
+            v-loading="seeHistory.listLoading"
+            element-loading-text="给我一点时间"
+            :data="seeHistory.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+            <el-table-column :key="2" label="修改时间" prop="changetime1" min-width="90px" align="center" />
+            <el-table-column :key="3" label="标准分数(分)" prop="standardscore" min-width="90px" align="center" />
+            <el-table-column :key="4" label="牛头数(分)" prop="cowsum" min-width="90px" align="center" />
+            <el-table-column :key="5" label="评分" min-width="90px" align="center">
+              <el-table-column label="1分 (头)" prop="onescore" min-width="90px" align="center" />
+              <el-table-column label="2分(头)" prop="twoscore" min-width="90px" align="center" />
+              <el-table-column label="3分(头)" prop="threescore" min-width="90px" align="center" />
+              <el-table-column label="4分(头)" prop="fourscore" min-width="90px" align="center" />
+              <el-table-column label="5分(头)" prop="fivescore" min-width="90px" align="center" />
+            </el-table-column>
+          </el-table>
+          <Pagination v-show="seeHistory.total>0" :total="seeHistory.total" :page.sync="seeHistory.getdataListParm.offset" :limit.sync="seeHistory.getdataListParm.pagecount" @pagination="getSeeHistoryList" />
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="seeHistory.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName } from '@/api/common'
+import draggable from 'vuedraggable'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'MaterialIssuancePlan',
+  display: 'Two list header slot',
+  order: 14,
+  components: { Pagination },
+  data() {
+    return {
+      table: {
+        getdataListParm: {
+          name: 'getDungandbodyhistory',
+          page: 1,
+          offset: 1,
+          pagecount: 12,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            changetime: '',
+            species: 'fppf'
+          }
+        },
+        list: [],
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        temp: {},
+        changeList: [],
+        startObj: {}
+      },
+
+      textMap: {
+        seeHistory: '粪便评分修改记录'
+      },
+      seeHistory: {
+        dialogFormVisible: false, dialogStatus: '',
+        total: 0, tableKey: 0, listLoading: false,
+        getdataListParm: {
+          name: 'getDungandbodyhistoryBar', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            inputDatetime: '',
+            time1: '',
+            time2: ''
+          }
+        }
+      },
+
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    changeDate() {
+      this.getList()
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    handleSearch() {
+      if (this.table.getdataListParm.parammaps.changetime == '') {
+        this.table.getdataListParm.parammaps.changetime = ''
+      } else {
+        this.table.getdataListParm.parammaps.changetime = parseTime(this.table.getdataListParm.parammaps.changetime, '{y}-{m}-{d}')
+      }
+      this.getList()
+    },
+    handleRefresh() {
+      this.table.getdataListParm.parammaps.changetime = ''
+      this.getList()
+    },
+    handleSeeHistory(row) {
+      console.log(row)
+      this.textMap.seeHistory = '粪便评分修改记录——栏舍:' + row.barname
+      this.seeHistory.dialogFormVisible = true
+      this.seeHistory.dialogStatus = 'seeHistory'
+
+      this.seeHistory.getdataListParm.parammaps.species = 'fppf'
+      this.seeHistory.getdataListParm.parammaps.barid = row.barids
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.getSeeHistoryList()
+    },
+    getSeeHistoryList() {
+      this.seeHistory.listLoading = true
+      GetDataByName(this.seeHistory.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.seeHistory.list = response.data.list
+          this.seeHistory.pageNum = response.data.pageNum
+          this.seeHistory.pageSize = response.data.pageSize
+          this.seeHistory.total = response.data.total
+        } else {
+          this.seeHistory.list = []
+        }
+        setTimeout(() => {
+          this.seeHistory.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch2() {
+      if (this.seeHistory.getdataListParm.parammaps.inputDatetime !== '' && this.seeHistory.getdataListParm.parammaps.inputDatetime !== null) {
+        this.seeHistory.getdataListParm.parammaps.time1 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.seeHistory.getdataListParm.parammaps.time2 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+        this.seeHistory.getdataListParm.parammaps.time1 = ''
+        this.seeHistory.getdataListParm.parammaps.time2 = ''
+      }
+      this.seeHistory.getdataListParm.offset = 1
+      this.getSeeHistoryList()
+    },
+    handleRefresh2() {
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.getSeeHistoryList()
+    }
+  }
+}
+</script>
+
+<style  lang="scss" scoped>
+ .search{margin-bottom: 10px;}
+</style>

+ 103 - 29
src/views/shedProduction/dungScores/index.vue

@@ -24,6 +24,7 @@
           <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
     </div>
     <div class="table">
       <el-table
@@ -106,7 +107,7 @@
         <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
           </template>
         </el-table-column>
@@ -116,18 +117,18 @@
 
     <!-- 新增/编辑 -->
     <el-dialog :fullscreen="dialogFull" :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[create.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
       <div class="app-add">
         <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 100%;margin:0 auto 50px">
           <el-row>
@@ -225,6 +226,29 @@
         </div>
       </div>
     </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -240,7 +264,7 @@ export default {
   name: 'DungScores',
   components: { Pagination },
   data() {
-    return {
+    return {
       dialogFull: false,
       isRoleEdit: [],
       requestParams: [
@@ -315,10 +339,16 @@ export default {
       },
       textMap: {
         create: '新增',
-        update: '编辑'
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
       },
-
       requestParam: {},
+      requestParam2: {},
       download: {
         getdataListParm: {
           name: 'getDungscoreList',
@@ -517,7 +547,7 @@ export default {
     handleCreate() {
       console.log('点击了新增')
       this.resetTemp()
-      this.getNoteTakerList()
+      this.getNoteTakerList()
       this.dialogFull = false
       this.create.dialogStatus = 'create'
       this.create.dialogFormVisible = true
@@ -547,16 +577,38 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
             }
           })
         }
       })
     },
+    saveData() {
+      this.requestParam2.name = 'insertDungandbodyhistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.create.temp.species = 'fppf'
+      this.create.temp.fourrate = ''
+      this.create.temp.fourweight = ''
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
     createDataAgain() {
       console.log('点击了新增保存')
       this.isokDisable = true
@@ -582,12 +634,17 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.saveData()
               this.resetTemp()
               this.getList()
               this.getNoteTakerList()
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
             }
           })
         }
@@ -606,7 +663,7 @@ export default {
       this.create.temp = Object.assign({}, row)
       this.create.temp.id = row.id
 
-      this.getNoteTakerList()
+      this.getNoteTakerList()
       this.dialogFull = false
       this.create.dialogStatus = 'update'
       this.create.dialogFormVisible = true
@@ -635,11 +692,14 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
             }
           })
         }
@@ -717,7 +777,12 @@ export default {
           this.requestParam.parammaps.id = this.selectList[0].id
           PostDataByName(this.requestParam).then(response => {
             if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ 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.getList()
@@ -832,6 +897,15 @@ export default {
           }
         })
       )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
     }
 
   }

+ 235 - 0
src/views/shedProduction/fecalScreen/historyRecord.vue

@@ -0,0 +1,235 @@
+<template>
+  <div class="app-table">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.operatetime" class="filter-item" type="date" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="年/月/日" />
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+      >
+        <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+        <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" />
+        <el-table-column :key="3" label="第一层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="onerate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="oneweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="4" label="第二层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="tworate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="twoweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="5" label="第三层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="threerate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="threeweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="6" label="操作" prop="operation" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <a class="correcting" @click="handleSeeHistory (row)">{{ row.operation }}</a>
+          </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 :visible.sync="seeHistory.dialogFormVisible" append-to-body :title="textMap[seeHistory.dialogStatus]" :close-on-click-modal="false" width="90%">
+      <div class="seeHistory">
+        <div class="search">
+          <el-date-picker v-model="seeHistory.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="seeHistory.tableKey"
+            v-loading="seeHistory.listLoading"
+            element-loading-text="给我一点时间"
+            :data="seeHistory.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+            <el-table-column :key="2" label="修改时间" prop="operatetime1" min-width="90px" align="center" />
+            <el-table-column :key="3" label="第一层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="onerate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="oneweight" min-width="90px" align="center" />
+            </el-table-column>
+            <el-table-column :key="4" label="第二层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="tworate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="twoweight" min-width="90px" align="center" />
+            </el-table-column>
+            <el-table-column :key="5" label="第三层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="threerate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="threeweight" min-width="90px" align="center" />
+            </el-table-column>
+          </el-table>
+          <Pagination v-show="seeHistory.total>0" :total="seeHistory.total" :page.sync="seeHistory.getdataListParm.offset" :limit.sync="seeHistory.getdataListParm.pagecount" @pagination="getSeeHistoryList" />
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="seeHistory.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName } from '@/api/common'
+import draggable from 'vuedraggable'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'MaterialIssuancePlan',
+  display: 'Two list header slot',
+  order: 14,
+  components: { Pagination },
+  data() {
+    return {
+      table: {
+        getdataListParm: {
+          name: 'getDungHistory',
+          page: 1,
+          offset: 1,
+          pagecount: 12,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            operatetime: ''
+          }
+        },
+        list: [],
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        temp: {},
+        changeList: [],
+        startObj: {}
+      },
+
+      textMap: {
+        seeHistory: '粪便筛修改记录'
+      },
+      seeHistory: {
+        dialogFormVisible: false, dialogStatus: '',
+        total: 0, tableKey: 0, listLoading: false,
+        getdataListParm: {
+          name: 'getDungHistoryBar', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            inputDatetime: '',
+            time1: '',
+            time2: ''
+          }
+        }
+      },
+
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    changeDate() {
+      this.getList()
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    handleSearch() {
+      if (this.table.getdataListParm.parammaps.operatetime == '') {
+        this.table.getdataListParm.parammaps.operatetime = ''
+      } else {
+        this.table.getdataListParm.parammaps.operatetime = parseTime(this.table.getdataListParm.parammaps.operatetime, '{y}-{m}-{d}')
+      }
+      this.getList()
+    },
+    handleRefresh() {
+      this.table.getdataListParm.parammaps.operatetime = ''
+      this.getList()
+    },
+    handleSeeHistory(row) {
+      console.log(row)
+      this.textMap.seeHistory = '粪便筛修改记录——栏舍:' + row.barname
+      this.seeHistory.dialogFormVisible = true
+      this.seeHistory.dialogStatus = 'seeHistory'
+      this.seeHistory.getdataListParm.parammaps.barid = row.barids
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.getSeeHistoryList()
+    },
+    getSeeHistoryList() {
+      this.seeHistory.listLoading = true
+      GetDataByName(this.seeHistory.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.seeHistory.list = response.data.list
+          this.seeHistory.pageNum = response.data.pageNum
+          this.seeHistory.pageSize = response.data.pageSize
+          this.seeHistory.total = response.data.total
+        } else {
+          this.seeHistory.list = []
+        }
+        setTimeout(() => {
+          this.seeHistory.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch2() {
+      if (this.seeHistory.getdataListParm.parammaps.inputDatetime !== '' && this.seeHistory.getdataListParm.parammaps.inputDatetime !== null) {
+        this.seeHistory.getdataListParm.parammaps.time1 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.seeHistory.getdataListParm.parammaps.time2 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+        this.seeHistory.getdataListParm.parammaps.time1 = ''
+        this.seeHistory.getdataListParm.parammaps.time2 = ''
+      }
+      this.seeHistory.getdataListParm.offset = 1
+      this.getSeeHistoryList()
+    },
+    handleRefresh2() {
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.getSeeHistoryList()
+    }
+  }
+}
+</script>
+
+<style  lang="scss" scoped>
+ .search{margin-bottom: 10px;}
+</style>

+ 65 - 10
src/views/shedProduction/fecalScreen/index.vue

@@ -24,7 +24,8 @@
           <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-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
     </div>
     <div class="table">
       <el-table
@@ -198,6 +199,29 @@
           <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
         </div>
       </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -286,10 +310,16 @@ export default {
       },
       textMap: {
         create: '新增',
-        update: '编辑'
+        update: '编辑',
+        historyRecord: '历史记录'
       },
-
-      requestParam: {},
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
       download: {
         getdataListParm: {
           name: 'getDungsieveList',
@@ -520,9 +550,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
               const checkStr = new RegExp('Duplicate entry :pbto')
               if (checkStr.test(response.data)) {
@@ -534,6 +562,25 @@ export default {
           })
         }
       })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertDungHistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.create.temp.species = 'fps'
+      this.create.temp.fourrate = ''
+      this.create.temp.fourweight = ''
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
     },
     createDataAgain() {
       console.log('点击了新增保存')
@@ -560,7 +607,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.saveData()
               this.resetTemp()
               this.getList()
               this.getNoteTakerList()
@@ -608,8 +655,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
+              this.saveData()
               this.getList()
             } else {
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
@@ -805,6 +851,15 @@ export default {
           }
         })
       )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
     }
 
   }

+ 311 - 0
src/views/shedProduction/formulaDryMatter/historyRecord.vue

@@ -0,0 +1,311 @@
+<template>
+  <div class="app-table">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.changeTime" class="filter-item" type="date" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="年/月/日" />
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :span-method="objectSpanMethod"
+      >
+        <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+        <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" />
+        <el-table-column :key="3" label="班次" prop="time1" min-width="90px" align="center" />
+        <el-table-column :key="4" label="鲜重重量(g)" prop="freshweight" min-width="90px" align="center" />
+        <el-table-column :key="5" label="烘干重量(g)" prop="dryweight" min-width="90px" align="center" />
+        <el-table-column :key="6" label="理论干物质" prop="thoweight" min-width="90px" align="center" />
+        <el-table-column :key="7" label="实际干物质" prop="actweight" min-width="90px" align="center" />
+        <el-table-column :key="8" label="操作" prop="operation" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <a class="correcting" @click="handleSeeHistory (row)">{{ row.operation }}</a>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination2 v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+    <el-dialog :visible.sync="seeHistory.dialogFormVisible" append-to-body :title="textMap[seeHistory.dialogStatus]" :close-on-click-modal="false" width="90%">
+      <div class="seeHistory">
+        <div class="search">
+          <el-date-picker v-model="seeHistory.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="seeHistory.tableKey"
+            v-loading="seeHistory.listLoading"
+            element-loading-text="给我一点时间"
+            :data="seeHistory.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :span-method="objectSpanMethod2"
+          >
+            <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+            <el-table-column :key="2" label="修改时间" prop="changeTime1" min-width="90px" align="center" />
+            <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" />
+            <el-table-column :key="4" label="鲜重重量(g)" prop="times" min-width="90px" align="center" />
+            <el-table-column :key="5" label="烘干重量(g)" prop="times" min-width="90px" align="center" />
+            <el-table-column :key="6" label="理论干物质" prop="times" min-width="90px" align="center" />
+            <el-table-column :key="7" label="实际干物质" prop="times" min-width="90px" align="center" />
+
+          </el-table>
+          <pagination2 v-show="seeHistory.total>0" :total="seeHistory.total" :page.sync="seeHistory.getdataListParm.offset" :limit.sync="seeHistory.getdataListParm.pagecount" @pagination="getSeeHistoryList" />
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="seeHistory.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName } from '@/api/common'
+import draggable from 'vuedraggable'
+import Cookies from 'js-cookie'
+import { parseTime, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
+import Pagination2 from '@/components/Pagination2'
+export default {
+  name: 'MaterialIssuancePlan',
+  display: 'Two list header slot',
+  order: 14,
+  components: { Pagination2 },
+  data() {
+    return {
+      table: {
+        getdataListParm: {
+          name: 'getFtdryHistory',
+          page: 1,
+          offset: 1,
+          pagecount: 12,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            changeTime: ''
+          }
+        },
+        list: [],
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        temp: {},
+        changeList: [],
+        startObj: {}
+      },
+      spanObj: {},
+      mergekeys: ['barname', 'operation'],
+      textMap: {
+        seeHistory: '配方干物质修改记录'
+      },
+      seeHistory: {
+        dialogFormVisible: false, dialogStatus: '',
+        total: 0, tableKey: 0, listLoading: false,
+        getdataListParm: {
+          name: 'getFtdryHistoryBar', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            inputDatetime: '',
+            time1: '',
+            time2: ''
+          }
+        }
+      },
+      spanObj2: {},
+      mergekeys2: ['changeTime1'],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    changeDate() {
+      this.getList()
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.handleSpan()
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSpan() {
+      this.mergekeys.forEach(key => {
+        this.spanObj[key] = []
+        let position = 0
+        this.table.list.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj[key].push(1)
+            position = 0
+          } else {
+            if (key == 'operation') {
+              if (this.table.list[index][key] === this.table.list[index - 1][key] && this.table.list[index]['barname'] === this.table.list[index - 1]['barname']) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.table.list[index][key] === this.table.list[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]) {
+          const _row = this.spanObj[this.mergekeys[i]][rowIndex]
+          const _col = _row > 0 ? 1 : 0
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
+    },
+    handleSearch() {
+      if (this.table.getdataListParm.parammaps.changeTime == '') {
+        this.table.getdataListParm.parammaps.changeTime = ''
+      } else {
+        this.table.getdataListParm.parammaps.changeTime = parseTime(this.table.getdataListParm.parammaps.changeTime, '{y}-{m}-{d}')
+      }
+      this.getList()
+    },
+    handleRefresh() {
+      this.table.getdataListParm.parammaps.changeTime = ''
+      this.getList()
+    },
+    handleSeeHistory(row) {
+      console.log(row)
+      this.textMap.seeHistory = '配方干物质修改记录——栏舍:' + row.barname
+      this.seeHistory.dialogFormVisible = true
+      this.seeHistory.dialogStatus = 'seeHistory'
+      this.seeHistory.getdataListParm.parammaps.barid = row.barids
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.getSeeHistoryList()
+    },
+    getSeeHistoryList() {
+      this.seeHistory.listLoading = true
+      GetDataByName(this.seeHistory.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.seeHistory.list = response.data.list
+          this.handleSpan2()
+          this.seeHistory.pageNum = response.data.pageNum
+          this.seeHistory.pageSize = response.data.pageSize
+          this.seeHistory.total = response.data.total
+        } else {
+          this.seeHistory.list = []
+        }
+        setTimeout(() => {
+          this.seeHistory.listLoading = false
+        }, 100)
+      })
+    },
+    handleSpan2() {
+      this.mergekeys2.forEach(key => {
+        this.spanObj2[key] = []
+        let position = 0
+        this.seeHistory.list.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj2[key].push(1)
+            position = 0
+          } else {
+            if (key == 'operation') {
+              if (this.seeHistory.list[index][key] === this.seeHistory.list[index - 1][key] && this.seeHistory.list[index]['barname'] === this.seeHistory.list[index - 1]['barname']) {
+                this.spanObj2[key][position] += 1
+                this.spanObj2[key].push(0)
+              } else {
+                this.spanObj2[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.seeHistory.list[index][key] === this.seeHistory.list[index - 1][key]) {
+                this.spanObj2[key][position] += 1
+                this.spanObj2[key].push(0)
+              } else {
+                this.spanObj2[key].push(1)
+                position = index
+              }
+            }
+          }
+        })
+      })
+    },
+    objectSpanMethod2({ row, column, rowIndex, columnIndex }) {
+      for (let i = 0; i < this.mergekeys2.length; i++) {
+        if (column.property === this.mergekeys2[i]) {
+          const _row = this.spanObj2[this.mergekeys2[i]][rowIndex]
+          const _col = _row > 0 ? 1 : 0
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
+    },
+    handleSearch2() {
+      if (this.seeHistory.getdataListParm.parammaps.inputDatetime !== '' && this.seeHistory.getdataListParm.parammaps.inputDatetime !== null) {
+        this.seeHistory.getdataListParm.parammaps.time1 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.seeHistory.getdataListParm.parammaps.time2 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+        this.seeHistory.getdataListParm.parammaps.time1 = ''
+        this.seeHistory.getdataListParm.parammaps.time2 = ''
+      }
+      this.seeHistory.getdataListParm.offset = 1
+      this.getSeeHistoryList()
+    },
+    handleRefresh2() {
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.getSeeHistoryList()
+    }
+  }
+}
+</script>
+
+<style  lang="scss" scoped>
+ .search{margin-bottom: 10px;}
+</style>

+ 62 - 10
src/views/shedProduction/formulaDryMatter/index.vue

@@ -26,7 +26,8 @@
           <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-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
     </div>
     <div class="table">
       <el-table
@@ -182,6 +183,29 @@
           <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
         </div>
       </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -270,10 +294,16 @@ export default {
       },
       textMap: {
         create: '新增',
-        update: '编辑'
+        update: '编辑',
+        historyRecord: '历史记录'
       },
-
-      requestParam: {},
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
+      },
+      requestParam: {},
+      requestParam2: {},
       download: {
         getdataListParm: {
           name: 'getFtdryList',
@@ -504,9 +534,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
               const barid = new RegExp("key 'barid'")
               if (barid.test(response.data)) {
@@ -518,6 +546,22 @@ export default {
           })
         }
       })
+    },
+    saveData() {
+      this.requestParam2.name = 'insertFtdryHistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
     },
     createDataAgain() {
       console.log('点击了新增保存')
@@ -549,7 +593,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.saveData()
               this.resetTemp()
               this.getList()
               this.getNoteTakerList()
@@ -607,8 +651,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
+              this.saveData()
               this.getList()
             } else {
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
@@ -805,6 +848,15 @@ export default {
           }
         })
       )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
     }
 
   }

+ 334 - 0
src/views/shedProduction/pennsylvaniaSieve/historyRecord.vue

@@ -0,0 +1,334 @@
+<template>
+  <div class="app-table">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.operatetime" class="filter-item" type="date" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="年/月/日" />
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :span-method="objectSpanMethod"
+      >
+        <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+        <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" />
+        <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" />
+        <el-table-column :key="4" label="第一层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="onerate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="oneweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="5" label="第二层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="tworate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="twoweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="6" label="第三层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="threerate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="threeweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="7" label="第四层" min-width="90px" align="center">
+          <el-table-column label="比例 (%)" prop="fourrate" min-width="90px" align="center" />
+          <el-table-column label="重量 (g)" prop="fourweight" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="8" label="操作" prop="operation" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <a class="correcting" @click="handleSeeHistory (row)">{{ row.operation }}</a>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination2 v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+    <el-dialog :visible.sync="seeHistory.dialogFormVisible" append-to-body :title="textMap[seeHistory.dialogStatus]" :close-on-click-modal="false" width="90%">
+      <div class="seeHistory">
+        <div class="search">
+          <el-date-picker v-model="seeHistory.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="seeHistory.tableKey"
+            v-loading="seeHistory.listLoading"
+            element-loading-text="给我一点时间"
+            :data="seeHistory.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :span-method="objectSpanMethod2"
+          >
+            <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+            <el-table-column :key="2" label="修改时间" prop="operatetime1" min-width="90px" align="center" />
+            <el-table-column :key="3" label="班次" prop="times" min-width="90px" align="center" />
+            <el-table-column :key="4" label="第一层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="onerate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="oneweight" min-width="90px" align="center" />
+            </el-table-column>
+            <el-table-column :key="5" label="第二层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="tworate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="twoweight" min-width="90px" align="center" />
+            </el-table-column>
+            <el-table-column :key="6" label="第三层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="threerate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="threeweight" min-width="90px" align="center" />
+            </el-table-column>
+            <el-table-column :key="7" label="第四层" min-width="90px" align="center">
+              <el-table-column label="比例 (%)" prop="fourrate" min-width="90px" align="center" />
+              <el-table-column label="重量 (g)" prop="fourweight" min-width="90px" align="center" />
+            </el-table-column>
+          </el-table>
+          <pagination2 v-show="seeHistory.total>0" :total="seeHistory.total" :page.sync="seeHistory.getdataListParm.offset" :limit.sync="seeHistory.getdataListParm.pagecount" @pagination="getSeeHistoryList" />
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="seeHistory.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName } from '@/api/common'
+import draggable from 'vuedraggable'
+import Cookies from 'js-cookie'
+import { parseTime, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
+import Pagination2 from '@/components/Pagination2'
+export default {
+  name: 'MaterialIssuancePlan',
+  display: 'Two list header slot',
+  order: 14,
+  components: { Pagination2 },
+  data() {
+    return {
+      table: {
+        getdataListParm: {
+          name: 'getPennsieveHistory',
+          page: 1,
+          offset: 1,
+          pagecount: 12,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            operatetime: ''
+          }
+        },
+        list: [],
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        temp: {},
+        changeList: [],
+        startObj: {}
+      },
+      spanObj: {},
+      mergekeys: ['barname', 'operation'],
+      textMap: {
+        seeHistory: '宾州筛修改记录'
+      },
+      seeHistory: {
+        dialogFormVisible: false, dialogStatus: '',
+        total: 0, tableKey: 0, listLoading: false,
+        getdataListParm: {
+          name: 'getPennsieveHistoryBar', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            inputDatetime: '',
+            time1: '',
+            time2: ''
+          }
+        }
+      },
+      spanObj2: {},
+      mergekeys2: ['operatetime1'],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    changeDate() {
+      this.getList()
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.handleSpan()
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSpan() {
+      this.mergekeys.forEach(key => {
+        this.spanObj[key] = []
+        let position = 0
+        this.table.list.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj[key].push(1)
+            position = 0
+          } else {
+            if (key == 'operation') {
+              if (this.table.list[index][key] === this.table.list[index - 1][key] && this.table.list[index]['barname'] === this.table.list[index - 1]['barname']) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.table.list[index][key] === this.table.list[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]) {
+          const _row = this.spanObj[this.mergekeys[i]][rowIndex]
+          const _col = _row > 0 ? 1 : 0
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
+    },
+    handleSearch() {
+      if (this.table.getdataListParm.parammaps.operatetime == '') {
+        this.table.getdataListParm.parammaps.operatetime = ''
+      } else {
+        this.table.getdataListParm.parammaps.operatetime = parseTime(this.table.getdataListParm.parammaps.operatetime, '{y}-{m}-{d}')
+      }
+      this.getList()
+    },
+    handleRefresh() {
+      this.table.getdataListParm.parammaps.operatetime = ''
+      this.getList()
+    },
+    handleSeeHistory(row) {
+      console.log(row)
+      this.textMap.seeHistory = '宾州筛修改记录——栏舍:' + row.barname
+      this.seeHistory.dialogFormVisible = true
+      this.seeHistory.dialogStatus = 'seeHistory'
+      this.seeHistory.getdataListParm.parammaps.barid = row.barids
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.getSeeHistoryList()
+    },
+    getSeeHistoryList() {
+      this.seeHistory.listLoading = true
+      GetDataByName(this.seeHistory.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.seeHistory.list = response.data.list
+          this.handleSpan2()
+          this.seeHistory.pageNum = response.data.pageNum
+          this.seeHistory.pageSize = response.data.pageSize
+          this.seeHistory.total = response.data.total
+        } else {
+          this.seeHistory.list = []
+        }
+        setTimeout(() => {
+          this.seeHistory.listLoading = false
+        }, 100)
+      })
+    },
+    handleSpan2() {
+      this.mergekeys2.forEach(key => {
+        this.spanObj2[key] = []
+        let position = 0
+        this.seeHistory.list.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj2[key].push(1)
+            position = 0
+          } else {
+            if (key == 'operation') {
+              if (this.seeHistory.list[index][key] === this.seeHistory.list[index - 1][key] && this.seeHistory.list[index]['barname'] === this.seeHistory.list[index - 1]['barname']) {
+                this.spanObj2[key][position] += 1
+                this.spanObj2[key].push(0)
+              } else {
+                this.spanObj2[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.seeHistory.list[index][key] === this.seeHistory.list[index - 1][key]) {
+                this.spanObj2[key][position] += 1
+                this.spanObj2[key].push(0)
+              } else {
+                this.spanObj2[key].push(1)
+                position = index
+              }
+            }
+          }
+        })
+      })
+    },
+    objectSpanMethod2({ row, column, rowIndex, columnIndex }) {
+      for (let i = 0; i < this.mergekeys2.length; i++) {
+        if (column.property === this.mergekeys2[i]) {
+          const _row = this.spanObj2[this.mergekeys2[i]][rowIndex]
+          const _col = _row > 0 ? 1 : 0
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
+    },
+    handleSearch2() {
+      if (this.seeHistory.getdataListParm.parammaps.inputDatetime !== '' && this.seeHistory.getdataListParm.parammaps.inputDatetime !== null) {
+        this.seeHistory.getdataListParm.parammaps.time1 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.seeHistory.getdataListParm.parammaps.time2 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+        this.seeHistory.getdataListParm.parammaps.time1 = ''
+        this.seeHistory.getdataListParm.parammaps.time2 = ''
+      }
+      this.seeHistory.getdataListParm.offset = 1
+      this.getSeeHistoryList()
+    },
+    handleRefresh2() {
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.getSeeHistoryList()
+    }
+  }
+}
+</script>
+
+<style  lang="scss" scoped>
+ .search{margin-bottom: 10px;}
+</style>

+ 61 - 9
src/views/shedProduction/pennsylvaniaSieve/index.vue

@@ -26,7 +26,8 @@
           <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-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
     </div>
     <div class="table">
       <el-table
@@ -227,6 +228,29 @@
           <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="save" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
         </div>
       </div>
+    </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -317,10 +341,16 @@ export default {
       },
       textMap: {
         create: '新增',
-        update: '编辑'
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
       },
-
       requestParam: {},
+      requestParam2: {},
       download: {
         getdataListParm: {
           name: 'getPennsieveList',
@@ -558,9 +588,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
               const checkStr = new RegExp('Duplicate entry :btop')
               if (checkStr.test(response.data)) {
@@ -573,6 +601,22 @@ export default {
         }
       })
     },
+    saveData() {
+      this.requestParam2.name = 'insertPennsieveHistory'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
     createDataAgain() {
       console.log('点击了新增保存')
       this.isokDisable = true
@@ -598,7 +642,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.saveData()
               this.resetTemp()
               this.getList()
               this.getNoteTakerList()
@@ -656,8 +700,7 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
+              this.saveData()
               this.getList()
             } else {
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
@@ -853,6 +896,15 @@ export default {
           }
         })
       )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
     }
 
   }

+ 228 - 0
src/views/shedProduction/physicalConditionScore/historyRecord.vue

@@ -0,0 +1,228 @@
+<template>
+  <div class="app-table">
+    <div class="search">
+      <el-date-picker v-model="table.getdataListParm.parammaps.changetime" class="filter-item" type="date" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="年/月/日" />
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+      >
+        <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+        <el-table-column :key="2" label="栏舍名称" prop="barname" min-width="90px" align="center" />
+        <el-table-column :key="3" label="标准分数(分)" prop="standardscore" min-width="90px" align="center" />
+        <el-table-column :key="4" label="牛头数(分)" prop="cowsum" min-width="90px" align="center" />
+        <el-table-column :key="5" label="评分" min-width="90px" align="center">
+          <el-table-column label="1分 (头)" prop="onescore" min-width="90px" align="center" />
+          <el-table-column label="2分(头)" prop="twoscore" min-width="90px" align="center" />
+          <el-table-column label="3分(头)" prop="threescore" min-width="90px" align="center" />
+          <el-table-column label="4分(头)" prop="fourscore" min-width="90px" align="center" />
+          <el-table-column label="5分(头)" prop="fivescore" min-width="90px" align="center" />
+        </el-table-column>
+        <el-table-column :key="6" label="操作" prop="operation" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <a class="correcting" @click="handleSeeHistory (row)">{{ row.operation }}</a>
+          </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 :visible.sync="seeHistory.dialogFormVisible" append-to-body :title="textMap[seeHistory.dialogStatus]" :close-on-click-modal="false" width="90%">
+      <div class="seeHistory">
+        <div class="search">
+          <el-date-picker v-model="seeHistory.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+          <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
+        </div>
+        <div class="table">
+          <el-table
+            :key="seeHistory.tableKey"
+            v-loading="seeHistory.listLoading"
+            element-loading-text="给我一点时间"
+            :data="seeHistory.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+          >
+            <el-table-column :key="1" label="序号" prop="sort" align="center" width="50px" />
+            <el-table-column :key="2" label="修改时间" prop="changetime1" min-width="90px" align="center" />
+            <el-table-column :key="3" label="标准分数(分)" prop="standardscore" min-width="90px" align="center" />
+            <el-table-column :key="4" label="牛头数(分)" prop="cowsum" min-width="90px" align="center" />
+            <el-table-column :key="5" label="评分" min-width="90px" align="center">
+              <el-table-column label="1分 (头)" prop="onescore" min-width="90px" align="center" />
+              <el-table-column label="2分(头)" prop="twoscore" min-width="90px" align="center" />
+              <el-table-column label="3分(头)" prop="threescore" min-width="90px" align="center" />
+              <el-table-column label="4分(头)" prop="fourscore" min-width="90px" align="center" />
+              <el-table-column label="5分(头)" prop="fivescore" min-width="90px" align="center" />
+            </el-table-column>
+          </el-table>
+          <Pagination v-show="seeHistory.total>0" :total="seeHistory.total" :page.sync="seeHistory.getdataListParm.offset" :limit.sync="seeHistory.getdataListParm.pagecount" @pagination="getSeeHistoryList" />
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="seeHistory.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName } from '@/api/common'
+import draggable from 'vuedraggable'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'MaterialIssuancePlan',
+  display: 'Two list header slot',
+  order: 14,
+  components: { Pagination },
+  data() {
+    return {
+      table: {
+        getdataListParm: {
+          name: 'getDungandbodyhistory',
+          page: 1,
+          offset: 1,
+          pagecount: 12,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            changetime: '',
+            species: 'tkpf'
+          }
+        },
+        list: [],
+        total: 0,
+        tableKey: 0,
+        listLoading: false,
+        temp: {},
+        changeList: [],
+        startObj: {}
+      },
+
+      textMap: {
+        seeHistory: '体况评分修改记录'
+      },
+      seeHistory: {
+        dialogFormVisible: false, dialogStatus: '',
+        total: 0, tableKey: 0, listLoading: false,
+        getdataListParm: {
+          name: 'getDungandbodyhistoryBar', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            inputDatetime: '',
+            time1: '',
+            time2: ''
+          }
+        }
+      },
+
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    changeDate() {
+      this.getList()
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    handleSearch() {
+      this.table.getdataListParm.parammaps.changetime = parseTime(this.table.getdataListParm.parammaps.changetime, '{y}-{m}-{d}')
+      this.getList()
+    },
+    handleRefresh() {
+      this.table.getdataListParm.parammaps.changetime = ''
+      this.getList()
+    },
+    handleSeeHistory(row) {
+      console.log(row)
+      this.textMap.seeHistory = '体况评分修改记录——栏舍:' + row.barname
+      this.seeHistory.dialogFormVisible = true
+      this.seeHistory.dialogStatus = 'seeHistory'
+
+      this.seeHistory.getdataListParm.parammaps.species = 'tkpf'
+      this.seeHistory.getdataListParm.parammaps.barid = row.barids
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.getSeeHistoryList()
+    },
+    getSeeHistoryList() {
+      this.seeHistory.listLoading = true
+      GetDataByName(this.seeHistory.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.seeHistory.list = response.data.list
+          this.seeHistory.pageNum = response.data.pageNum
+          this.seeHistory.pageSize = response.data.pageSize
+          this.seeHistory.total = response.data.total
+        } else {
+          this.seeHistory.list = []
+        }
+        setTimeout(() => {
+          this.seeHistory.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch2() {
+      if (this.seeHistory.getdataListParm.parammaps.inputDatetime !== '' && this.seeHistory.getdataListParm.parammaps.inputDatetime !== null) {
+        this.seeHistory.getdataListParm.parammaps.time1 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.seeHistory.getdataListParm.parammaps.time2 = parseTime(this.seeHistory.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+        this.seeHistory.getdataListParm.parammaps.time1 = ''
+        this.seeHistory.getdataListParm.parammaps.time2 = ''
+      }
+      this.seeHistory.getdataListParm.offset = 1
+      this.getSeeHistoryList()
+    },
+    handleRefresh2() {
+      this.seeHistory.getdataListParm.parammaps.time1 = ''
+      this.seeHistory.getdataListParm.parammaps.time2 = ''
+      this.seeHistory.getdataListParm.parammaps.inputDatetime = ''
+      this.getSeeHistoryList()
+    }
+  }
+}
+</script>
+
+<style  lang="scss" scoped>
+ .search{margin-bottom: 10px;}
+</style>

+ 103 - 29
src/views/shedProduction/physicalConditionScore/index.vue

@@ -24,6 +24,7 @@
           <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">历史记录</el-button>
     </div>
     <div class="table">
       <el-table
@@ -116,7 +117,7 @@
         <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <el-button v-if="isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
-            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
           </template>
         </el-table-column>
@@ -126,18 +127,18 @@
 
     <!-- 新增/编辑 -->
     <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ textMap[create.dialogStatus] }}
-          </span>
-          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
-            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
-            <svg-icon v-else icon-class="fullscreen" />
-          </div>
-        </div>
-      </template>
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[create.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
       <div class="app-add">
         <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 100%;margin:0 auto 50px">
           <el-row>
@@ -247,6 +248,29 @@
         </div>
       </div>
     </el-dialog>
+    <!-- 历史记录 -->
+    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[historyRecord.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="historyRecord">
+        <keep-alive>
+          <component :is="historyRecord.myComponent" ref="historyRecord" />
+        </keep-alive>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -262,7 +286,7 @@ export default {
   name: 'PhysicalConditionScore',
   components: { Pagination },
   data() {
-    return {
+    return {
       dialogFull: false,
       isRoleEdit: [],
       requestParams: [
@@ -339,10 +363,16 @@ export default {
       },
       textMap: {
         create: '新增',
-        update: '编辑'
+        update: '编辑',
+        historyRecord: '历史记录'
+      },
+      historyRecord: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        myComponent: null
       },
-
       requestParam: {},
+      requestParam2: {},
       download: {
         getdataListParm: {
           name: 'getBodyscoreList',
@@ -543,7 +573,7 @@ export default {
     handleCreate() {
       console.log('点击了新增')
       this.resetTemp()
-      this.getNoteTakerList()
+      this.getNoteTakerList()
       this.dialogFull = false
       this.create.dialogStatus = 'create'
       this.create.dialogFormVisible = true
@@ -573,16 +603,38 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
             }
           })
         }
       })
     },
+    saveData() {
+      this.requestParam2.name = 'insertDungandbodyhistory2'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.changetime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+      this.create.temp.species = 'tkpf'
+      this.create.temp.fourrate = ''
+      this.create.temp.fourweight = ''
+      this.requestParam2.parammaps = this.create.temp
+      PostDataByName(this.requestParam2).then(response => {
+        console.log('新增保存发送参数', this.requestParam1)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
     createDataAgain() {
       console.log('点击了新增保存')
       this.isokDisable = true
@@ -608,12 +660,17 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.saveData()
               this.resetTemp()
               this.getList()
               this.getNoteTakerList()
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
             }
           })
         }
@@ -634,7 +691,7 @@ export default {
       this.create.temp = Object.assign({}, row)
       this.create.temp.id = row.id
 
-      this.getNoteTakerList()
+      this.getNoteTakerList()
       this.dialogFull = false
       this.create.dialogStatus = 'update'
       this.create.dialogFormVisible = true
@@ -663,11 +720,14 @@ export default {
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
+              this.saveData()
             } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ type: 'error', message: '同一栏舍不可重复录入', duration: 2000 })
+              } else {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              }
             }
           })
         }
@@ -745,7 +805,12 @@ export default {
           this.requestParam.parammaps.id = this.selectList[0].id
           PostDataByName(this.requestParam).then(response => {
             if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              const isRepeat = new RegExp('Duplicate entry :ds')
+              if (isRepeat.test(response.data)) {
+                this.$notify({ 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.getList()
@@ -859,6 +924,15 @@ export default {
           }
         })
       )
+    },
+    handleHistoryRecord() {
+      console.log('点击历史记录')
+      this.dialogFull = false
+      this.historyRecord.dialogStatus = 'historyRecord'
+      this.historyRecord.dialogFormVisible = true
+      const vue = this
+      var myComponent = () => import('./historyRecord.vue')
+      return vue.historyRecord.myComponent = myComponent
     }
 
   }

+ 184 - 184
src/views/statisticalAnalysis/equipmentRunningTrack/index.vue

@@ -1,38 +1,38 @@
-<template>
-  <div class="app-container">
-    <!-- <h1>牧场</h1> -->
-    <div class="search">
+<template>
+  <div class="app-container">
+    <!-- <h1>牧场</h1> -->
+    <div class="search">
       <el-date-picker v-model="table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" />
-      <el-select v-model="table.getdataListParm.parammaps.lpplantype" placeholder="设备类型" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in equipmentTypeList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
-    <el-row :gutter="20">
-      <el-col :span="8">
-        <h4>设备列表</h4>
-        <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"
-            :height="table1Height"
-            @row-click="rowClick1"
-          >
-            <el-table-column label="设备类型" min-width="90px" align="center" prop="field1" />
-            <el-table-column label="设备名称" min-width="80px" align="center" prop="field2" />
-            <el-table-column label="GPS设备名称" min-width="90px" align="center" prop="field3" />
-            <el-table-column label="总时长(分钟)" min-width="100px" align="center" prop="field4" />
-          </el-table>
+      <el-select v-model="table.getdataListParm.parammaps.lpplantype" placeholder="设备类型" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in equipmentTypeList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+    </div>
+    <el-row :gutter="20">
+      <el-col :span="8">
+        <h4>设备列表</h4>
+        <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"
+            :height="table1Height"
+            @row-click="rowClick1"
+          >
+            <el-table-column label="设备类型" min-width="90px" align="center" prop="field1" />
+            <el-table-column label="设备名称" min-width="80px" align="center" prop="field2" />
+            <el-table-column label="GPS设备名称" min-width="90px" align="center" prop="field3" />
+            <el-table-column label="总时长(分钟)" min-width="100px" align="center" prop="field4" />
+          </el-table>
         </div>
         <h4>设备详情</h4>
         <div class="table">
@@ -56,50 +56,50 @@
             <el-table-column label="结束时间" min-width="90px" align="center" prop="field3" />
             <el-table-column label="时长(分钟)" min-width="100px" align="center" prop="field4" />
           </el-table>
-        </div>
-      </el-col>
+        </div>
+      </el-col>
       <el-col :span="16" class="map">
         <h4>设备轨迹图</h4>
         <div v-if="isShow" style="text-align: center;line-height: 400px;">设备轨迹图加载失败,请刷新加载设备轨迹图</div>
-        <div v-else id="yzMap" style="min-height: 400px;" />
-      </el-col>
-    </el-row>
-
-  </div>
-
-</template>
+        <div v-else id="yzMap" style="min-height: 400px;" />
+      </el-col>
+    </el-row>
+
+  </div>
 
-<script>
-import MapInit from '@/components/show/MapInit.js'
-import { GetDataByName } from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime } from '@/utils/index.js'
-export default {
-  name: 'EquipmentRunningTrack',
-  data() {
+</template>
+
+<script>
+import MapInit from '@/components/show/MapInit.js'
+import { GetDataByName } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+export default {
+  name: 'EquipmentRunningTrack',
+  data() {
     return {
       equipmentTypeList: [{ id: 0, name: '自走式TMR' }, { id: 1, name: '撒料设备TMR' }, { id: 2, name: '铲车' }, { id: 3, name: '推料车' }, { id: 4, name: '推粪车' }],
-      // TMR设备列表
-      table: {
-        getdataListParm: {
-          name: 'getprocessAnalysis',
-          page: 1,
-          offset: 1,
-          pagecount: '',
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            date: parseTime(new Date(), '{y}-{m}-{d}'),
-            iscompleted: '',
-            tmrtname: '',
-            lpplantype: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
+      // TMR设备列表
+      table: {
+        getdataListParm: {
+          name: 'getprocessAnalysis',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            date: parseTime(new Date(), '{y}-{m}-{d}'),
+            iscompleted: '',
+            tmrtname: '',
+            lpplantype: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true
+      },
       table2: {
         getdataListParm: {
           name: 'getprocessAnalysisStr',
@@ -140,52 +140,52 @@ export default {
         total: 0,
         listLoading: true
       },
-      table1Height: (document.documentElement.clientHeight - 85 - 250) / 2,
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      table1Height: (document.documentElement.clientHeight - 85 - 250) / 2,
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       map: '', drivingRoute: '',
       zoom: 16.5,
       startIcon: 'http://lbs.tianditu.gov.cn/images/bus/start.png',	// 起点图标
       endIcon: 'http://lbs.tianditu.gov.cn/images/bus/end.png', // 终点图标
       line: null,
-      points: [],
-      isShow: false
-    }
-  },
-  created() {
+      points: [],
+      isShow: false
+    }
+  },
+  created() {
     this.getList()
-    console.log(document.documentElement.clientHeight - 85 - 250)
-  },
-  methods: {
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('TMR设备列表table数据', response.data.list)
-        // if (response.data.list !== null) {
-        //   this.table.list = response.data.list
-        // } else {
-        //   this.table.list = []
+    console.log(document.documentElement.clientHeight - 85 - 250)
+  },
+  methods: {
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('TMR设备列表table数据', response.data.list)
+        // if (response.data.list !== null) {
+        //   this.table.list = response.data.list
+        // } else {
+        //   this.table.list = []
         // }
         this.table.list = [
           { 'field1': '自走式TMR', 'field2': '1', 'field3': '自走式GPS', 'field4': '100', 'id': '1' },
           { 'field1': '铲车', 'field2': '1号铲车', 'field3': '铲车GPS', 'field4': '60', 'id': '2' }
         ]
         this.table2.getdataListParm.parammaps.id = this.table.list[0].id
-        this.getList2()
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleSearch() {
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
+        this.getList2()
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleSearch() {
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
     rowClick1(row, column, event) {
       if (row.id == '1') {
         this.table2.getdataListParm.parammaps.id = '1'
@@ -193,16 +193,16 @@ export default {
         this.table2.getdataListParm.parammaps.id = '2'
       }
       this.getList2()
-    },
-
-    getList2() {
-      this.table2.listLoading = false
-      GetDataByName(this.table2.getdataListParm).then(response => {
-        console.log('过程详情table数据', response.data.list)
-        // if (response.data.list !== null) {
-        //   this.table2.list = response.data.list
-        // } else {
-        //   this.table2.list = []
+    },
+
+    getList2() {
+      this.table2.listLoading = false
+      GetDataByName(this.table2.getdataListParm).then(response => {
+        console.log('过程详情table数据', response.data.list)
+        // if (response.data.list !== null) {
+        //   this.table2.list = response.data.list
+        // } else {
+        //   this.table2.list = []
         // }
         if (this.table2.getdataListParm.parammaps.id == '1') {
           this.table2.list = [
@@ -216,10 +216,10 @@ export default {
         }
         this.table3.getdataListParm.parammaps.id = this.table2.list[0].id
         this.getList3()
-        setTimeout(() => {
-          this.table2.listLoading = false
-        }, 100)
-      })
+        setTimeout(() => {
+          this.table2.listLoading = false
+        }, 100)
+      })
     },
     rowClick2(row, column, event) {
       if (row.id == '1') {
@@ -296,7 +296,7 @@ export default {
           { 'longitude': 117.8813614, 'latitude': 33.8237577 },
           { 'longitude': 117.8816353, 'latitude': 33.8237002 },
           { 'longitude': 117.8820108, 'latitude': 33.8236552 },
-          { 'longitude': 117.8821708, 'latitude': 33.8237152 },
+          { 'longitude': 117.8821708, 'latitude': 33.8237152 },
           { 'longitude': 117.8822708, 'latitude': 33.8236152 },
           { 'longitude': 117.8824708, 'latitude': 33.8236152 },
           { 'longitude': 117.8825531, 'latitude': 33.8235588 },
@@ -305,44 +305,44 @@ export default {
         // this.table3.startLngLatMap = [117.754060, 33.505650]
         // this.table3.endLngLatMap = [117.728130, 33.603550]
       }
-      // this.getList3()
-      MapInit.init().then(
-        T => {
-          this.isShow = false
-          this.T = T
-          this.map = new T.Map('yzMap', config) // /初始化地图对象
-          const ctrl = new T.Control.MapType()
-          this.map.addControl(ctrl)
-          this.map.centerAndZoom(new T.LngLat(this.table3.initializationMap[0], this.table3.initializationMap[1]), this.zoom) // 初始化
-          var config = {
-            policy: 0	// 驾车策略
-            // onSearchComplete: this.searchResult	// 检索完成后的回调函数
-          }
-
-          console.log(this.map, '=========this.map')
-          // var map = this.map
-          // this.map.disableDrag()
-          // setTimeout(() => {
-          //   alert('可以拖拽地图了')
-          //   this.map.enableDrag()
-          // }, 2000)
-          this.map.setMapType(TMAP_HYBRID_MAP)
-          this.points = []
-          for (let i = 0; i < this.table3.pointsList.length; i++) {
-            this.points.push(new T.LngLat(this.table3.pointsList[i].longitude, this.table3.pointsList[i].latitude))
-          }
-          // 创建线对象
-          this.line = new T.Polyline(this.points, {
-            color: 'red'
-          })
-          // 向地图上添加线
-          this.map.addOverLay(this.line)
-          // this.drivingRoute = new T.DrivingRoute(this.map, config)
-          // this.searchDrivingRoute()
-          // this.map.enableInertia()
-        }).catch(error => {
-        console.log(error, '666')
-        this.isShow = true
+      // this.getList3()
+      MapInit.init().then(
+        T => {
+          this.isShow = false
+          this.T = T
+          this.map = new T.Map('yzMap', config) // /初始化地图对象
+          const ctrl = new T.Control.MapType()
+          this.map.addControl(ctrl)
+          this.map.centerAndZoom(new T.LngLat(this.table3.initializationMap[0], this.table3.initializationMap[1]), this.zoom) // 初始化
+          var config = {
+            policy: 0	// 驾车策略
+            // onSearchComplete: this.searchResult	// 检索完成后的回调函数
+          }
+
+          console.log(this.map, '=========this.map')
+          // var map = this.map
+          // this.map.disableDrag()
+          // setTimeout(() => {
+          //   alert('可以拖拽地图了')
+          //   this.map.enableDrag()
+          // }, 2000)
+          this.map.setMapType(TMAP_HYBRID_MAP)
+          this.points = []
+          for (let i = 0; i < this.table3.pointsList.length; i++) {
+            this.points.push(new T.LngLat(this.table3.pointsList[i].longitude, this.table3.pointsList[i].latitude))
+          }
+          // 创建线对象
+          this.line = new T.Polyline(this.points, {
+            color: 'red'
+          })
+          // 向地图上添加线
+          this.map.addOverLay(this.line)
+          // this.drivingRoute = new T.DrivingRoute(this.map, config)
+          // this.searchDrivingRoute()
+          // this.map.enableInertia()
+        }).catch(error => {
+        console.log(error, '666')
+        this.isShow = true
       })
     },
     getList3() {
@@ -440,7 +440,7 @@ export default {
 
     roadMap() {
       MapInit.init().then(
-        T => {
+        T => {
           this.isShow = false
           this.T = T
           this.map = new T.Map('yzMap', config) // /初始化地图对象
@@ -456,7 +456,7 @@ export default {
           this.map.disableDrag()
           // setTimeout(() => {
           //   alert('可以拖拽地图了')
-          //   this.map.enableDrag()
+          //   this.map.enableDrag()
           // }, 2000)
           this.map.setMapType(TMAP_HYBRID_MAP)
           this.points = []
@@ -465,8 +465,8 @@ export default {
           }
           // 创建线对象
           this.line = new T.Polyline(this.points, {
-            color: 'red'
-          })
+            color: 'red'
+          })
           // 向地图上添加线
           this.map.addOverLay(this.line)
           // this.drivingRoute = new T.DrivingRoute(this.map, config)
@@ -474,16 +474,16 @@ export default {
           // this.map.enableInertia()
           // console.log(JSON.stringify(this.map), '=========this.map')
         }).catch(error => {
-        console.log(error, '666')
+        console.log(error, '666')
         this.isShow = true
       })
-    },
-    getDistance(points) {
-      var r = 0
-      for (var k = 0; k < points.length - 1; k++) {
-        r += points[k].distanceTo(points[k + 1])
-      }
-      return r
+    },
+    getDistance(points) {
+      var r = 0
+      for (var k = 0; k < points.length - 1; k++) {
+        r += points[k].distanceTo(points[k + 1])
+      }
+      return r
     }
 
     // searchDrivingRoute() {
@@ -538,23 +538,23 @@ export default {
     //     that.createRoute(plan.getPath())
     //   }
     // }
-
-  }
-}
-
-</script>
-<style lang="scss" scoped>
-  .search{padding-top:10px;clear: both;}
-  .table{margin-top:10px;}
-  .detail{
-    height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
-    .detail-t{margin-top: 10px;}
-    .detail-b{margin-bottom: 10px;}
+
+  }
+}
+
+</script>
+<style lang="scss" scoped>
+  .search{padding-top:10px;clear: both;}
+  .table{margin-top:10px;}
+  .detail{
+    height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
+    .detail-t{margin-top: 10px;}
+    .detail-b{margin-bottom: 10px;}
   }
   .map{position: relative;min-height: 480px;}
    #yzMap {
     width: 95%;
     height: 100%;
     position: absolute;
-  }
-</style>
+  }
+</style>

+ 28 - 18
src/views/statisticalAnalysis/errorAnalysis/group/tab2.vue

@@ -37,25 +37,26 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
+        :height="myHeight2"
       >
         <el-table-column label="牧场" min-width="90px" align="center" prop="牧场" />
-        <el-table-column label="日期" min-width="90px" align="center" prop="日期" />
-        <el-table-column label="TMR名称" min-width="90px" align="center" prop="TMR名称" />
-        <el-table-column label="车次" min-width="90px" align="center" prop="车次" />
-        <el-table-column label="班次" min-width="90px" align="center" prop="班次" />
+        <el-table-column label="日期" min-width="70px" align="center" prop="日期" />
+        <el-table-column label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+        <el-table-column label="车次" min-width="50px" align="center" prop="车次" />
+        <el-table-column label="班次" min-width="50px" align="center" prop="班次" />
         <el-table-column label="配方名称" min-width="90px" align="center" prop="配方名称" />
-        <el-table-column label="饲料" min-width="90px" align="center" prop="饲料" />
-        <el-table-column label="理论重量" min-width="90px" align="center" prop="理论重量" />
-        <el-table-column label="实际重量" min-width="90px" align="center" prop="实际重量" />
-        <el-table-column label="误差值" min-width="90px" align="center" prop="误差值" />
-        <el-table-column label="准确率" min-width="90px" align="center" prop="准确率" />
-        <el-table-column label="计划时间" min-width="90px" align="center" prop="计划时间" />
-        <el-table-column label="开始时间" min-width="90px" align="center" prop="开始时间" />
-        <el-table-column label="结束时间" min-width="90px" align="center" prop="结束时间" />
-        <el-table-column label="搅拌时间" min-width="70px" align="center" prop="搅拌时间" />
-        <el-table-column label="跳转方式" min-width="90px" align="center" prop="跳转方式" />
-        <el-table-column label="开始重量" min-width="90px" align="center" prop="开始重量" />
-        <el-table-column label="结束重量" min-width="90px" align="center" prop="结束重量" />
+        <el-table-column label="饲料" min-width="70px" align="center" prop="饲料" />
+        <el-table-column label="理论重量" min-width="55px" align="center" prop="理论重量" />
+        <el-table-column label="实际重量" min-width="55px" align="center" prop="实际重量" />
+        <el-table-column label="误差值" min-width="45px" align="center" prop="误差值" />
+        <el-table-column label="准确率" min-width="45px" align="center" prop="准确率" />
+        <el-table-column label="计划时间" min-width="55px" align="center" prop="计划时间" />
+        <el-table-column label="开始时间" min-width="55px" align="center" prop="开始时间" />
+        <el-table-column label="结束时间" min-width="55px" align="center" prop="结束时间" />
+        <el-table-column label="搅拌时间" min-width="55px" align="center" prop="搅拌时间" />
+        <el-table-column label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+        <el-table-column label="开始重量" min-width="55px" align="center" prop="开始重量" />
+        <el-table-column label="结束重量" min-width="55px" align="center" prop="结束重量" />
       </el-table>
     </div>
   </div>
@@ -148,7 +149,8 @@ export default {
       },
 
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2:document.documentElement.clientHeight - 85-210
     }
   },
   created() {
@@ -288,5 +290,13 @@ export default {
 }
 </script>
 
-<style>
+<style lang="scss" scoped>
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
 </style>

+ 28 - 18
src/views/statisticalAnalysis/errorAnalysis/group/tab3.vue

@@ -37,24 +37,25 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
+        :height="myHeight2"
       >
-        <el-table-column label="牧场" min-width="110px" align="center" prop="牧场" />
-        <el-table-column label="日期" min-width="110px" align="center" prop="日期" />
-        <el-table-column label="TMR名称" min-width="110px" align="center" prop="TMR名称" />
-        <el-table-column label="车次" min-width="110px" align="center" prop="车次" />
-        <el-table-column label="班次" min-width="110px" align="center" prop="班次" />
-        <el-table-column label="配方名称" min-width="110px" align="center" prop="配方名称" />
-        <el-table-column label="栏舍" min-width="110px" align="center" prop="栏舍" />
-        <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
-        <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
-        <el-table-column label="误差值" min-width="110px" align="center" prop="误差值" />
-        <el-table-column label="准确率" min-width="110px" align="center" prop="准确率" />
-        <el-table-column label="开始时间" min-width="110px" align="center" prop="开始时间" />
-        <el-table-column label="结束时间" min-width="110px" align="center" prop="结束时间" />
+        <el-table-column label="牧场" min-width="55px" align="center" prop="牧场" />
+        <el-table-column label="日期" min-width="55px" align="center" prop="日期" />
+        <el-table-column label="TMR名称" min-width="55px" align="center" prop="TMR名称" />
+        <el-table-column label="车次" min-width="55px" align="center" prop="车次" />
+        <el-table-column label="班次" min-width="55px" align="center" prop="班次" />
+        <el-table-column label="配方名称" min-width="55px" align="center" prop="配方名称" />
+        <el-table-column label="栏舍" min-width="55px" align="center" prop="栏舍" />
+        <el-table-column label="理论重量" min-width="55px" align="center" prop="理论重量" />
+        <el-table-column label="实际重量" min-width="55px" align="center" prop="实际重量" />
+        <el-table-column label="误差值" min-width="55px" align="center" prop="误差值" />
+        <el-table-column label="准确率" min-width="55px" align="center" prop="准确率" />
+        <el-table-column label="开始时间" min-width="55px" align="center" prop="开始时间" />
+        <el-table-column label="结束时间" min-width="55px" align="center" prop="结束时间" />
         <!-- <el-table-column label="搅拌时间" min-width="70px" align="center" prop="搅拌时间" /> -->
-        <el-table-column label="跳转方式" min-width="110px" align="center" prop="跳转方式" />
-        <el-table-column label="开始重量" min-width="110px" align="center" prop="开始重量" />
-        <el-table-column label="结束重量" min-width="110px" align="center" prop="结束重量" />
+        <el-table-column label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+        <el-table-column label="开始重量" min-width="55px" align="center" prop="开始重量" />
+        <el-table-column label="结束重量" min-width="55px" align="center" prop="结束重量" />
       </el-table>
       <!-- <pagination v-show="tab3.table.total>=0" :total="tab3.table.total" :page.sync="tab3.table.getdataListParm.offset" :limit.sync="tab3.table.getdataListParm.pagecount" @pagination="getTab3List" /> -->
     </div>
@@ -149,7 +150,8 @@ export default {
         temp: {}
       },
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2:document.documentElement.clientHeight - 85-210
     }
   },
   create() {
@@ -285,5 +287,13 @@ export default {
 }
 </script>
 
-<style>
+<style lang="scss" scoped>
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
 </style>

+ 253 - 87
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -11,6 +11,7 @@
           <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍名称</el-radio>
           <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
           <el-radio v-model="tab.radio" label="4" @change="changeRadio">车次</el-radio>
+          <el-radio v-model="tab.radio" label="5" @change="changeRadio">TMR名称</el-radio>
           <el-checkbox v-model="tab.checked" style="margin-right: 10px;" @change="changeChecked">按日期统计</el-checkbox>
           <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="配方名称" />
           <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="栏舍名称" />
@@ -36,35 +37,43 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
+            :max-height="myHeight2"
           >
-
-            <el-table-column v-if="tab.checked" :key="0" sortable label="日期" min-width="90px" align="center" prop="计划时间" />
-            <el-table-column v-if="tab.isFormulaName" :key="1" sortable label="配方名称" min-width="100px" align="center" prop="配方名称" />
-            <el-table-column v-if="tab.isHouseName" :key="2" sortable label="栏舍名称" min-width="100px" align="center" prop="栏舍名称" />
-            <el-table-column v-if="tab.isLivestockType" :key="3" sortable label="牲畜类别" min-width="100px" align="center" prop="牲畜类别" />
-            <el-table-column v-if="tab.isTrainNumber" :key="4" sortable label="车次" min-width="100px" align="center" prop="车次" />
-            <el-table-column v-if="tab.isTrainNumber" :key="5" sortable label="班次" min-width="100px" align="center" prop="班次" />
-            <el-table-column v-if="tab.isTrainNumber" :key="6" sortable label="TMR名称" min-width="100px" align="center" prop="TMR名称" />
-            <el-table-column v-if="tab.isTrainNumber" :key="7" sortable label="驾驶员" min-width="100px" align="center" prop="驾驶员" />
-            <el-table-column :key="8" sortable label="理论重量" min-width="90px" align="center" prop="理论重量" />
-            <el-table-column :key="9" sortable label="实际重量" min-width="90px" align="center" prop="实际重量" />
-            <el-table-column :key="10" sortable label="计划混料操作数" min-width="90px" align="center" prop="计划混料操作数" />
-            <el-table-column :key="11" sortable label="已混料操作数" min-width="90px" align="center" prop="已混料操作数" />
-            <el-table-column :key="12" sortable label="混料操作率" min-width="100px" align="center" prop="混料操作率" />
-            <el-table-column :key="13" sortable label="混料误差值" min-width="100px" align="center" prop="混料误差值" />
-            <el-table-column :key="14" sortable label="混料准确率" min-width="100px" align="center" prop="混料准确率" />
-            <el-table-column v-if="tab.isTrainNumber" :key="15" sortable label="混料时间" min-width="100px" align="center" prop="混料时间" />
-            <el-table-column v-if="tab.isTrainNumber" :key="16" sortable label="等待时间" min-width="100px" align="center" prop="等待时间" />
-            <el-table-column :key="17" sortable label="混料自动跳转次数" min-width="90px" align="center" prop="混料自动跳转次数" />
-            <el-table-column :key="18" sortable label="混料手动跳转次数" min-width="90px" align="center" prop="混料手动跳转次数" />
-            <el-table-column :key="19" sortable label="取消次数" min-width="90px" align="center" prop="取消次数" />
-            <el-table-column :key="20" sortable label="混料正确数" min-width="90px" align="center" prop="混料正确数" />
-            <el-table-column :key="21" sortable label="混料正确率" min-width="90px" align="center" prop="混料正确率" />
-            <el-table-column :key="22" sortable label="去除取消正确率" min-width="90px" align="center" prop="去除取消正确率" />
-            <el-table-column :key="23" sortable label="标准差" min-width="90px" align="center" prop="方差" />
+            <el-table-column v-if="tab.checked" :key="0" sortable label="日期" min-width="70px" align="center" prop="计划时间" />
+            <el-table-column v-if="tab.isFormulaName" :key="1" sortable label="配方名称" min-width="70px" align="center" prop="配方名称" />
+            <el-table-column v-if="tab.isHouseName" :key="2" sortable label="栏舍名称" min-width="70px" align="center" prop="栏舍名称" />
+            <el-table-column v-if="tab.isLivestockType" :key="3" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
+            <el-table-column v-if="tab.isTrainNumber" :key="4" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTrainNumber" :key="5" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="6" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="7" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column v-if="tab.isTMRName" :key="8" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTMRName" :key="9" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTMRName" :key="10" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTMRName" :key="11" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column :key="12" sortable label="理论重量" min-width="60px" align="center" prop="理论重量" />
+            <el-table-column :key="13" sortable label="实际重量" min-width="60px" align="center" prop="实际重量" />
+            <el-table-column :key="14" sortable label="计划混料操作数" min-width="60px" align="center" prop="计划混料操作数" />
+            <el-table-column :key="15" sortable label="已混料操作数" min-width="50px" align="center" prop="已混料操作数" />
+            <el-table-column :key="16" sortable label="混料操作率" min-width="60px" align="center" prop="混料操作率" />
+            <el-table-column :key="17" sortable label="混料误差值" min-width="60px" align="center" prop="混料误差值" />
+            <el-table-column :key="18" sortable label="混料准确率" min-width="60px" align="center" prop="混料准确率" />
+            <el-table-column v-if="tab.isTrainNumber" :key="19" sortable label="混料时间" min-width="70px" align="center" prop="混料时间" />
+            <el-table-column v-if="tab.isTrainNumber" :key="20" sortable label="等待时间" min-width="70px" align="center" prop="等待时间" />
+            <el-table-column :key="21" sortable label="混料自动跳转次数" min-width="65px" align="center" prop="混料自动跳转次数" />
+            <el-table-column :key="22" sortable label="混料手动跳转次数" min-width="65px" align="center" prop="混料手动跳转次数" />
+            <el-table-column :key="23" sortable label="取消次数" min-width="70px" align="center" prop="取消次数" />
+            <el-table-column :key="24" sortable label="混料正确数" min-width="70px" align="center" prop="混料正确数" />
+            <el-table-column :key="25" sortable label="混料正确率" min-width="70px" align="center" prop="混料正确率" />
+            <el-table-column :key="26" sortable label="去除取消正确率" min-width="60px" align="center" prop="去除取消正确率" />
+            <el-table-column :key="27" sortable label="标准差" min-width="60px" align="center" prop="方差" />
+            <el-table-column :key="28" align="center" width="70" label="操作" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
+              </template>
+            </el-table-column>
           </el-table>
           <span v-if="tab.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table.total }}条</span>
-          <!-- <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getTabList" /> -->
           <h4>撒料</h4>
           <el-table
             :key="tab.table2.tableKey"
@@ -78,34 +87,43 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
+            :max-height="myHeight2"
           >
-            <el-table-column v-if="tab.checked" :key="0" sortable label="日期" min-width="90px" align="center" prop="计划时间" />
-            <el-table-column v-if="tab.isFormulaName" :key="1" sortable label="配方名称" min-width="100px" align="center" prop="配方名称" />
-            <el-table-column v-if="tab.isHouseName" :key="2" sortable label="栏舍名称" min-width="100px" align="center" prop="栏舍名称" />
-            <el-table-column v-if="tab.isLivestockType" :key="3" sortable label="牲畜类别" min-width="100px" align="center" prop="牲畜类别" />
-            <el-table-column v-if="tab.isTrainNumber" :key="4" sortable label="车次" min-width="100px" align="center" prop="车次" />
-            <el-table-column v-if="tab.isTrainNumber" :key="5" sortable label="班次" min-width="100px" align="center" prop="班次" />
-            <el-table-column v-if="tab.isTrainNumber" :key="6" sortable label="TMR名称" min-width="100px" align="center" prop="TMR名称" />
-            <el-table-column v-if="tab.isTrainNumber" :key="7" sortable label="驾驶员" min-width="100px" align="center" prop="驾驶员" />
-            <el-table-column :key="8" sortable label="理论重量" min-width="90px" align="center" prop="理论重量" />
-            <el-table-column :key="9" sortable label="实际重量" min-width="90px" align="center" prop="实际重量" />
-            <el-table-column :key="10" sortable label="计划撒料操作数" min-width="90px" align="center" prop="计划撒料操作数" />
-            <el-table-column :key="11" sortable label="已撒料操作数" min-width="90px" align="center" prop="已撒料操作数" />
-            <el-table-column :key="12" sortable label="撒料操作率" min-width="100px" align="center" prop="撒料操作率" />
-            <el-table-column :key="13" sortable label="撒料误差值" min-width="100px" align="center" prop="撒料误差值" />
-            <el-table-column :key="14" sortable label="撒料准确率" min-width="100px" align="center" prop="撒料准确率" />
-            <el-table-column v-if="tab.isTrainNumber" :key="15" sortable label="撒料时间" min-width="100px" align="center" prop="撒料时间" />
-            <el-table-column v-if="tab.isTrainNumber" :key="16" sortable label="等待时间" min-width="100px" align="center" prop="等待时间" />
-            <el-table-column :key="17" sortable label="撒料自动跳转次数" width="90px" align="center" prop="撒料自动跳转次数" />
-            <el-table-column :key="18" sortable label="撒料手动跳转次数" width="90px" align="center" prop="撒料手动跳转次数" />
-            <el-table-column :key="19" sortable label="取消次数" min-width="90px" align="center" prop="取消次数" />
-            <el-table-column :key="20" sortable label="撒料正确数" min-width="90px" align="center" prop="撒料正确数" />
-            <el-table-column :key="21" sortable label="撒料正确率" min-width="90px" align="center" prop="撒料正确率" />
-            <el-table-column :key="22" sortable label="去除取消正确率" min-width="90px" align="center" prop="去除取消正确率" />
-            <el-table-column :key="23" sortable label="标准差" min-width="90px" align="center" prop="方差" />
+            <el-table-column v-if="tab.checked" :key="0" sortable label="日期" min-width="70px" align="center" prop="计划时间" />
+            <el-table-column v-if="tab.isFormulaName" :key="1" sortable label="配方名称" min-width="70px" align="center" prop="配方名称" />
+            <el-table-column v-if="tab.isHouseName" :key="2" sortable label="栏舍名称" min-width="70px" align="center" prop="栏舍名称" />
+            <el-table-column v-if="tab.isLivestockType" :key="3" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
+            <el-table-column v-if="tab.isTrainNumber" :key="4" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="5" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTrainNumber" :key="6" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTrainNumber" :key="7" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column v-if="tab.isTMRName" :key="8" sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column v-if="tab.isTMRName" :key="9" sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column v-if="tab.isTMRName" :key="10" sortable label="车次" min-width="70px" align="center" prop="车次" />
+            <el-table-column v-if="tab.isTMRName" :key="11" sortable label="驾驶员" min-width="70px" align="center" prop="驾驶员" />
+            <el-table-column :key="12" sortable label="理论重量" min-width="60px" align="center" prop="理论重量" />
+            <el-table-column :key="13" sortable label="实际重量" min-width="60px" align="center" prop="实际重量" />
+            <el-table-column :key="14" sortable label="计划撒料操作数" min-width="60px" align="center" prop="计划撒料操作数" />
+            <el-table-column :key="15" sortable label="已撒料操作数" min-width="50px" align="center" prop="已撒料操作数" />
+            <el-table-column :key="16" sortable label="撒料操作率" min-width="60px" align="center" prop="撒料操作率" />
+            <el-table-column :key="17" sortable label="撒料误差值" min-width="60px" align="center" prop="撒料误差值" />
+            <el-table-column :key="18" sortable label="撒料准确率" min-width="60px" align="center" prop="撒料准确率" />
+            <el-table-column v-if="tab.isTrainNumber" :key="19" sortable label="撒料时间" min-width="70px" align="center" prop="撒料时间" />
+            <el-table-column v-if="tab.isTrainNumber" :key="20" sortable label="等待时间" min-width="70px" align="center" prop="等待时间" />
+            <el-table-column :key="21" sortable label="撒料自动跳转次数" width="65px" align="center" prop="撒料自动跳转次数" />
+            <el-table-column :key="22" sortable label="撒料手动跳转次数" width="65px" align="center" prop="撒料手动跳转次数" />
+            <el-table-column :key="23" sortable label="取消次数" min-width="70px" align="center" prop="取消次数" />
+            <el-table-column :key="24" sortable label="撒料正确数" min-width="70px" align="center" prop="撒料正确数" />
+            <el-table-column :key="25" sortable label="撒料正确率" min-width="70px" align="center" prop="撒料正确率" />
+            <el-table-column :key="26" sortable label="去除取消正确率" min-width="65px" align="center" prop="去除取消正确率" />
+            <el-table-column :key="27" sortable label="标准差" min-width="60px" align="center" prop="方差" />
+            <el-table-column :key="28" align="center" width="70" label="操作" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee(row)" />
+              </template>
+            </el-table-column>
           </el-table>
           <span v-if="tab.table2.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table2.total }}条</span>
-          <!-- <pagination v-show="tab.table2.total>=0" :total="tab.table2.total" :page.sync="tab.table2.getdataListParm.offset" :limit.sync="tab.table2.getdataListParm.pagecount" @pagination="getTabList2" /> -->
         </div>
         <div id="AnalysisChart" class="AnalysisChart">
           <el-row :gutter="10">
@@ -436,24 +454,25 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
+            :max-height="myHeight2"
           >
-            <el-table-column sortable label="日期" min-width="85px" align="center" prop="日期" />
-            <el-table-column sortable label="TMR名称" min-width="90px" align="center" prop="TMR名称" />
-            <el-table-column sortable label="车次" min-width="70px" align="center" prop="车次" />
-            <el-table-column sortable label="班次" min-width="70px" align="center" prop="班次" />
+            <el-table-column sortable label="日期" min-width="70px" align="center" prop="日期" />
+            <el-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column sortable label="车次" min-width="50px" align="center" prop="车次" />
+            <el-table-column sortable label="班次" min-width="50px" align="center" prop="班次" />
             <el-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
             <el-table-column sortable label="饲料" min-width="70px" align="center" prop="饲料" />
-            <el-table-column sortable label="理论重量" min-width="70px" align="center" prop="理论重量" />
-            <el-table-column sortable label="实际重量" min-width="70px" align="center" prop="实际重量" />
-            <el-table-column sortable label="误差值" min-width="70px" align="center" prop="误差值" />
-            <el-table-column sortable label="准确率" min-width="70px" align="center" prop="准确率" />
+            <el-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
+            <el-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
+            <el-table-column sortable label="误差值" min-width="45px" align="center" prop="误差值" />
+            <el-table-column sortable label="准确率" min-width="45px" align="center" prop="准确率" />
             <el-table-column sortable label="计划时间" min-width="55px" align="center" prop="计划时间" />
-            <el-table-column sortable label="开始时间" min-width="80px" align="center" prop="开始时间" />
-            <el-table-column sortable label="结束时间" min-width="80px" align="center" prop="结束时间" />
-            <el-table-column sortable label="搅拌时间" min-width="70px" align="center" prop="搅拌时间" />
-            <el-table-column sortable label="跳转方式" min-width="70px" align="center" prop="跳转方式" />
-            <el-table-column sortable label="开始重量" min-width="70px" align="center" prop="开始重量" />
-            <el-table-column sortable label="结束重量" min-width="70px" align="center" prop="结束重量" />
+            <el-table-column sortable label="开始时间" min-width="55px" align="center" prop="开始时间" />
+            <el-table-column sortable label="结束时间" min-width="55px" align="center" prop="结束时间" />
+            <el-table-column sortable label="搅拌时间" min-width="55px" align="center" prop="搅拌时间" />
+            <el-table-column sortable label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+            <el-table-column sortable label="开始重量" min-width="55px" align="center" prop="开始重量" />
+            <el-table-column sortable label="结束重量" min-width="55px" align="center" prop="结束重量" />
           </el-table>
           <span v-if="tab2.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab2.table.total }}条</span>
           <!-- <pagination v-show="tab2.table.total>=0" :total="tab2.table.total" :page.sync="tab2.table.getdataListParm.offset" :limit.sync="tab2.table.getdataListParm.pagecount" @pagination="getTab2List" /> -->
@@ -494,36 +513,37 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
+            :max-height="myHeight2"
           >
-            <el-table-column sortable label="日期" min-width="80px" align="center" prop="日期" />
-            <el-table-column sortable label="TMR名称" min-width="90px" align="center" prop="TMR名称" />
-            <el-table-column sortable label="车次" min-width="70px" align="center" prop="车次" />
-            <el-table-column sortable label="班次" min-width="70px" align="center" prop="班次" />
-            <el-table-column sortable label="配方名称" min-width="110px" align="center" prop="配方名称" />
-            <el-table-column sortable label="栏舍" min-width="110px" align="center" prop="栏舍" />
-            <el-table-column sortable label="理论重量" min-width="80px" align="center" prop="理论重量" />
-            <el-table-column sortable label="实际重量" min-width="80px" align="center" prop="实际重量" />
-            <el-table-column sortable label="误差值" min-width="70px" align="center" prop="误差值" />
-            <el-table-column sortable label="准确率" min-width="70px" align="center" prop="准确率" />
-            <el-table-column sortable label="开始时间" min-width="80px" align="center" prop="开始时间" />
-            <el-table-column sortable label="结束时间" min-width="80px" align="center" prop="结束时间" />
-            <!-- <el-table-column sortable label="搅拌时间" min-width="70px" align="center" prop="搅拌时间" /> -->
-            <el-table-column sortable label="跳转方式" min-width="70px" align="center" prop="跳转方式" />
-            <el-table-column sortable label="开始重量" min-width="70px" align="center" prop="开始重量" />
-            <el-table-column sortable label="结束重量" min-width="70px" align="center" prop="结束重量" />
+            <el-table-column sortable label="日期" min-width="70px" align="center" prop="日期" />
+            <el-table-column sortable label="TMR名称" min-width="70px" align="center" prop="TMR名称" />
+            <el-table-column sortable label="车次" min-width="45px" align="center" prop="车次" />
+            <el-table-column sortable label="班次" min-width="45px" align="center" prop="班次" />
+            <el-table-column sortable label="配方名称" min-width="90px" align="center" prop="配方名称" />
+            <el-table-column sortable label="栏舍" min-width="90px" align="center" prop="栏舍" />
+            <el-table-column sortable label="理论重量" min-width="55px" align="center" prop="理论重量" />
+            <el-table-column sortable label="实际重量" min-width="55px" align="center" prop="实际重量" />
+            <el-table-column sortable label="误差值" min-width="45px" align="center" prop="误差值" />
+            <el-table-column sortable label="准确率" min-width="45px" align="center" prop="准确率" />
+            <el-table-column sortable label="开始时间" min-width="55px" align="center" prop="开始时间" />
+            <el-table-column sortable label="结束时间" min-width="55px" align="center" prop="结束时间" />
+            <el-table-column sortable label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
+            <el-table-column sortable label="开始重量" min-width="55px" align="center" prop="开始重量" />
+            <el-table-column sortable label="结束重量" min-width="55px" align="center" prop="结束重量" />
           </el-table>
           <span v-if="tab3.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
-          <!-- <pagination v-show="tab3.table.total>=0" :total="tab3.table.total" :page.sync="tab3.table.getdataListParm.offset" :limit.sync="tab3.table.getdataListParm.pagecount" @pagination="getTab3List" /> -->
+          <pagination v-show="tab3.table.total>=0" :total="tab3.table.total" :page.sync="tab3.table.getdataListParm.offset" :limit.sync="tab3.table.getdataListParm.pagecount" @pagination="getTab3List" />
         </div>
       </el-tab-pane>
     </el-tabs>
+    <!-- 查看 -->
+    <See :show.sync="isShowDialog" :row-pid="rowPid" :title-fname="titlefname" />
   </div>
-
 </template>
 
 <script>
 import echarts from 'echarts'
-
+import See from './see.vue'
 require('echarts/theme/macarons')
 import { GetDataByName, GetReportform } from '@/api/common'
 import Cookies from 'js-cookie'
@@ -534,7 +554,7 @@ import { MessageBox } from 'element-ui'
 import mySelect from '@/components/mySelect'
 export default {
   name: 'PastureErrorAnalysis',
-  components: { Pagination, mySelect },
+  components: { Pagination, mySelect, See },
   data() {
     return {
       Beforedisabled: false,
@@ -585,6 +605,7 @@ export default {
         isHouseName: false, // 栏舍名称
         isLivestockType: false, // 牲畜类别
         isTrainNumber: false, // 车次
+        isTMRName: false, // TMR名称
         checked: false, // 按日期统计
         table: {
           getdataListParm: {
@@ -919,11 +940,16 @@ export default {
         jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }],
         isuseList: [{ id: '0', name: '未完成' }, { id: '2', name: '部分完成' }, { id: '1', name: '全部完成' }]
       },
+      titlefname: '',
+      rowPid: '',
+      isShowDialog: false,
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2: document.documentElement.clientHeight - 85 - 210
     }
   },
   created() {
+    console.log(this.isShowDialog, 'this.isShowDialog')
     this.getTimeFn()
     this.getIsDisplay()
     this.getTabList()
@@ -965,6 +991,8 @@ export default {
       that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
 
       // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 10)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
       that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
       that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
       that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
@@ -1231,6 +1259,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHFTDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1252,6 +1281,7 @@ export default {
           this.tab.isHouseName = true
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHNSDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1273,6 +1303,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = true
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHSCDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1295,6 +1326,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHCCDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1311,6 +1343,29 @@ export default {
           this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
           this.tab.table2.getdataListParm.offset = 1
           this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('TMR名称')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCLDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
         }
       } else {
         if (this.tab.radio == '1') {
@@ -1319,6 +1374,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHFT'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1340,6 +1396,7 @@ export default {
           this.tab.isHouseName = true
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHNS'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1361,6 +1418,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = true
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHSC'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1383,6 +1441,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHCC'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1399,6 +1458,29 @@ export default {
           this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
           this.tab.table2.getdataListParm.offset = 1
           this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('TMR名称')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCL'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
         }
       }
     },
@@ -1449,6 +1531,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHFTDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1471,6 +1554,7 @@ export default {
           this.tab.isHouseName = true
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHNSDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1493,6 +1577,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = true
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHSCDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1515,6 +1600,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHCCDate'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1534,6 +1620,32 @@ export default {
           this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
           this.tab.table2.getdataListParm.offset = 1
           this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('TMR名称/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMCDate'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCLDate'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+          this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+          this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
+          this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
         }
       } else {
         if (this.tab.radio == '1') {
@@ -1542,6 +1654,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHFT'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1564,6 +1677,7 @@ export default {
           this.tab.isHouseName = true
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHNS'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1586,6 +1700,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = true
           this.tab.isTrainNumber = false
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHSC'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1608,6 +1723,7 @@ export default {
           this.tab.isHouseName = false
           this.tab.isLivestockType = false
           this.tab.isTrainNumber = true
+          this.tab.isTMRName = false
           this.tab.table.getdataListParm.name = 'getAccuracyHCC'
           if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
             this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -1623,6 +1739,33 @@ export default {
           this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
           this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
 
+          this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
+          this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
+          this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
+          this.tab.table2.getdataListParm.offset = 1
+          this.getTabList2()
+        } else if (this.tab.radio == '5') {
+          console.log('tmr名称/查询')
+          this.tab.isFormulaName = false
+          this.tab.isHouseName = false
+          this.tab.isLivestockType = false
+          this.tab.isTrainNumber = false
+          this.tab.isTMRName = true
+          this.tab.table.getdataListParm.name = 'getAccuracyMC'
+          if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+            this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+            this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+          } else {
+            this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+            this.tab.table.getdataListParm.parammaps.startTime = ''
+            this.tab.table.getdataListParm.parammaps.stopTime = ''
+          }
+          this.tab.table.getdataListParm.offset = 1
+          this.getTabList()
+          this.tab.table2.getdataListParm.name = 'getAccuracySLCL'
+          this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
+          this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
+
           this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
           this.tab.table2.getdataListParm.parammaps.times = this.tab.table.getdataListParm.parammaps.times
           this.tab.table2.getdataListParm.parammaps.projname = this.tab.table.getdataListParm.parammaps.projname
@@ -2979,8 +3122,23 @@ export default {
         }
       ]
       json2excel(excelDatasTab3, '撒料统计', true, 'xlsx')
+    },
+    handleSee(row) {
+      if (this.tab.radio == 1) {
+        this.titlefname = '准确性详情——配方名称:' + row.配方名称
+      } else if (this.tab.radio == 2) {
+        this.titlefname = '准确性详情——栏舍名称:' + row.栏舍名称
+      } else if (this.tab.radio == 3) {
+        this.titlefname = '准确性详情——牲畜类别:' + row.栏舍名称
+      } else if (this.tab.radio == 4) {
+        this.titlefname = '准确性详情——车次:' + row.车次
+      } else if (this.tab.radio == 5) {
+        this.titlefname = '准确性详情——TMR名称:' + row.TMR名称
+      }
+      console.log(row, 'row')
+      this.rowPid = row.pid
+      this.isShowDialog = true
     }
-
   }
 }
 </script>
@@ -3001,4 +3159,12 @@ export default {
     }
   }
   .table{margin-bottom: 50px;}
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
 </style>

+ 408 - 0
src/views/statisticalAnalysis/errorAnalysis/pasture/see.vue

@@ -0,0 +1,408 @@
+<template>
+  <div v-if="visible">
+    <el-dialog id="reviseplanDialog" :title="title" :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="visible" :close-on-click-modal="false" append-to-body :before-close="closeDialog" 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" />
+            {{ title }}
+          </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="see">
+        <el-row :gutter="10">
+          <el-col :span="10">
+            <div class="train">
+              <h4>车次信息</h4>
+              <div class="table">
+                <el-table
+                  :key="table1.tableKey"
+                  v-loading="table1.listLoading"
+                  element-loading-text="给我一点时间"
+                  :data="table1.list"
+                  border
+                  fit
+                  highlight-current-row
+                  style="width: 98%;"
+                  :row-style="rowStyle"
+                  :cell-style="cellStyle"
+                  class="elTable table-fixed"
+                  height="700"
+                  @row-click="rowClick"
+                >
+                  <el-table-column label="序号" align="center" type="index" width="50" />
+                  <el-table-column label="计划名称" min-width="60px" align="center" prop="projname" />
+                  <el-table-column label="TMR名称" min-width="60px" align="center" prop="tmrtname" />
+                  <el-table-column sortable label="制定日期" min-width="70px" align="center" prop="mydate" />
+                  <el-table-column sortable label="开始时间" min-width="70px" align="center" prop="intime" />
+                </el-table>
+              </div>
+            </div>
+          </el-col>
+          <el-col :span="14">
+            <div class="mixture">
+              <h4>混料信息</h4>
+              <div class="table">
+                <el-table
+                  :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 table-fixed"
+                  height="150"
+                >
+                  <el-table-column label="操作编号" min-width="50px" align="center" prop="sort" />
+                  <el-table-column label="饲料名称" min-width="50px" align="center" prop="fname" />
+                  <el-table-column label="计划重量" min-width="50px" align="center" prop="lweight" />
+                  <el-table-column label="实际重量" min-width="50px" align="center" prop="actualweightminus">
+                    <template slot-scope="scope">
+                      <span v-if="scope.row.lweight == scope.row.actualweightminus">{{ scope.row.actualweightminus }}</span>
+                      <span v-else style="color: red;">{{ scope.row.actualweightminus }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="误差值" min-width="50px" align="center" prop="diff" />
+                  <el-table-column label="准确率" min-width="50px" align="center" prop="diffRate" />
+                  <el-table-column label="完成时间" min-width="50px" align="center" prop="intime" />
+                  <el-table-column label="过程时间" min-width="50px" align="center" prop="proesstime" />
+                  <el-table-column label="开始读取重量" min-width="50px" align="center" prop="lastactualweight" />
+                  <el-table-column label="最后读取重量" min-width="50px" align="center" prop="actualweight" />
+                  <el-table-column label="取料方式" min-width="50px" align="center" prop="buttontype" />
+                </el-table>
+              </div>
+            </div>
+            <div class="spreading">
+              <h4>撒料信息</h4>
+              <div class="table">
+                <el-table
+                  :key="table3.tableKey"
+                  v-loading="table3.listLoading"
+                  element-loading-text="给我一点时间"
+                  :data="table3.list"
+                  border
+                  fit
+                  highlight-current-row
+                  style="width: 98%;"
+                  :row-style="rowStyle"
+                  :cell-style="cellStyle"
+                  class="elTable table-fixed"
+                  height="150"
+                >
+                  <el-table-column label="操作编号" min-width="50px" align="center" prop="sort" />
+                  <el-table-column label="饲料名称" min-width="50px" align="center" prop="fname" />
+                  <el-table-column label="计划重量" min-width="50px" align="center" prop="lweight" />
+                  <el-table-column label="实际重量" min-width="50px" align="center" prop="actualweightminus">
+                    <template slot-scope="scope">
+                      <span v-if="scope.row.lweight == scope.row.actualweightminus">{{ scope.row.actualweightminus }}</span>
+                      <span v-else style="color: red;">{{ scope.row.actualweightminus }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="误差值" min-width="50px" align="center" prop="diff" />
+                  <el-table-column label="准确率" min-width="50px" align="center" prop="diffRate" />
+                  <el-table-column label="完成时间" min-width="50px" align="center" prop="intime" />
+                  <el-table-column label="过程时间" min-width="50px" align="center" prop="proesstime" />
+                  <el-table-column label="开始读取重量" min-width="50px" align="center" prop="lastactualweight" />
+                  <el-table-column label="最后读取重量" min-width="50px" align="center" prop="actualweight" />
+                  <el-table-column label="取料方式" min-width="50px" align="center" prop="buttontype" />
+                </el-table>
+              </div>
+            </div>
+            <div class="controlChart">
+              <h4>监控图</h4>
+              <div id="chartLine" style="width: 100%;height:300px;" />
+            </div>
+          </el-col>
+        </el-row>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="closeDialog()">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts'
+require('echarts/theme/macarons')
+import { GetDataByName, GetReportform, formatNum } from '@/api/common'
+export default {
+  name: 'See',
+  props: {
+    show: { type: Boolean, default: false }, // 弹框可见标志
+    titleFname: { type: String, defalut: '准确性详情' },
+    rowPid: { type: String, defalut: '0' }
+  },
+  data() {
+    return {
+      dialogFull: false,
+      visible: this.show,
+      title: '',
+      pid: '',
+      table1: {
+        getdataListParm: {
+          name: 'getDownloadedplanHLCK', page: 1, offset: 1, pagecount: '', returntype: 'Map',
+          parammaps: { pid: '' }
+        },
+        tableKey: 0, list: [], total: 0, listLoading: false
+      },
+      table2: {
+        getdataListParm: {
+          name: 'getprocessAnalysisHL', page: 1, offset: 1, pagecount: '', returntype: 'Map',
+          parammaps: { pid: '', pastureid: '' }
+        },
+        tableKey: 0, list: [], total: 0, listLoading: false
+      },
+      table3: {
+        getdataListParm: {
+          name: 'getprocessAnalysisSL', page: 1, offset: 1, pagecount: '', returntype: 'Map',
+          parammaps: { pid: '', pastureid: '' }
+        },
+        tableKey: 0, list: [], total: 0, listLoading: false
+      },
+      chart1: {
+        getdataListParm: {
+          name: 'getprocessAnalysisTB', page: 1, offset: 1, pagecount: '', returntype: 'Map',
+          parammaps: {
+            pid: '', pastureid: ''
+          }
+        },
+        tableKey: 0, list: [], total: 0, listLoading: false, chartLine_data: []
+      },
+      chartLine: null, chartLine_data: {}, chartName: '',
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight: document.documentElement.clientHeight - 85 - 200
+    }
+  },
+  watch: {
+    // 监听show,visible 随着show变化而变化
+    show: {
+      immediate: true,
+      handler(show) {
+        console.log(show, 'show')
+        this.visible = show
+        setTimeout(() => {
+          this.getList1()
+        }, 500)
+      }
+    },
+    titleFname: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log(newVal, 'titleFname')
+        this.title = newVal
+      }
+    },
+    rowPid: {
+      immediate: true,
+      handler(newVal, oldVal) {
+        console.log(newVal, 'rowPid')
+        this.pid = newVal
+      }
+    }
+  },
+  created() {
+
+  },
+  mounted() {
+
+  },
+  methods: {
+    closeDialog() {
+      this.dialogFull = false
+      this.$emit('update:show', false)
+    },
+    // TMR设备列表
+    getList1() {
+      this.table1.listLoading = true
+      this.table1.getdataListParm.parammaps.pid = this.pid
+      GetDataByName(this.table1.getdataListParm).then(response => {
+        console.log('车次信息数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table1.list = response.data.list
+          this.table2.getdataListParm.parammaps.pid = response.data.list[0].pid
+          this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+          this.table3.getdataListParm.parammaps.pid = response.data.list[0].pid
+          this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+          this.chart1.getdataListParm.parammaps.pid = response.data.list[0].pid
+          this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
+        } else {
+          this.table1.list = []
+          this.table2.getdataListParm.parammaps.pid = ''
+          this.table2.getdataListParm.parammaps.pastureid = ''
+          this.table3.getdataListParm.parammaps.pid = ''
+          this.table3.getdataListParm.parammaps.pastureid = ''
+          this.chart1.getdataListParm.parammaps.pid = ''
+          this.chart1.getdataListParm.parammaps.pastureid = ''
+        }
+        this.getList2()
+        this.getList3()
+        this.getChart1()
+        setTimeout(() => {
+          this.table1.listLoading = false
+        }, 100)
+      })
+    },
+    getList2() {
+      this.table2.listLoading = true
+      GetDataByName(this.table2.getdataListParm).then(response => {
+        console.log('混料信息数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table2.list = response.data.list
+          var sumlweight = 0
+          var sumactualweightminus = 0
+          var sumsweight = 0
+          var sumproesstime = ''
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].lweight == undefined) { response.data.list[i].lweight = 0 }
+            if (response.data.list[i].actualweightminus == undefined) { response.data.list[i].actualweightminus = 0 }
+            if (response.data.list[i].sweight == undefined) { response.data.list[i].sweight = 0 }
+            sumlweight += parseFloat(response.data.list[i].lweight)
+            sumactualweightminus += parseFloat(response.data.list[i].actualweightminus)
+            sumsweight += parseFloat(response.data.list[i].sweight)
+            sumproesstime = response.data.list[0].sumproesstime
+          }
+          sumlweight = formatNum(sumlweight, 2)
+          sumactualweightminus = formatNum(sumactualweightminus, 2)
+          sumsweight = formatNum(sumsweight, 2)
+          this.table2.list.push({ 'sort': '合计', 'lweight': sumlweight, 'actualweightminus': sumactualweightminus, 'sweight': sumsweight, 'proesstime': sumproesstime })
+        } else {
+          this.table2.list = []
+        }
+        setTimeout(() => {
+          this.table2.listLoading = false
+        }, 100)
+      })
+    },
+    getList3() {
+      this.table3.listLoading = true
+      GetDataByName(this.table3.getdataListParm).then(response => {
+        console.log('撒料信息数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table3.list = response.data.list
+          var sumlweight = 0
+          var sumactualweightminus = 0
+          var sumsweight = 0
+          var sumproesstime = ''
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].lweight == undefined) { response.data.list[i].lweight = 0 }
+            if (response.data.list[i].actualweightminus == undefined) { response.data.list[i].actualweightminus = 0 }
+            if (response.data.list[i].sweight == undefined) { response.data.list[i].sweight = 0 }
+            sumlweight += parseFloat(response.data.list[i].lweight)
+            sumactualweightminus += parseFloat(response.data.list[i].actualweightminus)
+            sumsweight += parseFloat(response.data.list[i].sweight)
+            sumproesstime = response.data.list[0].sumproesstime
+          }
+          sumlweight = formatNum(sumlweight, 2)
+          sumactualweightminus = formatNum(sumactualweightminus, 2)
+          sumsweight = formatNum(sumsweight, 2)
+          this.table3.list.push({ 'sort': '合计', 'lweight': sumlweight, 'actualweightminus': sumactualweightminus, 'sweight': sumsweight, 'proesstime': sumproesstime })
+        } else {
+          this.table3.list = []
+        }
+        setTimeout(() => {
+          this.table3.listLoading = false
+        }, 100)
+      })
+    },
+    getChart1() {
+      this.chart1.listLoading = true
+      GetReportform(this.chart1.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.chart1.list = response.data.data
+          console.log('监控图', response.data.list)
+          this.chart1.chartLine_data = response.data.list
+          this.chart1.total = response.data.total
+          this.roadChartLine1(this.chart1.chartLine_data)
+        } else {
+          this.chart1.list = []
+        }
+        setTimeout(() => {
+          this.chart1.listLoading = false
+        }, 100)
+      })
+    },
+    roadChartLine1(chartLine_data) {
+      console.log(chartLine_data.data5, 'chartLine_data')
+      if (this.chartLine != null) {
+        this.chartLine.dispose()
+      }
+      this.chartLine = echarts.init(document.getElementById('chartLine'))
+      var option = {
+        title: { text: '', subtext: '' },
+        color: ['#38c193', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
+        legend: [{
+          itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
+          data: [{ name: '设计重量' }, { name: '实际重量' }]
+        }, {
+          itemWidth: 15, itemHeight: 15, right: '0', textStyle: { fontSize: 12 },
+          data: [
+            { name: '开始重量' },
+            { name: '结束重量' }
+          ]
+        }],
+        tooltip: {
+          trigger: 'axis',
+          formatter: function(params) {
+            console.log(params, 'params')
+            var tip = params[0].name
+            for (let i = 0; i < params.length; i++) {
+              if (params[i].seriesName == '设计重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
+              }
+              if (params[i].seriesName == '实际重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
+              }
+              if (params[i].seriesName == '开始重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
+              }
+              if (params[i].seriesName == '结束重量') {
+                tip += '<br>' + params[i].seriesName + ':' + params[i].value[1] + '<br>' + params[i].value[2] + params[i].value[3]
+              }
+            }
+            return tip
+          }
+        },
+        calculable: true,
+        xAxis: [
+          { type: 'category' }
+        ],
+        yAxis: [{ type: 'value' }],
+        series: [
+          { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#38c193' }}}},
+          { symbol: 'none', name: '设计重量', type: 'line', step: 'middle', data: chartLine_data.data2 },
+          { name: '开始重量', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
+          { name: '结束重量', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
+        ]
+      }
+      this.chartLine.setOption(option)
+      window.onresize = function() {
+        this.chartLine.resize()
+      }
+    },
+    rowClick(row, column, event) {
+
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+</style>

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

@@ -30,7 +30,8 @@
             style="width: 100%;"
             :row-style="rowStyle"
             :cell-style="cellStyle"
-            class="elTable table-fixed"
+            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="栏舍" />
@@ -686,7 +687,8 @@ export default {
         }
       },
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight: document.documentElement.clientHeight - 85 - 210
     }
   },
 
@@ -709,6 +711,8 @@ export default {
       const start = new Date()
       const start2 = new Date()
       start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 10)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
 
       that.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
 

+ 160 - 153
src/views/statisticalAnalysis/inventoryManagement/group/index.vue

@@ -8,8 +8,8 @@
             <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
           </el-select>
           <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 250px;margin-bottom:10px;" :picker-options="pickerOptions" />
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
           <el-input v-model="tab.table.getdataListParm.parammaps.feedname" class="filter-item" style="width: 245px;margin-bottom:10px;" placeholder="饲料名称" />
           <el-button class="successBorder" style="margin-left: 10px;margin-bottom:10px;" @click="handleSearch('first')">查询</el-button>
           <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport(tab1)">导出</el-button>
@@ -57,8 +57,8 @@
             <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
           </el-select>
           <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
           <span style="margin-left: 10px;">统计类型:</span>
           <el-radio v-model="tab2.radio" label="1" @change="changeRadio2">牲畜类别</el-radio>
           <el-radio v-model="tab2.radio" label="2" @change="changeRadio2">栏舍名称</el-radio>
@@ -87,14 +87,16 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
+          :height="myHeight2"
+          ref="elTable1"
         >
           <el-table-column v-for="item in tab2.table.tableConfig" align="center" :label="item.label" :prop="item.prop">
             <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" align="center" :label="item1.label" :prop="item1.prop">
               <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :label="item2.label" :prop="item2.prop" />
             </el-table-column>
           </el-table-column>
-        </el-table>
-        <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>
+        </el-table>
+        <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 v-if="tab2.table.list.length==0" style="text-align: center;">暂无数据</div> -->
       </el-tab-pane>
       <el-tab-pane label="价格分析" name="third">
@@ -103,8 +105,8 @@
             <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
           </el-select>
           <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled3" @click="handleBefore3" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled3" @click="handleNext3" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled3" @click="handleBefore3" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled3" @click="handleNext3" />
           <span style="margin-left: 10px;">统计类型:</span>
           <el-radio v-model="tab3.radio" label="1" @change="changeRadio3">牲畜类别</el-radio>
           <el-radio v-model="tab3.radio" label="2" @change="changeRadio3">栏舍名称</el-radio>
@@ -129,14 +131,16 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
+          :height="myHeight2"
+          ref="elTable2"
         >
           <el-table-column v-for="item in tab3.table.tableConfig" align="center" :label="item.label" :prop="item.prop">
             <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" align="center" :label="item1.label" :prop="item1.prop">
               <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :label="item2.label" :prop="item2.prop" />
             </el-table-column>
           </el-table-column>
-        </el-table>
-        <span v-if="tab3.table.listLoading == false && tab3.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
+        </el-table>
+        <span v-if="tab3.table.listLoading == false && tab3.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
         <!-- <div v-if="tab3.table.list.length==0" style="text-align: center;">暂无数据</div> -->
       </el-tab-pane>
     </el-tabs>
@@ -154,10 +158,10 @@ export default {
   name: 'GroupInventoryManagement',
   components: { Pagination },
   data() {
-    return {
-      Beforedisabled: false,
-      Nextdisabled: false,
-      Beforedisabled2: false,
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      Beforedisabled2: false,
       Nextdisabled2: false,
       pickerMinDate: '',
       pickerOptions: {
@@ -272,11 +276,14 @@ export default {
         isRadio4: false
       },
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
-
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2:document.documentElement.clientHeight - 85-200
     }
   },
-
+  updated() {
+    this.$refs['elTable1'].doLayout()
+    this.$refs['elTable2'].doLayout()
+  },
   created() {
     this.getDownList()
     this.getTimeFn()
@@ -294,7 +301,7 @@ export default {
       const that = this
       const end = new Date()
       const start = new Date()
-      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
       end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
       that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
       that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
@@ -309,31 +316,31 @@ export default {
       that.tab3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
       that.tab3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
       that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-      that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
       that.tab3.table.getdataListParm.parammaps.inputDatetime = [start, end]
     },
     handleTabClick() {
-      if (this.activeName == 'first') {
-        const start = new Date()
-        const end = new Date()
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
-        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+      if (this.activeName == 'first') {
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
         this.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
         this.getTabList()
       } else if (this.activeName == 'second') {
-        console.log(this.pastureList)
-        const start2 = new Date()
-        const end2 = new Date()
-        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
-        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+        console.log(this.pastureList)
+        const start2 = new Date()
+        const end2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
         this.tab2.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
         this.tab2.table.getdataListParm.parammaps.pastureid = this.pastureList[0].pastureid
         this.getTab2List()
-      } else if (this.activeName == 'third') {
-        const start3 = new Date()
-        const end3 = new Date()
-        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
-        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
+      } else if (this.activeName == 'third') {
+        const start3 = new Date()
+        const end3 = new Date()
+        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
+        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
         this.tab3.table.getdataListParm.parammaps.inputDatetime = [start3, end3]
         this.tab3.table.getdataListParm.parammaps.pastureid = this.pastureList[0].pastureid
         this.getTab3List()
@@ -639,130 +646,130 @@ export default {
         this.tab3.table.getdataListParm.offset = 1
         this.getTab3List()
       }
-    },
-
-    handleBefore() {
-      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        if (stop > Date.now() - 8.64e7) {
-          this.Nextdisabled = true
-          this.Beforedisabled = false
-        } else {
-          this.Nextdisabled = false
-          this.Beforedisabled = false
-        }
-        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.$forceUpdate()
-      }
-      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTabList()
-    },
-    handleNext() {
-      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        if (stop2 > Date.now() - 8.64e7) {
-          this.Nextdisabled = true
-          this.Beforedisabled = false
-        } else {
-          this.Nextdisabled = false
-          this.Beforedisabled = false
-        }
-        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
-        this.$forceUpdate()
-      }
-      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTabList()
-    },
-    handleBefore2() {
-      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        if (stop3 > Date.now() - 8.64e7) {
-          this.Nextdisabled2 = true
-          this.Beforedisabled2 = false
-        } else {
-          this.Nextdisabled2 = false
-          this.Beforedisabled2 = false
-        }
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
-        this.$forceUpdate()
-      }
-      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab2List()
-    },
-    handleNext2() {
-      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        if (stop4 > Date.now() - 8.64e7) {
-          this.Nextdisabled2 = true
-          this.Beforedisabled2 = false
-        } else {
-          this.Nextdisabled2 = false
-          this.Beforedisabled2 = false
-        }
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
-        this.$forceUpdate()
-      }
-      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab2List()
-    },
-    handleBefore3() {
-      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        if (stop5 > Date.now() - 8.64e7) {
-          this.Nextdisabled3 = true
-          this.Beforedisabled3 = false
-        } else {
-          this.Nextdisabled3 = false
-          this.Beforedisabled3 = false
-        }
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
-        this.$forceUpdate()
-      }
-      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab3List()
-    },
-    handleNext3() {
-      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        if (stop6 > Date.now() - 8.64e7) {
-          this.Nextdisabled3 = true
-          this.Beforedisabled3 = false
-        } else {
-          this.Nextdisabled3 = false
-          this.Beforedisabled3 = false
-        }
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
-        this.$forceUpdate()
-      }
-      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab3List()
+    },
+
+    handleBefore() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleNext() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleBefore2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop3 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleNext2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop4 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleBefore3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop5 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    handleNext3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop6 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
     }
 
   }
 }
 </script>
 <style lang="scss" scoped>
-  .search{
-    margin-bottom:10px;
-    .el-radio{margin-right: 10px;}
-    .filter-item1{margin-top: 10px;}
+  .search{
+    margin-bottom:10px;
+    .el-radio{margin-right: 10px;}
+    .filter-item1{margin-top: 10px;}
   }
 </style>

+ 327 - 264
src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue

@@ -4,8 +4,8 @@
       <el-tab-pane label="库存统计" name="first">
         <div class="search">
           <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 250px;margin-bottom:10px;" :picker-options="pickerOptions" />
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" style="float: left;" @click="handleBefore" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" style="float: left;" @click="handleNext" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" style="float: left;" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" style="float: left;" @click="handleNext" />
           <el-input v-model="tab.table.getdataListParm.parammaps.feedname" class="filter-item" style="float: left;width: 245px;margin-bottom:10px;" placeholder="饲料名称" />
           <el-button class="successBorder" style="float: left;margin-left: 10px;margin-bottom:10px;" @click="handleSearch('first')">查询</el-button>
           <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" icon="el-icon-upload2" @click="handleExport('tab1')">导出</el-button>
@@ -50,8 +50,8 @@
       <el-tab-pane label="用料分析" name="second">
         <div class="search">
           <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 245px;" :picker-options="pickerOptions" />
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
           <span style="margin-left: 10px;">统计类型:</span>
           <el-radio v-model="tab2.radio" label="1" @change="changeRadio2">牲畜类别</el-radio>
           <el-radio v-model="tab2.radio" label="2" @change="changeRadio2">栏舍名称</el-radio>
@@ -59,6 +59,8 @@
           <el-radio v-model="tab2.radio" label="4" @change="changeRadio2">TMR设备编号</el-radio>
           <el-radio v-model="tab2.radio" label="5" @change="changeRadio2">班次</el-radio>
           <el-radio v-model="tab2.radio" label="6" @change="changeRadio2">车次</el-radio>
+          <el-checkbox v-model="tab2.table.getdataListParm.checked" :true-label="1" :false-label="0" style="margin-right:10px;" @change="changeChecked">误差</el-checkbox>
+          <br>
           <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="日期" />
@@ -66,35 +68,37 @@
           <el-input v-if="tab2.isRadio5" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="班次" />
           <el-input v-if="tab2.isRadio6" v-model="tab2.table.getdataListParm.parammaps.fname" class="filter-item filter-item1" style="width: 200px;" placeholder="车次" />
           <el-button class="successBorder" @click="handleSearch('second')">查询</el-button>
-          <el-button class="export" style="float: right;margin-right: 5px;" icon="el-icon-upload2" @click="handleExport('tab2')">导出</el-button>
-        </div>
-
-        <el-table
-          :key="tab2.table.tableKey"
-          v-loading="tab2.table.listLoading"
-          element-loading-text="给我一点时间"
-          :data="tab2.table.list"
-          border
-          fit
-          highlight-current-row
-          style="width: 100%;"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable table-fixed"
-        >
-          <el-table-column v-for="item in tab2.table.tableConfig" align="center" :label="item.label" :prop="item.prop">
-            <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" align="center" :label="item1.label" :prop="item1.prop" :min-width="item1.width">
-              <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :label="item2.label" :prop="item2.prop" />
+          <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handleExport('tab2')">导出</el-button>
+        </div>
+
+        <el-table
+          :key="tab2.table.tableKey"
+          ref="elTable1"
+          v-loading="tab2.table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab2.table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight2"
+        >
+          <el-table-column v-for="(item,key) in tab2.table.tableConfig" :key="key" align="center" :label="item.label" :prop="item.prop" :fixed="key==0">
+            <el-table-column v-for="(item1,key1) in item.children" v-if="item.children || item.children.length>0" :key="key1" align="center" :label="item1.label" :prop="item1.prop" :min-width="item1.width">
+              <el-table-column v-for="(item2,key2) in item1.children" v-if="item1.children || item1.children.length>0" :key="key2" :label="item2.label" :prop="item2.prop" />
             </el-table-column>
           </el-table-column>
-        </el-table>
-        <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>
+        </el-table>
+        <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>
       </el-tab-pane>
       <el-tab-pane label="价格分析" name="third">
         <div class="search">
           <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" style="width: 250px;" :picker-options="pickerOptions" />
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled3" @click="handleBefore3" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled3" @click="handleNext3" />
+          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled3" @click="handleBefore3" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled3" @click="handleNext3" />
           <span style="margin-left: 10px;">统计类型:</span>
           <el-radio v-model="tab3.radio" label="1" @change="changeRadio3">牲畜类别</el-radio>
           <el-radio v-model="tab3.radio" label="2" @change="changeRadio3">栏舍名称</el-radio>
@@ -106,27 +110,29 @@
           <el-input v-if="tab3.isRadio4" v-model="tab3.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 185px;" placeholder="TMR设备编号" />
           <el-button class="successBorder" @click="handleSearch('third')">查询</el-button>
           <el-button class="export filter-item1" style="float: right;margin-right: 5px;" icon="el-icon-upload2" @click="handleExport('tab3')">导出</el-button>
-        </div>
-        <el-table
-          :key="tab3.table.tableKey"
-          v-loading="tab3.table.listLoading"
-          element-loading-text="给我一点时间"
-          :data="tab3.table.list"
-          border
-          fit
-          highlight-current-row
-          style="width: 100%;"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable table-fixed"
-        >
-          <el-table-column v-for="item in tab3.table.tableConfig" align="center" :label="item.label" :prop="item.prop">
-            <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" align="center" :label="item1.label" :prop="item1.prop">
-              <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :label="item2.label" :prop="item2.prop" />
+        </div>
+        <el-table
+          :key="tab3.table.tableKey"
+          ref="elTable2"
+          v-loading="tab3.table.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab3.table.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight2"
+        >
+          <el-table-column v-for="(item,key) in tab3.table.tableConfig" :key="key" align="center" :label="item.label" :prop="item.prop" :fixed="key==0">
+            <el-table-column v-for="(item1,key1) in item.children" v-if="item.children || item.children.length>0" :key="key1" align="center" :label="item1.label" :prop="item1.prop" :min-width="item1.width">
+              <el-table-column v-for="(item2,key2) in item1.children" v-if="item1.children || item1.children.length>0" :key="key2" :label="item2.label" :prop="item2.prop" />
             </el-table-column>
           </el-table-column>
-        </el-table>
-        <span v-if="tab3.table.listLoading == false && tab3.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
+        </el-table>
+        <span v-if="tab3.table.listLoading == false && tab3.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab3.table.total }}条</span>
       </el-tab-pane>
     </el-tabs>
   </div>
@@ -144,12 +150,12 @@ export default {
   name: 'PastureInventoryManagement',
   components: { Pagination },
   data() {
-    return {
-      Beforedisabled: false,
-      Nextdisabled: false,
-      Beforedisabled2: false,
-      Nextdisabled2: false,
-      Beforedisabled3: false,
+    return {
+      Beforedisabled: false,
+      Nextdisabled: false,
+      Beforedisabled2: false,
+      Nextdisabled2: false,
+      Beforedisabled3: false,
       Nextdisabled3: false,
       pickerMinDate: '',
       pickerOptions: {
@@ -207,7 +213,8 @@ export default {
             page: 1,
             offset: 1,
             pagecount: '',
-            returntype: 'Map',
+            returntype: 'Map',
+            checked: 0,
             parammaps: {
               pastureid: Cookies.get('pastureid'),
               startTime: parseTime(new Date(), '{y}-{m}-{d}'),
@@ -259,62 +266,66 @@ export default {
         isRadio2: false,
         isRadio3: false,
         isRadio4: false
-      },
+      },
       downLoad: {},
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
+      cellStyle: { padding: 0 + 'px' },
+      myHeight2: document.documentElement.clientHeight - 85 - 200
 
     }
   },
 
+  updated() {
+    this.$refs['elTable1'].doLayout()
+    this.$refs['elTable2'].doLayout()
+  },
   created() {
     this.getTabList()
     this.getTimeFn()
   },
-
   methods: {
-    getTimeFn() {
-      const that = this
-      const start = new Date()
-      const end = new Date()
-      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
-      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
-      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
-      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
-      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-      that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
-      that.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
-      that.tab2.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
-      that.tab2.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
-      that.tab2.table.getdataListParm.parammaps.inputDatetime = [start, end]
-      that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-      that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
-      that.tab3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
-      that.tab3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
-      that.tab3.table.getdataListParm.parammaps.inputDatetime = [start, end]
-      that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+    getTimeFn() {
+      const that = this
+      const start = new Date()
+      const end = new Date()
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab2.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab2.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
+      that.tab3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
+      that.tab3.table.getdataListParm.parammaps.inputDatetime = [start, end]
+      that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
       that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
     },
     handleTabClick() {
-      if (this.activeName == 'first') {
-        const start = new Date()
-        const end = new Date()
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
-        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+      if (this.activeName == 'first') {
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
         this.tab.table.getdataListParm.parammaps.inputDatetime = [start, end]
         this.getTabList()
-      } else if (this.activeName == 'second') {
-        const start2 = new Date()
-        const end2 = new Date()
-        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
-        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
+      } else if (this.activeName == 'second') {
+        const start2 = new Date()
+        const end2 = new Date()
+        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
+        end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
         this.tab2.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
         this.getTab2List()
-      } else if (this.activeName == 'third') {
-        const start3 = new Date()
-        const end3 = new Date()
-        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
-        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
+      } else if (this.activeName == 'third') {
+        const start3 = new Date()
+        const end3 = new Date()
+        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 1)
+        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 1)
         this.tab3.table.getdataListParm.parammaps.inputDatetime = [start3, end3]
         this.getTab3List()
       }
@@ -372,29 +383,39 @@ export default {
     getTab2List() {
       this.tab2.table.listLoading = true
       GetReportform(this.tab2.table.getdataListParm).then(response => {
-        if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
-          console.log('库存统计-用料分析', response.data.list)
+        if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
           this.tab2.table.data = response.data.data
-          this.tab2.table.list = response.data.list.data1
+
           for (let i = 0; i < response.data.list.data2.length; i++) {
-            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', '45px')
-                } else {
-                  this.$set(response.data.list.data2[i].children[j], 'width', '60px')
+            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
                 }
               }
-            } else {
-              this.$set(response.data.list.data2[i].children[0], 'width', '70px')
-            }
-          }
+            }
+            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')
+            }
+          }
+          this.tab2.table.list = response.data.list.data1
           this.tab2.table.tableConfig = response.data.list.data2
           this.tab2.table.total = response.data.list.data1.length
+          console.log('库存统计-用料分析this.tab2.table.data', response.data.data)
+          console.log('库存统计-用料分析this.tab2.table.list', response.data.list.data1)
+          console.log('库存统计-用料分析this.tab2.table.tableConfig', response.data.data2)
         } else {
           this.tab2.table.list = []
           this.tab2.table.data = []
-        }
+        }
         console.log(this.tab2.table.list.length)
         setTimeout(() => {
           this.tab2.table.listLoading = false
@@ -471,6 +492,26 @@ export default {
       GetReportform(this.tab3.table.getdataListParm).then(response => {
         if (response.data !== null && response.data.list.data1 !== null && response.data.list.data2 !== null) {
           console.log('库存统计-价格分析', response.data.list)
+          for (let i = 0; i < response.data.list.data2.length; i++) {
+            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')
+            }
+          }
           this.tab3.table.list = response.data.list.data1
           this.tab3.table.tableConfig = response.data.list.data2
           this.tab3.table.total = response.data.list.data1.length
@@ -481,120 +522,120 @@ export default {
           this.tab3.table.listLoading = false
         }, 100)
       })
-    },
-    handleBefore() {
-      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        if (stop > Date.now() - 8.64e7) {
-          this.Nextdisabled = true
-          this.Beforedisabled = false
-        } else {
-          this.Nextdisabled = false
-          this.Beforedisabled = false
-        }
-        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
-        this.$forceUpdate()
-      }
-      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTabList()
-    },
-    handleNext() {
-      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        if (stop2 > Date.now() - 8.64e7) {
-          this.Nextdisabled = true
-          this.Beforedisabled = false
-        } else {
-          this.Nextdisabled = false
-          this.Beforedisabled = false
-        }
-        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
-        this.$forceUpdate()
-      }
-      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTabList()
-    },
-    handleBefore2() {
-      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        if (stop3 > Date.now() - 8.64e7) {
-          this.Nextdisabled2 = true
-          this.Beforedisabled2 = false
-        } else {
-          this.Nextdisabled2 = false
-          this.Beforedisabled2 = false
-        }
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
-        this.$forceUpdate()
-      }
-      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab2List()
-    },
-    handleNext2() {
-      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        if (stop4 > Date.now() - 8.64e7) {
-          this.Nextdisabled2 = true
-          this.Beforedisabled2 = false
-        } else {
-          this.Nextdisabled2 = false
-          this.Beforedisabled2 = false
-        }
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
-        this.$forceUpdate()
-      }
-      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab2List()
-    },
-    handleBefore3() {
-      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
-        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
-        if (stop5 > Date.now() - 8.64e7) {
-          this.Nextdisabled3 = true
-          this.Beforedisabled3 = false
-        } else {
-          this.Nextdisabled3 = false
-          this.Beforedisabled3 = false
-        }
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
-        this.$forceUpdate()
-      }
-      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab3List()
-    },
-    handleNext3() {
-      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
-        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
-        if (stop6 > Date.now() - 8.64e7) {
-          this.Nextdisabled3 = true
-          this.Beforedisabled3 = false
-        } else {
-          this.Nextdisabled3 = false
-          this.Beforedisabled3 = false
-        }
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
-        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
-        this.$forceUpdate()
-      }
-      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      this.getTab3List()
+    },
+    handleBefore() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleNext() {
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop2 = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop2 > Date.now() - 8.64e7) {
+          this.Nextdisabled = true
+          this.Beforedisabled = false
+        } else {
+          this.Nextdisabled = false
+          this.Beforedisabled = false
+        }
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
+        this.$forceUpdate()
+      }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
+    },
+    handleBefore2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop3 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop3 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start3, stop3)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleNext2() {
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop4 = new Date(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab2.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop4 > Date.now() - 8.64e7) {
+          this.Nextdisabled2 = true
+          this.Beforedisabled2 = false
+        } else {
+          this.Nextdisabled2 = false
+          this.Beforedisabled2 = false
+        }
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab2.table.getdataListParm.parammaps.inputDatetime.push(start4, stop4)
+        this.$forceUpdate()
+      }
+      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab2List()
+    },
+    handleBefore3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop5 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop5 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start5, stop5)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
+    },
+    handleNext3() {
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
+        var stop6 = new Date(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab3.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
+        if (stop6 > Date.now() - 8.64e7) {
+          this.Nextdisabled3 = true
+          this.Beforedisabled3 = false
+        } else {
+          this.Nextdisabled3 = false
+          this.Beforedisabled3 = false
+        }
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab3.table.getdataListParm.parammaps.inputDatetime.push(start6, stop6)
+        this.$forceUpdate()
+      }
+      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTab3List()
     },
     changeRadio3() {
       console.log(this.tab3.radio)
@@ -632,62 +673,79 @@ export default {
         this.getTab3List()
       }
     },
+    changeChecked(item) {
+      this.handleSearch('second')
+    },
     handleExport(item) {
       if (item == 'tab1') {
-        console.log('库存统计导出')
-        this.downLoad.getdataListParm = {}
-        this.downLoad.getdataListParm.name = 'getfsStaticlist'
-        this.downLoad.getdataListParm.pagecount = ''
-        this.downLoad.getdataListParm.parammaps = this.tab.table.getdataListParm.parammaps
-        GetDataByName(this.downLoad.getdataListParm).then(response => {
-          if (response.data.list !== null) {
-            this.$nextTick(() => {
-              this.downLoad.list = response.data.list
-            })
-          } else {
-            this.downLoad.list = []
-          }
-          import('@/vendor/Export5Excel').then(excel => {
-            const multiHeader = [['饲料名称', '期初', '', '用量', '', '', '', '期末', '']]
-            const multiHeader2 = [['', '期初库存(kg)', '期初金额(元)', '入库重量(kg)', '系统出库重量(kg)', '人工用料重量(kg)', '损耗重量', '期末库存(kg)', '期末金额(元)']]
-            const filterVal = ['feedname', 'startsum', 'startprice', 'laidsum', 'usesumXT', 'usesumRG', 'usesumXH', 'stopsum', 'stopprice']
-            const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
-            const merges = ['A1:A2', 'B1:C1', 'D1:G1', 'H1:I1']
-            excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '库存统计', merges })
-          })
-        })
+        console.log('库存统计导出')
+        this.downLoad.getdataListParm = {}
+        this.downLoad.getdataListParm.name = 'getfsStaticlist'
+        this.downLoad.getdataListParm.pagecount = ''
+        this.downLoad.getdataListParm.parammaps = this.tab.table.getdataListParm.parammaps
+        GetDataByName(this.downLoad.getdataListParm).then(response => {
+          if (response.data.list !== null) {
+            this.$nextTick(() => {
+              this.downLoad.list = response.data.list
+            })
+          } else {
+            this.downLoad.list = []
+          }
+          import('@/vendor/Export5Excel').then(excel => {
+            const multiHeader = [['饲料名称', '期初', '', '用量', '', '', '', '期末', '']]
+            const multiHeader2 = [['', '期初库存(kg)', '期初金额(元)', '入库重量(kg)', '系统出库重量(kg)', '人工用料重量(kg)', '损耗重量', '期末库存(kg)', '期末金额(元)']]
+            const filterVal = ['feedname', 'startsum', 'startprice', 'laidsum', 'usesumXT', 'usesumRG', 'usesumXH', 'stopsum', 'stopprice']
+            const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
+            const merges = ['A1:A2', 'B1:C1', 'D1:G1', 'H1:I1']
+            excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '库存统计', merges })
+          })
+        })
       } else if (item == 'tab2') {
         console.log('用料分析导出数据', this.tab2.table.list)
         console.log('用料分析导出表头', this.tab2.table.tableConfig)
+        console.log(this.tab2.table.getdataListParm.checked, 'checked')
         var exportData = []
         var exportTitle1 = [] // 一级标题
         var exportTitle2 = [] // 二级标题
+        var filterValArr = []
         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)
+            filterValArr.push(this.tab2.table.tableConfig[i].children[j].prop)
           }
         }
         console.log('一级标题exportTitle1', exportTitle1)
         console.log('二级标题exportTitle2', exportTitle2)
+        console.log('对应字段filterValArr', filterValArr)
         var headerArr = []// 处理一级标题
-        for (let i = 0; i < exportTitle1.length; i++) {
-          if (i > 0) {
-            headerArr.push(exportTitle1[i], '', '', '')
-          } else {
-            headerArr.push(exportTitle1[i])
+        if (this.tab2.table.getdataListParm.checked == 1) {
+          for (let i = 0; i < exportTitle1.length; i++) {
+            if (i > 0) {
+              headerArr.push(exportTitle1[i], '', '', '')
+            } else {
+              headerArr.push(exportTitle1[i])
+            }
           }
-        }
-        console.log('一级表头处理后', headerArr)
-        var valueArr = [] // 对应字段
-        for (let i = 0; i < exportTitle2.length; i++) {
-          if (i == 0) {
-            valueArr.push('A')
-          } else {
-            valueArr.push('a' + [i - 1])
+        } else {
+          for (let i = 0; i < exportTitle1.length; i++) {
+            if (i > 0) {
+              headerArr.push(exportTitle1[i], '')
+            } else {
+              headerArr.push(exportTitle1[i])
+            }
           }
         }
-        console.log('对应字段valueArr', valueArr)
+        console.log('一级表头处理后', headerArr)
+        // var valueArr = [] // 对应字段
+        // for (let i = 0; i < exportTitle2.length; i++) {
+        //   if (i == 0) {
+        //     valueArr.push('A')
+        //   } else {
+        //     valueArr.push('a' + [i - 1])
+        //   }
+        // }
+        // console.log('对应字段valueArr', valueArr)
         if (headerArr.length > 0) {
           import('@/vendor/Export3Excel').then((excel) => {
             const multiHeader = [
@@ -695,13 +753,10 @@ export default {
             ]
             const multiHeader2 = []
             const tHeader = exportTitle2
-            const filterVal = valueArr// 表头所对应的字段,这里未填写
+            const filterVal = filterValArr
             const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
-            // const data = [];
-            // 进行所有表头的单元格合并
-            // const merges = ['A1:A1', 'B1:E1','F1:J1' ];
+            // const data = []
             const merges = ['A1:A1']
-
             excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
           })
         }
@@ -777,10 +832,18 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
-  .search{
-    margin-bottom:10px;
-    .el-radio{margin-right: 10px;}
-    .filter-item1{margin-top: 10px;}
+  .search{
+    margin-bottom:10px;
+    .el-radio{margin-right: 10px;}
+    .filter-item1{margin-top: 10px;}
   }
+  /deep/ .el-table th>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
+  /deep/ .el-table td>.cell{
+    padding-left: 0 !important;;
+    padding-right: 0 !important;;
+  }
   // .el-radio{margin-right: 20px;}
 </style>

+ 22 - 21
src/views/systemManagement/role/index.vue

@@ -10,9 +10,9 @@
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
     </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="handleDelete">删除</el-button>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="handleDelete">删除</el-button>
     </div>
     <div class="table">
       <el-table
@@ -67,18 +67,18 @@
           <template slot-scope="{row}">
             <!-- 页面权限 -->
             <a v-if="row.NoEdit && isRoleEdit" class="correcting" @click="handleRole(row)">页面权限</a>
-            <span v-if="row.NoEdit && isRoleEdit" class="centerSpan">|</span>
+            <span v-if="row.NoEdit && isRoleEdit" class="centerSpan">|</span>
             <!-- 新增 -->
             <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="createData(row)" />
-            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
+            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-close" class="minCancel" @click="createCancel(row)" />
             <!-- 编辑 -->
             <el-button v-if="row.isUpdate && isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
-            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="row.isUpdate && isRoleEdit" icon="el-icon-delete" class="miniDanger" @click="handleRowDelete(row)" />
             <!-- 编辑保存 -->
             <el-button v-if="row.isUpdateSave && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="updateData(row)" />
-            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="row.isUpdateSave && isRoleEdit" icon="el-icon-close" class="minCancel" @click="updateCancel(row)" />
           </template>
         </el-table-column>
@@ -87,18 +87,18 @@
     </div>
 
     <el-dialog :fullscreen="dialogFull" :visible.sync="role.dialogFormVisible" :close-on-click-modal="false" width="70%">
-      <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[role.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>
+      <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[role.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="role-details inside-base">
         <div class="inside-base-main clearfix">
           <div class="inside-base-cont">
@@ -152,7 +152,7 @@ export default {
   name: 'Role',
   components: { Pagination },
   data() {
-    return {
+    return {
       dialogFull: false,
       isRoleEdit: [],
       enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
@@ -477,7 +477,7 @@ export default {
     },
     handleRole(row) {
       this.role.temp = Object.assign({}, row)
-      console.log('点击了行内页面权限')
+      console.log('点击了行内页面权限')
       this.dialogFull = false
       this.role.dialogStatus = 'role'
       this.role.dialogFormVisible = true
@@ -888,6 +888,7 @@ export default {
         seebutton: '@insertSpotList.seebutton',
         editbutton: '@insertSpotList.editbutton'
       }}
+      console.log(JSON.stringify(this.requestParam),'this.requestParam')
       ExecDataByConfig(this.requestParam).then(response => {
         console.log('权限菜单保存发送参数', this.requestParam)
         if (response.msg === 'fail') {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä