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,86 +1,87 @@
<!--出库任务-->
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="计划编码" prop="wmsOutPlanCode">
<el-input
v-model="queryParams.wmsOutPlanCode"
placeholder="请输入出库计划编码"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.wmsOutPlanCode"
placeholder="请输入出库计划编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务编码" prop="taskCode">
<el-input
v-model="queryParams.taskCode"
placeholder="请输入任务编码"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.taskCode"
placeholder="请输入任务编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务数量" prop="taskNumber">
<el-input
v-model="queryParams.taskNumber"
placeholder="请输入任务数量"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.taskNumber"
placeholder="请输入任务数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出库数量" prop="outNumber">
<el-input
v-model="queryParams.outNumber"
placeholder="请输入出库数量"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.outNumber"
placeholder="请输入出库数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次" prop="batchNum">
<el-input
v-model="queryParams.batchNum"
placeholder="请输入批次"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.batchNum"
placeholder="请输入批次"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="mdItemCode">
<el-input
v-model="queryParams.mdItemCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.mdItemCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="mdItemName">
<el-input
v-model="queryParams.mdItemName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.mdItemName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料单位" prop="mdItemUnit">
<el-input
v-model="queryParams.mdItemUnit"
placeholder="请输入物料单位"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.mdItemUnit"
placeholder="请输入物料单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务状态" prop="taskState">
<el-select v-model="queryParams.taskState" placeholder="请选择任务状态" clearable>
<el-option
v-for="dict in dict.type.in_plan_state"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in dict.type.in_plan_state"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="领料人" prop="recipientUsername">
<el-input
v-model="queryParams.recipientUsername"
placeholder="请输入领料人"
clearable
@keyup.enter.native="handleQuery"
v-model="queryParams.recipientUsername"
placeholder="请输入领料人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
@ -179,7 +180,7 @@
size="mini"
type="text"
icon="el-icon-running"
@click="handleAutoRun(scope.row)"
@click="handleIssue(scope.row)"
v-hasPermi="['md:TASK:remove']"
v-if="scope.row.taskState =='0'"
>WCS下发任务
@ -189,11 +190,11 @@
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改出库任务对话框 -->
@ -241,10 +242,10 @@
<el-form-item label="任务状态" prop="taskState">
<el-select v-model="form.taskState" placeholder="请选择任务状态">
<el-option
v-for="dict in dict.type.in_plan_state"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in dict.type.in_plan_state"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
@ -287,7 +288,17 @@
</template>
<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 {
name: "TASK",
@ -349,9 +360,9 @@ export default {
this.getList();
},
methods: {
tableRowStyle({row, index}){
tableRowStyle({row, index}) {
let rowBackground = {}
if (row.knifeWarning == true){
if (row.knifeWarning == true) {
rowBackground.background = "#ff6666"
rowBackground.color = "#666666"
return rowBackground
@ -485,6 +496,43 @@ export default {
}).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) {
const wmsOutTaskIds = row.wmsOutTaskId || this.ids;

View File

@ -102,8 +102,8 @@
type="text"
icon="el-icon-edit"
:disabled="scope.row.planInStatus === '1'"
@click="handleIssue(scope.row.id)"
>执行
@click="handleIssue(scope.row)"
>下发
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
@ -169,7 +169,7 @@ import {
delWmsInTask,
addWmsInTask,
updateWmsInTask,
issueBatchWmsInTask
issueBatchWmsInTask, issueWmsInTaskToWcs
} from "@/api/mes/wm/wmsInTask";
import {listTYPE} from "@/api/md/TYPE";
import {listWmsInPlanDetailsEntity} from "@/api/mes/wm/wmsInPlanDetailsEntity";
@ -272,12 +272,38 @@ export default {
}
return id
},
//
handleIssue(id) {
issueBatchWmsInTask([id.toString()]).then(response => {
this.$modal.msgSuccess("执行成功");
this.getList();
});
// WCS
handleIssue(task) {
const param = {
// ID
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() {