|
|
@@ -114,7 +114,7 @@
|
|
|
</van-row>
|
|
|
</van-dialog>
|
|
|
<!-- 装箱-->
|
|
|
- <check-packing ref="checkPackingRef" @cancelOrder="cancelOrder" @print="print"/>
|
|
|
+ <check-packing ref="checkPackingRef" @cancelOrder="cancelOrder" @resetPackingStatus="resetPackingStatus" @print="print"/>
|
|
|
<!-- 批量装箱-->
|
|
|
<batch-packing ref="batchPackingRef" @print="print" @loadData="loadData" />
|
|
|
<!-- 重置装箱-->
|
|
|
@@ -151,7 +151,7 @@ onMounted(() => {
|
|
|
})
|
|
|
const warehouse = store.warehouse
|
|
|
//SOZ25070900018
|
|
|
-const orderNo = ref('')
|
|
|
+const orderNo = ref('SOZ25070900018')
|
|
|
// 错误提示
|
|
|
const tips = ref('')
|
|
|
//强制返回
|
|
|
@@ -175,6 +175,7 @@ const statusMap = {
|
|
|
const dataList = ref([])
|
|
|
const orderList = computed(() => {
|
|
|
return dataList.value
|
|
|
+ .filter(item => item.qty !== 0 || item.isPacking)
|
|
|
.sort((a, b) => {
|
|
|
const statusPriority = {
|
|
|
'60': 0,
|
|
|
@@ -311,11 +312,13 @@ const beforeClose= (action) =>
|
|
|
}
|
|
|
resolve(true)
|
|
|
cutBarcode(matchBarcodeList.value, barcodeNumber.value)
|
|
|
+ }else {
|
|
|
+ tips.value='您已取消扣减扫描商品,请重新扫描'
|
|
|
+ scanBarcode.value=''
|
|
|
+ matchBarcodeList.value=[]
|
|
|
+ resolve(true)
|
|
|
}
|
|
|
- tips.value='您已取消扣减扫描商品,请重新扫描'
|
|
|
- scanBarcode.value=''
|
|
|
- matchBarcodeList.value=[]
|
|
|
- resolve(true)
|
|
|
+
|
|
|
});
|
|
|
const cutBarcode = (list, count) => { //扣减数量
|
|
|
let remainingCount = count // 剩余的扣减数量
|
|
|
@@ -347,9 +350,7 @@ const cutBarcode = (list, count) => { //扣减数量
|
|
|
item.qty -= remainingCount // 扣减剩余数量
|
|
|
remainingCount = 0
|
|
|
}
|
|
|
- if(item.status!='600'){
|
|
|
- item.isPacking=true
|
|
|
- }
|
|
|
+ item.isPacking=true
|
|
|
}
|
|
|
if (item.qty !== item.originalDetailAmount) {
|
|
|
updateData(item) // 更新扫描数据
|
|
|
@@ -371,18 +372,20 @@ const currPackingList=ref([])
|
|
|
const batchPackingRef=ref(null)
|
|
|
const setPacking=(type)=>{
|
|
|
if(!printer.value){
|
|
|
+ scanError()
|
|
|
showNotify({ type: 'warning', duration: 3000, message: '请先设置打印机' })
|
|
|
return
|
|
|
}
|
|
|
// 获取装箱的商品列表
|
|
|
- const currPackingList = orderList.value.filter(item => item.isPacking)
|
|
|
- if (currPackingList.length === 0) {
|
|
|
+ currPackingList.value = orderList.value.filter(item => item.isPacking)
|
|
|
+ if (currPackingList.value.length === 0) {
|
|
|
+ scanError()
|
|
|
showNotify({ type: 'warning', duration: 3000, message: '暂无未装箱数据' })
|
|
|
return
|
|
|
}
|
|
|
const materiaList = orderList.value.filter(item => item.status == '600' && item.qty > 0)
|
|
|
if (materiaList.length > 0) {
|
|
|
- const checkBarcode = new Set(currPackingList.flatMap(item => item.relatedMaterial.map(material => material.barCode)))
|
|
|
+ const checkBarcode = new Set(currPackingList.value.flatMap(item => item.relatedMaterial.map(material => material.barCode)))
|
|
|
const packingBarcodes = new Set(materiaList.map(item => item.barcode))
|
|
|
// 判断是否有装箱商品条形码与需要扫描的物料条形码重复
|
|
|
const hasCommonBarcode = [...packingBarcodes].some(barcode => checkBarcode.has(barcode))
|
|
|
@@ -393,15 +396,23 @@ const setPacking=(type)=>{
|
|
|
}
|
|
|
}
|
|
|
if (type === 'single') { // 普通装箱
|
|
|
- checkPackingRef.value?.show(currPackingList, orderDetail.value)
|
|
|
+ checkPackingRef.value?.show(currPackingList.value, orderDetail.value)
|
|
|
} else { // 批量装箱
|
|
|
- if (currPackingList.length > 1) {
|
|
|
+ if (currPackingList.value.length > 1) {
|
|
|
+ scanError()
|
|
|
showNotify({ type: 'warning', duration: 3000, message: '不支持多个商品装箱' })
|
|
|
return
|
|
|
}
|
|
|
- batchPackingRef.value?.show(currPackingList, orderDetail.value)
|
|
|
+ batchPackingRef.value?.show(currPackingList.value, orderDetail.value)
|
|
|
}
|
|
|
}
|
|
|
+//重置装箱状态
|
|
|
+const resetPackingStatus=()=>{
|
|
|
+ currPackingList.value.forEach((item) => {
|
|
|
+ item.quantity=0
|
|
|
+ delete item.isPacking
|
|
|
+ })
|
|
|
+}
|
|
|
//重置装箱
|
|
|
const packingListRef=ref(null)
|
|
|
const resetPacking=()=>{
|
|
|
@@ -424,6 +435,7 @@ const setPrinter=()=>{
|
|
|
const printer=ref(null)
|
|
|
const print=(templateCode,code)=>{
|
|
|
if(!printer.value){
|
|
|
+ scanError()
|
|
|
showNotify({ type: 'warning', duration: 3000, message: '请先设置打印机' });
|
|
|
return
|
|
|
}
|
|
|
@@ -464,7 +476,7 @@ const setBarcode = (code) => {
|
|
|
}
|
|
|
if(res.data.waveType!=='M'){
|
|
|
scanError()
|
|
|
- inputBarcodeRef.value?.show('', '请扫描订单/快递单号', '仅支持大件单复核')
|
|
|
+ inputBarcodeRef.value?.show('', '请扫描订单/快递单号', '仅支持大件单复核','')
|
|
|
return
|
|
|
}
|
|
|
scanSuccess()
|