修改二级ui

This commit is contained in:
2025-11-25 15:41:34 +08:00
parent 1330f98ac1
commit 06cb85d7b4
9 changed files with 1492 additions and 198 deletions

View File

@@ -29,13 +29,12 @@ export function getChangeIdList() {
* @param {object} params.endTime 结束时间
* @param {string} params.changeId 换辊号
* @param {string} params.rollid 轧辊号
* @param {number} params.pageNum
* @param {number} params.pageSize
* @param {number} params.pageNum
* @param {number} params.pageSize
* @returns
*/
export function getRollHistorytList(params) {
console.log('API调用参数:', params)
return l2Request({
method: 'post',
data: params,
@@ -46,7 +45,7 @@ export function getRollHistorytList(params) {
})
}
/**
/**
* 轧辊操作-备辊
* @param {object} params ReadyRollDataVO
* @param {string} params.rollid 轧辊号
@@ -65,7 +64,7 @@ export function backupRoll(data) {
})
}
/**
/**
* 轧辊操作-上线
* @param {object} data 上线数据
* @returns
@@ -78,7 +77,7 @@ export function onlineRoll(data) {
})
}
/**
/**
* 轧辊数据-获取在线辊信息
* @returns
*/
@@ -89,7 +88,7 @@ export function getOnlineRollList() {
})
}
/**
/**
* 轧辊数据-获取备用辊信息
* @param {string} position 位置,可用值:TOP,BOTTOM
* @param {string} type 类型,可用值:WORK,INTERMEDIATE,BACKUP
@@ -102,7 +101,7 @@ export function getOfflineRollList(position, type) {
})
}
/**
/**
* 轧辊数据-获取当前备辊信息
* @returns
*/
@@ -111,4 +110,4 @@ export function getReadyRollList() {
method: 'get',
url: '/api/roller/data/standby'
})
}
}

View File

@@ -0,0 +1,704 @@
<template>
<div class="plan-recommend-panel">
<div class="recommend-section steel-panel">
<div class="section-header">
<div>
<div class="section-title">钢种推荐</div>
<div class="section-subtitle">锁定钢种后自动调取面板库中的典型工艺主数据</div>
</div>
<el-tag v-if="steelGradeName" size="mini" effect="dark">{{ steelGradeName }}</el-tag>
</div>
<div class="section-body" v-loading="loadingSteel">
<template v-if="steelRecommendations.length">
<div class="card-list two-cols">
<div
class="recommend-card"
v-for="item in steelRecommendations"
:key="item._id"
@click="emitSteelGrade(item)"
>
<div class="card-header">
<div class="card-title">
{{ item.steelGradeLabel || '钢种' }}
</div>
<el-tag size="mini" type="info">
厚度 {{ formatNumber(item.entryThick) }} mm
</el-tag>
</div>
<div class="card-meta">
<div>
<span class="label">屈服点</span>
<span class="value">{{ formatNumber(item.yieldPoint) }}</span>
</div>
<div>
<span class="label">延伸率</span>
<span class="value">{{ formatNumber(item.spmElongation) }}</span>
</div>
</div>
<div class="card-meta">
<div>
<span class="label">轧制力</span>
<span class="value">{{ formatNumber(item.spmRollforce) }}</span>
</div>
<div>
<span class="label">更新时间</span>
<span class="value">{{ formatDate(item.updateTime) }}</span>
</div>
</div>
<div class="card-footer">
<span>点击写入钢种及主键</span>
<i class="el-icon-top-right" />
</div>
</div>
</div>
</template>
<el-empty
v-else
description="选择钢种后即可联动查询"
:image-size="100"
/>
</div>
</div>
<div class="recommend-section thickness-panel">
<div class="section-header">
<div>
<div class="section-title">厚度 / 屈服点联动</div>
<div class="section-subtitle">输入厚度后自动搜集多面板库对应的屈服点档案</div>
</div>
<el-tag v-if="entryThick" size="mini" effect="plain">{{ formatNumber(entryThick) }} mm</el-tag>
</div>
<div class="section-body" v-loading="loadingThickness">
<template v-if="thicknessRecommendations.length">
<div class="card-list">
<div
class="recommend-card"
v-for="item in thicknessRecommendations"
:key="item._id"
@click="emitThickness(item)"
>
<div class="card-header">
<div class="card-title">
{{ formatNumber(item.entryThick) }} mm
</div>
<el-tag size="mini" type="success">
屈服点 {{ formatNumber(item.yieldPoint) }}
</el-tag>
</div>
<div class="card-meta">
<div>
<span class="label">钢种</span>
<span class="value">{{ item.steelGradeLabel || '-' }}</span>
</div>
<div>
<span class="label">数据来源</span>
<span class="value">{{ item.sourceLabel }}</span>
</div>
</div>
<div class="card-footer">
<span>{{ item.updateTime ? '最近更新 ' + formatDate(item.updateTime) : '点击写入厚度/屈服点' }}</span>
<i class="el-icon-top-right" />
</div>
</div>
</div>
</template>
<el-empty
v-else
description="填写厚度后可获取推荐屈服点"
:image-size="100"
/>
</div>
</div>
<div class="recommend-section width-panel">
<div class="section-header">
<div>
<div class="section-title">宽度 / 弯辊联动</div>
<div class="section-subtitle">根据宽度 & 轧制力匹配弯辊力与宽度组合</div>
</div>
<el-tag v-if="entryWidth" size="mini" type="info">{{ formatNumber(entryWidth) }} mm</el-tag>
</div>
<div class="section-body" v-loading="loadingWidth">
<template v-if="widthRecommendations.length">
<div class="card-list">
<div
class="recommend-card"
v-for="item in widthRecommendations"
:key="item._id"
@click="emitWidth(item)"
>
<div class="card-header">
<div class="card-title">{{ formatNumber(item.width) }} mm</div>
<el-tag size="mini" effect="plain">轧制力 {{ formatNumber(item.rollForce) }}</el-tag>
</div>
<div class="card-meta">
<div>
<span class="label">弯辊力</span>
<span class="value">{{ formatNumber(item.bendForce) }}</span>
</div>
<div>
<span class="label">数据来源</span>
<span class="value">{{ item.sourceLabel }}</span>
</div>
</div>
<div class="card-footer">
<span>点击写入宽度 / 轧制力</span>
<i class="el-icon-top-right" />
</div>
</div>
</div>
</template>
<el-empty
v-else
description="填写宽度后可获取推荐"
:image-size="100"
/>
</div>
</div>
<div class="recommend-section rollforce-panel">
<div class="section-header">
<div>
<div class="section-title">轧制力反查</div>
<div class="section-subtitle">输入轧制力后反查对应厚度 / 屈服点组合</div>
</div>
<el-tag v-if="spmRollforce" size="mini" type="warning">{{ formatNumber(spmRollforce) }}</el-tag>
</div>
<div class="section-body" v-loading="loadingRollforce">
<template v-if="rollforceFocusRecommendations.length">
<div class="card-list">
<div
class="recommend-card"
v-for="item in rollforceFocusRecommendations"
:key="item._id"
@click="emitRollforce(item)"
>
<div class="card-header">
<div class="card-title">{{ formatNumber(item.spmRollforce) }}</div>
<el-tag size="mini" type="success">{{ item.sourceLabel }}</el-tag>
</div>
<div class="card-meta">
<div>
<span class="label">厚度</span>
<span class="value">{{ formatNumber(item.entryThick) }} mm</span>
</div>
<div>
<span class="label">屈服点</span>
<span class="value">{{ formatNumber(item.yieldPoint) }}</span>
</div>
</div>
<div class="card-meta">
<div>
<span class="label">延伸率</span>
<span class="value">{{ formatNumber(item.spmElongation) }}</span>
</div>
<div>
<span class="label">钢种</span>
<span class="value">{{ item.steelGradeLabel || '-' }}</span>
</div>
</div>
<div class="card-footer">
<span>点击写入相关字段</span>
<i class="el-icon-top-right" />
</div>
</div>
</div>
</template>
<el-empty
v-else
description="填写轧制力后可获取推荐"
:image-size="100"
/>
</div>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { listRollforce } from '@/api/business/rollforce'
import { listTension } from '@/api/business/tension'
import { listBendforce } from '@/api/business/bendforce'
let uid = 0
const createId = () => ++uid
export default {
name: 'PlanRecommendPanel',
props: {
steelGrade: {
type: [String, Number],
default: null
},
entryThick: {
type: [String, Number],
default: null
},
entryWidth: {
type: [String, Number],
default: null
},
spmRollforce: {
type: [String, Number],
default: null
},
steelGradeList: {
type: Array,
default: () => []
}
},
data() {
return {
steelRecommendations: [],
thicknessRecommendations: [],
widthRecommendations: [],
rollforceFocusRecommendations: [],
loadingSteel: false,
loadingThickness: false,
loadingWidth: false,
loadingRollforce: false,
steelFetchToken: 0,
thicknessFetchToken: 0,
widthFetchToken: 0,
rollforceFetchToken: 0,
steelDebounceTimer: null,
thicknessDebounceTimer: null,
widthDebounceTimer: null,
rollforceDebounceTimer: null
}
},
computed: {
steelGradeName() {
return this.getSteelGradeLabel(this.steelGrade)
}
},
watch: {
steelGrade: {
immediate: true,
handler(val) {
if (val === undefined || val === null || val === '') {
this.steelRecommendations = []
return
}
clearTimeout(this.steelDebounceTimer)
this.steelDebounceTimer = setTimeout(() => {
this.fetchSteelRecommendations()
}, 200)
}
},
entryThick: {
immediate: true,
handler(val) {
if (val === undefined || val === null || val === '') {
this.thicknessRecommendations = []
return
}
clearTimeout(this.thicknessDebounceTimer)
this.thicknessDebounceTimer = setTimeout(() => {
this.fetchThicknessRecommendations()
}, 200)
}
},
entryWidth: {
immediate: true,
handler(val) {
if (val === undefined || val === null || val === '') {
this.widthRecommendations = []
return
}
clearTimeout(this.widthDebounceTimer)
this.widthDebounceTimer = setTimeout(() => {
this.fetchWidthRecommendations()
}, 200)
}
},
spmRollforce: {
immediate: true,
handler(val) {
if (val === undefined || val === null || val === '') {
this.rollforceFocusRecommendations = []
return
}
clearTimeout(this.rollforceDebounceTimer)
this.rollforceDebounceTimer = setTimeout(() => {
this.fetchRollforceFocus()
}, 200)
}
}
},
beforeDestroy() {
clearTimeout(this.steelDebounceTimer)
clearTimeout(this.thicknessDebounceTimer)
clearTimeout(this.widthDebounceTimer)
clearTimeout(this.rollforceDebounceTimer)
},
methods: {
getSteelGradeLabel(gradeId) {
const match = this.steelGradeList.find(item => item.gradeid === gradeId)
return match ? match.name : (gradeId || '')
},
async fetchSteelRecommendations() {
const token = ++this.steelFetchToken
this.loadingSteel = true
try {
const response = await listRollforce({
pageNum: 1,
pageSize: 8,
steelGrade: this.steelGrade
})
if (token !== this.steelFetchToken) return
const rows = Array.isArray(response.rows) ? response.rows : []
this.steelRecommendations = rows.map(row => this.mapRollforceRow(row))
} catch (error) {
console.error('fetchSteelRecommendations error:', error)
this.$message?.error('钢种推荐获取失败,请稍后重试')
this.steelRecommendations = []
} finally {
if (token === this.steelFetchToken) {
this.loadingSteel = false
}
}
},
async fetchThicknessRecommendations() {
const rawValue = this.entryThick
if (rawValue === undefined || rawValue === null || rawValue === '') {
this.thicknessRecommendations = []
return
}
const token = ++this.thicknessFetchToken
this.loadingThickness = true
try {
const query = {
pageNum: 1,
pageSize: 8,
thick: rawValue
}
const [rollforceRes, tensionRes] = await Promise.allSettled([
listRollforce(query),
listTension(query)
])
if (token !== this.thicknessFetchToken) return
const records = []
if (rollforceRes.status === 'fulfilled') {
const rows = Array.isArray(rollforceRes.value.rows) ? rollforceRes.value.rows : []
records.push(...rows.map(row => this.mapRollforceRow(row, '光整机轧制力')))
}
if (tensionRes.status === 'fulfilled') {
const rows = Array.isArray(tensionRes.value.rows) ? tensionRes.value.rows : []
records.push(...rows.map(row => this.mapTensionRow(row)))
}
this.thicknessRecommendations = this.uniqueRecords(records).slice(0, 8)
} catch (error) {
console.error('fetchThicknessRecommendations error:', error)
this.$message?.error('厚度推荐获取失败,请稍后重试')
this.thicknessRecommendations = []
} finally {
if (token === this.thicknessFetchToken) {
this.loadingThickness = false
}
}
},
async fetchWidthRecommendations() {
const widthVal = Number(this.entryWidth)
if (Number.isNaN(widthVal)) {
this.widthRecommendations = []
return
}
const token = ++this.widthFetchToken
this.loadingWidth = true
try {
const response = await listBendforce({
pageNum: 1,
pageSize: 50,
width: widthVal
})
if (token !== this.widthFetchToken) return
const rows = Array.isArray(response.rows) ? response.rows : []
const tolerance = Math.max(2, widthVal * 0.01)
const matches = rows
.filter(row => {
const value = Number(row.width)
return !Number.isNaN(value) && Math.abs(value - widthVal) <= tolerance
})
.map(row => this.mapBendforceRow(row))
this.widthRecommendations = matches.slice(0, 6)
} catch (error) {
console.error('fetchWidthRecommendations error:', error)
this.$message?.error('宽度推荐获取失败,请稍后重试')
this.widthRecommendations = []
} finally {
if (token === this.widthFetchToken) {
this.loadingWidth = false
}
}
},
async fetchRollforceFocus() {
const rollforceVal = Number(this.spmRollforce)
if (Number.isNaN(rollforceVal)) {
this.rollforceFocusRecommendations = []
return
}
const token = ++this.rollforceFetchToken
this.loadingRollforce = true
try {
const response = await listRollforce({
pageNum: 1,
pageSize: 50,
value1: rollforceVal
})
if (token !== this.rollforceFetchToken) return
const rows = Array.isArray(response.rows) ? response.rows : []
const tolerance = Math.max(5, rollforceVal * 0.02)
const matches = rows
.filter(row => {
const value = Number(row.value1)
return !Number.isNaN(value) && Math.abs(value - rollforceVal) <= tolerance
})
.map(row => this.mapRollforceByValueRow(row))
this.rollforceFocusRecommendations = matches.slice(0, 6)
} catch (error) {
console.error('fetchRollforceFocus error:', error)
this.$message?.error('轧制力推荐获取失败,请稍后重试')
this.rollforceFocusRecommendations = []
} finally {
if (token === this.rollforceFetchToken) {
this.loadingRollforce = false
}
}
},
mapRollforceRow(row, sourceLabel = '光整机轧制力') {
return {
_id: `rollforce-${row.id || createId()}`,
sourceLabel,
steelGrade: row.steelGrade,
steelGradeLabel: this.getSteelGradeLabel(row.steelGrade),
entryThick: row.thick,
yieldPoint: row.yieldStren,
spmElongation: row.elong,
spmRollforce: row.value1,
updateTime: row.updateTime || row.createTime
}
},
mapRollforceByValueRow(row) {
return {
...this.mapRollforceRow(row, '轧制力面板'),
_id: `rollforce-focus-${row.id || createId()}`,
spmRollforce: row.value1
}
},
mapTensionRow(row) {
return {
_id: `tension-${row.id || createId()}`,
sourceLabel: '全线张力',
steelGrade: row.steelGrade,
steelGradeLabel: row.steelGrade ? this.getSteelGradeLabel(row.steelGrade) : '',
entryThick: row.thick,
yieldPoint: row.yieldStren,
spmElongation: row.elong,
spmRollforce: row.value1,
updateTime: row.updateTime || row.createTime
}
},
mapBendforceRow(row) {
return {
_id: `bendforce-${row.id || createId()}`,
sourceLabel: '弯辊力面板',
width: row.width,
rollForce: row.rollForce,
bendForce: row.value1,
updateTime: row.updateTime || row.createTime
}
},
uniqueRecords(records) {
const seen = new Set()
return records.filter(item => {
const key = [
item.steelGrade || '',
item.entryThick || '',
item.yieldPoint || '',
item.sourceLabel
].join('|')
if (seen.has(key)) return false
seen.add(key)
return true
})
},
emitSteelGrade(item) {
this.$emit('apply-steel-grade', {
steelGrade: item.steelGrade,
entryThick: item.entryThick,
yieldPoint: item.yieldPoint,
spmElongation: item.spmElongation,
spmRollforce: item.spmRollforce
})
},
emitThickness(item) {
this.$emit('apply-thickness', {
entryThick: item.entryThick,
yieldPoint: item.yieldPoint
})
},
emitWidth(item) {
this.$emit('apply-width', {
entryWidth: item.width,
spmRollforce: item.rollForce
})
},
emitRollforce(item) {
this.$emit('apply-rollforce', {
spmRollforce: item.spmRollforce,
entryThick: item.entryThick,
yieldPoint: item.yieldPoint,
spmElongation: item.spmElongation,
steelGrade: item.steelGrade
})
},
formatNumber(value) {
if (value === null || value === undefined || value === '') return '-'
const num = Number(value)
if (Number.isNaN(num)) return value
return Number.isInteger(num) ? num.toString() : num.toFixed(2)
},
formatDate(value) {
if (!value) return '-'
return parseTime(value, '{y}-{m}-{d}')
}
}
}
</script>
<style scoped>
.plan-recommend-panel {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 16px;
height: 100%;
padding-left: 16px;
border-left: 1px solid #e4e7ed;
min-height: 0;
}
.recommend-section {
background: #f9fafc;
border: 1px solid #e4e7ed;
border-radius: 6px;
padding: 12px;
flex: 1;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
}
.section-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 8px;
}
.section-title {
font-weight: 600;
color: #303133;
}
.section-subtitle {
font-size: 12px;
color: #909399;
}
.section-body {
flex: 1;
min-height: 0;
overflow-y: auto;
position: relative;
}
.card-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.card-list.two-cols {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.recommend-card {
border: 1px solid #dcdfe6;
border-radius: 6px;
padding: 10px;
background: #fff;
cursor: pointer;
transition: all 0.2s;
display: flex;
flex-direction: column;
gap: 6px;
}
.recommend-card:hover {
border-color: #409eff;
box-shadow: 0 6px 18px rgba(64, 158, 255, 0.15);
transform: translateY(-2px);
}
.card-header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: flex-start;
gap: 4px;
}
.card-title {
font-weight: 600;
color: #303133;
flex: 1 1 100%;
line-height: 1.4;
word-break: break-all;
}
.card-header .el-tag {
margin-top: 2px;
}
.card-meta {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
}
.card-meta .label {
color: #909399;
margin-right: 4px;
min-width: 54px;
}
.card-meta .value {
color: #303133;
font-weight: 600;
word-break: break-all;
}
.card-footer {
font-size: 12px;
color: #606266;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 6px;
flex-wrap: wrap;
}
.steel-panel .card-list.two-cols {
grid-template-columns: 1fr;
}
.thickness-panel .card-list {
display: flex;
flex-direction: column;
}
</style>

View File

@@ -0,0 +1,169 @@
<template>
<div class="process-recommend-panel">
<el-card shadow="never">
<div class="recommend-header">
<div>
<div class="title">推荐工艺参数</div>
<div class="subtitle">点击即可填入左侧表单一行展示更多字段</div>
</div>
<el-button type="text" icon="el-icon-finished" :disabled="!hasRecommendation" @click="$emit('apply-all')">
全部套用
</el-button>
</div>
<div v-if="!hasRecommendation" class="empty-state">
<el-empty description="暂无推荐数据,先补齐基础信息" :image-size="90" />
</div>
<div v-else class="group-list">
<div class="group" v-for="group in parameterGroups" :key="group.title">
<div class="group-title">{{ group.title }}</div>
<div class="item-grid">
<div
class="recommend-item"
v-for="item in group.items"
:key="item.key"
:class="{ disabled: !hasValue(recommendation[item.key]) }"
@click="handleApply(item.key)"
>
<div class="label">{{ item.label }}</div>
<div class="value">{{ formatValue(recommendation[item.key]) }}</div>
<i class="el-icon-top-right" />
</div>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { PARAMETER_GROUPS } from './setupRecommendationConfig'
export default {
name: 'ProcessRecommendPanel',
props: {
recommendation: {
type: Object,
default: () => ({})
}
},
computed: {
parameterGroups() {
return PARAMETER_GROUPS
},
hasRecommendation() {
return Object.values(this.recommendation || {}).some(val => this.hasValue(val))
}
},
methods: {
hasValue(value) {
return !(value === null || value === undefined || value === '')
},
formatValue(value) {
if (!this.hasValue(value)) return '-'
const num = Number(value)
if (Number.isNaN(num)) return value
return Number.isInteger(num) ? num : num.toFixed(2)
},
handleApply(key) {
if (!this.hasValue(this.recommendation[key])) return
this.$emit('apply-one', key)
}
}
}
</script>
<style scoped>
.process-recommend-panel {
flex: 1;
min-height: 0;
}
.recommend-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 12px;
}
.recommend-header .title {
font-weight: 600;
font-size: 16px;
color: #303133;
}
.recommend-header .subtitle {
font-size: 12px;
color: #909399;
}
.empty-state {
padding: 40px 0;
}
.group-list {
display: flex;
flex-direction: column;
gap: 18px;
max-height: 640px;
overflow-y: auto;
padding-right: 6px;
}
.group-title {
font-weight: 600;
color: #606266;
margin-bottom: 10px;
}
.item-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 10px;
}
.recommend-item {
border: 1px solid #e4e7ed;
border-radius: 6px;
padding: 8px;
background: #f7f9fc;
cursor: pointer;
display: flex;
flex-direction: column;
gap: 4px;
min-height: 70px;
position: relative;
transition: all 0.2s;
}
.recommend-item.disabled {
opacity: 0.5;
cursor: not-allowed;
}
.recommend-item:not(.disabled):hover {
border-color: #409eff;
background: #ecf5ff;
box-shadow: 0 4px 14px rgba(64, 158, 255, 0.2);
}
.recommend-item .label {
font-size: 12px;
color: #909399;
}
.recommend-item .value {
font-size: 16px;
font-weight: 600;
color: #303133;
word-break: break-all;
}
.recommend-item i {
position: absolute;
right: 6px;
bottom: 4px;
font-size: 12px;
color: #c0c4cc;
}
</style>

View File

@@ -1,7 +1,30 @@
<template>
<div>
<el-form :model="form" label-width="160px" v-loading="loading">
<el-row>
<div class="setup-form-wrapper">
<div v-if="!canGenerate" class="setup-hint">
<el-alert
type="info"
:closable="false"
title="工艺参数生成提示"
>
<div class="hint-text">
请先补齐以下基础信息系统才可以自动匹配推荐的工艺参数
</div>
<div class="hint-tags">
<el-tag
v-for="label in missingFieldLabels"
:key="label"
size="mini"
effect="dark"
>
{{ label }}
</el-tag>
</div>
</el-alert>
</div>
<el-row v-else :gutter="16">
<el-col :span="14">
<el-form :model="form" label-width="150px" v-loading="loading">
<el-row>
<el-col :span="8">
<el-form-item label="开卷机张力">
<el-input v-model="form.porTension" @change="syncModal" />
@@ -111,8 +134,48 @@
<el-input v-model="form.coolingSection" @change="syncModal" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-row>
</el-form>
</el-col>
<el-col v-if="showRecommendationPanel" :span="10">
<el-card class="recommend-card" shadow="never">
<div class="recommend-header">
<div>
<div class="title">推荐工艺参数</div>
<div class="subtitle">点击即可填入左侧表单</div>
</div>
<el-button type="text" @click="applyAll" :disabled="!hasRecommendation">全部套用</el-button>
</div>
<div v-if="!hasRecommendation" class="empty-recommend">
<el-empty description="暂无推荐数据" :image-size="100"></el-empty>
</div>
<div v-else class="recommend-groups">
<div
v-for="group in parameterGroups"
:key="group.title"
class="recommend-group"
>
<div class="group-title">{{ group.title }}</div>
<div class="recommend-items">
<div
v-for="item in group.items"
:key="item.key"
class="recommend-item"
:class="{ disabled: !hasValue(recommendation[item.key]) }"
@click="applyRecommended(item.key)"
>
<div class="label">{{ item.label }}</div>
<div class="value">
{{ formatValue(recommendation[item.key]) }}
</div>
<i class="el-icon-top-right"></i>
</div>
</div>
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
@@ -123,135 +186,352 @@ import { getRollforce } from '@/api/business/rollforce' // 光整机轧制力
import { getTl } from '@/api/business/tl' // 拉矫机
import { getMesh } from '@/api/business/mesh' // 光整机插入量
import { getFur } from '@/api/business/fur' // 炉火段
import { PARAMETER_GROUPS } from './setupRecommendationConfig'
const REQUIRED_FIELDS = [
'entryThick',
'yieldPoint',
'steelGrade',
'spmElongation',
'spmRollforce',
'entryWidth'
]
const FIELD_LABEL_MAP = {
entryThick: '入口厚度',
yieldPoint: '屈服点',
steelGrade: '钢种',
spmElongation: '延伸率(%)',
spmRollforce: 'SPM轧制力',
entryWidth: '入口宽度'
}
const createDefaultForm = () => ({
// 全线张力
porTension: undefined, // 开卷机张力
celTension: undefined, // 入口活套张力
cleanTension: undefined, // 清洗段张力
furTension: undefined, // 炉区张力
towerTension: undefined, // 冷却塔张力
tmNoneTension: undefined, // 光整机不投张力
tmEntryTension: undefined, // 光整机入口张力
tmExitTension: undefined, // 光整机出口张力
tlNoneTension: undefined, // 拉矫机不投张力
tlExitTension: undefined, // 拉矫机出口张力
coatTension: undefined, // 后处理张力
cxlTension: undefined, // 出口活套张力
trTension: undefined, // 卷取机张力
// 光整机
tmRollforce: undefined, // 光整机轧制力
tmBendforce: undefined, // 光整机弯辊力
tmAcrMesh: undefined, // 光整机防皱辊插入量
tmBrMesh: undefined, // 光整机防颤辊插入量
// 拉矫机
tlElong: undefined, // 拉矫机延伸率
tlLvlMesh1: undefined, // 拉矫机矫直辊插入量1
tlLvlMesh2: undefined, // 拉矫机矫直辊插入量2
tlAcbMesh: undefined, // 拉矫机防横弓插入量
// 炉火段
preheatingSection: undefined, // 炉火段预热段出口板温
heatingSection: undefined, // 炉火段加热段出口板温
coolingSection: undefined, // 炉火段冷却段出口板温
})
export default {
props: {
income: {
type: Object,
required: true
},
steelGradeOptions: {
type: Array,
default: () => []
},
planHistory: {
type: Array,
default: () => []
},
showRecommendationPanel: {
type: Boolean,
default: true
}
},
data() {
return {
form: {
// 全线张力
porTension: undefined, // 开卷机张力
celTension: undefined, // 入口活套张力
cleanTension: undefined, // 清洗段张力
furTension: undefined, // 炉区张力
towerTension: undefined, // 冷却塔张力
tmNoneTension: undefined, // 光整机不投张力
tmEntryTension: undefined, // 光整机入口张力
tmExitTension: undefined, // 光整机出口张力
tlNoneTension: undefined, // 拉矫机不投张力
tlExitTension: undefined, // 拉矫机出口张力
coatTension: undefined, // 后处理张力
cxlTension: undefined, // 出口活套张力
trTension: undefined, // 卷取机张力
// 光整机
tmRollforce: undefined, // 光整机轧制力
tmBendforce: undefined, // 光整机弯辊力
tmAcrMesh: undefined, // 光整机防皱辊插入量
tmBrMesh: undefined, // 光整机防颤辊插入量
// 拉矫机
tlElong: undefined, // 拉矫机延伸率
tlLvlMesh1: undefined, // 拉矫机矫直辊插入量1
tlLvlMesh2: undefined, // 拉矫机矫直辊插入量2
tlAcbMesh: undefined, // 拉矫机防横弓插入量
// 炉火段
preheatingSection: undefined, // 炉火段预热段出口板温
heatingSection: undefined, // 炉火段加热段出口板温
coolingSection: undefined, // 炉火段冷却段出口板温
},
loading: false
form: createDefaultForm(),
recommendation: createDefaultForm(),
loading: false,
lastSignature: ''
}
},
mounted() {
this.fetchSetup()
computed: {
missingFieldKeys() {
return REQUIRED_FIELDS.filter(key => !this.hasValue(this.income && this.income[key]))
},
missingFieldLabels() {
return this.missingFieldKeys.map(key => FIELD_LABEL_MAP[key])
},
canGenerate() {
return this.missingFieldKeys.length === 0
},
hasRecommendation() {
return Object.values(this.recommendation).some(val => this.hasValue(val))
},
parameterGroups() {
return PARAMETER_GROUPS
}
},
watch: {
income: {
handler() {
this.handleIncomeChange()
},
immediate: true,
deep: true
}
},
methods: {
hasValue(value) {
return !(value === null || value === undefined || value === '')
},
generateSignature() {
return REQUIRED_FIELDS.map(key => (this.income && this.income[key]) ?? '').join('|')
},
async handleIncomeChange() {
if (!this.canGenerate) {
this.lastSignature = ''
this.recommendation = createDefaultForm()
this.emitRecommendationChange()
return
}
const signature = this.generateSignature()
if (signature === this.lastSignature) {
return
}
this.lastSignature = signature
await this.fetchSetup()
},
async fetchSetup() {
if (!this.canGenerate) return
this.loading = true
const { entryThick, yieldPoint, steelGrade, spmElongation, spmRollforce, entryWidth } = this.income
const res1 = await getTension({
thick: entryThick,
yieldStren: yieldPoint
})
if (res1.data) {
// 全线张力的各种参数
this.form.porTension = res1.data.value1;
this.form.celTension = res1.data.value2;
this.form.cleanTension = res1.data.value3;
this.form.furTension = res1.data.value4;
this.form.towerTension = res1.data.value5;
this.form.tmNoneTension = res1.data.value6;
this.form.tmEntryTension = res1.data.value7;
this.form.tmExitTension = res1.data.value8;
this.form.tlNoneTension = res1.data.value9;
this.form.tlExitTension = res1.data.value10;
this.form.coatTension = res1.data.value11;
this.form.cxlTension = res1.data.value12;
this.form.trTension = res1.data.value13;
}
this.recommendation = createDefaultForm()
const {
entryThick,
yieldPoint,
steelGrade,
spmElongation,
spmRollforce,
entryWidth
} = this.income
const res2 = await getTl({
thick: entryThick,
yieldStren: yieldPoint,
steelGrade: steelGrade
})
if (res2.data) {
this.form.tlElong = res2.data.value1;
this.form.tlLvlMesh1 = res2.data.value2;
this.form.tlLvlMesh2 = res2.data.value3;
this.form.tlAcbMesh = res2.data.value4;
}
try {
const [
tensionRes,
tlRes,
rollforceRes,
bendforceRes,
meshRes,
furRes
] = await Promise.allSettled([
getTension({ thick: entryThick, yieldStren: yieldPoint }),
getTl({ thick: entryThick, yieldStren: yieldPoint, steelGrade }),
getRollforce({ thick: entryThick, yieldStren: yieldPoint, steelGrade, elong: spmElongation }),
getBendforce({ width: entryWidth, rollForce: spmRollforce }),
getMesh({ thick: entryThick, yieldStren: yieldPoint, steelGrade }),
getFur(steelGrade)
])
const res3 = await getRollforce({
thick: entryThick,
yieldStren: yieldPoint,
steelGrade: steelGrade,
elong: spmElongation
})
if (res3.data) {
this.form.tmRollforce = res3.data.value1;
}
if (tensionRes.status === 'fulfilled' && tensionRes.value.data) {
const data = tensionRes.value.data
this.recommendation.porTension = data.value1
this.recommendation.celTension = data.value2
this.recommendation.cleanTension = data.value3
this.recommendation.furTension = data.value4
this.recommendation.towerTension = data.value5
this.recommendation.tmNoneTension = data.value6
this.recommendation.tmEntryTension = data.value7
this.recommendation.tmExitTension = data.value8
this.recommendation.tlNoneTension = data.value9
this.recommendation.tlExitTension = data.value10
this.recommendation.coatTension = data.value11
this.recommendation.cxlTension = data.value12
this.recommendation.trTension = data.value13
}
const res4 = await getBendforce({
width: entryWidth,
rollForce: spmRollforce
})
if (res4.data) {
this.form.tmBendforce = res4.data.value1;
}
if (tlRes.status === 'fulfilled' && tlRes.value.data) {
const data = tlRes.value.data
this.recommendation.tlElong = data.value1
this.recommendation.tlLvlMesh1 = data.value2
this.recommendation.tlLvlMesh2 = data.value3
this.recommendation.tlAcbMesh = data.value4
}
const res5 = await getMesh({
thick: entryThick,
yieldStren: yieldPoint,
steelGrade: steelGrade
})
if (res5.data) {
this.form.tmAcrMesh = res5.data.value1;
this.form.tmBrMesh = res5.data.value2;
}
if (rollforceRes.status === 'fulfilled' && rollforceRes.value.data) {
this.recommendation.tmRollforce = rollforceRes.value.data.value1
}
const res6 = await getFur(steelGrade)
if (res6.data) {
this.form.preheatingSection = res6.data.value1;
this.form.heatingSection = res6.data.value2;
this.form.coolingSection = res6.data.value3;
}
if (bendforceRes.status === 'fulfilled' && bendforceRes.value.data) {
this.recommendation.tmBendforce = bendforceRes.value.data.value1
}
console.log('表单初始化完成', this.form)
if (meshRes.status === 'fulfilled' && meshRes.value.data) {
const data = meshRes.value.data
this.recommendation.tmAcrMesh = data.value1
this.recommendation.tmBrMesh = data.value2
}
if (furRes.status === 'fulfilled' && furRes.value.data) {
const data = furRes.value.data
this.recommendation.preheatingSection = data.value1
this.recommendation.heatingSection = data.value2
this.recommendation.coolingSection = data.value3
}
} catch (error) {
console.error('获取工艺参数提示失败', error)
} finally {
this.loading = false
this.emitRecommendationChange()
}
},
emitRecommendationChange() {
this.$emit('recommendation-change', { ...this.recommendation })
},
applyRecommended(field) {
if (!this.hasValue(this.recommendation[field])) return
this.$set(this.form, field, this.recommendation[field])
this.syncModal()
this.loading = false
},
applyAll() {
if (!this.hasRecommendation) return
Object.keys(this.recommendation).forEach((key) => {
if (this.hasValue(this.recommendation[key])) {
this.$set(this.form, key, this.recommendation[key])
}
})
this.syncModal()
},
formatValue(val) {
return this.hasValue(val) ? val : '-'
},
syncModal() {
this.$emit('input', this.form)
}
}
}
</script>
</script>
<style scoped>
.setup-form-wrapper {
padding-bottom: 8px;
}
.setup-hint {
margin-bottom: 12px;
}
q
.hint-text {
font-size: 13px;
color: #909399;
}
.hint-tags {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.recommend-card {
height: 100%;
display: flex;
flex-direction: column;
}
.recommend-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.recommend-header .title {
font-weight: 600;
color: #303133;
}
.recommend-header .subtitle {
font-size: 12px;
color: #909399;
}
.recommend-groups {
flex: 1;
overflow-y: auto;
padding-right: 6px;
}
.recommend-group + .recommend-group {
margin-top: 16px;
}
.group-title {
font-size: 13px;
font-weight: 600;
margin-bottom: 8px;
color: #606266;
}
.recommend-items {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.recommend-item {
border: 1px solid #e4e7ed;
border-radius: 4px;
padding: 8px;
cursor: pointer;
transition: all 0.2s;
display: flex;
flex-direction: column;
position: relative;
background: #f7f9fc;
}
.recommend-item.disabled {
cursor: not-allowed;
opacity: 0.5;
}
.recommend-item:not(.disabled):hover {
border-color: #409eff;
background: #ecf5ff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
}
.recommend-item .label {
font-size: 12px;
color: #909399;
}
.recommend-item .value {
font-size: 16px;
font-weight: 600;
color: #303133;
}
.recommend-item i {
position: absolute;
right: 8px;
top: 8px;
color: #c0c4cc;
}
.empty-recommend {
padding: 40px 0;
}
</style>

View File

@@ -0,0 +1,47 @@
export const PARAMETER_GROUPS = [
{
title: '全线张力',
items: [
{ label: '开卷机张力', 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: 'cxlTension' },
{ label: '卷取机张力', key: 'trTension' }
]
},
{
title: '光整机参数',
items: [
{ label: '光整机轧制力', key: 'tmRollforce' },
{ label: '光整机弯辊力', key: 'tmBendforce' },
{ label: '光整机防皱辊插入量', key: 'tmAcrMesh' },
{ label: '光整机防颤辊插入量', key: 'tmBrMesh' }
]
},
{
title: '拉矫机参数',
items: [
{ label: '拉矫机延伸率', key: 'tlElong' },
{ label: '矫直辊插入量1', key: 'tlLvlMesh1' },
{ label: '矫直辊插入量2', key: 'tlLvlMesh2' },
{ label: '防横弓插入量', key: 'tlAcbMesh' }
]
},
{
title: '炉火段参数',
items: [
{ label: '预热段出口板温', key: 'preheatingSection' },
{ label: '加热段出口板温', key: 'heatingSection' },
{ label: '冷却段出口板温', key: 'coolingSection' }
]
}
]

View File

@@ -230,77 +230,92 @@
<!-- 编辑/新增弹窗 -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" :close-on-click-modal="false"
append-to-body>
<el-form :model="form" ref="form" label-width="80px" :rules="rules" size="mini">
<!-- 基础信息区域 -->
<el-divider content-position="left">基础信息</el-divider>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="计划ID" prop="planid">
<el-input v-model="form.planid" placeholder="请输入计划ID" maxLength="32"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="钢卷号" prop="coilid">
<el-input v-model="form.coilid" placeholder="请输入钢卷号" maxLength="32"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="钢种" prop="steelGrade">
<el-select v-model="form.steelGrade" placeholder="请选择钢种">
<el-option v-for="item in steelGradeList" :key="item.gradeid" :label="item.name"
:value="item.gradeid"></el-option>
</el-select>
</el-form-item>
</el-col>
<div class="plan-dialog-body">
<div class="plan-dialog-left">
<el-form :model="form" ref="form" label-width="90px" :rules="rules" size="mini" class="plan-base-form">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="计划ID" prop="planid">
<el-input v-model="form.planid" placeholder="请输入计划ID" maxLength="32"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="钢卷号" prop="coilid">
<el-input v-model="form.coilid" placeholder="请输入钢卷号" maxLength="32"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="钢种" prop="steelGrade">
<el-select v-model="form.steelGrade" placeholder="请选择钢种">
<el-option v-for="item in steelGradeList" :key="item.gradeid" :label="item.name"
:value="item.gradeid"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厚度(mm)" prop="entryThick">
<el-input v-model="form.entryThick" placeholder="请输入入口厚度" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="宽度(mm)" prop="entryWidth">
<el-input v-model="form.entryWidth" placeholder="请输入入口宽度" type="number" step="1" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="屈服点" prop="yieldPoint">
<el-input v-model="form.yieldPoint" placeholder="请输入屈服点" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="重量(t)" prop="entryWeight">
<el-input v-model="form.entryWeight" placeholder="请输入入口重量" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="长度(mm)" prop="entryLength">
<el-input v-model="form.entryLength" placeholder="请输入入口长度" type="number" step="1" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="外径(mm)" prop="entryOuterDiameter">
<el-input v-model="form.entryOuterDiameter" placeholder="请输入入口外径" type="number" step="1"
min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="延伸率(%)" prop="spmElongation">
<el-input v-model="form.spmElongation" placeholder="请输入延伸率" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="轧制力" prop="spmRollforce">
<el-input v-model="form.spmRollforce" placeholder="请输入SPM轧制力" type="number" step="0.01"
min="0"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-col :span="6">
<el-form-item label="厚度(mm)" prop="entryThick">
<el-input v-model="form.entryThick" placeholder="请输入入口厚度" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="宽度(mm)" prop="entryWidth">
<el-input v-model="form.entryWidth" placeholder="请输入入口宽度" type="number" step="1" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="屈服点" prop="yieldPoint">
<el-input v-model="form.yieldPoint" placeholder="请输入屈服点" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="重量(t)" prop="entryWeight">
<el-input v-model="form.entryWeight" placeholder="请输入入口重量" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="长度(mm)" prop="entryLength">
<el-input v-model="form.entryLength" placeholder="请输入入口长度" type="number" step="1" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="外径(mm)" prop="entryOuterDiameter">
<el-input v-model="form.entryOuterDiameter" placeholder="请输入入口外径" type="number" step="1"
min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="延伸率(%)" prop="spmElongation">
<el-input v-model="form.spmElongation" placeholder="请输入延伸率" type="number" step="0.01" min="0"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="轧制力" prop="spmRollforce">
<el-input v-model="form.spmRollforce" placeholder="请输入SPM轧制力" type="number" step="0.01"
min="0"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="plan-dialog-actions">
<el-checkbox v-if="!form.id" v-model="spmFlag"
label="生成工艺参数(建议先填写完成基础信息再勾选此选项)"></el-checkbox>
<el-divider content-position="left" v-if="spmFlag">工艺参数</el-divider>
<setup-form v-if="spmFlag" ref="setupFormRef" :income="form" :steel-grade-options="steelGradeList"
:plan-history="planList" :show-recommendation-panel="false" @input="handleSetupInput"
@recommendation-change="handleProcessRecommendation" />
</div>
</div>
<el-checkbox v-if="!form.id" v-model="spmFlag" label="生成工艺参数(建议先填写完成基础信息再勾选此选项)"></el-checkbox>
<el-divider content-position="left" v-if="spmFlag">工艺参数</el-divider>
<setup-form v-if="spmFlag" :income="form" @input="handleSetupInput" />
<div class="plan-dialog-right">
<process-recommend-panel v-if="spmFlag" :recommendation="processRecommendation"
@apply-one="handleProcessApplyOne" @apply-all="handleProcessApplyAll" />
<plan-recommend-panel v-else :steel-grade="form.steelGrade" :entry-thick="form.entryThick"
:entry-width="form.entryWidth" :spm-rollforce="form.spmRollforce" :steel-grade-list="steelGradeList"
@apply-steel-grade="handleApplySteelGrade" @apply-thickness="handleApplyThickness"
@apply-width="handleApplyWidth" @apply-rollforce="handleApplyRollforce" />
</div>
</div>
<!-- 弹窗底部按钮 -->
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
@@ -318,7 +333,8 @@ import { getTrackMatPosition } from '@/api/l2/track'
import SetupForm from './components/setupForm.vue'
import SetupPane from './components/setupPane.vue'
import PlanRecommendPanel from './components/PlanRecommendPanel.vue'
import ProcessRecommendPanel from './components/ProcessRecommendPanel.vue'
// 标准日期格式化方法(优化时间处理逻辑,适配接口日期格式)
function parseTime(time, format = "{yyyy}-{mm}-{dd} {hh}:{ii}:{ss}") {
@@ -360,7 +376,9 @@ export default {
name: "PlanManagement",
components: {
SetupForm,
SetupPane
SetupPane,
PlanRecommendPanel,
ProcessRecommendPanel
},
data() {
return {
@@ -534,6 +552,7 @@ export default {
// 当前选中行数据(用于行点击、编辑回显)
currentRow: null,
steelGradeList: [],
processRecommendation: {},
};
},
computed: {
@@ -590,6 +609,44 @@ export default {
this.steelGradeList = res.data
})
},
handleApplySteelGrade(payload) {
if (!payload) return
if (payload.steelGrade) this.form.steelGrade = payload.steelGrade
if (payload.entryThick) this.form.entryThick = payload.entryThick
if (payload.entryWidth) this.form.entryWidth = payload.entryWidth
if (payload.yieldPoint) this.form.yieldPoint = payload.yieldPoint
if (payload.spmElongation) this.form.spmElongation = payload.spmElongation
if (payload.spmRollforce) this.form.spmRollforce = payload.spmRollforce
},
handleApplyThickness(payload) {
if (!payload) return
if (payload.entryThick) this.form.entryThick = payload.entryThick
if (payload.yieldPoint) this.form.yieldPoint = payload.yieldPoint
},
handleApplyWidth(payload) {
if (!payload) return
if (payload.entryWidth) this.form.entryWidth = payload.entryWidth
if (payload.spmRollforce) this.form.spmRollforce = payload.spmRollforce
},
handleApplyRollforce(payload) {
if (!payload) return
if (payload.spmRollforce) this.form.spmRollforce = payload.spmRollforce
if (payload.entryThick) this.form.entryThick = payload.entryThick
if (payload.yieldPoint) this.form.yieldPoint = payload.yieldPoint
if (payload.spmElongation) this.form.spmElongation = payload.spmElongation
if (payload.steelGrade) this.form.steelGrade = payload.steelGrade
},
handleProcessRecommendation(payload) {
this.processRecommendation = payload
},
handleProcessApplyOne(field) {
if (!field || !this.$refs.setupFormRef) return
this.$refs.setupFormRef.applyRecommended(field)
},
handleProcessApplyAll() {
if (!this.$refs.setupFormRef) return
this.$refs.setupFormRef.applyAll()
},
// 获取物料位置映射
fetchMatMapList() {
getTrackMatPosition().then(res => {
@@ -1265,6 +1322,44 @@ export default {
background: #fafafa;
}
.plan-dialog-body {
display: flex;
gap: 16px;
min-height: 520px;
}
.plan-dialog-left {
flex: 1 1 60%;
min-width: 0;
display: flex;
flex-direction: column;
gap: 16px;
}
.plan-base-form {
background: #fff;
padding: 12px;
border: 1px solid #e4e7ed;
border-radius: 6px;
}
.plan-dialog-actions {
flex: 1;
min-height: 0;
overflow-y: auto;
padding-right: 4px;
}
.plan-dialog-right {
flex: 1 1 38%;
min-width: 320px;
display: flex;
}
.plan-dialog-right ::v-deep .plan-recommend-panel {
width: 100%;
}
/* 统一的计划项样式 */
.plan-item {
display: flex;

View File

@@ -37,7 +37,7 @@
>
<el-card class="parameter-card" shadow="never" :body-style="{ padding: '10px' }">
<div slot="header" class="card-header">
<span class="card-title">厚度: {{ item.thick || '-' }} | 强度: {{ item.yieldStren || '-' }}</span>
<span class="card-title">厚度: {{ item.thick || '-' }} | 屈服点: {{ item.yieldStren || '-' }}</span>
</div>
<div class="card-body">
<div class="param-row">
@@ -150,8 +150,8 @@
<el-form-item label="厚度" prop="thick">
<el-input v-model="form.thick" placeholder="请输入厚度" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="强度" prop="yieldStren">
<el-input v-model="form.yieldStren" placeholder="请输入强度" :disabled="!isAdd" />
<el-form-item label="屈服点" prop="yieldStren">
<el-input v-model="form.yieldStren" placeholder="请输入屈服点" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="开卷机张力" prop="value1">
<el-input v-model="form.value1" placeholder="请输入开卷机张力" />

View File

@@ -57,7 +57,7 @@
>
<el-card class="parameter-card" shadow="never" :body-style="{ padding: '10px' }">
<div slot="header" class="card-header">
<span class="card-title">钢种: {{ getSteelGradeName(item.steelGrade) || '-' }} | 厚度: {{ item.thick || '-' }} | 强度: {{ item.yieldStren || '-' }}</span>
<span class="card-title">钢种: {{ getSteelGradeName(item.steelGrade) || '-' }} | 厚度: {{ item.thick || '-' }} | 屈服点: {{ item.yieldStren || '-' }}</span>
</div>
<div class="card-body">
<div class="param-row">
@@ -118,8 +118,8 @@
<el-form-item label="厚度" prop="thick">
<el-input v-model="form.thick" placeholder="请输入厚度" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="强度" prop="yieldStren">
<el-input v-model="form.yieldStren" placeholder="请输入强度" :disabled="!isAdd" />
<el-form-item label="屈服点" prop="yieldStren">
<el-input v-model="form.yieldStren" placeholder="请输入屈服点" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="防皱辊插入量" prop="value1">
<el-input v-model="form.value1" placeholder="请输入防皱辊插入量" />

View File

@@ -57,7 +57,7 @@
>
<el-card class="parameter-card" shadow="never" :body-style="{ padding: '10px' }">
<div slot="header" class="card-header">
<span class="card-title">钢种: {{ getSteelGradeName(item.steelGrade) || '-' }} | 厚度: {{ item.thick || '-' }} | 强度: {{ item.yieldStren || '-' }}</span>
<span class="card-title">钢种: {{ getSteelGradeName(item.steelGrade) || '-' }} | 厚度: {{ item.thick || '-' }} | 屈服点: {{ item.yieldStren || '-' }}</span>
</div>
<div class="card-body">
<div class="param-row">
@@ -118,8 +118,8 @@
<el-form-item label="厚度" prop="thick">
<el-input v-model="form.thick" placeholder="请输入厚度" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="强度" prop="yieldStren">
<el-input v-model="form.yieldStren" placeholder="请输入强度" :disabled="!isAdd" />
<el-form-item label="屈服点" prop="yieldStren">
<el-input v-model="form.yieldStren" placeholder="请输入屈服点" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="延伸率" prop="elong">
<el-input v-model="form.elong" placeholder="请输入延伸率" :disabled="!isAdd" />