feat(异常管理): 增强异常表格功能并优化显示
添加coil-info属性支持以显示异常挂载时机 新增创建人和创建时间列 调整主缺陷列位置 优化质量状态显示逻辑
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<abnormal-table ref="abnormalTable" :list="coilAbnormalList"
|
<abnormal-table ref="abnormalTable" :list="coilAbnormalList"
|
||||||
:editable="true" :show-coil="false"
|
:editable="true" :show-coil="false" :coil-info="currentCoil"
|
||||||
@delete="handleDelete" @update="handleUpdate">
|
@delete="handleDelete" @update="handleUpdate">
|
||||||
</abnormal-table>
|
</abnormal-table>
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,13 @@
|
|||||||
<dict-tag :options="dict.type.coil_abnormal_degree" :value="scope.row.degree" />
|
<dict-tag :options="dict.type.coil_abnormal_degree" :value="scope.row.degree" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -60,6 +67,10 @@ export default {
|
|||||||
showCoil: {
|
showCoil: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
coilInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -76,6 +87,22 @@ export default {
|
|||||||
if (this.editable) {
|
if (this.editable) {
|
||||||
this.$emit('update', row);
|
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 '补录'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="主缺陷" prop="mainMark" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-checkbox v-model="scope.row.mainMark" :true-label="1" :false-label="0"></el-checkbox>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="80">
|
<el-table-column label="操作" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-if="scope.row.abnormalId" type="text" size="mini" @click="handleDelete(scope.row)" style="color: #f56c6c;">
|
<el-button v-if="scope.row.abnormalId" type="text" size="mini" @click="handleDelete(scope.row)" style="color: #f56c6c;">
|
||||||
@@ -92,11 +97,6 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="主缺陷" prop="mainMark" width="60">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-checkbox v-model="scope.row.mainMark" :true-label="1" :false-label="0"></el-checkbox>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -725,7 +725,7 @@
|
|||||||
<span class="section-title">异常信息</span>
|
<span class="section-title">异常信息</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="section-body">
|
<div class="section-body">
|
||||||
<abnormal-table ref="abnormalTable" :list="abmornalList" :editable="false" :show-coil="false" />
|
<abnormal-table ref="abnormalTable" :list="abmornalList" :editable="false" :show-coil="false" :coil-info="coilInfo" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<abnormal-table v-loading="loading" ref="abnormalTable" :list="coilAbnormalList"
|
<abnormal-table v-loading="loading" ref="abnormalTable" :list="coilAbnormalList"
|
||||||
:editable="true" :show-coil="false"
|
:editable="true" :show-coil="false" :coil-info="coilInfo"
|
||||||
@delete="handleDelete" @update="handleUpdate">
|
@delete="handleDelete" @update="handleUpdate">
|
||||||
</abnormal-table>
|
</abnormal-table>
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,8 @@
|
|||||||
<!-- 质量状态,点击后会出现弹窗显示详细信息 -->
|
<!-- 质量状态,点击后会出现弹窗显示详细信息 -->
|
||||||
<template v-else-if="column.prop === 'qualityStatus'">
|
<template v-else-if="column.prop === 'qualityStatus'">
|
||||||
<div @click="handleQualityStatusClick(scope.row)" style="cursor: pointer; background-color: #f5f7fa;">
|
<div @click="handleQualityStatusClick(scope.row)" style="cursor: pointer; background-color: #f5f7fa;">
|
||||||
<dict-tag :options="dict.type.coil_quality_status" :value="scope.row.qualityStatus"></dict-tag>
|
<dict-tag v-if="scope.row.qualityStatus" :options="dict.type.coil_quality_status" :value="scope.row.qualityStatus"></dict-tag>
|
||||||
|
<span v-else>暂未判级</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- 默认渲染 -->
|
<!-- 默认渲染 -->
|
||||||
@@ -64,7 +65,7 @@
|
|||||||
|
|
||||||
<el-dialog title="钢卷异常信息" :visible.sync="abmornal.visible" width="60%">
|
<el-dialog title="钢卷异常信息" :visible.sync="abmornal.visible" width="60%">
|
||||||
<abnormal-table ref="abnormalTable" :list="abmornal.data"
|
<abnormal-table ref="abnormalTable" :list="abmornal.data"
|
||||||
:editable="false" :show-coil="false" v-loading="abmornal.loading">
|
:editable="false" :show-coil="false" :coil-info="abmornal.currentCoil" v-loading="abmornal.loading">
|
||||||
</abnormal-table>
|
</abnormal-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@@ -123,6 +124,7 @@ export default {
|
|||||||
visible: false,
|
visible: false,
|
||||||
data: {},
|
data: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
|
currentCoil: {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -239,6 +241,7 @@ export default {
|
|||||||
handleQualityStatusClick(row) {
|
handleQualityStatusClick(row) {
|
||||||
this.abmornal.visible = true
|
this.abmornal.visible = true
|
||||||
this.abmornal.loading = true
|
this.abmornal.loading = true
|
||||||
|
this.abmornal.currentCoil = row
|
||||||
listCoilAbnormal({
|
listCoilAbnormal({
|
||||||
coilId: row.coilId
|
coilId: row.coilId
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
|
|||||||
Reference in New Issue
Block a user