dengjunjie
4 天以前 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue
@@ -23,7 +23,7 @@
                >已选数量: {{ selectionSum }}
              </span>
            </el-col>
            <el-col :span="4">
            <!-- <el-col :span="4">
              <el-link
                type="primary"
                size="small"
@@ -31,7 +31,7 @@
                @click="revokeAssign"
                >撤销分配</el-link
              ></el-col
            >
            > -->
          </el-row>
        </el-alert>
      </div>
@@ -62,17 +62,35 @@
            :width="item.width"
            align="center"
          >
            <template #default="scoped" v-if="item.type == 'icon'">
              <el-tooltip
                class="item"
                effect="dark"
                :content="item.title"
                placement="bottom"
                ><el-button
                  type="text"
                  @click="tableButtonClick(scoped.row, item)"
                  ><i :class="item.icon" style="font-size: 22px"></i></el-button
              ></el-tooltip>
            <template #default="scoped">
              <template v-if="item.type == 'icon'">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="item.title"
                  placement="bottom"
                  ><el-button
                    type="text"
                    @click="tableButtonClick(scoped.row, item)"
                    ><i
                      :class="item.icon"
                      :style="{ fontSize: item.iconSize || '22px' }"
                    ></i></el-button
                ></el-tooltip>
              </template>
              <template v-else>
                <el-tooltip
                  :content="scoped.row[item.prop]"
                  placement="top"
                  :disabled="
                    !isContentOverflow(scoped.row[item.prop], item.width)
                  "
                >
                  <div class="cell-content">
                    {{ scoped.row[item.prop] }}
                  </div>
                </el-tooltip>
              </template>
            </template>
          </el-table-column>
        </el-table>
@@ -101,23 +119,23 @@
      showDetialBox: false,
      tableData: [],
      tableColumns: [
        {
          prop: "materielCode",
          title: "物料编号",
          type: "string",
          width: 150,
        },
        {
          prop: "materielName",
          title: "物料名称",
          type: "string",
          width: 150,
        },
        // {
        //   prop: "materielCode",
        //   title: "物料编号",
        //   type: "string",
        //   width: 150,
        // },
        // {
        //   prop: "materielName",
        //   title: "物料名称",
        //   type: "string",
        //   width: 150,
        // },
        // {
        //   prop: "palletCode",
        //   title: "托盘编号",
        //   type: "string",
        //   width: 150,
        //   width: 280,
        // },
        {
          prop: "batchNo",
@@ -126,13 +144,19 @@
          width: 150,
        },
        // {
        //   prop: "locationCode",
        //   title: "货位编号",
        //   prop: "stockQuantity",
        //   title: "库存",
        //   type: "string",
        //   width: 150,
        // },
        // {
        //   prop: "outboundQuantity",
        //   title: "出库袋数",
        //   type: "string",
        //   width: 180,
        // },
        {
          prop: "useableQuantity",
          prop: "stockQuantity",
          title: "可用数量",
          type: "string",
        },
@@ -144,6 +168,13 @@
    };
  },
  methods: {
    isContentOverflow(content, width) {
      if (!content || !width) return false;
      // ä¼°ç®—每个字符的宽度(根据字体大小调整)
      const charWidth = 8; // å‡è®¾æ¯ä¸ªå­—符宽度为 8px
      const maxChars = Math.floor(width / charWidth);
      return content.length > maxChars;
    },
    open(row) {
      this.row = row;
      this.showDetialBox = true;
@@ -175,9 +206,15 @@
        });
    },
    outbound() {
      if (this.selection.length <= 0) {
        return this.$message.error("请选择指定库存");
      }
      // if (this.selectionSum > this.row.orderQuantity) {
      //   return this.$message.error("已选数量不能超过需求数量");
      // }
      this.http
        .post(
          "api/Task/GenerateOutboundTask?id=" + this.row.id,
          "api/Task/NewGenerateOutboundTask?id=" + this.row.id,
          this.selection,
          "数据处理中"
        )
@@ -193,7 +230,9 @@
    getData() {
      this.http
        .post(
          "api/StockInfo/GetStockSelectViews?materielCode=" +
          // "api/StockInfo/GetStockSelectViews?materielCode=" +
          //   this.row.materielCode,
          "api/InventoryBatch/GetInventoryBatch?materielCode=" +
            this.row.materielCode,
          null,
          "查询中"
@@ -224,7 +263,7 @@
      this.selectionSum =
        val.reduce(
          (accumulator, currentValue) =>
            accumulator + currentValue["useableQuantity"],
            accumulator + currentValue["stockQuantity"],
          0
        ) + this.originalQuantity;
      if (this.selectionSum == this.row.orderQuantity) {
@@ -263,6 +302,12 @@
.more-style {
  color: red;
}
.cell-content {
  white-space: nowrap; /* é˜²æ­¢æ¢è¡Œ */
  overflow: hidden; /* éšè—è¶…出部分 */
  text-overflow: ellipsis; /* æ˜¾ç¤ºçœç•¥å· */
  width: 100%; /* å®½åº¦å æ»¡å•元格 */
}
</style>
<style>