|
|
@@ -6,9 +6,6 @@
|
|
|
<van-icon name="arrow-left" size="25" />
|
|
|
<div style="color: #fff">返回</div>
|
|
|
</template>
|
|
|
- <!-- <template #right>-->
|
|
|
- <!-- <div class="nav-right" @click="onClickRight">提交任务</div>-->
|
|
|
- <!-- </template>-->
|
|
|
</van-nav-bar>
|
|
|
<div class="activity">
|
|
|
<div class="wave-title">
|
|
|
@@ -27,7 +24,6 @@
|
|
|
<div>KG</div>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
-<!-- :class="[totalWeight>0?'success-input-barcode':'error-input-barcode']"-->
|
|
|
</div>
|
|
|
<div class="order-detail">
|
|
|
<div class="picking-no">
|
|
|
@@ -105,14 +101,16 @@
|
|
|
</div>
|
|
|
<!-- 条码输入组件 -->
|
|
|
<input-barcode :back="back" @setBarcode="setBarcode" ref="inputBarcodeRef" />
|
|
|
- <!-- 打印面单-->
|
|
|
+ <!-- 打印面单-->
|
|
|
<printer ref="printerRef" @onPrint="onPrint" />
|
|
|
- <!-- 订单列表-->
|
|
|
+ <!-- 订单列表-->
|
|
|
<order-list-table ref="orderListRef" />
|
|
|
- <!-- 返拣-->
|
|
|
+ <!-- 返拣-->
|
|
|
<reverse-picking ref="reversePickingRef" :warehouse="warehouse" :reversePickingContainerNo="reversePickingContainerNo" @load-data="loadData" @reversePickingReset="reversePickingReset" />
|
|
|
- <!-- 耗材-->
|
|
|
+ <!-- 耗材-->
|
|
|
<related-materia ref="relatedMateriaRef" @cut-barcode="cutBarcode" />
|
|
|
+ <!-- 复核组合商品-->
|
|
|
+ <check-barcode-combine ref="checkBarcodeCombineRef" @cutBarcode="cutBarcode" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
@@ -121,15 +119,16 @@ import { androidFocus, getHeader, goBack, scanError, scanSuccess } from '@/utils
|
|
|
import { useStore } from '@/store/modules/user'
|
|
|
import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
|
|
|
import { getPendingReviewTask, packingReview } from '@/api/check/index'
|
|
|
-import { barcodeToUpperCase } from '@/utils/dataType.js'
|
|
|
-import { closeToast, showConfirmDialog, showLoadingToast, showNotify } from 'vant'
|
|
|
+import { barcodeToUpperCase, toMap } from '@/utils/dataType.js'
|
|
|
+import { closeToast, showConfirmDialog, showDialog, showLoadingToast, showNotify, showToast } from 'vant'
|
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
-import { fluxPrint } from '@/api/picking/index'
|
|
|
+import { fluxPrint, getListCombineSku } from '@/api/picking/index'
|
|
|
import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
|
|
|
import Printer from '@/components/Printer.vue'
|
|
|
import orderListTable from '@/views/outbound/check/components/OrderListTable.vue'
|
|
|
import ReversePicking from '@/views/outbound/check/components/ReversePicking.vue'
|
|
|
import RelatedMateria from '@/views/outbound/check/components/RelatedMateria.vue'
|
|
|
+import CheckBarcodeCombine from '@/views/outbound/check/components/CheckBarcodeCombine.vue'
|
|
|
const store = useStore()
|
|
|
try {
|
|
|
getHeader()
|
|
|
@@ -169,15 +168,22 @@ const orderList=ref([])
|
|
|
const matchBarcodeList=ref([])
|
|
|
const actions = [
|
|
|
{ text: '重新开始',value:'reset' },
|
|
|
- // { text: '波次清单',value:'goods' },
|
|
|
{ text: '装箱清单',value:'packing' },
|
|
|
{ text: '取消单列表',value:'cancel' },
|
|
|
{ text: '冻结单列表',value: 'freeze' },
|
|
|
];
|
|
|
// 扫描条码监听
|
|
|
const relatedMateriaRef=ref(null)
|
|
|
+const matchedSku=ref([])
|
|
|
+const checkBarcodeCombineRef=ref(null)
|
|
|
const _handlerScan = (code) => {
|
|
|
if (code) {
|
|
|
+ if (isUniqueCode.value) {
|
|
|
+ scanError()
|
|
|
+ scanBarcode.value = ''
|
|
|
+ showNotify({ type: 'warning', duration: 3000, message: `此单包含唯一码/IMEI码,请到PC复核` })
|
|
|
+ return
|
|
|
+ }
|
|
|
const barcode = [...new Set(
|
|
|
orderList.value
|
|
|
.flatMap(item => [item.barcode, item.barcode2, item.sku, item.universalCode])
|
|
|
@@ -188,16 +194,6 @@ const _handlerScan = (code) => {
|
|
|
matchBarcodeList.value=orderList.value.filter(item=>((item.barcode===checkBarcode || item.sku===checkBarcode || item.barcode2===checkBarcode || item.universalCode==checkBarcode) && item.qty>0) )
|
|
|
if(matchBarcodeList.value.length>0){
|
|
|
const itemActive = matchBarcodeList.value[0]
|
|
|
- if(itemActive.uniqueRegExp){
|
|
|
- scanBarcode.value=''
|
|
|
- showNotify({ type: 'warning', duration: 3000, message: `此活动单包含唯一码,请到PC复核`})
|
|
|
- return
|
|
|
- }
|
|
|
- if(itemActive.imeiRegExp){
|
|
|
- scanBarcode.value=''
|
|
|
- showNotify({ type: 'warning', duration: 3000, message: `此活动单包含IMEI码,请到PC复核`})
|
|
|
- return
|
|
|
- }
|
|
|
scanBarcode.value=code
|
|
|
if(itemActive.relatedMaterial && itemActive.relatedMaterial.length>0){
|
|
|
relatedMateriaRef.value.show(itemActive)
|
|
|
@@ -210,12 +206,59 @@ const _handlerScan = (code) => {
|
|
|
showNotify({ type: 'warning', duration: 3000, message: `商品条码${code},已全部扫描完成`})
|
|
|
}
|
|
|
}else {
|
|
|
- scanBarcode.value=''
|
|
|
- showNotify({ type: 'warning', duration: 3000, message: `商品条码${code},不匹配请重新扫描!`})
|
|
|
- scanError()
|
|
|
+ //查询组合条码
|
|
|
+ matchedSku.value=[]
|
|
|
+ getListCombineSku({combineSku:code, workEnvironment:'check'}).then(res=>{
|
|
|
+ if(res.data.length>0){
|
|
|
+ const combineSkuMap=toMap(res.data,'barcode')
|
|
|
+ const matchedSkuList=getBarcodeCombine(orderList.value,combineSkuMap)
|
|
|
+ if(matchedSkuList.length>0){
|
|
|
+ if(matchedSkuList.length==res.data.length){
|
|
|
+ matchedSku.value=matchedSkuList
|
|
|
+ checkBarcodeCombineRef.value.show(matchedSku.value,orderList.value)
|
|
|
+ }else{
|
|
|
+ scanError()
|
|
|
+ showDialog({
|
|
|
+ title:'温馨提示',
|
|
|
+ message:'组合商品与拣货任务不匹配,请检查组合商品配置!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ scanError()
|
|
|
+ showDialog({
|
|
|
+ title:'温馨提示',
|
|
|
+ message:'组合商品与拣货任务不匹配,请检查组合商品配置!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ scanError()
|
|
|
+ scanBarcode.value=''
|
|
|
+ showNotify({ type: 'warning', duration: 3000, message: `商品条码${code},不匹配请重新扫描!`})
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//组合商品匹配到的商品
|
|
|
+const getBarcodeCombine=(goodsList, combineSkuMap)=>{
|
|
|
+ const result = goodsList.map(item => {
|
|
|
+ const barcode = item.barcode || item.barcodeAs;
|
|
|
+ // 如果有匹配数据添加到 item 中
|
|
|
+ if (combineSkuMap[barcode] && item.qty >= combineSkuMap[barcode].quantity ) {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ matchedJson: combineSkuMap[barcode]
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return null
|
|
|
+ })
|
|
|
+ .filter(item => item !== null) // 过滤掉 null 元素,保留匹配到的项
|
|
|
+ return result.length > 0 ? result : []
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//扣除商品数量
|
|
|
const weightRef=ref(null)
|
|
|
const cutBarcode = (itemActive, count) => {
|
|
|
@@ -236,7 +279,9 @@ const cutBarcode = (itemActive, count) => {
|
|
|
if (!totalWeight.value) {
|
|
|
tips.value = '请输入重量';
|
|
|
weightRef.value?.focus()
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请输入重量' });
|
|
|
} else {
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请点击结束复核' });
|
|
|
tips.value = '商品扫描完成,请点击结束复核';
|
|
|
}
|
|
|
}
|