|
@@ -1,2166 +1,2166 @@
|
|
|
-<template>
|
|
|
- <div class="app-container">
|
|
|
- <div class="operation">
|
|
|
- <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次
|
|
|
- </el-button>
|
|
|
- <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">减少车次</el-button>
|
|
|
- <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder" >{{$t('formulationEvaluation.ggsx')}}</el-button>
|
|
|
- <div v-else style="float: left;margin-left: 10px;">
|
|
|
- <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存 </el-button>
|
|
|
- <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">{{$t('formulationEvaluation.cancel')}}</el-button>
|
|
|
- </div>
|
|
|
- <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> 生效</el-button>
|
|
|
- <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> 禁用</el-button>
|
|
|
- <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
|
|
|
- <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency" >
|
|
|
- <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div class="table">
|
|
|
- <el-table
|
|
|
- id="table"
|
|
|
- :key="table.tableKey"
|
|
|
- ref="table"
|
|
|
- v-loading="table.listLoading"
|
|
|
- element-loading-text="给我一点时间"
|
|
|
- :data="table.list"
|
|
|
- border
|
|
|
- highlight-current-row
|
|
|
- style="width: 100%;"
|
|
|
- :height="height"
|
|
|
- :row-style="rowStyle"
|
|
|
- :cell-style="cellStyle"
|
|
|
- class="elTable"
|
|
|
- row-key="id"
|
|
|
- @selection-change="handleSelect"
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="50" />
|
|
|
- <el-table-column :label="$t('errorAnalysis.projname')" width="50px" align="center" class-name="small-padding fixed-width" fixed="">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.sort }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="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="$t('errorAnalysis.isTrainNumber')" 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 label="物料详情" width="90px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-popover
|
|
|
- placement="bottom"
|
|
|
- width="400"
|
|
|
- trigger="click">
|
|
|
- <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
|
|
|
- <el-table :data="materialdetailsList" border height="200">
|
|
|
- <el-table-column min-width="150" property="fname" label="物料" />
|
|
|
- <el-table-column min-width="100" property="fweight" label="重量" />
|
|
|
- <el-table-column min-width="100" property="scale" label="占比" />
|
|
|
- </el-table>
|
|
|
- <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">详情</span>
|
|
|
- </el-popover>
|
|
|
- </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="容量状态" width="90px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.volumeStatus == 1" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
|
|
|
- <span v-if="scope.row.volumeStatus == 2" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
|
|
|
- <span v-if="scope.row.volumeStatus == 0" style="color:green;">{{ scope.row.volumeStatusStr }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="element in scope.row.arrList" :key="element.name" class="list">
|
|
|
- <el-tooltip placement="top" :open-delay="1000">
|
|
|
- <div slot="content">
|
|
|
- <div> 栏舍全称:{{ element.barname }} </div>
|
|
|
- <div> 饲料重量:{{ element.weight }} </div>
|
|
|
- <div> 撒料车:{{ element.tmrname }} </div>
|
|
|
- </div>
|
|
|
- <div :style="{'background':element.background}" class="tmrname">{{ element.barname }}</div>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="$t('errorAnalysis.cz')" align="center" width="70" class-name="small-padding fixed-width" fixed="right">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
|
|
|
- <span v-if="isRoleEdit" class="centerSpan">|</span>
|
|
|
- <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <span
|
|
|
- v-if="table.listLoading == false"
|
|
|
- style="margin-right: 30px;margin-top: 10px;font-size: 14px;"
|
|
|
- >{{$t('processAnalysis.total')}}{{ table.total }}{{$t('processAnalysis.tiao')}}</span>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 新增、编辑 -->
|
|
|
- <el-dialog
|
|
|
- :fullscreen="dialogFull"
|
|
|
- :destroy-on-close="true"
|
|
|
- :visible.sync="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()">{{$t('common.closed')}}</el-button>
|
|
|
- <el-button
|
|
|
- v-if="create.dialogStatus==='create'"
|
|
|
- class="save"
|
|
|
- :disabled="isokDisable"
|
|
|
- @click="distributionAndSpreading()"
|
|
|
- >分配撒料</el-button>
|
|
|
- </div>
|
|
|
- <!-- 栏舍 -->
|
|
|
- <div v-if="create.dialogStatus =='update' || isDispaly" class="bottom" style="border-top: 1px solid #009C69;">
|
|
|
- <el-row>
|
|
|
- <el-col :span="20">
|
|
|
- <div class="fenceHouse">
|
|
|
- <ul v-loading="create.listLoadingTimes" class="fenceHouseList">
|
|
|
- <li v-for="element in create.list1" :key="element.arrid">
|
|
|
- <span v-if="element.isShowTitle" class="fenceHouseTitle">{{ element.ftname }}:</span>
|
|
|
- <div v-for="item in element.arrList" :key="item.id" class="colorBlock">
|
|
|
- <div style="position: relative;">
|
|
|
- <el-tooltip
|
|
|
- placement="top"
|
|
|
- style="height: 18px;line-height: 18px;"
|
|
|
- :style="{'background':item.background}"
|
|
|
- >
|
|
|
- <div slot="content">{{ item.barname }}</div>
|
|
|
- <div class="barname">
|
|
|
- <span
|
|
|
- style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"
|
|
|
- >{{ item.barname }}</span>
|
|
|
- <button style="background: red;float: right;width: 18px;color: #fff;font-size: 18px;border: none;text-align: center;" :disabled="isokDisable" @click="clickBar(item)">√</button>
|
|
|
- </div>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip placement="bottom" style="height: 18px;line-height: 18px;" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
|
|
|
- <div slot="content">{{ item.weight }}</div>
|
|
|
- <div class="barWeight">
|
|
|
- <span style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ item.weight }}</span>
|
|
|
- <el-popover
|
|
|
- placement="right"
|
|
|
- width="400"
|
|
|
- trigger="click">
|
|
|
- <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
|
|
|
- <el-table :data="materialdetailsList" height="200" border>
|
|
|
- <el-table-column min-width="150" property="fname" label="物料" />
|
|
|
- <el-table-column min-width="100" property="fweight" label="重量" />
|
|
|
- <el-table-column min-width="100" property="scale" label="占比" />
|
|
|
- </el-table>
|
|
|
- <!-- <span style="color: blue;">详情</span> -->
|
|
|
- <button slot="reference" style="background: #ccc;float: right;color: #fff;width: 18px;height:18px;font-size: 16px;border: none;text-align: center;" :disabled="isokDisable">?</button>
|
|
|
- </el-popover>
|
|
|
- </div>
|
|
|
- </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.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
|
|
|
- <!-- <div class="maxweight" style="line-height:20px;"><b>最大重量:</b>{{ create.temp.maxweight }} (KG)</div> -->
|
|
|
- <div class="sumweight" style="line-height:20px;margin-top: 10px;"> <b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
|
|
|
- <div class="sumweight" style="line-height:20px;margin-top: 10px;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
|
|
|
- <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>容积量:</b>{{ create.temp.volume }} m³ </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <!-- 撒料 -->
|
|
|
- <div class="spreadingMaterial">
|
|
|
- <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
|
|
|
- <div class="spreadingMaterialList">
|
|
|
- <!-- force-fallback="true" -->
|
|
|
- <draggable
|
|
|
- :disabled="isDropState"
|
|
|
- id="1"
|
|
|
- data-source="juju"
|
|
|
- :list="create.list2"
|
|
|
- class="list-group1"
|
|
|
- draggable=".item"
|
|
|
- group="a"
|
|
|
- animation="500"
|
|
|
- :move="move1"
|
|
|
- @change="changeLog1"
|
|
|
- @start="start1"
|
|
|
- @end="end1"
|
|
|
- >
|
|
|
- <div v-for="element in create.list2" :key="element.name" class="list-group-item2 item">
|
|
|
- <div class="arr-l" :style="{'background':element.tbackground}">
|
|
|
- <div class="arr-l-t">
|
|
|
- <div class="arr-l-t-t" />
|
|
|
- <el-select
|
|
|
- v-model="element.tmrid"
|
|
|
- placeholder="撒料设备"
|
|
|
- class="arr-l-t-b el-icon-arrow-down"
|
|
|
- @change="(value)=> {changeEquipment(value, element.fttype,element.id)}"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in equipmentList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.tname"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div class="arr-l-b">
|
|
|
- <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
|
|
|
- <div slot="content">{{ element.tmrname }}</div>
|
|
|
- <div class="tmrname">{{ element.tmrname }}</div>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div>
|
|
|
- </div>
|
|
|
- <div class="arr-r">
|
|
|
- <div class="arr-r-l">
|
|
|
- <el-tooltip placement="top">
|
|
|
- <div slot="content">{{ element.barname }}</div>
|
|
|
- <div class="barname">{{ element.barname }}</div>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- <div class="arr-r-c">-</div>
|
|
|
- <div class="arr-r-r">
|
|
|
- <el-tooltip placement="top">
|
|
|
- <div slot="content">{{ element.weight }}</div>
|
|
|
- <input
|
|
|
- ref="weight"
|
|
|
- v-model="element.weight"
|
|
|
- :autofocus="element.focusState"
|
|
|
- type="number"
|
|
|
- :placeholder="$t('formulationEvaluation.reset')"
|
|
|
- step="0.01"
|
|
|
- class="filter-item2"
|
|
|
- style="display: inline-block;height:25px;padding:4px 4px 4px 0;text-align:right;font-size:12px;width: 95%;border: 1px solid #e6e6e6;"
|
|
|
- @keyup.enter="$event.target.blur"
|
|
|
- @focus="focusWeight"
|
|
|
- @blur="blurWeight(element)"
|
|
|
- >
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="arr-t" :style="{'background':element.background}">
|
|
|
- <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
|
|
|
- <el-popover
|
|
|
- placement="bottom"
|
|
|
- width="400"
|
|
|
- height="200"
|
|
|
- trigger="click">
|
|
|
- <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
|
|
|
- <el-table :data="materialdetailsList" height="200" border>
|
|
|
- <el-table-column min-width="150" property="fname" label="物料" />
|
|
|
- <el-table-column min-width="100" property="fweight" label="重量" />
|
|
|
- <el-table-column min-width="100" property="scale" label="占比" />
|
|
|
- </el-table>
|
|
|
- <i slot="reference" class="el-icon-question" style="position: absolute;right: 0;top: 20px;"/>
|
|
|
- </el-popover>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </draggable>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div slot="footer" class="dialog-footer" style="height:55px;">
|
|
|
- <el-button class="cancelClose" :disabled="isokDisable" @click="close()" style="top:40px;">{{$t('common.closed')}}</el-button>
|
|
|
- <el-button class="save" :disabled="isokDisable" @click="updateData()" style="top:40px;">{{$t('errorAnalysis.confirm')}}</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 更改TMR编号 -->
|
|
|
- <el-dialog
|
|
|
- :title="textMap[tmrNumber.dialogStatus]"
|
|
|
- :destroy-on-close="true"
|
|
|
- :visible.sync="tmrNumber.dialogFormVisible"
|
|
|
- :before-close="close"
|
|
|
- :close-on-click-modal="false"
|
|
|
- width="30%"
|
|
|
- :modal-append-to-body="false"
|
|
|
- :append-to-body="true">
|
|
|
- <h3 style="text-align: center;">是否要改变TMR设备?</h3>
|
|
|
- <div class="tmrNumber" style="padding: 10px 30px;">
|
|
|
- <p>注:更换TMR撒料设备,变更后的装载重量不同,请选择处理方式</p>
|
|
|
- <el-radio v-model="tmrNumber.radio" label="0">1、多出的饲料平均从已分配的各栏舍中扣减。</el-radio><br/><br/>
|
|
|
- <el-radio v-model="tmrNumber.radio" label="1">2、多出的饲料从最后一个栏舍依次往前扣减。</el-radio><br/><br/>
|
|
|
- <el-radio v-model="tmrNumber.radio" label="2">3、清空已分配的撒料车。</el-radio>
|
|
|
- </div>
|
|
|
- <div slot="footer" class="dialog-footer" style="bottom: 10px;">
|
|
|
- <el-button class="cancelClose" :disabled="isokDisable" @click="closeTmrNumber">否</el-button>
|
|
|
- <el-button class="save" :disabled="isokDisable" @click="tmrNumberData()">是</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </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高度
|
|
|
- materialdetailsList: [],
|
|
|
- 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: '编辑',
|
|
|
- tmrNumber:''
|
|
|
- },
|
|
|
- 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,
|
|
|
- tmrNumber:{
|
|
|
- dialogFormVisible: false,
|
|
|
- dialogStatus: '',
|
|
|
- temp:{},
|
|
|
- radio:'0'
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- 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 url2 = 'authdata/tmrListEnableTypeAll'
|
|
|
- const data2 = {
|
|
|
- parammaps: {
|
|
|
- pastureid: Cookies.get('pastureid')
|
|
|
- }
|
|
|
- }
|
|
|
- postJson(url2, data2).then(response => {
|
|
|
- if (response.data !== null) {
|
|
|
- this.equipmentList = response.data
|
|
|
- if(this.create.dialogStatus == 'update'){
|
|
|
- if(this.equipmentList.find(obj => obj.id == this.create.temp.tmrid) !== undefined){
|
|
|
- this.create.temp.tclassname = this.equipmentList.find(obj => obj.id == this.create.temp.tmrid).tclassname
|
|
|
- }else{
|
|
|
- this.create.temp.tclassname = '固定式'
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.equipmentList = []
|
|
|
- }
|
|
|
- })
|
|
|
- const data3 = {
|
|
|
- name: 'getFTSWList',
|
|
|
- offset: 0,
|
|
|
- parammaps: {
|
|
|
- pastureid: Cookies.get('pastureid')
|
|
|
- }
|
|
|
- }
|
|
|
- postJson(url, data3).then(response => {
|
|
|
- if (response.data !== null) {
|
|
|
- this.templateFormulationList = response.data.list
|
|
|
- } else {
|
|
|
- this.templateFormulationList = []
|
|
|
- }
|
|
|
- })
|
|
|
- const data4 = {
|
|
|
- name: 'getSysoptEnable',
|
|
|
- offset: 0,
|
|
|
- parammaps: {
|
|
|
- pastureid: Cookies.get('pastureid'),
|
|
|
- inforname: 'isSmallMaterial'
|
|
|
- }
|
|
|
- }
|
|
|
- postJson(url, data4).then(response => {
|
|
|
- if (response.data !== null) {
|
|
|
- if (response.data.list[0].inforvalue == 0) {
|
|
|
- this.isInforvalue = false
|
|
|
- } else {
|
|
|
- this.isInforvalue = true
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.isInforvalue = false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getIsDisplay() {
|
|
|
- const url = 'authdata/GetDataByName'
|
|
|
- const data = this.maxTime.getMaxTimesParm
|
|
|
- postJson(url, data).then(response => {
|
|
|
- console.log(response.data.list[0].inforvalue)
|
|
|
- if (response.data.list[0].inforvalue == 1) {
|
|
|
- this.frequencyList = [{ id: 1, name: this.$t('errorAnalysis.one'), }]
|
|
|
- } else if (response.data.list[0].inforvalue == 2) {
|
|
|
- this.frequencyList = [
|
|
|
- { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
- { id: 2, name: this.$t('errorAnalysis.two'), }
|
|
|
- ]
|
|
|
- } else if (response.data.list[0].inforvalue == 3) {
|
|
|
- this.frequencyList = [
|
|
|
- { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
- { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
- { id: 3, name: this.$t('errorAnalysis.three'), }
|
|
|
- ]
|
|
|
- } else if (response.data.list[0].inforvalue == 4) {
|
|
|
- this.frequencyList = [
|
|
|
- { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
- { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
- { id: 3, name: this.$t('errorAnalysis.three'), },
|
|
|
- { id: 4, name: this.$t('errorAnalysis.four'), }
|
|
|
- ]
|
|
|
- }else if (response.data.list[0].inforvalue == 5) {
|
|
|
- this.frequencyList = [
|
|
|
- { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
- { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
- { id: 3, name: this.$t('errorAnalysis.three'), },
|
|
|
- { id: 4, name: this.$t('errorAnalysis.four'), },
|
|
|
- { id: 5, name: this.$t('errorAnalysis.five'), }
|
|
|
- ]
|
|
|
- }else if (response.data.list[0].inforvalue == 6) {
|
|
|
- this.frequencyList = [
|
|
|
- { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
- { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
- { id: 3, name: this.$t('errorAnalysis.three'), },
|
|
|
- { id: 4, name: this.$t('errorAnalysis.four'), },
|
|
|
- { id: 5, name: this.$t('errorAnalysis.five'), },
|
|
|
- { id: 6, name: this.$t('errorAnalysis.six'), }
|
|
|
- ]
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- 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.create.temp.ftvolume = this.templateFormulationList.find(obj => obj.id === item).volume
|
|
|
- this.getCreateList1()
|
|
|
- var obj = {
|
|
|
- 'pastureid':this.create.temp.pastureid,
|
|
|
- 'ftid':this.create.temp.ftid
|
|
|
- }
|
|
|
- this.getmaterialdetailsList(obj)
|
|
|
- },
|
|
|
- changeTimes(item) {
|
|
|
- this.getCreateList1()
|
|
|
- },
|
|
|
- // TMR编号
|
|
|
- changeTMRNumber(item) {
|
|
|
- console.log(this.create.temp.tmrid,'this.create.temp.tmrid111')
|
|
|
- if (this.create.list2.length > 0) {
|
|
|
- // 备份
|
|
|
- // MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
|
|
|
- // confirmButtonText: '是',
|
|
|
- // cancelButtonText: '否',
|
|
|
- // type: 'warning'
|
|
|
- // }).then(() => {
|
|
|
- // this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
- // this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
|
- // this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
|
|
|
- // this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
|
|
|
- // this.create.temp.mytmrid = this.create.temp.tmrid
|
|
|
- // this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
- // console.log('tmrname==>', this.create.temp)
|
|
|
- // if (this.isDispaly || this.create.dialogStatus == 'update') {
|
|
|
- // this.getClearList()
|
|
|
- // }
|
|
|
- // }).catch(() => {
|
|
|
- // console.log(this.create.temp,'====')
|
|
|
- // if(this.create.temp.tclassname == '固定式'){
|
|
|
- // console.log( this.create.temp,'====')
|
|
|
- // this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
- // }
|
|
|
- // this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
- // this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
- // this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
- // this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
- // this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
- // this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
- // console.log(this.create.temp)
|
|
|
- // this.$message({ type: 'info', message: '已取消' })
|
|
|
- // })
|
|
|
- // 备份
|
|
|
- this.tmrNumber.dialogFormVisible = true
|
|
|
- this.tmrNumber.dialogStatus = 'tmrNumber'
|
|
|
- this.tmrNumber.radio = '0'
|
|
|
- } else {
|
|
|
- this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
- this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
|
- this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
|
|
|
- this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
|
|
|
- this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === item).tmrvolume
|
|
|
- this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === item).maxVolume
|
|
|
- this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === item).minVolume
|
|
|
- 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)
|
|
|
- }
|
|
|
- },
|
|
|
- tmrNumberData(){
|
|
|
- if(this.tmrNumber.radio == '0'){
|
|
|
- console.log('1、多出的饲料平均从已分配的各栏舍中扣减。')
|
|
|
- }else if(this.tmrNumber.radio == '1'){
|
|
|
- console.log('2、多出的饲料从最后一个栏舍依次往前扣减。')
|
|
|
- }else if(this.tmrNumber.radio == '2'){
|
|
|
- console.log('3、清空已分配的撒料车。')
|
|
|
- }
|
|
|
- const url = 'authdata/materialtmr/date/edit'
|
|
|
- const data = {
|
|
|
- tmrid:this.create.temp.tmrid2,
|
|
|
- tmrtype: this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassid,
|
|
|
- lppid:this.create.temp.id,
|
|
|
- times:this.create.temp.times,
|
|
|
- pastureid:Cookies.get('pastureid'),
|
|
|
- status:this.tmrNumber.radio,
|
|
|
- date:this.date
|
|
|
- }
|
|
|
- postJson(url, data).then(response => {
|
|
|
- if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
- } else {
|
|
|
- this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
|
|
|
- this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
- this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
- this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tmrvolume
|
|
|
- this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxVolume
|
|
|
- this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).minVolume
|
|
|
- this.tmrNumber.dialogFormVisible = false
|
|
|
- this.getCreateList1()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- closeTmrNumber(){
|
|
|
- if(this.create.temp.tclassname == '固定式'){
|
|
|
- console.log( this.create.temp,'====')
|
|
|
- this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
- }
|
|
|
- this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
- this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
- this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
- this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
- this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
- this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
- this.tmrNumber.dialogFormVisible = false
|
|
|
- },
|
|
|
- getClearList() {
|
|
|
- const url = 'authdata/lpplandtl/del/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,
|
|
|
- volume: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)
|
|
|
- if(parseFloat(this.create.temp.ftvolume) !== 0 && parseFloat(this.create.temp.sumweight) !== 0){
|
|
|
- this.create.temp.volume = (parseFloat(this.create.temp.sumweight) / parseFloat(this.create.temp.ftvolume)).toFixed(2)
|
|
|
- }else{
|
|
|
- this.create.temp.volume = 0
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.create.list2 = []
|
|
|
- // this.create.temp.sort = 0
|
|
|
- this.create.temp.sumweight = 0
|
|
|
- this.create.temp.volume = 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)
|
|
|
- // }
|
|
|
- console.log(this.create.temp.tclassname,'this.create.temp.tclassname')
|
|
|
- if(this.create.temp.tclassname == '固定式'){
|
|
|
- if(this.equipmentList.find(obj => obj.tclassname == '任意车1') !== undefined){
|
|
|
- this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车1').eqcode
|
|
|
- this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车1').id
|
|
|
- }
|
|
|
- }
|
|
|
- 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': '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()
|
|
|
- })
|
|
|
- })
|
|
|
- console.log(this.create.temp.tmrid,'66666')
|
|
|
- },
|
|
|
- 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()
|
|
|
- this.getmaterialdetailsList(row)
|
|
|
- },
|
|
|
- updateData() {
|
|
|
- this.$refs['temp'].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.isokDisable = true
|
|
|
- setTimeout(() => {
|
|
|
- this.isokDisable = false
|
|
|
- }, 1000)
|
|
|
- var tip = ''
|
|
|
- if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.tmrvolume)){
|
|
|
- tip = '装载量已超过车辆容量' + this.create.temp.tmrvolume + 'm³,请确认'
|
|
|
- MessageBox.confirm(tip, {
|
|
|
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.save_updateData()
|
|
|
- })
|
|
|
- }else if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.maxVolume)){
|
|
|
- tip = '装载量不可超过车辆容量' + this.create.temp.maxVolume + 'm³,请确认'
|
|
|
- MessageBox.confirm(tip, {
|
|
|
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.save_updateData()
|
|
|
- })
|
|
|
- }else if(parseFloat(this.create.temp.volume) < parseFloat(this.create.temp.minVolume)){
|
|
|
- tip = '装载量不可低于车辆容量' + this.create.temp.minVolume + 'm³,请确认'
|
|
|
- MessageBox.confirm(tip, {
|
|
|
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.save_updateData()
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.save_updateData()
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- save_updateData(){
|
|
|
- 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.tmrid2
|
|
|
- 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 })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- 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.id = obj.id
|
|
|
- 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 })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- 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()
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- handleAllEmpty(){
|
|
|
- MessageBox.confirm('执行该操作会将现有车次已分配的撒料栏舍全部清空,是否要执行该操作?', {
|
|
|
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.requestParam = {}
|
|
|
- this.requestParam.common = { 'returnmap': '0' }
|
|
|
- this.requestParam.data = []
|
|
|
- this.requestParam.data[0] = { 'name': 'deleteLpplandtl1dateAll', 'type': 'e', 'parammaps': { pastureid: Cookies.get('pastureid'),date:this.date }},
|
|
|
- this.requestParam.data[1] = { 'name': 'deletefpdetaildateAll', 'type': 'e', 'parammaps': { pastureid: Cookies.get('pastureid'),date:this.date }},
|
|
|
- ExecDataByConfig(this.requestParam).then(response => {
|
|
|
- console.log('清空已分配栏舍', this.requestParam)
|
|
|
- if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
- } else {
|
|
|
- this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
|
|
|
- this.getList()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- getmaterialdetailsList(item){
|
|
|
- let url = 'authdata/GetDataByName'
|
|
|
- let data = {
|
|
|
- name:"getFTdetailList",page:1,offset:1,pagecount:"",returntype:"Map",
|
|
|
- parammaps:{
|
|
|
- pastureid:item.pastureid,ftid:item.ftid,
|
|
|
- // fttypeid:item.fttypeid,
|
|
|
- }
|
|
|
- }
|
|
|
- postJson(url, data).then(response => {
|
|
|
- if (response.msg !== 'fail') {
|
|
|
- this.materialdetailsList = response.data.list
|
|
|
- } else {
|
|
|
- this.materialdetailsList = []
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</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>
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <div class="operation">
|
|
|
+ <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" style="float:left;" @click="handleCreate">新增车次
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float:left;" @click="handleReduceTrains">{{$t('premixedPlan.jscc')}}</el-button>
|
|
|
+ <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder" >{{$t('formulationEvaluation.ggsx')}}</el-button>
|
|
|
+ <div v-else style="float: left;margin-left: 10px;">
|
|
|
+ <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存 </el-button>
|
|
|
+ <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">{{$t('formulationEvaluation.cancel')}}</el-button>
|
|
|
+ </div>
|
|
|
+ <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" style="float: left;" @click="handleTakeEffect"> {{$t('premixedPlan.sx')}}</el-button>
|
|
|
+ <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" style="float: left;" @click="handleDisable"> {{$t('premixedPlan.jy')}}</el-button>
|
|
|
+ <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" style="float: left;" @click="handleAllEmpty"> 清空已分配栏舍</el-button>
|
|
|
+ <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency" >
|
|
|
+ <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="table">
|
|
|
+ <el-table
|
|
|
+ id="table"
|
|
|
+ :key="table.tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="table.listLoading"
|
|
|
+ element-loading-text="给我一点时间"
|
|
|
+ :data="table.list"
|
|
|
+ border
|
|
|
+ highlight-current-row
|
|
|
+ style="width: 100%;"
|
|
|
+ :height="height"
|
|
|
+ :row-style="rowStyle"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ class="elTable"
|
|
|
+ row-key="id"
|
|
|
+ @selection-change="handleSelect"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="50" />
|
|
|
+ <el-table-column :label="$t('errorAnalysis.projname')" width="50px" align="center" class-name="small-padding fixed-width" fixed="">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.sort }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('premixedPlan.tmrbh')" width="110px" align="center" class-name="small-padding fixed-width" fixed="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.tmrname }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="描述" width="110px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.display }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('premixedPlan.sx')" width="70px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.sel"
|
|
|
+ disabled
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('errorAnalysis.isTrainNumber')" width="65px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.timesstr }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('premixedPlan.time')" width="55px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.begintime }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="最大重量" width="75px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.maxweight }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="合计重量" width="80px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.sumweight }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="模板配方" width="90px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.ftname }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物料详情" width="90px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="400"
|
|
|
+ trigger="click">
|
|
|
+ <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
|
|
|
+ <el-table :data="materialdetailsList" border height="200">
|
|
|
+ <el-table-column min-width="150" property="fname" label="物料" />
|
|
|
+ <el-table-column min-width="100" property="fweight" label="重量" />
|
|
|
+ <el-table-column min-width="100" property="scale" label="占比" />
|
|
|
+ </el-table>
|
|
|
+ <span slot="reference" style="color: blue;" @click="getmaterialdetailsList(scope.row)">详情</span>
|
|
|
+ </el-popover>
|
|
|
+ </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="容量状态" width="90px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.volumeStatus == 1" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
|
|
|
+ <span v-if="scope.row.volumeStatus == 2" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
|
|
|
+ <span v-if="scope.row.volumeStatus == 0" style="color:green;">{{ scope.row.volumeStatusStr }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-for="element in scope.row.arrList" :key="element.name" class="list">
|
|
|
+ <el-tooltip placement="top" :open-delay="1000">
|
|
|
+ <div slot="content">
|
|
|
+ <div> 栏舍全称:{{ element.barname }} </div>
|
|
|
+ <div> 饲料重量:{{ element.weight }} </div>
|
|
|
+ <div> 撒料车:{{ element.tmrname }} </div>
|
|
|
+ </div>
|
|
|
+ <div :style="{'background':element.background}" class="tmrname">{{ element.barname }}</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('errorAnalysis.cz')" align="center" width="70" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
|
|
|
+ <span v-if="isRoleEdit" class="centerSpan">|</span>
|
|
|
+ <el-button v-if="isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <span
|
|
|
+ v-if="table.listLoading == false"
|
|
|
+ style="margin-right: 30px;margin-top: 10px;font-size: 14px;"
|
|
|
+ >{{$t('processAnalysis.total')}}{{ table.total }}{{$t('processAnalysis.tiao')}}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 新增、编辑 -->
|
|
|
+ <el-dialog
|
|
|
+ :fullscreen="dialogFull"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :visible.sync="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()">{{$t('common.closed')}}</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="create.dialogStatus==='create'"
|
|
|
+ class="save"
|
|
|
+ :disabled="isokDisable"
|
|
|
+ @click="distributionAndSpreading()"
|
|
|
+ >分配撒料</el-button>
|
|
|
+ </div>
|
|
|
+ <!-- 栏舍 -->
|
|
|
+ <div v-if="create.dialogStatus =='update' || isDispaly" class="bottom" style="border-top: 1px solid #009C69;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="20">
|
|
|
+ <div class="fenceHouse">
|
|
|
+ <ul v-loading="create.listLoadingTimes" class="fenceHouseList">
|
|
|
+ <li v-for="element in create.list1" :key="element.arrid">
|
|
|
+ <span v-if="element.isShowTitle" class="fenceHouseTitle">{{ element.ftname }}:</span>
|
|
|
+ <div v-for="item in element.arrList" :key="item.id" class="colorBlock">
|
|
|
+ <div style="position: relative;">
|
|
|
+ <el-tooltip
|
|
|
+ placement="top"
|
|
|
+ style="height: 18px;line-height: 18px;"
|
|
|
+ :style="{'background':item.background}"
|
|
|
+ >
|
|
|
+ <div slot="content">{{ item.barname }}</div>
|
|
|
+ <div class="barname">
|
|
|
+ <span
|
|
|
+ style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"
|
|
|
+ >{{ item.barname }}</span>
|
|
|
+ <button style="background: red;float: right;width: 18px;color: #fff;font-size: 18px;border: none;text-align: center;" :disabled="isokDisable" @click="clickBar(item)">√</button>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip placement="bottom" style="height: 18px;line-height: 18px;" :style="{ background: 'rgba('+item.background2+ ',0.1)' }">
|
|
|
+ <div slot="content">{{ item.weight }}</div>
|
|
|
+ <div class="barWeight">
|
|
|
+ <span style="float: left;width: 70px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ item.weight }}</span>
|
|
|
+ <el-popover
|
|
|
+ placement="right"
|
|
|
+ width="400"
|
|
|
+ trigger="click">
|
|
|
+ <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
|
|
|
+ <el-table :data="materialdetailsList" height="200" border>
|
|
|
+ <el-table-column min-width="150" property="fname" label="物料" />
|
|
|
+ <el-table-column min-width="100" property="fweight" label="重量" />
|
|
|
+ <el-table-column min-width="100" property="scale" label="占比" />
|
|
|
+ </el-table>
|
|
|
+ <!-- <span style="color: blue;">详情</span> -->
|
|
|
+ <button slot="reference" style="background: #ccc;float: right;color: #fff;width: 18px;height:18px;font-size: 16px;border: none;text-align: center;" :disabled="isokDisable">?</button>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ </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.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
|
|
|
+ <!-- <div class="maxweight" style="line-height:20px;"><b>最大重量:</b>{{ create.temp.maxweight }} (KG)</div> -->
|
|
|
+ <div class="sumweight" style="line-height:20px;margin-top: 10px;"> <b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
|
|
|
+ <div class="sumweight" style="line-height:20px;margin-top: 10px;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
|
|
|
+ <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>容积量:</b>{{ create.temp.volume }} m³ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- 撒料 -->
|
|
|
+ <div class="spreadingMaterial">
|
|
|
+ <div>撒料:<el-button type="danger" @click="handleEmpty">清空</el-button></div>
|
|
|
+ <div class="spreadingMaterialList">
|
|
|
+ <!-- force-fallback="true" -->
|
|
|
+ <draggable
|
|
|
+ :disabled="isDropState"
|
|
|
+ id="1"
|
|
|
+ data-source="juju"
|
|
|
+ :list="create.list2"
|
|
|
+ class="list-group1"
|
|
|
+ draggable=".item"
|
|
|
+ group="a"
|
|
|
+ animation="500"
|
|
|
+ :move="move1"
|
|
|
+ @change="changeLog1"
|
|
|
+ @start="start1"
|
|
|
+ @end="end1"
|
|
|
+ >
|
|
|
+ <div v-for="element in create.list2" :key="element.name" class="list-group-item2 item">
|
|
|
+ <div class="arr-l" :style="{'background':element.tbackground}">
|
|
|
+ <div class="arr-l-t">
|
|
|
+ <div class="arr-l-t-t" />
|
|
|
+ <el-select
|
|
|
+ v-model="element.tmrid"
|
|
|
+ placeholder="撒料设备"
|
|
|
+ class="arr-l-t-b el-icon-arrow-down"
|
|
|
+ @change="(value)=> {changeEquipment(value, element.fttype,element.id)}"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in equipmentList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.tname"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="arr-l-b">
|
|
|
+ <el-tooltip placement="top" class="list-group-item1 item" style="height: 18px;line-height: 18px;">
|
|
|
+ <div slot="content">{{ element.tmrname }}</div>
|
|
|
+ <div class="tmrname">{{ element.tmrname }}</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <div v-if="element.fttype==0" style="background: #009C69;position:absolute;bottom: 0;left: 0;">补</div>
|
|
|
+ </div>
|
|
|
+ <div class="arr-r">
|
|
|
+ <div class="arr-r-l">
|
|
|
+ <el-tooltip placement="top">
|
|
|
+ <div slot="content">{{ element.barname }}</div>
|
|
|
+ <div class="barname">{{ element.barname }}</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <div class="arr-r-c">-</div>
|
|
|
+ <div class="arr-r-r">
|
|
|
+ <el-tooltip placement="top">
|
|
|
+ <div slot="content">{{ element.weight }}</div>
|
|
|
+ <input
|
|
|
+ ref="weight"
|
|
|
+ v-model="element.weight"
|
|
|
+ :autofocus="element.focusState"
|
|
|
+ type="number"
|
|
|
+ :placeholder="$t('formulationEvaluation.reset')"
|
|
|
+ step="0.01"
|
|
|
+ class="filter-item2"
|
|
|
+ style="display: inline-block;height:25px;padding:4px 4px 4px 0;text-align:right;font-size:12px;width: 95%;border: 1px solid #e6e6e6;"
|
|
|
+ @keyup.enter="$event.target.blur"
|
|
|
+ @focus="focusWeight"
|
|
|
+ @blur="blurWeight(element)"
|
|
|
+ >
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="arr-t" :style="{'background':element.background}">
|
|
|
+ <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="400"
|
|
|
+ height="200"
|
|
|
+ trigger="click">
|
|
|
+ <b style="text-align: center;width:100%;display:inline-block;">物料详情</b>
|
|
|
+ <el-table :data="materialdetailsList" height="200" border>
|
|
|
+ <el-table-column min-width="150" property="fname" label="物料" />
|
|
|
+ <el-table-column min-width="100" property="fweight" label="重量" />
|
|
|
+ <el-table-column min-width="100" property="scale" label="占比" />
|
|
|
+ </el-table>
|
|
|
+ <i slot="reference" class="el-icon-question" style="position: absolute;right: 0;top: 20px;"/>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer" style="height:55px;">
|
|
|
+ <el-button class="cancelClose" :disabled="isokDisable" @click="close()" style="top:40px;">{{$t('common.closed')}}</el-button>
|
|
|
+ <el-button class="save" :disabled="isokDisable" @click="updateData()" style="top:40px;">{{$t('errorAnalysis.confirm')}}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 更改TMR编号 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="textMap[tmrNumber.dialogStatus]"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :visible.sync="tmrNumber.dialogFormVisible"
|
|
|
+ :before-close="close"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="30%"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :append-to-body="true">
|
|
|
+ <h3 style="text-align: center;">是否要改变TMR设备?</h3>
|
|
|
+ <div class="tmrNumber" style="padding: 10px 30px;">
|
|
|
+ <p>注:更换TMR撒料设备,变更后的装载重量不同,请选择处理方式</p>
|
|
|
+ <el-radio v-model="tmrNumber.radio" label="0">1、多出的饲料平均从已分配的各栏舍中扣减。</el-radio><br/><br/>
|
|
|
+ <el-radio v-model="tmrNumber.radio" label="1">2、多出的饲料从最后一个栏舍依次往前扣减。</el-radio><br/><br/>
|
|
|
+ <el-radio v-model="tmrNumber.radio" label="2">3、清空已分配的撒料车。</el-radio>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer" style="bottom: 10px;">
|
|
|
+ <el-button class="cancelClose" :disabled="isokDisable" @click="closeTmrNumber">否</el-button>
|
|
|
+ <el-button class="save" :disabled="isokDisable" @click="tmrNumberData()">是</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </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高度
|
|
|
+ materialdetailsList: [],
|
|
|
+ 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: '编辑',
|
|
|
+ tmrNumber:''
|
|
|
+ },
|
|
|
+ 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,
|
|
|
+ tmrNumber:{
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dialogStatus: '',
|
|
|
+ temp:{},
|
|
|
+ radio:'0'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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 url2 = 'authdata/tmrListEnableTypeAll'
|
|
|
+ const data2 = {
|
|
|
+ parammaps: {
|
|
|
+ pastureid: Cookies.get('pastureid')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ postJson(url2, data2).then(response => {
|
|
|
+ if (response.data !== null) {
|
|
|
+ this.equipmentList = response.data
|
|
|
+ if(this.create.dialogStatus == 'update'){
|
|
|
+ if(this.equipmentList.find(obj => obj.id == this.create.temp.tmrid) !== undefined){
|
|
|
+ this.create.temp.tclassname = this.equipmentList.find(obj => obj.id == this.create.temp.tmrid).tclassname
|
|
|
+ }else{
|
|
|
+ this.create.temp.tclassname = '固定式'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.equipmentList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const data3 = {
|
|
|
+ name: 'getFTSWList',
|
|
|
+ offset: 0,
|
|
|
+ parammaps: {
|
|
|
+ pastureid: Cookies.get('pastureid')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ postJson(url, data3).then(response => {
|
|
|
+ if (response.data !== null) {
|
|
|
+ this.templateFormulationList = response.data.list
|
|
|
+ } else {
|
|
|
+ this.templateFormulationList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const data4 = {
|
|
|
+ name: 'getSysoptEnable',
|
|
|
+ offset: 0,
|
|
|
+ parammaps: {
|
|
|
+ pastureid: Cookies.get('pastureid'),
|
|
|
+ inforname: 'isSmallMaterial'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ postJson(url, data4).then(response => {
|
|
|
+ if (response.data !== null) {
|
|
|
+ if (response.data.list[0].inforvalue == 0) {
|
|
|
+ this.isInforvalue = false
|
|
|
+ } else {
|
|
|
+ this.isInforvalue = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isInforvalue = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getIsDisplay() {
|
|
|
+ const url = 'authdata/GetDataByName'
|
|
|
+ const data = this.maxTime.getMaxTimesParm
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ console.log(response.data.list[0].inforvalue)
|
|
|
+ if (response.data.list[0].inforvalue == 1) {
|
|
|
+ this.frequencyList = [{ id: 1, name: this.$t('errorAnalysis.one'), }]
|
|
|
+ } else if (response.data.list[0].inforvalue == 2) {
|
|
|
+ this.frequencyList = [
|
|
|
+ { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
+ { id: 2, name: this.$t('errorAnalysis.two'), }
|
|
|
+ ]
|
|
|
+ } else if (response.data.list[0].inforvalue == 3) {
|
|
|
+ this.frequencyList = [
|
|
|
+ { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
+ { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
+ { id: 3, name: this.$t('errorAnalysis.three'), }
|
|
|
+ ]
|
|
|
+ } else if (response.data.list[0].inforvalue == 4) {
|
|
|
+ this.frequencyList = [
|
|
|
+ { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
+ { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
+ { id: 3, name: this.$t('errorAnalysis.three'), },
|
|
|
+ { id: 4, name: this.$t('errorAnalysis.four'), }
|
|
|
+ ]
|
|
|
+ }else if (response.data.list[0].inforvalue == 5) {
|
|
|
+ this.frequencyList = [
|
|
|
+ { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
+ { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
+ { id: 3, name: this.$t('errorAnalysis.three'), },
|
|
|
+ { id: 4, name: this.$t('errorAnalysis.four'), },
|
|
|
+ { id: 5, name: this.$t('errorAnalysis.five'), }
|
|
|
+ ]
|
|
|
+ }else if (response.data.list[0].inforvalue == 6) {
|
|
|
+ this.frequencyList = [
|
|
|
+ { id: 1, name: this.$t('errorAnalysis.one'), },
|
|
|
+ { id: 2, name: this.$t('errorAnalysis.two'), },
|
|
|
+ { id: 3, name: this.$t('errorAnalysis.three'), },
|
|
|
+ { id: 4, name: this.$t('errorAnalysis.four'), },
|
|
|
+ { id: 5, name: this.$t('errorAnalysis.five'), },
|
|
|
+ { id: 6, name: this.$t('errorAnalysis.six'), }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ 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.create.temp.ftvolume = this.templateFormulationList.find(obj => obj.id === item).volume
|
|
|
+ this.getCreateList1()
|
|
|
+ var obj = {
|
|
|
+ 'pastureid':this.create.temp.pastureid,
|
|
|
+ 'ftid':this.create.temp.ftid
|
|
|
+ }
|
|
|
+ this.getmaterialdetailsList(obj)
|
|
|
+ },
|
|
|
+ changeTimes(item) {
|
|
|
+ this.getCreateList1()
|
|
|
+ },
|
|
|
+ // TMR编号
|
|
|
+ changeTMRNumber(item) {
|
|
|
+ console.log(this.create.temp.tmrid,'this.create.temp.tmrid111')
|
|
|
+ if (this.create.list2.length > 0) {
|
|
|
+ // 备份
|
|
|
+ // MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
|
|
|
+ // confirmButtonText: '是',
|
|
|
+ // cancelButtonText: '否',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
+ // this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
|
+ // this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
|
|
|
+ // this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
|
|
|
+ // this.create.temp.mytmrid = this.create.temp.tmrid
|
|
|
+ // this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
+ // console.log('tmrname==>', this.create.temp)
|
|
|
+ // if (this.isDispaly || this.create.dialogStatus == 'update') {
|
|
|
+ // this.getClearList()
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // console.log(this.create.temp,'====')
|
|
|
+ // if(this.create.temp.tclassname == '固定式'){
|
|
|
+ // console.log( this.create.temp,'====')
|
|
|
+ // this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
+ // }
|
|
|
+ // this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
+ // this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
+ // this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
+ // this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
+ // this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
+ // this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
+ // console.log(this.create.temp)
|
|
|
+ // this.$message({ type: 'info', message: '已取消' })
|
|
|
+ // })
|
|
|
+ // 备份
|
|
|
+ this.tmrNumber.dialogFormVisible = true
|
|
|
+ this.tmrNumber.dialogStatus = 'tmrNumber'
|
|
|
+ this.tmrNumber.radio = '0'
|
|
|
+ } else {
|
|
|
+ this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
+ this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
|
+ this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
|
|
|
+ this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
|
|
|
+ this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === item).tmrvolume
|
|
|
+ this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === item).maxVolume
|
|
|
+ this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === item).minVolume
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tmrNumberData(){
|
|
|
+ if(this.tmrNumber.radio == '0'){
|
|
|
+ console.log('1、多出的饲料平均从已分配的各栏舍中扣减。')
|
|
|
+ }else if(this.tmrNumber.radio == '1'){
|
|
|
+ console.log('2、多出的饲料从最后一个栏舍依次往前扣减。')
|
|
|
+ }else if(this.tmrNumber.radio == '2'){
|
|
|
+ console.log('3、清空已分配的撒料车。')
|
|
|
+ }
|
|
|
+ const url = 'authdata/materialtmr/date/edit'
|
|
|
+ const data = {
|
|
|
+ tmrid:this.create.temp.tmrid2,
|
|
|
+ tmrtype: this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassid,
|
|
|
+ lppid:this.create.temp.id,
|
|
|
+ times:this.create.temp.times,
|
|
|
+ pastureid:Cookies.get('pastureid'),
|
|
|
+ status:this.tmrNumber.radio,
|
|
|
+ date:this.date
|
|
|
+ }
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
|
|
|
+ this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
+ this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
+ this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tmrvolume
|
|
|
+ this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxVolume
|
|
|
+ this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).minVolume
|
|
|
+ this.tmrNumber.dialogFormVisible = false
|
|
|
+ this.getCreateList1()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeTmrNumber(){
|
|
|
+ if(this.create.temp.tclassname == '固定式'){
|
|
|
+ console.log( this.create.temp,'====')
|
|
|
+ this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
+ }
|
|
|
+ this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
+ this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
+ this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
+ this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
+ this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
+ this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
+ this.tmrNumber.dialogFormVisible = false
|
|
|
+ },
|
|
|
+ getClearList() {
|
|
|
+ const url = 'authdata/lpplandtl/del/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,
|
|
|
+ volume: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)
|
|
|
+ if(parseFloat(this.create.temp.ftvolume) !== 0 && parseFloat(this.create.temp.sumweight) !== 0){
|
|
|
+ this.create.temp.volume = (parseFloat(this.create.temp.sumweight) / parseFloat(this.create.temp.ftvolume)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.create.temp.volume = 0
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.create.list2 = []
|
|
|
+ // this.create.temp.sort = 0
|
|
|
+ this.create.temp.sumweight = 0
|
|
|
+ this.create.temp.volume = 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)
|
|
|
+ // }
|
|
|
+ console.log(this.create.temp.tclassname,'this.create.temp.tclassname')
|
|
|
+ if(this.create.temp.tclassname == '固定式'){
|
|
|
+ if(this.equipmentList.find(obj => obj.tclassname == '任意车1') !== undefined){
|
|
|
+ this.create.temp.tmrname = this.equipmentList.find(obj => obj.tclassname == '任意车1').eqcode
|
|
|
+ this.create.temp.tmrid = this.equipmentList.find(obj => obj.tclassname == '任意车1').id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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': '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()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(this.create.temp.tmrid,'66666')
|
|
|
+ },
|
|
|
+ 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()
|
|
|
+ this.getmaterialdetailsList(row)
|
|
|
+ },
|
|
|
+ updateData() {
|
|
|
+ this.$refs['temp'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.isokDisable = true
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isokDisable = false
|
|
|
+ }, 1000)
|
|
|
+ var tip = ''
|
|
|
+ if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.tmrvolume)){
|
|
|
+ tip = '装载量已超过车辆容量' + this.create.temp.tmrvolume + 'm³,请确认'
|
|
|
+ MessageBox.confirm(tip, {
|
|
|
+ confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.save_updateData()
|
|
|
+ })
|
|
|
+ }else if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.maxVolume)){
|
|
|
+ tip = '装载量不可超过车辆容量' + this.create.temp.maxVolume + 'm³,请确认'
|
|
|
+ MessageBox.confirm(tip, {
|
|
|
+ confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.save_updateData()
|
|
|
+ })
|
|
|
+ }else if(parseFloat(this.create.temp.volume) < parseFloat(this.create.temp.minVolume)){
|
|
|
+ tip = '装载量不可低于车辆容量' + this.create.temp.minVolume + 'm³,请确认'
|
|
|
+ MessageBox.confirm(tip, {
|
|
|
+ confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.save_updateData()
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.save_updateData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ save_updateData(){
|
|
|
+ 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.tmrid2
|
|
|
+ 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 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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.id = obj.id
|
|
|
+ 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 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAllEmpty(){
|
|
|
+ MessageBox.confirm('执行该操作会将现有车次已分配的撒料栏舍全部清空,是否要执行该操作?', {
|
|
|
+ confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.requestParam = {}
|
|
|
+ this.requestParam.common = { 'returnmap': '0' }
|
|
|
+ this.requestParam.data = []
|
|
|
+ this.requestParam.data[0] = { 'name': 'deleteLpplandtl1dateAll', 'type': 'e', 'parammaps': { pastureid: Cookies.get('pastureid'),date:this.date }},
|
|
|
+ this.requestParam.data[1] = { 'name': 'deletefpdetaildateAll', 'type': 'e', 'parammaps': { pastureid: Cookies.get('pastureid'),date:this.date }},
|
|
|
+ ExecDataByConfig(this.requestParam).then(response => {
|
|
|
+ console.log('清空已分配栏舍', this.requestParam)
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '清空失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '清空成功', message: '清空成功', type: 'success', duration: 2000 })
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getmaterialdetailsList(item){
|
|
|
+ let url = 'authdata/GetDataByName'
|
|
|
+ let data = {
|
|
|
+ name:"getFTdetailList",page:1,offset:1,pagecount:"",returntype:"Map",
|
|
|
+ parammaps:{
|
|
|
+ pastureid:item.pastureid,ftid:item.ftid,
|
|
|
+ // fttypeid:item.fttypeid,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.materialdetailsList = response.data.list
|
|
|
+ } else {
|
|
|
+ this.materialdetailsList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</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>
|