Explorar el Código

还库任务-优化2

zhaohuanhuan hace 1 mes
padre
commit
c9b181dd58

+ 11 - 0
src/views/inventory/returnTask/bin/index.vue

@@ -271,9 +271,11 @@ const onSelectMode = async (value) => {
     }).then(() => {
       showLoading()
       returnTaskAbandon({taskNo: taskNo.value}).then(res => {
+        scanSuccess()
         router.push({name: 'ReturnList'})
         showToast({duration: 3000, message: '当前任务已放弃正在跳转到任务页面,请稍后~'})
       }).catch((err) => {
+        scanError()
         tips.value = `${err.message}`
       }).finally(_ => {
         closeLoading()
@@ -305,6 +307,12 @@ const onClickRightIcon = () => {
 }
 // 完成任务
 const onComplete = () => {
+  if(binList.value.length==0){
+    scanError()
+    tips.value = '当前未扫描商品,请先扫描商品条码'
+    showToast({duration: 3000, message: tips.value})
+    return
+  }
   showConfirmDialog({
     title: '温馨提示',
     message:
@@ -322,11 +330,14 @@ const onComplete = () => {
 const _returnTaskFirstStepComplete=(callHikQuickIn)=>{
   showLoading()
   returnTaskFirstStepComplete({taskNo:taskNo.value,callHikQuickIn}).then(res => {
+    scanSuccess()
     if(callHikQuickIn){
       router.replace({ name: 'ReturnTask', query: { code:taskNo.value,container:containerNo.value } });
     }else {
       router.push({name: 'ReturnList'})
     }
+  }).catch(err=>{
+    scanError()
   }).finally(_ => {
     closeLoading()
   })

+ 3 - 0
src/views/inventory/returnTask/list/index.vue

@@ -211,7 +211,10 @@ const onComplete = (item) => {
 const _returnTaskFirstStepComplete=(callHikQuickIn,item)=>{
   showLoading()
   returnTaskFirstStepComplete({taskNo:item.taskNo,callHikQuickIn}).then(res => {
+    scanSuccess()
     router.replace({ name: 'ReturnTask', query: { code:item.taskNo,container:item.containerNo } });
+  }).catch(err=>{
+    scanError()
   }).finally(_ => {
     closeLoading()
   })

+ 2 - 2
src/views/inventory/returnTask/task/index.vue

@@ -212,7 +212,7 @@ const setBarcodeInput = (code, type) => {
 // 扫描条码监听
 const _handlerScan = (code) => {
   if (scanType.value === 1) {
-    workBinNo.value = code
+    workBinNo.value = barcodeToUpperCase(code)
     // 先清空推荐库位、预计数量和匹配的条码
     recommendedLocation.value = ''
     barcodeActive.value = {}
@@ -225,7 +225,7 @@ const _handlerScan = (code) => {
     greenHighlightSet.value.clear()
     // 在binList中查找匹配的containerCode并高亮
     const matched = binList.value.filter(item =>
-        item.containerCode && (item.containerCode === code || item.containerCode.startsWith(`${code}-`))
+        item.containerCode && (item.containerCode === barcodeToUpperCase(code) || item.containerCode.startsWith(`${barcodeToUpperCase(code)}-`))
     )
     if (matched.length === 0) {
       scanError()