Просмотр исходного кода

海康上架-新增最后一个完成任务

zhaohuanhuan 3 недель назад
Родитель
Сommit
421c89087c
2 измененных файлов с 26 добавлено и 4 удалено
  1. 13 1
      src/api/haikang/index.ts
  2. 13 3
      src/views/haikang/putaway/putaway/index.vue

+ 13 - 1
src/api/haikang/index.ts

@@ -71,12 +71,24 @@ export function boxReturn(data:any) {
     data
   })
 }
+
+/**
+ * 完成站点任务
+ */
+export function releaseCustomTaskStation(params:any) {
+  return request({
+    url: '/api/wms/robot/task/releaseCustomTaskStation',
+    method: 'post',
+    params,
+  })
+}
+
 /**
  * 海康料箱入库接口
  */
 export function taskContinue(params:any) {
   return request({
-    url: 'api/wms/robot/task/taskContinue',
+    url: '/api/wms/robot/task/taskContinue',
     method: 'post',
     params,
   })

+ 13 - 3
src/views/haikang/putaway/putaway/index.vue

@@ -117,6 +117,7 @@ import GoBoxBack from '@/views/haikang/putaway/components/GoBoxBack.vue'
 import { boxReturn,taskContinue, getShelveItemInfo, outboundEmptyBoxAndBindTask, setBoxInboundInventory } from '@/api/haikang'
 import { closeLoading, showLoading } from '@/utils/loading'
 import {useRoute} from "vue-router";
+import {releaseCustomTaskStation} from "../../../../api/haikang";
 try {
   getHeader()
   androidFocus()
@@ -459,7 +460,7 @@ const setPutaway=async (type)=>{
     })
       .then(() => {
         showLoading()
-        const {container,asnCode,stationCode,locationId}=locationDetailList.value[0]
+        const {container,asnCode,stationCode,locationId,equipment}=locationDetailList.value[0]
         const apiCall = mode.value
           ? boxReturn
           : taskContinue
@@ -469,6 +470,10 @@ const setPutaway=async (type)=>{
         apiCall(params).then(res=>{
           closeLoading()
           scanSuccess()
+          if(!mode.value && stationCode && dataList.value[0]?.remainBoxCount==1 ){
+            const params = {warehouse, stationCode, taskCode: equipment}
+            releaseCustomTaskStation(params).then(res=>{})
+          }
           tips.value = `${boxLabel.value}回库成功,请继续扫描${boxLabel.value}编号`
           showNotify({ type: 'success', duration: 3000, message: `${boxLabel.value}回库成功,请继续扫描${boxLabel.value}编号` })
           reset()
@@ -493,13 +498,18 @@ const setGoBack=async (item)=>{
   const res= await _setBoxInboundInventory()
   if(res){
     if(item.active==1){
-      const {warehouse,container,boxCode,asnCode,stationCode,locationId}=barcodeActive.value
+      const {warehouse,container,boxCode,asnCode,stationCode,locationId,equipment}=barcodeActive.value
       showLoading()
       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=>{
+      const boxRes= await apiCall(params).then(res=>{
+        if(!mode.value && stationCode && dataList.value[0]?.remainBoxCount==1 ){
+          const params = {warehouse, stationCode, taskCode: equipment}
+          releaseCustomTaskStation(params).then(res=>{})
+        }
+      }).catch(err=>{
         closeLoading()
       })
       closeLoading()