|
@@ -7,20 +7,20 @@
|
|
<div style="display: flex; margin-bottom: 15px">
|
|
<div style="display: flex; margin-bottom: 15px">
|
|
<ScanCodeInput
|
|
<ScanCodeInput
|
|
v-model="currentBox"
|
|
v-model="currentBox"
|
|
|
|
+ placeholder="请扫描或输入料箱编号"
|
|
style="width: 50%"
|
|
style="width: 50%"
|
|
- @enterfnc="enterBox"
|
|
|
|
|
|
+ @keyup.enter="enterBox"
|
|
/>
|
|
/>
|
|
<div class="current-box">
|
|
<div class="current-box">
|
|
- <span class="left">当前料箱</span>
|
|
|
|
- <span class="right">{{ currentBox }}</span>
|
|
|
|
|
|
+ <span class="left">{{ boxDetail?.name || "未绑定料箱" }}</span>
|
|
|
|
+ <span class="right">{{ boxDetail?.code || "未绑定料箱" }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="type-title">料箱绑定</div>
|
|
|
|
|
|
+ <div class="type-title">请扫码物料</div>
|
|
<ScanCodeInput
|
|
<ScanCodeInput
|
|
v-model="scanCodeInput"
|
|
v-model="scanCodeInput"
|
|
- style="width: 50%"
|
|
|
|
- @enterfnc="handleScanCodeInput"
|
|
|
|
|
|
+ @keyup.enter="handleScanCodeInput"
|
|
/>
|
|
/>
|
|
<div style="height: calc(100vh - 450px); margin-top: 15px">
|
|
<div style="height: calc(100vh - 450px); margin-top: 15px">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
@@ -31,12 +31,12 @@
|
|
class="list-box"
|
|
class="list-box"
|
|
>
|
|
>
|
|
<div>
|
|
<div>
|
|
- <div class="name">{{ item.name }}name</div>
|
|
|
|
- <div class="spec">{{ item.spec }}spec</div>
|
|
|
|
|
|
+ <div class="name">{{ item.materialName }}</div>
|
|
|
|
+ <div class="spec">{{ item.spec }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="bottom">
|
|
<div class="bottom">
|
|
- <NumberInput v-model="item.number" />
|
|
|
|
- <span class="unit">{{ item.unit }}个</span>
|
|
|
|
|
|
+ <NumberInput v-model="item.num" />
|
|
|
|
+ <span class="unit">{{ item.unitDictValue }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -51,12 +51,35 @@
|
|
:key="index"
|
|
:key="index"
|
|
:class="{ selected: index === currentDestinationIndex }"
|
|
:class="{ selected: index === currentDestinationIndex }"
|
|
class="end-box"
|
|
class="end-box"
|
|
- @click="onEndBoxClick(index)"
|
|
|
|
|
|
+ @click="onEndBoxClick(index, item)"
|
|
>
|
|
>
|
|
- ddd
|
|
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div
|
|
|
|
+ v-if="
|
|
|
|
+ item.targetType === 'stock' && index === currentDestinationIndex
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="selectStore"
|
|
|
|
+ filterable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ size="large"
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ value-key="id"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="store in storeMap.get(item.houseNo)"
|
|
|
|
+ :key="store.id"
|
|
|
|
+ :label="store.name"
|
|
|
|
+ :value="store"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <el-button class="sureBtn" type="primary">创建任务</el-button>
|
|
|
|
|
|
+ <el-button class="sureBtn" type="primary" @click="createTask"
|
|
|
|
+ >创建任务
|
|
|
|
+ </el-button>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -64,25 +87,89 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
//料箱
|
|
//料箱
|
|
-const currentBox = ref("");
|
|
|
|
|
|
+import {
|
|
|
|
+ addMaterialFlow,
|
|
|
|
+ getBoxDetailByLabel,
|
|
|
|
+ getDestinationList,
|
|
|
|
+ getMaterialInfoByLabel,
|
|
|
|
+ getStoreListByNo,
|
|
|
|
+} from "@/api/process/materialFlow";
|
|
|
|
+
|
|
|
|
+const currentBox = ref("ZJ000011");
|
|
|
|
+const boxDetail = ref<any>({});
|
|
const enterBox = () => {
|
|
const enterBox = () => {
|
|
- console.log("enterBox", currentBox);
|
|
|
|
|
|
+ getBoxDetailByLabel(currentBox.value).then((res) => {
|
|
|
|
+ boxDetail.value = res.data;
|
|
|
|
+ // materialList.value = res.data.materialList;
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
// 物料
|
|
// 物料
|
|
-const scanCodeInput = ref("");
|
|
|
|
|
|
+const scanCodeInput = ref("2010100002301#gys022#sc022#100#20220929#31");
|
|
|
|
+const materialList = ref<any>([]);
|
|
|
|
+
|
|
const handleScanCodeInput = () => {
|
|
const handleScanCodeInput = () => {
|
|
- console.log("handleScanCodeInput", scanCodeInput.value);
|
|
|
|
|
|
+ getMaterialInfoByLabel(scanCodeInput.value).then((res) => {
|
|
|
|
+ materialList.value.push(res.data);
|
|
|
|
+ scanCodeInput.value = "";
|
|
|
|
+ });
|
|
};
|
|
};
|
|
-
|
|
|
|
-const materialList = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}]);
|
|
|
|
-
|
|
|
|
// 流转终点
|
|
// 流转终点
|
|
-const destinationList = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}]);
|
|
|
|
|
|
+const destinationList = ref<any>();
|
|
|
|
+const currentDestination = ref<any>({});
|
|
const currentDestinationIndex = ref(-1);
|
|
const currentDestinationIndex = ref(-1);
|
|
-const onEndBoxClick = (index: number) => {
|
|
|
|
|
|
+const storeMap = new Map<string, Array<any>>();
|
|
|
|
+const selectStore = ref<any>({});
|
|
|
|
+const onEndBoxClick = (index: number, item: any) => {
|
|
|
|
+ currentDestination.value = item;
|
|
currentDestinationIndex.value = index;
|
|
currentDestinationIndex.value = index;
|
|
- console.log("onEndBoxClick", index);
|
|
|
|
|
|
+ // 如果是仓库,会根据仓库的no获取仓储的列表,存入map, 如果已经有数据了则不需要再次请求接口
|
|
|
|
+ if (item.targetType === "stock") {
|
|
|
|
+ if (!storeMap.has(item.houseNo)) {
|
|
|
|
+ getStoreListByNo(item.houseNo).then((res) => {
|
|
|
|
+ storeMap.set(item.houseNo, res.data || []);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ let wm = new WeakMap();
|
|
|
|
+ getDestinationList().then((res) => {
|
|
|
|
+ console.log("destinationList", res);
|
|
|
|
+ destinationList.value = res.data;
|
|
|
|
+ });
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const createTask = () => {
|
|
|
|
+ const params = {
|
|
|
|
+ circulationDetail: [...materialList.value],
|
|
|
|
+ coordinate: "",
|
|
|
|
+ houseNo: "",
|
|
|
|
+ locationNo: "",
|
|
|
|
+ stationId: 0,
|
|
|
|
+ targetType: "",
|
|
|
|
+ vehicleCode: "",
|
|
|
|
+ vehicleId: 0,
|
|
|
|
+ vehicleName: "",
|
|
|
|
+ };
|
|
|
|
+ params.targetType = currentDestination.value.targetType;
|
|
|
|
+ if (currentDestination.value.targetType === "stock") {
|
|
|
|
+ params.houseNo = currentDestination.value.houseNo;
|
|
|
|
+ params.locationNo = selectStore.value.locationNo;
|
|
|
|
+ params.coordinate = selectStore.value.coordinate;
|
|
|
|
+ } else {
|
|
|
|
+ params.stationId = currentDestination.value.id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ params.vehicleId = boxDetail.value.id;
|
|
|
|
+ params.vehicleCode = boxDetail.value.code;
|
|
|
|
+ params.vehicleName = boxDetail.value.name;
|
|
|
|
+
|
|
|
|
+ addMaterialFlow(params).then((res) => {
|
|
|
|
+ ElMessage.success("创建成功");
|
|
|
|
+ console.log("res", res);
|
|
|
|
+ });
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -182,6 +269,9 @@ const onEndBoxClick = (index: number) => {
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
font-size: 24px;
|
|
font-size: 24px;
|
|
color: rgba(0, 0, 0, 0.9);
|
|
color: rgba(0, 0, 0, 0.9);
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-evenly;
|
|
|
|
+ align-items: center;
|
|
}
|
|
}
|
|
|
|
|
|
.end-box:not(:last-child) {
|
|
.end-box:not(:last-child) {
|
|
@@ -192,6 +282,12 @@ const onEndBoxClick = (index: number) => {
|
|
border-radius: 40px;
|
|
border-radius: 40px;
|
|
border: 2px solid rgba(10, 89, 247, 1);
|
|
border: 2px solid rgba(10, 89, 247, 1);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .name {
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.sureBtn {
|
|
.sureBtn {
|