|
|
@@ -135,6 +135,7 @@ import { basicStore } from '@/store/modules/basic'
|
|
|
import InputBarcode from '@/views/outbound/components/InputBarcode.vue'
|
|
|
import LotAtt from '@/views/outbound/components/lotAtt.vue'
|
|
|
import { barcodeCombine } from '@/views/outbound/picking/list/hooks/barcodeCombine'
|
|
|
+import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
onUnmounted(() => {
|
|
|
closeListener()
|
|
|
})
|
|
|
@@ -461,11 +462,13 @@ const setCombine=(data)=>{
|
|
|
showToast({duration:5000,message:'当前容器下已有其他批次产品,请更换容器号'})
|
|
|
return false;
|
|
|
}
|
|
|
- _setPickingDetail(data,0)
|
|
|
+ _setPickingDetail(data,2)
|
|
|
}
|
|
|
const _setPickingDetail=(params,type)=>{
|
|
|
//扣减库存
|
|
|
+ showLoading()
|
|
|
setPickingDetail(params).then((res)=>{
|
|
|
+ closeLoading()
|
|
|
jumpLoading.value = false;
|
|
|
if (res.data == false) {
|
|
|
showDialog({
|
|
|
@@ -491,24 +494,27 @@ const _setPickingDetail=(params,type)=>{
|
|
|
};
|
|
|
selectTask.value.push(task);
|
|
|
})
|
|
|
- // 更新 locationList 中的 operationTime
|
|
|
- params.forEach((param, index) => {
|
|
|
- if (locationList.value[activeIndex.value].list[index]) {
|
|
|
- locationList.value[activeIndex.value].list[index].operationTime = param.operationTime;
|
|
|
- locationList.value[activeIndex.value].list[index].count = param.quantity;
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
+ // 更新 locationList 中的 operationTime
|
|
|
+ params.forEach((param, index) => {
|
|
|
+ if (locationList.value[activeIndex.value].list[index]) {
|
|
|
+ locationList.value[activeIndex.value].list[index].operationTime = param.operationTime;
|
|
|
+ locationList.value[activeIndex.value].list[index].count = param.quantity;
|
|
|
+ locationList.value[activeIndex.value].list[index].quantity = param.quantity;
|
|
|
+ }
|
|
|
+ });
|
|
|
//验证库位里的所有商品是否都存在拣货时间
|
|
|
- const allOperationTimeExist = locationList.value[activeIndex.value].list.every(item => item.operationTime);
|
|
|
- if(allOperationTimeExist){
|
|
|
- onScan(2)
|
|
|
- }else {
|
|
|
- onScan(3)
|
|
|
+ const { list } = locationList.value[activeIndex.value];
|
|
|
+ const allOperationTimeExist = list.every(({ operationTime }) => operationTime); // 检查所有商品是否都有拣货时间
|
|
|
+ if (!allOperationTimeExist) {
|
|
|
+ onScan(3); // 如果有商品缺少拣货时间,直接调用 onScan(3)
|
|
|
+ } else {
|
|
|
+ const numberExist = list.every(({ expectedQuantity, quantity }) => expectedQuantity == quantity && quantity!=0); // 检查数量是否匹配
|
|
|
+ onScan(numberExist ? 2 : 3)
|
|
|
}
|
|
|
if(type==1){
|
|
|
locationList.value[activeIndex.value].list.forEach(items=>{
|
|
|
- if(items.line==item.line){
|
|
|
+ if(items.line==params[0].line){
|
|
|
items.count=0
|
|
|
}
|
|
|
})
|
|
|
@@ -526,14 +532,17 @@ const _setPickingDetail=(params,type)=>{
|
|
|
})
|
|
|
}
|
|
|
}).catch((err)=> {
|
|
|
+ closeLoading()
|
|
|
scanBarcode.value = ''
|
|
|
onScan(4)
|
|
|
messageTips.value = err.message
|
|
|
scanError()
|
|
|
- if(err.code!='ERR_NETWORK'){
|
|
|
- showFailToast({duration:5000,message:err.message})
|
|
|
- }else {
|
|
|
+ if(err.code=='ERR_NETWORK'){
|
|
|
messageTips.value = '网络开小车了,请稍后重试!'
|
|
|
+ }if(err.code=='ECONNABORTED'){
|
|
|
+ messageTips.value = '请求超时,请稍后重试!'
|
|
|
+ }else {
|
|
|
+ showFailToast({duration:5000,message:err.message})
|
|
|
}
|
|
|
jumpLoading.value=false
|
|
|
})
|
|
|
@@ -608,7 +617,6 @@ const activeClass=(item)=>{
|
|
|
}else if(item.operationTime!=null){
|
|
|
return 'allActive'
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
//刷新页面
|
|
|
const loading = ref(false)
|