Explorar el Código

手持-海康上架-料箱回库调整接口,兼容上架文案

zhaohuanhuan hace 4 semanas
padre
commit
12acd3e052
Se han modificado 2 ficheros con 45 adiciones y 24 borrados
  1. 10 0
      src/api/haikang/index.ts
  2. 35 24
      src/views/haikang/putaway/putaway/index.vue

+ 10 - 0
src/api/haikang/index.ts

@@ -71,6 +71,16 @@ export function boxReturn(data:any) {
     data
   })
 }
+/**
+ * 海康料箱入库接口
+ */
+export function taskContinue(params:any) {
+  return request({
+    url: 'api/wms/robot/task/taskContinue',
+    method: 'post',
+    params,
+  })
+}
 
 /**
  * 调空料箱并回库

+ 35 - 24
src/views/haikang/putaway/putaway/index.vue

@@ -5,18 +5,18 @@
         <van-icon name="arrow-left" size="25" /><div style="color: #fff">返回</div>
       </template>
       <template #right>
-        <div class="nav-right" @click="setPutaway(1)">料箱回库</div>
+        <div class="nav-right" @click="setPutaway(1)">{{ boxLabel }}回库</div>
       </template>
     </van-nav-bar>
     <div class="putaway">
       <div class="putaway-top">
         <div class="putaway-tips">
           <div style="flex: 1"><van-notice-bar left-icon="volume-o">{{ tips }}</van-notice-bar></div>
-          <div class="putaway-tips-box" v-if="dataList.length>0">剩余料箱:{{ dataList[0].remainBoxCount || 0 }}</div>
+          <div class="putaway-tips-box" v-if="dataList.length>0">剩余{{ boxLabel }}:{{ dataList[0].remainBoxCount || 0 }}</div>
         </div>
         <div class="putaway-input">
           <div class="code-input">
-            <van-field v-model="workBinNo" placeholder="请扫描料箱号" label="料箱编号:" left-icon="" :class="[scanType===1?'search-input-barcode':'']"
+            <van-field v-model="workBinNo" :placeholder="`请扫描${boxLabel}号`" :label="`${boxLabel}编号:`" left-icon="" :class="[scanType===1?'search-input-barcode':'']"
               autocomplete="off" readonly @click="setBarcodeInput(workBinNo,1)"></van-field>
             <van-field v-model="searchBarcode" placeholder="请扫描商品条码" label="商品条码:" left-icon="" readonly :class="[scanType===2?'search-input-barcode':'']"
               autocomplete="off" @click="setBarcodeInput(searchBarcode,2)"></van-field>
@@ -56,7 +56,7 @@
               :cols="barcodeActive.containerCol"
             ></shelf>
           </div>
-          <div  style="font-size: 14px;" v-if="barcodeActive.gridNum" >料箱格口:{{ barcodeActive.gridNum }}</div>
+          <div  style="font-size: 14px;" v-if="barcodeActive.gridNum" >{{ boxLabel }}格口:{{ barcodeActive.gridNum }}</div>
         </div>
       </div>
       <div class="putaway-bottom"  v-if="equipmentBarcodeList.length>0">
@@ -104,7 +104,7 @@
   </div>
 </template>
 <script setup lang="ts">
-import { onMounted, onUnmounted, ref } from 'vue'
+import { computed, onMounted, onUnmounted, ref } from 'vue'
 import { androidFocus, getHeader, goBack, playVoiceBin, scanError, scanSuccess } from '@/utils/android'
 import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
 import { useStore } from '@/store/modules/user'
@@ -114,7 +114,7 @@ import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
 import Box from '@/views/haikang/putaway/components/Box.vue'
 import Shelf from '@/views/haikang/putaway/components/Shelf.vue'
 import GoBoxBack from '@/views/haikang/putaway/components/GoBoxBack.vue'
-import { boxReturn, getShelveItemInfo, outboundEmptyBoxAndBindTask, setBoxInboundInventory } from '@/api/haikang'
+import { boxReturn,taskContinue, getShelveItemInfo, outboundEmptyBoxAndBindTask, setBoxInboundInventory } from '@/api/haikang'
 import { closeLoading, showLoading } from '@/utils/loading'
 import {useRoute} from "vue-router";
 try {
@@ -133,12 +133,13 @@ const warehouse = store.warehouse
 const dataList=ref([])
 const route = useRoute()
 const mode=ref(route.query.type)
+const boxLabel = computed(() => mode.value ? '容器' : '料箱')
 //料箱编号
 const workBinNo = ref('')
 //扫描类型
 const scanType = ref(1) //料箱1、商品条码2,站台3
 //提示
-const tips = ref('请扫描料箱编号')
+const tips = ref(mode.value ? '请扫描容器编号' : '请扫描料箱编号')
 //匹配库位条码
 const matchedBarcodeItem=ref([])
 //条码
@@ -381,8 +382,8 @@ const reset=()=>{
 const inputCheck=()=>{
   if(!workBinNo.value){
     scanType.value = 1
-    tips.value = `请扫描料箱编号`
-    showNotify({ type: 'danger', duration: 3000, message: `请扫描料箱编号` })
+    tips.value = `请扫描${boxLabel.value}编号`
+    showNotify({ type: 'danger', duration: 3000, message: `请扫描${boxLabel.value}编号` })
     scanError()
     return false
   }
@@ -447,23 +448,29 @@ const setPutaway=async (type)=>{
   }else if(type==1){
     if(locationDetailList.value.length==0){
       scanType.value = 1
-      tips.value = `请先扫描料箱编号`
-      showNotify({ type: 'danger', duration: 3000, message: `请先扫描料箱编号,查询待上架信息` })
+      tips.value = `请先扫描${boxLabel.value}编号`
+      showNotify({ type: 'danger', duration: 3000, message: `请先扫描${boxLabel.value}编号,查询待上架信息` })
       scanError()
       return false
     }
-    showConfirmDialog({
-      title: '料箱回库',
-      message: `${ workBinNo.value },是否执行料箱回库?`,
+      showConfirmDialog({
+      title: `${boxLabel.value}回库`,
+      message: `${ workBinNo.value },是否执行${boxLabel.value}回库?`,
     })
       .then(() => {
         showLoading()
         const {container,asnCode,stationCode,locationId}=locationDetailList.value[0]
-        boxReturn({warehouse,container,boxCode:workBinNo.value,stationCode,locationId,externalCode:asnCode,taskType:mode.value?'ASRS':'HIK'}).then(res=>{
+        const apiCall = mode.value
+          ? boxReturn
+          : taskContinue
+        const params = mode.value
+          ? {warehouse,container,boxCode:workBinNo.value,stationCode,locationId,externalCode:asnCode,taskType:'ASRS'}
+          : {warehouse, boxCode: workBinNo.value, stationCode, externalCode: asnCode, emptyRobot: false}
+        apiCall(params).then(res=>{
           closeLoading()
           scanSuccess()
-          tips.value = `料箱回库成功,请继续扫描料箱编号`
-          showNotify({ type: 'success', duration: 3000, message: `料箱回库成功,请继续扫描料箱编号` })
+          tips.value = `${boxLabel.value}回库成功,请继续扫描${boxLabel.value}编号`
+          showNotify({ type: 'success', duration: 3000, message: `${boxLabel.value}回库成功,请继续扫描${boxLabel.value}编号` })
           reset()
           barcodeActive.value={}
           workBinNo.value=''
@@ -488,7 +495,11 @@ const setGoBack=async (item)=>{
     if(item.active==1){
       const {warehouse,container,boxCode,asnCode,stationCode,locationId}=barcodeActive.value
       showLoading()
-      const boxRes= await boxReturn({warehouse,container,boxCode,externalCode:asnCode,stationCode,locationId,taskType:mode.value?'ASRS':'HIK'}).catch(err=>{
+      const apiCall = mode.value ? boxReturn : taskContinue
+      const params = mode.value
+        ? {warehouse,container,boxCode,externalCode:asnCode,stationCode,locationId,taskType:'ASRS'}
+        : {warehouse, boxCode, stationCode, externalCode: asnCode, emptyRobot: false}
+      const boxRes= await apiCall(params).catch(err=>{
         closeLoading()
       })
       closeLoading()
@@ -500,9 +511,9 @@ const setGoBack=async (item)=>{
         searchLocation.value=''
         recommendedLocation.value=''
         scanType.value = 1
-        tips.value = `请扫描料箱编号`
+        tips.value = `请扫描${boxLabel.value}编号`
         binScanList.value=[]
-        showNotify({ type: 'success', duration: 3000, message: `请扫描下一个料箱编号` })
+        showNotify({ type: 'success', duration: 3000, message: `请扫描下一个${boxLabel.value}编号` })
         scanSuccess()
       }
     }else if(item.active==2){
@@ -518,7 +529,7 @@ const setGoBack=async (item)=>{
         recommendedLocation.value=''
         scanType.value = 1
         binScanList.value=[]
-        tips.value = `请扫描料箱编号`
+        tips.value = `请扫描${boxLabel.value}编号`
         scanError()
       }))
       closeLoading()
@@ -531,8 +542,8 @@ const setGoBack=async (item)=>{
         recommendedLocation.value=''
         scanType.value = 1
         binScanList.value=[]
-        tips.value = `料箱调取成功,请继续扫描料箱编号`
-        showNotify({ type: 'success', duration: 3000, message: `料箱调取成功,请继续扫描料箱编号` })
+        tips.value = `${boxLabel.value}调取成功,请继续扫描${boxLabel.value}编号`
+        showNotify({ type: 'success', duration: 3000, message: `${boxLabel.value}调取成功,请继续扫描${boxLabel.value}编号` })
         scanSuccess()
       }
     }
@@ -561,7 +572,7 @@ const _setBoxInboundInventory = async () => {
 //设置条码
 const inputBarcodeRef = ref(null)
 const setBarcodeInput = (code, type) => {
-  const typeMap = { 1: '请扫描料箱编号', 2: '请扫商品条码', 3: '请扫站台编号', 4: '请扫上架库位' }
+  const typeMap = { 1: `请扫描${boxLabel.value}编号`, 2: '请扫商品条码', 3: '请扫站台编号', 4: '请扫上架库位' }
   scanType.value = type
   inputBarcodeRef.value?.show(code, typeMap[type])
 }