|
@@ -171,6 +171,7 @@ const sureToOut = async () => {
|
|
|
houseNo: currentBox.value.houseNo,
|
|
|
});
|
|
|
commonS.orderId = res.data.orderId;
|
|
|
+ commonS.changeBoxType = 2; // 2出库
|
|
|
ElMessage.success("出库成功,等待料箱到达捡料位置");
|
|
|
checkHasOuting();
|
|
|
};
|
|
@@ -193,23 +194,27 @@ const checkHasOuting = () => {
|
|
|
clearInterval(outInterval);
|
|
|
commonS.orderId = -1;
|
|
|
|
|
|
- outingBox.value = { ...res.data };
|
|
|
- toSendBoxInfo.value = { ...outingBox.value }; //默认派发出库的盒子,如果返库了,扫码物料上方的载具信息则需要重新获取
|
|
|
// 同时也刷新左侧列表数据
|
|
|
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)
|
|
|
- );
|
|
|
- materialList.value = JSON.parse(
|
|
|
- JSON.stringify(outingBox.value.detailsList)
|
|
|
- );
|
|
|
- } else {
|
|
|
- outingRawBoxList = [];
|
|
|
- outingMaterials.value = [];
|
|
|
+
|
|
|
+ if (commonS.changeBoxType === 2) {
|
|
|
+ outingBox.value = { ...res.data };
|
|
|
+ toSendBoxInfo.value = { ...outingBox.value }; //默认派发出库的盒子,如果返库了,扫码物料上方的载具信息则需要重新获取
|
|
|
+
|
|
|
+ if (res.data.detailsList.length > 0) {
|
|
|
+ outingMaterials.value = outingBox.value.detailsList;
|
|
|
+ outingRawBoxList = JSON.parse(
|
|
|
+ JSON.stringify(outingBox.value.detailsList)
|
|
|
+ );
|
|
|
+ materialList.value = JSON.parse(
|
|
|
+ JSON.stringify(outingBox.value.detailsList)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ outingRawBoxList = [];
|
|
|
+ outingMaterials.value = [];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -225,21 +230,26 @@ const checkHasOuting = () => {
|
|
|
};
|
|
|
const backToStorage = async () => {
|
|
|
console.log("back to storage");
|
|
|
- await backToStorageAPI({
|
|
|
- vehicleCode: outingBox.value.vehicleNo,
|
|
|
+ let res: any = await backToStorageAPI({
|
|
|
+ vehicleCode: outingBox.value.vehicleCode,
|
|
|
houseNo: outingBox.value.houseNo,
|
|
|
detailsList: outingMaterials.value,
|
|
|
});
|
|
|
+ commonS.orderId = res.data.orderId;
|
|
|
+ commonS.changeBoxType = 1; // 2出库
|
|
|
+
|
|
|
+ ElMessage.success("返库成功,等待料箱到达");
|
|
|
+ checkHasOuting();
|
|
|
outingBox.value = {};
|
|
|
toSendBoxInfo.value = {};
|
|
|
outingMaterials.value = [];
|
|
|
- ElMessage.success("返库成功");
|
|
|
+
|
|
|
currentBox.value = {};
|
|
|
currentBoxIndex.value = -1;
|
|
|
boxSearch.value = "";
|
|
|
- getStorageBoxesList({}).then((res: any) => {
|
|
|
- boxesList.value = res.data;
|
|
|
- });
|
|
|
+ // getStorageBoxesList({}).then((res: any) => {
|
|
|
+ // boxesList.value = res.data;
|
|
|
+ // });
|
|
|
};
|
|
|
|
|
|
// 物料
|