wanshenmean
12 小时以前 0be9278cafe353fd47e069429709933d900e227b
feat(stock): 新增组盘、拆盘按钮调用MES接口

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
已修改1个文件
31 ■■■■■ 文件已修改
Code/WMS/WIDESEA_WMSClient/src/extension/stock/stock.jsx 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/extension/stock/stock.jsx
@@ -1,4 +1,4 @@
// 页面扩展配置:预留给库存页面二次开发。
// 页面扩展配置:库存页面组盘/拆盘按钮扩展
let extension = {
  components: {
    gridHeader: "",
@@ -8,14 +8,39 @@
    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;
@@ -38,4 +63,4 @@
  },
};
export default extension;
export default extension;