<template>
|
<el-dialog
|
width="80%"
|
title="工单库存预留"
|
top="5vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
class="stock-dialog"
|
>
|
<div class="reserved-operate-div">
|
<div class="task-need-part-div">
|
<div class="task-need-part-header">
|
<div>
|
<el-divider class="pane-divider" direction="vertical"></el-divider
|
><span style="font-size:14px;font-weight:bold">工单所需物料</span>
|
</div>
|
</div>
|
<el-table
|
ref="taskNeedPartTable"
|
:data="taskNeedPartList"
|
@row-click="changeNeedPart"
|
highlight-current-row
|
height="350px"
|
:header-cell-style="taskNeedPartTableHeaderCellStyle"
|
class="task-need-part-table"
|
>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件"
|
prop="partName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="需求数量"
|
prop="quantityRequired"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.quantityRequired }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="已预留数量"
|
prop="reservedQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.reservedQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="单位"
|
prop="unit"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.unit }}</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<el-tabs v-model="activeName">
|
<el-tab-pane label="库存列表" name="first"
|
><div class="need-part-stock-div">
|
<div class="need-part-stock-header">
|
<!-- <div>-->
|
<!-- <el-divider class="pane-divider" direction="vertical"></el-divider-->
|
<!-- ><span style="font-size:14px;font-weight:bold">库存列表</span>-->
|
<!-- </div>-->
|
<div>
|
<el-button
|
size="mini"
|
type="primary"
|
:disabled="isSubmit"
|
v-thinclick="`saveReserved`"
|
>保存</el-button
|
>
|
</div>
|
</div>
|
<el-table
|
ref="needPartStockTable"
|
:data="needPartStockList"
|
@selection-change="selectionNeedPartStockChange"
|
height="360px"
|
@row-click="clickNeedPartStock"
|
:header-cell-style="needPartStockTableHeaderCellStyle"
|
class="need-part-stock-table"
|
border
|
>
|
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">零件编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.partNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件名称"
|
prop="partName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">零件名称</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.partName"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="主生产计划号"
|
prop="mpsNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">主生产计划号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.mpsNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.mpsNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="销售订单号"
|
prop="customerOrderNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">销售订单号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.customerOrderNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.customerOrderNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="仓库"
|
prop="warehouseName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">仓库</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.warehouseName"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.warehouseName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="库位号"
|
prop="locationName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">库位号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.locationName"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.locationName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="系统编号"
|
prop="systemNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">系统编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.systemNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.systemNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件批号"
|
prop="partBatchNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">SN号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.partBatchNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partBatchNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="载具编号"
|
prop="reelNumber"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">载具编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.reelNumber"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.reelNumber }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="库存数量"
|
prop="stockQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">库存数量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.stockQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.stockQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="已预留数量"
|
prop="reserveQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">已预留数量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.reserveQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.reserveQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="可用库存数量"
|
prop="availableStockQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">可用库存数量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.availableStockQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.availableStockQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="单位"
|
prop="unit"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">单位</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.unit"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.unit }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="数量2"
|
prop="sstockQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">数量2</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.sstockQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.sstockQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="单位2"
|
prop="sunit"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">单位2</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.sunit"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.sunit }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
class-name="reserved-quantity"
|
label="预留数量"
|
prop="quantity"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-input
|
size="small"
|
@click.native.stop
|
@blur="inputBlur($event, scope.row)"
|
v-model="scope.row.quantity"
|
></el-input>
|
</template>
|
</el-table-column>
|
</el-table></div
|
></el-tab-pane>
|
<el-tab-pane label="ERP库存列表" name="second"
|
><div class="need-part-stock-div">
|
<div class="need-part-stock-header">
|
<div>
|
<el-button
|
size="mini"
|
type="primary"
|
:disabled="isSubmit"
|
v-thinclick="'saveReserved1'"
|
>保存</el-button
|
>
|
</div>
|
</div>
|
<el-table
|
ref="needPartStockTable"
|
:data="needPartStockList1"
|
@selection-change="selectionNeedPartStockChange"
|
height="360px"
|
@row-click="clickNeedPartStock"
|
:header-cell-style="needPartStockTableHeaderCellStyle"
|
class="need-part-stock-table"
|
border
|
>
|
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">零件编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.partNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件名称"
|
prop="partName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">零件名称</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.partName"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="主生产计划号"
|
prop="mpsNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">主生产计划号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.mpsNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.mpsNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="销售订单号"
|
prop="customerOrderNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">销售订单号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.customerOrderNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.customerOrderNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="仓库"
|
prop="warehouseName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">仓库</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.warehouseName"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.warehouseName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="库位号"
|
prop="locationName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">库位号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.locationName"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.locationName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="系统编号"
|
prop="systemNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">系统编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.systemNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.systemNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件批号"
|
prop="partBatchNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">SN号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.partBatchNo"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.partBatchNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="载具编号"
|
prop="reelNumber"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">载具编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.reelNumber"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.reelNumber }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="库存数量"
|
prop="stockQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">库存数量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.stockQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.stockQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="已预留数量"
|
prop="reserveQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">已预留数量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.reserveQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.reserveQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="可用库存数量"
|
prop="availableStockQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">可用库存数量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.availableStockQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.availableStockQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="单位"
|
prop="unit"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">单位</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.unit"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.unit }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="数量2"
|
prop="sstockQuantity"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">数量2</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.sstockQuantity"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.sstockQuantity }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="单位2"
|
prop="sunit"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">单位2</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.sunit"
|
@keyup.enter.native="handleFeedList"
|
clearable
|
@clear="handleFeedList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.sunit }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
class-name="reserved-quantity"
|
label="预留数量"
|
prop="quantity"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-input
|
size="small"
|
@click.native.stop
|
@blur="inputBlur($event, scope.row)"
|
v-model="scope.row.quantity"
|
></el-input>
|
</template>
|
</el-table-column>
|
</el-table></div
|
></el-tab-pane>
|
</el-tabs>
|
</div>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="innerVisible = false">关 闭</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
<style lang="scss" scoped>
|
.reserved-operate-div {
|
height: 800px;
|
}
|
.task-need-part-div {
|
height: 50%;
|
}
|
.task-need-part-header {
|
margin-top: 0px;
|
margin-bottom: 5px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.need-part-stock-div {
|
height: 50%;
|
}
|
.need-part-stock-header {
|
margin-top: 5px;
|
margin-bottom: 5px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.pane-divider {
|
width: 4px;
|
background-color: #4283ee;
|
}
|
.need-part-stock-table >>> .reserved-quantity {
|
padding: 0px 0px;
|
}
|
.need-part-stock-table
|
>>> .reserved-quantity
|
.el-input--small
|
.el-input__inner {
|
height: 41px;
|
line-height: 41px;
|
}
|
</style>
|
<script>
|
import {
|
getMaterial,
|
getStockListByPart,
|
getERPStockListByPart,
|
addReserve
|
} from '@/api/warehouse/joinstockorder'
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
taskId: {
|
type: Number,
|
default: 0
|
}
|
},
|
data() {
|
return {
|
activeName: 'first',
|
needPartStockList1: [],
|
innerVisible: false,
|
taskNeedPartList: [],
|
needPartStockList: [],
|
selectPartStocks: [],
|
currentPart: null,
|
isSubmit: false,
|
queryParamOne: {
|
partNo: null,
|
partName: null,
|
warehouseName: null,
|
locationName: null,
|
systemNo: null,
|
partBatchNo: null,
|
stockQuantity: null,
|
reserveQuantity: null,
|
availableStockQuantity: null,
|
unit: null,
|
reelNumber: null,
|
mpsNo: null,
|
customerOrderNo: null,
|
sstockQuantity: null,
|
sunit: null
|
},
|
queryType: null // 搜索类型 'taskNeedPart'点击工单需求物料触发搜索 'needPartStock'库存列表enter输入触发搜索
|
}
|
},
|
methods: {
|
// 根据工单id,查询工单所需物料
|
getOperateMaterial() {
|
const requestParam = { operationTaskId: this.taskId }
|
getMaterial(requestParam)
|
.then((response) => {
|
const resCode = response.data.code
|
const resData = response.data.data
|
if (resCode === 0) {
|
let part = null
|
if (this.currentPart != null) {
|
part = resData.find((item) => {
|
return item.id === this.currentPart.id
|
})
|
}
|
this.taskNeedPartList = resData
|
if (part != null) {
|
this.$nextTick(() => {
|
this.$refs.taskNeedPartTable.setCurrentRow(part)
|
this.changeNeedPart(part)
|
})
|
}
|
} else {
|
this.taskNeedPartList = []
|
this.$message.error('工单所需物料查询失败')
|
}
|
})
|
.catch(() => {
|
this.taskNeedPartList = []
|
console.log('查询工单所需物料时,发生错误')
|
})
|
},
|
// 工单需求列表换行点击时,触发查询该零件对应的库存
|
changeNeedPart(val) {
|
this.currentPart = val
|
this.queryType = 'taskNeedPart'
|
if (val != null) {
|
this.clearQueryParam()
|
const queryParam = {
|
partNo: val.partNo,
|
partId: val.partId,
|
partName: undefined,
|
warehouseName: undefined,
|
locationName: undefined,
|
systemNo: undefined,
|
partBatchNo: undefined,
|
stockQuantity: undefined,
|
reserveQuantity: undefined,
|
unit: undefined,
|
reelNumber: undefined
|
}
|
this.getStockByPart(queryParam)
|
}
|
},
|
clearQueryParam() {
|
this.queryParamOne.partNo = null
|
this.queryParamOne.partName = null
|
this.queryParamOne.warehouseName = null
|
this.queryParamOne.locationName = null
|
this.queryParamOne.systemNo = null
|
this.queryParamOne.partBatchNo = null
|
this.queryParamOne.stockQuantity = null
|
this.queryParamOne.reserveQuantity = null
|
this.queryParamOne.unit = null
|
this.queryParamOne.reelNumber = null
|
this.queryParamOne.mpsNo = null
|
this.queryParamOne.customerOrderNo = null
|
this.queryParamOne.sstockQuantity = null
|
this.queryParamOne.sunit = null
|
},
|
getStockByPart(reqParam) {
|
if (this.activeName === 'first') {
|
getStockListByPart(reqParam, 0)
|
.then((response) => {
|
const resCode = response.data.code
|
const resData = response.data.data
|
if (resCode === 0) {
|
this.needPartStockList = resData
|
} else {
|
this.needPartStockList = []
|
this.$message.error('库存列表查询失败')
|
}
|
})
|
.catch(() => {
|
this.needPartStockList = []
|
console.log('查询零件对应的库存列表时,发生错误')
|
})
|
} else {
|
getERPStockListByPart(reqParam)
|
.then((resp) => {
|
const respCode = resp.data.code
|
const respData = resp.data.data
|
if (respCode === 0) {
|
this.needPartStockList1 = respData
|
} else {
|
this.isSubmit = false
|
this.$message.error('库存列表查询失败')
|
}
|
})
|
.catch(() => {
|
this.isSubmit = false
|
console.log('查询零件对应的库存列表时,发生错误')
|
})
|
}
|
},
|
// 工单需求列表头部渲染
|
taskNeedPartTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
const headerStyle = 'background:#599ef4;color:#fff;'
|
return headerStyle
|
},
|
// 库存列表头部渲染
|
needPartStockTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
const headerStyle = 'background:#599ef4;color:#fff;'
|
return headerStyle
|
},
|
// 库存列表选中某行时,触发
|
selectionNeedPartStockChange(val) {
|
this.selectPartStocks = val
|
},
|
// 库存列表点击某行时,选中此行
|
clickNeedPartStock(row) {
|
this.$refs.needPartStockTable.toggleRowSelection(row)
|
},
|
// 保存某个或某些零件的预留,刷新库存列表或工单所需物料
|
saveReserved() {
|
this.isSubmit = true
|
if (this.selectPartStocks.length > 0) {
|
// 校验当前预留的库存是否可用
|
const queryParam = {
|
partNo:
|
this.currentPart != null
|
? this.currentPart.partNo
|
: this.queryParamOne.partNo,
|
partName: this.queryParamOne.partName,
|
warehouseName: this.queryParamOne.warehouseName,
|
locationName: this.queryParamOne.locationName,
|
systemNo: this.queryParamOne.systemNo,
|
partBatchNo: this.queryParamOne.partBatchNo,
|
stockQuantity: this.queryParamOne.stockQuantity,
|
reserveQuantity: this.queryParamOne.reserveQuantity,
|
unit: this.queryParamOne.unit,
|
reelNumber: this.queryParamOne.reelNumber,
|
mpsNo: this.queryParamOne.mpsNo,
|
customerOrderNo: this.queryParamOne.customerOrderNo,
|
sStockQuantity: this.queryParamOne.sStockQuantity,
|
sunit: this.queryParamOne.sunit
|
}
|
getStockListByPart(queryParam, 0)
|
.then((resp) => {
|
const respCode = resp.data.code
|
const respData = resp.data.data
|
if (respCode === 0) {
|
const canUseStockList = respData
|
// 校验当前选中库存是否可用
|
let canUseFlag = true
|
let canUseInfo = ''
|
for (let j = 0; j < this.selectPartStocks.length; j++) {
|
const canUseStock = canUseStockList.find((el) => {
|
return el.id === this.selectPartStocks[j].id
|
})
|
if (!canUseStock) {
|
canUseFlag = false
|
canUseInfo =
|
'零件:' +
|
this.selectPartStocks[j].partName +
|
'; SN号:' +
|
this.selectPartStocks[j].partBatchNo +
|
'; 系统编号:' +
|
this.selectPartStocks[j].systemNo +
|
'; 载具编号:' +
|
this.selectPartStocks[j].reelNumber +
|
';对应库存不可用!'
|
break
|
}
|
}
|
if (canUseFlag) {
|
const joinStockOrderList = []
|
this.selectPartStocks.forEach((item) => {
|
// 可用库存大于0才能预留
|
if (item.availableStockQuantity > 0) {
|
const checkFlag = this.checkNumber(item.quantity)
|
if (checkFlag) {
|
if (item.availableStockQuantity >= item.quantity) {
|
joinStockOrderList.push({
|
operationTaskId: this.taskId,
|
stockId: item.id,
|
reservedQuantity: item.quantity,
|
partNo: item.partNo,
|
partName: item.partName,
|
warehouseNo: item.warehouseNo,
|
warehouseName: item.warehouseName,
|
locationNo: item.locationNo,
|
locationName: item.locationName,
|
partUnit: item.unit,
|
systemNo: item.systemNo,
|
partBatchNo: item.partBatchNo,
|
status: '01unconfirmed',
|
type: '工单预留'
|
})
|
}
|
}
|
}
|
})
|
if (joinStockOrderList && joinStockOrderList.length > 0) {
|
addReserve(joinStockOrderList)
|
.then((response) => {
|
const resCode = response.data.code
|
if (resCode === 0) {
|
// 若是工单物料点击搜出的库存,则保存后需刷新工单物料、库存,
|
// 若是库存enter输入搜索出的库存,则保存后刷新库存
|
if (this.queryType === 'needPartStock') {
|
this.handleFeedList()
|
} else {
|
this.getOperateMaterial()
|
}
|
this.$emit('handleReserved')
|
this.$message.success('预留成功')
|
} else {
|
this.$message.error('预留失败')
|
}
|
this.isSubmit = false
|
})
|
.catch(() => {
|
this.isSubmit = false
|
console.log('零件预留时,发生错误')
|
})
|
} else {
|
this.isSubmit = false
|
}
|
} else {
|
this.isSubmit = false
|
this.$message.error(canUseInfo)
|
}
|
} else {
|
this.isSubmit = false
|
this.$message.error('库存列表查询失败')
|
}
|
})
|
.catch(() => {
|
this.isSubmit = false
|
console.log('查询零件对应的库存列表时,发生错误')
|
})
|
} else {
|
this.isSubmit = false
|
this.$message.warning('请选择需要预留的库存')
|
}
|
},
|
|
saveReserved1() {
|
this.isSubmit = true
|
if (this.selectPartStocks.length > 0) {
|
this.selectPartStocks.forEach((item) => {
|
// 可用库存大于0才能预留
|
if (item.availableStockQuantity > 0) {
|
const checkFlag = this.checkNumber(item.quantity)
|
if (checkFlag) {
|
const joinStockOrderList = []
|
if (item.availableStockQuantity >= item.quantity) {
|
joinStockOrderList.push({
|
source: 'erp',
|
operationTaskId: this.taskId,
|
stockId: item.id,
|
reservedQuantity: item.quantity,
|
partNo: item.partNo,
|
partName: item.partName,
|
warehouseNo: item.warehouseNo,
|
warehouseName: item.warehouseName,
|
locationNo: item.locationNo,
|
locationName: item.locationName,
|
partUnit: item.unit,
|
systemNo: item.systemNo,
|
partBatchNo: item.partBatchNo,
|
status: '01unconfirmed',
|
type: '工单预留'
|
})
|
}
|
if (joinStockOrderList && joinStockOrderList.length > 0) {
|
addReserve(joinStockOrderList)
|
.then((response) => {
|
const resCode = response.data.code
|
if (resCode === 0) {
|
this.isSubmit = false
|
// 若是工单物料点击搜出的库存,则保存后需刷新工单物料、库存,
|
// 若是库存enter输入搜索出的库存,则保存后刷新库存
|
// if (this.queryType === 'needPartStock') {
|
// this.handleFeedList()
|
// } else {
|
// this.getOperateMaterial()
|
// }
|
this.$emit('handleReserved')
|
this.$message.success('预留成功')
|
} else {
|
this.$message.error('预留失败')
|
}
|
})
|
.catch(() => {
|
this.isSubmit = false
|
console.log('零件预留时,发生错误')
|
})
|
} else {
|
this.$message.warning('可用库存大于0才能预留')
|
this.isSubmit = false
|
}
|
}
|
}
|
})
|
} else {
|
this.isSubmit = false
|
this.$message.warning('请选择需要预留的库存')
|
}
|
},
|
// input在blur时的回调
|
inputBlur(e, row) {
|
const checkFlag = this.checkNumber(e.target.value)
|
if (!checkFlag) {
|
this.$refs.needPartStockTable.toggleRowSelection(row, false)
|
this.$message.warning('请填写正确的预留数量')
|
} else {
|
this.$refs.needPartStockTable.toggleRowSelection(row, true)
|
}
|
},
|
// 校验数字
|
checkNumber(val) {
|
if (val && val != null && val.trim() !== '') {
|
if (Number(val) === 0) {
|
return false
|
} else {
|
return /^[0-9]+(.[0-9]{1,4})?$/.test(val)
|
}
|
} else {
|
return false
|
}
|
},
|
initData() {
|
this.taskNeedPartList = []
|
this.needPartStockList = []
|
this.selectPartStocks = []
|
this.currentPart = null
|
},
|
// 库存enter触发搜索时,需校验所有字段不能都为空
|
handleFeedList() {
|
this.queryType = 'needPartStock'
|
this.$refs.taskNeedPartTable.setCurrentRow()
|
this.currentPart = null
|
const flag = this.checkQueryParam()
|
if (flag) {
|
this.getStockByPart(this.queryParamOne)
|
} else {
|
this.needPartStockList = []
|
}
|
},
|
checkQueryParam() {
|
let flag = true
|
if (
|
(this.queryParamOne.partNo == null ||
|
this.queryParamOne.partNo.trim() == '') &&
|
(this.queryParamOne.partName == null ||
|
this.queryParamOne.partName.trim() == '') &&
|
(this.queryParamOne.warehouseName == null ||
|
this.queryParamOne.warehouseName.trim() == '') &&
|
(this.queryParamOne.locationName == null ||
|
this.queryParamOne.locationName.trim() == '') &&
|
(this.queryParamOne.systemNo == null ||
|
this.queryParamOne.systemNo.trim() == '') &&
|
(this.queryParamOne.partBatchNo == null ||
|
this.queryParamOne.partBatchNo.trim() == '') &&
|
(this.queryParamOne.stockQuantity == null ||
|
this.queryParamOne.stockQuantity.trim() == '') &&
|
(this.queryParamOne.reserveQuantity == null ||
|
this.queryParamOne.reserveQuantity.trim() == '') &&
|
(this.queryParamOne.unit == null ||
|
this.queryParamOne.unit.trim() == '') &&
|
(this.queryParamOne.reelNumber == null ||
|
this.queryParamOne.reelNumber.trim() == '') &&
|
(this.queryParamOne.mpsNo == null ||
|
this.queryParamOne.mpsNo.trim() == '') &&
|
(this.queryParamOne.customerOrderNo == null ||
|
this.queryParamOne.customerOrderNo.trim() == '') &&
|
(this.queryParamOne.sstockQuantity == null ||
|
this.queryParamOne.sstockQuantity.trim() == '') &&
|
(this.queryParamOne.sunit == null ||
|
this.queryParamOne.sunit.trim() == '')
|
) {
|
flag = false
|
}
|
|
return flag
|
}
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.initData()
|
this.$nextTick(() => {
|
// 查询工单对应的零件需求
|
this.getOperateMaterial()
|
})
|
}
|
}
|
}
|
}
|
</script>
|