|
|
@@ -77,7 +77,7 @@
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<tr v-for="(item, index) in orderList" :key="index" v-if="orderList.length>0">
|
|
|
- <td>{{ item.barcode }}</td>
|
|
|
+ <td>{{ item.barcode }} <van-tag type="success" v-if="item.universalCode">万用</van-tag></td>
|
|
|
<td>{{item.qty}}/{{item.qtyOrdered}}</td>
|
|
|
<td>{{ item.qty }}</td>
|
|
|
<td v-if="isUniqueCode">
|
|
|
@@ -173,12 +173,12 @@ const _handlerScan = (code) => {
|
|
|
if (code) {
|
|
|
const barcode = [...new Set(
|
|
|
orderList.value
|
|
|
- .flatMap(item => [item.barcode, item.barcode2, item.sku])
|
|
|
- .filter(value => value !== null && value !== '' && value !== undefined)
|
|
|
+ .flatMap(item => [item.barcode, item.barcode2, item.sku, item.universalCode])
|
|
|
+ .filter(value => value !== null && value !== '' && value !== undefined),
|
|
|
)];
|
|
|
const checkBarcode = barcodeToUpperCase(code);
|
|
|
if (barcode.some(item => barcodeToUpperCase(item) === checkBarcode)) {
|
|
|
- matchBarcodeList.value=orderList.value.filter(item=>((item.barcode===checkBarcode || item.sku===checkBarcode || item.barcode2===checkBarcode) && item.qty>0) )
|
|
|
+ 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){
|
|
|
@@ -284,22 +284,26 @@ const endCheck=()=>{
|
|
|
showNotify({ type: 'warning', duration: 3000, message: '商品未扫描完成,请先扫描商品' });
|
|
|
return
|
|
|
}
|
|
|
- if(Object.keys(orderMap.value.dataGroup)===0){
|
|
|
- scanError()
|
|
|
- tips.value = '暂无需装箱数据,请刷新数据';
|
|
|
- showNotify({ type: 'warning', duration: 3000, message: '暂无需装箱数据,请刷新数据' });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!totalWeight.value) {
|
|
|
+ const lastNumber=Object.keys(orderMap.value.dataGroup).length
|
|
|
+ if (!totalWeight.value && lastNumber>0) {
|
|
|
tips.value = '请输入重量';
|
|
|
scanError()
|
|
|
showNotify({ type: 'warning', duration: 3000, message: '请输入重量' });
|
|
|
weightRef.value?.focus()
|
|
|
return
|
|
|
}
|
|
|
- const lastNumber=Object.keys(orderMap.value.dataGroup).length
|
|
|
+ if (lastNumber > 0) {
|
|
|
+ const dataGroup = orderMap.value.dataGroup
|
|
|
+ for (const order of Object.values(dataGroup)) {
|
|
|
+ for (const item of order) {
|
|
|
+ if (item.qty !== 0) {
|
|
|
+ item.quantity = item.qty
|
|
|
+ item.qty = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
packingRequests(0,lastNumber)
|
|
|
-
|
|
|
}
|
|
|
//装箱
|
|
|
const reversePickingRef=ref(null)
|
|
|
@@ -309,15 +313,12 @@ const packingRequests = async (startIndex = 0, lastNumber) => {
|
|
|
return
|
|
|
}
|
|
|
try {
|
|
|
- const getNonEmptyList = (list) => list.length ? list : undefined;
|
|
|
const key = Object.keys(orderMap.value.dataGroup)[startIndex];
|
|
|
const list = orderMap.value.dataGroup[key] || [];
|
|
|
const groupDetailList = list.map(items => {
|
|
|
return {
|
|
|
lotNum: items.lotNum,
|
|
|
qty: items.quantity,
|
|
|
- serialNoList: getNonEmptyList(items.serialNoList),
|
|
|
- secondSerialNoList: getNonEmptyList(items.secondSerialNoList),
|
|
|
};
|
|
|
});
|
|
|
const item = list[0] || {};
|
|
|
@@ -393,6 +394,7 @@ const setBarcode = (code) => {
|
|
|
}
|
|
|
matchBarcodeList.value=[]
|
|
|
scanBarcode.value=''
|
|
|
+ totalWeight.value=''
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
scanError()
|
|
|
@@ -419,6 +421,9 @@ const getDataList = (data) => {
|
|
|
data.forEach(curr => {
|
|
|
curr.serialNoList = []
|
|
|
curr.secondSerialNoList = []
|
|
|
+ if (curr.universalBarcode) {
|
|
|
+ curr.universalCode = '#@@@@@@#'
|
|
|
+ }
|
|
|
curr.quantity=0
|
|
|
if (curr.releaseStatus === 'H') {
|
|
|
groupOrder(curr, groupedData.freezeGroup, curr.orderNo, freezeList) // 处理冻结订单
|