出站优化:判断是否为末站点
This commit is contained in:
@@ -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) {
|
export function addStation(data: MesStationData) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ref, computed, reactive } from 'vue';
|
|||||||
import { useRouter, useRoute } from 'vue-router';
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { listStorageLocation } from '@/api/traceOrderManage/location';
|
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';
|
import { useTraceOrderStore } from '@/store';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -34,9 +34,15 @@ const fetchLocationList = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openSelectLocation = ref(false);
|
const openSelectLocation = ref(false);
|
||||||
const handleSelectLocation = () => {
|
const handleOutfeed = async () => {
|
||||||
fetchLocationList();
|
// 判断是否为末站点
|
||||||
openSelectLocation.value = true;
|
const { data: isLastStation } = await getIsLastStation(traceOrderStore.currentStationId);
|
||||||
|
if (isLastStation || outfeedChildRef.value?.totals.ngNum) {
|
||||||
|
fetchLocationList();
|
||||||
|
openSelectLocation.value = true;
|
||||||
|
} else {
|
||||||
|
submitOutfeed();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const storage = reactive({});
|
const storage = reactive({});
|
||||||
@@ -44,9 +50,13 @@ const handleChangeLocation = (value: any, option: any) => {
|
|||||||
Object.assign(storage, option);
|
Object.assign(storage, option);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const closeOutfeed = () => {
|
||||||
|
openSelectLocation.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
// 确认出站
|
// 确认出站
|
||||||
const outfeeding = ref(false);
|
const outfeeding = ref(false);
|
||||||
const handleOutfeed = async () => {
|
const submitOutfeed = async () => {
|
||||||
outfeeding.value = true;
|
outfeeding.value = true;
|
||||||
try {
|
try {
|
||||||
await completeStation(traceOrderStore.currentStationId, storage);
|
await completeStation(traceOrderStore.currentStationId, storage);
|
||||||
@@ -95,12 +105,12 @@ fetchLocationList();
|
|||||||
:stroke-color="activeKey === item.key ? '#1890ff' : undefined" class="menu-progress" />
|
:stroke-color="activeKey === item.key ? '#1890ff' : undefined" class="menu-progress" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a-button type="primary" size="large" @click="handleSelectLocation">确认出站</a-button>
|
<a-button type="primary" size="large" @click="handleOutfeed">确认出站</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<a-modal title="选择出站库位" :open="openSelectLocation" @ok="handleOutfeed" >
|
<a-modal title="选择出站库位" :open="openSelectLocation" @ok="submitOutfeed" @cancel="closeOutfeed">
|
||||||
<a-select style="width: 100%" @change="handleChangeLocation" :options="locationOptions" :fieldNames="{ label: 'storageLocationCode', value: 'id' }" />
|
<a-select style="width: 100%" @change="handleChangeLocation" :options="locationOptions" :fieldNames="{ label: 'storageLocationCode', value: 'id' }" />
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
Reference in New Issue
Block a user