From a53fa45c9a76ea414600a60ee545c445c0b74ca1 Mon Sep 17 00:00:00 2001 From: Kelvin Date: Tue, 26 Nov 2024 16:16:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E4=BB=BB=E5=8A=A1):?= =?UTF-8?q?=20=E4=B8=8B=E5=8F=91=E4=BB=BB=E5=8A=A1=E8=87=B3wcs=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/wm/wmsInTask/index.vue | 154 ++++++++++++--------------- 1 file changed, 69 insertions(+), 85 deletions(-) diff --git a/src/views/mes/wm/wmsInTask/index.vue b/src/views/mes/wm/wmsInTask/index.vue index 8f17161..234acd9 100644 --- a/src/views/mes/wm/wmsInTask/index.vue +++ b/src/views/mes/wm/wmsInTask/index.vue @@ -18,52 +18,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -90,29 +44,37 @@ @@ -169,7 +131,7 @@ import { delWmsInTask, addWmsInTask, updateWmsInTask, - issueBatchWmsInTask, issueWmsInTaskToWcs + issueBatchWmsInTask, issueInTaskWcsLTK, issueInTaskWcsDJ } from "@/api/mes/wm/wmsInTask"; import {listTYPE} from "@/api/md/TYPE"; import {listWmsInPlanDetailsEntity} from "@/api/mes/wm/wmsInPlanDetailsEntity"; @@ -218,7 +180,7 @@ export default { createTime: null, updateBy: null, updateTime: null, - isActivy: null, + isActive: null, isDelete: null, batch: null, materialId: null, @@ -272,13 +234,12 @@ export default { } return id }, - // 下发任务至 WCS - handleIssue(task) { - let warehouseTypeCode = "" - // 刀片入库 则入 立体库 - if (task.planTypeId === "8") { - warehouseTypeCode = "LTK" - } + /** + * 下发任务至 WCS + * @param task + * @param type 出库或入库 + */ + handleIssueWcs(task, type = "RK") { const param = { // 计划ID planId: task.planInId, @@ -287,25 +248,48 @@ export default { // 库位 信息 cellCode: task.cellCode, // 库房类型编码 - warehouseTypeCode, + warehouseTypeCode: "", // 物料信息 materialId: task.materialId, materialCode: task.materialCode, materialName: task.materialName, materialCount: task.actualInQuantity, - rfid: "", + rfid: "123456789AAA", // 出库OR入库 - type: "RK", + type, } - console.log(task) - issueWmsInTaskToWcs(param).then(res => { - console.log(res) - this.$modal.msgSuccess("下发成功"); - }) - // issueBatchWmsInTask([task.id.toString()]).then(response => { - // this.$modal.msgSuccess("执行成功"); - // this.getList(); - // }); + /** 刀片入库|刀柄入库|拆刀回库 入 立体库 */ + if (["DPRK", "DBRK", "CDHK"].includes(task.planTypeCode)) { + param.warehouseTypeCode = "LTK" + issueInTaskWcsLTK(param).then(res => { + if (type === "RK") { + task.planInStatus = "YTR" + this.$modal.msgSuccess("推入库位"); + } else if (type === "CK") { + task.planInStatus = "YTC" + this.$modal.msgSuccess("推出库位"); + } + // 更新 当前任务状态 + updateWmsInTask(task).then(res => { + this.getList(); + }) + }) + } else if (["ZDHK", "ZDRK"].includes(task.planTypeCode)) { + /** 整刀回库|组刀入库 入 刀具库 */ + param.warehouseTypeCode = "DJ" + issueInTaskWcsDJ(param).then(res => { + this.$modal.msgSuccess("下发成功"); + }) + } + }, + /** + * 手动执行入库任务 + */ + manualIssue(task) { + issueBatchWmsInTask([task.id.toString()]).then(response => { + this.$modal.msgSuccess("执行成功"); + this.getList(); + }); }, // 取消按钮 cancel() {