Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

lisongyi 2 miesięcy temu
rodzic
commit
21626f00b5

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

@@ -684,6 +684,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,
@@ -693,6 +694,7 @@ const onConfirm = () => {
       customerId,
       serialNos: uniqueCodeList.value.length > 0 ? uniqueCodeList.value : undefined,
       ...lotMap,
+      taskNo:taskCode
     }
     showLoading()
     inputBarcodeType.value='task'

+ 1 - 0
src/views/inventory/moveTask/putaway/index.vue

@@ -318,6 +318,7 @@ const _moveTaskDown=()=>{
 }
 const setBarcode=(item)=>{
   activeBarcode.value=item
+  searchBarcode.value=item.barcode
   lotBarcodeTrueFalseBy.value=false;
   _getLocation(item)
 }

+ 1 - 1
src/views/inventory/transfer/index.vue

@@ -234,7 +234,7 @@ const _handlerScan = (code) => {
       warehouse,
       barcode: productBarcode.value,
       location: sourceLocation.value,
-      locationRegexp: '^(?!STAGE_|SORTATION_).*$',
+      locationRegexp: '^(?!STAGE_|SORTATION_|TRANSFER_).*$',
     }
     showLoading()
     getInventory(params).then(res => {

+ 1 - 1
src/views/outbound/check/moveStock/index.vue

@@ -282,7 +282,7 @@ const _getInventoryList = async (barcode) => {
     }
     scanSuccess()
     searchBarcode.value= res.data[0].sku
-    const params={ warehouse, barcode,locationRegexp:'^(?!STAGE_|SORTATION_|REVERSEPICK_|FJ-).*$',queryLocationInfo:true }
+    const params={ warehouse, barcode,locationRegexp:'^(?!STAGE_|SORTATION_|REVERSEPICK_|FJ-|TRANSFER_).*$',queryLocationInfo:true }
     if(barcode==='') return
     getInventory(params).then(res=>{
       totalList.value=res.data

+ 55 - 11
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(() => {
@@ -363,6 +365,35 @@ const onScan = (type) => {
 const barcodeCombineRef=ref(null)
 //扫描条码监听
 const _handlerScan=(code)=> {
+  // 如果数量弹框正在显示,检查是否需要自动确认
+  if (countTrueFalseBy.value) {
+    const modelLocative = locationList.value[activeIndex.value]
+
+    // 检查是否扫描到当前数据内的库位
+    let scannedLocation = code
+    if (locationContainerMap.value[barcodeToUpperCase(code)]) {
+      scannedLocation = locationContainerMap.value[barcodeToUpperCase(code)]
+    }
+    if (taskMap.value[barcodeToUpperCase(scannedLocation)]) {
+      // 扫描到当前任务中的库位,自动确认,接口成功后再跳转
+      pendingLocationJump.value = barcodeToUpperCase(scannedLocation)
+      onSubmitCount()
+      return
+    }
+
+    // 检查是否扫描到当前库位内的商品条码
+    const barcodeList = [...new Set(
+      modelLocative.list
+        .flatMap(item => [item.barcode, item.barcodeAs])
+        .filter(value => value !== null)
+    )]
+    if (barcodeList.some(item => barcodeToUpperCase(item) === barcodeToUpperCase(code))) {
+      // 扫描到当前库位内的条码,自动确认
+      onSubmitCount()
+      return
+    }
+  }
+
   if(scanType.value===1){
     if(code.split('-')[0]!=='JH'){
        showToast({duration:5000,message:'请使用标准拣货容器'})
@@ -444,12 +475,8 @@ const _handlerScan=(code)=> {
               onScan(4)
               activeItem.value=activeBarcode
               countTrueFalseBy.value=true
-              setTimeout(()=>{
-                countRef.value?.focus()
-              },200)
               // setTimeout(()=>{
-              //   //匹配到条码扣减库存
-              //   onCount(activeBarcode,0)
+              //   countRef.value?.focus()
               // },200)
             }).catch(()=>{
               const allOperationTimeExist = modelLocative.list.every(({ operationTime }) => operationTime);
@@ -465,11 +492,9 @@ const _handlerScan=(code)=> {
             //匹配到条码扣减库存
             activeItem.value=activeBarcode
             countTrueFalseBy.value=true
-            setTimeout(()=>{
-              countRef.value?.focus()
-            },200)
-            // onCount(activeBarcode,0)
-          // },200)
+            // setTimeout(()=>{
+            //   countRef.value?.focus()
+            // },200)
         }
     }else{
       //查询组合条码
@@ -687,7 +712,6 @@ const _setPickingDetail=(params,type)=>{
         }
       })
     }
-    scanSuccess()
     if(selectTask.value.length===taskItem.value.length){
       showDialog({
         title: '温馨提示',
@@ -702,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

@@ -689,6 +689,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,
@@ -697,6 +698,7 @@ const onConfirm = () => {
       warehouse,
       serialNos: uniqueCodeList.value.length > 0 ? uniqueCodeList.value : undefined,
       ...lotMap,
+      taskNo:taskCode
     }
     showLoading()
     inputBarcodeType.value='task'