refactor(入库任务): 下发任务至wcs功能优化

This commit is contained in:
Kelvin 2024-11-26 16:16:53 +08:00
parent d6fc38c1b4
commit a53fa45c9a

View File

@ -18,52 +18,6 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['wm:wmsInTask:add']"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['wm:wmsInTask:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['wm:wmsInTask:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['wm:wmsInTask:export']"-->
<!-- >导出-->
<!-- </el-button>-->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -90,29 +44,37 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <template v-if="scope.row.planInStatus !== '1' && scope.row.planTypeCode !== 'ZDHK'">
<!-- size="mini"--> <el-button
<!-- type="text"--> size="mini"
<!-- icon="el-icon-edit"--> type="text"
<!-- @click="openTaskDetailDialog(scope.row)"--> v-if="scope.row.planInStatus !== 'YTC'"
<!-- >详情--> @click="handleIssueWcs(scope.row,'CK')"
<!-- </el-button>--> >推出库位
</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.planInStatus !== 'YTR' && scope.row.planInStatus !== '0'"
@click="handleIssueWcs(scope.row,'RK')"
>推入库位
</el-button>
</template>
<template v-if="scope.row.planInStatus !== '1'">
<el-button
size="mini"
type="text"
@click="handleIssueWcs(scope.row,'CK')"
>下发
</el-button>
</template>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit"
:disabled="scope.row.planInStatus === '1'" :disabled="scope.row.planInStatus === '1'"
@click="handleIssue(scope.row)" @click="manualIssue(scope.row)"
>下发 >手动入库
</el-button> </el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['wm:wmsInTask:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -169,7 +131,7 @@ import {
delWmsInTask, delWmsInTask,
addWmsInTask, addWmsInTask,
updateWmsInTask, updateWmsInTask,
issueBatchWmsInTask, issueWmsInTaskToWcs issueBatchWmsInTask, issueInTaskWcsLTK, issueInTaskWcsDJ
} 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";
@ -218,7 +180,7 @@ export default {
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
isActivy: null, isActive: null,
isDelete: null, isDelete: null,
batch: null, batch: null,
materialId: null, materialId: null,
@ -272,13 +234,12 @@ export default {
} }
return id return id
}, },
// WCS /**
handleIssue(task) { * 下发任务至 WCS
let warehouseTypeCode = "" * @param task
// * @param type 出库或入库
if (task.planTypeId === "8") { */
warehouseTypeCode = "LTK" handleIssueWcs(task, type = "RK") {
}
const param = { const param = {
// ID // ID
planId: task.planInId, planId: task.planInId,
@ -287,25 +248,48 @@ export default {
// //
cellCode: task.cellCode, cellCode: task.cellCode,
// //
warehouseTypeCode, warehouseTypeCode: "",
// //
materialId: task.materialId, materialId: task.materialId,
materialCode: task.materialCode, materialCode: task.materialCode,
materialName: task.materialName, materialName: task.materialName,
materialCount: task.actualInQuantity, materialCount: task.actualInQuantity,
rfid: "", rfid: "123456789AAA",
// OR // OR
type: "RK", type,
} }
console.log(task) /** 刀片入库|刀柄入库|拆刀回库 入 立体库 */
issueWmsInTaskToWcs(param).then(res => { if (["DPRK", "DBRK", "CDHK"].includes(task.planTypeCode)) {
console.log(res) param.warehouseTypeCode = "LTK"
this.$modal.msgSuccess("下发成功"); issueInTaskWcsLTK(param).then(res => {
}) if (type === "RK") {
// issueBatchWmsInTask([task.id.toString()]).then(response => { task.planInStatus = "YTR"
// this.$modal.msgSuccess(""); this.$modal.msgSuccess("推入库位");
// this.getList(); } 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() { cancel() {