feat(报表): 增强报表功能并优化标签显示

- 新增镀锌1预填接口和报表字段
- 优化标签材质显示逻辑,移除content前缀
- 增加报表分页大小选项和耗时格式化
- 扩展报表可选列和默认列配置
- 改进报表统计计算逻辑,考虑质量状态
- 调整报表页面大小限制为99999
This commit is contained in:
砂糖
2026-03-20 17:56:08 +08:00
parent 25e4ce9b76
commit 4478921d9b
10 changed files with 96 additions and 23 deletions

View File

@@ -18,6 +18,10 @@
<template v-else-if="column.prop === 'status'">
{{ scope.row.status === 0 ? '在库' : '已出库' }}
</template>
<!-- 生产耗时单位分钟渲染为xx天xx小时xx分钟 -->
<template v-else-if="column.prop === 'productionDuration'">
{{ formatProductionDuration(scope.row.productionDuration) }}
</template>
<!-- 默认渲染 -->
<template v-else>
{{ scope.row[column.prop] }}
@@ -30,6 +34,7 @@
layout="total, sizes, prev, pager, next, jumper"
:total="total"
:page-size.sync="pageSize"
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
@@ -92,6 +97,26 @@ export default {
handleCurrentChange(val) {
this.pageNum = val
},
// 生产耗时单位分钟渲染为xx天xx小时xx分钟
formatProductionDuration(duration) {
if (!duration || isNaN(duration)) {
return '0分钟'
}
const days = Math.floor(duration / 1440)
const hours = Math.floor((duration - days * 1440) / 60)
const minutes = duration - days * 1440 - hours * 60
let result = ''
if (days > 0) {
result += `${days}`
}
if (hours > 0) {
result += `${hours}小时`
}
if (minutes > 0 || (days === 0 && hours === 0)) {
result += `${minutes}分钟`
}
return result
}
}
}
</script>

View File

@@ -136,8 +136,15 @@ export default {
optionalProps: [
{ label: '入场钢卷号', value: 'enterCoilNo' },
{ label: '当前钢卷号', value: 'currentCoilNo' },
{ label: '厂家钢卷号', value: 'supplierCoilNo' },
{ label: '逻辑库区', value: 'warehouseName' },
{ label: '实际库区', value: 'actualWarehouseName' },
{ label: '质量状态', value: 'qualityStatus' },
{ label: '切边要求', value: 'trimmingRequirement' },
{ label: '打包状态', value: 'packingStatus' },
{ label: '包装要求', value: 'packagingRequirement' },
{ label: '产品类型', value: 'itemId' },
{ label: '品名', value: 'itemName' },
{ label: '宽度', value: 'computedWidth' },