소스 검색

库位合并-增加强制完成料箱任务

zh 2 달 전
부모
커밋
34ecb84b78
2개의 변경된 파일46개의 추가작업 그리고 1개의 파일을 삭제
  1. 15 0
      src/api/location/merge.ts
  2. 31 1
      src/views/robot/merge/index.vue

+ 15 - 0
src/api/location/merge.ts

@@ -17,6 +17,7 @@ export interface LocationMergeDetails {
   barcode?: string
   productName?: string
   lotNumber?: string
+  lotNum?: string
   owner?: string
   qualityStatus?: string
   warehouseType?: string
@@ -150,6 +151,20 @@ export function getWorkingMergeTasks(warehouse: string) {
   })
 }
 
+/**
+ * 强制完成料箱任务
+ * @param warehouse 仓库
+ * @param stationCode 站点编码
+ * @param boxCode 料箱编码
+ */
+export function forceCompleteBoxTask(warehouse: string, stationCode: string, boxCode: string | null) {
+  return request<boolean>({
+    url: '/api/wms/location/merge/forceCompleteBoxTask',
+    method: 'get',
+    params: { warehouse, stationCode, boxCode }
+  })
+}
+
 /**
  * 海康-站点解绑
  * @param data

+ 31 - 1
src/views/robot/merge/index.vue

@@ -277,7 +277,7 @@ import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
 import { onMounted, onUnmounted, ref, reactive, nextTick } from 'vue'
 import { showToast, showLoadingToast, closeToast } from 'vant'
 import { useStore } from '@/store/modules/user'
-import { getWorkingDetailsByBox, getBoxSplitCode, boxAndStationUnbindTask, reissueTask, getBoxStatus, type BoxRelatedMergeDetailsVO, type LocationMergeDetails } from '@/api/location/merge'
+import { getWorkingDetailsByBox, getBoxSplitCode, boxAndStationUnbindTask, reissueTask, getBoxStatus, forceCompleteBoxTask, type BoxRelatedMergeDetailsVO, type LocationMergeDetails } from '@/api/location/merge'
 import { getInventory, inventoryMovement } from '@/api/inventory'
 import { showConfirmDialog } from 'vant'
 import { getHeader, androidFocus, goBack, scanError, scanSuccess } from '@/utils/android'
@@ -569,6 +569,12 @@ const resetProductInfo = () => {
 const loadBoxData = async (code: string) => {
   if (!code) return
 
+  // 检查是否为站台编码(以RLOCHK开头)
+  if (code.startsWith('RLOCHK')) {
+    handleStationCodeForceComplete(code)
+    return
+  }
+
   try {
     showLoadingToast({ message: '加载中...', forbidClick: true })
 
@@ -914,6 +920,30 @@ const handleStationClick = (station: StationItem) => {
   selectStation(station)
 }
 
+// 处理站台编码强制完成任务
+const handleStationCodeForceComplete = async (stationCode: string) => {
+  showConfirmDialog({
+    title: '强制完成任务',
+    message: `检测到站台编码:${stationCode},是否强制完成该站台料箱任务?`
+  }).then(async () => {
+    try {
+      showLoadingToast({ message: '正在强制完成任务...', forbidClick: true })
+      await forceCompleteBoxTask(warehouse, stationCode, null)
+      closeToast()
+      scanSuccess()
+      showToast('强制完成任务成功')
+      // 重新加载数据
+      refreshBoxData()
+    } catch (error: any) {
+      closeToast()
+      scanError()
+      showToast(error.message || '强制完成任务失败')
+    }
+  }).catch(() => {
+    // 用户取消
+  })
+}
+
 // 显示重新下发确认框
 const showReissueConfirm = (station: StationItem) => {
   showConfirmDialog({