feat: 实时数据持久化到计划/实绩 + 质量管理改版(钢卷信息+异常记录+继承)
- 在产计划持久化实时数据快照(run_data),物料跟踪每次轮询上报;生产完成写入实绩 process_data - 实绩页点击行展开生产阶段数据 + 实时数据快照(测点列表) - 质量管理默认进入异常管理,改为全宽:顶部选卷 + 钢卷信息(5列) + 异常记录表 - 异常记录新增「继承来源」列与「继承」按钮(从来源卷复制缺陷),进入即预置6行 - qc_defect 增加 inherit_source 字段 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -337,7 +337,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPlans, startProducing } from '@/api'
|
||||
import { getPlans, startProducing, saveRuntime } from '@/api'
|
||||
function rnd(base, amp) { return base + (Math.random() - 0.5) * amp }
|
||||
function fix(v, n = 1) { return Number(v).toFixed(n) }
|
||||
|
||||
@@ -560,6 +560,20 @@ export default {
|
||||
const pp = this.producingPlan
|
||||
if (pp && pp.cold_coil_no) this.current.coil_no = pp.cold_coil_no
|
||||
this.prodBase = pp ? { id: pp.id, len: pp.run_length_m || 0, at: Date.now(), speed: pp.run_speed || 0 } : null
|
||||
// 持久化实时数据快照到在产计划
|
||||
if (pp) this.persistRuntime(pp)
|
||||
} catch (e) { /* ignore */ }
|
||||
},
|
||||
async persistRuntime(pp) {
|
||||
try {
|
||||
const snapshot = {
|
||||
time: new Date().toISOString(),
|
||||
coil_no: pp.cold_coil_no || pp.plan_no,
|
||||
line_speed: Number(this.current.speed.toFixed(1)),
|
||||
weld_position: Number((this.weld.position * 100).toFixed(1)),
|
||||
items: this.rtItems.map(it => ({ label: it.label, value: it.val, unit: it.unit })),
|
||||
}
|
||||
await saveRuntime(pp.id, snapshot)
|
||||
} catch (e) { /* ignore */ }
|
||||
},
|
||||
async movePlan(p) {
|
||||
|
||||
Reference in New Issue
Block a user