refactor: 下发任务至wcs功能优化

This commit is contained in:
Kelvin 2024-11-27 08:58:06 +08:00
parent a53fa45c9a
commit e8648b3712
2 changed files with 142 additions and 62 deletions

View File

@ -159,6 +159,31 @@
<el-table-column label="出库时间" align="center" prop="createTime"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template v-if="scope.row.taskState !== '1' && scope.row.wmsBusinessTypeCode !== 'ZDCK'">
<el-button
size="mini"
type="text"
v-if="scope.row.taskState !== 'YTC'"
@click="handleIssue(scope.row,'CK')"
>推出库位
</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.taskState !== 'YTR' && scope.row.taskState !== '0'"
@click="handleIssue(scope.row,'RK')"
>推入库位
</el-button>
</template>
<el-button
size="mini"
type="text"
icon="el-icon-running"
@click="handleIssue(scope.row,'CK')"
v-hasPermi="['md:TASK:remove']"
v-if="scope.row.taskState ==='0'"
>WCS下发任务
</el-button>
<el-button
size="mini"
type="text"
@ -175,15 +200,6 @@
v-if="scope.row.taskState =='0'"
>手动出库
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-running"
@click="handleAutoRun(scope.row)"
v-hasPermi="['md:TASK:remove']"
v-if="scope.row.taskState =='0'"
>WCS下发任务
</el-button>
</template>
</el-table-column>
</el-table>
@ -287,7 +303,16 @@
</template>
<script>
import {addTASK, autoRunTASK, delTASK, getTASK, listTASK, runTASK, updateTASK} from "@/api/md/TASK";
import {
addTASK,
autoRunTASK,
delTASK,
getTASK, issueOutTaskWcsDJ,
issueWmsOutTaskToWcs,
listTASK,
runTASK,
updateTASK
} from "@/api/md/TASK";
export default {
name: "TASK",
@ -485,6 +510,61 @@ export default {
}).catch(() => {
});
},
// WCS
handleIssue(task, type = 'CK') {
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: "",
//
materialId: outInfo.mdItemId,
materialCode: outInfo.mdItemCode,
materialName: outInfo.mdItemName,
materialCount: outInfo.actualInQuantity,
rfid: "123456789AAA",
// OR
type,
}
if (['DPCK', 'DBCK'].includes(task.wmsBusinessTypeCode)) {
param.warehouseTypeCode = "LTK"
issueWmsOutTaskToWcs(param).then(res => {
if (type === "RK") {
task.taskState = "YTR"
this.$modal.msgSuccess("推入库位");
} else if (type === "CK") {
task.taskState = "YTC"
this.$modal.msgSuccess("推出库位");
}
updateTASK(task).then(res => {
this.getList();
})
this.$modal.msgSuccess("下发成功");
})
} else if (task.wmsBusinessTypeCode === "ZDCK") {
param.warehouseTypeCode = "DJ"
issueOutTaskWcsDJ(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

@ -64,7 +64,7 @@
<el-button
size="mini"
type="text"
@click="handleIssueWcs(scope.row,'CK')"
@click="handleIssueWcs(scope.row,'RK')"
>下发
</el-button>
</template>