feat(mes/roll/grind): 增加厂家搜索筛选和CR类型选项

1. 新增厂家搜索输入框和筛选逻辑
2. 新增CR类型的单选筛选按钮
3. 在辊子列表中展示厂家信息
4. 优化有效当前辊径的默认返回逻辑
This commit is contained in:
2026-05-30 15:05:43 +08:00
parent 3b7ae10499
commit 6a5220ad78

View File

@@ -27,10 +27,13 @@
<div class="roll-filter">
<el-input v-model="filterNo" size="small" placeholder="编号搜索" prefix-icon="el-icon-search"
clearable @input="filterRolls" style="margin-bottom:8px" />
<el-input v-model="filterManufacturer" size="small" placeholder="厂家搜索" prefix-icon="el-icon-search"
clearable @input="filterRolls" style="margin-bottom:8px" />
<el-radio-group v-model="filterType" size="small" @change="filterRolls" style="margin-bottom:8px">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="WR">WR</el-radio-button>
<el-radio-button label="BR">BR</el-radio-button>
<el-radio-button label="CR">CR</el-radio-button>
</el-radio-group>
</div>
@@ -47,6 +50,7 @@
<span :class="['ri-status', 'st-' + r.status]">{{ statusLabel(r.status) }}</span>
<span class="ri-dia">φ{{ r.currentDia != null ? r.currentDia : r.initialDia }}</span>
</div>
<div v-if="r.manufacturer" class="ri-manufacturer">{{ r.manufacturer }}</div>
<div v-if="filterLineId === null && r.lineName" class="ri-line">{{ r.lineName }}</div>
</div>
<div v-if="!rollLoading && filteredRolls.length === 0" class="roll-empty">暂无数据</div>
@@ -260,6 +264,7 @@ export default {
filteredRolls: [],
filterNo: '',
filterType: '',
filterManufacturer: '',
// 右侧选中辊
selectedRollId: null,
@@ -301,9 +306,9 @@ export default {
// 有效当前辊径:优先取 currentDia无则取最新磨削记录的磨后径
effectiveCurrentDia() {
if (this.selectedRoll && this.selectedRoll.currentDia != null) {
return parseFloat(this.selectedRoll.currentDia)
}
// if (this.selectedRoll && this.selectedRoll.currentDia != null) {
// return parseFloat(this.selectedRoll.currentDia)
// }
if (this.grindList.length > 0) {
const latest = [...this.grindList].sort((a, b) => {
const ta = a.grindTime ? new Date(a.grindTime).getTime() : 0
@@ -311,6 +316,8 @@ export default {
return tb - ta
})[0]
if (latest && latest.diaAfter != null) return parseFloat(latest.diaAfter)
} else {
return null
}
return null
},
@@ -363,7 +370,8 @@ export default {
this.filteredRolls = this.allRolls.filter(r => {
const matchNo = !this.filterNo || r.rollNo.includes(this.filterNo)
const matchType = !this.filterType || r.rollType === this.filterType
return matchNo && matchType
const matchMfr = !this.filterManufacturer || (r.manufacturer || '').toLowerCase().includes(this.filterManufacturer.toLowerCase())
return matchNo && matchType && matchMfr
})
},
selectRoll(r) {
@@ -545,6 +553,7 @@ export default {
.ri-no { font-family: 'Consolas', monospace; font-size: 13px; font-weight: 600; color: #1f2329; }
.ri-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.ri-dia { font-size: 11px; color: #9aa0a6; }
.ri-manufacturer { font-size: 10px; color: #909399; margin-top: 2px; }
.ri-line { font-size: 10px; color: #b0b3bb; margin-top: 2px; }
.ri-status { font-size: 11px; }
.roll-empty { text-align: center; color: #c0c4cc; padding: 20px 0; font-size: 12px; }