|
|
@@ -128,7 +128,7 @@ import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
|
|
|
import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
|
|
|
import { useStore } from '@/store/modules/user'
|
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
-import { getPendingReviewTask, reversePicking } from '@/api/check'
|
|
|
+import { getOrderPacking, getPendingReviewTask, reversePicking } from '@/api/check'
|
|
|
import { barcodeToUpperCase } from '@/utils/dataType'
|
|
|
import { showConfirmDialog, showDialog, showNotify, showToast } from 'vant'
|
|
|
import { fluxPrint } from '@/api/picking'
|
|
|
@@ -150,8 +150,7 @@ onMounted(() => {
|
|
|
loadData()
|
|
|
})
|
|
|
const warehouse = store.warehouse
|
|
|
-//SOZ25070900018
|
|
|
-const orderNo = ref('')
|
|
|
+const orderNo = ref('SOZ25072200017')
|
|
|
// 错误提示
|
|
|
const tips = ref('请扫描订单/快递单号')
|
|
|
//强制返回
|
|
|
@@ -160,6 +159,8 @@ const scanBarcode = ref('')
|
|
|
const inputBarcodeRef = ref(null)
|
|
|
// 订单明细
|
|
|
const orderDetail = ref({})
|
|
|
+//装箱明细
|
|
|
+const packingDetailMap=ref({})
|
|
|
const isUniqueCode = ref(false)
|
|
|
const statusMap = {
|
|
|
'00': '创建',
|
|
|
@@ -417,7 +418,7 @@ const resetPackingStatus=()=>{
|
|
|
//重置装箱
|
|
|
const packingListRef=ref(null)
|
|
|
const resetPacking=()=>{
|
|
|
- packingListRef.value?.show(orderDetail.value.orderPacking,orderDetail.value)
|
|
|
+ packingListRef.value?.show(packingDetailMap.value,orderDetail.value)
|
|
|
}
|
|
|
|
|
|
//重新开始
|
|
|
@@ -469,6 +470,7 @@ const onPrint=(code)=>{
|
|
|
const setBarcode = (code) => {
|
|
|
const data = { warehouse, code, activityOrderFlag: true }
|
|
|
showLoading()
|
|
|
+ packingDetailMap.value={}
|
|
|
getPendingReviewTask(data).then(res => {
|
|
|
if (res.data.details.length == 0) {
|
|
|
scanError()
|
|
|
@@ -489,6 +491,7 @@ const setBarcode = (code) => {
|
|
|
orderNo.value = code
|
|
|
orderDetail.value = res.data
|
|
|
tips.value = '请扫描商品条码'
|
|
|
+ _getOrderPacking(res.data.orderNo)
|
|
|
scanSuccess()
|
|
|
// 处理每个详情项
|
|
|
res.data.details.forEach((item) => {
|
|
|
@@ -566,7 +569,26 @@ const _reversePicking = () => {
|
|
|
closeLoading()
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+const _getOrderPacking=(orderNo)=>{
|
|
|
+ getOrderPacking({ warehouse, orderNo }).then(res => {
|
|
|
+ const mergedList = Object.values(
|
|
|
+ res.data.reduce((acc, item) => {
|
|
|
+ const { sku, qty } = item;
|
|
|
+ acc[sku] = acc[sku] || { ...item, qty: 0 }
|
|
|
+ acc[sku].qty += qty;
|
|
|
+ return acc;
|
|
|
+ }, {})
|
|
|
+ );
|
|
|
+ packingDetailMap.value = mergedList.reduce((acc, item) => {
|
|
|
+ const { traceId } = item;
|
|
|
+ acc[traceId] = acc[traceId] || []
|
|
|
+ acc[traceId].push(item);
|
|
|
+ return acc;
|
|
|
+ }, {});
|
|
|
+ }).catch(err => {
|
|
|
+ packingDetailMap.value = {};
|
|
|
+ });
|
|
|
+}
|
|
|
const rowStyle=( row )=>{
|
|
|
if(row.isPacking){
|
|
|
return { background: '#E6A23C'}
|