写入功能完成
This commit is contained in:
@@ -34,3 +34,11 @@ export function getSendJob(jobId) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取上次炉火写入的钢卷信息
|
||||
export function getLastFurnaceSendCoilInfo() {
|
||||
return request({
|
||||
url: '/business/sendJob/furnace/lastCoilInfo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -71,6 +71,10 @@
|
||||
<i class="el-icon-time"></i>
|
||||
Last Sent: {{ formatTime(lastSuccess.lastSendTime) }}
|
||||
</span>
|
||||
<span v-if="lastFurnaceCoilInfo" class="last-coil-info">
|
||||
<i class="el-icon-document"></i>
|
||||
Last Coil: {{ lastFurnaceCoilInfo.coilId }} (Plan: {{ lastFurnaceCoilInfo.planId }})
|
||||
</span>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@@ -145,7 +149,7 @@ Modified
|
||||
|
||||
<script>
|
||||
// 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; }
|
||||
|
||||
Reference in New Issue
Block a user