duanxiaoduan 2 years ago
parent
commit
ca37a868c1

BIN
dist.zip


+ 0 - 2049
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan - 副本.vue

@@ -1,2049 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-select
-        v-model="table.getdataListParm.parammaps.times"
-        filterable
-        placeholder="班次"
-        class="filter-item"
-        style="width: 120px;"
-        @change="changeFrequency"
-      >
-        <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-    </div>
-    <div class="operation">
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次
-      </el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">
-        减少车次</el-button>
-      <el-button
-        v-if="isOrder && isRoleEdit"
-        icon="el-icon-sort"
-        style="float: left;"
-        class="success"
-        @click="handleChangeOrder"
-      >更改顺序</el-button>
-      <div v-else style="float: left;margin-left: 10px;">
-        <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存
-        </el-button>
-        <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
-      </div>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect">
-        生效</el-button>
-      <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable">
-        禁用</el-button>
-    </div>
-    <div class="table">
-      <el-table
-        id="table"
-        :key="table.tableKey"
-        ref="table"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        highlight-current-row
-        style="width: 100%;"
-        :height="height"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable"
-        row-key="id"
-        @selection-change="handleSelect"
-      >
-        <el-table-column type="selection" width="50" />
-        <el-table-column label="车次" width="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="TMR编号" 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="生效" 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="班次" width="65px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.timesstr }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="时间" 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="操作" 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;"
-      >共{{ table.total }}条</span>
-    </div>
-
-    <!-- 新增、编辑 -->
-    <el-dialog
-      :fullscreen="dialogFull"
-      :destroy-on-close="true"
-      :visible.sync="create.dialogFormVisible"
-      :before-close="close"
-      :close-on-click-modal="false"
-      width="90%"
-      :modal-append-to-body="false"
-      :append-to-body="true"
-    >
-      <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 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()">关闭</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;width: 18px;color: #fff;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">
-              <draggable
-                :disabled="isDropState"
-                id="1"
-                data-source="juju"
-                :list="create.list2"
-                class="list-group1"
-                draggable=".item"
-                group="a"
-                animation="500"
-                force-fallback="true"
-                :move="move1"
-                @change="changeLog1"
-                @start="start1"
-                @end="end1"
-              >
-                <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="重量"
-                          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;">关闭</el-button>
-            <el-button class="save" :disabled="isokDisable" @click="updateData()" style="top:40px;">确认</el-button>
-          </div>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import Cookies from 'js-cookie'
-import Sortable from 'sortablejs'
-import draggable from 'vuedraggable'
-import { checkButtons, postJson,ExecDataByConfig } from '@/api/common'
-import { MessageBox } from 'element-ui'
-export default {
-  components: {
-    draggable
-  },
-  name: 'MaterialIssuancePlan',
-  directives: {
-    focus: {
-      update: function(el, {
-        value
-      }) {
-        if (value) {
-          el.focus()
-        }
-      }
-    }
-  },
-  props: {
-    show: {
-      type: Boolean,
-      default: false
-    }, // 弹框可见标志
-    parentDate: {
-      type: String,
-      defalut: ''
-    }
-  },
-  data() {
-    return {
-      date: '',
-      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: [],
-      textMap: {
-        create: '新增',
-        update: '编辑'
-      },
-      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,
-      isDropState:false
-    }
-  },
-  watch: {
-    // 监听show,visible 随着show变化而变化
-    show: {
-      immediate: true,
-      handler(newVal, oldVal) {
-        console.log('newVal-show', newVal)
-      }
-    },
-    parentDate: {
-      immediate: true,
-      handler(newVal, oldVal) {
-        console.log('newVal-show', newVal)
-        this.date = newVal
-      }
-    }
-  },
-  created() {
-    this.getButtons()
-    this.getIsDisplay()
-    this.getList()
-  },
-  methods: {
-    getButtons() {
-      const Edit = 'DailyExecutionPlan'
-      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 data2 = {
-        name: 'getTMRListEnableTypeAll',
-        offset: 0,
-        parammaps: {
-          pastureid: Cookies.get('pastureid'),
-          eqtype: '1'
-        }
-      }
-      postJson(url, data2).then(response => {
-        if (response.data !== null) {
-          this.equipmentList = response.data.list
-          if(this.create.dialogStatus == 'update'){
-            this.create.temp.tclassname = this.equipmentList.find(obj => obj.id ==  this.create.temp.tmrid).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: '第一班'
-          }]
-        } else if (response.data.list[0].inforvalue == 2) {
-          this.frequencyList = [{
-            id: 1,
-            name: '第一班'
-          },
-          {
-            id: 2,
-            name: '第二班'
-          }
-          ]
-        } else if (response.data.list[0].inforvalue == 3) {
-          this.frequencyList = [{
-            id: 1,
-            name: '第一班'
-          },
-          {
-            id: 2,
-            name: '第二班'
-          },
-          {
-            id: 3,
-            name: '第三班'
-          }
-          ]
-        } else if (response.data.list[0].inforvalue == 4) {
-          this.frequencyList = [{
-            id: 1,
-            name: '第一班'
-          },
-          {
-            id: 2,
-            name: '第二班'
-          },
-          {
-            id: 3,
-            name: '第三班'
-          },
-          {
-            id: 4,
-            name: '第四班'
-          }
-          ]
-        }
-      })
-    },
-
-    getList() {
-      this.table.listLoading = true
-      const url = 'authdata/spillage/day'
-      this.table.getdataListParm.parammaps.date = this.date
-      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 = 'deleteLppdate'
-          this.requestParam.parammaps = {}
-          this.requestParam.parammaps.pastureid = row.pastureid
-          this.requestParam.parammaps.id = row.id
-          this.requestParam.parammaps.date = this.date
-          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.mytmrid = this.create.temp.tmrid
-          this.create.temp.mytmrname = this.create.temp.tmrname
-          console.log('tmrname==>', this.create.temp)
-          if (this.isDispaly || this.create.dialogStatus == 'update') {
-            this.getClearList()
-          }
-        }).catch(() => {
-          this.create.temp.tmrid2 = this.create.temp.tmrid
-          this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
-          this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
-          this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
-          this.create.temp.mytmrid = this.create.temp.tmrid2
-          this.create.temp.mytmrname = this.create.temp.tmrname
-          if (this.isDispaly || this.create.dialogStatus == 'update') {
-            this.getClearList()
-          }
-          console.log(this.create.temp)
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          })
-        })
-      } 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
-        console.log('TMR编号item==>', item)
-        console.log('tmrname==>', this.create.temp)
-      }
-    },
-    getClearList() {
-      const url = 'authdata/lpplandtl/del/day'
-      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
-        obj.date = this.date
-        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) {
-      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': 'checkFPdLeftWdate',
-        'type': 'v',
-        'parammaps': {
-          pastureid: item.pastureid,
-          fpdid: item.fpdid,
-          fttype: item.fttype,
-          lweight: lweight,
-          date: this.date
-        }
-      }
-      this.requestParam.data[1] = {
-        'name': 'updateLppddate',
-        '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,
-          date: this.date
-        }
-      }
-      this.requestParam.data[2] = {
-        'name': 'updateFpdetailUsedate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: item.pastureid,
-          id: item.fpdid,
-          fttype: item.fttype,
-          lweight: lweight,
-          date: this.date
-        }
-      }
-      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()
-      })
-    },
-    handleFLDelete(ele) {
-      console.log(ele, '点击了撒料删除')
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'deleteLppddate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: ele.pastureid,
-          id: ele.id,
-          date: this.date
-        }
-      }
-      this.requestParam.data[1] = {
-        'name': 'updateFpdetailUsedate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: ele.pastureid,
-          id: ele.fpdid,
-          fttype: ele.fttype,
-          lweight: '-' + parseFloat(ele.weight),
-          date: this.date
-        }
-      }
-      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/lpplandtl/add/day'
-          const data = {}
-          this.create.temp.pastureid = Cookies.get('pastureid')
-          this.create.temp.times = parseInt(this.create.temp.times)
-          this.create.temp.date = this.date
-          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/day'
-      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,
-          date: this.date
-        }
-      }
-      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/day'
-      const data = {}
-      data.parammaps = {}
-      data.parammaps.pastureid = Cookies.get('pastureid'),
-      data.parammaps.id = this.create.temp.id
-      data.parammaps.date = this.date
-      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)
-      console.log('点击了栏舍item==>', item)
-      this.create.temp.sumweight = parseFloat(this.create.temp.sumweight)
-      // if(this.create.temp.tclassname == '固定式'){
-      //   console.log(this.equipmentList.find(obj => obj.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
-      //   }
-      //   console.log('temp',this.create.temp)
-      // }
-      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
-        }
-      }
-      console.log('this.create.temp.sumweight', this.create.temp.sumweight)
-      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===>', item.weight)
-      // const url = 'authdata/lpplandtl/date/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
-      // data.parammaps.date = this.date
-      // postJson(url, data).then(response => {
-        this.requestParam = {}
-        this.requestParam.common = {
-          'returnmap': '0'
-        }
-        this.requestParam.data = []
-        this.requestParam.data[0] = { 'name': 'insertLppddate', '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,
-            date: this.date
-          }
-        }
-        ExecDataByConfig(this.requestParam).then(response => {
-        this.requestParam = {}
-        this.requestParam.common = { 'returnmap': '0' }
-        this.requestParam.data = []
-        // this.requestParam.data[0] = {
-        //   'name': 'updateLpplandtlSortsdate',
-        //   'type': 'e',
-        //   'parammaps': {
-        //     pastureid: evt.pastureid,
-        //     sort: evt.sort,
-        //     lppid: evt.id,
-        //     date: this.date
-        //   }
-        // }
-        this.requestParam.data[0] = { 'name': 'updateFpdetailUsedate', 'type': 'e',
-          'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight, date: this.date }
-        }
-        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) {
-      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
-      console.log('this.create.temp', this.create.temp)
-      this.create.checkBarList = []
-      this.getCreateList1()
-    },
-    updateData() {
-      this.$refs['temp'].validate(valid => {
-        if (valid) {
-          this.isokDisable = true
-          setTimeout(() => {
-            this.isokDisable = false
-          }, 1000)
-          const url = 'authdata/PostDataByName'
-          const data = {}
-          data.name = 'updateLppdate'
-          this.create.temp.pastureid = Cookies.get('pastureid')
-          this.create.temp.times = parseInt(this.create.temp.times)
-          this.create.temp.sumcowcount = 0
-          this.create.temp.date = this.date
-          data.parammaps = this.create.temp
-          data.parammaps.tmrid = this.create.temp.mytmrid
-          data.parammaps.tmrname = this.create.temp.mytmrname
-          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/day'
-        const data = {}
-        data.old = []
-        for (let i = 0; i < this.create.list2.length; i++) {
-          this.$set(this.create.list2[i], 'date', this.date)
-        }
-        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 })
-          }
-        })
-      } else {
-        console.log('编辑关闭')
-        this.isokDisable = true
-        setTimeout(() => {
-          this.isokDisable = false
-        }, 1000)
-        const url = 'authdata/lpplandtl/restore/day'
-        const data = {}
-        for (let i = 0; i < this.create.temp.arrList.length; i++) {
-          this.$set(this.create.temp.arrList[i], 'date', this.date)
-        }
-        for (let i = 0; i < this.create.list2.length; i++) {
-          this.$set(this.create.list2[i], 'date', this.date)
-        }
-        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/date/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
-      // data.parammaps.date = this.date
-
-      // 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 })
-      //   }
-      // })
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'updateLpplandtl1Tmrdate', 'type': 'e', 'parammaps': {
-          tmrid: objList.tmrid,
-          tmrname: objList.tmrname,
-          id: objList.id,
-          pastureid: this.create.temp.pastureid,
-          date:this.date
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.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('changeLog1===>', evt)
-       // var obj = evt.moved.element
-       // const url = 'authdata/lpplandtl/edit/date/sort'
-       // const data = {}
-       // 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.date = this.date
-       // 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 })
-       //   }
-       // })
-       var sortArr = []
-       for (let i = 0; i < this.create.list2.length; i++) {
-         var obj = {}
-         obj.sort = i + 1
-         obj.id = this.create.list2[i].id
-         obj.pastureid = this.create.list2[i].pastureid
-         sortArr.push(obj)
-       }
-       this.requestParam = {}
-       this.requestParam.common = { 'returnmap': '0' }
-       this.requestParam.data = []
-       this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortArr }}
-       this.requestParam.data[0].children = []
-       this.requestParam.data[0].children[0] = { 'name': 'updateLpplandtlSortonedate', 'type': 'e', 'parammaps': {
-         id: '@insertSpotList.id',
-         pastureid: '@insertSpotList.pastureid',
-         sort: '@insertSpotList.sort',
-         date:this.date
-       }}
-       ExecDataByConfig(this.requestParam).then(response => {
-         console.log('顺序切换保存发送参数', this.requestParam)
-       if (response.msg === 'fail') {
-         this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-       } else {
-         this.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, originalEvent){
-      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)
-          for (let i = 0; i < this.selectList.length; i++) {
-            this.$set(this.selectList[i], 'date', this.date)
-          }
-          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': 'deleteLppdate',
-            'type': 'e',
-            'parammaps': {
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid',
-              date: '@insertSpotList.date'
-            }
-          }
-          const url = 'authdata/ExecDataByConfig'
-          const data = this.requestParam
-          postJson(url, data).then(response => {
-            console.log('删除保存发送参数', this.requestParam)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '删除失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.$notify({
-                title: '',
-                message: '删除成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.table.getdataListParm.parammaps.refresh = 1
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-    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.date = this.date
-        obj.id = this.table.list[i].id
-        obj.pastureid = this.table.list[i].pastureid
-        sortArr.push(obj)
-      }
-      const url = 'authdata/trains/day'
-      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)
-          const data = {}
-          data.common = {
-            'returnmap': '0'
-          }
-          data.data = []
-          data.data[0] = {
-            'name': 'insertSpotList',
-            'resultmaps': {
-              'list': this.selectList
-            }
-          }
-          data.data[0].children = []
-          data.data[0].children[0] = {
-            'name': 'UpdateLpplandateSel',
-            'type': 'e',
-            'parammaps': {
-              sel: '@insertSpotList.sel',
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }
-          }
-          const url = 'authdata/ExecDataByConfig'
-          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()
-            }
-          })
-        })
-      }
-    },
-    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)
-          var data = {}
-          data.common = {
-            'returnmap': '0'
-          }
-          data.data = []
-          data.data[0] = {
-            'name': 'insertSpotList',
-            'resultmaps': {
-              'list': this.selectList
-            }
-          }
-          data.data[0].children = []
-          data.data[0].children[0] = {
-            'name': 'UpdateLpplandateSel',
-            'type': 'e',
-            'parammaps': {
-              sel: '@insertSpotList.sel',
-              id: '@insertSpotList.id',
-              pastureid: '@insertSpotList.pastureid'
-            }
-          }
-          const url = 'authdata/ExecDataByConfig'
-          postJson(url, data).then(response => {
-            console.log('禁用保存发送参数', data)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '禁用失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.$notify({
-                title: '禁用成功',
-                message: '禁用成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.table.getdataListParm.parammaps.refresh = 1
-              this.getList()
-            }
-          })
-        })
-      }
-    },
-    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': 'deleteLpplandtl1DateByLppid', 'type': 'e', 'parammaps': { lppid: this.create.temp.id, pastureid:  Cookies.get('pastureid'),date:this.date }},
-      this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
-      this.requestParam.data[1].children = []
-      this.requestParam.data[1].children[0] = {
-        'name': 'updateFpdetailUsedate',
-        'type': 'e',
-        'parammaps': { pastureid: '@insertSpotList.pastureid', id: '@insertSpotList.id', fttype: '@insertSpotList.fttype', lweight: '@insertSpotList.lweight',date:this.date }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('清空保存发送参数', this.requestParam)
-        if (response.msg === 'fail') {
-          this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
-          this.getCreateList1()
-        }
-      })
-    }
-  }
-}
-</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" scoped>
-  .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>

+ 0 - 668
src/views/formulationPlan/formulaDistribution/inde改.vue

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

+ 15 - 15
src/views/formulationPlan/recipeTemplate/index.vue

@@ -2269,25 +2269,25 @@ export default {
       this.table2.temp.preftid = this.table2.temp.preftid
       this.table2.temp.autosecond = row.autosecond
       this.table2.temp.deviation = row.deviation
-      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+      if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
         this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+      } else if (this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
         this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+      } else if (this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
         this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      }else if (this.table2.temp.fid == '') {
+      }else if (this.table2.temp.fid === '') {
         this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fweight == '') {
+      } else if (this.table2.temp.fweight === '') {
         this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.autosecond == '') {
+      } else if (this.table2.temp.autosecond === '') {
         this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.deviation == '') {
+      } else if (this.table2.temp.deviation === '') {
         this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
         return false
       }
@@ -2488,25 +2488,25 @@ export default {
           // } else {
           //   status = 1
           // }
-          if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+          if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
             this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+          } else if (this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
             this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
-            this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空', duration: 2000 })
+          } else if (this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
+            this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空1=', duration: 2000 })
             return false
-          }else if (this.table2.temp.fid == '') {
+          }else if (this.table2.temp.fid === '') {
             this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fweight == '') {
+          } else if (this.table2.temp.fweight === '') {
             this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.autosecond == '') {
+          } else if (this.table2.temp.autosecond === '') {
             this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.deviation == '') {
+          } else if (this.table2.temp.deviation === '') {
             this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
             return false
           }

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

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

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

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

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

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

+ 0 - 448
src/views/inventoryManagement/statistics/index改.vue

@@ -1,448 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="search">
-      <el-select v-model="table.getdataListParm.parammaps.feedid" filterable placeholder="饲料名称" class="filter-item" style="width: 150px;" clearable>
-        <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
-      </el-select>
-      <el-button class="successBorder" @click="handleSearch">查询</el-button>
-      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-      <el-button class="export" icon="el-icon-upload2" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
-    </div>
-
-    <div class="table">
-      <el-table
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        :max-height="myHeight"
-      >
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="饲料名称" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.feedname }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="当前库存重量(kg)" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.stockweight }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="金额(元)" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.sumprice }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="平均单价(元/kg)" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span>后台待返回</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button class="miniSuccess" icon="el-icon-search" :disabled="isokDisable" @click="handleSee(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
-    </div>
-
-    <el-dialog :fullscreen="dialogFull" :visible.sync="see.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[see.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-see">
-        <el-tabs v-model="see.activeName" @tab-click="handleTabClick">
-          <el-tab-pane label="入库记录" name="first">
-            <div class="search">
-              <el-date-picker v-model="see.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-              <el-button class="successBorder" @click="handleSearch1">查询</el-button>
-            </div>
-            <div class="table">
-              <el-table
-                :key="see.tableKey"
-                v-loading="see.listLoading"
-                element-loading-text="给我一点时间"
-                :data="see.list"
-                border
-                fit
-                highlight-current-row
-                style="width: 100%;"
-                :row-style="rowStyle"
-                :cell-style="cellStyle"
-                class="elTable table-fixed"
-              >
-                <el-table-column label="序号" align="center" type="index" width="50px">
-                  <template slot-scope="scope">
-                    <span>{{ scope.$index + (see.pageNum-1) * see.pageSize + 1 }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="入库日期" min-width="130px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.laiddate }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="操作重量(kg)" min-width="130px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.operateweight }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="金额(元)" min-width="110px" align="center">
-                  <template slot-scope="scope">
-                    <span> {{ scope.row.sumprice }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="备注" min-width="110px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.remark }}</span>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
-            <pagination v-show="see.total>=0" style="margin-bottom: 50px;" :total="see.total" :page.sync="see.getdataListParm.offset" :limit.sync="see.getdataListParm.pagecount" @pagination="getSeeList" />
-          </el-tab-pane>
-          <el-tab-pane label="出库记录" name="second">
-            <div class="search">
-              <el-select v-model="see.getdataListParm2.parammaps.usetype" placeholder="出库类型" class="filter-item" style="width: 150px;" clearable>
-                <el-option v-for="item in deliveryTypeList" :key="item.id" :label="item.label" :value="item.value" />
-              </el-select>
-              <el-date-picker v-model="see.getdataListParm2.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-              <el-button class="successBorder" @click="handleSearch2">查询</el-button>
-            </div>
-            <div class="table">
-              <el-table
-                :key="see.tableKey2"
-                v-loading="see.listLoading2"
-                element-loading-text="给我一点时间"
-                :data="see.list2"
-                border
-                fit
-                highlight-current-row
-                style="width: 100%;"
-                :row-style="rowStyle"
-                :cell-style="cellStyle"
-                class="elTable table-fixed"
-              >
-                <el-table-column label="序号" align="center" type="index" width="50px">
-                  <template slot-scope="scope">
-                    <span>{{ scope.$index + (see.pageNum2-1) * see.pageSize2 + 1 }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="出库日期" min-width="130px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.usedate }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="出库类型" min-width="130px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.usetype }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="牲畜类别" min-width="110px" align="center">
-                  <template slot-scope="scope">
-                    <span> {{ scope.row.cowclass }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="操作重量(kg)" min-width="110px" align="center">
-                  <template slot-scope="scope">
-                    <span> {{ scope.row.operateweight }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column label="备注" min-width="110px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.remark }}</span>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
-            <pagination v-show="see.total2>=0" style="margin-bottom: 50px;" :total="see.total2" :page.sync="see.getdataListParm2.offset" :limit.sync="see.getdataListParm2.pagecount" @pagination="getSeeList2" />
-          </el-tab-pane>
-        </el-tabs>
-        <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose cancelClose1" @click="see.dialogFormVisible = false; ">关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-
-</template>
-
-<script>
-import { GetDataByName, GetDataByNames, checkButtons } from '@/api/common'
-import Pagination from '@/components/Pagination'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-export default {
-  name: 'Statistics',
-  components: { Pagination },
-  data() {
-    return {
-      dialogFull: false,
-      isRoleEdit: [],
-      requestParams: [
-        { name: 'getFeedListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
-        { name: 'getDictByNameUse', offset: 0, pagecount: 0, params: ['人工用量操作类型'] }
-      ],
-      feedNameList: [], // 饲料名称
-      deliveryTypeList: [], // 出库类型
-      table: {
-        getdataListParm: {
-          name: 'getFeedstorageList',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pageCount')),
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            feedid: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true
-      },
-      textMap: {
-        see: '库存'
-      },
-      see: {
-        dialogFormVisible: false,
-        dialogStatus: '',
-        temp: {},
-        rules: {},
-        getdataListParm: {
-          name: 'getFsLaidList',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: '',
-            feedid: '',
-            inputDatetime: '',
-            startTime: '',
-            stopTime: ''
-          }
-        },
-        tableKey: 0,
-        list: [],
-        total: 0,
-        listLoading: true,
-        activeName: 'first',
-        getdataListParm2: {
-          name: 'getFsUseList',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: '',
-            feedid: '',
-            inputDatetime: '',
-            startTime: '',
-            stopTime: '',
-            usetype: ''
-          }
-        },
-        tableKey2: 0,
-        list2: [],
-        total2: 0,
-        listLoading2: true
-      },
-      requestParam: {},
-      download: {
-        getdataListParm: {
-          name: 'getFeedstorageList',
-          page: 1,
-          offset: 1,
-          pagecount: 0,
-          returntype: 'Map',
-          parammaps: {
-            pastureid: Cookies.get('pastureid'),
-            feedid: ''
-          }
-        },
-        list: []
-      },
-      isokDisable: false,
-      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150 -10
-    }
-  },
-
-  created() {
-    this.getButtons()
-    this.getDownList()
-    this.getList()
-  },
-
-  methods: {
-    getButtons() {
-      const Edit = 'Statistics'
-      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
-      this.isRoleEdit = isRoleEdit
-    },
-    getDownList() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.feedNameList = response.data.getFeedListEnable.list
-        this.deliveryTypeList = response.data.getDictByNameUse.list
-      })
-    },
-    getList() {
-      this.table.listLoading = true
-      GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-        } else {
-          this.table.list = []
-        }
-        this.table.total = response.data.total
-        setTimeout(() => {
-          this.table.listLoading = false
-        }, 100)
-      })
-    },
-
-    handleSearch() {
-      console.log('点击了查询')
-      this.table.getdataListParm.offset = 1
-      this.getList()
-    },
-    handleRefresh() {
-      console.log('点击了重置')
-      this.table.getdataListParm.offset = 1
-      this.table.getdataListParm.parammaps.feedid = ''
-      this.getList()
-    },
-    handleSee(row) {
-      this.see.dialogStatus = 'see'
-      this.dialogFull = false
-      this.see.dialogFormVisible = true
-      this.see.list = []
-      this.see.getdataListParm.offset = 1
-      this.see.getdataListParm2.offset = 1
-      this.see.getdataListParm.parammaps.pastureid = row.pastureid
-      this.see.getdataListParm.parammaps.feedid = row.feedid
-      this.see.getdataListParm2.parammaps.pastureid = row.pastureid
-      this.see.getdataListParm2.parammaps.feedid = row.feedid
-      this.see.activeName = 'first'
-      this.getSeeList()
-      this.getSeeList2()
-    },
-    getSeeList() {
-      this.see.listLoading = true
-      GetDataByName(this.see.getdataListParm).then(response => {
-        console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
-          this.see.list = response.data.list
-          this.see.pageNum = response.data.pageNum
-          this.see.pageSize = response.data.pageSize
-          this.see.total = response.data.total
-        } else {
-          this.see.list = []
-        }
-        setTimeout(() => {
-          this.see.listLoading = false
-        }, 100)
-      })
-    },
-    getSeeList2() {
-      this.see.listLoading2 = true
-      GetDataByName(this.see.getdataListParm2).then(response => {
-        console.log('table数据2', response.data.list)
-        if (response.data.list !== null) {
-          this.see.list2 = response.data.list
-          this.see.pageNum2 = response.data.pageNum
-          this.see.pageSize2 = response.data.pageSize
-          this.see.total2 = response.data.total
-        } else {
-          this.see.list2 = []
-        }
-        setTimeout(() => {
-          this.see.listLoading2 = false
-        }, 100)
-      })
-    },
-    handleTabClick(val) {
-      if (val.name === 'first') {
-        this.getSeeList()
-      } else if (val.name === 'second') {
-        this.getSeeList2()
-      }
-    },
-    handleSearch1() {
-      console.log('点击了库存入库记录查询')
-      if (this.see.getdataListParm.parammaps.inputDatetime !== '' && this.see.getdataListParm.parammaps.inputDatetime !== null) {
-        this.see.getdataListParm.parammaps.startTime = parseTime(this.see.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.see.getdataListParm.parammaps.stopTime = parseTime(this.see.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.see.getdataListParm.parammaps.inputDatetime = ''
-        this.see.getdataListParm.parammaps.startTime = ''
-        this.see.getdataListParm.parammaps.stopTime = ''
-      }
-      this.getSeeList()
-    },
-    handleSearch2() {
-      console.log('点击了库存出库记录查询')
-      if (this.see.getdataListParm2.parammaps.inputDatetime !== '' && this.see.getdataListParm2.parammaps.inputDatetime !== null) {
-        this.see.getdataListParm2.parammaps.startTime = parseTime(this.see.getdataListParm2.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.see.getdataListParm2.parammaps.stopTime = parseTime(this.see.getdataListParm2.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.see.getdataListParm2.parammaps.inputDatetime = ''
-        this.see.getdataListParm2.parammaps.startTime = ''
-        this.see.getdataListParm2.parammaps.stopTime = ''
-      }
-      this.getSeeList2()
-    },
-    handleExport() {
-      console.log('点击了导出')
-      this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-      GetDataByName(this.download.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.download.list = response.data.list
-        } else {
-          this.download.list = []
-        }
-        var excelDatas = [
-          {
-            tHeader: ['饲料名称', '批号', '当前库存重量(kg)', '金额(元)'],
-            filterVal: ['feedname', 'pcpde', 'stockweight', 'sumprice'],
-            tableDatas: this.download.list,
-            sheetName: 'Sheet1'
-          }
-        ]
-        json2excel(excelDatas, '库存统计', true, 'xlsx')
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-  .search{margin-top:10px;}
-
-</style>

+ 0 - 410
src/views/inventoryManagement/systemConsumption/index改.vue

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

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

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

+ 66 - 46
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -7,11 +7,11 @@
       <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
         <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
       </el-select>
-      <el-select v-model="record" filterable placeholder="记录" class="filter-item" style="width: 150px;">
+      <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.barid" filterable placeholder="TMR编号" 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 v-if="record== '1'" v-model="table.getdataListParm.parammaps.eqcode" filterable placeholder="TMR编号" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.tname" :value="item.eqcode" />
       </el-select>
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
@@ -25,23 +25,14 @@
       </el-upload>
       <el-dropdown style="float: right;margin-right: 10px;">
         <el-button class="export" icon="el-icon-upload2">导出</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item  @click.native="handleExport(1)">导出模板</el-dropdown-item>
           <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
     </div>
     <div class="operation" v-else>
-      <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
-        <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
-      </el-upload>
-      <el-dropdown style="float: right;margin-right: 10px;">
-        <el-button class="export" icon="el-icon-upload2">导出</el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
-          <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
+        <el-button style="float: right;margin-right: 10px;" class="export" icon="el-icon-upload2" @click="handleExport(3)">导出</el-button>
     </div>
     <!-- 手动记录 -->
     <div class="table" v-if="record== '0'">
@@ -98,15 +89,15 @@
         :height="myHeight"
       >
         <el-table-column type="selection" align="center" width="50" />
-        <el-table-column label="TMR设备编号" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="TMR设备名称" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="TMR设备类型" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="栏舍名称" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="收集时间" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="剩料重量(kg)" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="开始重量(kg)" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="结束重量(kg)" min-width="150px" align="center" prop="remain" />
-        <el-table-column label="驾驶员" min-width="150px" align="center" prop="remain" />
+        <el-table-column label="TMR设备编号" min-width="150px" align="center" prop="eqcode" />
+        <el-table-column label="TMR设备名称" min-width="150px" align="center" prop="eqname" />
+        <el-table-column label="TMR设备类型" min-width="150px" align="center" prop="tclassname" />
+        <el-table-column label="栏舍名称" min-width="150px" align="center" prop="barname" />
+        <el-table-column label="收集时间" min-width="150px" align="center" prop="createtime" />
+        <el-table-column label="剩料重量(kg)" min-width="150px" align="center" prop="weight" />
+        <el-table-column label="开始重量(kg)" min-width="150px" align="center" prop="beginweight" />
+        <el-table-column label="结束重量(kg)" min-width="150px" align="center" prop="endweight" />
+        <el-table-column label="驾驶员" min-width="150px" align="center" prop="driver" />
       </el-table>
       <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
     </div>
@@ -203,7 +194,9 @@ export default {
       isRoleEdit: [],
       requestParams: [
         { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
-        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }},
+        { name: 'getTMRListEnableType', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'eqtype': '1' }},
+
       ],
       houseNameList: [], // 栏舍名称
       frequencyList: [], // 班次
@@ -327,7 +320,8 @@ export default {
     },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
-        this.houseNameList = response.data.getBarListEnable.list
+        this.houseNameList = response.data.getBarListEnable.list
+        this.TMRNumberList = response.data.getTMRListEnableType.list
         if (response.data.getSysoptEnable.list !== null) {
           for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
             const obj = {}
@@ -360,7 +354,15 @@ export default {
     },
 
     getList() {
-      this.table.listLoading = true
+      this.table.listLoading = true
+      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.table.getdataListParm.parammaps.inputDatetime = ''
+        this.table.getdataListParm.parammaps.startTime = ''
+        this.table.getdataListParm.parammaps.stopTime = ''
+      }
       GetDataByName(this.table.getdataListParm).then(response => {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
@@ -375,17 +377,18 @@ export default {
           this.table.listLoading = false
         }, 100)
       })
+    },
+    changeRecord(item){
+      if(item == '0'){
+        this.table.getdataListParm.name = 'getBarfeedremainList'
+      }else{
+        this.table.getdataListParm.name = 'getRemainplanrecord'
+      }
+      this.table.getdataListParm.offset = 1
+      this.getList()
     },
     handleSearch() {
       console.log('点击了查询')
-      if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
-        this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-        this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      } else {
-        this.table.getdataListParm.parammaps.inputDatetime = ''
-        this.table.getdataListParm.parammaps.startTime = ''
-        this.table.getdataListParm.parammaps.stopTime = ''
-      }
       this.table.getdataListParm.offset = 1
       this.getList()
     },
@@ -686,7 +689,12 @@ export default {
           window.URL.revokeObjectURL(url)
         })
       } else {
-        console.log('点击了导出数据')
+        console.log('点击了导出数据',item,this.record)
+        if(this.record == '0'){
+          this.download.getdataListParm.name = 'getBarfeedremainList'
+        }else{
+          this.download.getdataListParm.name = 'getRemainplanrecord'
+        }
         this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
         if (this.download.getdataListParm.parammaps.inputDatetime !== '' && this.download.getdataListParm.parammaps.inputDatetime !== null) {
           this.download.getdataListParm.parammaps.startTime = parseTime(this.download.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
@@ -701,16 +709,28 @@ export default {
             this.download.list = response.data.list
           } else {
             this.download.list = []
-          }
-          var excelDatas = [
-            {
-              tHeader: ['栏舍名称', '剩料量(kg)', '班次', '收集时间', '操作人'],
-              filterVal: ['barname', 'remain', 'timesstr', 'operatetime', 'emp'],
-              tableDatas: this.download.list,
-              sheetName: 'Sheet1'
-            }
-          ]
-          json2excel(excelDatas, '栏舍剩料记录', true, 'xlsx')
+          }
+           if(item== 2){
+              var excelDatas1 = [
+                {
+                  tHeader: ['栏舍名称', '剩料量(kg)', '班次', '收集时间', '操作人'],
+                  filterVal: ['barname', 'remain', 'timesstr', 'operatetime', 'emp'],
+                  tableDatas: this.download.list,
+                  sheetName: 'Sheet1'
+                }
+              ]
+              json2excel(excelDatas1, '栏舍剩料记录-手动记录', true, 'xlsx')
+           }else{
+             var excelDatas2 = [
+               {
+                 tHeader: ['TMR设备编号','TMR设备名称','TMR设备类型','栏舍名称','收集时间','剩料重量(kg)','开始重量(kg)','结束重量(kg)','驾驶员'],
+                 filterVal: ['eqcode','eqname','tclassname','barname','createtime','weight','beginweight','endweight','driver'],
+                 tableDatas: this.download.list,
+                 sheetName: 'Sheet1'
+               }
+             ]
+             json2excel(excelDatas2, '栏舍剩料记录-TMR设备自动记录', true, 'xlsx')
+           }
         })
       }
     },