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" />
- 确认出站
+ 确认出站
-
+