fix(wms/coil): 修复钻取表格物料名称显示问题并添加表格高度限制

修复从store获取物料名称的逻辑,确保钻取对话框标题正确显示物料名称
为两个表格添加max-height属性,防止数据过多时表格高度无限增长
This commit is contained in:
砂糖
2025-10-31 13:26:12 +08:00
parent c657dad4d3
commit 50ab8dfbb9

View File

@@ -35,7 +35,7 @@
<!-- 数据表格 -->
<div class="table-container">
<el-table :data="list" border stripe style="width: 100%; margin-top: 20px" @row-click="handleTableRowClick"
<el-table max-height="400" :data="list" border stripe style="width: 100%; margin-top: 20px" @row-click="handleTableRowClick"
row-class-name="table-row-hover">
<!-- 仓库相关列仅仓库统计时有效 -->
<el-table-column v-if="queryParams.statType === '2'" prop="warehouseName" label="仓库名称" align="center"
@@ -95,7 +95,7 @@
</template>
<!-- 钻取表格 -->
<el-table v-loading="drillDownLoading" :data="drillDownList" border stripe style="width: 100%"
<el-table max-height="400" v-loading="drillDownLoading" :data="drillDownList" border stripe style="width: 100%"
v-if="!drillDownLoading">
<el-table-column prop="warehouseName" label="仓库名称" align="center" min-width="150"></el-table-column>
<el-table-column prop="currentCoilNo" label="当前卷号" align="center" min-width="120"></el-table-column>
@@ -145,6 +145,7 @@ import MaterialSelect from "@/components/KLPService/MaterialSelect";
import * as echarts from 'echarts';
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
import { findItemWithBom } from "@/store/modules/category";
export default {
components: {
@@ -532,8 +533,11 @@ export default {
// 物料统计钻取
this.drillDownParams.itemType = data.itemType;
this.drillDownParams.itemId = data.itemId;
this.drillDownParams.itemName = data.name;
this.dialogTitle = `${data.itemType === 'product' ? '成品' : '原材料'}库存明细 - ${data.name}`;
// 从store中获取物料名称
const item = findItemWithBom(data.itemType, data.itemId);
console.log('item', item, data);
this.drillDownParams.itemName = item ? item.itemName : data.name;
this.dialogTitle = `${data.itemType === 'product' ? '成品' : '原材料'}库存明细 - ${this.drillDownParams.itemName}`;
} else if (data.warehouseId && data.warehouseName) {
// 仓库统计钻取
this.drillDownParams.warehouseId = data.warehouseId;