Browse Source

剩料计划&推料计划

Shan9312 1 year ago
parent
commit
10b4f9bd1e
25 changed files with 8141 additions and 9920 deletions
  1. 52 0
      src/lang/en/langModule/premixedPlan.js
  2. 61 2
      src/lang/zn/langModule/premixedPlan.js
  3. 2 2
      src/views/basicData/sapLog/index.vue
  4. 1 1
      src/views/formulationPlan/dailyExecutionPlan/historyRecord.vue
  5. 6 6
      src/views/formulationPlan/dailyExecutionPlan/index.vue
  6. 42 42
      src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue
  7. 19 19
      src/views/formulationPlan/dailyExecutionPlan/typePage/surplusMaterialPlan.vue
  8. 6 6
      src/views/formulationPlan/materialIssuancePlan/historyRecord.vue
  9. 54 54
      src/views/formulationPlan/materialIssuancePlan/index.vue
  10. 0 1890
      src/views/formulationPlan/materialIssuancePlan/index1.vue
  11. 9 9
      src/views/formulationPlan/pushMaterialPlan/index.vue
  12. 21 21
      src/views/formulationPlan/surplusMaterialPlan/index.vue
  13. 929 929
      src/views/shedProduction/dungScores/index.vue
  14. 886 886
      src/views/shedProduction/fecalScreen/index.vue
  15. 902 902
      src/views/shedProduction/formulaDryMatter/index.vue
  16. 858 858
      src/views/shedProduction/materialRemainingRecord/index.vue
  17. 932 932
      src/views/shedProduction/pennsylvaniaSieve/index.vue
  18. 2 2
      src/views/shedProduction/performance/index.vue
  19. 956 956
      src/views/shedProduction/physicalConditionScore/index.vue
  20. 1 1
      src/views/statisticalAnalysis/processAnalysis/group/index.vue
  21. 1 1
      src/views/statisticalAnalysis/processAnalysis/pasture/index.vue
  22. 2 2
      src/views/systemManagement/boardEchartManagement/index.vue
  23. 909 909
      src/views/systemManagement/boardEchartManagement2/index.vue
  24. 909 909
      src/views/systemManagement/operationManagement/group/index.vue
  25. 581 581
      src/views/systemManagement/operationManagement/pasture/index.vue

+ 52 - 0
src/lang/en/langModule/premixedPlan.js

@@ -12,9 +12,61 @@ fljhcsgs:"Material Issuance Plan with Batch Following",
 time:"Time",
 
 
+y:"Verification",
+zdsc:"Auto-generated",
+save:"Save",
+qkyfls:"Clear Assigned Pens",
+bc:"shift",
+lsjl:"Historical Record",
+ms:"Description",
+zdzl:"Maximum Weight",
+hjzl:"Total Weight",
+pfmb:"recipe template",
+wlxq:"Material Details",
+xq:"Details",
+sftqcfxl:"Whether to Split Small Materials in Advance",
+rlzt:"Capacity Status",
+sl:"Spread Feed",
+lsqc:"Full Name of the Stall",
+slzl:"feed weight",
+slc:"Spreader Truck",
+qxzzdscfa1:'Please select the automatic generation method',
+qxzzdscfa2:"Clear the plan and generate a new plan",
+qxzzdscfa3:"Continue to generate plans based on the current plan",
+jxsc:"Continue Generating",
+cxsc:"Regenerate",
 
+weight:"weight",
+zb:"Proportion",
+wl:"Material",
+fpsl:"Distribute Feed",
+clrj:"Vehicle Volume Capacity",
+rjl:"Volume Capacity",
+qk:"Empty",
+tlc:"Feed Pushcart",
+status:'Status',
+ls:"Shelter",
+clbm:"Vehicle Code",
+tljh:"Feed Push Plan",
 
+scc:"Reduce Batches",
+slclfs:"Leftover Material Disposal Method",
+ztls:"Transfer to Pens",
+cci:"batch:",
+lsname:"Shelter Name:",
 
+fuzhi:'Copy',
+taici:"Parity",
+pjmrts:"Average Lactation Days",
+hyts:"Pregnancy Duration",
+cnl:"产奶量(kg/头)",
+jlr:"Recorder",
+sxsj:"Effective Time",
+sxrq:"Effective Date",
+jlr:"Recorder:",
+lsxx:"Pen Information",
+sxlb:"livestock categories:",
+nts:"Head Count of Cattle:",
 
 
 }

+ 61 - 2
src/lang/zn/langModule/premixedPlan.js

@@ -5,11 +5,70 @@ jscc:"减少车次",
 sx:"生效",
 jy:"禁用",
 tmrbh:"TMR编号",
-sljhccgs:"撒料计划车次跟随",
+sljhccgs:"撒料计划车次跟随:",
 zdjbl:"最大搅拌量(KG)",
 hlzl:"混料重量",
 fljhcsgs:"发料计划车次跟随",
-time:"时间",
+time:"时间:",
+
+jy:"校验",
+zdsc:"自动生成",
+save:"保存",
+qkyfls:"清空已分配栏舍",
+bc:"班次",
+lsjl:"历史记录",
+ms:"描述",
+zdzl:"最大重量",
+hjzl:"合计重量",
+pfmb:"模板配方",
+wlxq:"物料详情",
+xq:"详情",
+sftqcfxl:"是否提前小料拆分",
+rlzt:"容量状态",
+sl:"撒料",
+lsqc:"栏舍全称",
+slzl:"饲料重量",
+slc:"撒料车",
+qxzzdscfa1:'请选择自动生成方式',
+qxzzdscfa2:"清空计划并生成新计划",
+qxzzdscfa3:"当前计划基础上继续生成计划",
+jxsc:"继续生成",
+cxsc:"重新生成",
+weight:"重量",
+zb:"占比",
+wl:"物料",
+fpsl:"分配撒料",
+clrj:"车辆容积量",
+rjl:"容积量",
+qk:"清空",
+tlc:"推料车",
+status:'状态',
+ls:"栏舍",
+clbm:"车辆编码",
+tljh:"推料计划",
+
+jscc:"减少车次",
+slclfs:"剩料处理方式",
+ztls:"转投栏舍",
+cci:"车次:",
+lsname:"栏舍名称:",
+
+fuzhi:'复制',
+taici:"胎次",
+pjmrts:"平均泌乳天数",
+hyts:"怀孕天数",
+cnl:"产奶量(kg/头)",
+jlr:"记录人",
+sxsj:"生效时间",
+sxrq:"生效日期",
+jlr:"记录人:",
+lsxx:"栏舍信息",
+sxlb:"牲畜类别:",
+nts:"牛头数:",
+
+
+
+
 
 
 

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

@@ -114,7 +114,7 @@
             <el-table-column label="原料编码" min-width="90px" align="center" prop="msgtext" />
             <el-table-column label="原料名称" min-width="90px" align="center" prop="url" />
             <el-table-column label="原料类型" min-width="90px" align="center" prop="createTime" />
-            <el-table-column label="重量" min-width="90px" align="center" prop="createTime" />
+            <el-table-column :label="$t('premixedPlan.weight')" min-width="90px" align="center" prop="createTime" />
             <el-table-column :label="$t('formulationEvaluation.sort')" min-width="90px" align="center" prop="createTime" />
             <el-table-column label="允许误差" min-width="90px" align="center" prop="createTime" />
           </el-table>
@@ -173,7 +173,7 @@
             <el-table-column :label="$t('formulationEvaluation.xh')" min-width="90px" align="center" prop="pastureName" />
             <el-table-column :label="$t('errorAnalysis.date')" min-width="90px" align="center" prop="status" />
             <el-table-column :label="$t('errorAnalysis.pen')" min-width="90px" align="center" prop="msgtext" />
-            <el-table-column label="重量" min-width="90px" align="center" prop="url" />
+            <el-table-column :label="$t('premixedPlan.weight')" min-width="90px" align="center" prop="url" />
           </el-table>
         </div>
         <span v-if="type.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">{{$t('processAnalysis.total')}}{{ type.table.total }}{{$t('processAnalysis.tiao')}}</span>

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

@@ -136,7 +136,7 @@
                 <span>{{ scope.row.fname }}</span>
               </template>
             </el-table-column>
-            <el-table-column v-if="table3.getdataListParm.parammaps.lpplantype == 3" label="转投栏舍" min-width="130px" align="center">
+            <el-table-column v-if="table3.getdataListParm.parammaps.lpplantype == 3" :label="$t('premixedPlan.ztls')"min-width="130px" align="center">
               <template slot-scope="scope">
                 <span>{{ scope.row.useinbar }}</span>
               </template>

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

@@ -13,7 +13,7 @@
 :placeholder="$t('processAnalysis.planType')"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-select v-model="table.getdataListParm.parammaps.times" filterable :placeholder="$t('premixedPlan.bc')"   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;">
@@ -36,7 +36,7 @@
         <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button>
         <el-button class="export" style="margin-left: -5px;" @click="form_deleteRecord">删除记录</el-button>
       </div>
-      <div class="operation" style="margin-bottom: 10px;">
+      <div class="operation" style="margin-bottom: 26px;">
         <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>
@@ -137,7 +137,7 @@
               <span>{{ scope.row.cowcount }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="描述" min-width="80px" align="center">
+          <el-table-column :label="$t('premixedPlan.ms')"min-width="80px" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.display }}</span>
             </template>
@@ -412,7 +412,7 @@
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="转投栏舍" min-width="130px" align="center">
+                <el-table-column :label="$t('premixedPlan.ztls')"min-width="130px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
@@ -863,7 +863,7 @@
             <el-table-column :label="$t('premixedPlan.time')"   min-width="80px" align="center" prop="plantime" />
             <el-table-column  :label="$t('errorAnalysis.feedName')"  min-width="100px" align="center" prop="ftname" />
             <el-table-column :label="$t('formulationEvaluation.nts')" min-width="80px" align="center" prop="cowcount" />
-            <el-table-column label="描述" min-width="80px" align="center" prop="display" />
+            <el-table-column :label="$t('premixedPlan.ms')"min-width="80px" align="center" prop="display" />
             <el-table-column label="发料位" min-width="80px" align="left" prop="barnames" />
           </el-table>
           <span v-if="deleteRecord.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">{{$t('processAnalysis.total')}}{{ deleteRecord.total }}{{$t('processAnalysis.tiao')}}</span>
@@ -879,7 +879,7 @@
         <el-form ref="sapUpload" :rules="sapUpload.rules" :model="sapUpload.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
           <el-row>
             <el-col :span="24">
-              <el-form-item label="时间:" prop="date">
+              <el-form-item :label="$t('premixedPlan.time')"  prop="date">
                 <el-date-picker v-model="sapUpload.temp.date" :clearable="false" class="filter-item" type="date" />
               </el-form-item>
             </el-col>

+ 42 - 42
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -1,18 +1,18 @@
 <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 v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">{{$t('premixedPlan.xzcc')}}
       </el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">{{$t('premixedPlan.jscc')}}</el-button>
       <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder" >{{$t('formulationEvaluation.ggsx')}}</el-button>
       <div v-else style="float: left;margin-left: 10px;">
-        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存 </el-button>
+        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">{{$t('premixedPlan.save')}}   </el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">{{$t('formulationEvaluation.cancel')}}</el-button>
       </div>
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> {{$t('premixedPlan.sx')}}</el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> {{$t('premixedPlan.jy')}}</el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
-        <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency" >
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> {{$t('premixedPlan.qkyfls')}}</el-button>
+        <el-select v-model="table.getdataListParm.parammaps.times" filterable :placeholder="$t('premixedPlan.bc')"   class="filter-item" style="width: 120px;" @change="changeFrequency" >
           <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
         </el-select>
     </div>
@@ -45,7 +45,7 @@
             <span>{{ scope.row.tmrname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="描述" width="110px" align="center">
+        <el-table-column :label="$t('premixedPlan.ms')"width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.display }}</span>
           </template>
@@ -72,38 +72,38 @@
             <span>{{ scope.row.begintime }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="最大重量" width="75px" align="center">
+        <el-table-column :label="$t('premixedPlan.zdzl')" 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">
+        <el-table-column :label="$t('premixedPlan.hjzl')" width="80px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.sumweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="模板配方" width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.pfmb')"width="90px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.ftname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="物料详情" width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.wlxq')"  width="90px" align="center">
           <template slot-scope="scope">
             <el-popover
               placement="bottom"
               width="400"
               trigger="click">
-              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+              <b style="text-align: center;width:100%;display:inline-block;">{{$t('premixedPlan.wlxq')}}</b>
               <el-table :data="materialdetailsList" border height="200">
-                <el-table-column min-width="150" property="fname" label="物料" />
-                <el-table-column min-width="100" property="fweight" label="重量" />
-                <el-table-column min-width="100" property="scale" label="占比" />
+                <el-table-column min-width="150" property="fname" :label="$t('premixedPlan.wl')" />
+                <el-table-column min-width="100" property="fweight" :label="$t('premixedPlan.weight')" />
+                <el-table-column min-width="100" property="scale" :label="$t('premixedPlan.zb')" />
               </el-table>
-              <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">详情</span>
+              <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">{{$t('premixedPlan.xq')}}</span>
             </el-popover>
           </template>
         </el-table-column>
-        <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="70px" align="center">
+        <el-table-column v-show="isInforvalue" :label="$t('premixedPlan.sftqcfxl')" width="70px" align="center">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.issplit"
@@ -115,14 +115,14 @@
             />
           </template>
         </el-table-column>
-        <el-table-column label="容量状态" width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.rlzt')" width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.volumeStatus == 1" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
             <span v-if="scope.row.volumeStatus == 2" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
             <span v-if="scope.row.volumeStatus == 0" style="color:green;">{{ scope.row.volumeStatusStr }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
+        <el-table-column :label="$t('premixedPlan.sl')"min-width="250px" align="left" header-align="center">
           <template slot-scope="scope">
             <div v-for="element in scope.row.arrList" :key="element.name" class="list">
               <el-tooltip placement="top" :open-delay="1000">
@@ -184,7 +184,7 @@
         >
           <el-row>
             <el-col :span="8">
-              <el-form-item label="生效:" prop="sel">
+              <el-form-item :label="$t('premixedPlan.sx')"prop="sel">
                 <el-switch
                   v-model="create.temp.sel"
                   active-color="#13ce66"
@@ -195,11 +195,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="TMR编号:" prop="tmrid2">
+              <el-form-item :label="$t('premixedPlan.tmrbh')"  prop="tmrid2">
                 <el-select
                   v-model="create.temp.tmrid2"
                   style="width: 100%;"
-                  placeholder="TMR编号"
+                  :placeholder="$t('premixedPlan.tmrbh')"
                   @change="changeTMRNumber"
                 >
                   <el-option v-for="item in TMRNumberList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" />
@@ -207,11 +207,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="班次:" prop="times">
+              <el-form-item :label="$t('premixedPlan.bc')"  prop="times">
                 <el-select
                   v-model="create.temp.times"
                   :disabled="create.list2.length>0"
-                  placeholder="班次"
+                  :placeholder="$t('premixedPlan.bc')"
                   style="width:100%;"
                   @change="changeTimes"
                 >
@@ -222,7 +222,7 @@
           </el-row>
           <el-row>
             <el-col :span="8">
-              <el-form-item label="提前小料拆分:" prop="issplit">
+              <el-form-item :label="$t('premixedPlan.sftqcfxl')"  prop="issplit">
                 <el-switch
                   v-model="create.temp.issplit"
                   active-color="#13ce66"
@@ -233,7 +233,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="时间:" prop="begintime">
+              <el-form-item :label="$t('premixedPlan.time')"   prop="begintime">
                 <el-time-picker
                   v-model="create.temp.begintime"
                   style="width: 100%;"
@@ -246,7 +246,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="模板配方:" prop="ftid">
+              <el-form-item :label="$t('premixedPlan.pfmb')"prop="ftid">
                 <el-select
                   v-model="create.temp.ftid"
                   :disabled="create.list2.length>0"
@@ -266,7 +266,7 @@
           </el-row>
           <el-row>
             <el-col :span="8">
-              <el-form-item label="描述:" prop="display">
+              <el-form-item :label="$t('premixedPlan.ms')" prop="display">
                 <el-input
                   v-model="create.temp.display"
                   type="textarea"
@@ -286,7 +286,7 @@
             class="save"
             :disabled="isokDisable"
             @click="distributionAndSpreading()"
-          >分配撒料</el-button>
+          >{{$t('premixedPlan.fpsl')}} </el-button>
         </div>
         <!-- 栏舍 -->
         <div v-if="create.dialogStatus =='update' || isDispaly" class="bottom" style="border-top: 1px solid #009C69;">
@@ -319,13 +319,13 @@
                               placement="right"
                               width="400"
                               trigger="click">
-                              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                              <b style="text-align: center;width:100%;display:inline-block;">{{$t('premixedPlan.wlxq')}}</b>
                               <el-table :data="materialdetailsList" height="200" border>
-                                <el-table-column min-width="150" property="fname" label="物料" />
-                                <el-table-column min-width="100" property="fweight" label="重量" />
-                                <el-table-column min-width="100" property="scale" label="占比" />
+                                <el-table-column min-width="150" property="fname" :label="$t('premixedPlan.wl')" />
+                                <el-table-column min-width="100" property="fweight" :label="$t('premixedPlan.weight')" />
+                                <el-table-column min-width="100" property="scale" :label="$t('premixedPlan.zb')" />
                               </el-table>
-                              <!-- <span  style="color: blue;">详情</span> -->
+                              <!-- <span  style="color: blue;">{{$t('premixedPlan.xq')}}</span> -->
                               <button slot="reference" style="background: #ccc;float: right;color: #fff;width: 18px;height:18px;font-size: 16px;border: none;text-align: center;" :disabled="isokDisable">?</button>
                             </el-popover>
                           </div>
@@ -341,17 +341,17 @@
             </el-col>
             <el-col :span="4">
               <div style="text-align: center;height: 100px;margin-top: 40px;">
-                <div class="maxweight" style="line-height:20px;"><b>车辆容积量:</b>{{ create.temp.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
+                <div class="maxweight" style="line-height:20px;"><b>{{$t('premixedPlan.clrj')}} :</b>{{ create.temp.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
                 <!-- <div class="maxweight" style="line-height:20px;"><b>最大重量:</b>{{ create.temp.maxweight }} (KG)</div> -->
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;"> <b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>容积量:</b>{{ create.temp.volume }} m³ </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;"> <b>{{$t('premixedPlan.hjzl')}} :</b>{{ create.temp.sumweight }} (KG) </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>{{$t('premixedPlan.rjl')}} :</b>{{ create.temp.volume }} m³ </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>{{$t('premixedPlan.rjl')}} :</b>{{ create.temp.volume }} m³ </div>
               </div>
             </el-col>
           </el-row>
           <!-- 撒料 -->
           <div class="spreadingMaterial">
-            <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
+            <div>{{$t('premixedPlan.sl')}} <el-button type="danger" @click="handleEmpty">{{$t('premixedPlan.qk')}} </el-button></div>
             <div class="spreadingMaterialList">
               <!-- force-fallback="true" -->
               <draggable
@@ -428,11 +428,11 @@
                       width="400"
                       height="200"
                       trigger="click">
-                      <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                      <b style="text-align: center;width:100%;display:inline-block;">{{$t('premixedPlan.wlxq')}}</b>
                       <el-table :data="materialdetailsList" height="200" border>
-                       <el-table-column min-width="150" property="fname" label="物料" />
-                       <el-table-column min-width="100" property="fweight" label="重量" />
-                       <el-table-column min-width="100" property="scale" label="占比" />
+                       <el-table-column min-width="150" property="fname" :label="$t('premixedPlan.wl')" />
+                       <el-table-column min-width="100" property="fweight" :label="$t('premixedPlan.weight')" />
+                       <el-table-column min-width="100" property="scale" :label="$t('premixedPlan.zb')" />
                       </el-table>
                       <i slot="reference" class="el-icon-question" style="position: absolute;right: 0;top: 20px;"/>
                     </el-popover>
@@ -1911,7 +1911,7 @@ export default {
         this.requestParam.data[0] = { 'name': 'deleteLpplandtl1dateAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid'),date:this.date }},
         this.requestParam.data[1] = { 'name': 'deletefpdetaildateAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid'),date:this.date }},
         ExecDataByConfig(this.requestParam).then(response => {
-          console.log('清空已分配栏舍', this.requestParam)
+
           if (response.msg === 'fail') {
             this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
           } else {

+ 19 - 19
src/views/formulationPlan/dailyExecutionPlan/typePage/surplusMaterialPlan.vue

@@ -1,21 +1,21 @@
 <template>
   <div>
     <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate">新增车次
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate">{{$t('premixedPlan.xzcc')}}
       </el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="form_delete">减少车次
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="form_delete">{{$t('premixedPlan.jscc')}}
       </el-button>
-      <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">校验</el-button>
+      <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">{{$t('premixedPlan.jy')}}  </el-button>
       <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success"
         @click="handleChangeOrder">{{$t('formulationEvaluation.ggsx')}}</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 v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">{{$t('premixedPlan.save')}}
         </el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">{{$t('formulationEvaluation.cancel')}}</el-button>
       </div>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">生效
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">{{$t('premixedPlan.sx')}}
       </el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">{{$t('premixedPlan.jy')}}
       </el-button>
     </div>
     <div class="search" />
@@ -69,12 +69,12 @@
           </template>
         </el-table-column>
 
-        <el-table-column label="剩料处理方式" min-width="130px" align="center">
+        <el-table-column :label="$t('premixedPlan.slclfs')"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">
+        <el-table-column :label="$t('premixedPlan.ztls')"min-width="130px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.hstr }}</span>
           </template>
@@ -109,12 +109,12 @@
         <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="6">
-              <el-form-item label="车次:" prop="sort">
+              <el-form-item :label="$t('premixedPlan.cci')"prop="sort">
                 <el-input ref="sort" v-model="create.temp.sort" class="filter-item" type="number" :placeholder="$t('errorAnalysis.projname')"  />
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="栏舍名称:" prop="barid">
+              <el-form-item :label="$t('premixedPlan.lsname')" prop="barid">
                 <el-select v-model="create.temp.barid" multiple filterable :placeholder="$t('errorAnalysis.isHouseName')"  class="filter-item"
                   style="width:100%; " @change="changeBars">
                   <el-option v-for="item in barsList" :key="item.id" :label="item.bname" :value="item.id" />
@@ -123,14 +123,14 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="TMR编号:" prop="tmrid">
-                <el-select v-model="create.temp.tmrid" filterable placeholder="TMR编号" class="filter-item"
+                <el-select v-model="create.temp.tmrid" filterable :placeholder="$t('premixedPlan.tmrbh')"   class="filter-item"
                   style="width: 100%;" @change="changeTMRNumber">
                   <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="生效:" prop="sort">
+              <el-form-item :label="$t('premixedPlan.sx')"prop="sort">
                 <el-switch ref="enable" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949"
                   :active-value="1" :inactive-value="0" />
               </el-form-item>
@@ -138,30 +138,30 @@
           </el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="班次:" prop="times">
-                <el-select v-model="create.temp.times" filterable placeholder="班次" class="filter-item"
+              <el-form-item :label="$t('premixedPlan.bc')"  prop="times">
+                <el-select v-model="create.temp.times" filterable :placeholder="$t('premixedPlan.bc')"   class="filter-item"
                   style="width: 100%;" @change="changeTimes">
                   <el-option v-for="item in frequencyList" :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="lppid">
-                <el-select v-model="create.temp.lppid" filterable placeholder="撒料计划车次跟随" class="filter-item"
+              <el-form-item :label="$t('premixedPlan.sljhccgs')"  prop="lppid">
+                <el-select v-model="create.temp.lppid" filterable :placeholder="$t('premixedPlan.sljhccgs')"  class="filter-item"
                   style="width: 100%;" @change="changeCarFollow">
                   <el-option v-for="item in carFollowList" :key="item.id" :label="item.lppcode" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="时间:" prop="rtime">
+              <el-form-item :label="$t('premixedPlan.time')"  prop="rtime">
 
                 <el-time-picker v-model="create.temp.rtime" type="datetime" placeholder="选择时间" format="HH:mm"
                   value-format="HH:mm" style="display: inline-block;width: 95%;" />
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="剩料处理方式:" prop="treatmethod">
+              <el-form-item :label="$t('premixedPlan.slclfs')"  prop="treatmethod">
                 <el-select v-model="create.temp.treatmethod" filterable placeholder="剩料处理方式" class="filter-item"
                   style="width: 100%;" @change="changeResidueDisposal">
                   <el-option v-for="item in residueDisposalList" :key="item.value" :label="item.label"
@@ -172,7 +172,7 @@
           </el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="转投栏舍:" prop="useinbarid">
+              <el-form-item :label="$t('premixedPlan.ztls')"  prop="useinbarid">
                 <el-select v-model="create.temp.useinbarid" filterable placeholder="转投栏舍" class="filter-item"
                   style="width: 100%;" @change="changeTransferbars" :disabled='isDis'>
                   <el-option v-for="item in transferbarsList" :key="item.id" :label="item.bname" :value="item.id" />

+ 6 - 6
src/views/formulationPlan/materialIssuancePlan/historyRecord.vue

@@ -31,7 +31,7 @@
             <span>{{ scope.row.tmrname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="描述" width="110px" align="center">
+        <el-table-column :label="$t('premixedPlan.ms')"width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.display }}</span>
           </template>
@@ -51,27 +51,27 @@
             <span>{{ scope.row.begintime }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="最大重量" width="80px" align="center">
+        <el-table-column :label="$t('premixedPlan.zdzl')" 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">
+        <el-table-column :label="$t('premixedPlan.hjzl')" 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">
+        <el-table-column :label="$t('premixedPlan.pfmb')"width="120px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.ftname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="是否提前小料拆分" width="100px" align="center">
+        <el-table-column :label="$t('premixedPlan.sftqcfxl')" width="100px" 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" disabled />
           </template>
         </el-table-column>
-        <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
+        <el-table-column :label="$t('premixedPlan.sl')"min-width="250px" align="left" header-align="center">
           <template slot-scope="scope">
             <div v-for="element in scope.row.arrList" :key="element.name" class="list">
               <el-tooltip placement="top" :open-delay="1000">

+ 54 - 54
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -1,27 +1,27 @@
 <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 v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">{{$t('premixedPlan.xzcc')}}
       </el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">{{$t('premixedPlan.jscc')}}</el-button>
-      <el-button v-if="isRoleEdit && ischeck" class="danger" style="float: left;" @click="handleCheck">校验</el-button>
-      <el-button v-else-if="isRoleEdit && !ischeck" class="success" style="float: left;" @click="handleCheck">校验</el-button>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-download" style="float:left;" @click="handleAutomaticGeneration">自动生成</el-button>
+      <el-button v-if="isRoleEdit && ischeck" class="danger" style="float: left;" @click="handleCheck">{{$t('premixedPlan.jy')}}  </el-button>
+      <el-button v-else-if="isRoleEdit && !ischeck" class="success" style="float: left;" @click="handleCheck">{{$t('premixedPlan.jy')}}  </el-button>
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-download" style="float:left;" @click="handleAutomaticGeneration">{{$t('premixedPlan.zdsc')}}  </el-button>
       <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder">{{$t('formulationEvaluation.ggsx')}}</el-button>
       <div v-else style="float: left;margin-left: 10px;">
-        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存 </el-button>
+        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">{{$t('premixedPlan.save')}}   </el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">{{$t('formulationEvaluation.cancel')}}</el-button>
       </div>
       <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> {{$t('premixedPlan.sx')}}</el-button>
       <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> {{$t('premixedPlan.jy')}}</el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
-      <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;float: left;margin-left: 10px;" @change="changeFrequency">
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> {{$t('premixedPlan.qkyfls')}}</el-button>
+      <el-select v-model="table.getdataListParm.parammaps.times" filterable :placeholder="$t('premixedPlan.bc')"   class="filter-item" style="width: 120px;float: left;margin-left: 10px;" @change="changeFrequency">
         <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
-      <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button>
+      <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">{{$t('premixedPlan.lsjl')}}</el-button>
     </div>
     <!-- <div class="search">
-      <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency">
+      <el-select v-model="table.getdataListParm.parammaps.times" filterable :placeholder="$t('premixedPlan.bc')"   class="filter-item" style="width: 120px;" @change="changeFrequency">
         <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
     </div> -->
@@ -54,7 +54,7 @@
             <span>{{ scope.row.tmrname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="描述" width="110px" align="center">
+        <el-table-column :label="$t('premixedPlan.ms')" width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.display }}</span>
           </template>
@@ -74,50 +74,50 @@
             <span>{{ scope.row.begintime }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="最大重量" width="75px" align="center">
+        <el-table-column :label="$t('premixedPlan.zdzl')" 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">
+        <el-table-column :label="$t('premixedPlan.hjzl')" width="80px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.sumweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="模板配方" width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.pfmb')" width="90px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.ftname }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="物料详情" width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.wlxq')"  width="90px" align="center">
           <template slot-scope="scope">
             <el-popover
               placement="bottom"
               width="400"
               trigger="click">
-              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+              <b style="text-align: center;width:100%;display:inline-block;">{{$t('premixedPlan.wlxq')}}</b>
               <el-table :data="materialdetailsList" border height="200">
-                <el-table-column min-width="150" property="fname" label="物料" />
-                <el-table-column min-width="100" property="fweight" label="重量" />
-                <el-table-column min-width="100" property="scale" label="占比" />
+                <el-table-column min-width="150" property="fname" :label="$t('premixedPlan.wl')" />
+                <el-table-column min-width="100" property="fweight" :label="$t('premixedPlan.weight')" />
+                <el-table-column min-width="100" property="scale" :label="$t('premixedPlan.zb')" />
               </el-table>
-              <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">详情</span>
+              <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">{{$t('premixedPlan.xq')}}</span>
             </el-popover>
           </template>
         </el-table-column>
-        <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="70px" align="center">
+        <el-table-column v-show="isInforvalue" :label="$t('premixedPlan.sftqcfxl')" width="70px" align="center">
           <template slot-scope="scope">
             <el-switch v-model="scope.row.issplit" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
           </template>
         </el-table-column>
-        <el-table-column label="容量状态" width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.rlzt')" width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.volumeStatus == 1" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
             <span v-if="scope.row.volumeStatus == 2" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
             <span v-if="scope.row.volumeStatus == 0" style="color:green;">{{ scope.row.volumeStatusStr }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
+        <el-table-column :label="$t('premixedPlan.sl')" min-width="250px" align="left" header-align="center">
           <template slot-scope="scope">
             <div v-for="element in scope.row.arrList" :key="element.name" class="list">
               <el-tooltip placement="top" :open-delay="1000">
@@ -158,14 +158,14 @@
       </template>
       <div class="app-automaticGeneration" style="margin: 0 auto;">
         <div style="width: 210px;margin:60px auto 120px;font-weight: 16px;">
-          请选择自动生成方式:<br>
-          清空计划并生成新计划;<br>
-          当前计划基础上继续生成计划;<br>
+          {{$t('premixedPlan.qxzzdscfa1')}};<br>
+          {{$t('premixedPlan.qxzzdscfa2')}};<br>
+          {{$t('premixedPlan.qxzzdscfa3')}};<br>
         </div>
         <div slot="footer" class="dialog-footer">
           <el-button style="right:240px;" class="cancelClose" @click="automaticGeneration.dialogFormVisible = false;">{{$t('common.closed')}}</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>
+          <el-button style="right:130px;" class="save" :disabled="isokDisable" @click="continueData(0)">{{$t('premixedPlan.jxsc')}}   </el-button>
+          <el-button style="right:20px;" class="save" :disabled="isokDisable" @click="continueData(1)">{{$t('premixedPlan.cxsc')}}   </el-button>
         </div>
       </div>
     </el-dialog>
@@ -211,21 +211,21 @@
         <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 100%;margin:0 auto 10px;">
           <el-row>
             <el-col :span="8">
-              <el-form-item label="生效:" prop="sel">
+              <el-form-item :label="$t('premixedPlan.sx')" prop="sel">
                 <el-switch v-model="create.temp.sel" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="TMR编号:" prop="tmrid2">
-                <el-select v-model="create.temp.tmrid2" style="width: 100%;" placeholder="TMR编号" @change="changeTMRNumber">
+              <el-form-item :label="$t('premixedPlan.tmrbh')"  prop="tmrid2">
+                <el-select v-model="create.temp.tmrid2" style="width: 100%;" :placeholder="$t('premixedPlan.tmrbh')"   @change="changeTMRNumber">
                   <!-- <el-option v-for="item in equipmentList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" /> -->
                     <el-option v-for="item in TMRNumberList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="班次:" prop="times">
-                <el-select v-model="create.temp.times" :disabled="create.list2.length>0" placeholder="班次" style="width:100%;" @change="changeTimes">
+              <el-form-item :label="$t('premixedPlan.bc')"  prop="times">
+                <el-select v-model="create.temp.times" :disabled="create.list2.length>0" :placeholder="$t('premixedPlan.bc')"   style="width:100%;" @change="changeTimes">
                   <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -233,18 +233,18 @@
           </el-row>
           <el-row>
             <el-col :span="8">
-              <el-form-item label="提前小料拆分:" prop="issplit">
+              <el-form-item :label="$t('premixedPlan.sftqcfxl')"  prop="issplit">
                 <el-switch v-model="create.temp.issplit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="时间:" prop="begintime">
+              <el-form-item :label="$t('premixedPlan.time')"   prop="begintime">
                 <el-time-picker v-model="create.temp.begintime" style="width: 100%;" :clearable="false" type="datetime" placeholder="时间" format="HH:mm" value-format="HH:mm" />
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="模板配方:" prop="ftid">
-                <el-select v-model="create.temp.ftid" :disabled="create.list2.length>0" placeholder="模板配方" style="width:100%;" @change="changeTemplateFormulation">
+              <el-form-item :label="$t('premixedPlan.pfmb')"prop="ftid">
+                <el-select v-model="create.temp.ftid" :disabled="create.list2.length>0" :placeholder="$t('premixedPlan.pfmb')" style="width:100%;" @change="changeTemplateFormulation">
                   <el-option v-for="item in templateFormulationList" :key="item.id" :label="item.tname" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -252,15 +252,15 @@
           </el-row>
           <el-row>
             <el-col :span="8">
-              <el-form-item label="描述:" prop="display">
-                <el-input v-model="create.temp.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="描述" maxlength="255" style="width: 100%;" />
+              <el-form-item :label="$t('premixedPlan.ms')" prop="display">
+                <el-input v-model="create.temp.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" :placeholder="$t('premixedPlan.ms')" maxlength="255" style="width: 100%;" />
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
         <div v-if="create.dialogStatus !=='update' && !isDispaly" slot="footer" class="dialog-footer">
           <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">{{$t('common.closed')}}</el-button>
-          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="distributionAndSpreading()">分配撒料</el-button>
+          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="distributionAndSpreading()">{{$t('premixedPlan.fpsl')}} </el-button>
         </div>
         <!-- 栏舍 -->
         <div v-if="create.dialogStatus =='update' || isDispaly" class="bottom" style="border-top: 1px solid #009C69;">
@@ -287,13 +287,13 @@
                               placement="right"
                               width="400"
                               trigger="click">
-                              <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                              <b style="text-align: center;width:100%;display:inline-block;">{{$t('premixedPlan.wlxq')}}</b>
                               <el-table :data="materialdetailsList" height="200" border>
-                                <el-table-column min-width="150" property="fname" label="物料" />
-                                <el-table-column min-width="100" property="fweight" label="重量" />
-                                <el-table-column min-width="100" property="scale" label="占比" />
+                                <el-table-column min-width="150" property="fname" :label="$t('premixedPlan.wl')" />
+                                <el-table-column min-width="100" property="fweight" :label="$t('premixedPlan.weight')" />
+                                <el-table-column min-width="100" property="scale" :label="$t('premixedPlan.zb')" />
                               </el-table>
-                              <!-- <span  style="color: blue;">详情</span> -->
+                              <!-- <span  style="color: blue;">{{$t('premixedPlan.xq')}}</span> -->
                               <button slot="reference" style="background: #ccc;float: right;color: #fff;width: 18px;height:18px;font-size: 16px;border: none;text-align: center;" :disabled="isokDisable">?</button>
                             </el-popover>
                           </div>
@@ -308,16 +308,16 @@
             </el-col>
             <el-col :span="4">
               <div style="text-align: center;height: 100px;margin-top: 40px;">
-                <div class="maxweight" style="line-height:20px;"><b>车辆容积量:</b>{{ create.temp.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;"><b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>容积量:</b>{{ create.temp.volume }} m³ </div>
+                <div class="maxweight" style="line-height:20px;"><b>{{$t('premixedPlan.clrj')}} :</b>{{ create.temp.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;"><b>{{$t('premixedPlan.hjzl')}} :</b>{{ create.temp.sumweight }} (KG) </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>{{$t('premixedPlan.rjl')}} :</b>{{ create.temp.volume }} m³ </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>{{$t('premixedPlan.rjl')}} :</b>{{ create.temp.volume }} m³ </div>
               </div>
             </el-col>
           </el-row>
           <!-- 撒料 -->
           <div class="spreadingMaterial">
-            <div>撒料:<el-button type="danger" @click="handleEmpty">清空1</el-button></div>
+            <div>{{$t('premixedPlan.sl')}} <el-button type="danger" @click="handleEmpty">{{$t('premixedPlan.qk')}} </el-button></div>
             <div class="spreadingMaterialList">
               <!-- force-fallback="true" -->
               <draggable
@@ -395,11 +395,11 @@
                       width="400"
                       height="200"
                       trigger="click">
-                      <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
+                      <b style="text-align: center;width:100%;display:inline-block;">{{$t('premixedPlan.wlxq')}}</b>
                       <el-table :data="materialdetailsList" height="200" border>
-                       <el-table-column min-width="150" property="fname" label="物料" />
-                       <el-table-column min-width="100" property="fweight" label="重量" />
-                       <el-table-column min-width="100" property="scale" label="占比" />
+                       <el-table-column min-width="150" property="fname" :label="$t('premixedPlan.wl')" />
+                       <el-table-column min-width="100" property="fweight" :label="$t('premixedPlan.weight')" />
+                       <el-table-column min-width="100" property="scale" :label="$t('premixedPlan.zb')" />
                       </el-table>
                       <i slot="reference" class="el-icon-question" style="position: absolute;right: 0;top: 20px;"/>
                     </el-popover>
@@ -1860,7 +1860,7 @@ export default {
         // this.requestParam.data[1] = { 'name': 'deletefpdetailAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times,barid:this.allEmptySelect.toString()}},
         // this.requestParam.data[1] = { 'name': 'deletefpdetailAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times,barid:this.allEmptySelect.toString()}},
         // ExecDataByConfig(this.requestParam).then(response => {
-        //   console.log('清空已分配栏舍', this.requestParam)
+        //
         //   if (response.msg === 'fail') {
         //     this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
         //   } else {

+ 0 - 1890
src/views/formulationPlan/materialIssuancePlan/index1.vue

@@ -1,1890 +0,0 @@
-<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="handleReduceTrains">{{$t('premixedPlan.jscc')}}</el-button>
-      <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">校验</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">{{$t('formulationEvaluation.ggsx')}}</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">{{$t('formulationEvaluation.cancel')}}</el-button>
-      </div>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> {{$t('premixedPlan.sx')}}</el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> {{$t('premixedPlan.jy')}}</el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
-      <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;float: left;margin-left: 10px;" @change="changeFrequency">
-        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button>
-    </div>
-    <!-- <div class="search">
-      <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency">
-        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-    </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="$t('errorAnalysis.projname')" width="50px" align="center" class-name="small-padding fixed-width" fixed="">
-          <template slot-scope="scope">
-            <span>{{ scope.row.sort }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('premixedPlan.tmrbh')"  width="110px" align="center" class-name="small-padding fixed-width" fixed="left">
-          <template slot-scope="scope">
-            <span>{{ scope.row.tmrname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="描述" width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.display }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('premixedPlan.sx')"  width="70px" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.sel" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  width="65px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.timesstr }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('premixedPlan.time')"   width="55px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.begintime }}</span>
-          </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="90px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.ftname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column v-show="isInforvalue" label="是否提前小料拆分" width="70px" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.issplit" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </template>
-        </el-table-column>
-        <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
-          <template slot-scope="scope">
-            <div v-for="element in scope.row.arrList" :key="element.name" class="list">
-              <el-tooltip placement="top" :open-delay="1000">
-                <div slot="content">
-                  <div> 栏舍全称:{{ element.barname }} </div>
-                  <div> 饲料重量:{{ element.weight }} </div>
-                  <div> 撒料车:{{ element.tmrname }} </div>
-                </div>
-                <div :style="{'background':element.background}" class="tmrname">{{ element.barname }}</div>
-              </el-tooltip>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column  :label="$t('errorAnalysis.cz')" 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>
-      <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">{{$t('processAnalysis.total')}}{{ table.total }}{{$t('processAnalysis.tiao')}}</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;">{{$t('common.closed')}}</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; ">{{$t('common.closed')}}</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 新增、编辑 -->
-    <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="create.dialogFormVisible" :before-close="close" :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="create">
-        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 100%;margin:0 auto 10px;">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="生效:" prop="sel">
-                <el-switch v-model="create.temp.sel" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="TMR编号:" prop="tmrid2">
-                <el-select v-model="create.temp.tmrid2" style="width: 100%;" placeholder="TMR编号" @change="changeTMRNumber">
-                  <!-- <el-option v-for="item in equipmentList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" /> -->
-                    <el-option v-for="item in TMRNumberList" :key="item.id" :label="`${item.tclassname}/${item.eqcode}`" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="班次:" prop="times">
-                <el-select v-model="create.temp.times" :disabled="create.list2.length>0" placeholder="班次" style="width:100%;" @change="changeTimes">
-                  <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="8">
-              <el-form-item label="提前小料拆分:" prop="issplit">
-                <el-switch v-model="create.temp.issplit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="时间:" prop="begintime">
-                <el-time-picker v-model="create.temp.begintime" style="width: 100%;" :clearable="false" type="datetime" placeholder="时间" format="HH:mm" value-format="HH:mm" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="模板配方:" prop="ftid">
-                <el-select v-model="create.temp.ftid" :disabled="create.list2.length>0" placeholder="模板配方" style="width:100%;" @change="changeTemplateFormulation">
-                  <el-option v-for="item in templateFormulationList" :key="item.id" :label="item.tname" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="描述:" prop="display">
-                <el-input v-model="create.temp.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="描述" maxlength="255" style="width: 100%;" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div v-if="create.dialogStatus !=='update' && !isDispaly" slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">{{$t('common.closed')}}</el-button>
-          <el-button v-if="create.dialogStatus==='create'" class="save" :disabled="isokDisable" @click="distributionAndSpreading()">分配撒料</el-button>
-        </div>
-        <!-- 栏舍 -->
-        <div v-if="create.dialogStatus =='update' || isDispaly" class="bottom" style="border-top: 1px solid #009C69;">
-          <el-row>
-            <el-col :span="20">
-              <div class="fenceHouse">
-                <ul v-loading="create.listLoadingTimes" class="fenceHouseList">
-                  <li v-for="element in create.list1" :key="element.arrid">
-                    <span v-if="element.isShowTitle" class="fenceHouseTitle">{{ element.ftname }}:</span>
-                    <div v-for="item in element.arrList" :key="item.id" class="colorBlock">
-                      <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="barname">
-                            <span style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ item.barname }}</span>
-                            <button style="background: red;float: right;color: #fff;width: 18px;font-size: 18px;border: none;text-align: center;" :disabled="isokDisable" @click="clickBar(item)">√</button>
-                          </div>
-                        </el-tooltip>
-                        <div class="barWeight" :style="{ background: 'rgba('+item.background2+ ',0.1)' }"> {{ item.weight }} </div>
-                      </div>
-                    </div>
-                  </li>
-                </ul>
-              </div>
-            </el-col>
-            <el-col :span="4">
-              <div style="text-align: center;height: 100px;margin-top: 40px;">
-                <div class="maxweight" style="line-height:20px;"><b>最大重量:</b>{{ create.temp.maxweight }} (KG)</div>
-                <div class="sumweight" style="line-height:20px;margin-top: 10px;"><b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
-              </div>
-            </el-col>
-          </el-row>
-          <!-- 撒料 -->
-          <div class="spreadingMaterial">
-            <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
-            <div class="spreadingMaterialList">
-              <!-- force-fallback="true" -->
-              <draggable
-                :disabled="isDropState"
-                id="1"
-                data-source="juju"
-                :list="create.list2"
-                class="list-group1"
-                draggable=".item"
-                group="a"
-                animation="500"
-                :move="move1"
-                @change="changeLog1"
-                @start="start1"
-                @end="end1(create.temp)"
-              >
-                <div v-for="element in create.list2" :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, element.fttype,element.id)}"
-                      >
-                        <el-option
-                          v-for="item in equipmentList"
-                          :key="item.id"
-                          :label="item.tname"
-                          :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 placement="top">
-                        <div slot="content">{{ element.weight }}</div>
-                        <input
-                          ref="weight"
-                          v-model="element.weight"
-                          :autofocus="element.focusState"
-                          type="number"
-                          :placeholder="$t('formulationEvaluation.reset')"
-                          step="0.01"
-                          class="filter-item2"
-                          style="display: inline-block;height:25px;padding:4px 4px 4px 0;text-align:right;font-size:12px;width: 95%;border: 1px solid #e6e6e6;"
-                          @keyup.enter="$event.target.blur"
-                          @focus="focusWeight"
-                          @blur="blurWeight(element)"
-                        >
-                      </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)" />
-                  </div>
-                </div>
-              </draggable>
-            </div>
-          </div>
-          <div slot="footer" class="dialog-footer" style="height: 55px;">
-            <el-button class="cancelClose" :disabled="isokDisable" @click="close()" style="top:40px;">{{$t('common.closed')}}</el-button>
-            <el-button class="save" :disabled="isokDisable" @click="updateData()" style="top:40px;">{{$t('errorAnalysis.confirm')}}</el-button>
-          </div>
-        </div>
-      </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>
-        <div v-for="(item,index) in check.temp.ftlist" :key="index">
-          <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
-          <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
-            <span v-for="(item2,index2) in item.arrList" :key="index2">
-              {{item2.barname}}
-            </span>
-          </span>
-        </div>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="save" @click="check.dialogFormVisible=false;">{{$t('errorAnalysis.confirm')}}</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 更改TMR编号 -->
-    <el-dialog :title="textMap[tmrNumber.dialogStatus]" :destroy-on-close="true" :visible.sync="tmrNumber.dialogFormVisible" :close-on-click-modal="false" width="30%">
-        <h3 style="text-align: center;">是否要改变TMR设备?</h3>
-      <div class="tmrNumber" style="padding: 10px 30px;">
-        <p>注:更换TMR撒料设备,变更后的装载重量不同,请选择处理方式</p>
-        <el-radio v-model="tmrNumber.radio" label="0">1、多出的饲料平均从已分配的各栏舍中扣减。</el-radio><br/><br/>
-        <el-radio v-model="tmrNumber.radio" label="1">2、多出的饲料从最后一个栏舍依次往前扣减。</el-radio><br/><br/>
-        <el-radio v-model="tmrNumber.radio" label="2">3、清空已分配的撒料车。</el-radio>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose" :disabled="isokDisable" @click="closeTmrNumber">否</el-button>
-        <el-button class="save" :disabled="isokDisable" @click="tmrNumberData()">是</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 清空已分配的栏舍 -->
-    <el-dialog :title="textMap[allEmpty.dialogStatus]" :destroy-on-close="true" :visible.sync="allEmpty.dialogFormVisible" :close-on-click-modal="false" width="50%">
-      <div class="allEmptyData">
-        <el-table
-          id="table"
-          :key="allEmpty.table.tableKey"
-          ref="allEmptyTable"
-          v-loading="allEmpty.table.listLoading"
-          element-loading-text="给我一点时间"
-          :data="allEmpty.table.list"
-          border
-          highlight-current-row
-          style="width: 100%;"
-          :height="height"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable"
-          row-key="id"
-          @selection-change="handleAllEmptySelect"
-          height="300"
-        >
-          <el-table-column type="selection" width="50" />
-          <el-table-column :label="$t('formulationEvaluation.xh')" width="50px" align="center" type="index" />
-          <el-table-column  :label="$t('errorAnalysis.isHouseName')"  min-width="110px" align="center" prop="bname"/>
-        </el-table>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose" @click="allEmpty.dialogFormVisible = false;getList()">{{$t('common.closed')}}</el-button>
-        <el-button class="save" :disabled="isokDisable" @click="allEmptyData()">{{$t('errorAnalysis.confirm')}}</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import Cookies from 'js-cookie'
-import draggable from 'vuedraggable'
-import Sortable from 'sortablejs'
-import { checkButtons, ExecDataByConfig, postJson } from '@/api/common'
-import { MessageBox } from 'element-ui'
-export default {
-  components: {
-    draggable
-  },
-  data() {
-    return {
-      isRoleEdit: [],
-      rowStyle: { maxHeight: 25 + 'px', height: 25 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      height: document.body.clientHeight - 220, // table高度
-      table: {
-        getdataListParm: {
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            times: 1,
-            refresh: 1
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: false
-      },
-      frequencyList: [], // 班次
-      maxTime: {
-        getMaxTimesParm: {
-          name: 'getSysoptEnable',
-          page: 1,
-          offset: 1,
-          pagecount: 1,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inforname: 'times'
-          }
-        }
-      },
-      // 是否显示小料拆分
-      isInforvalue: false,
-      selectList: [],
-      historyRecord: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        myComponent: null
-      },
-      // 自动生成
-      automaticGeneration: {
-        dialogFormVisible: false,
-        dialogStatus: ''
-      },
-      textMap: {
-        automaticGeneration: '提示',
-        historyRecord: '历史记录',
-        create: '新增',
-        update: '编辑',
-        check: '提示',
-        tmrNumber:'',
-        allEmpty:'清空已分配的栏舍'
-      },
-      check: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        temp: {
-          ftlist:[],
-          isDistribution: ''
-        }
-      },
-      dialogFull: false,
-      isOrder: true,
-      requestParam: {},
-      isokDisable: false,
-      create: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        temp: { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' },
-        rules: {
-          tmrid2: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          times: [{ type: 'number', required: true, message: '必填', trigger: 'blur' }],
-          ftid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
-        },
-        listLoadingTimes: false,
-        list1: [],
-        list2: [],
-        checkBarList: []
-      },
-      TMRNumberList: [], // TMR编号
-      equipmentList: [], // 撒料设备
-      templateFormulationList: [], // 模板配方
-      isDispaly: false,
-      dropState: false,
-      isDropState:false,
-      tmrNumber:{
-        dialogFormVisible: false,
-        dialogStatus: '',
-        temp:{},
-        radio:'0'
-      },
-      allEmpty:{
-        dialogFormVisible: false,
-        dialogStatus: '',
-        table: {
-          getdataListParm: {
-            name:'getBarList',
-            page: 1,
-            offset: 1,
-            pagecount: '',
-            returntype: 'Map',
-            parammaps: {
-              pastureid: Cookies.get('pastureid'),
-              times: 1,
-              refresh: 1
-            }
-          },
-          tableKey: 0,
-          list: [],
-          total: 0,
-          listLoading: false,
-        }
-      },
-      allEmptySelect:[]
-    }
-  },
-  created() {
-    this.getButtons()
-    this.getIsDisplay()
-    this.getList()
-  },
-  methods: {
-    getButtons() {
-      const Edit = 'MaterialIssuancePlan'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    // 下拉列表
-    getDownList() {
-      const url = 'authdata/GetDataByName'
-      const data1 = {
-        name: 'getTMRListEnableType',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
-        }
-      }
-      postJson(url, data1).then(response => {
-        if (response.data !== null) {
-          this.TMRNumberList = response.data.list
-        } else {
-          this.TMRNumberList = []
-        }
-      })
-      const url2 = 'authdata/tmrListEnableTypeAll'
-      const data2 = {
-        parammaps: {
-          pastureid: Cookies.get('pastureid')
-        }
-      }
-      postJson(url2, data2).then(response => {
-        if (response.data !== null) {
-          this.equipmentList = response.data
-          if(this.create.dialogStatus == 'update'){
-            if(this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid) !== undefined){
-              this.create.temp.tclassname = this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid).tclassname
-            }else{
-              this.create.temp.tclassname = '固定式'
-            }
-          }
-        } else {
-          this.equipmentList = []
-        }
-      })
-      const data3 = {
-        name: 'getFTSWList',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid')
-        }
-      }
-      postJson(url, data3).then(response => {
-        if (response.data !== null) {
-          this.templateFormulationList = response.data.list
-        } else {
-          this.templateFormulationList = []
-        }
-      })
-      const data4 = {
-        name: 'getSysoptEnable',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          inforname: 'isSmallMaterial'
-        }
-      }
-      postJson(url, data4).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() {
-      const url = 'authdata/GetDataByName'
-      const data = this.maxTime.getMaxTimesParm
-      postJson(url, data).then(response => {
-        console.log(response.data.list[0].inforvalue)
-        if (response.data.list[0].inforvalue == 1) {
-          this.frequencyList = [{ id: 1, name: this.$t('errorAnalysis.one'), }]
-        } else if (response.data.list[0].inforvalue == 2) {
-          this.frequencyList = [
-            { id: 1, name: this.$t('errorAnalysis.one'), },
-            { id: 2, name: this.$t('errorAnalysis.two'), }
-          ]
-        } else if (response.data.list[0].inforvalue == 3) {
-          this.frequencyList = [
-            { id: 1, name: this.$t('errorAnalysis.one'), },
-            { id: 2, name: this.$t('errorAnalysis.two'), },
-            { id: 3, name: this.$t('errorAnalysis.three'), }
-          ]
-        } else if (response.data.list[0].inforvalue == 4) {
-          this.frequencyList = [
-            { id: 1, name: this.$t('errorAnalysis.one'), },
-            { id: 2, name: this.$t('errorAnalysis.two'), },
-            { id: 3, name: this.$t('errorAnalysis.three'), },
-            { id: 4, name: this.$t('errorAnalysis.four'), }
-          ]
-        }
-      })
-    },
-
-    getList() {
-      this.table.listLoading = true
-      const url = 'authdata/spillage'
-      const data = this.table.getdataListParm
-      postJson(url, data).then(response => {
-        if (response.data.list !== undefined) {
-          if (response.data.list !== null) {
-            console.log('table数据', response.data.list)
-            for (let i = 0; i < response.data.list.length; i++) {
-              if (response.data.list[i].arrList == null) {
-                this.$set(response.data.list[i], 'arrList', [])
-              }
-            }
-            this.table.list = response.data.list
-            this.table.total = response.data.list.length
-            setTimeout(() => {
-              this.$refs.table.doLayout()
-            }, 100)
-          } else {
-            this.table.list = []
-          }
-        }
-        this.table.listLoading = false
-      })
-    },
-    changeFrequency(val) {
-      console.log('选择了班次', val)
-      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
-          const url = 'authdata/PostDataByName'
-          const data = this.requestParam
-          postJson(url, data).then(response => {
-            if (response.msg === 'fail') {
-              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-              this.table.getdataListParm.parammaps.refresh = 1
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消删除' })
-        })
-      } else {
-        this.$message({ type: 'error', message: '本车次已添加栏舍不可删除', duration: 2000 })
-        return false
-      }
-    },
-    handleSelect(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    changeTemplateFormulation(item) {
-      this.create.temp.ftname = this.templateFormulationList.find(obj => obj.id === item).tname
-      this.getCreateList1()
-    },
-    changeTimes(item) {
-      this.getCreateList1()
-    },
-    // TMR编号
-    changeTMRNumber(item) {
-      if (this.create.list2.length > 0) {
-        // 备份
-        // MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
-        //   confirmButtonText: '是', cancelButtonText: '否', type: 'warning'
-        // }).then(() => {
-        //   this.create.temp.tmrid = this.create.temp.tmrid2
-        //   this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
-        //   this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
-        //   this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
-        //   this.create.temp.mytmrid = this.create.temp.tmrid
-        //   this.create.temp.mytmrname = this.create.temp.tmrname
-        //   console.log('tmrname==>', this.create.temp)
-        //   if (this.isDispaly || this.create.dialogStatus == 'update') {
-        //     this.getClearList()
-        //   }
-        // }).catch(() => {
-        //   if(this.create.temp.tclassname == '固定式'){
-        //     console.log( this.create.temp,'====')
-        //     this.create.temp.tmrid = this.create.temp.mytmrid
-        //   }
-        //   this.create.temp.tmrid2 = this.create.temp.tmrid
-        //   this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
-        //   this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
-        //   this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
-        //   this.create.temp.mytmrid = this.create.temp.tmrid2
-        //   this.create.temp.mytmrname = this.create.temp.tmrname
-        //   console.log(this.create.temp)
-        //   this.$message({ type: 'info', message: '已取消' })
-        // })
-        // 备份
-        this.tmrNumber.dialogFormVisible = true
-        this.tmrNumber.dialogStatus = 'tmrNumber'
-        this.tmrNumber.radio = '0'
-      } else {
-        this.create.temp.tmrid = this.create.temp.tmrid2
-        this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
-        this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
-        this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
-        this.create.temp.mytmrid = this.create.temp.tmrid
-        this.create.temp.mytmrname = this.create.temp.tmrname
-        if (this.isDispaly || this.create.dialogStatus == 'update') {
-          this.getClearList()
-        }
-      }
-    },
-    tmrNumberData(){
-      if(this.tmrNumber.radio == '0'){
-        console.log('1、多出的饲料平均从已分配的各栏舍中扣减。')
-      }else if(this.tmrNumber.radio == '1'){
-        console.log('2、多出的饲料从最后一个栏舍依次往前扣减。')
-      }else if(this.tmrNumber.radio == '2'){
-        console.log('3、清空已分配的撒料车。')
-      }
-      const url = 'authdata/materialtmr/edit'
-      const data = {
-        tmrid:this.create.temp.tmrid2,
-        tmrtype: this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassid,
-        lppid:this.create.temp.id,
-        times:this.create.temp.times,
-        pastureid:Cookies.get('pastureid'),
-        status:this.tmrNumber.radio
-      }
-      postJson(url, data).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-          this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
-          this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
-          this.tmrNumber.dialogFormVisible = false
-          this.getCreateList1()
-        }
-      })
-    },
-    closeTmrNumber(){
-      if(this.create.temp.tclassname == '固定式'){
-        console.log( this.create.temp,'====')
-        this.create.temp.tmrid = this.create.temp.mytmrid
-      }
-      this.create.temp.tmrid2 = this.create.temp.tmrid
-      this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
-      this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
-      this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
-      this.create.temp.mytmrid = this.create.temp.tmrid2
-      this.create.temp.mytmrname = this.create.temp.tmrname
-      this.tmrNumber.dialogFormVisible = false
-    },
-    getClearList() {
-      const url = 'authdata/lpplandtl/del'
-      const data = []
-      this.create.list2.forEach((item, i) => {
-        const obj = {}
-        obj.pastureid = item.pastureid
-        obj.lpplandtlid = item.id
-        obj.fttype = item.fttype
-        obj.lweight = item.lweight
-        obj.fpdid = item.fpdid
-        data.push(obj)
-      })
-      postJson(url, data).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
-          this.getCreateList1()
-        }
-      })
-    },
-    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(',') + ')'
-    },
-    dbclickWeight(item) {
-      console.log('item==>', item)
-      console.log('isRoleEdit==>', this.isRoleEdit)
-      this.$set(item, 'isWeight', true)
-      this.$set(item, 'focusState', true)
-    },
-    focusWeight(){
-      this.isDropState = true
-    },
-    blurWeight(item) {
-      console.log("监听失效===")
-      this.isDropState = false
-      if (parseFloat(item.weight) <= 0) {
-        this.$message({ type: 'error', message: '重量不可输入小于0的数据', duration: 2000 })
-        return false
-      }
-      if (item.weight == '') {
-        item.weight = 0
-      }
-      const lweight = String(parseFloat(item.weight) - parseFloat(item.lweight))
-      let sum = 0
-      this.create.list2.forEach((item, i) => {
-        console.log('item==>', item)
-        sum += parseFloat(item.weight)
-      })
-      if (sum > this.create.temp.maxweight) {
-        this.$message({ type: 'error', message: '撒料车总重量大于最大重量', duration: 2000 })
-        return false
-      }
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'checkFPdLeftW', 'type': 'v',
-        'parammaps': {
-          pastureid: item.pastureid, fpdid: item.fpdid, fttype: item.fttype,
-          lweight: lweight
-        }
-      }
-      this.requestParam.data[1] = {
-        'name': 'updateLppd', 'type': 'e',
-        'parammaps': {
-          pastureid: this.create.temp.pastureid, lppid: this.create.temp.id, barid: item.barid,
-          barname: item.barname, fpdid: item.fpdid, fttype: item.fttype,
-          lweight: item.weight, sort: item.sort, tmrid: item.tmrid,
-          tmrname: item.tmrname, background: item.background, id: item.id
-        }
-      }
-      this.requestParam.data[2] = {
-        'name': 'updateFpdetailUse', 'type': 'e',
-        'parammaps': {
-          pastureid: item.pastureid, id: item.fpdid,
-          fttype: item.fttype, lweight: lweight
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          // this.isDropState = false
-          // this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-        }
-        this.getCreateList1()
-      })
-    },
-    handleFLDelete(ele) {
-      console.log(ele, '点击了撒料删除')
-      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) }
-      }
-      const url = 'authdata/ExecDataByConfig'
-      const data = this.requestParam
-      postJson(url, data).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
-          this.getCreateList1()
-        }
-      })
-    },
-    handleCreate() {
-      console.log('新增车次')
-      this.create.temp = { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' }
-      this.create.temp.times = this.table.getdataListParm.parammaps.times
-      this.getDownList()
-      this.isDispaly = false
-      this.dialogFull = false
-      this.create.dialogStatus = 'create'
-      this.create.dialogFormVisible = true
-      this.create.list1 = []
-      this.create.list2 = []
-      this.create.checkBarList = []
-    },
-    distributionAndSpreading() {
-      console.log('点击了分配撒料')
-      this.$refs['temp'].validate(valid => {
-        if (valid) {
-          this.isokDisable = true
-          setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          const url = 'authdata/lpplan/add'
-          const data = {}
-          this.create.temp.pastureid = Cookies.get('pastureid')
-          this.create.temp.times = parseInt(this.create.temp.times)
-          data.parammaps = this.create.temp
-          postJson(url, data).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.temp.id = response.data.Id
-              this.isDispaly = true
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          })
-          this.getCreateList1()
-        }
-      })
-    },
-    getCreateList1() {
-      this.create.listLoadingTimes = true
-      const url = 'authdata/spillage'
-      const data = {
-        page: 1,
-        offset: 1,
-        pagecount: 0,
-        returntype: 'Map',
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          times: this.create.temp.times,
-          refresh: 2,
-          ftid: this.create.temp.ftid
-        }
-      }
-      postJson(url, data).then(response => {
-        if (response.data.ftlist !== null) {
-          for (let i = 0; i < response.data.ftlist.length; i++) {
-            this.$set(response.data.ftlist[i], 'isShowTitle', true)
-            if (response.data.ftlist[i].arrList == null) {
-              this.$set(response.data.ftlist[i], 'isShowTitle', false)
-            } else {
-              for (let j = 0; j < response.data.ftlist[i].arrList.length; j++) {
-                this.$set(response.data.ftlist[i].arrList[j], 'background2', this.colorRgb(response.data.ftlist[i].arrList[j].background))
-              }
-            }
-          }
-          this.create.list1 = response.data.ftlist
-        } else {
-          this.create.list1 = []
-        }
-        this.create.listLoadingTimes = false
-      })
-      this.getCreateList2()
-    },
-    getCreateList2() {
-      const url = 'authdata/lpplandtl'
-      const data = {}
-      data.parammaps = {}
-      data.parammaps.pastureid = Cookies.get('pastureid'),
-      data.parammaps.id = this.create.temp.id
-      postJson(url, data).then(response => {
-        if (response.data !== null) {
-          this.create.list2 = response.data
-          this.create.temp.sort = response.data.length + 1
-          var sumweight = 0
-          for (let i = 0; i < this.create.list2.length; i++) {
-            sumweight += parseFloat(this.create.list2[i].weight)
-            this.$set(this.create.list2[i], 'isWeight', false)
-            this.$set(this.create.list2[i], 'focusState', false)
-          }
-          console.log('sumweight==>', sumweight)
-          this.create.temp.sumweight = (sumweight).toFixed(2)
-        } else {
-          this.create.list2 = []
-          // this.create.temp.sort = 0
-          this.create.temp.sumweight = 0
-        }
-      })
-    },
-    clickBar(item) {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.create.temp.sumweight = parseFloat(this.create.temp.sumweight)
-      console.log('this.TMRNumberList==>', this.TMRNumberList)
-      console.log('点击了栏舍item==>', item)
-      console.log('temp==>',this.create.temp)
-      console.log('this.equipmentList==>',this.equipmentList)
-      // if(this.create.temp.tclassname == '固定式'){
-      //   if(this.equipmentList.find(obj => obj.tclassname == '撒料设备') !== undefined){
-      //     this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '撒料设备').eqcode
-      //     this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '撒料设备').id
-      //   }else if(this.equipmentList.find(obj => obj.tclassname == '自走式') !== undefined){
-      //     this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '自走式').eqcode
-      //     this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '自走式').id
-      //   }else{
-      //     this.$message({ type: 'error', message: '请先在TMR设备中创建撒料设备', duration: 2000 })
-      //     return
-      //   }
-      // }
-      if(this.create.temp.tclassname == '固定式'){
-        if(this.equipmentList.find(obj => obj.tclassname == '任意车1') !== undefined){
-          this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车1').eqcode
-          this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车1').id
-        }
-      }
-      var evt = this.create.temp
-      if (parseFloat(evt.maxweight) - parseFloat(evt.sumweight) < parseFloat(item.weight)) {
-        if (parseFloat(evt.sumweight) + parseFloat(item.weight) > parseFloat(evt.maxweight)) {
-          this.$set(item, 'weight', (parseFloat(evt.maxweight) - parseFloat(evt.sumweight)).toFixed(2))
-        }
-      }
-      if (parseFloat(evt.maxweight) == parseFloat(evt.sumweight) || parseFloat(evt.maxweight) < parseFloat(evt.sumweight)) {
-        this.$message({ type: 'error', message: '计划配方已经是最大容量', duration: 2000 })
-        this.getCreateList1()
-        return
-      }
-      console.log('item.weight===>', evt.maxweight)
-      console.log('item.weight===>', evt.sumweight)
-      const url = 'authdata/lpplandtl/add'
-      const data = {}
-      data.parammaps = {}
-      data.parammaps.id = item.id
-      data.parammaps.pastureid = evt.pastureid
-      data.parammaps.lppid = evt.id
-      data.parammaps.barid = item.barid
-      data.parammaps.barname = item.barname
-      data.parammaps.fpdid = item.id
-      data.parammaps.lweight = item.weight
-      data.parammaps.tmrid = evt.tmrid
-      data.parammaps.tmrname = evt.tmrname
-      data.parammaps.fttype = item.fttype
-      data.parammaps.background = item.background
-      data.parammaps.cowcount = item.cowcount
-      data.parammaps.ccountradio = item.ccountradio
-      postJson(url, data).then(response => {
-        // this.requestParam = {}
-        // this.requestParam.common = {
-        //   'returnmap': '0'
-        // }
-        // this.requestParam.data = []
-        // this.requestParam.data[0] = { 'name': 'insertLppd', 'type': 'e', 'parammaps': {
-        //     pastureid:item.pastureid,
-        //     lppid:evt.id,
-        //     barid:item.barid,
-        //     barname:item.barname,
-        //     fpdid:item.id,
-        //     tmrid:evt.tmrid,
-        //     tmrname:evt.tmrname,
-        //     fttype:item.fttype,
-        //     background:item.background,
-        //     cowcount:item.cowcount,
-        //     ccountradio:item.ccountradio,
-        //     lweight:item.weight
-        //   }
-        // }
-        // ExecDataByConfig(this.requestParam).then(response => {
-        this.requestParam = {}
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        this.requestParam.data[0] = { 'name': 'updateFpdetailUse', 'type': 'e',
-          'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
-        }
-        const url2 = 'authdata/ExecDataByConfig'
-        const data2 = this.requestParam
-        postJson(url2, data2).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.getCreateList1()
-        })
-      })
-    },
-    handleUpdate(row) {
-      console.log(row)
-      console.log("equipmentList",this.equipmentList)
-      this.getDownList()
-      this.dialogFull = false
-      this.create.dialogStatus = 'update'
-      this.create.dialogFormVisible = true
-      row.tmrid2 = row.tmrid
-      this.create.temp = Object.assign({}, row)
-      this.create.temp.mytmrname = row.tmrname
-      this.create.temp.mytmrid = row.tmrid
-      this.create.checkBarList = []
-      console.log(this.create.temp,'this.create.temp')
-      this.getCreateList1()
-    },
-    updateData() {
-      this.$refs['temp'].validate(valid => {
-        if (valid) {
-          this.isokDisable = true
-          setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          const url = 'authdata/lpplan/edit'
-          const data = {}
-          this.create.temp.pastureid = Cookies.get('pastureid')
-          this.create.temp.times = parseInt(this.create.temp.times)
-          data.parammaps = this.create.temp
-          data.parammaps.tmrid = this.create.temp.tmrid2
-          data.parammaps.tmrname = this.create.temp.mytmrname
-          data.old = this.create.temp.arrList
-          postJson(url, data).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.isDispaly = false
-              this.dialogFull = false
-              this.create.dialogFormVisible = false
-              this.getList()
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          })
-        }
-      })
-    },
-    close() {
-      if (this.create.dialogStatus == 'create') {
-        console.log('新增关闭')
-        this.isokDisable = true
-        setTimeout(() => {
-          this.isokDisable = false
-        }, 1000)
-        const url = 'authdata/lpplandtl/restore'
-        const data = {}
-        data.old = []
-        data.new = this.create.list2
-        postJson(url, data).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg !== 'fail') {
-            this.isDispaly = false
-            this.dialogFull = false
-            this.create.dialogFormVisible = false
-            this.getList()
-          }
-        })
-      } else {
-        console.log('编辑关闭')
-        this.isokDisable = true
-        setTimeout(() => {
-          this.isokDisable = false
-        }, 1000)
-        const url = 'authdata/lpplandtl/restore'
-        const data = {}
-        data.old = this.create.temp.arrList
-        data.new = this.create.list2
-        postJson(url, data).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg !== 'fail') {
-            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-            this.isDispaly = false
-            this.dialogFull = false
-            this.create.dialogFormVisible = false
-            this.getList()
-          } else {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          }
-        })
-      }
-    },
-    changeEquipment(item, fttype, myid) {
-      console.log('item==>',item)
-      console.log('fttype==>',fttype)
-      console.log('myid==>',myid)
-      let tclassname = this.equipmentList.find(obj => obj.id == item).tclassname
-      let maxstirfeed = this.equipmentList.find(obj => obj.id == item).maxstirfeed
-      if(tclassname == '固定式'){
-        this.$message({ type: 'error', message: '固定式设备无法撒料,请选择撒料设备', duration: 2000 })
-        this.getCreateList2()
-        return
-      }
-      var objList = {}
-      for (let i = 0; i < this.create.list2.length; i++) {
-        if (this.create.list2[i].fttype == fttype && this.create.list2[i].id == myid) {
-          this.create.list2[i].tmrname = this.equipmentList.find(obj => obj.id === item).tname
-          objList = this.create.list2[i]
-          if(parseFloat(this.create.list2[i].weight) > parseFloat(maxstirfeed)){
-            objList.weight = maxstirfeed
-          }
-        }
-      }
-      const url = 'authdata/lpplandtl/add'
-      const data = {}
-      data.parammaps = {}
-      data.parammaps.id = objList.id
-      data.parammaps.pastureid = this.create.temp.pastureid
-      data.parammaps.lppid = this.create.temp.id
-      data.parammaps.tmrid = objList.tmrid
-      data.parammaps.tmrname = objList.tmrname
-      postJson(url, data).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.getCreateList2()
-          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-        }
-      })
-    },
-    move1(evt, originalEvent){
-      console.log('move1===>evt', evt)
-      console.log('move1===>originalEvent', originalEvent)
-    },
-    changeLog1(evt){
-      console.log("evt========",evt)
-      // 按组拖拽
-      const url = 'authdata/lpplandtl/edit/sort'
-      const data = {}
-      var obj = evt.moved.element
-      data.parammaps = {}
-      data.parammaps.tmrid = obj.tmrid
-      data.parammaps.pastureid = obj.pastureid
-      data.parammaps.lppid = obj.lppid
-      data.parammaps.sort = evt.moved.newIndex +1
-      data.parammaps.id = obj.id
-      postJson(url, data).then(response => {
-        console.log('拖动保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.getCreateList2()
-          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-        }
-      })
-    },
-    start1(evt){
-      console.log('start1===>', evt)
-      // this.$set(this.table.startObj, 'from', evt.from.className)
-      // this.$set(this.table.startObj, 'to', evt.from.className)
-    },
-    end1(evt){
-      console.log('end1===>', evt)
-    },
-    // 减少车次
-    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.table.getdataListParm.parammaps.refresh = 1
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-    // 自动生成
-    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
-        const url = 'authdata/autogeneration'
-        const data = this.requestParam
-        postJson(url, data).then(response => {
-          console.log('新增保存发送参数', this.requestParam)
-          if (response.msg !== 'fail') {
-            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-            this.automaticGeneration.dialogFormVisible = false
-            this.getIsDisplay()
-          } 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
-          this.requestParam = {}
-          this.requestParam.pastureid = Cookies.get('pastureid')
-          this.requestParam.type = 1
-          const url = 'authdata/autogeneration'
-          const data = this.requestParam
-          postJson(url, data).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.automaticGeneration.dialogFormVisible = false
-              this.getIsDisplay()
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消重新生成' })
-        })
-      }
-    },
-    handleChangeOrder() {
-      console.log('更改顺序')
-      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)
-      }
-      const url = 'authdata/trains'
-      const data = sortArr
-      postJson(url, data).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
-          this.table.getdataListParm.parammaps.refresh = 1
-          this.getList()
-          this.isOrder = true
-        }
-      })
-    },
-    cancelChangeOrder() {
-      console.log('取消顺序')
-      this.table.getdataListParm.parammaps.refresh = 1
-      this.getList()
-      this.isOrder = true
-    },
-    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.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.table.getdataListParm.parammaps.refresh = 1
-              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.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.table.getdataListParm.parammaps.refresh = 1
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-    // 历史记录
-    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
-    },
-    handleCheck() {
-      console.log('点击了校验')
-      this.check.dialogStatus = 'check'
-      this.check.dialogFormVisible = true
-      this.getCheckList()
-    },
-    getCheckList() {
-      const url = 'authdata/spillage'
-      const data = {
-        page: 1,
-        offset: 1,
-        pagecount: 0,
-        returntype: 'Map',
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          times: this.table.getdataListParm.parammaps.times,
-          refresh: 2
-        }
-      }
-      postJson(url, data).then(response => {
-        if (response.data.ftlist !== undefined && response.data.ftlist !== null) {
-          this.$set(this.check.temp,'isDistribution',0)
-          this.check.temp.ftlist = response.data.ftlist
-        } else {
-          this.check.temp = {}
-          this.$set(this.check.temp,'isDistribution',1)
-        }
-      })
-    },
-    handleEmpty(){
-      console.log('点击了清空')
-      var list = []
-      for(let i=0;i<this.create.list2.length;i++){
-        var obj = {}
-        obj.pastureid = this.create.list2[i].pastureid
-        obj.id = this.create.list2[i].fpdid
-        obj.fttype = this.create.list2[i].fttype
-        obj.lweight = '-'+this.create.list2[i].weight
-        list.push(obj)
-      }
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'deleteLpplandtl1ByLppid', 'type': 'e', 'parammaps': { lppid: this.create.temp.id, pastureid:  Cookies.get('pastureid') }},
-      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
-      this.requestParam.data[1].children = []
-      this.requestParam.data[1].children[0] = {
-        'name': 'updateFpdetailUse',
-        'type': 'e',
-        'parammaps': { pastureid: '@insertSpotList.pastureid', id: '@insertSpotList.id', fttype: '@insertSpotList.fttype', lweight: '@insertSpotList.lweight' }
-      }
-      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.getCreateList1()
-        }
-      })
-    },
-    handleAllEmpty(){
-      this.allEmpty.dialogStatus = 'allEmpty'
-      this.allEmpty.dialogFormVisible = true
-
-      // MessageBox.confirm('执行该操作会将现有车次已分配的撒料栏舍全部清空,是否要执行该操作?', {
-      //   confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      // }).then(() => {
-      //
-      // })
-      this.getAllEmptyList()
-    },
-    getAllEmptyList() {
-      this.allEmpty.table.listLoading = true
-      const url = 'authdata/GetDataByName'
-      const data = this.allEmpty.table.getdataListParm
-      postJson(url, data).then(response => {
-        if (response.data.list !== undefined) {
-          if (response.data.list !== null) {
-            this.allEmpty.table.list = response.data.list
-            this.allEmpty.table.total = response.data.list.length
-            setTimeout(() => {
-              this.$refs.allEmptyTable.doLayout()
-            }, 100)
-          } else {
-            this.allEmpty.table.list = []
-          }
-        }
-        this.allEmpty.table.listLoading = false
-      })
-    },
-    handleAllEmptySelect(val){
-      this.allEmptySelect = []
-      val.forEach((ele)=> {
-        this.allEmptySelect.push(ele.id)
-      });
-    },
-    allEmptyData(){
-      // console.log(this.allEmptySelect)
-      // console.log(this.allEmptySelect.toString())
-      if(this.allEmptySelect.length == 0){
-        this.allEmpty.dialogFormVisible = false;
-        this.getList()
-      }else{
-        // this.requestParam = {}
-        // this.requestParam.common = { 'returnmap': '0' }
-        // this.requestParam.data = []
-        // this.requestParam.data[0] = { 'name': 'deleteLpplandtl1All', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times,barid:this.allEmptySelect.toString()}},
-        // this.requestParam.data[1] = { 'name': 'deletefpdetailAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times,barid:this.allEmptySelect.toString()}},
-        // this.requestParam.data[1] = { 'name': 'deletefpdetailAll', 'type': 'e', 'parammaps': { pastureid:  Cookies.get('pastureid') ,times:this.table.getdataListParm.parammaps.times,barid:this.allEmptySelect.toString()}},
-        // ExecDataByConfig(this.requestParam).then(response => {
-        //   console.log('清空已分配栏舍', this.requestParam)
-        //   if (response.msg === 'fail') {
-        //     this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
-        //   } else {
-            let url = 'authdata/spillageall/del'
-            let data  = {}
-            data.parammaps = {}
-            data.parammaps.pastureid = Cookies.get('pastureid')
-            data.parammaps.times = this.table.getdataListParm.parammaps.times
-            data.parammaps.barid = this.allEmptySelect.toString()
-            postJson(url, data).then(response => {
-              if (response.msg !== 'fail') {
-                this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
-                this.allEmpty.dialogFormVisible = false;
-                this.getList()
-              } else {
-                this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
-              }
-            })
-        //   }
-        // })
-      }
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-  .list{width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
-    .tmrname{
-      width:100%;padding: 5px 5px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
-    }
- }
-  .fenceHouse {
-    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;
-    }
-    .fenceHouseList {
-      position: absolute;
-      width: 100%;
-      margin: 0 0;
-      height: 130px;
-      list-style: none;
-      padding: 0 0;
-      overflow: auto;
-      font-size: 12px;
-      .fenceHouseTitle {
-        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;
-        .barname {
-          display: block;
-          width: 100%;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-        }
-        .barWeight{
-          display: block;
-          line-height: 18px;
-          height: 18px;
-          color: #000;
-          width: 100%;
-          margin: 0 auto;
-        }
-        .colorBlock{
-         width: 88px;float: left;margin:5px 5px;height: 36px;
-        }
-       }
-     }
-   }
-</style>
-<style lang="scss" >
-
-  .spreadingMaterial {
-    height: 200px;
-      ::-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;
-      }
-      .spreadingMaterialList{height: 100%;overflow: auto;}
-      .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: 70px;
-
-            .barname {
-              width: 95%;
-              overflow: hidden;
-              text-overflow: ellipsis;
-              white-space: nowrap;
-              font-size: 14px;
-              text-align: center;
-            }
-          }
-
-          .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>

+ 9 - 9
src/views/formulationPlan/pushMaterialPlan/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <div class="search">
       <el-time-picker v-model="table.parammaps.date" style="width: 250px;" value-format="HH:mm:ss" />
-      <el-input v-model="table.parammaps.eqCode" placeholder="车辆编码" style="width: 180px;" class="filter-item" clearable />
+      <el-input v-model="table.parammaps.eqCode" :placeholder="$t('premixedPlan.clbm')" style="width: 180px;" class="filter-item" clearable />
       <!-- <el-select v-model="table.getdataListParm.parammaps.enable" filterable :placeholder="$t('formulationEvaluation.sfqy')" 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> -->
@@ -31,11 +31,11 @@
       >
         <el-table-column type="selection" width="50" />
         <el-table-column :key="1" :label="$t('formulationEvaluation.xh')" 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" prop="tname" />
+        <el-table-column :label="$t('premixedPlan.tlc')" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left" prop="tname" />
         <el-table-column :label="$t('premixedPlan.time')"   min-width="100px" align="center" prop="date" />
         <el-table-column :label="$t('formulationEvaluation.remark')" min-width="100px" align="center" prop="remark" />
         <el-table-column :label="$t('errorAnalysis.pen')" min-width="100px" align="center" prop="bname" />
-        <el-table-column label="状态" min-width="90px" align="center">
+        <el-table-column :label="$t('premixedPlan.status')" 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>
@@ -55,7 +55,7 @@
         <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" />
-            推料计划
+            {{$t('premixedPlan.tljh')}}
           </span>
           <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
             <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
@@ -67,7 +67,7 @@
         <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="12">
-              <el-form-item label="推料车:" prop="tmrId">
+              <el-form-item :label="$t('premixedPlan.tlc')" prop="tmrId">
                 <el-select v-model="create.temp.tmrId" filterable placeholder="推料车" class="filter-item" style="width: 100%;">
                   <el-option v-for="item in tmrList" :key="item.id" :label="item.tname" :value="item.id" />
                 </el-select>
@@ -76,7 +76,7 @@
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="时间:" prop="date">
+              <el-form-item :label="$t('premixedPlan.time')" prop="date">
                 <el-time-picker v-model="create.temp.date" style="width: 100%;" value-format="HH:mm:ss" />
               </el-form-item>
             </el-col>
@@ -90,8 +90,8 @@
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="栏舍:" prop="barId">
-                <el-select v-model="create.temp.barId" multiple  filterable :placeholder="$t('errorAnalysis.pen')"class="filter-item" style="width: 100%;">
+              <el-form-item :label="$t('premixedPlan.ls')" prop="barId">
+                <el-select v-model="create.temp.barId" multiple  filterable :placeholder="$t('errorAnalysis.pen')" class="filter-item" style="width: 100%;">
                   <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -99,7 +99,7 @@
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="状态:" prop="enable">
+              <el-form-item :label="$t('premixedPlan.status')" prop="enable">
                 <el-switch v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"  />
               </el-form-item>
             </el-col>

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

@@ -1,21 +1,21 @@
 <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 v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float: left;" @click="handleCreate">{{$t('premixedPlan.xzcc')}}
       </el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="form_delete">减少车次
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="form_delete">{{$t('premixedPlan.jscc')}}
       </el-button>
-      <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">校验</el-button>
+      <el-button v-if="isRoleEdit" class="success" style="float: left;" @click="handleCheck">{{$t('premixedPlan.jy')}}  </el-button>
       <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success"
         @click="handleChangeOrder">{{$t('formulationEvaluation.ggsx')}}</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 v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">{{$t('premixedPlan.save')}}
         </el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">{{$t('formulationEvaluation.cancel')}}</el-button>
       </div>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">生效
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">{{$t('premixedPlan.sx')}}
       </el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">禁用
+      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">{{$t('premixedPlan.jy')}}
       </el-button>
       <el-button class="import" style="float: right;" @click="handleHistoryRecords">{{$t('dhedFormula.lsjl')}}</el-button>
     </div>
@@ -62,13 +62,13 @@
           </template>
         </el-table-column>
 
-        <el-table-column label="剩料处理方式" min-width="130px" align="center">
+        <el-table-column :label="$t('premixedPlan.slclfs')" 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">
+        <el-table-column :label="$t('premixedPlan.ztls')" min-width="130px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.hstr }}</span>
 
@@ -122,12 +122,12 @@
         <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="6">
-              <el-form-item label="车次:" prop="sort">
+              <el-form-item :label="$t('premixedPlan.cci')"prop="sort">
                 <el-input ref="sort" v-model="create.temp.sort" class="filter-item" type="number" :placeholder="$t('errorAnalysis.projname')"  />
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="栏舍名称:" prop="barid">
+              <el-form-item :label="$t('premixedPlan.lsname')" prop="barid">
                 <el-select v-model="create.temp.barid" multiple filterable :placeholder="$t('errorAnalysis.isHouseName')"  class="filter-item"
                   style="width:100%; " @change="changeBars">
                   <el-option v-for="item in barsList" :key="item.id" :label="item.bname" :value="item.id" />
@@ -136,14 +136,14 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="TMR编号:" prop="tmrid">
-                <el-select v-model="create.temp.tmrid" filterable placeholder="TMR编号" class="filter-item"
+                <el-select v-model="create.temp.tmrid" filterable :placeholder="$t('premixedPlan.tmrbh')"   class="filter-item"
                   style="width: 100%;" @change="changeTMRNumber">
                   <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="生效:" prop="sort">
+              <el-form-item :label="$t('premixedPlan.sx')" prop="sort">
                 <el-switch ref="enable" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949"
                   :active-value="1" :inactive-value="0" />
               </el-form-item>
@@ -151,30 +151,30 @@
           </el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="班次:" prop="times">
-                <el-select v-model="create.temp.times" filterable placeholder="班次" class="filter-item"
+              <el-form-item :label="$t('premixedPlan.bc')"  prop="times">
+                <el-select v-model="create.temp.times" filterable :placeholder="$t('premixedPlan.bc')"   class="filter-item"
                   style="width: 100%;" @change="changeTimes">
                   <el-option v-for="item in frequencyList" :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="lppid">
-                <el-select v-model="create.temp.lppid" filterable placeholder="撒料计划车次跟随" class="filter-item"
+              <el-form-item :label="$t('premixedPlan.sljhccgs')"  prop="lppid">
+                <el-select v-model="create.temp.lppid" filterable :placeholder="$t('premixedPlan.sljhccgs')"  class="filter-item"
                   style="width: 100%;" @change="changeCarFollow">
                   <el-option v-for="item in carFollowList" :key="item.id" :label="item.lppcode" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="时间:" prop="rtime">
+              <el-form-item :label="$t('premixedPlan.time')"  prop="rtime">
 
                 <el-time-picker v-model="create.temp.rtime" type="datetime" placeholder="选择时间" format="HH:mm"
                   value-format="HH:mm" style="display: inline-block;width: 95%;" />
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="剩料处理方式:" prop="treatmethod">
+              <el-form-item :label="$t('premixedPlan.slclfs')"  prop="treatmethod">
                 <el-select v-model="create.temp.treatmethod" filterable placeholder="剩料处理方式" class="filter-item"
                   style="width: 100%;" @change="changeResidueDisposal">
                   <el-option v-for="item in residueDisposalList" :key="item.value" :label="item.label"
@@ -185,7 +185,7 @@
           </el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="转投栏舍:" prop="useinbarid">
+              <el-form-item :label="$t('premixedPlan.ztls')"  prop="useinbarid">
                 <el-select v-model="create.temp.useinbarid" filterable placeholder="转投栏舍" class="filter-item"
                   style="width: 100%;" @change="changeTransferbars" :disabled='isDis'>
                   <el-option v-for="item in transferbarsList" :key="item.id" :label="item.bname" :value="item.id" />
@@ -273,12 +273,12 @@
                 <span>{{ scope.row.rtime }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="剩料处理方式" min-width="130px" align="center">
+            <el-table-column :label="$t('premixedPlan.slclfs')"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">
+            <el-table-column :label="$t('premixedPlan.ztls')"min-width="130px" align="center">
               <template slot-scope="scope">
                 <span>{{ scope.row.hstr }}</span>
               </template>

+ 929 - 929
src/views/shedProduction/dungScores/index.vue

@@ -1,929 +1,929 @@
-<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
-      <!-- 临时注释 -->
-      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button> -->
-      <!-- 临时注释 -->
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">{{$t('dashboard.Export')}}</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='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="$t('errorAnalysis.isHouseName')"  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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  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 Cookies.get('url') + '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 = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { 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)
-      })
-    },
-    form_search() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.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
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择粪便评分', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': '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  {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-
-          var send_data = {
-            "common":{"returnmap":"0"},
-            "data":[
-              {
-                "name":"insertSpotList",
-                "resultmaps":{
-                  "list":this.selectList
-                },
-                "children":[
-                    {
-                      "name":"copyDungscore","type":"e",
-                      "parammaps":{
-                        "id": "@insertSpotList.id",
-                        "pastureid":"@insertSpotList.pastureid"
-                      }
-                    }
-                ]
-              }
-            ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消复制' })
-        })
-      }
-    },
-
-
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/粪便评分导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '粪便评分导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.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>
+<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">{{$t('dashboard.Export')}}</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+        :max-height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='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="$t('premixedPlan.lsname')" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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="$t('premixedPlan.lsname')" 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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
+      myHeight:document.documentElement.clientHeight - 85- 150 - 45
+    }
+  },
+  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 Cookies.get('url') + '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 = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { 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)
+      })
+    },
+    form_search() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.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
+    },
+    form_delete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择粪便评分', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': '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  {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+
+          var send_data = {
+            "common":{"returnmap":"0"},
+            "data":[
+              {
+                "name":"insertSpotList",
+                "resultmaps":{
+                  "list":this.selectList
+                },
+                "children":[
+                    {
+                      "name":"copyDungscore","type":"e",
+                      "parammaps":{
+                        "id": "@insertSpotList.id",
+                        "pastureid":"@insertSpotList.pastureid"
+                      }
+                    }
+                ]
+              }
+            ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消复制' })
+        })
+      }
+    },
+
+
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/粪便评分导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '粪便评分导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.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>

+ 886 - 886
src/views/shedProduction/fecalScreen/index.vue

@@ -1,886 +1,886 @@
-<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
-      <!-- 临时注释 -->
-      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
-      <!-- 临时注释 -->
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">{{$t('dashboard.Export')}}</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' :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="$t('errorAnalysis.isHouseName')"  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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  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 Cookies.get('url') + '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 = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { 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)
-      })
-    },
-    form_search() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.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
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择粪便筛', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': '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  {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-
-          var send_data = {
-            "common":{"returnmap":"0"},
-            "data":[
-              {
-                "name":"insertSpotList",
-                "resultmaps":{
-                  "list":this.selectList
-                },
-                "children":[
-                    {
-                      "name":"copyDungsieve","type":"e",
-                      "parammaps":{
-                        "id": "@insertSpotList.id",
-                        "pastureid":"@insertSpotList.pastureid"
-                      }
-                    }
-                ]
-              }
-            ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消复制' })
-        })
-      }
-    },
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/粪便筛导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '粪便筛导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.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>
+<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">{{$t('dashboard.Export')}}</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+        :max-height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' :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="$t('premixedPlan.lsname')" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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="$t('premixedPlan.lsname')" 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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
+      myHeight:document.documentElement.clientHeight - 85- 150 - 45
+    }
+  },
+  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 Cookies.get('url') + '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 = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { 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)
+      })
+    },
+    form_search() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.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
+    },
+    form_delete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择粪便筛', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': '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  {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+
+          var send_data = {
+            "common":{"returnmap":"0"},
+            "data":[
+              {
+                "name":"insertSpotList",
+                "resultmaps":{
+                  "list":this.selectList
+                },
+                "children":[
+                    {
+                      "name":"copyDungsieve","type":"e",
+                      "parammaps":{
+                        "id": "@insertSpotList.id",
+                        "pastureid":"@insertSpotList.pastureid"
+                      }
+                    }
+                ]
+              }
+            ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消复制' })
+        })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/粪便筛导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '粪便筛导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.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>

+ 902 - 902
src/views/shedProduction/formulaDryMatter/index.vue

@@ -1,902 +1,902 @@
-<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="$t('errorAnalysis.isTrainNumber')"  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="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
-      <!-- 临时注释 -->
-      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
-      <!-- 临时注释 -->
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">{{$t('formulationEvaluation.out')}}</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.barname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  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="是否剩料" min-width="100px" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.excess" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </template>
-        </el-table-column>
-
-        <el-table-column  :label="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' :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="$t('errorAnalysis.isHouseName')"  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="$t('errorAnalysis.isTrainNumber')"  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-row>
-            <el-col :span="12">
-              <el-form-item label="是否剩料:" prop="excess">
-                <el-switch v-model="create.temp.excess"  active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson } 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: '',excess:1 },
-        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' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  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 Cookies.get('url') + '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 = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { 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)
-      })
-    },
-    form_search() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.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: '',excess:1 }
-    },
-    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') }
-          var url = 'authdata/ftdry/add'
-          postJson(url,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') }
-          var url = 'authdata/ftdry/add'
-          postJson(url,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') }
-          var url = 'authdata/ftdry/add'
-          postJson(url,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
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择配方干物质', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': '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  {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-
-          var send_data = {
-            "common":{"returnmap":"0"},
-            "data":[
-              {
-                "name":"insertSpotList",
-                "resultmaps":{
-                  "list":this.selectList
-                },
-                "children":[
-                    {
-                      "name":"copyFtdry","type":"e",
-                      "parammaps":{
-                        "id": "@insertSpotList.id",
-                        "pastureid":"@insertSpotList.pastureid"
-                      }
-                    }
-                ]
-              }
-            ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            if (response.msg === 'fail') {
-              const barid = new RegExp("key 'barid'")
-              if (barid.test(response.data)) {
-                this.$notify({ type: 'warning', message: '该栏舍该班次今日配方干物质已存在,不可重复生成', duration: 2000 })
-                return
-              }
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消复制' })
-        })
-      }
-    },
-
-
-
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/配方干物质导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '配方干物质导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.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','excess_str'],
-              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>
+<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="$t('errorAnalysis.isTrainNumber')"  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="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">{{$t('formulationEvaluation.out')}}</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+        :max-height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  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="是否剩料" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.excess" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </template>
+        </el-table-column>
+
+        <el-table-column  :label="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' :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="$t('premixedPlan.lsname')" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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="$t('premixedPlan.lsname')" 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="$t('premixedPlan.bc')"  prop="times">
+                <el-select ref="times" v-model="create.temp.times" :disabled="create.dialogStatus=='update'" filterable :placeholder="$t('errorAnalysis.isTrainNumber')"  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-row>
+            <el-col :span="12">
+              <el-form-item label="是否剩料:" prop="excess">
+                <el-switch v-model="create.temp.excess"  active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson } 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: '',excess:1 },
+        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' },
+      myHeight:document.documentElement.clientHeight - 85- 150 - 45
+    }
+  },
+  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 Cookies.get('url') + '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 = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { 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)
+      })
+    },
+    form_search() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.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: '',excess:1 }
+    },
+    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') }
+          var url = 'authdata/ftdry/add'
+          postJson(url,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') }
+          var url = 'authdata/ftdry/add'
+          postJson(url,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') }
+          var url = 'authdata/ftdry/add'
+          postJson(url,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
+    },
+    form_delete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择配方干物质', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': '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  {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+
+          var send_data = {
+            "common":{"returnmap":"0"},
+            "data":[
+              {
+                "name":"insertSpotList",
+                "resultmaps":{
+                  "list":this.selectList
+                },
+                "children":[
+                    {
+                      "name":"copyFtdry","type":"e",
+                      "parammaps":{
+                        "id": "@insertSpotList.id",
+                        "pastureid":"@insertSpotList.pastureid"
+                      }
+                    }
+                ]
+              }
+            ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            if (response.msg === 'fail') {
+              const barid = new RegExp("key 'barid'")
+              if (barid.test(response.data)) {
+                this.$notify({ type: 'warning', message: '该栏舍该班次今日配方干物质已存在,不可重复生成', duration: 2000 })
+                return
+              }
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消复制' })
+        })
+      }
+    },
+
+
+
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/配方干物质导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '配方干物质导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.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','excess_str'],
+              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>

+ 858 - 858
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -1,858 +1,858 @@
-<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
-      </el-select>
-      <el-select v-model="record" filterable placeholder="记录" class="filter-item" style="width: 150px;" @change="changeRecord">
-        <el-option v-for="item in recordList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-select v-if="record== '1'" v-model="table.getdataListParm.parammaps.eqcode" filterable placeholder="TMR编号" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.tname" :value="item.eqcode" />
-      </el-select>
-      <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation" v-if="record== '0'">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button>
-      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">{{$t('formulationEvaluation.out')}}</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item  @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-    </div>
-    <div class="operation" v-else>
-      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
-        <el-button style="float: right;margin-right: 10px;" class="export" icon="el-icon-upload2" @click="handleExport(3)">{{$t('formulationEvaluation.out')}}</el-button>
-    </div>
-    <!-- 手动记录 -->
-    <div class="table" v-if="record== '0'">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  min-width="150px" align="center" prop="barname" />
-        <el-table-column label="剩料量(kg)" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="干物质" min-width="150px" align="center" prop="dry" />
-        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  min-width="90px" align="center" prop="timesstr" />
-        <el-table-column label="收集时间" min-width="100px" align="center" prop="operatetime" />
-        <el-table-column label="操作人" min-width="90px" align="center" prop="emp" />
-        <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button v-if="isRoleEdit" :disabled="row.emp == '设备采集'" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <span v-if="isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="isRoleEdit" :disabled="row.emp == '设备采集'" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
-          </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>
-    <!-- TMR设备自动记录 -->
-    <div class="table" v-else>
-      <el-table
-        :key="table.tableKey2"
-        v-loading="table.listLoading2"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 98%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        :height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column label="TMR设备编号" min-width="150px" align="center" prop="eqcode" />
-        <el-table-column label="TMR设备名称" min-width="150px" align="center" prop="eqname" />
-        <el-table-column label="TMR设备类型" min-width="150px" align="center" prop="tclassname" />
-        <el-table-column  :label="$t('errorAnalysis.isHouseName')"  min-width="150px" align="center" prop="barname" />
-        <el-table-column label="收集时间" min-width="150px" align="center" prop="createtime" />
-        <el-table-column label="剩料重量(kg)" min-width="150px" align="center" prop="weight" />
-        <el-table-column label="开始重量(kg)" min-width="150px" align="center" prop="beginweight" />
-        <el-table-column label="结束重量(kg)" min-width="150px" align="center" prop="endweight" />
-        <el-table-column  :label="$t('errorAnalysis.Driver')"  min-width="150px" align="center" prop="driver" />
-      </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <!-- 新增/编辑 -->
-    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" v-if='create.dialogFormVisible' width="40%">
-      <template slot="title">
-        <div class="avue-crud__dialog__header">
-          <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
-            {{ 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 v-if="create.dialogStatus=='create'">
-            <el-col :span="20">
-              <el-form-item label="栏舍名称:" prop="barid">
-                <el-select ref="barid" v-model="create.temp.barid" :disabled="create.dialogStatus=='update'" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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-row>
-          <el-row v-else>
-            <el-col :span="20">
-              <el-form-item label="栏舍名称:" prop="barname">
-                <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="20">
-              <el-form-item label="剩料量:" prop="remain">
-                <el-input ref="remain" v-model="create.temp.remain" class="filter-item" placeholder="剩料量" type="number" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="20">
-              <el-form-item label="干物质:" prop="dry">
-                <el-input ref="dry" v-model="create.temp.dry" class="filter-item" placeholder="干物质" type="number"  />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="20">
-              <el-form-item label="班次:" prop="times">
-                <el-select ref="times" v-model="create.temp.times" filterable :placeholder="$t('errorAnalysis.isTrainNumber')"  :disabled="create.dialogStatus=='update'" class="filter-item" style="width: 100%;">
-                  <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="20">
-              <el-form-item label="处理时间:" prop="operatetime">
-                <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="datetime" placeholder="选择处理时间" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" style="width: 100%;" :clearable="false" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="20">
-              <el-form-item label="操作人:" prop="emp">
-                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" :disabled="create.dialogStatus=='update'" class="filter-item" style="width: 100%;" @blur="blurEmp">
-                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson2  } from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-import { MessageBox } from 'element-ui'
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-export default {
-  name: 'MaterialRemainingRecord',
-  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' }},
-        { name: 'getTMRListEnableType', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'eqtype': '1' }},
-
-      ],
-      houseNameList: [], // 栏舍名称
-      frequencyList: [], // 班次
-      recordList:[{id:'0',name:'手动记录'},{id:'1',name:'TMR设备自动记录'}],
-      record:'0',
-      table: {
-        getdataListParm: {
-          name: 'getBarfeedremainList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            barid: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {},
-        tableKey2:0,
-        listLoading2: false,
-        list2:[]
-      },
-
-      // 新增/编辑
-      create: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '',dry:0, times: '' },
-        rules: {
-          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          remain: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
-        },
-        getdataListParm: {
-          name: 'getBarfeedremainEmpHis',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid')
-          }
-        },
-        noteTakerList: [] // 记录人
-      },
-      textMap: {
-        create: '新增',
-        update: '编辑'
-      },
-
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getBarfeedremainList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            barid: '',
-            startTime: '',
-            stopTime: '',
-            inputDatetime: ''
-          }
-        },
-        list: []
-      },
-      dataSynchronization: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        getdataListParm: {
-          name: 'getSysoptEnable',
-          page: 1,
-          offset: 1,
-          pagecount: 1,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            inforname: 'wgSap'
-          }
-        },
-        isDataSynchronization: false
-      },
-      isokDisable: false,
-      selectList: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45,
-      url:'authdata/ImportExcel'
-    }
-  },
-  computed: {
-    // 设置请求头
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'checkbarname,checktimes,insertBarfeedremainUpload',
-        importParams: '栏舍名称,剩料量(kg),干物质,班次(第一班/第二班/第三班),收集时间,操作人',
-        sheetname: 'Sheet1',
-        // 登录牧场
-        pastureid: Cookies.get('pastureid'),
-        // 日期参数
-        dateParams: '收集时间',
-        // 必填参数
-        requiredParams: '栏舍名称,剩料量(kg),剩料量(kg),班次(第一班/第二班/第三班)',
-        // 为数值的参数
-        numParams: '剩料量(kg)'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      // return Cookies.get('url') + 'authdata/ImportExcel'
-      return Cookies.get('url') + 'authdata/ImportExcel'
-    }
-    // let url = 'authdata/ImportExcel';
-
-  },
-  created() {
-    console.log(document.querySelector("html").getAttribute("domain"),'7777')
-    this.getDataSynchronization()
-    this.getList()
-    this.getDownList()
-    this.getButtons()
-  },
-
-  methods: {
-    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
-        }
-      })
-    },
-    getButtons() {
-      const Edit = 'MaterialRemainingRecord'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.houseNameList = response.data.getBarListEnable.list
-        this.TMRNumberList = response.data.getTMRListEnableType.list
-        if (response.data.getSysoptEnable.list !== null) {
-          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
-            const obj = {}
-            obj.id = String(i)
-            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { obj.name = '第六班' }
-            this.frequencyList.push(obj)
-          }
-        } else {
-          this.frequencyList = []
-        }
-      })
-    },
-    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
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          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)
-      })
-    },
-    changeRecord(item){
-      if(item == '0'){
-        this.table.getdataListParm.name = 'getBarfeedremainList'
-      }else{
-        this.table.getdataListParm.name = 'getRemainplanrecord'
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    form_search() {
-      console.log('点击了查询')
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.barid = ''
-      this.table.getdataListParm.parammaps.startTime = ''
-      this.table.getdataListParm.parammaps.stopTime = ''
-      this.table.getdataListParm.parammaps.inputDatetime = ''
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-
-    // 新增
-    resetTemp() {
-      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '',dry:0, times: '' }
-    },
-    blurEmp(item) {
-      this.create.temp.emp = item.target.value
-    },
-    // 栏舍名称
-    changeBar(item) {
-      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
-    },
-
-    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 = []
-        }
-      })
-    },
-    handleCreate() {
-      console.log('点击了新增')
-      this.dialogFull = false
-      this.resetTemp()
-      this.getNoteTakerList()
-      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 remain = /^\d+(\.\d{1,2})?$/
-          // 剩料量
-          if (!remain.test(parseFloat(this.create.temp.remain))) {
-            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
-            return false
-          }
-          if(this.create.temp.dry){
-            this.create.temp.dry = parseFloat(this.create.temp.dry)
-          }else{
-            this.create.temp.dry = 0
-          }
-          this.requestParam.name = 'insertBarfeedremain'
-          this.requestParam.parammaps = this.create.temp
-          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
-          PostDataByName(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
-            } 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 })
-              }
-            }
-          })
-        }
-      })
-    },
-    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 remain = /^\d+(\.\d{1,2})?$/
-          // 剩料量
-          if (!remain.test(parseFloat(this.create.temp.remain))) {
-            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
-            return false
-          }
-          if(this.create.temp.dry){
-            this.create.temp.dry = parseFloat(this.create.temp.dry)
-          }else{
-            this.create.temp.dry = 0
-          }
-          this.requestParam.name = 'insertBarfeedremain'
-          this.requestParam.parammaps = this.create.temp
-          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
-          PostDataByName(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.resetTemp()
-              this.getList()
-              this.getNoteTakerList()
-            } 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)
-      this.dialogFull = false
-      row.barid = String(row.barid)
-      this.create.temp = Object.assign({}, row)
-      this.create.temp.id = row.id
-
-      this.getNoteTakerList()
-      this.create.dialogStatus = 'update'
-      this.create.dialogFormVisible = true
-    },
-    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 remain = /^\d+(\.\d{1,2})?$/
-          // 剩料量
-          if (!remain.test(parseFloat(this.create.temp.remain))) {
-            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
-            return false
-          }
-
-          this.requestParam.name = 'updateBarfeedremain'
-          if(this.create.temp.dry){
-            this.create.temp.dry = parseFloat(this.create.temp.dry)
-          }else{
-            this.create.temp.dry = 0
-          }
-          this.requestParam.parammaps = this.create.temp
-          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
-          PostDataByName(this.requestParam).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.create.dialogFormVisible = false
-              this.getList()
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          })
-        }
-      })
-    },
-
-    // 删除
-    handleRowDelete(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.selectList = []
-        this.requestParam.name = 'deleteBarfeedremain'
-        this.requestParam.parammaps = {}
-        this.requestParam.parammaps.pastureid = row.pastureid
-        this.requestParam.parammaps.id = row.id
-        PostDataByName(this.requestParam).then(response => {
-          if (response.msg === 'fail') {
-            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-            this.getList()
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    handleSelectionChange(val) {
-      console.log('勾选数据', val)
-      this.selectList = val
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择栏舍剩料记录', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': 'deleteBarfeedremain', 'type': 'e', 'parammaps': {
-            id: '@insertSpotList.id',
-            pastureid: '@insertSpotList.pastureid'
-          }}
-          ExecDataByConfig(this.requestParam).then(response => {
-            console.log('删除保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-    // 复制
-    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 = 'copybarfeedremain'
-          this.requestParam.parammaps = {}
-          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
-          this.requestParam.parammaps.id = this.selectList[0].id
-          PostDataByName(this.requestParam).then(response => {
-            if (response.msg === 'fail') {
-              const barid = new RegExp("key 'barid'")
-              if (barid.test(response.data)) {
-                this.$notify({ type: 'warning', message: '该栏舍该班次今日剩料量已存在,不可重复生成', duration: 2000 })
-                return
-              }
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消复制' })
-        })
-      } else {
-        this.$message({ type: 'error', message: '请选择一条栏舍剩料记录', duration: 2000 })
-      }
-    },
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'authdata/barfeedremain/excel' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'POST',
-          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('点击了导出数据',item,this.record)
-        if(this.record == '0'){
-          this.download.getdataListParm.name = 'getBarfeedremainList'
-        }else{
-          this.download.getdataListParm.name = 'getRemainplanrecord'
-        }
-        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
-          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-        } 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 = []
-          }
-           if(item== 2){
-              var excelDatas1 = [
-                {
-                  tHeader: ['栏舍名称', '剩料量(kg)','干物质', '班次(第一班/第二班/第三班)', '收集时间', '操作人'],
-                  filterVal: ['barname', 'remain','dry', 'timesstr', 'operatetime', 'emp'],
-                  tableDatas: this.download.list,
-                  sheetName: 'Sheet1'
-                }
-              ]
-              json2excel(excelDatas1, '栏舍剩料记录-手动记录', true, 'xlsx')
-           }else{
-             var excelDatas2 = [
-               {
-                 tHeader: ['TMR设备编号','TMR设备名称','TMR设备类型','栏舍名称','收集时间','剩料重量(kg)','开始重量(kg)','结束重量(kg)','驾驶员'],
-                 filterVal: ['eqcode','eqname','tclassname','barname','createtime','weight','beginweight','endweight','driver'],
-                 tableDatas: this.download.list,
-                 sheetName: 'Sheet1'
-               }
-             ]
-             json2excel(excelDatas2, '栏舍剩料记录-TMR设备自动记录', true, 'xlsx')
-           }
-        })
-      }
-    },
-
-    beforeImport(file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
-      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]
-          }
-        })
-      )
-    },
-    handleDataUpload(){
-      let a = Cookies.get('url')
-      let b = a.search(8081)
-      let c = a.substring(0,a.search(8081)) + '8082'
-      let d = a.substring(0,a.lastIndexOf('/'))
-      console.log(d)
-      let url = ''
-      if(b == -1){
-        url = d + ':8082'
-      }else{
-        url = c
-      }
-      console.log(url,'url')
-      let _url = url + '/authdata/surplus/push'
-      let data = {
-        date:parseTime(new Date(), '{y}-{m}-{d}'),
-        pastureId:Cookies.get('pastureid')
-      }
-      console.log(_url,'_url')
-      postJson2(_url, data).then(response => {
-        if(response.msg == 'ok'){
-          this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
-        }else{
-          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    }
-  }
-}
-</script>
+<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
+      </el-select>
+      <el-select v-model="record" filterable placeholder="记录" class="filter-item" style="width: 150px;" @change="changeRecord">
+        <el-option v-for="item in recordList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-select v-if="record== '1'" v-model="table.getdataListParm.parammaps.eqcode" filterable :placeholder="$t('premixedPlan.tmrbh')"   class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.tname" :value="item.eqcode" />
+      </el-select>
+      <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation" v-if="record== '0'">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button>
+      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">{{$t('formulationEvaluation.out')}}</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item  @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+    <div class="operation" v-else>
+      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
+        <el-button style="float: right;margin-right: 10px;" class="export" icon="el-icon-upload2" @click="handleExport(3)">{{$t('formulationEvaluation.out')}}</el-button>
+    </div>
+    <!-- 手动记录 -->
+    <div class="table" v-if="record== '0'">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+        :max-height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  min-width="150px" align="center" prop="barname" />
+        <el-table-column label="剩料量(kg)" min-width="150px" align="center" prop="remain" />
+        <el-table-column label="干物质" min-width="150px" align="center" prop="dry" />
+        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  min-width="90px" align="center" prop="timesstr" />
+        <el-table-column label="收集时间" min-width="100px" align="center" prop="operatetime" />
+        <el-table-column label="操作人" min-width="90px" align="center" prop="emp" />
+        <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isRoleEdit" :disabled="row.emp == '设备采集'" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <span v-if="isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="isRoleEdit" :disabled="row.emp == '设备采集'" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
+          </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>
+    <!-- TMR设备自动记录 -->
+    <div class="table" v-else>
+      <el-table
+        :key="table.tableKey2"
+        v-loading="table.listLoading2"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 98%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column label="TMR设备编号" min-width="150px" align="center" prop="eqcode" />
+        <el-table-column label="TMR设备名称" min-width="150px" align="center" prop="eqname" />
+        <el-table-column label="TMR设备类型" min-width="150px" align="center" prop="tclassname" />
+        <el-table-column  :label="$t('errorAnalysis.isHouseName')"  min-width="150px" align="center" prop="barname" />
+        <el-table-column label="收集时间" min-width="150px" align="center" prop="createtime" />
+        <el-table-column label="剩料重量(kg)" min-width="150px" align="center" prop="weight" />
+        <el-table-column label="开始重量(kg)" min-width="150px" align="center" prop="beginweight" />
+        <el-table-column label="结束重量(kg)" min-width="150px" align="center" prop="endweight" />
+        <el-table-column  :label="$t('errorAnalysis.Driver')"  min-width="150px" align="center" prop="driver" />
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 新增/编辑 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" v-if='create.dialogFormVisible' width="40%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ 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 v-if="create.dialogStatus=='create'">
+            <el-col :span="20">
+              <el-form-item :label="$t('premixedPlan.lsname')" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" :disabled="create.dialogStatus=='update'" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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-row>
+          <el-row v-else>
+            <el-col :span="20">
+              <el-form-item :label="$t('premixedPlan.lsname')" 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="20">
+              <el-form-item label="剩料量:" prop="remain">
+                <el-input ref="remain" v-model="create.temp.remain" class="filter-item" placeholder="剩料量" type="number" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="20">
+              <el-form-item label="干物质:" prop="dry">
+                <el-input ref="dry" v-model="create.temp.dry" class="filter-item" placeholder="干物质" type="number"  />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="20">
+              <el-form-item :label="$t('premixedPlan.bc')"  prop="times">
+                <el-select ref="times" v-model="create.temp.times" filterable :placeholder="$t('errorAnalysis.isTrainNumber')"  :disabled="create.dialogStatus=='update'" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="20">
+              <el-form-item label="处理时间:" prop="operatetime">
+                <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="datetime" placeholder="选择处理时间" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" style="width: 100%;" :clearable="false" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="20">
+              <el-form-item label="操作人:" prop="emp">
+                <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" :disabled="create.dialogStatus=='update'" class="filter-item" style="width: 100%;" @blur="blurEmp">
+                  <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson2  } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'MaterialRemainingRecord',
+  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' }},
+        { name: 'getTMRListEnableType', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'eqtype': '1' }},
+
+      ],
+      houseNameList: [], // 栏舍名称
+      frequencyList: [], // 班次
+      recordList:[{id:'0',name:'手动记录'},{id:'1',name:'TMR设备自动记录'}],
+      record:'0',
+      table: {
+        getdataListParm: {
+          name: 'getBarfeedremainList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {},
+        tableKey2:0,
+        listLoading2: false,
+        list2:[]
+      },
+
+      // 新增/编辑
+      create: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '',dry:0, times: '' },
+        rules: {
+          barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          remain: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+        },
+        getdataListParm: {
+          name: 'getBarfeedremainEmpHis',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid')
+          }
+        },
+        noteTakerList: [] // 记录人
+      },
+      textMap: {
+        create: '新增',
+        update: '编辑'
+      },
+
+      requestParam: {},
+      download: {
+        getdataListParm: {
+          name: 'getBarfeedremainList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            barid: '',
+            startTime: '',
+            stopTime: '',
+            inputDatetime: ''
+          }
+        },
+        list: []
+      },
+      dataSynchronization: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        getdataListParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'wgSap'
+          }
+        },
+        isDataSynchronization: false
+      },
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight:document.documentElement.clientHeight - 85- 150 - 45,
+      url:'authdata/ImportExcel'
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'checkbarname,checktimes,insertBarfeedremainUpload',
+        importParams: '栏舍名称,剩料量(kg),干物质,班次(第一班/第二班/第三班),收集时间,操作人',
+        sheetname: 'Sheet1',
+        // 登录牧场
+        pastureid: Cookies.get('pastureid'),
+        // 日期参数
+        dateParams: '收集时间',
+        // 必填参数
+        requiredParams: '栏舍名称,剩料量(kg),剩料量(kg),班次(第一班/第二班/第三班)',
+        // 为数值的参数
+        numParams: '剩料量(kg)'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      // return Cookies.get('url') + 'authdata/ImportExcel'
+      return Cookies.get('url') + 'authdata/ImportExcel'
+    }
+    // let url = 'authdata/ImportExcel';
+
+  },
+  created() {
+    console.log(document.querySelector("html").getAttribute("domain"),'7777')
+    this.getDataSynchronization()
+    this.getList()
+    this.getDownList()
+    this.getButtons()
+  },
+
+  methods: {
+    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
+        }
+      })
+    },
+    getButtons() {
+      const Edit = 'MaterialRemainingRecord'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.houseNameList = response.data.getBarListEnable.list
+        this.TMRNumberList = response.data.getTMRListEnableType.list
+        if (response.data.getSysoptEnable.list !== null) {
+          for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
+            const obj = {}
+            obj.id = String(i)
+            if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }else if (i == 5) { obj.name = '第五班' }else if (i == 6) { obj.name = '第六班' }
+            this.frequencyList.push(obj)
+          }
+        } else {
+          this.frequencyList = []
+        }
+      })
+    },
+    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
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          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)
+      })
+    },
+    changeRecord(item){
+      if(item == '0'){
+        this.table.getdataListParm.name = 'getBarfeedremainList'
+      }else{
+        this.table.getdataListParm.name = 'getRemainplanrecord'
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    form_search() {
+      console.log('点击了查询')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.barid = ''
+      this.table.getdataListParm.parammaps.startTime = ''
+      this.table.getdataListParm.parammaps.stopTime = ''
+      this.table.getdataListParm.parammaps.inputDatetime = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    // 新增
+    resetTemp() {
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '',dry:0, times: '' }
+    },
+    blurEmp(item) {
+      this.create.temp.emp = item.target.value
+    },
+    // 栏舍名称
+    changeBar(item) {
+      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
+    },
+
+    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 = []
+        }
+      })
+    },
+    handleCreate() {
+      console.log('点击了新增')
+      this.dialogFull = false
+      this.resetTemp()
+      this.getNoteTakerList()
+      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 remain = /^\d+(\.\d{1,2})?$/
+          // 剩料量
+          if (!remain.test(parseFloat(this.create.temp.remain))) {
+            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
+            return false
+          }
+          if(this.create.temp.dry){
+            this.create.temp.dry = parseFloat(this.create.temp.dry)
+          }else{
+            this.create.temp.dry = 0
+          }
+          this.requestParam.name = 'insertBarfeedremain'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.create.dialogFormVisible = false
+              this.getList()
+            } 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 })
+              }
+            }
+          })
+        }
+      })
+    },
+    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 remain = /^\d+(\.\d{1,2})?$/
+          // 剩料量
+          if (!remain.test(parseFloat(this.create.temp.remain))) {
+            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
+            return false
+          }
+          if(this.create.temp.dry){
+            this.create.temp.dry = parseFloat(this.create.temp.dry)
+          }else{
+            this.create.temp.dry = 0
+          }
+          this.requestParam.name = 'insertBarfeedremain'
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.resetTemp()
+              this.getList()
+              this.getNoteTakerList()
+            } 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)
+      this.dialogFull = false
+      row.barid = String(row.barid)
+      this.create.temp = Object.assign({}, row)
+      this.create.temp.id = row.id
+
+      this.getNoteTakerList()
+      this.create.dialogStatus = 'update'
+      this.create.dialogFormVisible = true
+    },
+    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 remain = /^\d+(\.\d{1,2})?$/
+          // 剩料量
+          if (!remain.test(parseFloat(this.create.temp.remain))) {
+            this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
+            return false
+          }
+
+          this.requestParam.name = 'updateBarfeedremain'
+          if(this.create.temp.dry){
+            this.create.temp.dry = parseFloat(this.create.temp.dry)
+          }else{
+            this.create.temp.dry = 0
+          }
+          this.requestParam.parammaps = this.create.temp
+          if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
+          PostDataByName(this.requestParam).then(response => {
+            console.log('新增保存发送参数', this.requestParam)
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.create.dialogFormVisible = false
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+
+    // 删除
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.selectList = []
+        this.requestParam.name = 'deleteBarfeedremain'
+        this.requestParam.parammaps = {}
+        this.requestParam.parammaps.pastureid = row.pastureid
+        this.requestParam.parammaps.id = row.id
+        PostDataByName(this.requestParam).then(response => {
+          if (response.msg === 'fail') {
+            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
+            this.getList()
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+    handleSelectionChange(val) {
+      console.log('勾选数据', val)
+      this.selectList = val
+    },
+    form_delete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择栏舍剩料记录', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'deleteBarfeedremain', 'type': 'e', 'parammaps': {
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('删除保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    // 复制
+    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 = 'copybarfeedremain'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
+          this.requestParam.parammaps.id = this.selectList[0].id
+          PostDataByName(this.requestParam).then(response => {
+            if (response.msg === 'fail') {
+              const barid = new RegExp("key 'barid'")
+              if (barid.test(response.data)) {
+                this.$notify({ type: 'warning', message: '该栏舍该班次今日剩料量已存在,不可重复生成', duration: 2000 })
+                return
+              }
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消复制' })
+        })
+      } else {
+        this.$message({ type: 'error', message: '请选择一条栏舍剩料记录', duration: 2000 })
+      }
+    },
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = Cookies.get('url') + 'authdata/barfeedremain/excel' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'POST',
+          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('点击了导出数据',item,this.record)
+        if(this.record == '0'){
+          this.download.getdataListParm.name = 'getBarfeedremainList'
+        }else{
+          this.download.getdataListParm.name = 'getRemainplanrecord'
+        }
+        this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+        if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
+          this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+          this.download.getdataListParm.parammaps.stopTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+        } 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 = []
+          }
+           if(item== 2){
+              var excelDatas1 = [
+                {
+                  tHeader: ['栏舍名称', '剩料量(kg)','干物质', '班次(第一班/第二班/第三班)', '收集时间', '操作人'],
+                  filterVal: ['barname', 'remain','dry', 'timesstr', 'operatetime', 'emp'],
+                  tableDatas: this.download.list,
+                  sheetName: 'Sheet1'
+                }
+              ]
+              json2excel(excelDatas1, '栏舍剩料记录-手动记录', true, 'xlsx')
+           }else{
+             var excelDatas2 = [
+               {
+                 tHeader: ['TMR设备编号','TMR设备名称','TMR设备类型','栏舍名称','收集时间','剩料重量(kg)','开始重量(kg)','结束重量(kg)','驾驶员'],
+                 filterVal: ['eqcode','eqname','tclassname','barname','createtime','weight','beginweight','endweight','driver'],
+                 tableDatas: this.download.list,
+                 sheetName: 'Sheet1'
+               }
+             ]
+             json2excel(excelDatas2, '栏舍剩料记录-TMR设备自动记录', true, 'xlsx')
+           }
+        })
+      }
+    },
+
+    beforeImport(file) {
+      const isLt2M = file.size / 1024 / 1024 < 2
+      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]
+          }
+        })
+      )
+    },
+    handleDataUpload(){
+      let a = Cookies.get('url')
+      let b = a.search(8081)
+      let c = a.substring(0,a.search(8081)) + '8082'
+      let d = a.substring(0,a.lastIndexOf('/'))
+      console.log(d)
+      let url = ''
+      if(b == -1){
+        url = d + ':8082'
+      }else{
+        url = c
+      }
+      console.log(url,'url')
+      let _url = url + '/authdata/surplus/push'
+      let data = {
+        date:parseTime(new Date(), '{y}-{m}-{d}'),
+        pastureId:Cookies.get('pastureid')
+      }
+      console.log(_url,'_url')
+      postJson2(_url, data).then(response => {
+        if(response.msg == 'ok'){
+          this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
+        }else{
+          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    }
+  }
+}
+</script>

+ 932 - 932
src/views/shedProduction/pennsylvaniaSieve/index.vue

@@ -1,932 +1,932 @@
-<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="$t('errorAnalysis.isTrainNumber')"  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="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
-      <!-- 临时注释 -->
-      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
-      <!-- 临时注释 -->
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">{{$t('formulationEvaluation.out')}}</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="40" />
-        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  min-width="100px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.barname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' 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="$t('errorAnalysis.isHouseName')"  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="$t('errorAnalysis.isTrainNumber')"  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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  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 Cookies.get('url') + '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)
-      })
-    },
-    form_search() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.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
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择宾州筛', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': '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  {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-
-          var send_data = {
-            "common":{"returnmap":"0"},
-            "data":[
-              {
-                "name":"insertSpotList",
-                "resultmaps":{
-                  "list":this.selectList
-                },
-                "children":[
-                    {
-                      "name":"copyPennsieve","type":"e",
-                      "parammaps":{
-                        "id": "@insertSpotList.id",
-                        "pastureid":"@insertSpotList.pastureid"
-                      }
-                    }
-                ]
-              }
-            ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消复制' })
-        })
-      }
-    },
-
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/宾州筛导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '宾州筛导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.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>
+<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="$t('errorAnalysis.isTrainNumber')"  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="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">{{$t('formulationEvaluation.out')}}</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+        :max-height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="40" />
+        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.barname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('errorAnalysis.isTrainNumber')"  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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' 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="$t('premixedPlan.lsname')" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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="$t('premixedPlan.lsname')" 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="$t('premixedPlan.bc')"  prop="times">
+                <el-select ref="times" v-model="create.temp.times" :disabled="create.dialogStatus=='update'" filterable :placeholder="$t('errorAnalysis.isTrainNumber')"  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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
+      myHeight:document.documentElement.clientHeight - 85- 150 - 45
+    }
+  },
+  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 Cookies.get('url') + '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)
+      })
+    },
+    form_search() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.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
+    },
+    form_delete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择宾州筛', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': '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  {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+
+          var send_data = {
+            "common":{"returnmap":"0"},
+            "data":[
+              {
+                "name":"insertSpotList",
+                "resultmaps":{
+                  "list":this.selectList
+                },
+                "children":[
+                    {
+                      "name":"copyPennsieve","type":"e",
+                      "parammaps":{
+                        "id": "@insertSpotList.id",
+                        "pastureid":"@insertSpotList.pastureid"
+                      }
+                    }
+                ]
+              }
+            ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消复制' })
+        })
+      }
+    },
+
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/宾州筛导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '宾州筛导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.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>

+ 2 - 2
src/views/shedProduction/performance/index.vue

@@ -177,14 +177,14 @@
           </el-row>
           <el-row>
             <el-col v-if="create.dialogStatus=='create'" :span="6">
-              <el-form-item label="栏舍名称:" prop="barid">
+              <el-form-item :label="$t('premixedPlan.lsname')" prop="barid">
                 <el-select v-model="create.temp.barid" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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-form-item :label="$t('premixedPlan.lsname')" prop="barname">
                 <el-input ref="barname" v-model="create.temp.barname" disabled class="filter-item" placeholder="barname" />
               </el-form-item>
             </el-col>

+ 956 - 956
src/views/shedProduction/physicalConditionScore/index.vue

@@ -1,956 +1,956 @@
-<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
-      <!-- 临时注释 -->
-      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
-      <!-- 临时注释 -->
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">{{$t('dashboard.Export')}}</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" align="center" width="50" />
-        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  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.5分-(头)" 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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' 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="$t('errorAnalysis.isHouseName')"  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.5分-:" 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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
-      myHeight:document.documentElement.clientHeight - 85- 150 - 45
-    }
-  },
-  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 Cookies.get('url') + '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)
-      })
-    },
-    form_search() {
-      console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.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
-    },
-    form_delete() {
-      console.log('点击了删除')
-      if (this.selectList.length == 0) {
-        this.$message({ type: 'error', message: '请选择体况评分', duration: 2000 })
-      } else {
-        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-          console.log(this.selectList)
-          this.requestParam.common = { 'returnmap': '0' }
-          this.requestParam.data = []
-          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
-          this.requestParam.data[0].children = []
-          this.requestParam.data[0].children[0] = { 'name': '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  {
-        MessageBox.confirm('是否确认复制此信息?', {
-          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-        }).then(() => {
-     
-          var send_data = {
-            "common":{"returnmap":"0"},
-            "data":[
-              {
-                "name":"insertSpotList",
-                "resultmaps":{
-                  "list":this.selectList
-                },
-                "children":[
-                    {
-                      "name":"copyBodyscore","type":"e",
-                      "parammaps":{
-                        "id": "@insertSpotList.id",
-                        "pastureid":"@insertSpotList.pastureid"
-                      }
-                    }
-                ]
-              }
-            ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            if (response.msg === 'fail') {     
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.getList()
-            }
-          })
-        }).catch(() => {
-          this.$message({ type: 'info', message: '已取消复制' })
-        })
-      } 
-    },
-
-
-    // 导出
-    handleExport(item) {
-      if (item == 1) {
-        console.log('点击了导出模板')
-        const requestParam = this.requestParam
-        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/体况评分导入模板.xlsx' // 请求下载文件的地址
-        console.log(url)
-        axios({
-          method: 'GET',
-          url: url,
-          data: requestParam,
-          headers: { token: getToken(), optname: 'insertcustomdoc' },
-          responseType: 'blob'
-        }).then(res => {
-          if (!res) return
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-          const blob = new Blob([res.data], {
-            type: 'application/octet-stream;charset=utf-8'
-          })
-          const url = window.URL.createObjectURL(blob)
-          const aLink = document.createElement('a')
-          aLink.style.display = 'none'
-          aLink.href = url
-          const docname = '体况评分导入模板.xlsx'
-          aLink.setAttribute('download', docname) // 下载的文件
-          document.body.appendChild(aLink)
-          aLink.click()
-          document.body.removeChild(aLink)
-          window.URL.revokeObjectURL(url)
-        })
-      } else {
-        console.log('点击了导出数据')
-        this.download.getdataListParm.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>
+<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="$t('common.to')"  :start-placeholder="$t('common.startTime')" :end-placeholder="$t('common.endTime')" 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="$t('errorAnalysis.isHouseName')"  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="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+      <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">{{$t('formulationEvaluation.del')}}</el-button>
+      <!-- 临时注释 -->
+      <!-- <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy" @click="handleCopy">复制</el-button> -->
+      <!-- 临时注释 -->
+      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
+        <el-button class="import" icon="el-icon-download" style="float: right;">{{$t('formulationEvaluation.enter')}}</el-button>
+      </el-upload>
+      <el-dropdown style="float: right;margin-right: 10px;">
+        <el-button class="export" icon="el-icon-upload2">{{$t('dashboard.Export')}}</el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item @click.native="handleExport(1)">{{$t('formulationEvaluation.outmb')}}</el-dropdown-item>
+          <el-dropdown-item @click.native="handleExport(2)">{{$t('formulationEvaluation.outsj')}}</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button class="export" style="float: right;" @click="handleHistoryRecord">{{$t('dhedFormula.lsjl')}}</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        @selection-change="handleSelectionChange"
+        :max-height="myHeight"
+      >
+        <el-table-column type="selection" align="center" width="50" />
+        <el-table-column :label="$t('formulationEvaluation.xh')" 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="$t('errorAnalysis.isHouseName')"  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.5分-(头)" 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="$t('formulationEvaluation.remark')" 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="$t('errorAnalysis.cz')" 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" v-if='create.dialogFormVisible' 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="$t('premixedPlan.lsname')" prop="barid">
+                <el-select ref="barid" v-model="create.temp.barid" :disabled="create.dialogStatus == 'update'" filterable :placeholder="$t('errorAnalysis.isHouseName')"  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="$t('premixedPlan.lsname')" 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.5分-:" 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()">{{$t('common.closed')}}</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()">{{$t('errorAnalysis.confirm')}}</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; ">{{$t('common.closed')}}</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' },
+      myHeight:document.documentElement.clientHeight - 85- 150 - 45
+    }
+  },
+  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 Cookies.get('url') + '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)
+      })
+    },
+    form_search() {
+      console.log('点击了查询')
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.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
+    },
+    form_delete() {
+      console.log('点击了删除')
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择体况评分', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': '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  {
+        MessageBox.confirm('是否确认复制此信息?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+
+          var send_data = {
+            "common":{"returnmap":"0"},
+            "data":[
+              {
+                "name":"insertSpotList",
+                "resultmaps":{
+                  "list":this.selectList
+                },
+                "children":[
+                    {
+                      "name":"copyBodyscore","type":"e",
+                      "parammaps":{
+                        "id": "@insertSpotList.id",
+                        "pastureid":"@insertSpotList.pastureid"
+                      }
+                    }
+                ]
+              }
+            ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消复制' })
+        })
+      }
+    },
+
+
+    // 导出
+    handleExport(item) {
+      if (item == 1) {
+        console.log('点击了导出模板')
+        const requestParam = this.requestParam
+        const url = Cookies.get('url') + 'file/导入导出模板/栏舍生产/体况评分导入模板.xlsx' // 请求下载文件的地址
+        console.log(url)
+        axios({
+          method: 'GET',
+          url: url,
+          data: requestParam,
+          headers: { token: getToken(), optname: 'insertcustomdoc' },
+          responseType: 'blob'
+        }).then(res => {
+          if (!res) return
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+          const blob = new Blob([res.data], {
+            type: 'application/octet-stream;charset=utf-8'
+          })
+          const url = window.URL.createObjectURL(blob)
+          const aLink = document.createElement('a')
+          aLink.style.display = 'none'
+          aLink.href = url
+          const docname = '体况评分导入模板.xlsx'
+          aLink.setAttribute('download', docname) // 下载的文件
+          document.body.appendChild(aLink)
+          aLink.click()
+          document.body.removeChild(aLink)
+          window.URL.revokeObjectURL(url)
+        })
+      } else {
+        console.log('点击了导出数据')
+        this.download.getdataListParm.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>

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

@@ -288,7 +288,7 @@
             max-height="260px"
           >
             <el-table-column label="$t('processAnalysis.sort')" min-width="110px" align="center" prop="sort" />
-            <el-table-column label="转投栏舍" min-width="110px" align="center" prop="fname" />
+            <el-table-column :label="$t('premixedPlan.ztls')"min-width="110px" align="center" prop="fname" />
             <el-table-column label="允许分配剩料量" min-width="110px" align="center" prop="lweight" />
             <el-table-column label="实际分配重量(kg)" min-width="110px" align="center" prop="actualweightminus" />
             <el-table-column label="废弃剩料重量" min-width="110px" align="center" prop="aweight" />

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

@@ -319,7 +319,7 @@
             max-height="260px"
           >
             <el-table-column label="$t('processAnalysis.sort')" min-width="110px" align="center" prop="sort" />
-            <el-table-column label="转投栏舍" min-width="110px" align="center" prop="fname" />
+            <el-table-column :label="$t('premixedPlan.ztls')"min-width="110px" align="center" prop="fname" />
             <el-table-column label="允许分配剩料量" min-width="110px" align="center" prop="lweight" />
             <el-table-column label="实际分配重量(kg)" min-width="110px" align="center" prop="actualweightminus" />
             <el-table-column label="废弃剩料重量" min-width="110px" align="center" prop="aweight" />

+ 2 - 2
src/views/systemManagement/boardEchartManagement/index.vue

@@ -49,7 +49,7 @@
                   <el-input v-if="scope.row.Edit" v-model="scope.row.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
                 </template>
               </el-table-column>
-              <el-table-column label="状态" min-width="100px" align="center">
+              <el-table-column :label="$t('premixedPlan.status')" min-width="100px" align="center">
                 <template slot-scope="scope">
                   <span v-if="scope.row.NoEdit && scope.row.statue == 1">公开</span>
                   <span v-if="scope.row.NoEdit && scope.row.statue == 0">私有</span>
@@ -157,7 +157,7 @@
                   <el-input v-if="scope.row.Edit" v-model="scope.row.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
                 </template>
               </el-table-column>
-              <el-table-column label="状态" min-width="200px" align="center">
+              <el-table-column :label="$t('premixedPlan.status')" min-width="200px" align="center">
                 <template slot-scope="scope">
                   <span v-if="scope.row.NoEdit && scope.row.statue == 1">公开</span>
                   <span v-if="scope.row.NoEdit && scope.row.statue == 0">私有</span>

+ 909 - 909
src/views/systemManagement/boardEchartManagement2/index.vue

@@ -1,909 +1,909 @@
-<template>
-
-  <div class="app-container">
-
-    <el-tabs v-model="activeName" @tab-click="handleClick">
-      <el-tab-pane label="仪表盘" name="first">
-        <div class="search">
-          <el-input v-model="table.getdataListParm.parammaps.dname" placeholder="仪表盘名称" style="width: 180px;" class="filter-item" clearable />
-          <el-select v-model="table.getdataListParm.parammaps.statue" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
-            <el-option v-for="item in statueList" :key="item.id" :label="item.value" :value="item.id" />
-          </el-select>
-          <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
-          <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-        </div>
-        <div class="operation">
-          <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">{{$t('formulationEvaluation.add')}}</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"
-            >
-              <!-- <el-table-column type="selection" align="center" width="50" /> -->
-              <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
-                <template slot-scope="scope">
-                  <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="仪表盘名称" min-width="180px" align="center">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.NoEdit">{{ scope.row.dname }}</span>
-                  <el-input v-if="scope.row.Edit" v-model="scope.row.dname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
-                </template>
-              </el-table-column>
-
-              <el-table-column label="仪表盘描述" min-width="180px" align="center">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.NoEdit">{{ scope.row.display }}</span>
-                  <el-input v-if="scope.row.Edit" v-model="scope.row.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
-                </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.statue == 1">公开</span>
-                  <span v-if="scope.row.NoEdit && scope.row.statue == 0">私有</span>
-                  <el-select v-if="scope.row.Edit" v-model="scope.row.statue" filterable placeholder="状态" class="filter-item" style="width:95%;padding:10px 0;" @change="changeStatue">
-                    <el-option v-for="item in statueList" :key="item.id" :label="item.value" :value="item.id" />
-                  </el-select>
-                </template>
-              </el-table-column>
-
-              <el-table-column label="分发角色" min-width="150px" align="center">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.NoEdit">{{ scope.row.rolenames }}</span>
-                  <el-select v-if="scope.row.Edit" v-model="scope.row.rolenamesId" multiple filterable placeholder="分发角色" class="filter-item" style="width:95%;padding:10px 0;" @change="changeRole">
-                    <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
-                  </el-select>
-                </template>
-              </el-table-column>
-
-              <el-table-column label="显示到菜单" min-width="90px" align="center">
-                <template slot-scope="scope">
-                  <el-switch v-model="scope.row.reportenable" :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="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.opratetime }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
-                <template slot-scope="{row}">
-
-                  <!-- 跳转页面 -->
-                  <el-button class="miniSuccess" icon="el-icon-search" @click="jumpSee(row)" />
-                  <span v-if="isRoleEdit" class="centerSpan">|</span>
-                  <!-- <el-button class="miniSuccess" :disabled="row.empid != empid" @click="jumpEdit(row)">修改仪表盘</el-button> -->
-
-                  <!-- 新增 -->
-                  <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @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" :disabled="row.empid != empid" 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" :disabled="row.empid != empid" icon="el-icon-delete" @click="handleRowDelete(row)" />
-                  <!-- 编辑保存 -->
-                  <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @click="updateData(row)" />
-                  <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-                  <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-form>
-          <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="图表" name="second">
-        <div class="search">
-          <el-input v-model="table2.getdataListParm.parammaps.dname" placeholder="图表名称" style="width: 180px;" class="filter-item" clearable />
-          <el-select v-model="table2.getdataListParm.parammaps.statue" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
-            <el-option v-for="item in statueList2" :key="item.id" :label="item.value" :value="item.id" />
-          </el-select>
-          <el-button class="successBorder" @click="form_search2">{{$t('common.query')}}</el-button>
-          <el-button class="successBorder" @click="handleRefresh2">{{$t('common.reset')}}</el-button>
-        </div>
-        <div class="operation">
-          <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate2">{{$t('formulationEvaluation.add')}}</el-button>
-        </div>
-        <div class="table">
-          <el-form ref="form" :rules="table2.rules" :model="table2">
-            <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"
-            >
-              <!-- <el-table-column type="selection" align="center" width="50" /> -->
-              <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
-                <template slot-scope="scope">
-                  <span>{{ scope.$index + (table2.pageNum-1) * table2.pageSize + 1 }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="图表名称" min-width="200px" align="center">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.NoEdit">{{ scope.row.cname }}</span>
-                  <el-input v-if="scope.row.Edit" v-model="scope.row.cname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
-                </template>
-              </el-table-column>
-
-              <el-table-column label="图表描述" min-width="200px" 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}" style="width:95%;padding:0 10px;" maxlength="32" />
-                </template>
-              </el-table-column>
-              <el-table-column label="状态" min-width="200px" align="center">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.NoEdit && scope.row.statue == 1">公开</span>
-                  <span v-if="scope.row.NoEdit && scope.row.statue == 0">私有</span>
-                  <el-select v-if="scope.row.Edit" v-model="scope.row.statue" filterable placeholder="状态" class="filter-item" style="width:95%;padding:10px 0;" @change="changeStatue2">
-                    <el-option v-for="item in statueList" :key="item.id" :label="item.value" :value="item.id" />
-                  </el-select>
-                </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.opratetime }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
-                <template slot-scope="{row}">
-
-                  <!-- 跳转页面 -->
-                  <el-button class="miniSuccess" icon="el-icon-search" @click="jumpSee2(row)" />
-                  <span v-if="isRoleEdit" class="centerSpan">|</span>
-                  <a v-if="isRoleEdit" class="correcting" :disabled="row.empid != empid" @click="jumpEdit2(row)">修改图表</a>
-                  <span v-if="isRoleEdit" class="centerSpan">|</span>
-                  <!-- 新增 -->
-                  <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @click="createData2(row)" />
-                  <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-                  <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel2(row)" />
-                  <!-- 编辑 -->
-                  <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" :disabled="row.empid != empid" 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" :disabled="row.empid != empid" icon="el-icon-delete" @click="handleRowDelete2(row)" />
-                  <!-- 编辑保存 -->
-                  <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @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)" />
-
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-form>
-          <pagination v-show="table2.total>=0" :total="table2.total" :page.sync="table2.getdataListParm.offset" :limit.sync="table2.getdataListParm.pagecount" @pagination="getList2" />
-        </div>
-      </el-tab-pane>
-
-    </el-tabs>
-    <el-dialog title="新增仪表盘" width="750px" :visible.sync="editDialogVisible">
-      <el-form label-width="160px">
-        <el-form-item label="仪表盘名称">
-          <el-input v-model="dbObj.dname" size="small" style="width: 450px;" placeholder="请输入仪表盘名称" />
-        </el-form-item>
-        <el-form-item label="仪表盘描述">
-          <el-input v-model="dbObj.display" type="textarea" :rows="5" size="small" style="width: 450px;" placeholder="请输入仪表盘描述" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
-        <el-button class="cancelClose" @click="editDialogVisible = false">{{$t('formulationEvaluation.cancel')}}</el-button>
-        <el-button class="save" @click="handleSubmit"> 确认</el-button>
-      </div>
-    </el-dialog>
-  </div>
-
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, 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: 'BoardEchartManagement2',
-  components: { Pagination },
-  data() {
-    return {
-      empid: Cookies.get('employeid'),
-      editDialogVisible: false,
-      dbObj: {},
-      // requestParams: [
-      //   { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
-      // ],
-      requestParams: [
-        { name: 'getRoleAll', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
-      ],
-
-      statueList: [{ id: '1', value: '公开' }, { id: '0', value: '私有' }],
-      statueList2: [{ id: '1', value: '公开' }, { id: '0', value: '私有' }],
-
-      roleList: [],
-
-      rolenamesIdTempArr: [],
-
-      table: {
-        rules: {
-          name: { type: 'string', required: true, message: '必填字段', trigger: 'change' }
-        },
-        getdataListParm: {
-          name: 'getDashboardList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            dname: '',
-            statue: '',
-            empid: Cookies.get('employeid')
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {}
-      },
-
-      table2: {
-        rules: {
-          name: { type: 'string', required: true, message: '必填字段', trigger: 'change' }
-        },
-        getdataListParm: {
-          name: 'getChartList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            cname: '',
-            statue: '',
-            empid: Cookies.get('employeid')
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        temp: {}
-      },
-
-      requestParam: {},
-      isokDisable: false,
-      selectList: [],
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-
-      activeName: 'first',
-      isRoleEdit: []
-
-    }
-  },
-
-  created() {
-    this.getList()
-    this.getList2()
-    this.getDownList()
-    this.getButtons()
-
-    if (this.$route.params.tab == 'second') {
-      this.activeName = 'second'
-    } else {
-      this.activeName = 'first'
-    }
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'BoardEchartManagement'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    handleClick(tab, event) {
-      console.log(tab, event)
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        console.log('下拉框数据', response.data)
-        this.roleList = response.data.getRoleAll.list
-      })
-    },
-    getList() {
-      this.table.listLoading = true
-      console.log(this.table.getdataListParm)
-      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) // 编辑保存
-          }
-
-          var arr = response.data.list
-
-          arr.map(function(i, j) {
-            // console.log(i, '====')
-            if (i.roleids) {
-              return i.rolenamesId = i.roleids.split(',')
-            } else {
-              return i.rolenamesId = []
-            }
-          })
-
-          arr.map(function(i, j) {
-            if (i.roleids) {
-              return i.rolenamesId2B = i.roleids.split(',')
-            } else {
-              return i.rolenamesId2B = []
-            }
-          })
-          this.table.list = arr
-
-          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)
-      })
-    },
-    getList2() {
-      this.table2.listLoading = true
-      console.log(this.table2.getdataListParm)
-      GetDataByName(this.table2.getdataListParm).then(response => {
-        console.log('table2数据', 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.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)
-      })
-    },
-    handleEnableChange(val) {
-      console.log('点击了是否启用', val)
-    },
-    form_search() {
-      console.log('点击了查询')
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    form_search2() {
-      console.log('点击了查询')
-      this.table2.getdataListParm.offset = 1
-      this.getList2()
-    },
-
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.parammaps.cname = ''
-      this.table.getdataListParm.parammaps.dname = ''
-      this.table.getdataListParm.parammaps.statue = ''
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh2() {
-      console.log('点击了重置')
-      this.table2.getdataListParm.parammaps.cname = ''
-      this.table2.getdataListParm.parammaps.dname = ''
-      this.table2.getdataListParm.parammaps.statue = ''
-      this.table2.getdataListParm.offset = 1
-      this.getList2()
-    },
-
-    // changeParent(val) {
-    //   console.log('点击了牲畜类别父类', val)
-    //   console.log(this.parentList.find(obj => obj.value == val).label)
-    //   this.table.temp.parentname = this.parentList.find(obj => obj.value == val).label
-    // },id
-    changeStatue(val) {
-      console.log('点击了状态', val)
-      // console.log(this.statueList.find(obj => obj.value == val).id)
-      this.table.temp.statueid = val
-      this.table.temp.statue = val
-    },
-    changeStatue2(val) {
-      console.log('点击了状态', val)
-      // console.log(this.statueList.find(obj => obj.value == val).id)
-      this.table2.temp.statueid = val
-      this.table2.temp.statue = val
-    },
-
-    changeRole(val) {
-      console.log('点击了角色', val)
-
-      console.log('this.table.list', this.table.list)
-      var arr = []
-
-      this.roleList.forEach(function(i) {
-        val.forEach(function(j) {
-          if (i.id == j) {
-            arr.push(i)
-          }
-        })
-      })
-
-      console.log('点击了角色', arr)
-
-      this.table.temp.rolenamesId = arr
-
-      this.rolenamesIdTempArr = arr
-    },
-    handleCreate() {
-      this.editDialogVisible = true
-    },
-    handleSubmit() {
-      var data = {
-        name: 'insertDashboard',
-        parammaps: {
-          dname: this.dbObj.dname,
-          display: this.dbObj.display,
-          pastureid: Cookies.get('pastureid'),
-          empid: Cookies.get('employeid'),
-          emp: Cookies.get('employename')
-        }
-      }
-
-      PostDataByName(data).then(res => {
-        console.log('新增保存发送参数', data)
-        this.$message({
-          type: 'success',
-          message: this.$t('common.saveSuccess')
-        })
-
-        this.editDialogVisible = false
-        console.log('res', res)
-        if (res.data.LastInsertId) {
-          this.$router.push({ name: 'Addboard', params: { id: res.data.LastInsertId, isEdit: 'create' }})
-          Cookies.set('AddboardIsEdit', 'create')
-          Cookies.set('AddboardIsEditId', res.data.LastInsertId)
-
-          localStorage.setItem('AddboardIsEditId', res.data.LastInsertId)
-        }
-      })
-    },
-
-    createData(row) {
-      console.log('点击了新增保存')
-      this.table.temp.pastureid = Cookies.get('pastureid')
-      this.table.temp.dname = row.dname
-      this.table.temp.display = row.display
-      this.table.temp.statue = row.statue
-      this.table.temp.reportenable = row.reportenable
-      this.table.temp.emp = row.emp
-      this.table.temp.opratetime = row.opratetime
-
-      // 仪表盘名称/状态是否为空
-      if (this.table.temp.dname == '' && this.table.temp.statue == '') {
-        this.$message({ type: 'error', message: '仪表盘名称/状态不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.dname == '') {
-        this.$message({ type: 'error', message: '仪表盘名称不能为空', duration: 2000 })
-        return false
-      }
-      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
-      if (pattern.test(this.table.temp.dname)) {
-        this.$message({ type: 'error', message: '仪表盘名称不可输入特殊字符', duration: 2000 })
-        return false
-      }
-
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam.name = 'insertDashboard'
-      this.requestParam.parammaps = this.table.temp
-      PostDataByName(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-
-    createCancel(row) {
-      console.log('点击了新增取消')
-      for (let i = 0; i < this.table.list.length; i++) {
-        if (row.myId === this.table.list[i].myId) {
-          var listIndex = this.table.list.indexOf(this.table.list[i])
-        }
-        if (listIndex > -1) {
-          this.table.list.splice(listIndex, 1)
-          return
-        }
-      }
-    },
-    handleCreate2(row) {
-      this.$router.push({ name: 'ChartPanel', params: { id: 'create', isEdit: 'edit' }})
-      Cookies.set('ChartPanelIsEdit', 'edit')
-      Cookies.set('ChartPanelIsEditId', 'create')
-      localStorage.setItem('ChartPanelIsEditId', 'create')
-    },
-    jumpSee(row) {
-      console.log('点击了查看', row)
-      this.$router.push({ name: 'Addboard', params: { id: row.id, isEdit: 'view', isRoleEdit: this.isRoleEdit }})
-      Cookies.set('AddboardIsEdit', 'view')
-      Cookies.set('AddboardIsEditId', row.id)
-
-      localStorage.setItem('AddboardIsEditId', row.id)
-    },
-    jumpEdit(row) {
-      console.log('点击了编辑', row)
-      this.$router.push({ name: 'Addboard', params: { id: row.id, isEdit: 'edit' }})
-      Cookies.set('AddboardIsEdit', 'edit')
-      Cookies.set('AddboardIsEditId', row.id)
-
-      localStorage.setItem('AddboardIsEditId', row.id)
-    },
-    jumpSee2(row) {
-      console.log('点击了查看', row)
-      this.$router.push({ name: 'ChartPanel', params: { id: row.id, isEdit: 'view', isRoleEdit: this.isRoleEdit }})
-      Cookies.set('ChartPanelIsEdit', 'view')
-      Cookies.set('ChartPanelIsEditId', row.id)
-
-      localStorage.setItem('ChartPanelIsEditId', row.id)
-      localStorage.setItem('ChartPanelIsEdit', 'view')
-      this.$store.state.user.dashchartid = row.id
-      this.$store.state.user.dashchartidisedit = 'view'
-    },
-    jumpEdit2(row) {
-      console.log('点击了编辑', row)
-      this.$router.push({ name: 'ChartPanel', params: { id: row.id, isEdit: 'edit' }})
-      Cookies.set('ChartPanelIsEdit', 'edit')
-      Cookies.set('ChartPanelIsEditId', row.id)
-
-      localStorage.setItem('ChartPanelIsEditId', row.id)
-      localStorage.setItem('ChartPanelIsEdit', 'edit')
-      this.$store.state.user.dashchartid = row.id
-      this.$store.state.user.dashchartidisedit = 'edit'
-    },
-
-    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
-      // console.log(row.parentid)
-      row.statue = String(row.statue)
-      console.log('row.statue ', row.statue)
-      this.table.temp.statue = row.statue
-      this.table.temp.statueid = row.statueid
-      this.table.temp.parentname = row.parentname
-    },
-    handleUpdate2(row) {
-      console.log('点击了设置', row)
-      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
-        }
-      }
-      // 编辑true,不可编辑false
-      row.Edit = true
-      row.NoEdit = false
-      // 新增false,编辑false,编辑保存true
-      row.isCreate = false
-      row.isUpdate = false
-      row.isUpdateSave = true
-      // console.log(row.parentid)
-      row.statue = String(row.statue)
-      this.table2.temp.statue = row.statue
-      this.table2.temp.statueid = row.statueid
-    },
-    updateData(row) {
-      console.log('点击了编辑保存')
-      this.table.temp.pastureid = Cookies.get('pastureid')
-      this.table.temp.dname = row.dname
-      this.table.temp.display = row.display
-      this.table.temp.reportenable = row.reportenable
-      this.table.temp.emp = row.emp
-      this.table.temp.opratetime = row.opratetime
-      this.table.temp.id = row.id
-      this.table.temp.statue = row.statue
-      this.table.temp.rolenamesId = row.rolenamesId
-      console.log(this.table.temp.rolenamesId)
-
-      var rolenamesIdArr = []
-
-      this.table.temp.rolenamesId.forEach(function(i, j) {
-        rolenamesIdArr.push({ 'id': i })
-      })
-      // 仪表盘名称/状态是否为空
-      if (this.table.temp.dname == '' && this.table.temp.statue == '') {
-        this.$message({ type: 'error', message: '仪表盘名称/状态不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.dname == '') {
-        this.$message({ type: 'error', message: '仪表盘名称不能为空', duration: 2000 })
-        return false
-      }
-      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
-      if (pattern.test(this.table.temp.dname)) {
-        this.$message({ type: 'error', message: '仪表盘名称不可输入特殊字符', duration: 2000 })
-        return false
-      }
-
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-
-      console.log(this.table.temp)
-
-      var send_data3 = {
-        'common': { 'returnmap': '0' },
-        'data': [
-          {
-            'name': 'updateDashboard',
-            'type': 'e',
-            'parammaps': this.table.temp
-          },
-          {
-            'name': 'deleteDrole',
-            'type': 'e',
-            'parammaps': {
-              'id': row.id,
-              'pastureid': Cookies.get('pastureid')
-            }
-          },
-          {
-            'name': 'insertSpotList',
-            'resultmaps': {
-              'list': rolenamesIdArr
-            },
-            'children': [
-              {
-                'name': 'insertDrole',
-                'type': 'e',
-                'parammaps':
-                  {
-                    'id': row.id,
-                    'pastureid': Cookies.get('pastureid'),
-                    'roleid': '@insertSpotList.id'
-                  }
-              }
-            ]
-          }
-        ]
-      }
-
-      ExecDataByConfig(send_data3).then(response => {
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-    updateData2(row) {
-      console.log('点击了编辑保存')
-      this.table2.temp.pastureid = Cookies.get('pastureid')
-      this.table2.temp.cname = row.cname
-      this.table2.temp.display = row.display
-
-      this.table2.temp.emp = row.emp
-      this.table2.temp.opratetime = row.opratetime
-      this.table2.temp.id = row.id
-      this.table2.temp.statue = row.statue
-      // 仪表盘名称/状态是否为空
-      if (this.table2.temp.dname == '' && this.table.temp.statue == '') {
-        this.$message({ type: 'error', message: '仪表盘名称/状态不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.dname == '') {
-        this.$message({ type: 'error', message: '仪表盘名称不能为空', duration: 2000 })
-        return false
-      }
-      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
-      if (pattern.test(this.table2.temp.dname)) {
-        this.$message({ type: 'error', message: '仪表盘名称不可输入特殊字符', duration: 2000 })
-        return false
-      }
-
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-
-      console.log(this.table2.temp)
-
-      var send_data3 = {
-        'name': 'updateChart',
-        'parammaps': this.table2.temp
-      }
-
-      PostDataByName(send_data3).then(response => {
-        console.log('新增保存发送参数', send_data3)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList2()
-        } 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
-
-      row.rolenamesId = row.rolenamesId2B
-    },
-    updateCancel2(row) {
-      console.log('点击了编辑取消')
-      // 编辑false,不可编辑true
-      row.Edit = false
-      row.NoEdit = true
-      // 新增false,编辑true,编辑保存false
-      row.isCreate = false
-      row.isUpdate = true
-      row.isUpdateSave = false
-    },
-    handleRowDelete(row) {
-      console.log('点击了行内删除')
-      MessageBox.confirm('是否确认删除此信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'deleteDashboard'
-        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: '已取消删除' })
-      })
-    },
-    handleRowDelete2(row) {
-      console.log('点击了行内删除')
-
-      var send_data = {
-        'name': 'getChartuseCount',
-        'parammaps': {
-          'pastureid': Cookies.get('pastureid'),
-          'id': row.id
-        }
-
-      }
-
-      GetDataByName(send_data).then(res => {
-        console.log(res)
-        if (res.data.list[0].cou > 0) {
-          MessageBox.confirm('当前图表已被引用,是否进行删除?', {
-            confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-          }).then(() => {
-            this.requestParam.name = 'deleteChart'
-            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.getList2()
-              }
-            })
-          }).catch(() => {
-            this.$message({ type: 'info', message: '已取消删除' })
-          })
-        } else {
-          this.requestParam.name = 'deleteChart'
-          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.getList2()
-            }
-          })
-        }
-      })
-
-      // MessageBox.confirm('当前图表已被引用,是否进行删除?', {
-      //   confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      // }).then(() => {
-      //   this.requestParam.name = 'deleteChart'
-      //   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.getList2()
-      //     }
-      //   })
-      // }).catch(() => {
-      //   this.$message({ type: 'info', message: '已取消删除' })
-      // })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-.search {
-  margin-top: 10px;
-}
-.table {
-  margin-top: 10px;
-}
-</style>
+<template>
+
+  <div class="app-container">
+
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="仪表盘" name="first">
+        <div class="search">
+          <el-input v-model="table.getdataListParm.parammaps.dname" placeholder="仪表盘名称" style="width: 180px;" class="filter-item" clearable />
+          <el-select v-model="table.getdataListParm.parammaps.statue" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in statueList" :key="item.id" :label="item.value" :value="item.id" />
+          </el-select>
+          <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
+          <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+        </div>
+        <div class="operation">
+          <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">{{$t('formulationEvaluation.add')}}</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"
+            >
+              <!-- <el-table-column type="selection" align="center" width="50" /> -->
+              <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
+                <template slot-scope="scope">
+                  <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="仪表盘名称" min-width="180px" align="center">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.NoEdit">{{ scope.row.dname }}</span>
+                  <el-input v-if="scope.row.Edit" v-model="scope.row.dname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
+                </template>
+              </el-table-column>
+
+              <el-table-column label="仪表盘描述" min-width="180px" align="center">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.NoEdit">{{ scope.row.display }}</span>
+                  <el-input v-if="scope.row.Edit" v-model="scope.row.display" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
+                </template>
+              </el-table-column>
+              <el-table-column :label="$t('premixedPlan.status')" min-width="100px" align="center">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.NoEdit && scope.row.statue == 1">公开</span>
+                  <span v-if="scope.row.NoEdit && scope.row.statue == 0">私有</span>
+                  <el-select v-if="scope.row.Edit" v-model="scope.row.statue" filterable placeholder="状态" class="filter-item" style="width:95%;padding:10px 0;" @change="changeStatue">
+                    <el-option v-for="item in statueList" :key="item.id" :label="item.value" :value="item.id" />
+                  </el-select>
+                </template>
+              </el-table-column>
+
+              <el-table-column label="分发角色" min-width="150px" align="center">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.NoEdit">{{ scope.row.rolenames }}</span>
+                  <el-select v-if="scope.row.Edit" v-model="scope.row.rolenamesId" multiple filterable placeholder="分发角色" class="filter-item" style="width:95%;padding:10px 0;" @change="changeRole">
+                    <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
+                  </el-select>
+                </template>
+              </el-table-column>
+
+              <el-table-column label="显示到菜单" min-width="90px" align="center">
+                <template slot-scope="scope">
+                  <el-switch v-model="scope.row.reportenable" :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="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.opratetime }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
+                <template slot-scope="{row}">
+
+                  <!-- 跳转页面 -->
+                  <el-button class="miniSuccess" icon="el-icon-search" @click="jumpSee(row)" />
+                  <span v-if="isRoleEdit" class="centerSpan">|</span>
+                  <!-- <el-button class="miniSuccess" :disabled="row.empid != empid" @click="jumpEdit(row)">修改仪表盘</el-button> -->
+
+                  <!-- 新增 -->
+                  <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @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" :disabled="row.empid != empid" 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" :disabled="row.empid != empid" icon="el-icon-delete" @click="handleRowDelete(row)" />
+                  <!-- 编辑保存 -->
+                  <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @click="updateData(row)" />
+                  <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+                  <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form>
+          <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="图表" name="second">
+        <div class="search">
+          <el-input v-model="table2.getdataListParm.parammaps.dname" placeholder="图表名称" style="width: 180px;" class="filter-item" clearable />
+          <el-select v-model="table2.getdataListParm.parammaps.statue" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in statueList2" :key="item.id" :label="item.value" :value="item.id" />
+          </el-select>
+          <el-button class="successBorder" @click="form_search2">{{$t('common.query')}}</el-button>
+          <el-button class="successBorder" @click="handleRefresh2">{{$t('common.reset')}}</el-button>
+        </div>
+        <div class="operation">
+          <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate2">{{$t('formulationEvaluation.add')}}</el-button>
+        </div>
+        <div class="table">
+          <el-form ref="form" :rules="table2.rules" :model="table2">
+            <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"
+            >
+              <!-- <el-table-column type="selection" align="center" width="50" /> -->
+              <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
+                <template slot-scope="scope">
+                  <span>{{ scope.$index + (table2.pageNum-1) * table2.pageSize + 1 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="图表名称" min-width="200px" align="center">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.NoEdit">{{ scope.row.cname }}</span>
+                  <el-input v-if="scope.row.Edit" v-model="scope.row.cname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:0 10px;" maxlength="32" />
+                </template>
+              </el-table-column>
+
+              <el-table-column label="图表描述" min-width="200px" 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}" style="width:95%;padding:0 10px;" maxlength="32" />
+                </template>
+              </el-table-column>
+              <el-table-column :label="$t('premixedPlan.status')" min-width="200px" align="center">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.NoEdit && scope.row.statue == 1">公开</span>
+                  <span v-if="scope.row.NoEdit && scope.row.statue == 0">私有</span>
+                  <el-select v-if="scope.row.Edit" v-model="scope.row.statue" filterable placeholder="状态" class="filter-item" style="width:95%;padding:10px 0;" @change="changeStatue2">
+                    <el-option v-for="item in statueList" :key="item.id" :label="item.value" :value="item.id" />
+                  </el-select>
+                </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.opratetime }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
+                <template slot-scope="{row}">
+
+                  <!-- 跳转页面 -->
+                  <el-button class="miniSuccess" icon="el-icon-search" @click="jumpSee2(row)" />
+                  <span v-if="isRoleEdit" class="centerSpan">|</span>
+                  <a v-if="isRoleEdit" class="correcting" :disabled="row.empid != empid" @click="jumpEdit2(row)">修改图表</a>
+                  <span v-if="isRoleEdit" class="centerSpan">|</span>
+                  <!-- 新增 -->
+                  <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @click="createData2(row)" />
+                  <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
+                  <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel2(row)" />
+                  <!-- 编辑 -->
+                  <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" :disabled="row.empid != empid" 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" :disabled="row.empid != empid" icon="el-icon-delete" @click="handleRowDelete2(row)" />
+                  <!-- 编辑保存 -->
+                  <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" :disabled="isokDisable" icon="el-icon-folder-checked" @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)" />
+
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form>
+          <pagination v-show="table2.total>=0" :total="table2.total" :page.sync="table2.getdataListParm.offset" :limit.sync="table2.getdataListParm.pagecount" @pagination="getList2" />
+        </div>
+      </el-tab-pane>
+
+    </el-tabs>
+    <el-dialog title="新增仪表盘" width="750px" :visible.sync="editDialogVisible">
+      <el-form label-width="160px">
+        <el-form-item label="仪表盘名称">
+          <el-input v-model="dbObj.dname" size="small" style="width: 450px;" placeholder="请输入仪表盘名称" />
+        </el-form-item>
+        <el-form-item label="仪表盘描述">
+          <el-input v-model="dbObj.display" type="textarea" :rows="5" size="small" style="width: 450px;" placeholder="请输入仪表盘描述" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="bottom: 10px;">
+        <el-button class="cancelClose" @click="editDialogVisible = false">{{$t('formulationEvaluation.cancel')}}</el-button>
+        <el-button class="save" @click="handleSubmit"> 确认</el-button>
+      </div>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, 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: 'BoardEchartManagement2',
+  components: { Pagination },
+  data() {
+    return {
+      empid: Cookies.get('employeid'),
+      editDialogVisible: false,
+      dbObj: {},
+      // requestParams: [
+      //   { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
+      // ],
+      requestParams: [
+        { name: 'getRoleAll', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+      ],
+
+      statueList: [{ id: '1', value: '公开' }, { id: '0', value: '私有' }],
+      statueList2: [{ id: '1', value: '公开' }, { id: '0', value: '私有' }],
+
+      roleList: [],
+
+      rolenamesIdTempArr: [],
+
+      table: {
+        rules: {
+          name: { type: 'string', required: true, message: '必填字段', trigger: 'change' }
+        },
+        getdataListParm: {
+          name: 'getDashboardList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            dname: '',
+            statue: '',
+            empid: Cookies.get('employeid')
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      table2: {
+        rules: {
+          name: { type: 'string', required: true, message: '必填字段', trigger: 'change' }
+        },
+        getdataListParm: {
+          name: 'getChartList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            cname: '',
+            statue: '',
+            empid: Cookies.get('employeid')
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        temp: {}
+      },
+
+      requestParam: {},
+      isokDisable: false,
+      selectList: [],
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+
+      activeName: 'first',
+      isRoleEdit: []
+
+    }
+  },
+
+  created() {
+    this.getList()
+    this.getList2()
+    this.getDownList()
+    this.getButtons()
+
+    if (this.$route.params.tab == 'second') {
+      this.activeName = 'second'
+    } else {
+      this.activeName = 'first'
+    }
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'BoardEchartManagement'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    handleClick(tab, event) {
+      console.log(tab, event)
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        console.log('下拉框数据', response.data)
+        this.roleList = response.data.getRoleAll.list
+      })
+    },
+    getList() {
+      this.table.listLoading = true
+      console.log(this.table.getdataListParm)
+      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) // 编辑保存
+          }
+
+          var arr = response.data.list
+
+          arr.map(function(i, j) {
+            // console.log(i, '====')
+            if (i.roleids) {
+              return i.rolenamesId = i.roleids.split(',')
+            } else {
+              return i.rolenamesId = []
+            }
+          })
+
+          arr.map(function(i, j) {
+            if (i.roleids) {
+              return i.rolenamesId2B = i.roleids.split(',')
+            } else {
+              return i.rolenamesId2B = []
+            }
+          })
+          this.table.list = arr
+
+          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)
+      })
+    },
+    getList2() {
+      this.table2.listLoading = true
+      console.log(this.table2.getdataListParm)
+      GetDataByName(this.table2.getdataListParm).then(response => {
+        console.log('table2数据', 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.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)
+      })
+    },
+    handleEnableChange(val) {
+      console.log('点击了是否启用', val)
+    },
+    form_search() {
+      console.log('点击了查询')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    form_search2() {
+      console.log('点击了查询')
+      this.table2.getdataListParm.offset = 1
+      this.getList2()
+    },
+
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.parammaps.cname = ''
+      this.table.getdataListParm.parammaps.dname = ''
+      this.table.getdataListParm.parammaps.statue = ''
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh2() {
+      console.log('点击了重置')
+      this.table2.getdataListParm.parammaps.cname = ''
+      this.table2.getdataListParm.parammaps.dname = ''
+      this.table2.getdataListParm.parammaps.statue = ''
+      this.table2.getdataListParm.offset = 1
+      this.getList2()
+    },
+
+    // changeParent(val) {
+    //   console.log('点击了牲畜类别父类', val)
+    //   console.log(this.parentList.find(obj => obj.value == val).label)
+    //   this.table.temp.parentname = this.parentList.find(obj => obj.value == val).label
+    // },id
+    changeStatue(val) {
+      console.log('点击了状态', val)
+      // console.log(this.statueList.find(obj => obj.value == val).id)
+      this.table.temp.statueid = val
+      this.table.temp.statue = val
+    },
+    changeStatue2(val) {
+      console.log('点击了状态', val)
+      // console.log(this.statueList.find(obj => obj.value == val).id)
+      this.table2.temp.statueid = val
+      this.table2.temp.statue = val
+    },
+
+    changeRole(val) {
+      console.log('点击了角色', val)
+
+      console.log('this.table.list', this.table.list)
+      var arr = []
+
+      this.roleList.forEach(function(i) {
+        val.forEach(function(j) {
+          if (i.id == j) {
+            arr.push(i)
+          }
+        })
+      })
+
+      console.log('点击了角色', arr)
+
+      this.table.temp.rolenamesId = arr
+
+      this.rolenamesIdTempArr = arr
+    },
+    handleCreate() {
+      this.editDialogVisible = true
+    },
+    handleSubmit() {
+      var data = {
+        name: 'insertDashboard',
+        parammaps: {
+          dname: this.dbObj.dname,
+          display: this.dbObj.display,
+          pastureid: Cookies.get('pastureid'),
+          empid: Cookies.get('employeid'),
+          emp: Cookies.get('employename')
+        }
+      }
+
+      PostDataByName(data).then(res => {
+        console.log('新增保存发送参数', data)
+        this.$message({
+          type: 'success',
+          message: this.$t('common.saveSuccess')
+        })
+
+        this.editDialogVisible = false
+        console.log('res', res)
+        if (res.data.LastInsertId) {
+          this.$router.push({ name: 'Addboard', params: { id: res.data.LastInsertId, isEdit: 'create' }})
+          Cookies.set('AddboardIsEdit', 'create')
+          Cookies.set('AddboardIsEditId', res.data.LastInsertId)
+
+          localStorage.setItem('AddboardIsEditId', res.data.LastInsertId)
+        }
+      })
+    },
+
+    createData(row) {
+      console.log('点击了新增保存')
+      this.table.temp.pastureid = Cookies.get('pastureid')
+      this.table.temp.dname = row.dname
+      this.table.temp.display = row.display
+      this.table.temp.statue = row.statue
+      this.table.temp.reportenable = row.reportenable
+      this.table.temp.emp = row.emp
+      this.table.temp.opratetime = row.opratetime
+
+      // 仪表盘名称/状态是否为空
+      if (this.table.temp.dname == '' && this.table.temp.statue == '') {
+        this.$message({ type: 'error', message: '仪表盘名称/状态不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.dname == '') {
+        this.$message({ type: 'error', message: '仪表盘名称不能为空', duration: 2000 })
+        return false
+      }
+      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
+      if (pattern.test(this.table.temp.dname)) {
+        this.$message({ type: 'error', message: '仪表盘名称不可输入特殊字符', duration: 2000 })
+        return false
+      }
+
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam.name = 'insertDashboard'
+      this.requestParam.parammaps = this.table.temp
+      PostDataByName(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+
+    createCancel(row) {
+      console.log('点击了新增取消')
+      for (let i = 0; i < this.table.list.length; i++) {
+        if (row.myId === this.table.list[i].myId) {
+          var listIndex = this.table.list.indexOf(this.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.table.list.splice(listIndex, 1)
+          return
+        }
+      }
+    },
+    handleCreate2(row) {
+      this.$router.push({ name: 'ChartPanel', params: { id: 'create', isEdit: 'edit' }})
+      Cookies.set('ChartPanelIsEdit', 'edit')
+      Cookies.set('ChartPanelIsEditId', 'create')
+      localStorage.setItem('ChartPanelIsEditId', 'create')
+    },
+    jumpSee(row) {
+      console.log('点击了查看', row)
+      this.$router.push({ name: 'Addboard', params: { id: row.id, isEdit: 'view', isRoleEdit: this.isRoleEdit }})
+      Cookies.set('AddboardIsEdit', 'view')
+      Cookies.set('AddboardIsEditId', row.id)
+
+      localStorage.setItem('AddboardIsEditId', row.id)
+    },
+    jumpEdit(row) {
+      console.log('点击了编辑', row)
+      this.$router.push({ name: 'Addboard', params: { id: row.id, isEdit: 'edit' }})
+      Cookies.set('AddboardIsEdit', 'edit')
+      Cookies.set('AddboardIsEditId', row.id)
+
+      localStorage.setItem('AddboardIsEditId', row.id)
+    },
+    jumpSee2(row) {
+      console.log('点击了查看', row)
+      this.$router.push({ name: 'ChartPanel', params: { id: row.id, isEdit: 'view', isRoleEdit: this.isRoleEdit }})
+      Cookies.set('ChartPanelIsEdit', 'view')
+      Cookies.set('ChartPanelIsEditId', row.id)
+
+      localStorage.setItem('ChartPanelIsEditId', row.id)
+      localStorage.setItem('ChartPanelIsEdit', 'view')
+      this.$store.state.user.dashchartid = row.id
+      this.$store.state.user.dashchartidisedit = 'view'
+    },
+    jumpEdit2(row) {
+      console.log('点击了编辑', row)
+      this.$router.push({ name: 'ChartPanel', params: { id: row.id, isEdit: 'edit' }})
+      Cookies.set('ChartPanelIsEdit', 'edit')
+      Cookies.set('ChartPanelIsEditId', row.id)
+
+      localStorage.setItem('ChartPanelIsEditId', row.id)
+      localStorage.setItem('ChartPanelIsEdit', 'edit')
+      this.$store.state.user.dashchartid = row.id
+      this.$store.state.user.dashchartidisedit = 'edit'
+    },
+
+    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
+      // console.log(row.parentid)
+      row.statue = String(row.statue)
+      console.log('row.statue ', row.statue)
+      this.table.temp.statue = row.statue
+      this.table.temp.statueid = row.statueid
+      this.table.temp.parentname = row.parentname
+    },
+    handleUpdate2(row) {
+      console.log('点击了设置', row)
+      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
+        }
+      }
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 新增false,编辑false,编辑保存true
+      row.isCreate = false
+      row.isUpdate = false
+      row.isUpdateSave = true
+      // console.log(row.parentid)
+      row.statue = String(row.statue)
+      this.table2.temp.statue = row.statue
+      this.table2.temp.statueid = row.statueid
+    },
+    updateData(row) {
+      console.log('点击了编辑保存')
+      this.table.temp.pastureid = Cookies.get('pastureid')
+      this.table.temp.dname = row.dname
+      this.table.temp.display = row.display
+      this.table.temp.reportenable = row.reportenable
+      this.table.temp.emp = row.emp
+      this.table.temp.opratetime = row.opratetime
+      this.table.temp.id = row.id
+      this.table.temp.statue = row.statue
+      this.table.temp.rolenamesId = row.rolenamesId
+      console.log(this.table.temp.rolenamesId)
+
+      var rolenamesIdArr = []
+
+      this.table.temp.rolenamesId.forEach(function(i, j) {
+        rolenamesIdArr.push({ 'id': i })
+      })
+      // 仪表盘名称/状态是否为空
+      if (this.table.temp.dname == '' && this.table.temp.statue == '') {
+        this.$message({ type: 'error', message: '仪表盘名称/状态不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.dname == '') {
+        this.$message({ type: 'error', message: '仪表盘名称不能为空', duration: 2000 })
+        return false
+      }
+      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
+      if (pattern.test(this.table.temp.dname)) {
+        this.$message({ type: 'error', message: '仪表盘名称不可输入特殊字符', duration: 2000 })
+        return false
+      }
+
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+
+      console.log(this.table.temp)
+
+      var send_data3 = {
+        'common': { 'returnmap': '0' },
+        'data': [
+          {
+            'name': 'updateDashboard',
+            'type': 'e',
+            'parammaps': this.table.temp
+          },
+          {
+            'name': 'deleteDrole',
+            'type': 'e',
+            'parammaps': {
+              'id': row.id,
+              'pastureid': Cookies.get('pastureid')
+            }
+          },
+          {
+            'name': 'insertSpotList',
+            'resultmaps': {
+              'list': rolenamesIdArr
+            },
+            'children': [
+              {
+                'name': 'insertDrole',
+                'type': 'e',
+                'parammaps':
+                  {
+                    'id': row.id,
+                    'pastureid': Cookies.get('pastureid'),
+                    'roleid': '@insertSpotList.id'
+                  }
+              }
+            ]
+          }
+        ]
+      }
+
+      ExecDataByConfig(send_data3).then(response => {
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateData2(row) {
+      console.log('点击了编辑保存')
+      this.table2.temp.pastureid = Cookies.get('pastureid')
+      this.table2.temp.cname = row.cname
+      this.table2.temp.display = row.display
+
+      this.table2.temp.emp = row.emp
+      this.table2.temp.opratetime = row.opratetime
+      this.table2.temp.id = row.id
+      this.table2.temp.statue = row.statue
+      // 仪表盘名称/状态是否为空
+      if (this.table2.temp.dname == '' && this.table.temp.statue == '') {
+        this.$message({ type: 'error', message: '仪表盘名称/状态不能为空', duration: 2000 })
+        return false
+      } else if (this.table2.temp.dname == '') {
+        this.$message({ type: 'error', message: '仪表盘名称不能为空', duration: 2000 })
+        return false
+      }
+      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
+      if (pattern.test(this.table2.temp.dname)) {
+        this.$message({ type: 'error', message: '仪表盘名称不可输入特殊字符', duration: 2000 })
+        return false
+      }
+
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+
+      console.log(this.table2.temp)
+
+      var send_data3 = {
+        'name': 'updateChart',
+        'parammaps': this.table2.temp
+      }
+
+      PostDataByName(send_data3).then(response => {
+        console.log('新增保存发送参数', send_data3)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList2()
+        } 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
+
+      row.rolenamesId = row.rolenamesId2B
+    },
+    updateCancel2(row) {
+      console.log('点击了编辑取消')
+      // 编辑false,不可编辑true
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+    },
+    handleRowDelete(row) {
+      console.log('点击了行内删除')
+      MessageBox.confirm('是否确认删除此信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'deleteDashboard'
+        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: '已取消删除' })
+      })
+    },
+    handleRowDelete2(row) {
+      console.log('点击了行内删除')
+
+      var send_data = {
+        'name': 'getChartuseCount',
+        'parammaps': {
+          'pastureid': Cookies.get('pastureid'),
+          'id': row.id
+        }
+
+      }
+
+      GetDataByName(send_data).then(res => {
+        console.log(res)
+        if (res.data.list[0].cou > 0) {
+          MessageBox.confirm('当前图表已被引用,是否进行删除?', {
+            confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+          }).then(() => {
+            this.requestParam.name = 'deleteChart'
+            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.getList2()
+              }
+            })
+          }).catch(() => {
+            this.$message({ type: 'info', message: '已取消删除' })
+          })
+        } else {
+          this.requestParam.name = 'deleteChart'
+          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.getList2()
+            }
+          })
+        }
+      })
+
+      // MessageBox.confirm('当前图表已被引用,是否进行删除?', {
+      //   confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      // }).then(() => {
+      //   this.requestParam.name = 'deleteChart'
+      //   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.getList2()
+      //     }
+      //   })
+      // }).catch(() => {
+      //   this.$message({ type: 'info', message: '已取消删除' })
+      // })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.search {
+  margin-top: 10px;
+}
+.table {
+  margin-top: 10px;
+}
+</style>

+ 909 - 909
src/views/systemManagement/operationManagement/group/index.vue

@@ -1,909 +1,909 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-input v-model="tab1.table.getdataListParm.parammaps.groupsname" placeholder="集团名称" style="width: 180px;" class="filter-item" clearable />
-      <el-select v-model="tab1.table.getdataListParm.parammaps.enable" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in stateList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        :key="tab1.table.tableKey"
-        v-loading="tab1.table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="tab1.table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-      >
-        <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (tab1.table.pageNum-1) * tab1.table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="集团ID" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.groupscode }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.groupscode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-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.groupsname }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.groupsname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-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.emp }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.emp" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-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.phone }}</span>
-            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.phone" placeholder="请输入11位手机号" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="11" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column label="管理员用户名" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.user }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.user" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-32字符" 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" />
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.note }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" placeholder="1-255字符" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column  :label="$t('errorAnalysis.cz')" 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="handlePageConfiguration(row)">页面配置</a>
-            <!-- 新增 -->
-            <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="createData(row)" />
-            <span v-if="row.isCreate" class="centerSpan">|</span>
-            <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-close" class="minCancel" @click="createCancel(row)" />
-            <!-- 编辑 -->
-            <span v-if="row.isUpdate" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdate && isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
-            <!-- 关联 -->
-            <span v-if="row.isUpdate" class="centerSpan">|</span>
-            <a v-if="row.isUpdate" class="correcting" @click="handleRelation(row)">关联</a>
-            <!-- 编辑保存 -->
-            <el-button v-if="row.isUpdateSave && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="updateData(row)" />
-            <span v-if="row.isUpdateSave" 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="tab1.table.total>=0" :total="tab1.table.total" :page.sync="tab1.table.getdataListParm.offset" :limit.sync="tab1.table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-    <!-- 页面配置 -->
-    <el-dialog :title="textMap[tab1.pageConfiguration.dialogStatus]" :visible.sync="tab1.pageConfiguration.dialogFormVisible" :close-on-click-modal="false" width="25%">
-      <div style="height: 400px;overflow-y: auto;">
-        <el-tree
-          ref="tree"
-          v-loading="tab1.pageConfiguration.listLoading"
-          show-checkbox
-          node-key="id"
-          :default-expand-all="true"
-          :data="tab1.pageConfiguration.data"
-          :props="tab1.pageConfiguration.defaultProps"
-          :default-checked-keys="tab1.pageConfiguration.defaultCheckedKeys"
-          @check-change="handelCheckChange"
-        />
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom:10px">
-        <el-button class="cancelClose" @click="tab1.pageConfiguration.dialogFormVisible = false;getList(); ">{{$t('formulationEvaluation.cancel')}}</el-button>
-        <el-button class="save" :disabled="isokDisable" @click="pageConfigurationData()">{{$t('errorAnalysis.confirm')}}</el-button>
-      </div>
-    </el-dialog>
-    <!-- 关联 -->
-    <el-dialog :fullscreen="dialogFull" :visible.sync="tab1.relation.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[tab1.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>
-        <el-form ref="relationTemp" :rules="rules" label-position="right" :model="tab1.relation.temp" label-width="130px" style="width: 100%;">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="集团名称:" prop="groupsname">
-                <el-input ref="groupsname" v-model="tab1.relation.temp.groupsname" disabled class="filter-item" placeholder="集团名称" type="text" style="width:100%;" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="关联:" prop="radio">
-                <el-radio-group v-model="tab1.relation.radio">
-                  <el-radio-button label="集团" />
-                  <el-radio-button :label="$t('feedingEfficiency.mc')"/>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <div v-if="tab1.relation.radio =='集团'" class="group">
-            <el-row>
-              <el-col :span="16">
-                <el-form-item label="选择关联集团:">
-                  <el-autocomplete v-model="tab1.relation.group.groupsname" class="inline-input" :fetch-suggestions="groupSearch" placeholder="选择关联集团" style="width: 100%;" @select="handleGroupSelect">
-                    <template slot-scope="{ item }">
-                      <span class="addr"> 集团:{{ item.groupsname }}</span>
-                    </template>
-                  </el-autocomplete>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <div class="table">
-              <el-table
-                :key="tab1.relation.group.table.tableKey"
-                v-loading="tab1.relation.group.table.listLoading"
-                element-loading-text="给我一点时间"
-                :data="tab1.relation.group.table.list"
-                border
-                fit
-                highlight-current-row
-                style="width: 100%;"
-                :row-style="rowStyle"
-                :cell-style="cellStyle"
-                class="elTable table-fixed"
-              >
-                <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px" />
-                <el-table-column label="集团ID" min-width="130px" align="center" prop="groupscode" />
-                <el-table-column label="集团名称" min-width="130px" align="center" prop="groupsname" />
-                <el-table-column label="管理员用户名" min-width="130px" align="center" prop="user" />
-                <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" />
-                  </template>
-                </el-table-column>
-                <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center" prop="note" />
-                <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
-                  <template slot-scope="{row}">
-                    <el-button class="miniDanger" icon="el-icon-delete" @click="handleGroupDelete(row)" />
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
-          </div>
-          <div v-if="tab1.relation.radio =='牧场'" class="pasture">
-            <el-row>
-              <el-col :span="16">
-                <el-form-item label="选择关联牧场:">
-                  <el-autocomplete v-model="tab1.relation.pasture.pastureName" class="inline-input" :fetch-suggestions="pastureSearch" placeholder="选择关联牧场" style="width: 100%;" @select="handlePastureSelect">
-                    <template slot-scope="{ item }">
-                      <span class="addr"> 牧场:{{ item.pasturename }}</span>
-                    </template>
-                  </el-autocomplete>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <div class="table">
-              <el-table
-                :key="tab1.relation.pasture.table.tableKey"
-                v-loading="tab1.relation.pasture.table.listLoading"
-                element-loading-text="给我一点时间"
-                :data="tab1.relation.pasture.table.list"
-                border
-                fit
-                highlight-current-row
-                style="width: 100%;"
-                :row-style="rowStyle"
-                :cell-style="cellStyle"
-                class="elTable table-fixed"
-              >
-                <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px" />
-                <el-table-column label="牧场ID" min-width="130px" align="center" prop="pasturecode" />
-                <el-table-column label="牧场名称" min-width="130px" align="center" prop="pasturename" />
-                <el-table-column label="管理员用户名" min-width="130px" align="center" prop="user" />
-                <el-table-column label="权限归属" min-width="130px" align="center" prop="groupsname" />
-                <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" />
-                  </template>
-                </el-table-column>
-                <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center" prop="note" />
-                <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
-                  <template slot-scope="{row}">
-                    <el-button class="miniDanger" icon="el-icon-delete" @click="handlePastureDelete(row)" />
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
-          </div>
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom:10px;">
-        <el-button class="cancelClose" @click="tab1.relation.dialogFormVisible = false;getList(); ">{{$t('formulationEvaluation.cancel')}}</el-button>
-        <el-button v-if="tab1.relation.dialogStatus==='relation'" class="save" :disabled="isokDisable" @click="relationData()">{{$t('errorAnalysis.confirm')}}</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, failproccess, transData, ExecDataByConfig, checkButtons } from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime } from '@/utils/index.js'
-import { validate11Digits } from '@/utils/validate.js'
-import { MessageBox } from 'element-ui'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'OperationManagement',
-  components: { Pagination },
-  data() {
-    return {
-      requestParams: [
-        { name: 'getGroupsAllList', offset: 0, pagecount: 0, parammaps: {}}
-      ],
-      dialogFull: false,
-      isRoleEdit: [],
-      stateList: [{ id: 1, name: '启用' }, { id: 0, name: '禁止' }], // 状态
-      tab1: {
-        table: {
-          getdataListParm: {
-            name: 'getGroupsAllList',
-            page: 1,
-            offset: 1,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {
-              groupsname: '',
-              enable: ''
-            }
-          },
-          tableKey: 0,
-          list: [],
-          total: 0,
-          listLoading: true,
-          temp: {}
-        },
-        // 页面配置
-        pageConfiguration: {
-          dialogFormVisible: false,
-          dialogStatus: '',
-          temp: {},
-          listLoading: true,
-          getdataListParm: {
-            name: 'getMenuandButtonlistJT'
-          },
-          parentType: [],
-          defaultProps: {
-            children: 'children',
-            label: 'name'
-          },
-          defaultCheckedKeys: [],
-          arrList: []
-        },
-        // 关联
-        relation: {
-          dialogFormVisible: false,
-          dialogStatus: '',
-          radio: '集团',
-          temp: {},
-          group: {
-            requestParam: {
-              name: 'getGroupsAllListV2',
-              page: 1,
-              offset: 1,
-              pagecount: 10,
-              returntype: 'Map',
-              parammaps: {
-                groupsname: ''
-              }
-            },
-            searchList: [],
-            table: {
-              tableKey: 1,
-              list: [],
-              total: 0,
-              listLoading: false,
-              getdataListParm: {
-                name: 'groupsrelationlistJT',
-                page: 1,
-                offset: 1,
-                pagecount: 10,
-                returntype: 'Map',
-                parammaps: {
-                  groupsname: ''
-                }
-              }
-            }
-          },
-          pasture: {
-            requestParam: {
-              name: 'groupsrelationlistMCAll',
-              page: 1,
-              offset: 1,
-              pagecount: 10,
-              returntype: 'Map',
-              parammaps: {
-                pastureName: ''
-              }
-            },
-            searchList: [],
-            table: {
-              tableKey: 2,
-              list: [],
-              total: 0,
-              listLoading: false,
-              getdataListParm: {
-                name: 'groupsrelationlistMC',
-                page: 1,
-                offset: 1,
-                pagecount: 10,
-                returntype: 'Map',
-                parammaps: {
-                  pastureName: ''
-                }
-              }
-            }
-          }
-        }
-      },
-      requestParam: {},
-      rules: {},
-      isokDisable: false,
-      textMap: {
-        pageConfiguration: '页面配置',
-        relation: '关联'
-      },
-      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.tab1.table.listLoading = true
-      GetDataByName(this.tab1.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.tab1.table.list = response.data.list
-          this.tab1.table.pageNum = response.data.pageNum
-          this.tab1.table.pageSize = response.data.pageSize
-          this.tab1.table.total = response.data.total
-        } else {
-          this.tab1.table.list = []
-        }
-        setTimeout(() => {
-          this.tab1.table.listLoading = false
-        }, 100)
-      })
-    },
-
-    form_search() {
-      console.log('点击了查询')
-      this.tab1.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.tab1.table.getdataListParm.parammaps.groupsname = ''
-      this.tab1.table.getdataListParm.parammaps.enable = ''
-      this.tab1.table.getdataListParm.offset = 1
-      this.getList()
-    },
-
-    handleCreate() {
-      console.log('点击了新增')
-      // 编辑true/不可编辑false
-      // 新增操true,编辑false,编辑保存false
-      for (let i = 0; i < this.tab1.table.list.length; i++) {
-        if (this.tab1.table.list[i].Edit == true) {
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-      }
-      this.tab1.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'groupscode': '', 'groupsname': '', 'emp': '', 'phone': '', 'user': '', 'note': '' })
-    },
-    createData(row) {
-      // 检验集团ID/集团名称是否为空
-      console.log(row)
-      if (row.groupscode == '' && row.groupsname == '' && row.user == '') {
-        this.$message({ type: 'error', message: '集团ID/集团名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.groupsname == '' && row.user == '') {
-        this.$message({ type: 'error', message: '集团名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.groupscode == '') {
-        this.$message({ type: 'error', message: '集团ID不能为空', duration: 2000 })
-        return false
-      } else if (row.groupsname == '') {
-        this.$message({ type: 'error', message: '集团名称不能为空', duration: 2000 })
-        return false
-      } else if (row.user == '') {
-        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
-        return false
-      }
-      if (row.phone !== undefined && row.phone !== '') {
-        const phone = /^\d{11}$/
-        if (!phone.test(row.phone)) {
-          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
-          return false
-        }
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'checkuser', 'type': 'v', 'parammaps': {
-        'user': row.user
-      }}
-      this.requestParam.data[1] = { 'name': 'insertGroups', 'type': 'e', 'parammaps': {
-        'groupsname': row.groupsname,
-        'groupscode': row.groupscode,
-        'emp': row.emp,
-        'phone': row.phone,
-        'enable': row.enable,
-        'note': row.note,
-        'user': row.user
-      }}
-      this.requestParam.data[2] = { 'name': 'createNewPasture', 'type': 'e', 'parammaps': {
-        'user': row.user,
-        'pastureid': '@insertGroups.LastInsertId',
-        'type': '1'
-      }}
-
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          const tId = new RegExp("column 'id'")
-          if (tId.test(response.data)) {
-            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          }
-        }
-      })
-    },
-    createCancel(row) {
-      console.log('点击了集团新增取消')
-      for (let i = 0; i < this.tab1.table.list.length; i++) {
-        if (row.myId === this.tab1.table.list[i].myId) {
-          var listIndex = this.tab1.table.list.indexOf(this.tab1.table.list[i])
-        }
-        if (listIndex > -1) {
-          this.tab1.table.list.splice(listIndex, 1)
-          return
-        }
-      }
-    },
-    handleUpdate(row) {
-      console.log('点击了编辑')
-      for (let i = 0; i < this.tab1.table.list.length; i++) {
-        if (this.tab1.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) {
-      if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
-        this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturename == '' && row.user == '') {
-        this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturecode == '') {
-        this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturename == '') {
-        this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
-        return false
-      } else if (row.user == '') {
-        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
-        return false
-      }
-      if (row.phone !== undefined && row.phone !== '') {
-        const phone = /^\d{11}$/
-        if (!phone.test(row.phone)) {
-          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
-          return false
-        }
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'updateGroups', 'type': 'e', 'parammaps': {
-        'id': row.id,
-        'groupsname': row.groupsname,
-        'groupscode': row.groupscode,
-        'emp': row.emp,
-        'phone': row.phone,
-        'enable': row.enable,
-        'note': row.note,
-        'user': row.user
-      }}
-      this.requestParam.data[1] = { 'name': 'updateUserName', 'type': 'e', 'parammaps': {
-        'id': row.id,
-        'userold': row.userold,
-        'user': row.user
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          const tId = new RegExp("column 'id'")
-          if (tId.test(response.data)) {
-            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', 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()
-    },
-    handlePageConfiguration(row) {
-      this.tab1.pageConfiguration.temp = Object.assign({}, row)
-      console.log('点击了行内页面配置')
-      this.tab1.pageConfiguration.dialogStatus = 'pageConfiguration'
-      this.tab1.pageConfiguration.dialogFormVisible = true
-      this.getPageConfigurationList()
-    },
-    getPageConfigurationList() {
-      this.tab1.pageConfiguration.getdataListParm.parammaps = {}
-      this.tab1.pageConfiguration.getdataListParm.parammaps.pastureid = this.tab1.pageConfiguration.temp.pastureid
-      this.tab1.pageConfiguration.getdataListParm.parammaps.id = this.tab1.pageConfiguration.temp.id
-      this.tab1.pageConfiguration.listLoading = true
-      GetDataByName(this.tab1.pageConfiguration.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (parseFloat(response.data.list[i].seebutton) > 0 && response.data.list[i].pid !== -1) {
-              this.tab1.pageConfiguration.defaultCheckedKeys.push(String(response.data.list[i].menu_id))
-            }
-            if (parseFloat(response.data.list[i].seebutton) > 0) {
-              this.tab1.pageConfiguration.arrList.push(String(response.data.list[i].menu_id))
-            }
-          }
-          this.tab1.pageConfiguration.data = transData(response.data.list, 'id', 'pid', 'children')
-          console.log(this.tab1.pageConfiguration.data)
-          console.log(response.data.list)
-        } else {
-          this.tab1.pageConfiguration.data = []
-        }
-        setTimeout(() => {
-          this.tab1.pageConfiguration.listLoading = false
-        }, 1000)
-      })
-    },
-    handelCheckChange(id) {
-      this.tab1.pageConfiguration.defaultCheckedKeys = this.$refs.tree.getCheckedKeys()
-      var checkedKeys = this.$refs.tree.getCheckedKeys()
-      var options = checkedKeys.map((item) => {
-        var node = this.$refs.tree.getNode(item) // 所有被选中的节点对应的node
-        const tmpMap = {}
-        console.log(node, 'node')
-        tmpMap.pid = node.parent.key
-        tmpMap.value = node.key
-        return tmpMap
-      })
-      var selectedData = options.map((item) => {
-        console.log(item)
-        return item
-      })
-      console.log(selectedData)
-      var arr = []
-      for (let i = 0; i < selectedData.length; i++) {
-        if (selectedData[i].pid !== undefined) {
-          arr.push(selectedData[i].pid, selectedData[i].value)
-        } else {
-          arr.push(selectedData[i].value)
-        }
-      }
-      this.tab1.pageConfiguration.arrList = this.unique(arr)
-    },
-    unique(arr) {
-      return Array.from(new Set(arr))
-    },
-    pageConfigurationData() {
-      console.log('集团页面配置保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'deletemenuPastureJT', 'type': 'e', 'parammaps': {
-        'id': this.tab1.pageConfiguration.temp.id
-      }}
-      var list = []
-      for (let i = 0; i < this.tab1.pageConfiguration.arrList.length; i++) {
-        list.push({ 'id': this.tab1.pageConfiguration.arrList[i] })
-      }
-      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
-      this.requestParam.data[1].children = []
-      this.requestParam.data[1].children[0] = { 'name': 'insertRolepastureJT', 'type': 'e', 'parammaps': {
-        menuid: '@insertSpotList.id',
-        id: this.tab1.pageConfiguration.temp.id
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('页面配置保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.tab1.pageConfiguration.dialogFormVisible = false
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-    handleRelation(row) {
-      this.tab1.relation.temp = Object.assign({}, row)
-      console.log('关联', this.tab1.relation.temp)
-      this.dialogFull = false
-      this.tab1.relation.dialogStatus = 'relation'
-      this.tab1.relation.dialogFormVisible = true
-      this.tab1.relation.radio = '集团'
-      this.getGrouplist()
-      this.getPasturelist()
-    },
-    getGrouplist() {
-      this.tab1.relation.group.table.listLoading = true
-      this.tab1.relation.group.table.getdataListParm.parammaps.id = this.tab1.relation.temp.id
-      GetDataByName(this.tab1.relation.group.table.getdataListParm).then(response => {
-        console.log('集团table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.tab1.relation.group.table.list = response.data.list
-        } else {
-          this.tab1.relation.group.table.list = []
-        }
-        setTimeout(() => {
-          this.tab1.relation.group.table.listLoading = false
-        }, 100)
-      })
-    },
-    getPasturelist() {
-      this.tab1.relation.pasture.table.listLoading = true
-      this.tab1.relation.pasture.table.getdataListParm.parammaps.id = this.tab1.relation.temp.id
-      GetDataByName(this.tab1.relation.pasture.table.getdataListParm).then(response => {
-        console.log('牧场table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.tab1.relation.pasture.table.list = response.data.list
-        } else {
-          this.tab1.relation.pasture.table.list = []
-        }
-        setTimeout(() => {
-          this.tab1.relation.pasture.table.listLoading = false
-        }, 100)
-      })
-    },
-    groupSearch(queryString, cb) {
-      console.log(this.tab1.relation.temp, '====')
-      this.tab1.relation.group.requestParam.parammaps.groupsname = queryString
-      this.tab1.relation.group.requestParam.parammaps.id = this.tab1.relation.temp.id
-      GetDataByName(this.tab1.relation.group.requestParam).then(response => {
-        if (response.data.list !== null) {
-          this.tab1.relation.group.searchList = response.data.list
-          cb(this.tab1.relation.group.searchList)
-        } else {
-          cb([])
-        }
-      })
-    },
-    handleGroupSelect(item) {
-      if (this.tab1.relation.group.table.list.length > 0) {
-        if (this.tab1.relation.group.table.list.find(obj => obj.id === item.id)) {
-          this.$message({ type: 'warning', message: '集团不可重复添加' })
-        } else {
-          this.tab1.relation.group.table.list.push(item)
-        }
-      } else {
-        this.tab1.relation.group.table.list.push(item)
-      }
-    },
-    handleGroupDelete(row) {
-      for (var i = 0; i < this.tab1.relation.group.table.list.length; i++) {
-        if (this.tab1.relation.group.table.list[i].id == row.id) {
-          var listIndex = this.tab1.relation.group.table.list.indexOf(this.tab1.relation.group.table.list[i])
-        }
-        if (listIndex > -1) {
-          this.tab1.relation.group.table.list.splice(listIndex, 1)
-          return
-        }
-      }
-    },
-    pastureSearch(queryString, cb) {
-      this.tab1.relation.pasture.requestParam.parammaps.pastureName = queryString
-      GetDataByName(this.tab1.relation.pasture.requestParam).then(response => {
-        if (response.data.list !== null) {
-          this.tab1.relation.pasture.searchList = response.data.list
-          cb(this.tab1.relation.pasture.searchList)
-        } else {
-          cb([])
-        }
-      })
-    },
-    handlePastureSelect(item) {
-      if (this.tab1.relation.pasture.table.list.length > 0) {
-        if (this.tab1.relation.pasture.table.list.find(obj => obj.id === item.id)) {
-          this.$message({ type: 'warning', message: '集团不可重复添加' })
-        } else {
-          this.tab1.relation.pasture.table.list.push(item)
-        }
-      } else {
-        this.tab1.relation.pasture.table.list.push(item)
-      }
-    },
-    handlePastureDelete(row) {
-      for (var i = 0; i < this.tab1.relation.pasture.table.list.length; i++) {
-        if (this.tab1.relation.pasture.table.list[i].id == row.id) {
-          var listIndex = this.tab1.relation.pasture.table.list.indexOf(this.tab1.relation.pasture.table.list[i])
-        }
-        if (listIndex > -1) {
-          this.tab1.relation.pasture.table.list.splice(listIndex, 1)
-          return
-        }
-      }
-    },
-    relationData() {
-      console.log('关联保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'deletegroupsPasture', 'type': 'e', 'parammaps': {
-        'id': this.tab1.relation.temp.id
-      }}
-      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.relation.group.table.list }}
-      this.requestParam.data[1].children = []
-      this.requestParam.data[1].children[0] = { 'name': 'insertgroupsPasture', 'type': 'e', 'parammaps': {
-        rid: '@insertSpotList.id',
-        id: this.tab1.relation.temp.id,
-        type: '1'
-      }}
-      this.requestParam.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.tab1.relation.pasture.table.list }}
-      this.requestParam.data[2].children = []
-      this.requestParam.data[2].children[0] = { 'name': 'insertgroupsPasture', 'type': 'e', 'parammaps': {
-        rid: '@insertSpotList2.id',
-        id: this.tab1.relation.temp.id,
-        type: '0'
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('关联保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.tab1.relation.dialogFormVisible = false
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  
-  .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>
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-input v-model="tab1.table.getdataListParm.parammaps.groupsname" placeholder="集团名称" style="width: 180px;" class="filter-item" clearable />
+      <el-select v-model="tab1.table.getdataListParm.parammaps.enable" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in stateList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">{{$t('formulationEvaluation.add')}}</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="tab1.table.tableKey"
+        v-loading="tab1.table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="tab1.table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+      >
+        <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (tab1.table.pageNum-1) * tab1.table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="集团ID" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.groupscode }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.groupscode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-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.groupsname }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.groupsname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-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.emp }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.emp" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-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.phone }}</span>
+            <el-input v-if="scope.row.Edit" v-model.trim="scope.row.phone" placeholder="请输入11位手机号" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="11" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column label="管理员用户名" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.user }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.user" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" placeholder="1-32字符" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('premixedPlan.status')" 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" />
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.note }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" placeholder="1-255字符" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column  :label="$t('errorAnalysis.cz')" 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="handlePageConfiguration(row)">页面配置</a>
+            <!-- 新增 -->
+            <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="createData(row)" />
+            <span v-if="row.isCreate" class="centerSpan">|</span>
+            <el-button v-if="row.isCreate && isRoleEdit" icon="el-icon-close" class="minCancel" @click="createCancel(row)" />
+            <!-- 编辑 -->
+            <span v-if="row.isUpdate" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate && isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
+            <!-- 关联 -->
+            <span v-if="row.isUpdate" class="centerSpan">|</span>
+            <a v-if="row.isUpdate" class="correcting" @click="handleRelation(row)">关联</a>
+            <!-- 编辑保存 -->
+            <el-button v-if="row.isUpdateSave && isRoleEdit" icon="el-icon-folder-checked" class="miniSuccess" :disabled="isokDisable" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave" 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="tab1.table.total>=0" :total="tab1.table.total" :page.sync="tab1.table.getdataListParm.offset" :limit.sync="tab1.table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+    <!-- 页面配置 -->
+    <el-dialog :title="textMap[tab1.pageConfiguration.dialogStatus]" :visible.sync="tab1.pageConfiguration.dialogFormVisible" :close-on-click-modal="false" width="25%">
+      <div style="height: 400px;overflow-y: auto;">
+        <el-tree
+          ref="tree"
+          v-loading="tab1.pageConfiguration.listLoading"
+          show-checkbox
+          node-key="id"
+          :default-expand-all="true"
+          :data="tab1.pageConfiguration.data"
+          :props="tab1.pageConfiguration.defaultProps"
+          :default-checked-keys="tab1.pageConfiguration.defaultCheckedKeys"
+          @check-change="handelCheckChange"
+        />
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom:10px">
+        <el-button class="cancelClose" @click="tab1.pageConfiguration.dialogFormVisible = false;getList(); ">{{$t('formulationEvaluation.cancel')}}</el-button>
+        <el-button class="save" :disabled="isokDisable" @click="pageConfigurationData()">{{$t('errorAnalysis.confirm')}}</el-button>
+      </div>
+    </el-dialog>
+    <!-- 关联 -->
+    <el-dialog :fullscreen="dialogFull" :visible.sync="tab1.relation.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[tab1.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>
+        <el-form ref="relationTemp" :rules="rules" label-position="right" :model="tab1.relation.temp" label-width="130px" style="width: 100%;">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="集团名称:" prop="groupsname">
+                <el-input ref="groupsname" v-model="tab1.relation.temp.groupsname" disabled class="filter-item" placeholder="集团名称" type="text" style="width:100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="关联:" prop="radio">
+                <el-radio-group v-model="tab1.relation.radio">
+                  <el-radio-button label="集团" />
+                  <el-radio-button :label="$t('feedingEfficiency.mc')"/>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <div v-if="tab1.relation.radio =='集团'" class="group">
+            <el-row>
+              <el-col :span="16">
+                <el-form-item label="选择关联集团:">
+                  <el-autocomplete v-model="tab1.relation.group.groupsname" class="inline-input" :fetch-suggestions="groupSearch" placeholder="选择关联集团" style="width: 100%;" @select="handleGroupSelect">
+                    <template slot-scope="{ item }">
+                      <span class="addr"> 集团:{{ item.groupsname }}</span>
+                    </template>
+                  </el-autocomplete>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <div class="table">
+              <el-table
+                :key="tab1.relation.group.table.tableKey"
+                v-loading="tab1.relation.group.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="tab1.relation.group.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px" />
+                <el-table-column label="集团ID" min-width="130px" align="center" prop="groupscode" />
+                <el-table-column label="集团名称" min-width="130px" align="center" prop="groupsname" />
+                <el-table-column label="管理员用户名" min-width="130px" align="center" prop="user" />
+                <el-table-column :label="$t('premixedPlan.status')" 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" />
+                  </template>
+                </el-table-column>
+                <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center" prop="note" />
+                <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
+                  <template slot-scope="{row}">
+                    <el-button class="miniDanger" icon="el-icon-delete" @click="handleGroupDelete(row)" />
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+          <div v-if="tab1.relation.radio =='牧场'" class="pasture">
+            <el-row>
+              <el-col :span="16">
+                <el-form-item label="选择关联牧场:">
+                  <el-autocomplete v-model="tab1.relation.pasture.pastureName" class="inline-input" :fetch-suggestions="pastureSearch" placeholder="选择关联牧场" style="width: 100%;" @select="handlePastureSelect">
+                    <template slot-scope="{ item }">
+                      <span class="addr"> 牧场:{{ item.pasturename }}</span>
+                    </template>
+                  </el-autocomplete>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <div class="table">
+              <el-table
+                :key="tab1.relation.pasture.table.tableKey"
+                v-loading="tab1.relation.pasture.table.listLoading"
+                element-loading-text="给我一点时间"
+                :data="tab1.relation.pasture.table.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px" />
+                <el-table-column label="牧场ID" min-width="130px" align="center" prop="pasturecode" />
+                <el-table-column label="牧场名称" min-width="130px" align="center" prop="pasturename" />
+                <el-table-column label="管理员用户名" min-width="130px" align="center" prop="user" />
+                <el-table-column label="权限归属" min-width="130px" align="center" prop="groupsname" />
+                <el-table-column :label="$t('premixedPlan.status')" 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" />
+                  </template>
+                </el-table-column>
+                <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center" prop="note" />
+                <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
+                  <template slot-scope="{row}">
+                    <el-button class="miniDanger" icon="el-icon-delete" @click="handlePastureDelete(row)" />
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom:10px;">
+        <el-button class="cancelClose" @click="tab1.relation.dialogFormVisible = false;getList(); ">{{$t('formulationEvaluation.cancel')}}</el-button>
+        <el-button v-if="tab1.relation.dialogStatus==='relation'" class="save" :disabled="isokDisable" @click="relationData()">{{$t('errorAnalysis.confirm')}}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, failproccess, transData, ExecDataByConfig, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+import { validate11Digits } from '@/utils/validate.js'
+import { MessageBox } from 'element-ui'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'OperationManagement',
+  components: { Pagination },
+  data() {
+    return {
+      requestParams: [
+        { name: 'getGroupsAllList', offset: 0, pagecount: 0, parammaps: {}}
+      ],
+      dialogFull: false,
+      isRoleEdit: [],
+      stateList: [{ id: 1, name: '启用' }, { id: 0, name: '禁止' }], // 状态
+      tab1: {
+        table: {
+          getdataListParm: {
+            name: 'getGroupsAllList',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              groupsname: '',
+              enable: ''
+            }
+          },
+          tableKey: 0,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        // 页面配置
+        pageConfiguration: {
+          dialogFormVisible: false,
+          dialogStatus: '',
+          temp: {},
+          listLoading: true,
+          getdataListParm: {
+            name: 'getMenuandButtonlistJT'
+          },
+          parentType: [],
+          defaultProps: {
+            children: 'children',
+            label: 'name'
+          },
+          defaultCheckedKeys: [],
+          arrList: []
+        },
+        // 关联
+        relation: {
+          dialogFormVisible: false,
+          dialogStatus: '',
+          radio: '集团',
+          temp: {},
+          group: {
+            requestParam: {
+              name: 'getGroupsAllListV2',
+              page: 1,
+              offset: 1,
+              pagecount: 10,
+              returntype: 'Map',
+              parammaps: {
+                groupsname: ''
+              }
+            },
+            searchList: [],
+            table: {
+              tableKey: 1,
+              list: [],
+              total: 0,
+              listLoading: false,
+              getdataListParm: {
+                name: 'groupsrelationlistJT',
+                page: 1,
+                offset: 1,
+                pagecount: 10,
+                returntype: 'Map',
+                parammaps: {
+                  groupsname: ''
+                }
+              }
+            }
+          },
+          pasture: {
+            requestParam: {
+              name: 'groupsrelationlistMCAll',
+              page: 1,
+              offset: 1,
+              pagecount: 10,
+              returntype: 'Map',
+              parammaps: {
+                pastureName: ''
+              }
+            },
+            searchList: [],
+            table: {
+              tableKey: 2,
+              list: [],
+              total: 0,
+              listLoading: false,
+              getdataListParm: {
+                name: 'groupsrelationlistMC',
+                page: 1,
+                offset: 1,
+                pagecount: 10,
+                returntype: 'Map',
+                parammaps: {
+                  pastureName: ''
+                }
+              }
+            }
+          }
+        }
+      },
+      requestParam: {},
+      rules: {},
+      isokDisable: false,
+      textMap: {
+        pageConfiguration: '页面配置',
+        relation: '关联'
+      },
+      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.tab1.table.listLoading = true
+      GetDataByName(this.tab1.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.tab1.table.list = response.data.list
+          this.tab1.table.pageNum = response.data.pageNum
+          this.tab1.table.pageSize = response.data.pageSize
+          this.tab1.table.total = response.data.total
+        } else {
+          this.tab1.table.list = []
+        }
+        setTimeout(() => {
+          this.tab1.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    form_search() {
+      console.log('点击了查询')
+      this.tab1.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.tab1.table.getdataListParm.parammaps.groupsname = ''
+      this.tab1.table.getdataListParm.parammaps.enable = ''
+      this.tab1.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    handleCreate() {
+      console.log('点击了新增')
+      // 编辑true/不可编辑false
+      // 新增操true,编辑false,编辑保存false
+      for (let i = 0; i < this.tab1.table.list.length; i++) {
+        if (this.tab1.table.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      this.tab1.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'groupscode': '', 'groupsname': '', 'emp': '', 'phone': '', 'user': '', 'note': '' })
+    },
+    createData(row) {
+      // 检验集团ID/集团名称是否为空
+      console.log(row)
+      if (row.groupscode == '' && row.groupsname == '' && row.user == '') {
+        this.$message({ type: 'error', message: '集团ID/集团名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.groupsname == '' && row.user == '') {
+        this.$message({ type: 'error', message: '集团名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.groupscode == '') {
+        this.$message({ type: 'error', message: '集团ID不能为空', duration: 2000 })
+        return false
+      } else if (row.groupsname == '') {
+        this.$message({ type: 'error', message: '集团名称不能为空', duration: 2000 })
+        return false
+      } else if (row.user == '') {
+        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
+        return false
+      }
+      if (row.phone !== undefined && row.phone !== '') {
+        const phone = /^\d{11}$/
+        if (!phone.test(row.phone)) {
+          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'checkuser', 'type': 'v', 'parammaps': {
+        'user': row.user
+      }}
+      this.requestParam.data[1] = { 'name': 'insertGroups', 'type': 'e', 'parammaps': {
+        'groupsname': row.groupsname,
+        'groupscode': row.groupscode,
+        'emp': row.emp,
+        'phone': row.phone,
+        'enable': row.enable,
+        'note': row.note,
+        'user': row.user
+      }}
+      this.requestParam.data[2] = { 'name': 'createNewPasture', 'type': 'e', 'parammaps': {
+        'user': row.user,
+        'pastureid': '@insertGroups.LastInsertId',
+        'type': '1'
+      }}
+
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const tId = new RegExp("column 'id'")
+          if (tId.test(response.data)) {
+            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        }
+      })
+    },
+    createCancel(row) {
+      console.log('点击了集团新增取消')
+      for (let i = 0; i < this.tab1.table.list.length; i++) {
+        if (row.myId === this.tab1.table.list[i].myId) {
+          var listIndex = this.tab1.table.list.indexOf(this.tab1.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.tab1.table.list.splice(listIndex, 1)
+          return
+        }
+      }
+    },
+    handleUpdate(row) {
+      console.log('点击了编辑')
+      for (let i = 0; i < this.tab1.table.list.length; i++) {
+        if (this.tab1.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) {
+      if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
+        this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturename == '' && row.user == '') {
+        this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturecode == '') {
+        this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturename == '') {
+        this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
+        return false
+      } else if (row.user == '') {
+        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
+        return false
+      }
+      if (row.phone !== undefined && row.phone !== '') {
+        const phone = /^\d{11}$/
+        if (!phone.test(row.phone)) {
+          this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
+          return false
+        }
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'updateGroups', 'type': 'e', 'parammaps': {
+        'id': row.id,
+        'groupsname': row.groupsname,
+        'groupscode': row.groupscode,
+        'emp': row.emp,
+        'phone': row.phone,
+        'enable': row.enable,
+        'note': row.note,
+        'user': row.user
+      }}
+      this.requestParam.data[1] = { 'name': 'updateUserName', 'type': 'e', 'parammaps': {
+        'id': row.id,
+        'userold': row.userold,
+        'user': row.user
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('编辑保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const tId = new RegExp("column 'id'")
+          if (tId.test(response.data)) {
+            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', 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()
+    },
+    handlePageConfiguration(row) {
+      this.tab1.pageConfiguration.temp = Object.assign({}, row)
+      console.log('点击了行内页面配置')
+      this.tab1.pageConfiguration.dialogStatus = 'pageConfiguration'
+      this.tab1.pageConfiguration.dialogFormVisible = true
+      this.getPageConfigurationList()
+    },
+    getPageConfigurationList() {
+      this.tab1.pageConfiguration.getdataListParm.parammaps = {}
+      this.tab1.pageConfiguration.getdataListParm.parammaps.pastureid = this.tab1.pageConfiguration.temp.pastureid
+      this.tab1.pageConfiguration.getdataListParm.parammaps.id = this.tab1.pageConfiguration.temp.id
+      this.tab1.pageConfiguration.listLoading = true
+      GetDataByName(this.tab1.pageConfiguration.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (parseFloat(response.data.list[i].seebutton) > 0 && response.data.list[i].pid !== -1) {
+              this.tab1.pageConfiguration.defaultCheckedKeys.push(String(response.data.list[i].menu_id))
+            }
+            if (parseFloat(response.data.list[i].seebutton) > 0) {
+              this.tab1.pageConfiguration.arrList.push(String(response.data.list[i].menu_id))
+            }
+          }
+          this.tab1.pageConfiguration.data = transData(response.data.list, 'id', 'pid', 'children')
+          console.log(this.tab1.pageConfiguration.data)
+          console.log(response.data.list)
+        } else {
+          this.tab1.pageConfiguration.data = []
+        }
+        setTimeout(() => {
+          this.tab1.pageConfiguration.listLoading = false
+        }, 1000)
+      })
+    },
+    handelCheckChange(id) {
+      this.tab1.pageConfiguration.defaultCheckedKeys = this.$refs.tree.getCheckedKeys()
+      var checkedKeys = this.$refs.tree.getCheckedKeys()
+      var options = checkedKeys.map((item) => {
+        var node = this.$refs.tree.getNode(item) // 所有被选中的节点对应的node
+        const tmpMap = {}
+        console.log(node, 'node')
+        tmpMap.pid = node.parent.key
+        tmpMap.value = node.key
+        return tmpMap
+      })
+      var selectedData = options.map((item) => {
+        console.log(item)
+        return item
+      })
+      console.log(selectedData)
+      var arr = []
+      for (let i = 0; i < selectedData.length; i++) {
+        if (selectedData[i].pid !== undefined) {
+          arr.push(selectedData[i].pid, selectedData[i].value)
+        } else {
+          arr.push(selectedData[i].value)
+        }
+      }
+      this.tab1.pageConfiguration.arrList = this.unique(arr)
+    },
+    unique(arr) {
+      return Array.from(new Set(arr))
+    },
+    pageConfigurationData() {
+      console.log('集团页面配置保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'deletemenuPastureJT', 'type': 'e', 'parammaps': {
+        'id': this.tab1.pageConfiguration.temp.id
+      }}
+      var list = []
+      for (let i = 0; i < this.tab1.pageConfiguration.arrList.length; i++) {
+        list.push({ 'id': this.tab1.pageConfiguration.arrList[i] })
+      }
+      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
+      this.requestParam.data[1].children = []
+      this.requestParam.data[1].children[0] = { 'name': 'insertRolepastureJT', 'type': 'e', 'parammaps': {
+        menuid: '@insertSpotList.id',
+        id: this.tab1.pageConfiguration.temp.id
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('页面配置保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.tab1.pageConfiguration.dialogFormVisible = false
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    handleRelation(row) {
+      this.tab1.relation.temp = Object.assign({}, row)
+      console.log('关联', this.tab1.relation.temp)
+      this.dialogFull = false
+      this.tab1.relation.dialogStatus = 'relation'
+      this.tab1.relation.dialogFormVisible = true
+      this.tab1.relation.radio = '集团'
+      this.getGrouplist()
+      this.getPasturelist()
+    },
+    getGrouplist() {
+      this.tab1.relation.group.table.listLoading = true
+      this.tab1.relation.group.table.getdataListParm.parammaps.id = this.tab1.relation.temp.id
+      GetDataByName(this.tab1.relation.group.table.getdataListParm).then(response => {
+        console.log('集团table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab1.relation.group.table.list = response.data.list
+        } else {
+          this.tab1.relation.group.table.list = []
+        }
+        setTimeout(() => {
+          this.tab1.relation.group.table.listLoading = false
+        }, 100)
+      })
+    },
+    getPasturelist() {
+      this.tab1.relation.pasture.table.listLoading = true
+      this.tab1.relation.pasture.table.getdataListParm.parammaps.id = this.tab1.relation.temp.id
+      GetDataByName(this.tab1.relation.pasture.table.getdataListParm).then(response => {
+        console.log('牧场table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.tab1.relation.pasture.table.list = response.data.list
+        } else {
+          this.tab1.relation.pasture.table.list = []
+        }
+        setTimeout(() => {
+          this.tab1.relation.pasture.table.listLoading = false
+        }, 100)
+      })
+    },
+    groupSearch(queryString, cb) {
+      console.log(this.tab1.relation.temp, '====')
+      this.tab1.relation.group.requestParam.parammaps.groupsname = queryString
+      this.tab1.relation.group.requestParam.parammaps.id = this.tab1.relation.temp.id
+      GetDataByName(this.tab1.relation.group.requestParam).then(response => {
+        if (response.data.list !== null) {
+          this.tab1.relation.group.searchList = response.data.list
+          cb(this.tab1.relation.group.searchList)
+        } else {
+          cb([])
+        }
+      })
+    },
+    handleGroupSelect(item) {
+      if (this.tab1.relation.group.table.list.length > 0) {
+        if (this.tab1.relation.group.table.list.find(obj => obj.id === item.id)) {
+          this.$message({ type: 'warning', message: '集团不可重复添加' })
+        } else {
+          this.tab1.relation.group.table.list.push(item)
+        }
+      } else {
+        this.tab1.relation.group.table.list.push(item)
+      }
+    },
+    handleGroupDelete(row) {
+      for (var i = 0; i < this.tab1.relation.group.table.list.length; i++) {
+        if (this.tab1.relation.group.table.list[i].id == row.id) {
+          var listIndex = this.tab1.relation.group.table.list.indexOf(this.tab1.relation.group.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.tab1.relation.group.table.list.splice(listIndex, 1)
+          return
+        }
+      }
+    },
+    pastureSearch(queryString, cb) {
+      this.tab1.relation.pasture.requestParam.parammaps.pastureName = queryString
+      GetDataByName(this.tab1.relation.pasture.requestParam).then(response => {
+        if (response.data.list !== null) {
+          this.tab1.relation.pasture.searchList = response.data.list
+          cb(this.tab1.relation.pasture.searchList)
+        } else {
+          cb([])
+        }
+      })
+    },
+    handlePastureSelect(item) {
+      if (this.tab1.relation.pasture.table.list.length > 0) {
+        if (this.tab1.relation.pasture.table.list.find(obj => obj.id === item.id)) {
+          this.$message({ type: 'warning', message: '集团不可重复添加' })
+        } else {
+          this.tab1.relation.pasture.table.list.push(item)
+        }
+      } else {
+        this.tab1.relation.pasture.table.list.push(item)
+      }
+    },
+    handlePastureDelete(row) {
+      for (var i = 0; i < this.tab1.relation.pasture.table.list.length; i++) {
+        if (this.tab1.relation.pasture.table.list[i].id == row.id) {
+          var listIndex = this.tab1.relation.pasture.table.list.indexOf(this.tab1.relation.pasture.table.list[i])
+        }
+        if (listIndex > -1) {
+          this.tab1.relation.pasture.table.list.splice(listIndex, 1)
+          return
+        }
+      }
+    },
+    relationData() {
+      console.log('关联保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'deletegroupsPasture', 'type': 'e', 'parammaps': {
+        'id': this.tab1.relation.temp.id
+      }}
+      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.relation.group.table.list }}
+      this.requestParam.data[1].children = []
+      this.requestParam.data[1].children[0] = { 'name': 'insertgroupsPasture', 'type': 'e', 'parammaps': {
+        rid: '@insertSpotList.id',
+        id: this.tab1.relation.temp.id,
+        type: '1'
+      }}
+      this.requestParam.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.tab1.relation.pasture.table.list }}
+      this.requestParam.data[2].children = []
+      this.requestParam.data[2].children[0] = { 'name': 'insertgroupsPasture', 'type': 'e', 'parammaps': {
+        rid: '@insertSpotList2.id',
+        id: this.tab1.relation.temp.id,
+        type: '0'
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('关联保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.tab1.relation.dialogFormVisible = false
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+  .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>

+ 581 - 581
src/views/systemManagement/operationManagement/pasture/index.vue

@@ -1,581 +1,581 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-input v-model="tab2.table.getdataListParm.parammaps.pastureName" placeholder="牧场名称" style="width: 180px;" class="filter-item" clearable />
-      <el-select v-model="tab2.table.getdataListParm.parammaps.enable" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in stateList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-select v-model="tab2.table.getdataListParm.parammaps.statue" placeholder="是否归属集团" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in isBelongGroupList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
-      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">{{$t('formulationEvaluation.add')}}</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"
-      >
-        <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (tab2.table.pageNum-1) * tab2.table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="牧场ID" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.pasturecode }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.pasturecode" 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.pasturename }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.pasturename" 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.user }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.user" 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="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="权限归属" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.groupsname }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.groupsid" :clearable="false" filterable placeholder="权限归属" class="filter-item" style="width: 120px;" clearable>
-              <el-option v-for="item in belongGroupList" :key="item.id" :label="item.groupsname" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.note }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-
-        <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <!-- 页面权限 -->
-            <a v-if="row.NoEdit && isRoleEdit" class="correcting" @click="handlePageConfiguration(row)">页面配置</a>
-
-            <!-- 新增 -->
-            <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" icon="el-icon-folder-checked" :disabled="isokDisable" @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)" />
-            <!-- 编辑 -->
-            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <!-- 编辑保存 -->
-            <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" icon="el-icon-folder-checked" :disabled="isokDisable" @click="updateData(row)" />
-            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="tab2.table.total>=0" :total="tab2.table.total" :page.sync="tab2.table.getdataListParm.offset" :limit.sync="tab2.table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <!-- 页面配置 -->
-    <el-dialog :title="textMap[tab1.pageConfiguration.dialogStatus]" :visible.sync="tab1.pageConfiguration.dialogFormVisible" :close-on-click-modal="false" width="25%">
-      <div style="height: 400px;overflow-y: auto;">
-        <el-tree
-          ref="tree"
-          v-loading="tab1.pageConfiguration.listLoading"
-          show-checkbox
-          node-key="id"
-          :default-expand-all="true"
-          :data="tab1.pageConfiguration.data"
-          :props="tab1.pageConfiguration.defaultProps"
-          :default-checked-keys="tab1.pageConfiguration.defaultCheckedKeys"
-          @check-change="handelCheckChange"
-        />
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom:10px">
-        <el-button class="cancelClose" @click="tab1.pageConfiguration.dialogFormVisible = false;getList(); ">{{$t('formulationEvaluation.cancel')}}</el-button>
-        <el-button class="save" :disabled="isokDisable" @click="pageConfigurationData()">{{$t('errorAnalysis.confirm')}}</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, failproccess, transData, ExecDataByConfig, checkButtons } from '@/api/common'
-import Cookies from 'js-cookie'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'OperationManagement',
-  components: { Pagination },
-  data() {
-    return {
-      requestParams: [
-        { name: 'getGroupsAllList', offset: 0, pagecount: 0, parammaps: {}}
-      ],
-      isRoleEdit: [],
-      stateList: [{ id: 1, name: '启用' }, { id: 0, name: '禁止' }], // 状态
-      isBelongGroupList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否归属集团
-      belongGroupList: [], // 权限归属
-      tab1: {
-        // 页面配置
-        pageConfiguration: {
-          dialogFormVisible: false,
-          dialogStatus: '',
-          temp: {},
-          listLoading: true,
-          getdataListParm: {
-            name: 'getMenuandButtonlistMC'
-          },
-          parentType: [],
-          defaultProps: {
-            children: 'children',
-            label: 'name'
-          },
-          defaultCheckedKeys: [],
-          arrList: []
-        }
-      },
-      tab2: {
-        table: {
-          getdataListParm: {
-            name: 'groupsrelationlistMCAll',
-            page: 1,
-            offset: 1,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {
-              pastureName: '',
-              enable: '',
-              statue: ''
-            }
-          },
-          tableKey: 0,
-          list: [],
-          total: 0,
-          listLoading: true,
-          temp: {}
-        },
-        // 页面配置
-        pageConfiguration: {
-          temp: {}
-        }
-      },
-      requestParam: {},
-      rules: {},
-      isokDisable: false,
-      textMap: {
-        pageConfiguration: '页面配置',
-        relation: '关联'
-      },
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' }
-
-    }
-  },
-
-  created() {
-    this.getList()
-    this.getButtons()
-    this.getDownList()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'Role'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.belongGroupList = response.data.getGroupsAllList.list
-      })
-    },
-    handleEnableChange() {
-      console.log('点击了是否启用')
-    },
-    form_search() {
-      console.log('点击了查询')
-      this.tab2.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.tab2.table.getdataListParm.parammaps.pastureName = ''
-      this.tab2.table.getdataListParm.parammaps.statue = ''
-      this.tab2.table.getdataListParm.parammaps.enable = ''
-      this.tab2.table.getdataListParm.offset = 1
-      this.getList()
-    },
-
-    createCancel(row) {
-      console.log('点击了牧场新增取消')
-      for (let i = 0; i < this.tab2.table.list.length; i++) {
-        if (row.myId === this.tab2.table.list[i].myId) {
-          var listIndex2 = this.tab2.table.list.indexOf(this.tab2.table.list[i])
-        }
-        if (listIndex2 > -1) {
-          this.tab2.table.list.splice(listIndex2, 1)
-          return
-        }
-      }
-    },
-    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()
-    },
-
-    getPageConfigurationList() {
-      this.tab1.pageConfiguration.getdataListParm.parammaps = {}
-      this.tab1.pageConfiguration.getdataListParm.parammaps.pastureid = this.tab2.pageConfiguration.temp.pastureid
-      this.tab1.pageConfiguration.getdataListParm.parammaps.id = this.tab1.pageConfiguration.temp.id
-      this.tab1.pageConfiguration.listLoading = true
-      this.tab1.pageConfiguration.defaultCheckedKeys = []
-      GetDataByName(this.tab1.pageConfiguration.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (parseFloat(response.data.list[i].seebutton) > 0 && response.data.list[i].pid !== -1) {
-              this.tab1.pageConfiguration.defaultCheckedKeys.push(String(response.data.list[i].menu_id))
-            }
-            if (parseFloat(response.data.list[i].seebutton) > 0) {
-              this.tab1.pageConfiguration.arrList.push(String(response.data.list[i].menu_id))
-            }
-          }
-          this.tab1.pageConfiguration.data = transData(response.data.list, 'id', 'pid', 'children')
-          console.log(this.tab1.pageConfiguration.data)
-          console.log(response.data.list)
-        } else {
-          this.tab1.pageConfiguration.data = []
-        }
-        setTimeout(() => {
-          this.tab1.pageConfiguration.listLoading = false
-        }, 1000)
-      })
-    },
-    handelCheckChange(id) {
-      // this.tab1.pageConfiguration.defaultCheckedKeys = this.$refs.tree.getCheckedKeys()
-      var checkedKeys = this.$refs.tree.getCheckedKeys()
-      var options = checkedKeys.map((item) => {
-        var node = this.$refs.tree.getNode(item) // 所有被选中的节点对应的node
-        const tmpMap = {}
-        console.log(node, 'node')
-        tmpMap.pid = node.parent.key
-        tmpMap.value = node.key
-        return tmpMap
-      })
-      var selectedData = options.map((item) => {
-        console.log(item)
-        return item
-      })
-      console.log(selectedData)
-      var arr = []
-      for (let i = 0; i < selectedData.length; i++) {
-        if (selectedData[i].pid !== undefined) {
-          arr.push(selectedData[i].pid, selectedData[i].value)
-        } else {
-          arr.push(selectedData[i].value)
-        }
-      }
-      this.tab1.pageConfiguration.arrList = this.unique(arr)
-      // this.tab1.pageConfiguration.defaultCheckedKeys = this.unique(arr)
-    },
-    unique(arr) {
-      return Array.from(new Set(arr))
-    },
-    handlePageConfiguration(row) {
-      this.tab2.pageConfiguration.temp = Object.assign({}, row)
-      console.log('点击了行内页面配置')
-      this.tab1.pageConfiguration.dialogStatus = 'pageConfiguration'
-      this.tab1.pageConfiguration.dialogFormVisible = true
-      this.tab1.pageConfiguration.defaultCheckedKeys = []
-      this.getPageConfigurationList()
-    },
-    pageConfigurationData() {
-      console.log('牧场页面配置保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'deletemenuPastureMC', 'type': 'e', 'parammaps': {
-        'id': this.tab2.pageConfiguration.temp.id
-      }}
-      var list = []
-      for (let i = 0; i < this.tab1.pageConfiguration.arrList.length; i++) {
-        list.push({ 'id': this.tab1.pageConfiguration.arrList[i] })
-      }
-      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
-      this.requestParam.data[1].children = []
-      this.requestParam.data[1].children[0] = { 'name': 'insertRolepastureMC', 'type': 'e', 'parammaps': {
-        menuid: '@insertSpotList.id',
-        id: this.tab2.pageConfiguration.temp.id
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('页面配置保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.tab1.pageConfiguration.dialogFormVisible = false
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
-    getList() {
-      this.tab2.table.listLoading = true
-      GetDataByName(this.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++) {
-            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.tab2.table.list = response.data.list
-          this.tab2.table.pageNum = response.data.pageNum
-          this.tab2.table.pageSize = response.data.pageSize
-          this.tab2.table.total = response.data.total
-        } else {
-          this.tab2.table.list = []
-        }
-        setTimeout(() => {
-          this.tab2.table.listLoading = false
-        }, 100)
-      })
-    },
-    handleCreate() {
-      console.log('点击了牧场新增')
-      // 编辑true/不可编辑false
-      // 新增操true,编辑false,编辑保存false
-      for (let i = 0; i < this.tab2.table.list.length; i++) {
-        if (this.tab2.table.list[i].Edit == true) {
-          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-          return false
-        }
-      }
-      this.tab2.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'pasturecode': '', 'phone': '', 'contact': '', 'address': '', 'pasturename': '', 'group': '', 'groupsid': '', 'pasturecode': '' })
-    },
-
-    createData(row) {
-      console.log('点击了牧场新增保存', row)
-      // 检验牧场ID/牧场名称是否为空
-      if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
-        this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturename == '' && row.user == '') {
-        this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturecode == '') {
-        this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturename == '') {
-        this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
-        return false
-      } else if (row.user == '') {
-        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
-        return false
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'checkuser', 'type': 'v', 'parammaps': {
-        'user': row.user
-      }}
-      this.requestParam.data[1] = { 'name': 'insertPasture', 'type': 'e', 'parammaps': {
-        'pasturecode': row.pasturecode,
-        'pasturename': row.pasturename,
-        'groupsid': row.groupsid,
-        'user': row.user,
-        'note': row.note,
-        'enable': row.enable,
-        'emp': row.emp,
-        'phone': row.phone,
-        'address': row.address
-      }}
-      this.requestParam.data[2] = { 'name': 'createNewPasture', 'type': 'e', 'parammaps': {
-        'user': row.user,
-        'pastureid': '@insertPasture.LastInsertId',
-        'type': '0'
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          const tId = new RegExp("column 'id'")
-          if (tId.test(response.data)) {
-            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          }
-        }
-      })
-    },
-    handleUpdate(row) {
-      console.log('点击了牧场编辑', row)
-      for (let i = 0; i < this.tab2.table.list.length; i++) {
-        if (this.tab2.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.groupsid !== undefined) {
-        row.groupsid = String(row.groupsid)
-      }
-    },
-    updateData(row) {
-      console.log('点击了牧场编辑保存')
-      // 检验牧场ID/牧场名称是否为空
-      if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
-        this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturename == '' && row.user == '') {
-        this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturecode == '') {
-        this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
-        return false
-      } else if (row.pasturename == '') {
-        this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
-        return false
-      } else if (row.user == '') {
-        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
-        return false
-      }
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.requestParam = {}
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'updatePasture', 'type': 'e', 'parammaps': {
-        'id': row.id,
-        'pasturecode': row.pasturecode,
-        'pasturename': row.pasturename,
-        'groupsid': row.groupsid,
-        'user': row.user,
-        'note': row.note,
-        'enable': row.enable,
-        'emp': row.emp,
-        'phone': row.phone,
-        'address': row.address
-      }}
-      this.requestParam.data[1] = { 'name': 'updateUserName', 'type': 'e', 'parammaps': {
-        'id': row.id,
-        'userold': row.userold,
-        'user': row.user
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList()
-        } else {
-          const tId = new RegExp("column 'id'")
-          if (tId.test(response.data)) {
-            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
-          } else {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          }
-        }
-      })
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-  
-  .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>
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-input v-model="tab2.table.getdataListParm.parammaps.pastureName" placeholder="牧场名称" style="width: 180px;" class="filter-item" clearable />
+      <el-select v-model="tab2.table.getdataListParm.parammaps.enable" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in stateList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-select v-model="tab2.table.getdataListParm.parammaps.statue" placeholder="是否归属集团" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in isBelongGroupList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
+      <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
+    </div>
+    <div class="operation">
+      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">{{$t('formulationEvaluation.add')}}</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"
+      >
+        <el-table-column :label="$t('formulationEvaluation.xh')" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (tab2.table.pageNum-1) * tab2.table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="牧场ID" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.pasturecode }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.pasturecode" 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.pasturename }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.pasturename" 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.user }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.user" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('premixedPlan.status')" 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="权限归属" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.groupsname }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.groupsid" :clearable="false" filterable placeholder="权限归属" class="filter-item" style="width: 120px;" clearable>
+              <el-option v-for="item in belongGroupList" :key="item.id" :label="item.groupsname" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('formulationEvaluation.remark')" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.note }}</span>
+            <el-input v-if="scope.row.Edit" v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
+          </template>
+        </el-table-column>
+
+        <el-table-column  :label="$t('errorAnalysis.cz')" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <!-- 页面权限 -->
+            <a v-if="row.NoEdit && isRoleEdit" class="correcting" @click="handlePageConfiguration(row)">页面配置</a>
+
+            <!-- 新增 -->
+            <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" icon="el-icon-folder-checked" :disabled="isokDisable" @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)" />
+            <!-- 编辑 -->
+            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
+            <!-- 编辑保存 -->
+            <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" icon="el-icon-folder-checked" :disabled="isokDisable" @click="updateData(row)" />
+            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
+            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="tab2.table.total>=0" :total="tab2.table.total" :page.sync="tab2.table.getdataListParm.offset" :limit.sync="tab2.table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <!-- 页面配置 -->
+    <el-dialog :title="textMap[tab1.pageConfiguration.dialogStatus]" :visible.sync="tab1.pageConfiguration.dialogFormVisible" :close-on-click-modal="false" width="25%">
+      <div style="height: 400px;overflow-y: auto;">
+        <el-tree
+          ref="tree"
+          v-loading="tab1.pageConfiguration.listLoading"
+          show-checkbox
+          node-key="id"
+          :default-expand-all="true"
+          :data="tab1.pageConfiguration.data"
+          :props="tab1.pageConfiguration.defaultProps"
+          :default-checked-keys="tab1.pageConfiguration.defaultCheckedKeys"
+          @check-change="handelCheckChange"
+        />
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom:10px">
+        <el-button class="cancelClose" @click="tab1.pageConfiguration.dialogFormVisible = false;getList(); ">{{$t('formulationEvaluation.cancel')}}</el-button>
+        <el-button class="save" :disabled="isokDisable" @click="pageConfigurationData()">{{$t('errorAnalysis.confirm')}}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, failproccess, transData, ExecDataByConfig, checkButtons } from '@/api/common'
+import Cookies from 'js-cookie'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'OperationManagement',
+  components: { Pagination },
+  data() {
+    return {
+      requestParams: [
+        { name: 'getGroupsAllList', offset: 0, pagecount: 0, parammaps: {}}
+      ],
+      isRoleEdit: [],
+      stateList: [{ id: 1, name: '启用' }, { id: 0, name: '禁止' }], // 状态
+      isBelongGroupList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否归属集团
+      belongGroupList: [], // 权限归属
+      tab1: {
+        // 页面配置
+        pageConfiguration: {
+          dialogFormVisible: false,
+          dialogStatus: '',
+          temp: {},
+          listLoading: true,
+          getdataListParm: {
+            name: 'getMenuandButtonlistMC'
+          },
+          parentType: [],
+          defaultProps: {
+            children: 'children',
+            label: 'name'
+          },
+          defaultCheckedKeys: [],
+          arrList: []
+        }
+      },
+      tab2: {
+        table: {
+          getdataListParm: {
+            name: 'groupsrelationlistMCAll',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              pastureName: '',
+              enable: '',
+              statue: ''
+            }
+          },
+          tableKey: 0,
+          list: [],
+          total: 0,
+          listLoading: true,
+          temp: {}
+        },
+        // 页面配置
+        pageConfiguration: {
+          temp: {}
+        }
+      },
+      requestParam: {},
+      rules: {},
+      isokDisable: false,
+      textMap: {
+        pageConfiguration: '页面配置',
+        relation: '关联'
+      },
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' }
+
+    }
+  },
+
+  created() {
+    this.getList()
+    this.getButtons()
+    this.getDownList()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'Role'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.belongGroupList = response.data.getGroupsAllList.list
+      })
+    },
+    handleEnableChange() {
+      console.log('点击了是否启用')
+    },
+    form_search() {
+      console.log('点击了查询')
+      this.tab2.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.tab2.table.getdataListParm.parammaps.pastureName = ''
+      this.tab2.table.getdataListParm.parammaps.statue = ''
+      this.tab2.table.getdataListParm.parammaps.enable = ''
+      this.tab2.table.getdataListParm.offset = 1
+      this.getList()
+    },
+
+    createCancel(row) {
+      console.log('点击了牧场新增取消')
+      for (let i = 0; i < this.tab2.table.list.length; i++) {
+        if (row.myId === this.tab2.table.list[i].myId) {
+          var listIndex2 = this.tab2.table.list.indexOf(this.tab2.table.list[i])
+        }
+        if (listIndex2 > -1) {
+          this.tab2.table.list.splice(listIndex2, 1)
+          return
+        }
+      }
+    },
+    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()
+    },
+
+    getPageConfigurationList() {
+      this.tab1.pageConfiguration.getdataListParm.parammaps = {}
+      this.tab1.pageConfiguration.getdataListParm.parammaps.pastureid = this.tab2.pageConfiguration.temp.pastureid
+      this.tab1.pageConfiguration.getdataListParm.parammaps.id = this.tab1.pageConfiguration.temp.id
+      this.tab1.pageConfiguration.listLoading = true
+      this.tab1.pageConfiguration.defaultCheckedKeys = []
+      GetDataByName(this.tab1.pageConfiguration.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (parseFloat(response.data.list[i].seebutton) > 0 && response.data.list[i].pid !== -1) {
+              this.tab1.pageConfiguration.defaultCheckedKeys.push(String(response.data.list[i].menu_id))
+            }
+            if (parseFloat(response.data.list[i].seebutton) > 0) {
+              this.tab1.pageConfiguration.arrList.push(String(response.data.list[i].menu_id))
+            }
+          }
+          this.tab1.pageConfiguration.data = transData(response.data.list, 'id', 'pid', 'children')
+          console.log(this.tab1.pageConfiguration.data)
+          console.log(response.data.list)
+        } else {
+          this.tab1.pageConfiguration.data = []
+        }
+        setTimeout(() => {
+          this.tab1.pageConfiguration.listLoading = false
+        }, 1000)
+      })
+    },
+    handelCheckChange(id) {
+      // this.tab1.pageConfiguration.defaultCheckedKeys = this.$refs.tree.getCheckedKeys()
+      var checkedKeys = this.$refs.tree.getCheckedKeys()
+      var options = checkedKeys.map((item) => {
+        var node = this.$refs.tree.getNode(item) // 所有被选中的节点对应的node
+        const tmpMap = {}
+        console.log(node, 'node')
+        tmpMap.pid = node.parent.key
+        tmpMap.value = node.key
+        return tmpMap
+      })
+      var selectedData = options.map((item) => {
+        console.log(item)
+        return item
+      })
+      console.log(selectedData)
+      var arr = []
+      for (let i = 0; i < selectedData.length; i++) {
+        if (selectedData[i].pid !== undefined) {
+          arr.push(selectedData[i].pid, selectedData[i].value)
+        } else {
+          arr.push(selectedData[i].value)
+        }
+      }
+      this.tab1.pageConfiguration.arrList = this.unique(arr)
+      // this.tab1.pageConfiguration.defaultCheckedKeys = this.unique(arr)
+    },
+    unique(arr) {
+      return Array.from(new Set(arr))
+    },
+    handlePageConfiguration(row) {
+      this.tab2.pageConfiguration.temp = Object.assign({}, row)
+      console.log('点击了行内页面配置')
+      this.tab1.pageConfiguration.dialogStatus = 'pageConfiguration'
+      this.tab1.pageConfiguration.dialogFormVisible = true
+      this.tab1.pageConfiguration.defaultCheckedKeys = []
+      this.getPageConfigurationList()
+    },
+    pageConfigurationData() {
+      console.log('牧场页面配置保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'deletemenuPastureMC', 'type': 'e', 'parammaps': {
+        'id': this.tab2.pageConfiguration.temp.id
+      }}
+      var list = []
+      for (let i = 0; i < this.tab1.pageConfiguration.arrList.length; i++) {
+        list.push({ 'id': this.tab1.pageConfiguration.arrList[i] })
+      }
+      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
+      this.requestParam.data[1].children = []
+      this.requestParam.data[1].children[0] = { 'name': 'insertRolepastureMC', 'type': 'e', 'parammaps': {
+        menuid: '@insertSpotList.id',
+        id: this.tab2.pageConfiguration.temp.id
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('页面配置保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.tab1.pageConfiguration.dialogFormVisible = false
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    getList() {
+      this.tab2.table.listLoading = true
+      GetDataByName(this.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++) {
+            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.tab2.table.list = response.data.list
+          this.tab2.table.pageNum = response.data.pageNum
+          this.tab2.table.pageSize = response.data.pageSize
+          this.tab2.table.total = response.data.total
+        } else {
+          this.tab2.table.list = []
+        }
+        setTimeout(() => {
+          this.tab2.table.listLoading = false
+        }, 100)
+      })
+    },
+    handleCreate() {
+      console.log('点击了牧场新增')
+      // 编辑true/不可编辑false
+      // 新增操true,编辑false,编辑保存false
+      for (let i = 0; i < this.tab2.table.list.length; i++) {
+        if (this.tab2.table.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      this.tab2.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'pasturecode': '', 'phone': '', 'contact': '', 'address': '', 'pasturename': '', 'group': '', 'groupsid': '', 'pasturecode': '' })
+    },
+
+    createData(row) {
+      console.log('点击了牧场新增保存', row)
+      // 检验牧场ID/牧场名称是否为空
+      if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
+        this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturename == '' && row.user == '') {
+        this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturecode == '') {
+        this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturename == '') {
+        this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
+        return false
+      } else if (row.user == '') {
+        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'checkuser', 'type': 'v', 'parammaps': {
+        'user': row.user
+      }}
+      this.requestParam.data[1] = { 'name': 'insertPasture', 'type': 'e', 'parammaps': {
+        'pasturecode': row.pasturecode,
+        'pasturename': row.pasturename,
+        'groupsid': row.groupsid,
+        'user': row.user,
+        'note': row.note,
+        'enable': row.enable,
+        'emp': row.emp,
+        'phone': row.phone,
+        'address': row.address
+      }}
+      this.requestParam.data[2] = { 'name': 'createNewPasture', 'type': 'e', 'parammaps': {
+        'user': row.user,
+        'pastureid': '@insertPasture.LastInsertId',
+        'type': '0'
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const tId = new RegExp("column 'id'")
+          if (tId.test(response.data)) {
+            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        }
+      })
+    },
+    handleUpdate(row) {
+      console.log('点击了牧场编辑', row)
+      for (let i = 0; i < this.tab2.table.list.length; i++) {
+        if (this.tab2.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.groupsid !== undefined) {
+        row.groupsid = String(row.groupsid)
+      }
+    },
+    updateData(row) {
+      console.log('点击了牧场编辑保存')
+      // 检验牧场ID/牧场名称是否为空
+      if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
+        this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturename == '' && row.user == '') {
+        this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturecode == '') {
+        this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
+        return false
+      } else if (row.pasturename == '') {
+        this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
+        return false
+      } else if (row.user == '') {
+        this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
+        return false
+      }
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.requestParam = {}
+      this.requestParam.common = { 'returnmap': '0' }
+      this.requestParam.data = []
+      this.requestParam.data[0] = { 'name': 'updatePasture', 'type': 'e', 'parammaps': {
+        'id': row.id,
+        'pasturecode': row.pasturecode,
+        'pasturename': row.pasturename,
+        'groupsid': row.groupsid,
+        'user': row.user,
+        'note': row.note,
+        'enable': row.enable,
+        'emp': row.emp,
+        'phone': row.phone,
+        'address': row.address
+      }}
+      this.requestParam.data[1] = { 'name': 'updateUserName', 'type': 'e', 'parammaps': {
+        'id': row.id,
+        'userold': row.userold,
+        'user': row.user
+      }}
+      ExecDataByConfig(this.requestParam).then(response => {
+        console.log('编辑保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.getList()
+        } else {
+          const tId = new RegExp("column 'id'")
+          if (tId.test(response.data)) {
+            this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+  .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>