heshaofeng
2026-02-02 deb12fd2b06ccc821104aa475a8fb784c39dfb2c
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
@@ -237,6 +237,12 @@
          width: 90,
        },
        {
          prop: "warehouseCode",
          title: "仓库编号",
          type: "string",
          width: 90,
        },
        {
          prop: "unit",
          title: "单位",
          type: "string",
@@ -418,38 +424,48 @@
      });
    },
    outbound() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
    if (this.selection.length === 0) {
      return this.$message.error("请选择单据明细");
    }
      const keys = this.selection.map((item) => item.id);
      const requestParams = {
        detailIds: keys,
        outboundQuantity: 1,
        operator: "",
        orderNo: this.row.orderNo,
        isBatch: this.isBatch,
      };
      console.log(requestParams);
      this.$refs.DirectOutbound.open(requestParams);
    },
    outboundbatch() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
    const keys = this.selection.map((item) => item.id);
    const requestParams = {
      detailIds: keys,
      outboundQuantity: 1,
      operator: "",
      orderNo: this.row.orderNo,
      isBatch: this.isBatch,
    };
    console.log(requestParams);
    this.$refs.DirectOutbound.open(requestParams);
  },
  outboundbatch() {
    if (this.selection.length === 0) {
      return this.$message.error("请选择单据明细");
    }
      const keys = this.selection.map((item) => item.id);
      const requestParams = {
        detailIds: keys,
        outboundQuantity:
          this.selection[0].orderQuantity - this.selection[0].lockQuantity,
        operator: "",
        orderNo: this.row.orderNo,
        isBatch: this.isBatch,
      };
      console.log(requestParams);
      this.$refs.DirectOutbound.open(requestParams);
    },
    const keys = this.selection.map((item) => item.id);
    // è®¡ç®—所有选中明细的可出库数量总和
    let totalOutboundQuantity = 0;
    this.selection.forEach(item => {
      // ç±»åž‹è½¬æ¢+容错,避免非数字值导致计算错误
      const orderQty = Number(item.orderQuantity) || 0;
      const lockQty = Number(item.lockQuantity) || 0;
      totalOutboundQuantity += (orderQty - lockQty);
    });
    const requestParams = {
      detailIds: keys,
      outboundQuantity: totalOutboundQuantity,
      operator: "",
      orderNo: this.row.orderNo,
      isBatch: this.isBatch,
    };
    console.log("分批出库参数:", requestParams);
    this.$refs.DirectOutbound.open(requestParams);
  },
    setCurrent(row) {
      this.$refs.singleTable.setCurrentRow(row);
    },