feat: 出入库任务 对接WCS
This commit is contained in:
parent
50713ea57e
commit
0c06372931
@ -1,3 +1,4 @@
|
||||
<!--出库任务-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
@ -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下发任务
|
||||
@ -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;
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user