feat: 添加钢卷ID字段并实现导出功能

- 在WmsActualWarehouseVo中添加coilId字段
- 在WmsActualWarehouseServiceImpl中设置coilId值
- 在WarehouseBird组件中添加导出库内钢卷信息功能
- 在CoilTable组件中添加总卷数和总净重统计显示
This commit is contained in:
砂糖
2026-04-03 15:34:19 +08:00
parent b9385858f3
commit c4c9641901
4 changed files with 40 additions and 23 deletions

View File

@@ -1,5 +1,10 @@
<template>
<div>
<!-- 统计信息 -->
<div class="coil-stats" style="margin-bottom: 10px; padding: 10px; background-color: #f5f7fa; border-radius: 4px;">
<span style="margin-right: 20px;"><strong>总卷数{{ totalCoils }}</strong></span>
<span><strong>总净重{{ totalNetWeight }} kg</strong></span>
</div>
<KLPTable :data="data" :floatLayer="true" :floatLayerConfig="floatLayerConfig">
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
<template slot-scope="scope">
@@ -21,21 +26,8 @@
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
</template>
</el-table-column>
<el-table-column label="长度 (米)" align="center" prop="length" />
<!-- <el-table-column label="关联信息" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.parentCoilNos && scope.row.hasMergeSplit === 1 && scope.row.dataType === 1">
<el-tag type="warning" size="mini">来自母卷{{ scope.row.parentCoilNos }}</el-tag>
</span>
<span v-else-if="scope.row.parentCoilNos && scope.row.dataType === 0">
<el-tag type="info" size="mini">分为子卷{{ scope.row.parentCoilNos }}</el-tag>
</span>
<span v-else-if="scope.row.parentCoilNos && scope.row.hasMergeSplit === 2">
<el-tag type="success" size="mini">合并自{{ scope.row.parentCoilNos }}</el-tag>
</span>
<span v-else></span>
</template>
</el-table-column> -->
<!-- <el-table-column label="长度 (米)" align="center" prop="length" /> -->
<el-table-column label="净重(t)" align="center" prop="netWeight" />
<el-table-column label="质量状态" align="center" prop="qualityStatus"></el-table-column>
@@ -101,6 +93,18 @@ export default {
LabelRender,
CoilNo
},
computed: {
// 计算总卷数
totalCoils() {
return this.data.length;
},
// 计算总净重
totalNetWeight() {
return this.data.reduce((sum, item) => {
return sum + (Number(item.netWeight) || 0);
}, 0).toFixed(2);
}
},
data() {
return {
floatLayerConfig: {

View File

@@ -3,14 +3,18 @@
<!-- 统计信息卡片 -->
<div class="statistics-card">
<el-card shadow="hover">
<div class="statistics-item">
<span class="label">总库位数</span>
<span class="value">{{ statistics.total }}</span>
</div>
<div class="statistics-item">
<span class="label">总列数</span>
<span class="value">{{ statistics.columnCount }}</span>
<div style="display: flex; gap: 10px; align-items: center;">
<div class="statistics-item">
<span class="label">总库位数</span>
<span class="value">{{ statistics.total }}</span>
</div>
<div class="statistics-item">
<span class="label">总列数</span>
<span class="value">{{ statistics.columnCount }}</span>
</div>
<el-button type="primary" @click="exportData">导出库内钢卷信息</el-button>
</div>
<el-table :data="tableData" border size="medium" style="width: 100%; margin-bottom: 20px;">
<!-- 表头配置合并表头实现层级展示 -->
<el-table-column label="列信息" align="center" width="80">
@@ -83,6 +87,7 @@
<script>
import WarehouseInterlaced from './WarehouseInterlaced.vue';
// import { listCoilWithIds } from "@/api/wms/coil";
export default {
name: "WarehouseBird",
@@ -136,6 +141,13 @@ export default {
this.$emit('split-warehouse', warehouse);
},
exportData() {
// 收集coilIds
this.download('wms/materialCoil/export', {
coilIds: this.warehouseList.map(item => item.coilId).join(',')
}, `库内钢卷信息_${new Date().getTime()}.xlsx`)
},
// 1. 转换layerDetail为表格所需的数组格式
formatTableData() {
const layerDetail = this.statistics.layerDetail;
@@ -347,7 +359,6 @@ export default {
margin-bottom: 16px;
.statistics-item {
margin-bottom: 8px;
&:last-child {
margin-bottom: 0;

View File

@@ -83,6 +83,7 @@ public class WmsActualWarehouseVo {
private String enterCoilNo;
private String currentCoilNo;
private String supplierCoilNo;
private Long coilId;

View File

@@ -241,6 +241,7 @@ public class WmsActualWarehouseServiceImpl implements IWmsActualWarehouseService
it.setEnterCoilNo(c.getEnterCoilNo());
it.setCurrentCoilNo(c.getCurrentCoilNo());
it.setSupplierCoilNo(c.getSupplierCoilNo());
it.setCoilId(c.getCoilId());
}
}
});