|
@@ -36,6 +36,7 @@
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="type-title">捡料位</div>
|
|
<div class="type-title">捡料位</div>
|
|
<el-scrollbar class="outing-container">
|
|
<el-scrollbar class="outing-container">
|
|
|
|
+ <div class="boxHeader">载具:{{ outingBox?.vehicleCode }}</div>
|
|
<div
|
|
<div
|
|
v-for="(material, index) in outingMaterials"
|
|
v-for="(material, index) in outingMaterials"
|
|
:key="index"
|
|
:key="index"
|
|
@@ -44,16 +45,16 @@
|
|
<div class="material-title">
|
|
<div class="material-title">
|
|
{{ material.materialName }} | {{ material.materialNo }}
|
|
{{ material.materialName }} | {{ material.materialNo }}
|
|
</div>
|
|
</div>
|
|
- <div class="material-info">
|
|
|
|
- <div>批次号</div>
|
|
|
|
- <el-tooltip :content="material.batchCode" placement="top">
|
|
|
|
- <div class="batchCode">{{ material.batchCode }}</div>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </div>
|
|
|
|
- <div class="material-info">
|
|
|
|
- <div>位置</div>
|
|
|
|
- <div>{{ material.locationNo }}</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!-- <div class="material-info">-->
|
|
|
|
+ <!-- <div>批次号</div>-->
|
|
|
|
+ <!-- <el-tooltip :content="material.batchCode" placement="top">-->
|
|
|
|
+ <!-- <div class="batchCode">{{ material.batchCode }}</div>-->
|
|
|
|
+ <!-- </el-tooltip>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- <div class="material-info">-->
|
|
|
|
+ <!-- <div>位置</div>-->
|
|
|
|
+ <!-- <div>{{ material.locationNo }}</div>-->
|
|
|
|
+ <!-- </div>-->
|
|
<div class="material-info">
|
|
<div class="material-info">
|
|
<div>数量</div>
|
|
<div>数量</div>
|
|
<div>{{ material.num }}</div>
|
|
<div>{{ material.num }}</div>
|
|
@@ -86,6 +87,12 @@
|
|
<NumberInput v-model="item.num" />
|
|
<NumberInput v-model="item.num" />
|
|
<span class="unit">{{ item.unitDictLabel }}</span>
|
|
<span class="unit">{{ item.unitDictLabel }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <i-ep-delete
|
|
|
|
+ class="delete-btn"
|
|
|
|
+ color="#ff4d4f"
|
|
|
|
+ size="20px"
|
|
|
|
+ @click="deleteMaterial(index)"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
@@ -126,8 +133,12 @@ import {
|
|
import {
|
|
import {
|
|
backToStorageAPI,
|
|
backToStorageAPI,
|
|
getStorageBoxesList,
|
|
getStorageBoxesList,
|
|
|
|
+ getStorageOrderInfo,
|
|
toOutBox,
|
|
toOutBox,
|
|
} from "@/api/storage/out";
|
|
} from "@/api/storage/out";
|
|
|
|
+import { useCommonStoreHook } from "@/store";
|
|
|
|
+
|
|
|
|
+const commonS = useCommonStoreHook();
|
|
|
|
|
|
const boxSearch = ref("");
|
|
const boxSearch = ref("");
|
|
const boxesList = ref<any[]>([]);
|
|
const boxesList = ref<any[]>([]);
|
|
@@ -135,7 +146,7 @@ const currentBox = ref<any>({});
|
|
const currentBoxIndex = ref(-1);
|
|
const currentBoxIndex = ref(-1);
|
|
const enterBox = () => {
|
|
const enterBox = () => {
|
|
boxSearch.value = boxSearch.value.trim();
|
|
boxSearch.value = boxSearch.value.trim();
|
|
- getStorageBoxesList({}).then((res) => {
|
|
|
|
|
|
+ getStorageBoxesList({}).then((res: any) => {
|
|
boxesList.value = res.data;
|
|
boxesList.value = res.data;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -145,25 +156,49 @@ const clickBox = (box: any, index: number) => {
|
|
currentBoxIndex.value = index;
|
|
currentBoxIndex.value = index;
|
|
};
|
|
};
|
|
const sureToOut = async () => {
|
|
const sureToOut = async () => {
|
|
- await toOutBox({
|
|
|
|
|
|
+ let res: any = await toOutBox({
|
|
vehicleNo: currentBox.value.vehicleNo,
|
|
vehicleNo: currentBox.value.vehicleNo,
|
|
houseNo: currentBox.value.houseNo,
|
|
houseNo: currentBox.value.houseNo,
|
|
});
|
|
});
|
|
- ElMessage.success("出库成功");
|
|
|
|
- outingBox.value = currentBox.value;
|
|
|
|
- if (outingBox.value.list.length > 0) {
|
|
|
|
- outingMaterials.value = outingBox.value.list;
|
|
|
|
- outingRawBoxList = JSON.parse(JSON.stringify(outingBox.value.list));
|
|
|
|
- } else {
|
|
|
|
- outingRawBoxList = [];
|
|
|
|
- outingMaterials.value = [];
|
|
|
|
- }
|
|
|
|
|
|
+ commonS.orderId = res.data.orderId;
|
|
|
|
+ ElMessage.success("出库成功,等待料箱到达捡料位置");
|
|
|
|
+ checkHasOuting();
|
|
};
|
|
};
|
|
|
|
|
|
//捡料位
|
|
//捡料位
|
|
let outingRawBoxList: any[] = []; //确认添加的时候会对比捡料位和扫描的数量,多次点击会导致捡料位的数字一直改变,所以用一个变量来保存原始的捡料位数据
|
|
let outingRawBoxList: any[] = []; //确认添加的时候会对比捡料位和扫描的数量,多次点击会导致捡料位的数字一直改变,所以用一个变量来保存原始的捡料位数据
|
|
const outingBox = ref<any>({});
|
|
const outingBox = ref<any>({});
|
|
const outingMaterials = ref<any[]>([]);
|
|
const outingMaterials = ref<any[]>([]);
|
|
|
|
+let outInterval: number = -1;
|
|
|
|
+const checkHasOuting = () => {
|
|
|
|
+ // 点击出库之后,需要在其他地方(机器)确实已经到达检料位置,才能进行捡料
|
|
|
|
+ // 接口需要传入出库outBox接口返回的orderId转为id传上去, 如果有这个orderId就开始轮询
|
|
|
|
+ // 如果没有数据则停止轮询。数据返回的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 = [];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ clearInterval(outInterval);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }, 1000);
|
|
|
|
+ }
|
|
|
|
+};
|
|
const backToStorage = async () => {
|
|
const backToStorage = async () => {
|
|
console.log("back to storage");
|
|
console.log("back to storage");
|
|
await backToStorageAPI({
|
|
await backToStorageAPI({
|
|
@@ -177,7 +212,7 @@ const backToStorage = async () => {
|
|
currentBox.value = {};
|
|
currentBox.value = {};
|
|
currentBoxIndex.value = -1;
|
|
currentBoxIndex.value = -1;
|
|
boxSearch.value = "";
|
|
boxSearch.value = "";
|
|
- getStorageBoxesList({}).then((res) => {
|
|
|
|
|
|
+ getStorageBoxesList({}).then((res: any) => {
|
|
boxesList.value = res.data;
|
|
boxesList.value = res.data;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -187,7 +222,7 @@ const scanCodeInput = ref("");
|
|
const materialList = ref<any[]>([]);
|
|
const materialList = ref<any[]>([]);
|
|
|
|
|
|
const handleScanCodeInput = () => {
|
|
const handleScanCodeInput = () => {
|
|
- getMaterialInfoByLabel(scanCodeInput.value).then((res) => {
|
|
|
|
|
|
+ getMaterialInfoByLabel(scanCodeInput.value).then((res: any) => {
|
|
// 扫描之后要先查看数组中是否有这个物料,有的话就数量相加,没有的话就添加到数组中
|
|
// 扫描之后要先查看数组中是否有这个物料,有的话就数量相加,没有的话就添加到数组中
|
|
let hasMaterial = false;
|
|
let hasMaterial = false;
|
|
for (let i = 0; i < materialList.value.length; i++) {
|
|
for (let i = 0; i < materialList.value.length; i++) {
|
|
@@ -223,6 +258,11 @@ const sureToAdd = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const deleteMaterial = (index: number) => {
|
|
|
|
+ materialList.value.splice(index, 1);
|
|
|
|
+};
|
|
|
|
+
|
|
// 出库终点
|
|
// 出库终点
|
|
const destinationList = ref<any>();
|
|
const destinationList = ref<any>();
|
|
const currentDestination = ref<any>({});
|
|
const currentDestination = ref<any>({});
|
|
@@ -235,12 +275,13 @@ const onEndBoxClick = (index: number, item: any) => {
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
let wm = new WeakMap();
|
|
let wm = new WeakMap();
|
|
- getDestinationList(0).then((res) => {
|
|
|
|
|
|
+ getDestinationList(0).then((res: any) => {
|
|
destinationList.value = res.data;
|
|
destinationList.value = res.data;
|
|
});
|
|
});
|
|
getStorageBoxesList({}).then((res) => {
|
|
getStorageBoxesList({}).then((res) => {
|
|
boxesList.value = res.data;
|
|
boxesList.value = res.data;
|
|
});
|
|
});
|
|
|
|
+ checkHasOuting();
|
|
});
|
|
});
|
|
|
|
|
|
const createTask = () => {
|
|
const createTask = () => {
|
|
@@ -251,7 +292,7 @@ const createTask = () => {
|
|
// locationNo: "",
|
|
// locationNo: "",
|
|
stationId: currentDestination.value.id,
|
|
stationId: currentDestination.value.id,
|
|
targetType: currentDestination.value.targetType,
|
|
targetType: currentDestination.value.targetType,
|
|
- vehicleCode: outingBox.value.vehicleNo,
|
|
|
|
|
|
+ vehicleCode: outingBox.value.vehicleCode,
|
|
vehicleId: outingBox.value.vehicleId,
|
|
vehicleId: outingBox.value.vehicleId,
|
|
vehicleName: outingBox.value.vehicleName,
|
|
vehicleName: outingBox.value.vehicleName,
|
|
};
|
|
};
|
|
@@ -266,6 +307,7 @@ const createTask = () => {
|
|
materialList.value = [];
|
|
materialList.value = [];
|
|
currentDestination.value = {};
|
|
currentDestination.value = {};
|
|
currentDestinationIndex.value = -1;
|
|
currentDestinationIndex.value = -1;
|
|
|
|
+ commonS.orderId = -1;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -314,11 +356,18 @@ const createTask = () => {
|
|
.outing-container {
|
|
.outing-container {
|
|
height: calc(100vh - 354px);
|
|
height: calc(100vh - 354px);
|
|
|
|
|
|
|
|
+ .boxHeader {
|
|
|
|
+ font-weight: bolder;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ text-align: left;
|
|
|
|
+ }
|
|
|
|
+
|
|
.outing-box {
|
|
.outing-box {
|
|
background: #fff;
|
|
background: #fff;
|
|
border-radius: 16px;
|
|
border-radius: 16px;
|
|
margin-bottom: 15px;
|
|
margin-bottom: 15px;
|
|
padding: 10px 8px;
|
|
padding: 10px 8px;
|
|
|
|
+ position: relative;
|
|
}
|
|
}
|
|
|
|
|
|
.material-title {
|
|
.material-title {
|
|
@@ -361,6 +410,13 @@ const createTask = () => {
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
align-items: start;
|
|
align-items: start;
|
|
padding: 30px 30px;
|
|
padding: 30px 30px;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .delete-btn {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 15px;
|
|
|
|
+ right: 15px;
|
|
|
|
+ }
|
|
|
|
|
|
.name {
|
|
.name {
|
|
font-weight: 500;
|
|
font-weight: 500;
|