From a3cb47d83871aa6fedc1214bb635c3ac385d3e2c Mon Sep 17 00:00:00 2001 From: zouzhiwen <409053122@qq.com> Date: Tue, 9 Jun 2026 13:38:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=AB=8B=E5=BA=93?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E3=80=81?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/generate.ts | 20 ++++ src/views/generate/TaskGenerateView.vue | 137 +++++++++++++++++++++++- 3 files changed, 157 insertions(+), 2 deletions(-) diff --git a/.env.development b/.env.development index d12f28e..f4175a7 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ # 开发环境 — 留空,走 vite.config.ts 中的 proxy -VITE_API_BASE=http://localhost:8114 +VITE_API_BASE=https://sit-api.baoshi56.com VITE_ENTRY_OPTIONS=ops,monitor diff --git a/src/api/generate.ts b/src/api/generate.ts index 3aca8c0..23cab61 100644 --- a/src/api/generate.ts +++ b/src/api/generate.ts @@ -51,6 +51,18 @@ export interface CancelReq extends MachineBaseReq { reason?: string } +export interface InboundExceptionReq { + palletCode: string + outboundStation: string + elevatorId: number + elevatorPoint: string +} + +export interface ExpediteReq { + businessNo: string + priority: number +} + export function generateInbound(data: InboundReq) { return request.post(`${BASE}/inbound`, data) } @@ -98,3 +110,11 @@ export function generateReleaseStation(data: ReleaseStationReq) { export function generateCancel(data: CancelReq) { return request.post(`${BASE}/cancel`, data) } + +export function generateInboundException(data: InboundExceptionReq) { + return request.post(`${BASE}/inboundException`, data) +} + +export function generateExpedite(data: ExpediteReq) { + return request.post(`${BASE}/expedite`, data) +} diff --git a/src/views/generate/TaskGenerateView.vue b/src/views/generate/TaskGenerateView.vue index f04b195..0bc6667 100644 --- a/src/views/generate/TaskGenerateView.vue +++ b/src/views/generate/TaskGenerateView.vue @@ -288,6 +288,48 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + 出库 + 解绑 + + +
+ + +
+ + + + + + 正常 + 加急 + 非常紧急 + + +
@@ -314,7 +356,9 @@ defineOptions({ name: 'TaskGenerateView' }) import { generateBindStation, generateCancel, + generateExpedite, generateInbound, + generateInboundException, generateMoveBatch, generateMoveBatchNew, generateOutboundNoWait, @@ -333,7 +377,7 @@ import { } from '@/api/generate' import { cancelTaskByBusinessNo } from '@/api/task' import { useDevice } from '@/composables/useDevice' -import { ElMessage } from 'element-plus' +import { ElMessage, ElMessageBox } from 'element-plus' import { computed, reactive, ref } from 'vue' const { isMobile } = useDevice() @@ -356,6 +400,8 @@ const taskTypeNavItems: { key: string; label: string }[] = [ { key: 'releaseStation', label: '解绑站点' }, { key: 'cancel', label: '取消任务(仓+容器)' }, { key: 'businessCancel', label: '业务取消' }, + { key: 'inboundException', label: '入库异常处理' }, + { key: 'expedite', label: '任务加急' }, ] const panelKey = ref('inbound') @@ -417,6 +463,20 @@ const releaseStationForm = reactive({ warehouse: '', containe const cancelForm = reactive({ warehouse: '', container: '' }) const businessCancelForm = reactive({ businessNo: '', reason: '' }) +/** 入库异常处理:出库站点与提升机点位映射(与后台 ASRSConsts 保持一致) */ +const outboundStationOptions = ['A3', 'A4'] +const elevatorOptions = [ + { id: 1, label: '提升机1号', point: '0211520SS0225040' }, + { id: 2, label: '提升机2号', point: '0228800SS0225040' }, +] +const inboundExceptionForm = reactive({ + palletCode: '', + outboundStation: 'A3', + elevatorId: 1 as number, + warehouse: 'WH01', +}) +const expediteForm = reactive({ businessNo: '' }) + function showResult(title: string, type: 'success' | 'error', detail?: unknown) { resultTitle.value = title resultType.value = type @@ -606,6 +666,81 @@ async function handleCancel() { } } +async function handleInboundException() { + if (!inboundExceptionForm.palletCode) { + return ElMessage.warning('请输入托盘码') + } + if (!inboundExceptionForm.outboundStation) { + return ElMessage.warning('请选择出库站点') + } + const elevator = elevatorOptions.find(e => e.id === inboundExceptionForm.elevatorId) + if (!elevator) { + return ElMessage.warning('请选择提升机') + } + loading.value = true + try { + await generateInboundException({ + palletCode: inboundExceptionForm.palletCode, + outboundStation: inboundExceptionForm.outboundStation, + elevatorId: elevator.id, + elevatorPoint: elevator.point, + }) + showResult('入库异常出库已提交', 'success') + ElMessage.success('入库异常出库已提交') + } catch (e) { + showResult('入库异常出库失败', 'error', e) + } finally { + loading.value = false + } +} + +async function handleInboundExceptionUnbind() { + if (!inboundExceptionForm.warehouse || !inboundExceptionForm.palletCode || !inboundExceptionForm.outboundStation) { + return ElMessage.warning('请填写仓库编码、托盘码和出库站点') + } + loading.value = true + try { + await generateReleaseStation({ + warehouse: inboundExceptionForm.warehouse, + container: inboundExceptionForm.palletCode, + station: inboundExceptionForm.outboundStation, + }) + showResult('解绑成功', 'success') + ElMessage.success('解绑成功') + } catch (e) { + showResult('解绑失败', 'error', e) + } finally { + loading.value = false + } +} + +async function handleExpedite(priority: number) { + const businessNo = expediteForm.businessNo?.trim() + if (!businessNo) { + return ElMessage.warning('请填写业务跟踪号') + } + const label = priority >= 1000 ? '非常紧急' : priority >= 500 ? '加急' : '正常' + try { + await ElMessageBox.confirm( + `确认将业务跟踪号「${businessNo}」的任务链设为${label}(优先级 ${priority})?`, + '任务加急确认', + { type: 'warning', confirmButtonText: '确认', cancelButtonText: '取消' }, + ) + } catch { + return + } + loading.value = true + try { + await generateExpedite({ businessNo, priority }) + showResult(`任务已${label}(优先级 ${priority})`, 'success') + ElMessage.success(`任务已${label}`) + } catch (e) { + showResult('任务加急失败', 'error', e) + } finally { + loading.value = false + } +} + async function handleBusinessCancel() { if (!businessCancelForm.businessNo?.trim()) { return ElMessage.warning('请填写业务跟踪号')