Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
|
||||
<script>
|
||||
import { listInspectionMain, addInspectionMain, updateInspectionMain, delInspectionMain } from '@/api/mes/qc/inspectionMain'
|
||||
import { listInspectionDetail, addInspectionDetail, updateInspectionDetail } from '@/api/mes/qc/inspectionDetail'
|
||||
import { listInspectionDetail } from '@/api/mes/qc/inspectionDetail'
|
||||
import { listInspectionItemTemplate, getInfoByInspectionItem } from '@/api/mes/qc/inspectionItemTemplate'
|
||||
|
||||
export default {
|
||||
@@ -391,36 +391,28 @@ export default {
|
||||
|
||||
handleSaveMain(row) {
|
||||
row._saving = true
|
||||
const detailList = this.checkItems.map(checkItem => {
|
||||
const itemData = row._items[checkItem.itemName]
|
||||
if (!itemData || (!itemData.itemValue && !itemData.detailId)) return null
|
||||
return {
|
||||
detailId: itemData.detailId,
|
||||
mainId: row.mainId,
|
||||
itemName: itemData.itemName,
|
||||
itemValue: itemData.itemValue || '',
|
||||
itemUnit: itemData.itemUnit || '',
|
||||
upperLimit: itemData.upperLimit,
|
||||
lowerLimit: itemData.lowerLimit,
|
||||
rangeDesc: itemData.rangeDesc || ''
|
||||
}
|
||||
}).filter(Boolean)
|
||||
updateInspectionMain({
|
||||
mainId: row.mainId,
|
||||
sampleName: row.sampleName,
|
||||
sampleNo: row.sampleNo,
|
||||
batchNo: row.batchNo,
|
||||
inspectionDate: row.inspectionDate,
|
||||
remark: row.remark
|
||||
}).then(() => {
|
||||
const items = this.checkItems.map(checkItem => {
|
||||
const itemData = row._items[checkItem.itemName]
|
||||
return itemData || { itemName: checkItem.itemName }
|
||||
})
|
||||
const promises = items.map(item => {
|
||||
const data = {
|
||||
mainId: row.mainId,
|
||||
itemName: item.itemName,
|
||||
itemValue: item.itemValue,
|
||||
itemUnit: item.itemUnit,
|
||||
upperLimit: item.upperLimit,
|
||||
lowerLimit: item.lowerLimit
|
||||
}
|
||||
if (item.detailId) {
|
||||
data.detailId = item.detailId
|
||||
return updateInspectionDetail(data)
|
||||
} else if (item.itemValue) {
|
||||
return addInspectionDetail(data)
|
||||
}
|
||||
return Promise.resolve()
|
||||
})
|
||||
return Promise.all(promises)
|
||||
remark: row.remark,
|
||||
detailList: detailList
|
||||
}).then(() => {
|
||||
this.$message.success('保存成功')
|
||||
return listInspectionDetail({ mainId: row.mainId, pageNum: 1, pageSize: 9999 })
|
||||
|
||||
@@ -519,7 +519,7 @@
|
||||
|
||||
<script>
|
||||
import { listInspectionTensile, getInspectionTensile, addInspectionTensile, updateInspectionTensile } from '@/api/mes/qc/inspectionTensile'
|
||||
import { listInspectionTensileDetail, addInspectionTensileDetail, updateInspectionTensileDetail, delInspectionTensileDetail } from '@/api/mes/qc/inspectionTensileDetail'
|
||||
import { listInspectionTensileDetail, addInspectionTensileDetail, updateInspectionTensileDetail, delInspectionTensileDetail, batchInsertTensileDetails } from '@/api/mes/qc/inspectionTensileDetail'
|
||||
import { listMaterialCoil } from '@/api/wms/coil'
|
||||
import { listChemicalItem } from '@/api/mes/qc/chemicalItem'
|
||||
import { listPhysicalItem } from '@/api/mes/qc/physicalItem'
|
||||
@@ -765,16 +765,12 @@ export default {
|
||||
this.$message.warning('请选择钢卷')
|
||||
return
|
||||
}
|
||||
|
||||
let successCount = 0
|
||||
let failCount = 0
|
||||
this.detailLoading = true
|
||||
|
||||
for (let index = 0; index < coils.length; index++) {
|
||||
const coil = coils[index]
|
||||
const detailList = []
|
||||
for (const coil of coils) {
|
||||
try {
|
||||
const data = await this.fetchLatestChemAndPhys(coil.enterCoilNo)
|
||||
addInspectionTensileDetail({
|
||||
detailList.push({
|
||||
testMainId: this.currentTestId,
|
||||
steelCoilNo: coil.currentCoilNo,
|
||||
material: coil.material,
|
||||
@@ -782,21 +778,27 @@ export default {
|
||||
rawMaterialNo: coil.enterCoilNo,
|
||||
...data
|
||||
})
|
||||
successCount++
|
||||
} catch {
|
||||
failCount++
|
||||
// skip failed coil
|
||||
}
|
||||
}
|
||||
|
||||
this.batchAddDialogVisible = false
|
||||
if (failCount === 0) {
|
||||
this.$message.success(`批量新增成功,共新增 ${successCount} 条明细`)
|
||||
} else if (successCount === 0) {
|
||||
this.$message.error('批量新增失败')
|
||||
} else {
|
||||
this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`)
|
||||
if (detailList.length === 0) {
|
||||
this.detailLoading = false
|
||||
this.$message.error('批量新增失败,请稍后重试')
|
||||
return
|
||||
}
|
||||
this.getDetailList()
|
||||
updateInspectionTensile({
|
||||
testId: this.currentTestId,
|
||||
detailList: detailList
|
||||
}).then(() => {
|
||||
this.$message.success(`批量新增成功,共新增 ${detailList.length} 条明细`)
|
||||
}).catch(() => {
|
||||
this.$message.error('批量新增失败')
|
||||
}).finally(() => {
|
||||
this.batchAddDialogVisible = false
|
||||
this.detailLoading = false
|
||||
this.getDetailList()
|
||||
})
|
||||
},
|
||||
|
||||
// 保存明细
|
||||
|
||||
113
klp-ui/src/views/micro/pages/acid/components/CoilInfoCard.vue
Normal file
113
klp-ui/src/views/micro/pages/acid/components/CoilInfoCard.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="coil-info-card">
|
||||
<div class="card-title">
|
||||
<span>{{ title }}</span>
|
||||
<span v-if="coil" class="status-text">{{ statusText }}</span>
|
||||
</div>
|
||||
<div v-if="!coil" class="empty-tip">暂无数据</div>
|
||||
<div v-else class="info-list">
|
||||
<div class="info-row">
|
||||
<span class="info-label">钢卷号</span>
|
||||
<span class="info-value">{{ coil.coilid || '-' }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">钢种</span>
|
||||
<span class="info-value">{{ coil.spec.grade }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">来料厚度</span>
|
||||
<span class="info-value">{{ coil.spec.entry_thick }} mm</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">成品厚度</span>
|
||||
<span class="info-value">{{ coil.spec.exit_thick }} mm</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">宽度</span>
|
||||
<span class="info-value">{{ coil.spec.width }} mm</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">压下率</span>
|
||||
<span class="info-value">{{ reductionPct }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const STATUS_TEXT = {
|
||||
PRODUCING: '正在轧',
|
||||
READY: '设定值已生成',
|
||||
ONLINE: '排队待轧',
|
||||
PRODUCT: '已轧完',
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'CoilInfoCard',
|
||||
props: {
|
||||
title: { type: String, required: true },
|
||||
coil: { type: Object, default: null },
|
||||
},
|
||||
computed: {
|
||||
statusText() {
|
||||
return STATUS_TEXT[this.coil.status] || this.coil.status || ''
|
||||
},
|
||||
reductionPct() {
|
||||
const s = this.coil && this.coil.spec
|
||||
if (!s || !s.entry_thick) return '-'
|
||||
return (((s.entry_thick - s.exit_thick) / s.entry_thick) * 100).toFixed(1)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.coil-info-card {
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
padding: 12px 14px;
|
||||
|
||||
& + & {
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid #f0f2f5;
|
||||
|
||||
.status-text {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
color: #c0c4cc;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
|
||||
.info-label {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
145
klp-ui/src/views/micro/pages/acid/components/CoilModelTable.vue
Normal file
145
klp-ui/src/views/micro/pages/acid/components/CoilModelTable.vue
Normal file
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="coil-model-table">
|
||||
<div class="section-title">{{ title }}</div>
|
||||
|
||||
<div v-if="!coil" class="empty-tip">暂无数据</div>
|
||||
|
||||
<template v-else>
|
||||
<div v-if="coil.l2_note" class="note-line">赛迪:{{ coil.l2_note }}</div>
|
||||
<div v-if="coil.ours_note" class="note-line">FAD:{{ coil.ours_note }}</div>
|
||||
|
||||
<el-table :data="rows" size="mini" border :row-class-name="rowClassName">
|
||||
<el-table-column label="机架" prop="standLabel" width="64" align="center" fixed />
|
||||
<el-table-column
|
||||
v-for="col in columns"
|
||||
:key="col.field"
|
||||
:label="col.label"
|
||||
align="center"
|
||||
>
|
||||
<template slot="header">
|
||||
<div>{{ col.label }}</div>
|
||||
<div class="col-unit">{{ col.unit }}</div>
|
||||
</template>
|
||||
<el-table-column label="赛迪" align="right" min-width="66">
|
||||
<template slot-scope="{ row }">{{ row.idle ? '-' : col.fmt(row.l2[col.field]) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="FAD" align="right" min-width="66">
|
||||
<template slot-scope="{ row }">
|
||||
<span class="fad-value">{{ row.idle ? '-' : col.fmt(row.ours[col.field]) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
function fmtNum(v, digits) {
|
||||
if (v === null || v === undefined || v === '') return '-'
|
||||
const n = Number(v)
|
||||
return Number.isNaN(n) ? '-' : n.toFixed(digits)
|
||||
}
|
||||
|
||||
// 与 klp-ml-mill/predict.py 的 TABLE_COLUMNS 保持一致
|
||||
const COLUMNS = [
|
||||
{ label: '入口厚度', unit: 'mm', field: 'setup_enthick', fmt: v => fmtNum(v, 3) },
|
||||
{ label: '压下率', unit: '%', field: 'setup_reduct', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '轧辊速度', unit: 'm/min', field: 'calc_stand_spd', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '前滑', unit: '%', field: 'meas_slip', fmt: v => fmtNum(v, 2) },
|
||||
{ label: '轧制力', unit: 'kN', field: 'calc_force', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '辊缝', unit: 'mm', field: 'calc_gap_run', fmt: v => fmtNum(v, 2) },
|
||||
{ label: '工作辊弯辊', unit: 'kN', field: 'mea_wr_bend', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '中间辊弯辊', unit: 'kN', field: 'mea_ir_bend', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '张应力', unit: 'MPa', field: 'setup_extension_stress', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '出口张力', unit: 'kN', field: 'setup_extension_force', fmt: v => fmtNum(v, 0) },
|
||||
{ label: '负荷', unit: '%', field: 'calc_power_ratio', fmt: v => fmtNum(v, 0) },
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'CoilModelTable',
|
||||
props: {
|
||||
title: { type: String, required: true },
|
||||
coil: { type: Object, default: null },
|
||||
},
|
||||
data() {
|
||||
return { columns: COLUMNS }
|
||||
},
|
||||
computed: {
|
||||
// 6机架,每行同时带赛迪(L2实测)和FAD(我们预测)两组值,交给嵌套表头对比展示;
|
||||
// 空过机架(真正关闭的机架,不是"没数据")单独一行,不展示任何预测值。
|
||||
rows() {
|
||||
if (!this.coil) return []
|
||||
const l2 = this.coil.l2 || {}
|
||||
const ours = (this.coil.ours && this.coil.ours.predictions) || {}
|
||||
const out = []
|
||||
for (let sid = 0; sid < 6; sid++) {
|
||||
const oursStand = ours['stand' + sid] || {}
|
||||
const active = oursStand.active !== false
|
||||
if (!active) {
|
||||
out.push({ standLabel: '机架' + (sid + 1), idle: true })
|
||||
continue
|
||||
}
|
||||
const oursFlat = {}
|
||||
COLUMNS.forEach(c => {
|
||||
const e = oursStand[c.field]
|
||||
oursFlat[c.field] = e && typeof e === 'object' ? e.value : null
|
||||
})
|
||||
out.push({
|
||||
standLabel: '机架' + (sid + 1), idle: false,
|
||||
l2: l2[sid] || {},
|
||||
ours: oursFlat,
|
||||
})
|
||||
}
|
||||
return out
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
rowClassName({ row }) {
|
||||
return row.idle ? 'idle-row' : ''
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.coil-model-table {
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
color: #c0c4cc;
|
||||
font-size: 13px;
|
||||
padding: 12px 0;
|
||||
}
|
||||
|
||||
.note-line {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.col-unit {
|
||||
font-size: 11px;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.fad-value {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
::v-deep .el-table .idle-row {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,10 @@
|
||||
<i class="el-icon-s-tools"></i>
|
||||
<span slot="title">规程</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="model">
|
||||
<i class="el-icon-cpu"></i>
|
||||
<span slot="title">模型</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="performance">
|
||||
<i class="el-icon-date"></i>
|
||||
<span slot="title">计划</span>
|
||||
@@ -39,7 +43,7 @@
|
||||
<span slot="title">实绩</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="rollConfig">
|
||||
<i class="el-icon-s-tools"></i>
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">配辊</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="rollHistory">
|
||||
@@ -54,10 +58,6 @@
|
||||
<i class="el-icon-alarm-clock"></i>
|
||||
<span slot="title">app</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="model">
|
||||
<i class="el-icon-coin"></i>
|
||||
<span slot="title">模型</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
<div style="flex: 1; overflow: hidden;">
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
AcidTiming,
|
||||
TrackingView,
|
||||
ProcessSpec,
|
||||
Model,
|
||||
Model
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -166,6 +166,7 @@ export default {
|
||||
color: #606266;
|
||||
padding: 0 20px;
|
||||
font-size: 14px;
|
||||
transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background-color: #ecf5ff;
|
||||
@@ -176,11 +177,13 @@ export default {
|
||||
background-color: #ecf5ff;
|
||||
color: #409eff;
|
||||
border-right: 3px solid #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 18px;
|
||||
margin-right: 8px;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user