diff --git a/apps/l2/src/views/l2/plan/components/setupForm.vue b/apps/l2/src/views/l2/plan/components/setupForm.vue index 69ff984..f659612 100644 --- a/apps/l2/src/views/l2/plan/components/setupForm.vue +++ b/apps/l2/src/views/l2/plan/components/setupForm.vue @@ -356,6 +356,11 @@ export default { this.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) } } diff --git a/apps/l2/src/views/l2/plan/index.vue b/apps/l2/src/views/l2/plan/index.vue index dc6e7d4..a9ee546 100644 --- a/apps/l2/src/views/l2/plan/index.vue +++ b/apps/l2/src/views/l2/plan/index.vue @@ -200,7 +200,7 @@ {{ currentRow.planid }} {{ currentRow.coilid }} {{ currentRow.steelGrade }} - {{ currentRow.yieldPoint }} + {{ currentRow.yieldPoint }} {{ currentRow.entryWeight }} {{ currentRow.entryThick }} {{ currentRow.entryWidth }} @@ -264,8 +264,8 @@ - - + + @@ -1054,14 +1054,19 @@ export default { }, generateSpmParams() { - console.log(this.form) - console.log(this.form.steelGrade) - addSetup({ + // 注意:工艺参数入库需要 steelGrade/thick/yieldStren 等基础字段。 + // 这里 thick/yieldStren 后端字段名对应 pdi_setup.thick / pdi_setup.yield_stren + // 前端基础信息里分别是 entryThick / yieldPoint + let data = { coilid: this.form.coilid, planid: this.form.planid, steelGrade: this.form.steelGrade, + thick: this.form.entryThick, + yieldStren: this.form.yieldPoint, ...this.setupForm - }).then(res => { + } + console.log(data) + addSetup(data).then(res => { this.$message.success("工艺参数创建成功"); }) } diff --git a/apps/l2/src/views/l2/send/drive.vue b/apps/l2/src/views/l2/send/drive.vue index 7146eca..e925341 100644 --- a/apps/l2/src/views/l2/send/drive.vue +++ b/apps/l2/src/views/l2/send/drive.vue @@ -66,7 +66,7 @@
- 入口厚度: {{ setup.entryThick || '-' }} - 入口宽度: {{ setup.entryWidth || '-' }} -
- -
- 入口重量: {{ setup.entryWeight || '-' }} - 入口长度: {{ setup.entryLength || '-' }} -
- -
- 拉伸机延伸率: {{ setup.tlElong || '-' }} - 轧机轧制力: {{ setup.tmRollforce || '-' }} -
- -
- 轧机弯辊力: {{ setup.tmBendforce || '-' }} + 钢种: {{ setup.steelGrade || '-' }} + 厚度: {{ setup.thick || '-' }} + 屈服强度: {{ setup.yieldStren || '-' }} 更新时间: {{ formatTime(setup.updateTime) }}
@@ -166,56 +153,47 @@ import { listPlan } from '@/api/l2/plan' // 传动字段定义(中文界面,贴合工业场景) const DRIVE_FIELDS = [ + // 全线张力(与 pdi_setup / PdiSetups 字段对齐) { key: 'porTension', label: '开卷机张力' }, { key: 'celTension', label: '入口活套张力' }, { key: 'cleanTension', label: '清洗段张力' }, - { key: 'furTension', label: '炉区张力' }, - { key: 'towerTension', label: '冷却塔张力' }, - { key: 'tmNoneTension', label: '轧机无张力' }, - { key: 'tmEntryTension', label: '轧机入口张力' }, - { key: 'tmExitTension', label: '轧机出口张力' }, - { key: 'tlNoneTension', label: '拉伸机无张力' }, - { key: 'tlExitTension', label: '拉伸机出口张力' }, - { key: 'coatTension', label: '后处理段张力' }, + { key: 'passivationTension', label: '钝化段张力' }, { key: 'cxlTension', label: '出口活套张力' }, { key: 'trTension', label: '卷取机张力' }, - { key: 'tlElong', label: '拉伸机延伸率' }, - { key: 'tlLvlMesh1', label: '拉伸机矫直辊间隙1' }, - { key: 'tlLvlMesh2', label: '拉伸机矫直辊间隙2' }, - { key: 'tlAcbMesh', label: '拉伸机防侧弯间隙' }, + // 平整机 + { key: 'levelerEntryTension', label: '平整机入口张力' }, + { key: 'levelerExitTension', label: '平整机出口张力' }, - { key: 'tmBendforce', label: '轧机弯辊力' }, - { key: 'tmAcrMesh', label: '轧机防皱辊间隙' }, - { key: 'tmBrMesh', label: '轧机防颤辊间隙' }, - { key: 'tmRollforce', label: '轧机轧制力' } + // 矫直机 + { key: 'straightenerExitTension', label: '矫直机出口张力' }, + + // 退火炉 + { key: 'furTension', label: '炉区张力' }, + { key: 'towerTension', label: '冷却塔张力' } ] // OPC地址映射(保持原有配置,不影响功能) const DRIVE_ADDRESS = { + // 全线张力 porTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionPorBR1', celTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR3', cleanTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR1BR2', - furTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur1', - towerTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur2', - 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', + // 原系统里 passivation 对应“BR7-BR8”段(原 coatTension 地址),这里沿用该地址 + passivationTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR7BR8', cxlTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR8BR9', trTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR9TR', - tlElong: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.TLElongation', - tlLvlMesh1: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.LevelingMesh1', - tlLvlMesh2: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.LevelingMesh2', - tlAcbMesh: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.AntiCrossBowUnitMesh', + // 平整机(原 tm* 地址沿用) + levelerEntryTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionBR5TM', + levelerExitTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionTMBR6', - tmBendforce: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.TMBendforce', - tmAcrMesh: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.ACRMesh', - tmBrMesh: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.BRMesh', - tmRollforce: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.TMRollforce' + // 矫直机(原 tl* 地址沿用) + straightenerExitTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionTLBR7', + + // 退火炉 + furTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur1', + towerTension: 'ns=2;s=ProcessCGL.PLCLine.L2Setup.tensionFur2' } export default { @@ -295,13 +273,14 @@ export default { this.setups = setupList.map(s => { const params = {} this.driveFields.forEach(f => { + // s 是后端 listSetup 返回的 PdiSetups(字段名与 driveFields.key 对齐) const fromSetup = s ? s[f.key] : undefined const fromLast = this.lastSuccess?.values?.[f.key] // 优先级:当前配置值 > 上次成功值 > 空字符串 if (fromSetup !== undefined && fromSetup !== null && 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) } else { params[f.key] = ''