feat: 出入库任务 对接WCS

This commit is contained in:
Kelvin 2024-11-27 08:56:56 +08:00
parent 50713ea57e
commit 0c06372931
2 changed files with 136 additions and 62 deletions

View File

@ -1,3 +1,4 @@
<!--出库任务-->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
@ -179,7 +180,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-running" icon="el-icon-running"
@click="handleAutoRun(scope.row)" @click="handleIssue(scope.row)"
v-hasPermi="['md:TASK:remove']" v-hasPermi="['md:TASK:remove']"
v-if="scope.row.taskState =='0'" v-if="scope.row.taskState =='0'"
>WCS下发任务 >WCS下发任务
@ -287,7 +288,17 @@
</template> </template>
<script> <script>
import {addTASK, autoRunTASK, delTASK, getTASK, listTASK, runTASK, updateTASK} from "@/api/md/TASK"; import {
addTASK,
autoRunTASK,
delTASK,
getTASK,
issueWmsOutTaskToWcs,
listTASK,
runTASK,
updateTASK
} from "@/api/md/TASK";
import {issueWmsInTaskToWcs} from "@/api/mes/wm/wmsInTask";
export default { export default {
name: "TASK", name: "TASK",
@ -485,6 +496,43 @@ export default {
}).catch(() => { }).catch(() => {
}); });
}, },
// WCS
handleIssue(task) {
getTASK(task.wmsOutTaskId).then(res => {
res.data.outInfoList.length = 1;
res.data.outInfoList.forEach(outInfo => {
const param = {
// ID
planId: outInfo.planInId,
// ID
taskId: outInfo.id,
//
cellCode: outInfo.wmStorageAreaCode,
cellX: outInfo.cellX,
cellY: outInfo.cellY,
cellZ: outInfo.cellZ,
//
warehouseTypeCode: "DDJ",
//
materialId: outInfo.materialId,
materialCode: outInfo.materialCode,
materialName: outInfo.materialName,
materialCount: outInfo.actualInQuantity,
rfid: "",
// OR
type: "CK",
}
issueWmsOutTaskToWcs(param).then(res => {
console.log(res)
this.$modal.msgSuccess("下发成功");
})
})
// issueBatchWmsInTask([task.id.toString()]).then(response => {
// this.$modal.msgSuccess("");
// this.getList();
// });
})
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const wmsOutTaskIds = row.wmsOutTaskId || this.ids; const wmsOutTaskIds = row.wmsOutTaskId || this.ids;

View File

@ -102,8 +102,8 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
:disabled="scope.row.planInStatus === '1'" :disabled="scope.row.planInStatus === '1'"
@click="handleIssue(scope.row.id)" @click="handleIssue(scope.row)"
>执行 >下发
</el-button> </el-button>
<!-- <el-button--> <!-- <el-button-->
<!-- size="mini"--> <!-- size="mini"-->
@ -169,7 +169,7 @@ import {
delWmsInTask, delWmsInTask,
addWmsInTask, addWmsInTask,
updateWmsInTask, updateWmsInTask,
issueBatchWmsInTask issueBatchWmsInTask, issueWmsInTaskToWcs
} from "@/api/mes/wm/wmsInTask"; } from "@/api/mes/wm/wmsInTask";
import {listTYPE} from "@/api/md/TYPE"; import {listTYPE} from "@/api/md/TYPE";
import {listWmsInPlanDetailsEntity} from "@/api/mes/wm/wmsInPlanDetailsEntity"; import {listWmsInPlanDetailsEntity} from "@/api/mes/wm/wmsInPlanDetailsEntity";
@ -272,12 +272,38 @@ export default {
} }
return id return id
}, },
// // WCS
handleIssue(id) { handleIssue(task) {
issueBatchWmsInTask([id.toString()]).then(response => { const param = {
this.$modal.msgSuccess("执行成功"); // ID
this.getList(); planId: task.planInId,
}); // ID
taskId: task.id,
//
cellCode: task.cellCode,
cellX:task.cellX,
cellY:task.cellY,
cellZ:task.cellZ,
//
warehouseTypeCode:"DDJ",
//
materialId: task.materialId,
materialCode: task.materialCode,
materialName: task.materialName,
materialCount: task.actualInQuantity,
rfid: "",
// OR
type: "RK",
}
console.log(param)
issueWmsInTaskToWcs(param).then(res => {
console.log(res)
this.$modal.msgSuccess("下发成功");
})
// issueBatchWmsInTask([task.id.toString()]).then(response => {
// this.$modal.msgSuccess("");
// this.getList();
// });
}, },
// //
cancel() { cancel() {