diff --git a/src/api/l2/sendJob.js b/src/api/l2/sendJob.js index 22ce6a7..c835024 100644 --- a/src/api/l2/sendJob.js +++ b/src/api/l2/sendJob.js @@ -34,3 +34,11 @@ export function getSendJob(jobId) { method: 'get' }) } + +// 获取上次炉火写入的钢卷信息 +export function getLastFurnaceSendCoilInfo() { + return request({ + url: '/business/sendJob/furnace/lastCoilInfo', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/views/l2/send/furnace.vue b/src/views/l2/send/furnace.vue index 1060242..60f7d2b 100644 --- a/src/views/l2/send/furnace.vue +++ b/src/views/l2/send/furnace.vue @@ -71,6 +71,10 @@ Last Sent: {{ formatTime(lastSuccess.lastSendTime) }} + + + Last Coil: {{ lastFurnaceCoilInfo.coilId }} (Plan: {{ lastFurnaceCoilInfo.planId }}) + // Import APIs / 引入接口 -import { createSendJob, executeSendJob } from '@/api/l2/sendJob' +import { createSendJob, executeSendJob, getLastFurnaceSendCoilInfo } from '@/api/l2/sendJob' import { getSendTemplate, getLastSuccess, updateSendTemplate, batchSaveSendTemplateItems } from '@/api/l2/sendTemplate' // Import Components / 引入组件 @@ -168,6 +172,7 @@ export default { template: null, // Template / 模板 lastSuccess: null, // Last success / 上次成功 form: {}, // Form values / 表单值 + lastFurnaceCoilInfo: null, // Last furnace send coil info / 上次炉火写入的钢卷信息 // 仅用于 Edit Template:记录加载时的原始模板项快照,用来计算差异,避免全量提交 originalItemsSnapshot: [] @@ -273,13 +278,15 @@ export default { async reload() { this.loading = true - const [templateRes, lastRes] = await Promise.all([ + const [templateRes, lastRes, coilInfoRes] = await Promise.all([ getSendTemplate('FURNACE_DEFAULT'), - getLastSuccess('FURNACE') + getLastSuccess('FURNACE'), + getLastFurnaceSendCoilInfo() ]) this.template = templateRes && templateRes.code === 200 ? templateRes.data : null this.lastSuccess = lastRes && lastRes.code === 200 ? lastRes.data : null + this.lastFurnaceCoilInfo = coilInfoRes && coilInfoRes.code === 200 ? coilInfoRes.data : null // 记录模板项原始快照(用于 Edit Template 计算差异,避免全量提交) this.originalItemsSnapshot = this.template && Array.isArray(this.template.items) @@ -486,6 +493,7 @@ export default { await executeSendJob(jobId) this.$message.success('Send success') + // 重新加载数据,包括上次写入的钢卷信息 await this.reload() } catch (e) { console.error(e) @@ -506,6 +514,7 @@ export default { .card-title { font-weight: 600; } .header-right { display:flex; align-items:center; } .last-send-time { font-size: 12px; color:#909399; margin-right:16px; } +.last-coil-info { font-size: 12px; color:#409eff; margin-right:16px; } .empty-data { margin-top: 20px; } .addr-inline { margin-top: 6px; } .addr-label { display:inline-block; margin-right:6px; color:#909399; font-size:12px; }