|
|
@ -2,181 +2,109 @@ |
|
|
<div> |
|
|
<div> |
|
|
<div class="pda-container"> |
|
|
<div class="pda-container"> |
|
|
<div class="status-bar"> |
|
|
<div class="status-bar"> |
|
|
<div class="goBack" @click="processFlag===1?$router.back():processFlag===3?processFlag=2:processFlag=1"><i class="el-icon-arrow-left"></i>上一页</div> |
|
|
|
|
|
|
|
|
<div class="goBack" @click="handleBack"><i class="el-icon-arrow-left"></i>上一页</div> |
|
|
<div class="goBack">采购订单接收</div> |
|
|
<div class="goBack">采购订单接收</div> |
|
|
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|
|
|
|
|
|
|
|
<div class="network" style="color: #fff" @click="$router.push({ path: '/' })">🏠首页</div> |
|
|
</div> |
|
|
</div> |
|
|
<div style="overflow-y: auto"> |
|
|
<div style="overflow-y: auto"> |
|
|
<div v-if="processFlag===1"> |
|
|
|
|
|
<!-- 扫描输入区 --> |
|
|
|
|
|
<div class="scan-box" style="margin-left: 2px;margin-right: 2px;"> |
|
|
|
|
|
|
|
|
<!-- Step 1: 扫描 --> |
|
|
|
|
|
<div v-if="processFlag === 1"> |
|
|
|
|
|
<div class="scan-box" style="margin: 2px;"> |
|
|
<el-input clearable v-model="scanCode" placeholder="扫描PO条码或输入PO号" |
|
|
<el-input clearable v-model="scanCode" placeholder="扫描PO条码或输入PO号" |
|
|
@keyup.enter.native="searchPoList" ref="scanCodeRef"/> |
|
|
|
|
|
|
|
|
@keyup.enter.native="searchPoList" ref="scanCodeRef" /> |
|
|
</div> |
|
|
</div> |
|
|
<!-- 商品列表区 --> |
|
|
|
|
|
<div class="item-list" v-if="poList.length>0" style="margin-left: 2px;margin-right: 2px;"> |
|
|
|
|
|
<el-form label-position="top" style="margin-left: 3px;margin-right: 3px;"> |
|
|
|
|
|
|
|
|
<div class="item-list" v-if="poList.length > 0" style="margin: 2px;"> |
|
|
|
|
|
<el-form label-position="top" style="margin: 3px;"> |
|
|
<el-row :gutter="5" @click.native="recvLine(poDetail)" |
|
|
<el-row :gutter="5" @click.native="recvLine(poDetail)" |
|
|
:class="index<poList.length-1?'bottom-line-row':''" :key="index" :value="poDetail" v-for="(poDetail,index) in poList "> |
|
|
|
|
|
<el-col :span="8" style="height: 40px"> |
|
|
|
|
|
<el-form-item :label="'商品编码'" ><span>{{poDetail.partNo}}</span></el-form-item> |
|
|
|
|
|
|
|
|
v-for="(poDetail, index) in poList" :key="index" :class="index < poList.length - 1 ? 'bottom-line-row' : ''"> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="商品编码"><span>{{ poDetail.partNo }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item :label="'行号/下达号'" ><span>{{poDetail.wdr}}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="行号/下达号"><span>{{ poDetail.wdr }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item :label="''" > |
|
|
|
|
|
<el-button type="text" class="recvButton" @click="recvLine(poDetail)" style="margin-top: 10px;margin-left: 10px" size="small">接收</el-button> |
|
|
|
|
|
|
|
|
<el-form-item label=""> |
|
|
|
|
|
<el-button type="text" class="recvButton" @click="recvLine(poDetail)" style="margin-top: 10px;" size="small">接收</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item :label="'商品描述'" ><span>{{poDetail.desc}}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="商品描述"><span>{{ poDetail.desc }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item :label="'订单数量'" ><span>{{poDetail.qty}}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="订单数量"><span>{{ poDetail.qty }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item :label="'待收数量'" ><span>{{poDetail.qty}}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="待收数量"><span>{{ poDetail.qty }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item :label="'此次接收数量'" ><span>{{poDetail.qty}}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="此次接收数量"><span>{{ poDetail.qty }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item style="margin-left: 10px" :label="'单位'" ><span>{{poDetail.unit}}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="单位"><span>{{ poDetail.unit }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="processFlag===2" style="overflow-y: auto"> |
|
|
|
|
|
<el-form label-position="top" style="margin-left: 5px;margin-right: 5px;"> |
|
|
|
|
|
<el-row :gutter="20" style=""> |
|
|
|
|
|
<el-col :span="12" style="height: 40px"> |
|
|
|
|
|
<el-form-item :label="'PO号码'" ><el-input v-model="recvItem.poNo" disabled></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Step 2: 收货明细 --> |
|
|
|
|
|
<div v-if="processFlag === 2"> |
|
|
|
|
|
<el-form label-position="top" class="form-section" style="margin: 5px;"> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="PO号码"><el-input v-model="recvItem.poNo" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="行号/下达号"><el-input v-model="recvItem.wdr" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="商品编码"><el-input v-model="recvItem.partNo" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="计量单位"><el-input v-model="recvItem.unit" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="24"><el-form-item label="商品名称"><el-input v-model="recvItem.desc" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="订单数量"><el-input v-model="recvItem.qty" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="待收数量"><el-input v-model="recvItem.dueinQty" disabled /></el-form-item></el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item :label="'行号/下达号'" ><el-input disabled v-model="recvItem.wdr"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'商品编码'" ><el-input disabled v-model="recvItem.partNo"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'计量单位'" ><el-input disabled v-model="recvItem.unit"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'商品名称'" ><el-input disabled v-model="recvItem.desc"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'订单数量'" ><el-input disabled v-model="recvItem.qty"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'待收数量'" ><el-input disabled v-model="recvItem.dueinQty"></el-input> |
|
|
|
|
|
|
|
|
<el-form-item label="此次接收数量"> |
|
|
|
|
|
<el-input v-model="recvItem.transQty" :disabled="recvItem.needHandlingUnit === 'Y'" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'此次接收数量'" ><el-input v-model="recvItem.transQty" ></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="' '" > |
|
|
|
|
|
<el-button type="text" @click.stop="handlingUnitStep" :disabled="recvItem.needHandlingUnit!=='Y'" |
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label=" "> |
|
|
|
|
|
<el-button type="text" @click.stop="handlingUnitStep" :disabled="recvItem.needHandlingUnit !== 'Y'" |
|
|
:class="{ 'disabled-button': recvItem.needHandlingUnit !== 'Y' }" |
|
|
:class="{ 'disabled-button': recvItem.needHandlingUnit !== 'Y' }" |
|
|
style="font-size: 16px" size="small">包装记录</el-button> |
|
|
style="font-size: 16px" size="small">包装记录</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'制造日期'" > |
|
|
|
|
|
<el-date-picker style="width: 100%" v-model="recvItem.productDate" |
|
|
|
|
|
type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择制造日期"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'失效日期'" > |
|
|
|
|
|
<el-date-picker style="width: 100%" v-model="recvItem.expiringDate" |
|
|
|
|
|
type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择失效日期"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'库位'" > |
|
|
|
|
|
<el-input v-model="recvItem.locationNo" placeholder="请输入库位"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'批号'" > |
|
|
|
|
|
<el-input v-model="recvItem.batchNo" placeholder="请输入批号"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 20px;"> |
|
|
|
|
|
<el-form-item :label="''" > |
|
|
|
|
|
<el-button type="text" style="font-size: 16px;margin-left: 30px" size="small" @click="processFlag=1">回退</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 20px"> |
|
|
|
|
|
<el-form-item :label="''" > |
|
|
|
|
|
<el-button type="text" @click.stop="receivePo()" style="font-size: 16px;margin-left: 20px" size="small">保存</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 20px"> |
|
|
|
|
|
<el-form-item :label="''" > |
|
|
|
|
|
<el-button type="text" style="font-size: 16px;margin-left: 10px" size="small">退出</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
<el-col :span="12"><el-form-item label="制造日期"><el-date-picker v-model="recvItem.productDate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择制造日期" style="width: 100%" /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="失效日期"><el-date-picker v-model="recvItem.expiringDate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择失效日期" style="width: 100%" /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="库位"><el-input v-model="recvItem.locationNo" placeholder="请输入库位" /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="批号"><el-input v-model="recvItem.batchNo" placeholder="请输入批号" /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 10px"><el-form-item><el-button type="text" style="font-size: 16px;margin-left: 30px" @click="processFlag = 1">回退</el-button></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 10px"><el-form-item><el-button type="text" style="font-size: 16px;margin-left: 20px" @click="receivePo">保存</el-button></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 10px"><el-form-item><el-button type="text" style="font-size: 16px;margin-left: 10px" @click="$router.push('/')">退出</el-button></el-form-item></el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-if="processFlag===3" style="overflow-y: auto"> |
|
|
|
|
|
<el-form label-position="top" style="margin-left: 5px;margin-right: 5px;"> |
|
|
|
|
|
<el-row :gutter="20" style=""> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'商品编码'" ><el-input disabled v-model="recvItem.partNo"></el-input></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'计量单位'" ><el-input disabled v-model="recvItem.unit"></el-input></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'商品名称'" ><el-input disabled v-model="recvItem.desc"></el-input></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 6px;margin-bottom: 10px"> |
|
|
|
|
|
<el-form-item :label="'单包装数量'" ><el-input v-model="hanlingItem.perQty"></el-input></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="'包装数'" ><el-input v-model="hanlingItem.packageQty" ></el-input></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 6px"> |
|
|
|
|
|
<el-form-item :label="' '" > |
|
|
|
|
|
<el-button type="text" @click="createHandlingUnit" style="font-size: 18px" size="small">创建</el-button></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-table :data="handlingUnit" :row-style="{ height: '30px' }" style="width: 94%;margin-left: 10px" highlight-current-row> |
|
|
|
|
|
<el-table-column prop="code" header-align="center" align="left" label="Unit ID"></el-table-column> |
|
|
|
|
|
<el-table-column prop="qty" header-align="center" align="right" label="数量" width="42"></el-table-column> |
|
|
|
|
|
<el-table-column header-align="center" align="center" label="操作"> |
|
|
|
|
|
|
|
|
<!-- Step 3: 包装记录 --> |
|
|
|
|
|
<div v-if="processFlag === 3"> |
|
|
|
|
|
<el-form label-position="top" class="form-section" style="margin: 5px;"> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="商品编码"><el-input v-model="recvItem.partNo" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item label="计量单位"><el-input v-model="recvItem.unit" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="24"><el-form-item label="商品名称"><el-input v-model="recvItem.desc" disabled /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="8"><el-form-item label="单包装数量"><el-input v-model="hanlingItem.perQty" /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="8"><el-form-item label="包装数"><el-input v-model="hanlingItem.packageQty" /></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="8" style="margin-top: 24px"><el-form-item> |
|
|
|
|
|
<el-button type="text" @click="createHandlingUnit" style="font-size: 16px">创建</el-button></el-form-item></el-col> |
|
|
|
|
|
<el-table :data="handlingUnit" :row-style="{ height: '30px' }" style="width: 94%; margin-left: 10px;" highlight-current-row> |
|
|
|
|
|
<el-table-column prop="code" label="Unit ID" /> |
|
|
|
|
|
<el-table-column prop="qty" label="数量" width="60" /> |
|
|
|
|
|
<el-table-column label="操作"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<a type="text" style="font-size: 14px" @click="removeItem">删除</a> |
|
|
|
|
|
|
|
|
<a @click="removeItem(scope.$index)">删除</a> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<el-col :span="24" style="margin-top: -10px;margin-left: 4px;"> |
|
|
|
|
|
<el-form-item :label="' '" > |
|
|
|
|
|
<span>合计</span><span style="margin-left: 38%">{{totalQty}}</span> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 20px;"> |
|
|
|
|
|
<el-form-item :label="''" > |
|
|
|
|
|
<el-button type="text" style="font-size: 18px;margin-left: 60px" size="small" @click="processFlag=2">回退</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" style="margin-top: 20px"> |
|
|
|
|
|
<el-form-item :label="''" ><el-button type="text" @click="processFlag=2" style="font-size: 18px;margin-left: 20px" size="small">确定</el-button></el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
<el-col :span="24"><el-form-item><span>合计</span><span style="margin-left: 38%">{{ totalQty }}</span></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item><el-button type="text" @click="processFlag = 2" style="font-size: 18px;margin-left: 60px">回退</el-button></el-form-item></el-col> |
|
|
|
|
|
<el-col :span="12"><el-form-item><el-button type="text" @click="processFlag = 2" style="font-size: 18px;">确定</el-button></el-form-item></el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
@ -186,109 +114,92 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
|
|
|
getPoList,receivePo, |
|
|
|
|
|
} from "@/api/po/po.js" |
|
|
|
|
|
|
|
|
import { getPoList, receivePo } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
processFlag:1, |
|
|
|
|
|
recvVisible: false, |
|
|
|
|
|
handlingUnit: [], |
|
|
|
|
|
hanlingItem:{code:'', qty: '',perQty: '', packageQty: ''}, |
|
|
|
|
|
rollqty:'', |
|
|
|
|
|
|
|
|
processFlag: 1, |
|
|
scanCode: '', |
|
|
scanCode: '', |
|
|
poList: [], |
|
|
poList: [], |
|
|
recvItem:{} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
recvItem: {}, |
|
|
|
|
|
handlingUnit: [], |
|
|
|
|
|
hanlingItem: { code: '', qty: '', perQty: '', packageQty: '' }, |
|
|
|
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
totalQty() { |
|
|
totalQty() { |
|
|
let sum = this.handlingUnit.reduce((sum, item) => sum + item.qty, 0); |
|
|
|
|
|
this.recvItem.transQty = sum |
|
|
|
|
|
return sum |
|
|
|
|
|
|
|
|
const sum = this.handlingUnit.reduce((sum, item) => sum + Number(item.qty), 0); |
|
|
|
|
|
this.recvItem.transQty = sum; |
|
|
|
|
|
return sum; |
|
|
}, |
|
|
}, |
|
|
|
|
|
huKey() { |
|
|
|
|
|
return `hu_${this.recvItem.poNo}_${this.recvItem.wdr}`; |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 获取po列表 |
|
|
|
|
|
|
|
|
handleBack() { |
|
|
|
|
|
if (this.processFlag === 1) this.$router.back(); |
|
|
|
|
|
else if (this.processFlag === 3) this.processFlag = 2; |
|
|
|
|
|
else this.processFlag = 1; |
|
|
|
|
|
}, |
|
|
searchPoList() { |
|
|
searchPoList() { |
|
|
if (!this.scanCode) { |
|
|
|
|
|
this.poList = [] |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
getPoList({}).then(({data}) => { |
|
|
|
|
|
if (data.code == 0) { |
|
|
|
|
|
this.poList = data.rows |
|
|
|
|
|
|
|
|
if (!this.scanCode) return this.poList = []; |
|
|
|
|
|
getPoList({ poNo: this.scanCode }).then(({ data }) => { |
|
|
|
|
|
if (data.code === 0) this.poList = data.rows; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
recvLine(row) { |
|
|
|
|
|
this.recvItem = { ...row, poNo: this.scanCode }; |
|
|
|
|
|
this.processFlag = 2; |
|
|
|
|
|
}, |
|
|
|
|
|
handlingUnitStep() { |
|
|
|
|
|
this.processFlag = 3; |
|
|
|
|
|
const saved = localStorage.getItem(this.huKey); |
|
|
|
|
|
this.handlingUnit = saved ? JSON.parse(saved) : []; |
|
|
|
|
|
}, |
|
|
|
|
|
createHandlingUnit() { |
|
|
|
|
|
const { perQty, packageQty } = this.hanlingItem; |
|
|
|
|
|
if (!perQty || !packageQty || isNaN(perQty) || isNaN(packageQty)) { |
|
|
|
|
|
return this.$message.warning("请填写有效的包装信息"); |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
|
|
|
const qty = parseFloat(perQty) * parseInt(packageQty); |
|
|
|
|
|
const code = 'H' + String(this.handlingUnit.length + 1).padStart(3, '0'); |
|
|
|
|
|
const newItem = { ...this.hanlingItem, qty, code }; |
|
|
|
|
|
this.handlingUnit.push(newItem); |
|
|
|
|
|
localStorage.setItem(this.huKey, JSON.stringify(this.handlingUnit)); |
|
|
}, |
|
|
}, |
|
|
/* 第二步,收货 */ |
|
|
|
|
|
recvLine(row){ |
|
|
|
|
|
this.processFlag=2; |
|
|
|
|
|
this.recvItem=row |
|
|
|
|
|
this.recvItem.poNo = this.scanCode |
|
|
|
|
|
|
|
|
removeItem(index) { |
|
|
|
|
|
this.handlingUnit.splice(index, 1); |
|
|
|
|
|
localStorage.setItem(this.huKey, JSON.stringify(this.handlingUnit)); |
|
|
}, |
|
|
}, |
|
|
receivePo() { |
|
|
receivePo() { |
|
|
this.recvItem.site='1' |
|
|
|
|
|
this.recvItem.itemNo = '1' |
|
|
|
|
|
//校验数量库位批次是否为空 |
|
|
|
|
|
if (!this.recvItem.transQty) { |
|
|
|
|
|
this.$message.error('请填写接收数量') |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
const item = this.recvItem; |
|
|
|
|
|
if (!item.transQty || !item.locationNo || !item.batchNo) { |
|
|
|
|
|
return this.$message.error("请填写完整信息"); |
|
|
} |
|
|
} |
|
|
if (!this.recvItem.locationNo) { |
|
|
|
|
|
this.$message.error('请填写库位') |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
if (item.needHandlingUnit === 'Y') { |
|
|
|
|
|
item.handlingUnitList = this.handlingUnit; |
|
|
} |
|
|
} |
|
|
if (!this.recvItem.batchNo) { |
|
|
|
|
|
this.$message.error('请填写批次') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
// 如果启用hand领Unit,则获取handlingUnit |
|
|
|
|
|
if (this.recvItem.needHandlingUnit==='Y') { |
|
|
|
|
|
const handlingUnitList = JSON.parse(localStorage.getItem('handlingUnit')); |
|
|
|
|
|
this.recvItem.handlingUnitList = handlingUnitList |
|
|
|
|
|
} |
|
|
|
|
|
receivePo(this.recvItem).then(({data}) => { |
|
|
|
|
|
if (data.code == 0) { |
|
|
|
|
|
//this.poList = data.rows |
|
|
|
|
|
this.$message({message: '操作成功', type: 'success', |
|
|
|
|
|
duration: 1500, onClose: () => {} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
receivePo({ ...item, site: '1', itemNo: '1' }).then(({ data }) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
|
localStorage.removeItem(this.huKey); |
|
|
|
|
|
this.processFlag = 1; |
|
|
|
|
|
this.scanCode = ''; |
|
|
|
|
|
this.poList = []; |
|
|
|
|
|
this.recvItem = {}; |
|
|
|
|
|
this.handlingUnit = []; |
|
|
} else { |
|
|
} else { |
|
|
this.$message({message: data.msg, |
|
|
|
|
|
type: 'error', duration: 1500, onClose: () => {} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.$message.error(data.msg); |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
/* 第三步,包装记录 */ |
|
|
|
|
|
handlingUnitStep (row) { |
|
|
|
|
|
this.processFlag=3 |
|
|
|
|
|
const handlingUnitList = JSON.parse(localStorage.getItem('handlingUnit')); |
|
|
|
|
|
if (handlingUnitList && handlingUnitList.length > 0) { |
|
|
|
|
|
this.handlingUnit = handlingUnitList |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
removeItem(index) { |
|
|
|
|
|
this.handlingUnit.splice(index, 1) |
|
|
|
|
|
localStorage.setItem('handlingUnit', JSON.stringify(this.handlingUnit)); |
|
|
|
|
|
}, |
|
|
|
|
|
createHandlingUnit () { |
|
|
|
|
|
this.hanlingItem.code = 'H'+String(this.handlingUnit.length+1).padStart(3, '0'); |
|
|
|
|
|
this.hanlingItem.qty = this.hanlingItem.perQty * this.hanlingItem.packageQty; |
|
|
|
|
|
let item = JSON.parse(JSON.stringify(this.hanlingItem)); |
|
|
|
|
|
this.handlingUnit.push(item); |
|
|
|
|
|
localStorage.setItem('handlingUnit', JSON.stringify(this.handlingUnit)); |
|
|
|
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.$refs.scanCodeRef.focus(); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.$nextTick(() => this.$refs.scanCodeRef.focus()); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|
@ -297,40 +208,36 @@ export default { |
|
|
padding: 12px; |
|
|
padding: 12px; |
|
|
font-size: 16px; |
|
|
font-size: 16px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item-list { |
|
|
.item-list { |
|
|
flex: 1; |
|
|
flex: 1; |
|
|
overflow-y: auto; |
|
|
overflow-y: auto; |
|
|
margin: 10px 0; |
|
|
margin: 10px 0; |
|
|
border: 1px solid rgba(200, 200, 200, 0.8); /* 浅灰色半透明 */ |
|
|
|
|
|
|
|
|
border: 1px solid rgba(200, 200, 200, 0.8); |
|
|
} |
|
|
} |
|
|
.item-list span { |
|
|
.item-list span { |
|
|
color: #000000; |
|
|
|
|
|
|
|
|
color: #000; |
|
|
font-size: 15px; |
|
|
font-size: 15px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.bottom-line-row { |
|
|
.bottom-line-row { |
|
|
border-bottom: 1px solid rgba(200, 200, 200, 0.8); |
|
|
border-bottom: 1px solid rgba(200, 200, 200, 0.8); |
|
|
//padding-bottom: 2px; /* 可选间距调整 */ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.submit-btn { |
|
|
|
|
|
padding: 12px; |
|
|
|
|
|
background: #07c160; |
|
|
|
|
|
color: white; |
|
|
|
|
|
border: none; |
|
|
|
|
|
font-size: larger; |
|
|
|
|
|
} |
|
|
} |
|
|
.recvButton { |
|
|
.recvButton { |
|
|
font-size: 16px; |
|
|
font-size: 16px; |
|
|
border-radius: 3px; |
|
|
border-radius: 3px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item-list .el-row { cursor: pointer; transition: background 0.3s; } |
|
|
|
|
|
.item-list .el-row:hover { background: #f5f7fa; } |
|
|
|
|
|
|
|
|
.item-list .el-row { |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
transition: background 0.3s; |
|
|
|
|
|
} |
|
|
|
|
|
.item-list .el-row:hover { |
|
|
|
|
|
background: #f5f7fa; |
|
|
|
|
|
} |
|
|
.disabled-button { |
|
|
.disabled-button { |
|
|
color: #ccc !important; |
|
|
color: #ccc !important; |
|
|
cursor: not-allowed !important; |
|
|
cursor: not-allowed !important; |
|
|
} |
|
|
} |
|
|
|
|
|
.form-section >>> .el-col { |
|
|
|
|
|
margin-bottom: 12px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |