|
@@ -176,27 +176,35 @@ const checkHasOuting = () => {
|
|
|
// 如果没有数据则停止轮询。数据返回的state是1处理中2启用3处理异常4已完成, 当为3或者4的时候停止轮询,并且在派发后清空oderid。
|
|
|
if (commonS.orderId != -1) {
|
|
|
outInterval = setInterval(() => {
|
|
|
- getStorageOrderInfo({ id: commonS.orderId }).then((res: any) => {
|
|
|
- if (res.data) {
|
|
|
- if (res.data.state === 3 || res.data.state === 4) {
|
|
|
- clearInterval(outInterval);
|
|
|
- outingBox.value = { ...res.data };
|
|
|
- console.log(outingBox.value);
|
|
|
- if (res.data.detailsList.length > 0) {
|
|
|
- outingMaterials.value = outingBox.value.detailsList;
|
|
|
- outingRawBoxList = JSON.parse(
|
|
|
- JSON.stringify(outingBox.value.detailsList)
|
|
|
- );
|
|
|
- } else {
|
|
|
- outingRawBoxList = [];
|
|
|
- outingMaterials.value = [];
|
|
|
+ getStorageOrderInfo({ id: commonS.orderId })
|
|
|
+ .then((res: any) => {
|
|
|
+ if (res.data) {
|
|
|
+ if (res.data.state === 3 || res.data.state === 4) {
|
|
|
+ clearInterval(outInterval);
|
|
|
+ outingBox.value = { ...res.data };
|
|
|
+ // 同时也刷新左侧列表数据
|
|
|
+ getStorageBoxesList({}).then((res: any) => {
|
|
|
+ boxesList.value = res.data;
|
|
|
+ });
|
|
|
+ if (res.data.detailsList.length > 0) {
|
|
|
+ outingMaterials.value = outingBox.value.detailsList;
|
|
|
+ outingRawBoxList = JSON.parse(
|
|
|
+ JSON.stringify(outingBox.value.detailsList)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ outingRawBoxList = [];
|
|
|
+ outingMaterials.value = [];
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ clearInterval(outInterval);
|
|
|
}
|
|
|
- } else {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
clearInterval(outInterval);
|
|
|
- }
|
|
|
- });
|
|
|
- }, 1000);
|
|
|
+ commonS.orderId = -1;
|
|
|
+ });
|
|
|
+ }, 5000);
|
|
|
}
|
|
|
};
|
|
|
const backToStorage = async () => {
|
|
@@ -278,7 +286,7 @@ onMounted(() => {
|
|
|
getDestinationList(0).then((res: any) => {
|
|
|
destinationList.value = res.data;
|
|
|
});
|
|
|
- getStorageBoxesList({}).then((res) => {
|
|
|
+ getStorageBoxesList({}).then((res: any) => {
|
|
|
boxesList.value = res.data;
|
|
|
});
|
|
|
checkHasOuting();
|