From 09b921009efcc5f4067ff2cd7ebe2f639658b530 Mon Sep 17 00:00:00 2001 From: tao Date: Wed, 14 Jan 2026 09:21:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E7=AB=99=E4=BC=98=E5=8C=96=EF=BC=9A?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA=E6=9C=AB=E7=AB=99?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/traceOrderManage/station/index.ts | 8 +++++++ src/views/traceOrderManage/outfeed/layout.vue | 24 +++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/api/traceOrderManage/station/index.ts b/src/api/traceOrderManage/station/index.ts index a3ce40d..81bb83a 100644 --- a/src/api/traceOrderManage/station/index.ts +++ b/src/api/traceOrderManage/station/index.ts @@ -28,6 +28,14 @@ export function getStation(id: ID) { }); } +// 判断站点是否为最后一个站点 +export function isLastStation(id: ID) { + return request({ + url: '/mes/station/' + id + '/isLast', + method: 'get' + }) +} + // 新增站点 export function addStation(data: MesStationData) { return request({ diff --git a/src/views/traceOrderManage/outfeed/layout.vue b/src/views/traceOrderManage/outfeed/layout.vue index 2c99b39..b24664e 100644 --- a/src/views/traceOrderManage/outfeed/layout.vue +++ b/src/views/traceOrderManage/outfeed/layout.vue @@ -3,7 +3,7 @@ import { ref, computed, reactive } from 'vue'; import { useRouter, useRoute } from 'vue-router'; import { message } from 'ant-design-vue'; import { listStorageLocation } from '@/api/traceOrderManage/location'; -import { completeStation } from '@/api/traceOrderManage/station'; +import { completeStation, isLastStation as getIsLastStation } from '@/api/traceOrderManage/station'; import { useTraceOrderStore } from '@/store'; const router = useRouter(); @@ -34,9 +34,15 @@ const fetchLocationList = async () => { }; const openSelectLocation = ref(false); -const handleSelectLocation = () => { - fetchLocationList(); - openSelectLocation.value = true; +const handleOutfeed = async () => { + // 判断是否为末站点 + const { data: isLastStation } = await getIsLastStation(traceOrderStore.currentStationId); + if (isLastStation || outfeedChildRef.value?.totals.ngNum) { + fetchLocationList(); + openSelectLocation.value = true; + } else { + submitOutfeed(); + } }; const storage = reactive({}); @@ -44,9 +50,13 @@ const handleChangeLocation = (value: any, option: any) => { Object.assign(storage, option); }; +const closeOutfeed = () => { + openSelectLocation.value = false; +}; + // 确认出站 const outfeeding = ref(false); -const handleOutfeed = async () => { +const submitOutfeed = async () => { outfeeding.value = true; try { await completeStation(traceOrderStore.currentStationId, storage); @@ -95,12 +105,12 @@ fetchLocationList(); :stroke-color="activeKey === item.key ? '#1890ff' : undefined" class="menu-progress" /> - 确认出站 + 确认出站 - +