更正前端内容

This commit is contained in:
2026-01-07 21:05:48 +08:00
parent f65a4439ae
commit 8c58a93e67
3 changed files with 46 additions and 57 deletions

View File

@@ -356,6 +356,11 @@ export default {
this.syncModal() this.syncModal()
}, },
syncModal() { syncModal() {
// 注意:父组件保存工艺参数时需要基础字段(钢种/厚度/屈服强度)
// 这里将 income 中的基础字段合并进 form再回传给父组件
this.$set(this.form, 'steelGrade', this.income && this.income.steelGrade)
this.$set(this.form, 'thick', this.income && this.income.entryThick)
this.$set(this.form, 'yieldStren', this.income && this.income.yieldPoint)
this.$emit('input', this.form) this.$emit('input', this.form)
} }
} }

View File

@@ -200,7 +200,7 @@
<el-descriptions-item label="计划号">{{ currentRow.planid }}</el-descriptions-item> <el-descriptions-item label="计划号">{{ currentRow.planid }}</el-descriptions-item>
<el-descriptions-item label="钢卷号">{{ currentRow.coilid }}</el-descriptions-item> <el-descriptions-item label="钢卷号">{{ currentRow.coilid }}</el-descriptions-item>
<el-descriptions-item label="钢种">{{ currentRow.steelGrade }}</el-descriptions-item> <el-descriptions-item label="钢种">{{ currentRow.steelGrade }}</el-descriptions-item>
<el-descriptions-item label="屈服">{{ currentRow.yieldPoint }}</el-descriptions-item> <el-descriptions-item label="屈服强度">{{ currentRow.yieldPoint }}</el-descriptions-item>
<el-descriptions-item label="重量(t)">{{ currentRow.entryWeight }}</el-descriptions-item> <el-descriptions-item label="重量(t)">{{ currentRow.entryWeight }}</el-descriptions-item>
<el-descriptions-item label="厚度(mm)">{{ currentRow.entryThick }}</el-descriptions-item> <el-descriptions-item label="厚度(mm)">{{ currentRow.entryThick }}</el-descriptions-item>
<el-descriptions-item label="宽度(mm)">{{ currentRow.entryWidth }}</el-descriptions-item> <el-descriptions-item label="宽度(mm)">{{ currentRow.entryWidth }}</el-descriptions-item>
@@ -264,8 +264,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="屈服" prop="yieldPoint"> <el-form-item label="屈服强度" prop="yieldPoint">
<el-input v-model="form.yieldPoint" placeholder="请输入屈服" type="number" step="0.01" min="0"></el-input> <el-input v-model="form.yieldPoint" placeholder="请输入屈服强度" type="number" step="0.01" min="0"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -1054,14 +1054,19 @@ export default {
}, },
generateSpmParams() { generateSpmParams() {
console.log(this.form) // 注意:工艺参数入库需要 steelGrade/thick/yieldStren 等基础字段。
console.log(this.form.steelGrade) // 这里 thick/yieldStren 后端字段名对应 pdi_setup.thick / pdi_setup.yield_stren
addSetup({ // 前端基础信息里分别是 entryThick / yieldPoint
let data = {
coilid: this.form.coilid, coilid: this.form.coilid,
planid: this.form.planid, planid: this.form.planid,
steelGrade: this.form.steelGrade, steelGrade: this.form.steelGrade,
thick: this.form.entryThick,
yieldStren: this.form.yieldPoint,
...this.setupForm ...this.setupForm
}).then(res => { }
console.log(data)
addSetup(data).then(res => {
this.$message.success("工艺参数创建成功"); this.$message.success("工艺参数创建成功");
}) })
} }

View File

@@ -66,7 +66,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col <el-col
v-for="setup in setups" v-for="setup in setups"
:key="setup.ID" :key="setup.id || setup.ID || setup.planid || setup.coilid"
:xs="24" :xs="24"
:sm="12" :sm="12"
:md="8" :md="8"
@@ -85,22 +85,9 @@
</div> </div>
<div class="card-subtitle"> <div class="card-subtitle">
<span>入口厚度: {{ setup.entryThick || '-' }}</span> <span>钢种: {{ setup.steelGrade || '-' }}</span>
<span>入口宽: {{ setup.entryWidth || '-' }}</span> <span>: {{ setup.thick || '-' }}</span>
</div> <span>屈服强度: {{ setup.yieldStren || '-' }}</span>
<div class="card-subtitle">
<span>入口重量: {{ setup.entryWeight || '-' }}</span>
<span>入口长度: {{ setup.entryLength || '-' }}</span>
</div>
<div class="card-subtitle">
<span>拉伸机延伸率: {{ setup.tlElong || '-' }}</span>
<span>轧机轧制力: {{ setup.tmRollforce || '-' }}</span>
</div>
<div class="card-subtitle">
<span>轧机弯辊力: {{ setup.tmBendforce || '-' }}</span>
<span v-if="setup.updateTime">更新时间: {{ formatTime(setup.updateTime) }}</span> <span v-if="setup.updateTime">更新时间: {{ formatTime(setup.updateTime) }}</span>
</div> </div>
</div> </div>
@@ -166,56 +153,47 @@ import { listPlan } from '@/api/l2/plan'
// 传动字段定义(中文界面,贴合工业场景) // 传动字段定义(中文界面,贴合工业场景)
const DRIVE_FIELDS = [ const DRIVE_FIELDS = [
// 全线张力(与 pdi_setup / PdiSetups 字段对齐)
{ key: 'porTension', label: '开卷机张力' }, { key: 'porTension', label: '开卷机张力' },
{ key: 'celTension', label: '入口活套张力' }, { key: 'celTension', label: '入口活套张力' },
{ key: 'cleanTension', label: '清洗段张力' }, { key: 'cleanTension', label: '清洗段张力' },
{ key: 'furTension', label: '炉区张力' }, { key: 'passivationTension', label: '钝化段张力' },
{ key: 'towerTension', label: '冷却塔张力' },
{ key: 'tmNoneTension', label: '轧机无张力' },
{ key: 'tmEntryTension', label: '轧机入口张力' },
{ key: 'tmExitTension', label: '轧机出口张力' },
{ key: 'tlNoneTension', label: '拉伸机无张力' },
{ key: 'tlExitTension', label: '拉伸机出口张力' },
{ key: 'coatTension', label: '后处理段张力' },
{ key: 'cxlTension', label: '出口活套张力' }, { key: 'cxlTension', label: '出口活套张力' },
{ key: 'trTension', label: '卷取机张力' }, { key: 'trTension', label: '卷取机张力' },
{ key: 'tlElong', label: '拉伸机延伸率' }, // 平整机
{ key: 'tlLvlMesh1', label: '拉伸机矫直辊间隙1' }, { key: 'levelerEntryTension', label: '平整机入口张力' },
{ key: 'tlLvlMesh2', label: '拉伸机矫直辊间隙2' }, { key: 'levelerExitTension', label: '平整机出口张力' },
{ key: 'tlAcbMesh', label: '拉伸机防侧弯间隙' },
{ key: 'tmBendforce', label: '轧机弯辊力' }, // 矫直机
{ key: 'tmAcrMesh', label: '轧机防皱辊间隙' }, { key: 'straightenerExitTension', label: '矫直机出口张力' },
{ key: 'tmBrMesh', label: '轧机防颤辊间隙' },
{ key: 'tmRollforce', label: '轧机轧制力' } // 退火炉
{ key: 'furTension', label: '炉区张力' },
{ key: 'towerTension', label: '冷却塔张力' }
] ]
// OPC地址映射保持原有配置不影响功能 // OPC地址映射保持原有配置不影响功能
const DRIVE_ADDRESS = { const DRIVE_ADDRESS = {
// 全线张力
porTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionPorBR1', porTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionPorBR1',
celTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR3', celTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR3',
cleanTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR1BR2', cleanTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR1BR2',
furTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur1', // 原系统里 passivation 对应“BR7-BR8”段原 coatTension 地址),这里沿用该地址
towerTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur2', passivationTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR7BR8',
tmNoneTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR5BR6',
tmEntryTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR5TM',
tmExitTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionTMBR6',
tlNoneTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR6BR7',
tlExitTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionTLBR7',
coatTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR7BR8',
cxlTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR8BR9', cxlTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR8BR9',
trTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR9TR', trTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR9TR',
tlElong: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.TLElongation', // 平整机(原 tm* 地址沿用)
tlLvlMesh1: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.LevelingMesh1', levelerEntryTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR5TM',
tlLvlMesh2: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.LevelingMesh2', levelerExitTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionTMBR6',
tlAcbMesh: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.AntiCrossBowUnitMesh',
tmBendforce: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.TMBendforce', // 矫直机(原 tl* 地址沿用)
tmAcrMesh: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.ACRMesh', straightenerExitTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionTLBR7',
tmBrMesh: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.BRMesh',
tmRollforce: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.TMRollforce' // 退火炉
furTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur1',
towerTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur2'
} }
export default { export default {
@@ -295,13 +273,14 @@ export default {
this.setups = setupList.map(s => { this.setups = setupList.map(s => {
const params = {} const params = {}
this.driveFields.forEach(f => { this.driveFields.forEach(f => {
// s 是后端 listSetup 返回的 PdiSetups字段名与 driveFields.key 对齐)
const fromSetup = s ? s[f.key] : undefined const fromSetup = s ? s[f.key] : undefined
const fromLast = this.lastSuccess?.values?.[f.key] const fromLast = this.lastSuccess?.values?.[f.key]
// 优先级:当前配置值 > 上次成功值 > 空字符串 // 优先级:当前配置值 > 上次成功值 > 空字符串
if (fromSetup !== undefined && fromSetup !== null && String(fromSetup) !== '') { if (fromSetup !== undefined && fromSetup !== null && String(fromSetup) !== '') {
params[f.key] = String(fromSetup) params[f.key] = String(fromSetup)
} else if (fromLast !== undefined && fromLast !== null) { } else if (fromLast !== undefined && fromLast !== null && String(fromLast) !== '') {
params[f.key] = String(fromLast) params[f.key] = String(fromLast)
} else { } else {
params[f.key] = '' params[f.key] = ''