fix: 统一长度单位显示为米并优化CoilInfo组件
将多处长度单位从毫米(mm)改为米(m),保持单位统一 重构CoilInfo组件为动态字段配置模式,提升可维护性 移除未使用的CoilInfoRender组件引用
This commit is contained in:
@@ -1,44 +1,22 @@
|
||||
<template>
|
||||
<el-descriptions
|
||||
:column="column"
|
||||
:border="true"
|
||||
:border="border"
|
||||
size="small"
|
||||
>
|
||||
<el-descriptions-item label="入场卷号">{{ coilInfo.enterCoilNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前卷号">{{ coilInfo.currentCoilNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="厂家原料号">{{ coilInfo.supplierCoilNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="逻辑库位">{{ coilInfo.warehouseName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实际库区">{{ coilInfo.actualWarehouseName || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="班组">{{ coilInfo.team || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料类型">{{ coilInfo.materialType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产品/原料">{{ coilInfo.itemName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">{{ coilInfo.specification || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材质">{{ coilInfo.material || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="厂家">{{ coilInfo.manufacturer || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="镀层质量">{{ coilInfo.zincLayer || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="表面处理">{{ coilInfo.surfaceTreatmentDesc || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="质量状态">
|
||||
<span :class="getStatusClass(coilInfo.qualityStatus)">{{ coilInfo.qualityStatus || '-' }}</span>
|
||||
<template slot="extra">
|
||||
<slot name="extra"></slot>
|
||||
</template>
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in filteredFields"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:span="item.span || 1"
|
||||
>
|
||||
<template>
|
||||
{{ item.value || '-' }}
|
||||
</template>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="切边要求">{{ coilInfo.trimmingRequirement || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="原料材质">{{ coilInfo.packingStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="包装要求">{{ coilInfo.packagingRequirement || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实测厚度[mm]">{{ coilInfo.actualThickness || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实测宽度[mm]">{{ coilInfo.actualWidth || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="长度[mm]">{{ coilInfo.length || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="毛重[t]">{{ coilInfo.grossWeight || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="净重[t]">{{ coilInfo.netWeight || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产开始">{{ coilInfo.productionStartTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产结束">{{ coilInfo.productionEndTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="调制度">{{ coilInfo.temperGrade || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="镀层种类">{{ coilInfo.coatingType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="表面处理">{{ coilInfo.coilSurfaceTreatment || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="column - 2">{{ coilInfo.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
@@ -54,22 +32,62 @@ export default {
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
// 只显示有值的字段
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 只显示有值的字段
|
||||
showOnlyValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatusClass(status) {
|
||||
if (!status) return ''
|
||||
const statusLower = status.toLowerCase()
|
||||
if (statusLower.includes('合格')) return 'status-success'
|
||||
if (statusLower.includes('不合格')) return 'status-danger'
|
||||
if (statusLower.includes('待检')) return 'status-warning'
|
||||
return ''
|
||||
computed: {
|
||||
fields() {
|
||||
return [
|
||||
{ label: '入场卷号', key: 'enterCoilNo' },
|
||||
{ label: '当前卷号', key: 'currentCoilNo' },
|
||||
{ label: '厂家原料号', key: 'supplierCoilNo' },
|
||||
{ label: '逻辑库位', key: 'warehouseName' },
|
||||
{ label: '实际库区', key: 'actualWarehouseName' },
|
||||
{ label: '班组', key: 'team' },
|
||||
{ label: '材料类型', key: 'materialType' },
|
||||
{ label: '物料名', key: 'itemName' },
|
||||
{ label: '规格', key: 'specification' },
|
||||
{ label: '材质', key: 'material' },
|
||||
{ label: '厂家', key: 'manufacturer' },
|
||||
{ label: '镀层质量', key: 'zincLayer' },
|
||||
{ label: '表面处理', key: 'surfaceTreatmentDesc' },
|
||||
{ label: '质量状态', key: 'qualityStatus' },
|
||||
{ label: '切边要求', key: 'trimmingRequirement' },
|
||||
{ label: '原料材质', key: 'packingStatus' },
|
||||
{ label: '包装要求', key: 'packagingRequirement' },
|
||||
{ label: '实测厚度[mm]', key: 'actualThickness' },
|
||||
{ label: '实测宽度[mm]', key: 'actualWidth' },
|
||||
{ label: '长度[m]', key: 'length' },
|
||||
{ label: '毛重[t]', key: 'grossWeight' },
|
||||
{ label: '净重[t]', key: 'netWeight' },
|
||||
{ label: '生产开始', key: 'productionStartTime' },
|
||||
{ label: '生产结束', key: 'productionEndTime' },
|
||||
{ label: '调制度', key: 'temperGrade' },
|
||||
{ label: '镀层种类', key: 'coatingType' },
|
||||
{ label: '钢卷表面处理', key: 'coilSurfaceTreatment' },
|
||||
{ label: '备注', key: 'remark', span: this.column > 2 ? this.column - 2 : 1 }
|
||||
]
|
||||
},
|
||||
filteredFields() {
|
||||
let fields = this.fields.map(item => ({
|
||||
...item,
|
||||
value: this.coilInfo[item.key]
|
||||
}))
|
||||
|
||||
if (this.showOnlyValue) {
|
||||
fields = fields.filter(item => item.value !== undefined && item.value !== null && item.value !== '')
|
||||
}
|
||||
|
||||
return fields
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user