酸轧数据同步,轧辊新增产线新增各种产线

This commit is contained in:
2026-05-14 15:12:30 +08:00
parent 4a5b9544a4
commit 49561a125e
41 changed files with 2054 additions and 319 deletions

View File

@@ -0,0 +1,707 @@
<template>
<div class="app-container working-roll-page">
<!-- 顶部行作业辊一览2/3+ 可用轧辊1/3 -->
<div class="top-row">
<!-- 作业辊一览 -->
<el-card shadow="never" class="roll-table-card top-row__main">
<div slot="header" class="card-header">
<span class="card-title"><i class="el-icon-s-grid" /> 作业辊一览</span>
<span class="header-meta" v-if="current.changeTime">末次换辊{{ current.changeTime }}</span>
<span style="margin-left:auto;display:flex;align-items:center;gap:6px">
<el-button size="mini" icon="el-icon-refresh-right" @click="handleOpenChange">换辊</el-button>
<el-divider direction="vertical" />
<el-button type="success" size="mini" icon="el-icon-plus" @click="handleAddStandby">添加下批</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleClearStandby"
:disabled="!standbyList.length">清空下批</el-button>
</span>
</div>
<el-table
ref="mainTable"
:data="mergedRows"
v-loading="loadingCurrent || loadingStandby"
:row-class-name="rowClass"
:span-method="mergeParamCol"
border
size="small"
style="width:100%"
>
<el-table-column label="参数" width="156" align="left">
<template slot-scope="scope">
<span :class="['param-label', scope.row.group]">{{ scope.row.label }}</span>
</template>
</el-table-column>
<el-table-column label="当前在机轧辊" align="center" min-width="120">
<template slot-scope="scope">
<param-cell :data="scope.row.cur" />
</template>
</el-table-column>
<el-table-column label="下批轧辊" align="center" min-width="120">
<template slot-scope="scope">
<div
:class="['sb-cell',
scope.row.sb && scope.row.sb.standbyId ? 'sb-cell--del' :
scope.row.rollType ? 'sb-cell--add' : '']"
@click="handleSbCellClick(scope.row.sb, scope.row.rollType, scope.row.position)"
>
<param-cell :data="scope.row.sb" />
</div>
</template>
</el-table-column>
</el-table>
</el-card>
<!-- 右侧可用辊 + 工作绩效 -->
<div class="top-row__aside aside-col">
<!-- 可用轧辊离线 -->
<el-card shadow="never" class="roll-table-card aside-panel">
<div slot="header" class="card-header">
<span class="card-title"><i class="el-icon-files" /> 可用轧辊离线</span>
<el-button size="mini" icon="el-icon-refresh" style="margin-left:auto" @click="loadOfflineRolls">刷新</el-button>
</div>
<el-table v-loading="offlineLoading" :data="offlineRolls" size="small" :height="asideHalfH" style="width:100%">
<el-table-column label="辊型" align="center" prop="rollType" width="52">
<template slot-scope="scope">
<el-tag size="mini" :type="scope.row.rollType === 'WR' ? 'primary' : 'warning'">{{ scope.row.rollType }}</el-tag>
</template>
</el-table-column>
<el-table-column label="轧辊编号" align="center" prop="rollNo" min-width="90" show-overflow-tooltip />
<el-table-column label="辊径(mm)" align="center" width="76">
<template slot-scope="scope">{{ scope.row.currentDia != null ? scope.row.currentDia : scope.row.initialDia }}</template>
</el-table-column>
<el-table-column label="粗糙度" align="center" prop="roughness" width="64" />
</el-table>
</el-card>
<!-- 工作绩效 -->
<el-card shadow="never" class="roll-table-card aside-panel">
<div slot="header" class="card-header">
<span class="card-title"><i class="el-icon-data-analysis" /> 工作绩效实时</span>
<el-button size="mini" icon="el-icon-refresh" style="margin-left:auto" @click="loadRollPerformance">刷新</el-button>
</div>
<el-table v-loading="perfLoading" :data="perfRows" size="small" :height="asideHalfH" border style="width:100%">
<el-table-column label="辊位" align="center" prop="label" width="80" />
<el-table-column label="轧辊编号" align="center" width="110">
<template slot-scope="scope"><span class="perf-roll">{{ scope.row.rollNo || '—' }}</span></template>
</el-table-column>
<el-table-column label="工作长度(m)" align="center" width="100">
<template slot-scope="scope">{{ scope.row.workLength != null ? scope.row.workLength : '—' }}</template>
</el-table-column>
<el-table-column label="过卷数" align="center" width="70">
<template slot-scope="scope">{{ scope.row.coilCount != null ? scope.row.coilCount : '—' }}</template>
</el-table-column>
</el-table>
</el-card>
</div>
</div>
<!-- 换辊历史 -->
<el-card shadow="never" class="roll-table-card" style="margin-top:16px">
<div slot="header" class="card-header">
<span class="card-title"><i class="el-icon-document" /> 换辊历史</span>
<el-form :inline="true" size="small" style="margin-left:auto;margin-bottom:0">
<el-form-item label="类型" style="margin-bottom:0">
<el-select v-model="historyQuery.changeType" placeholder="全部" clearable style="width:110px" @change="loadHistory">
<el-option label="计划换辊" value="计划换辊" />
<el-option label="紧急换辊" value="紧急换辊" />
</el-select>
</el-form-item>
<el-form-item label="时间起" style="margin-bottom:0">
<el-date-picker v-model="historyQuery.changeTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间"
style="width:160px" @change="loadHistory" />
</el-form-item>
</el-form>
</div>
<KLPTable v-loading="historyLoading" :data="historyList">
<el-table-column label="换辊编号" align="center" prop="changeNo" width="130" />
<el-table-column label="换辊时间" align="center" prop="changeTime" width="160" />
<el-table-column label="类型" align="center" prop="changeType" width="100">
<template slot-scope="scope">
<el-tag size="small" :type="scope.row.changeType === '紧急换辊' ? 'danger' : ''">{{ scope.row.changeType }}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operator" width="80" />
<el-table-column label="换辊辊组" align="left" min-width="160">
<template slot-scope="scope">
<div class="roll-group-cell">
<span v-if="scope.row.upperBrNo" class="rg-item"><b>上BR</b> {{ scope.row.upperBrNo }}<em v-if="scope.row.upperBrDia"> φ{{ scope.row.upperBrDia }}</em></span>
<span v-if="scope.row.upperWrNo" class="rg-item"><b>上WR</b> {{ scope.row.upperWrNo }}<em v-if="scope.row.upperWrDia"> φ{{ scope.row.upperWrDia }}</em></span>
<span v-if="scope.row.lowerWrNo" class="rg-item"><b>下WR</b> {{ scope.row.lowerWrNo }}<em v-if="scope.row.lowerWrDia"> φ{{ scope.row.lowerWrDia }}</em></span>
<span v-if="scope.row.lowerBrNo" class="rg-item"><b>下BR</b> {{ scope.row.lowerBrNo }}<em v-if="scope.row.lowerBrDia"> φ{{ scope.row.lowerBrDia }}</em></span>
<span v-if="!scope.row.upperBrNo && !scope.row.upperWrNo && !scope.row.lowerWrNo && !scope.row.lowerBrNo" style="color:#c0c4cc"></span>
</div>
</template>
</el-table-column>
<el-table-column label="工作长度(m)" align="center" prop="workLength" width="100" />
<el-table-column label="过卷数" align="center" prop="coilCount" width="72" />
<el-table-column label="过卷重量" align="center" prop="totalWeight" width="90" />
<el-table-column label="备注" align="left" prop="remark" min-width="100" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="110" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditHistory(scope.row)">补录</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" style="color:#c5221f"
@click="handleDeleteHistory(scope.row)">删除</el-button>
</template>
</el-table-column>
</KLPTable>
<pagination
v-show="historyTotal > 0"
:total="historyTotal"
:page.sync="historyQuery.pageNum"
:limit.sync="historyQuery.pageSize"
@pagination="loadHistory"
/>
</el-card>
<!-- 换辊确认弹窗 -->
<el-dialog title="确认换辊" :visible.sync="changeOpen" width="420px" append-to-body @close="resetChangeForm">
<div class="roll-preview">
<div class="roll-preview__title">以下轧辊将被换入</div>
<div class="roll-preview__item">
<span class="rp-label">上支撑辊</span>
<span class="rp-val">{{ changeForm.upperBrNo || '—' }}</span>
<span class="rp-dia" v-if="changeForm.upperBrDia">φ{{ changeForm.upperBrDia }} mm</span>
</div>
<div class="roll-preview__item">
<span class="rp-label">上工作辊</span>
<span class="rp-val">{{ changeForm.upperWrNo || '—' }}</span>
<span class="rp-dia" v-if="changeForm.upperWrDia">φ{{ changeForm.upperWrDia }} mm</span>
</div>
<div class="roll-preview__item">
<span class="rp-label">下工作辊</span>
<span class="rp-val">{{ changeForm.lowerWrNo || '—' }}</span>
<span class="rp-dia" v-if="changeForm.lowerWrDia">φ{{ changeForm.lowerWrDia }} mm</span>
</div>
<div class="roll-preview__item">
<span class="rp-label">下支撑辊</span>
<span class="rp-val">{{ changeForm.lowerBrNo || '—' }}</span>
<span class="rp-dia" v-if="changeForm.lowerBrDia">φ{{ changeForm.lowerBrDia }} mm</span>
</div>
</div>
<div class="roll-preview__tip">换辊时间和操作人将由系统自动记录</div>
<div slot="footer">
<el-button type="primary" :loading="changeSubmitting" @click="submitChange">确认换辊</el-button>
<el-button @click="changeOpen = false"> </el-button>
</div>
</el-dialog>
<!-- 换辊历史补录/编辑对话框 -->
<el-dialog title="换辊记录补录" :visible.sync="historyEditOpen" width="560px" append-to-body @close="historyEditForm = {}">
<el-form ref="historyEditForm" :model="historyEditForm" label-width="100px" size="small">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="换辊类型">
<el-select v-model="historyEditForm.changeType" style="width:100%">
<el-option label="计划换辊" value="计划换辊" />
<el-option label="紧急换辊" value="紧急换辊" />
<el-option label="三级换辊" value="三级换辊" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="换辊时间">
<el-date-picker v-model="historyEditForm.changeTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" style="width:100%" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="操作人">
<el-input v-model="historyEditForm.operator" />
</el-form-item>
<el-divider content-position="left">工作辊</el-divider>
<el-row :gutter="16">
<el-col :span="12"><el-form-item label="上工作辊"><el-input v-model="historyEditForm.upperWrNo" /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="上工作辊径"><el-input-number v-model="historyEditForm.upperWrDia" :precision="2" :min="0" style="width:100%" /></el-form-item></el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12"><el-form-item label="下工作辊"><el-input v-model="historyEditForm.lowerWrNo" /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="下工作辊径"><el-input-number v-model="historyEditForm.lowerWrDia" :precision="2" :min="0" style="width:100%" /></el-form-item></el-col>
</el-row>
<el-divider content-position="left">支撑辊</el-divider>
<el-row :gutter="16">
<el-col :span="12"><el-form-item label="上支撑辊"><el-input v-model="historyEditForm.upperBrNo" /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="上支撑辊径"><el-input-number v-model="historyEditForm.upperBrDia" :precision="2" :min="0" style="width:100%" /></el-form-item></el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12"><el-form-item label="下支撑辊"><el-input v-model="historyEditForm.lowerBrNo" /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="下支撑辊径"><el-input-number v-model="historyEditForm.lowerBrDia" :precision="2" :min="0" style="width:100%" /></el-form-item></el-col>
</el-row>
<el-form-item label="备注">
<el-input v-model="historyEditForm.remark" type="textarea" :rows="2" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitHistoryEdit"> </el-button>
<el-button @click="historyEditOpen = false"> </el-button>
</div>
</el-dialog>
<!-- 添加下批轧辊对话框 -->
<el-dialog title="添加下批轧辊" :visible.sync="standbyOpen" width="460px" append-to-body @close="resetStandbyForm">
<el-form ref="standbyForm" :model="standbyForm" :rules="standbyRules" label-width="100px">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="辊型" prop="rollType">
<el-input
v-if="standbyFromCell"
:value="standbyForm.rollType === 'WR' ? '工作辊 WR' : '支撑辊 BR'"
readonly style="width:100%"
/>
<el-select v-else v-model="standbyForm.rollType" placeholder="请选择" style="width:100%"
@change="handleStandbyRollTypeChange">
<el-option label="工作辊 WR" value="WR" />
<el-option label="支撑辊 BR" value="BR" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="辊位" prop="position">
<el-input
v-if="standbyFromCell"
:value="standbyForm.position === 'UP' ? '上辊' : '下辊'"
readonly style="width:100%"
/>
<el-select v-else v-model="standbyForm.position" placeholder="请选择" style="width:100%">
<el-option label="上辊" value="UP" />
<el-option label="下辊" value="DOWN" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="轧辊编号" prop="rollNo">
<el-select v-model="standbyForm.rollNo" placeholder="请选择" filterable style="width:100%">
<el-option
v-for="no in standbyForm.rollType === 'WR' ? wrOptions : brOptions"
:key="no" :label="no" :value="no"
/>
</el-select>
</el-form-item>
<el-form-item label="就绪时间">
<el-date-picker v-model="standbyForm.readyTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="默认当前时间" style="width:100%" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="standbyForm.remark" type="textarea" :rows="2" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitStandby"> </el-button>
<el-button @click="standbyOpen = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getCurrentRolls, listRollChange, addRollChange, updateRollChange, delRollChange, getRollPerformance } from '@/api/mes/roll/rollChange'
import { listRollStandby, addRollStandby, delRollStandby, clearRollStandby } from '@/api/mes/roll/rollStandby'
import { listRollOptions, listRollInfo } from '@/api/mes/roll/rollInfo'
import rollLineMixin from '../rollLineMixin'
const STAND_NO = '1#'
const ParamCell = {
name: 'ParamCell',
props: { data: { type: Object, default: null } },
render(h) {
const d = this.data
if (!d || d.val == null || d.val === '') return h('span', { class: 'cell-empty' }, '—')
return h('span', { class: 'cell-main' }, String(d.val))
}
}
export default {
name: 'WorkingRollSingle',
components: { ParamCell },
mixins: [rollLineMixin],
data() {
return {
current: {},
loadingCurrent: false,
standbyList: [],
loadingStandby: false,
rollInfoMap: {},
historyLoading: false,
historyList: [],
historyTotal: 0,
historyQuery: { pageNum: 1, pageSize: 15, standNo: STAND_NO, changeType: undefined, changeTime: undefined },
wrOptions: [],
brOptions: [],
historyEditOpen: false,
historyEditForm: {},
offlineRolls: [],
offlineLoading: false,
perfData: {},
perfLoading: false,
asideHalfH: 200,
changeOpen: false,
changeSubmitting: false,
changeForm: {},
standbyOpen: false,
standbyForm: {},
standbyFromCell: false,
standbyRules: {
rollType: [{ required: true, message: '请选择辊型', trigger: 'change' }],
position: [{ required: true, message: '请选择辊位', trigger: 'change' }],
rollNo: [{ required: true, message: '请选择轧辊编号', trigger: 'change' }]
}
}
},
computed: {
mergedRows() {
const c = this.current || {}
const ri = this.rollInfoMap
const cv = (val, rollNo) => ({
val: (val == null || val === '') ? null : val,
sub: rollNo || null
})
const rv = (rollNo, field) => {
const info = rollNo ? ri[rollNo] : null
const val = info ? info[field] : null
return { val: (val == null || val === '') ? null : val, sub: rollNo || null }
}
const sv = (rollType, pos, field) => {
const item = this.standbyList.find(i => i.rollType === rollType && i.position === pos)
if (!item) return { val: null, sub: null }
let val = item[field]
if ((val == null || val === '') && item.rollNo) {
const info = ri[item.rollNo]
if (info) {
val = field === 'diameter'
? (info.currentDia != null ? info.currentDia : info.initialDia)
: info[field]
}
}
return { val: (val == null || val === '') ? null : val, sub: item.rollNo, standbyId: item.standbyId }
}
const sm = (rollType, pos) => {
const item = this.standbyList.find(i => i.rollType === rollType && i.position === pos)
if (!item || !item.rollNo) return { val: null, sub: null }
const info = ri[item.rollNo]
return { val: info ? (info.material || null) : null, sub: item.rollNo, standbyId: item.standbyId }
}
return [
{ label: '上支承辊直径(mm)', group: 'br', rollType: 'BR', position: 'UP',
cur: cv(c.upperBrDia, c.upperBrNo), sb: sv('BR', 'UP', 'diameter') },
{ label: '上工作辊直径(mm)', group: 'wr', rollType: 'WR', position: 'UP',
cur: cv(c.upperWrDia, c.upperWrNo), sb: sv('WR', 'UP', 'diameter') },
{ label: '上工作辊凸度', group: 'wr', rollType: 'WR', position: 'UP',
cur: rv(c.upperWrNo, 'crown'), sb: sv('WR', 'UP', 'crown') },
{ label: '上工作辊粗糙度(μm)', group: 'wr', rollType: 'WR', position: 'UP',
cur: rv(c.upperWrNo, 'roughness'), sb: sv('WR', 'UP', 'roughness') },
{ label: '工作辊类型', group: 'wr', rollType: 'WR', position: 'UP',
cur: rv(c.upperWrNo, 'material'), sb: sm('WR', 'UP') },
{ label: '下工作辊直径(mm)', group: 'wr', rollType: 'WR', position: 'DOWN',
cur: cv(c.lowerWrDia, c.lowerWrNo), sb: sv('WR', 'DOWN', 'diameter') },
{ label: '下工作辊凸度', group: 'wr', rollType: 'WR', position: 'DOWN',
cur: rv(c.lowerWrNo, 'crown'), sb: sv('WR', 'DOWN', 'crown') },
{ label: '下工作辊粗糙度(μm)', group: 'wr', rollType: 'WR', position: 'DOWN',
cur: rv(c.lowerWrNo, 'roughness'), sb: sv('WR', 'DOWN', 'roughness') },
{ label: '下支承辊直径(mm)', group: 'br', rollType: 'BR', position: 'DOWN',
cur: cv(c.lowerBrDia, c.lowerBrNo), sb: sv('BR', 'DOWN', 'diameter') }
]
},
perfRows() {
const standData = (this.perfData['upperBr'] || {})
const d = (key) => {
const obj = (this.perfData[key] || {})[STAND_NO] || {}
return { rollNo: obj.rollNo, workLength: obj.workLength, coilCount: obj.coilCount }
}
return [
{ label: '上支撑辊', ...d('upperBr') },
{ label: '上工作辊', ...d('upperWr') },
{ label: '下工作辊', ...d('lowerWr') },
{ label: '下支撑辊', ...d('lowerBr') }
]
}
},
created() {},
mounted() {
this.$nextTick(this.syncAsideHeight)
window.addEventListener('resize', this.syncAsideHeight)
},
beforeDestroy() {
window.removeEventListener('resize', this.syncAsideHeight)
},
methods: {
onLineResolved() {
this.loadCurrent()
this.loadStandby()
this.loadHistory()
this.loadOfflineRolls()
this.loadRollPerformance()
this.loadRollOptions()
this.loadRollInfoMap()
},
loadCurrent() {
this.loadingCurrent = true
getCurrentRolls(this.lineId, STAND_NO).then(res => {
this.current = res.data || {}
this.$nextTick(this.syncAsideHeight)
}).finally(() => { this.loadingCurrent = false })
},
loadStandby() {
this.loadingStandby = true
listRollStandby(this.lineId, STAND_NO).then(res => {
this.standbyList = res.data || []
}).finally(() => { this.loadingStandby = false })
},
loadHistory() {
this.historyLoading = true
listRollChange({ ...this.historyQuery, lineId: this.lineId }).then(res => {
this.historyList = res.rows || []
this.historyTotal = res.total || 0
}).finally(() => { this.historyLoading = false })
},
loadRollOptions() {
listRollOptions(this.lineId, 'WR', 'Offline').then(res => { this.wrOptions = res.data || [] })
listRollOptions(this.lineId, 'BR', 'Offline').then(res => { this.brOptions = res.data || [] })
},
loadRollInfoMap() {
listRollInfo({ lineId: this.lineId, pageNum: 1, pageSize: 500 }).then(res => {
const map = {}
;(res.rows || []).forEach(r => { map[r.rollNo] = r })
this.rollInfoMap = map
})
},
loadRollPerformance() {
this.perfLoading = true
getRollPerformance(this.lineId).then(res => {
this.perfData = res.data || {}
}).finally(() => { this.perfLoading = false })
},
loadOfflineRolls() {
this.offlineLoading = true
listRollInfo({ lineId: this.lineId, status: 'Offline', pageNum: 1, pageSize: 30 }).then(res => {
this.offlineRolls = res.rows || []
}).finally(() => { this.offlineLoading = false })
},
rowClass({ row }) {
if (row.group === 'br') return 'row-br'
return ''
},
mergeParamCol({ columnIndex }) {
if (columnIndex === 0) return [1, 1]
},
handleOpenChange() {
const ri = this.rollInfoMap
const pick = (rollType, pos) => {
const item = this.standbyList.find(i => i.rollType === rollType && i.position === pos)
if (!item) return { no: undefined, dia: undefined }
const info = ri[item.rollNo]
const dia = item.diameter != null ? item.diameter
: (info ? (info.currentDia != null ? info.currentDia : info.initialDia) : undefined)
return { no: item.rollNo, dia }
}
const uwr = pick('WR', 'UP'), lwr = pick('WR', 'DOWN')
const ubr = pick('BR', 'UP'), lbr = pick('BR', 'DOWN')
this.changeForm = {
standNo: STAND_NO,
lineId: this.lineId,
changeType: undefined,
upperWrNo: uwr.no, upperWrDia: uwr.dia,
lowerWrNo: lwr.no, lowerWrDia: lwr.dia,
upperBrNo: ubr.no, upperBrDia: ubr.dia,
lowerBrNo: lbr.no, lowerBrDia: lbr.dia
}
this.changeOpen = true
},
submitChange() {
if (this.changeSubmitting) return
this.changeSubmitting = true
addRollChange(this.changeForm).then(() => {
this.$modal.msgSuccess('换辊成功')
this.changeOpen = false
clearRollStandby(this.lineId, STAND_NO).finally(() => {
this.loadCurrent()
this.loadStandby()
this.loadHistory()
this.loadOfflineRolls()
this.loadRollPerformance()
})
}).finally(() => { this.changeSubmitting = false })
},
resetChangeForm() {
this.changeForm = {}
this.changeSubmitting = false
},
handleSbCellClick(cell, rollType, position) {
if (cell && cell.standbyId) {
this.handleDelStandby(cell.standbyId)
} else if (rollType) {
this.standbyForm = { standNo: STAND_NO, rollType, position, rollNo: undefined }
this.standbyFromCell = true
this.standbyOpen = true
}
},
handleAddStandby() {
this.standbyForm = { standNo: STAND_NO, rollType: undefined, position: undefined, rollNo: undefined }
this.standbyFromCell = false
this.standbyOpen = true
},
handleStandbyRollTypeChange() {
this.$set(this.standbyForm, 'rollNo', undefined)
},
submitStandby() {
this.$refs.standbyForm.validate(valid => {
if (!valid) return
addRollStandby({ ...this.standbyForm, lineId: this.lineId }).then(() => {
this.$modal.msgSuccess('已添加到下批轧辊')
this.standbyOpen = false
this.loadStandby()
this.loadRollOptions()
this.loadOfflineRolls()
})
})
},
resetStandbyForm() {
this.standbyForm = {}
this.standbyFromCell = false
this.$nextTick(() => { this.$refs.standbyForm && this.$refs.standbyForm.clearValidate() })
},
handleDelStandby(standbyId) {
this.$modal.confirm('确认移除该下批轧辊?移除后该辊状态将恢复为"离线"。').then(() => {
return delRollStandby(standbyId)
}).then(() => {
this.$modal.msgSuccess('已移除')
this.loadStandby()
this.loadRollOptions()
this.loadOfflineRolls()
})
},
handleClearStandby() {
this.$modal.confirm('确认清空全部下批轧辊?').then(() => {
return clearRollStandby(this.lineId, STAND_NO)
}).then(() => {
this.$modal.msgSuccess('已清空')
this.loadStandby()
})
},
handleEditHistory(row) {
this.historyEditForm = { ...row }
this.historyEditOpen = true
},
submitHistoryEdit() {
updateRollChange(this.historyEditForm).then(() => {
this.$modal.msgSuccess('保存成功')
this.historyEditOpen = false
this.loadHistory()
})
},
handleDeleteHistory(row) {
this.$modal.confirm('确认删除该换辊记录?此操作不可恢复。').then(() => {
return delRollChange(row.changeId)
}).then(() => {
this.$modal.msgSuccess('已删除')
this.loadHistory()
})
},
syncAsideHeight() {
const el = this.$refs.mainTable && this.$refs.mainTable.$el
if (!el) return
const totalH = el.offsetHeight
const gap = 12
const headerH = 48
const half = Math.max(100, Math.floor((totalH - gap) / 2) - headerH)
this.asideHalfH = half
}
}
}
</script>
<style scoped>
.working-roll-page { background: #f4f5f7; }
.roll-table-card { border: 1px solid #dcdee0; border-radius: 4px; }
.top-row { display: flex; gap: 12px; align-items: stretch; }
.top-row__main { flex: 2; min-width: 0; }
.top-row__aside { flex: 1; min-width: 0; }
.aside-col { display: flex; flex-direction: column; gap: 12px; }
.aside-panel { flex: 1; min-width: 0; }
.roll-group-cell { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1.5; }
.rg-item { font-size: 12px; color: #3d4b5c; }
.rg-item b { color: #5f6368; font-weight: 600; margin-right: 2px; }
.rg-item em { font-style: normal; color: #9aa0a6; font-size: 11px; }
.card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 13px; font-weight: 600; color: #3d4b5c; white-space: nowrap; }
.header-meta { font-size: 11px; color: #8f9099; white-space: nowrap; }
.param-label { font-size: 12px; color: #3d4b5c; }
.cell-main { font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; font-weight: 600; color: #1f2329; }
.cell-empty { color: #c0c4cc; font-size: 12px; }
.perf-roll { font-family: 'Consolas', monospace; font-size: 12px; font-weight: 600; color: #1f2329; }
.roll-preview { background: #f7f8fa; border: 1px solid #e4e6eb; border-radius: 4px; padding: 10px 12px; }
.roll-preview__title { font-size: 11px; color: #8f9099; margin-bottom: 8px; letter-spacing: .5px; }
.roll-preview__item { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.rp-label { font-size: 12px; color: #8f9099; width: 56px; flex-shrink: 0; }
.rp-val { font-size: 13px; font-weight: 600; color: #1f2329; font-family: 'Consolas', monospace; flex: 1; }
.rp-dia { font-size: 11px; color: #9aa0a6; }
.roll-preview__tip { font-size: 11px; color: #b0b3bb; margin-top: 10px; text-align: center; }
.sb-cell { display: block; min-height: 24px; border-radius: 2px; cursor: default; }
.sb-cell--add { cursor: pointer; background: #f0f9f4; }
.sb-cell--add:hover { background: #d4edda; }
.sb-cell--del { cursor: pointer; background: #fff7f7; }
.sb-cell--del:hover { background: #ffe4e4; }
::v-deep .row-br td { background: #fafafa !important; }
</style>
<style>
.el-table .editing-row { background: #fffbf0 !important; }
</style>