1
dengjunjie
2025-03-18 9f225bb1f1e26d25c1652d3e1ec2a8f239f69615
ÏîÄ¿´úÂë/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>
@@ -81,9 +99,9 @@
        <el-button type="primary" size="small" @click="outbound"
          >直接出库</el-button
        >
        <el-button type="primary" size="small" @click="lockStock"
        <!-- <el-button type="primary" size="small" @click="lockStock"
          >锁定库存</el-button
        >
        > -->
        <el-button type="danger" size="small" @click="showDetialBox = false"
          >关闭</el-button
        >
@@ -120,9 +138,16 @@
          width: 150,
        },
        {
          prop: "batchNo",
          title: "批次号",
          type: "string",
          width: 150,
        },
        {
          prop: "locationCode",
          title: "货位编号",
          type: "string",
          width: 180,
        },
        {
@@ -138,6 +163,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;
@@ -169,6 +201,9 @@
        });
    },
    outbound() {
      if (this.selection.length <= 0) {
        return this.$message.error("请选择指定库存");
      }
      this.http
        .post(
          "api/Task/GenerateOutboundTask?id=" + this.row.id,
@@ -257,6 +292,12 @@
.more-style {
  color: red;
}
.cell-content {
  white-space: nowrap; /* é˜²æ­¢æ¢è¡Œ */
  overflow: hidden; /* éšè—è¶…出部分 */
  text-overflow: ellipsis; /* æ˜¾ç¤ºçœç•¥å· */
  width: 100%; /* å®½åº¦å æ»¡å•元格 */
}
</style>
<style>