feat: 出入库任务 对接WCS
This commit is contained in:
parent
50713ea57e
commit
0c06372931
@ -1,86 +1,87 @@
|
|||||||
|
<!--出库任务-->
|
||||||
<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">
|
||||||
<el-form-item label="计划编码" prop="wmsOutPlanCode">
|
<el-form-item label="计划编码" prop="wmsOutPlanCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.wmsOutPlanCode"
|
v-model="queryParams.wmsOutPlanCode"
|
||||||
placeholder="请输入出库计划编码"
|
placeholder="请输入出库计划编码"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务编码" prop="taskCode">
|
<el-form-item label="任务编码" prop="taskCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.taskCode"
|
v-model="queryParams.taskCode"
|
||||||
placeholder="请输入任务编码"
|
placeholder="请输入任务编码"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务数量" prop="taskNumber">
|
<el-form-item label="任务数量" prop="taskNumber">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.taskNumber"
|
v-model="queryParams.taskNumber"
|
||||||
placeholder="请输入任务数量"
|
placeholder="请输入任务数量"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出库数量" prop="outNumber">
|
<el-form-item label="出库数量" prop="outNumber">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.outNumber"
|
v-model="queryParams.outNumber"
|
||||||
placeholder="请输入出库数量"
|
placeholder="请输入出库数量"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="批次" prop="batchNum">
|
<el-form-item label="批次" prop="batchNum">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.batchNum"
|
v-model="queryParams.batchNum"
|
||||||
placeholder="请输入批次"
|
placeholder="请输入批次"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物料编码" prop="mdItemCode">
|
<el-form-item label="物料编码" prop="mdItemCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.mdItemCode"
|
v-model="queryParams.mdItemCode"
|
||||||
placeholder="请输入物料编码"
|
placeholder="请输入物料编码"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物料名称" prop="mdItemName">
|
<el-form-item label="物料名称" prop="mdItemName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.mdItemName"
|
v-model="queryParams.mdItemName"
|
||||||
placeholder="请输入物料名称"
|
placeholder="请输入物料名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物料单位" prop="mdItemUnit">
|
<el-form-item label="物料单位" prop="mdItemUnit">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.mdItemUnit"
|
v-model="queryParams.mdItemUnit"
|
||||||
placeholder="请输入物料单位"
|
placeholder="请输入物料单位"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务状态" prop="taskState">
|
<el-form-item label="任务状态" prop="taskState">
|
||||||
<el-select v-model="queryParams.taskState" placeholder="请选择任务状态" clearable>
|
<el-select v-model="queryParams.taskState" placeholder="请选择任务状态" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.in_plan_state"
|
v-for="dict in dict.type.in_plan_state"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="领料人" prop="recipientUsername">
|
<el-form-item label="领料人" prop="recipientUsername">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.recipientUsername"
|
v-model="queryParams.recipientUsername"
|
||||||
placeholder="请输入领料人"
|
placeholder="请输入领料人"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -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下发任务
|
||||||
@ -189,11 +190,11 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改出库任务对话框 -->
|
<!-- 添加或修改出库任务对话框 -->
|
||||||
@ -241,10 +242,10 @@
|
|||||||
<el-form-item label="任务状态" prop="taskState">
|
<el-form-item label="任务状态" prop="taskState">
|
||||||
<el-select v-model="form.taskState" placeholder="请选择任务状态">
|
<el-select v-model="form.taskState" placeholder="请选择任务状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.in_plan_state"
|
v-for="dict in dict.type.in_plan_state"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -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",
|
||||||
@ -349,9 +360,9 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tableRowStyle({row, index}){
|
tableRowStyle({row, index}) {
|
||||||
let rowBackground = {}
|
let rowBackground = {}
|
||||||
if (row.knifeWarning == true){
|
if (row.knifeWarning == true) {
|
||||||
rowBackground.background = "#ff6666"
|
rowBackground.background = "#ff6666"
|
||||||
rowBackground.color = "#666666"
|
rowBackground.color = "#666666"
|
||||||
return rowBackground
|
return rowBackground
|
||||||
@ -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;
|
||||||
|
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user