Przeglądaj źródła

海康-上架回库优化

zhaohuanhuan 8 miesięcy temu
rodzic
commit
38430bfe69

+ 0 - 0
src/views/haikang/putaway/components/GoBack.vue → src/views/haikang/putaway/components/GoBoxBack.vue


+ 10 - 4
src/views/haikang/putaway/putaway/index.vue

@@ -58,7 +58,7 @@
       </div>
     </div>
     <input-barcode ref="inputBarcodeRef" @setBarcode="_handlerScan" />
-    <go-back ref="goBackRef"   v-model:scanType="scanType" @setGoBack="setGoBack"  />
+    <go-box-back ref="goBackRef"   v-model:scanType="scanType" @setGoBack="setGoBack"  />
     <van-action-sheet v-model:show="equipmentTrueFalseBy" cancel-text="取消" description="请选择分拨墙" close-on-click-action>
       <van-cell-group>
         <van-cell v-for="(value,key) in equipmentMap" @click="selectEquipment(key)">
@@ -79,7 +79,7 @@ import { showNotify } from 'vant'
 import { barcodeToUpperCase, toMap } from '@/utils/dataType'
 import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
 import Box from '@/views/haikang/putaway/components/Box.vue'
-import GoBack from '@/views/haikang/putaway/components/GoBack.vue'
+import GoBoxBack from '@/views/haikang/putaway/components/GoBoxBack.vue'
 import { boxReturn, getShelveItemInfo, outboundEmptyBoxAndBindTask, setBoxInboundInventory } from '@/api/haikang'
 import { closeLoading, showLoading } from '@/utils/loading'
 try {
@@ -334,12 +334,15 @@ const setPutaway=async (type)=>{
   }
 }
 const setGoBack=async (item)=>{
-  console.log(item,'回库')
   const res= await _setBoxInboundInventory()
   if(res){
     if(item.active==1){
       const {warehouse,container,boxCode,asnCode}=barcodeActive.value
-      const boxRes= await boxReturn({warehouse,container,boxCode,externalCode:asnCode})
+      showLoading()
+      const boxRes= await boxReturn({warehouse,container,boxCode,externalCode:asnCode}).catch(err=>{
+        closeLoading()
+      })
+      closeLoading()
       if(boxRes){
         reset()
         barcodeActive.value={}
@@ -353,7 +356,9 @@ const setGoBack=async (item)=>{
       }
     }else if(item.active==2){
       const {warehouse,container,boxCode,lotNum,asnCode}=barcodeActive.value
+      showLoading()
       const boxRes= await outboundEmptyBoxAndBindTask({warehouse,container,originalBoxCode:boxCode,lotNum,boxType:item.bin,boxEmpty:item.boxEmpty,externalCode:asnCode}).catch((err=>{
+        closeLoading()
         reset()
         barcodeActive.value={}
         workBinNo.value=''
@@ -363,6 +368,7 @@ const setGoBack=async (item)=>{
         tips.value = `请扫描料箱编号`
         scanError()
       }))
+      closeLoading()
       if(boxRes){
         reset()
         barcodeActive.value={}