Compare commits

...

2 Commits

Author SHA1 Message Date
e9de87a7b6 Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X 2026-05-23 09:18:29 +08:00
a5b1a19a2b fix(mes/roll/grind): 修复当前辊径显示和取值逻辑
将当前辊径取值改为优先使用有效当前辊径计算逻辑,统一磨削前辊径取值
2026-05-23 09:18:24 +08:00

View File

@@ -68,7 +68,7 @@
<div class="rh-item"><span class="rh-k">辊型</span><span class="rh-v">{{ selectedRoll.rollType === 'WR' ? '工作辊' : '支撑辊' }}</span></div>
<div class="rh-item"><span class="rh-k">材质</span><span class="rh-v">{{ selectedRoll.material || '—' }}</span></div>
<div class="rh-item"><span class="rh-k">初始辊径</span><span class="rh-v">{{ selectedRoll.initialDia != null ? selectedRoll.initialDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">当前辊径</span><span class="rh-v bold accent">{{ selectedRoll.currentDia != null ? selectedRoll.currentDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">当前辊径</span><span class="rh-v bold accent">{{ effectiveCurrentDia != null ? effectiveCurrentDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">最小辊径</span><span class="rh-v">{{ selectedRoll.minDia != null ? selectedRoll.minDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">磨削次数</span><span class="rh-v">{{ tableData.length ? tableData.length + ' 次' : '0 次' }}</span></div>
<div class="rh-item"><span class="rh-k">粗糙度</span><span class="rh-v">{{ selectedRoll.roughness != null ? selectedRoll.roughness + ' μm' : '—' }}</span></div>
@@ -296,6 +296,22 @@ export default {
})
},
// 有效当前辊径:优先取 currentDia无则取最新磨削记录的磨后径
effectiveCurrentDia() {
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
const tb = b.grindTime ? new Date(b.grindTime).getTime() : 0
return tb - ta
})[0]
if (latest && latest.diaAfter != null) return parseFloat(latest.diaAfter)
}
return null
},
// 表格数据:新增时在顶部插入一个编辑行占位
tableData() {
if (this.editRow && this.editRow.__isNew) {
@@ -401,8 +417,7 @@ export default {
rollId: this.selectedRollId,
grindTime,
team: undefined,
diaBefore: this.selectedRoll && this.selectedRoll.currentDia != null
? parseFloat(this.selectedRoll.currentDia) : undefined,
diaBefore: this.effectiveCurrentDia != null ? this.effectiveCurrentDia : undefined,
diaAfter: undefined,
rollShape: '平',
flawResult: '合格',