647556386
2026-01-27 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
@@ -41,7 +41,7 @@
              <el-link
                type="primary"
                size="small"
                v-if="isBatch === 0"
                v-if="isBatch === 0 && mainBusinessType != '30'"
                style="float: right; height: 20px; margin-right: 10px"
                @click="outbound"
                >直接出库</el-link
@@ -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);
    },