Procházet zdrojové kódy

Merge remote-tracking branch 'origin/testing' into testing

lisongyi před 2 měsíci
rodič
revize
003debf9f7

+ 2 - 0
src/views/inbound/takeDelivery/task/index.vue

@@ -690,6 +690,7 @@ const onConfirm = () => {
   if(isCheck()){
     const lotMap = toMap(lotData.value, 'field', 'mapping')
     const { asnLineNo, asnNo, warehouse,customerId } = asnInfo.value
+    const {taskNo: taskCode } = taskInfo.value
     const data = {
       asnLineNo,
       asnNo,
@@ -699,6 +700,7 @@ const onConfirm = () => {
       customerId,
       serialNos: uniqueCodeList.value.length > 0 ? uniqueCodeList.value : undefined,
       ...lotMap,
+      taskNo:taskCode
     }
     showLoading()
     inputBarcodeType.value='task'

+ 24 - 2
src/views/outbound/picking/list/index.vue

@@ -170,6 +170,8 @@ const count=ref('')
 const countRef= ref(null)
 const countTrueFalseBy=ref(false)
 const  activeItem=ref({})
+// 存储需要跳转的库位(当弹框显示时扫描到库位)
+const pendingLocationJump=ref('')
 //容器号ref
 const scanCountRef = ref(null)
 onMounted(() => {
@@ -373,7 +375,8 @@ const _handlerScan=(code)=> {
       scannedLocation = locationContainerMap.value[barcodeToUpperCase(code)]
     }
     if (taskMap.value[barcodeToUpperCase(scannedLocation)]) {
-      // 扫描到当前任务中的库位,自动确认
+      // 扫描到当前任务中的库位,自动确认,接口成功后再跳转
+      pendingLocationJump.value = barcodeToUpperCase(scannedLocation)
       onSubmitCount()
       return
     }
@@ -709,7 +712,6 @@ const _setPickingDetail=(params,type)=>{
         }
       })
     }
-    scanSuccess()
     if(selectTask.value.length===taskItem.value.length){
       showDialog({
         title: '温馨提示',
@@ -724,12 +726,32 @@ const _setPickingDetail=(params,type)=>{
         }
       })
     }
+    // 如果任务全部完成,则不跳转,优先执行完成逻辑
+    if (selectTask.value.length === taskItem.value.length) {
+      pendingLocationJump.value = '' // 清空待跳转标记
+      scanSuccess()
+    } else {
+      // 检查是否有待跳转的库位(弹框显示时扫描库位的情况)
+      if (pendingLocationJump.value) {
+        nextTick(() => {
+          nextLocation.value = ''
+          activeIndex.value = locationList.value.findIndex(item => item.location === pendingLocationJump.value)
+          onScan(3)
+          scanSuccess()
+          pendingLocationJump.value = '' // 清空标记
+        })
+      } else {
+        scanSuccess()
+      }
+    }
   }).catch((err)=> {
     closeLoading()
     scanBarcode.value = ''
     onScan(4)
     messageTips.value = err.message
     scanError()
+    // 接口调用失败,清空待跳转库位标记
+    pendingLocationJump.value = ''
     if(err.code=='ERR_NETWORK'){
       messageTips.value = '网络开小车了,请稍后重试!'
     }if(err.code=='ECONNABORTED'){

+ 2 - 0
src/views/robot/takeDelivery/task/index.vue

@@ -695,6 +695,7 @@ const onConfirm = () => {
   if(isCheck()){
     const lotMap = toMap(lotData.value, 'field', 'mapping')
     const { asnLineNo, asnNo, warehouse } = asnInfo.value
+    const {taskNo: taskCode } = taskInfo.value
     const data = {
       asnLineNo,
       asnNo,
@@ -703,6 +704,7 @@ const onConfirm = () => {
       warehouse,
       serialNos: uniqueCodeList.value.length > 0 ? uniqueCodeList.value : undefined,
       ...lotMap,
+      taskNo:taskCode
     }
     showLoading()
     inputBarcodeType.value='task'