feat(stock): 新增组盘、拆盘按钮调用MES接口
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| | |
| | | // 页面扩展配置:预留给库存页面二次开发。 |
| | | // 页面扩展配置:库存页面组盘/拆盘按钮扩展 |
| | | let extension = { |
| | | components: { |
| | | gridHeader: "", |
| | |
| | | modelBody: "", |
| | | modelFooter: "", |
| | | }, |
| | | tableAction: "", |
| | | tableAction: "stock", |
| | | buttons: { view: [], box: [], detail: [] }, |
| | | methods: { |
| | | onInit() { |
| | | return true; |
| | | }, |
| | | onInited() { |
| | | // 注入组盘、拆盘按钮到操作列 |
| | | this.editTableButtons = [ |
| | | { name: "组盘", onClick: this.onGroupPallet }, |
| | | { name: "拆盘", onClick: this.onSplitPallet } |
| | | ]; |
| | | return true; |
| | | }, |
| | | async onGroupPallet({ row }) { |
| | | // 调用组盘接口 |
| | | let result = await this.$api.post("/Stock/GroupPalletConfirm", { palletCode: row.palletCode }); |
| | | if (result.status) { |
| | | this.$Message.success("组盘成功,MES数据已异步上传"); |
| | | this.$refs.grid.search(); |
| | | } else { |
| | | this.$Message.error(result.message || "组盘失败"); |
| | | } |
| | | }, |
| | | async onSplitPallet({ row }) { |
| | | // 调用拆盘接口 |
| | | let result = await this.$api.post("/Stock/SplitPalletConfirm", { palletCode: row.palletCode }); |
| | | if (result.status) { |
| | | this.$Message.success("拆盘成功,MES数据已异步上传"); |
| | | this.$refs.grid.search(); |
| | | } else { |
| | | this.$Message.error(result.message || "拆盘失败"); |
| | | } |
| | | }, |
| | | searchBefore(param) { |
| | | return true; |
| | | }, |