|
@@ -96,39 +96,20 @@
|
|
|
<el-col :span="6">
|
|
|
<div class="type-title">流转终点</div>
|
|
|
<div class="destination">
|
|
|
- <div
|
|
|
- v-for="(item, index) in destinationList"
|
|
|
- :key="index"
|
|
|
- :class="{ selected: index === currentDestinationIndex }"
|
|
|
- class="end-box"
|
|
|
- @click="onEndBoxClick(index, item)"
|
|
|
- >
|
|
|
- <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>
|
|
|
+ <el-scrollbar>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in destinationList"
|
|
|
+ :key="index"
|
|
|
+ :class="{ selected: index === currentDestinationIndex }"
|
|
|
+ class="end-box"
|
|
|
+ @click="onEndBoxClick(index, item)"
|
|
|
+ >
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
</div>
|
|
|
<el-button class="sureBtn" type="primary" @click="createTask"
|
|
|
- >创建任务
|
|
|
+ >派发
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -138,6 +119,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
//料箱
|
|
|
import {
|
|
|
+ addMaterialFlow,
|
|
|
getDestinationList,
|
|
|
getMaterialInfoByLabel,
|
|
|
} from "@/api/process/materialFlow";
|
|
@@ -240,29 +222,19 @@ const sureToAdd = () => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-// 流转终点
|
|
|
+// 出库终点
|
|
|
const destinationList = ref<any>();
|
|
|
const currentDestination = ref<any>({});
|
|
|
const currentDestinationIndex = ref(-1);
|
|
|
-const storeMap = new Map<string, Array<any>>();
|
|
|
-const selectStore = ref<any>({});
|
|
|
+
|
|
|
const onEndBoxClick = (index: number, item: any) => {
|
|
|
currentDestination.value = item;
|
|
|
currentDestinationIndex.value = 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);
|
|
|
+ getDestinationList(0).then((res) => {
|
|
|
destinationList.value = res.data;
|
|
|
});
|
|
|
getStorageBoxesList({}).then((res) => {
|
|
@@ -274,14 +246,26 @@ const createTask = () => {
|
|
|
const params = {
|
|
|
circulationDetail: [...materialList.value],
|
|
|
// coordinate: "",
|
|
|
- houseNo: "",
|
|
|
+ houseNo: outingBox.value.houseNo,
|
|
|
// locationNo: "",
|
|
|
- stationId: 0,
|
|
|
- targetType: "",
|
|
|
- vehicleCode: "",
|
|
|
- vehicleId: 0,
|
|
|
- vehicleName: "",
|
|
|
+ stationId: currentDestination.value.id,
|
|
|
+ targetType: currentDestination.value.targetType,
|
|
|
+ vehicleCode: outingBox.value.vehicleNo,
|
|
|
+ vehicleId: outingBox.value.id,
|
|
|
+ vehicleName: outingBox.value.name,
|
|
|
};
|
|
|
+
|
|
|
+ addMaterialFlow(params).then((res: any) => {
|
|
|
+ ElMessage.success(res.msg ?? "派发成功");
|
|
|
+ currentBox.value = {};
|
|
|
+ currentBoxIndex.value = -1;
|
|
|
+ boxSearch.value = "";
|
|
|
+ outingBox.value = {};
|
|
|
+ outingMaterials.value = [];
|
|
|
+ materialList.value = [];
|
|
|
+ currentDestination.value = {};
|
|
|
+ currentDestinationIndex.value = -1;
|
|
|
+ });
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -407,7 +391,7 @@ const createTask = () => {
|
|
|
}
|
|
|
|
|
|
.destination {
|
|
|
- height: calc(100vh - 350px);
|
|
|
+ height: calc(100vh - 353px);
|
|
|
margin-top: 15px;
|
|
|
|
|
|
.end-box {
|