feat(异常管理): 增强异常表格功能并优化显示

添加coil-info属性支持以显示异常挂载时机
新增创建人和创建时间列
调整主缺陷列位置
优化质量状态显示逻辑
This commit is contained in:
2026-05-05 17:42:41 +08:00
parent 2f5c799143
commit bc2e42b110
7 changed files with 41 additions and 11 deletions

View File

@@ -34,6 +34,13 @@
<dict-tag :options="dict.type.coil_abnormal_degree" :value="scope.row.degree" />
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="挂载时机" align="center" prop="abnormalTime" v-if="coilInfo.coilId">
<template slot-scope="scope">
{{ getAbnormalTime(scope.row) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable">
<template slot-scope="scope">
@@ -60,6 +67,10 @@ export default {
showCoil: {
type: Boolean,
default: false
},
coilInfo: {
type: Object,
default: () => ({})
}
},
components: {
@@ -76,6 +87,22 @@ export default {
if (this.editable) {
this.$emit('update', row);
}
},
// 计算目标列的异常挂载时机
// 如果coilInfo.coilId存在且与row.coilId相同
// 判断钢卷的createBy和row.createBy是否相同
// 判断钢卷的createTime与row的createTime是否在一分钟内
// 如果是,返回'生产时'
// 如果否,返回'补录'
getAbnormalTime(row) {
if (this.coilInfo.coilId === row.coilId) {
if (this.coilInfo.createBy === row.createBy) {
if (Math.abs(new Date(this.coilInfo.createTime) - new Date(row.createTime)) < 60 * 1000) {
return '生产时'
}
}
}
return '补录'
}
}
}