写入功能完成
This commit is contained in:
@@ -34,3 +34,11 @@ export function getSendJob(jobId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取上次炉火写入的钢卷信息
|
||||||
|
export function getLastFurnaceSendCoilInfo() {
|
||||||
|
return request({
|
||||||
|
url: '/business/sendJob/furnace/lastCoilInfo',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -71,6 +71,10 @@
|
|||||||
<i class="el-icon-time"></i>
|
<i class="el-icon-time"></i>
|
||||||
Last Sent: {{ formatTime(lastSuccess.lastSendTime) }}
|
Last Sent: {{ formatTime(lastSuccess.lastSendTime) }}
|
||||||
</span>
|
</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
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -145,7 +149,7 @@ Modified
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Import APIs / 引入接口
|
// 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 { getSendTemplate, getLastSuccess, updateSendTemplate, batchSaveSendTemplateItems } from '@/api/l2/sendTemplate'
|
||||||
|
|
||||||
// Import Components / 引入组件
|
// Import Components / 引入组件
|
||||||
@@ -168,6 +172,7 @@ export default {
|
|||||||
template: null, // Template / 模板
|
template: null, // Template / 模板
|
||||||
lastSuccess: null, // Last success / 上次成功
|
lastSuccess: null, // Last success / 上次成功
|
||||||
form: {}, // Form values / 表单值
|
form: {}, // Form values / 表单值
|
||||||
|
lastFurnaceCoilInfo: null, // Last furnace send coil info / 上次炉火写入的钢卷信息
|
||||||
|
|
||||||
// 仅用于 Edit Template:记录加载时的原始模板项快照,用来计算差异,避免全量提交
|
// 仅用于 Edit Template:记录加载时的原始模板项快照,用来计算差异,避免全量提交
|
||||||
originalItemsSnapshot: []
|
originalItemsSnapshot: []
|
||||||
@@ -273,13 +278,15 @@ export default {
|
|||||||
|
|
||||||
async reload() {
|
async reload() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const [templateRes, lastRes] = await Promise.all([
|
const [templateRes, lastRes, coilInfoRes] = await Promise.all([
|
||||||
getSendTemplate('FURNACE_DEFAULT'),
|
getSendTemplate('FURNACE_DEFAULT'),
|
||||||
getLastSuccess('FURNACE')
|
getLastSuccess('FURNACE'),
|
||||||
|
getLastFurnaceSendCoilInfo()
|
||||||
])
|
])
|
||||||
|
|
||||||
this.template = templateRes && templateRes.code === 200 ? templateRes.data : null
|
this.template = templateRes && templateRes.code === 200 ? templateRes.data : null
|
||||||
this.lastSuccess = lastRes && lastRes.code === 200 ? lastRes.data : null
|
this.lastSuccess = lastRes && lastRes.code === 200 ? lastRes.data : null
|
||||||
|
this.lastFurnaceCoilInfo = coilInfoRes && coilInfoRes.code === 200 ? coilInfoRes.data : null
|
||||||
|
|
||||||
// 记录模板项原始快照(用于 Edit Template 计算差异,避免全量提交)
|
// 记录模板项原始快照(用于 Edit Template 计算差异,避免全量提交)
|
||||||
this.originalItemsSnapshot = this.template && Array.isArray(this.template.items)
|
this.originalItemsSnapshot = this.template && Array.isArray(this.template.items)
|
||||||
@@ -486,6 +493,7 @@ export default {
|
|||||||
await executeSendJob(jobId)
|
await executeSendJob(jobId)
|
||||||
this.$message.success('Send success')
|
this.$message.success('Send success')
|
||||||
|
|
||||||
|
// 重新加载数据,包括上次写入的钢卷信息
|
||||||
await this.reload()
|
await this.reload()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@@ -506,6 +514,7 @@ export default {
|
|||||||
.card-title { font-weight: 600; }
|
.card-title { font-weight: 600; }
|
||||||
.header-right { display:flex; align-items:center; }
|
.header-right { display:flex; align-items:center; }
|
||||||
.last-send-time { font-size: 12px; color:#909399; margin-right:16px; }
|
.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; }
|
.empty-data { margin-top: 20px; }
|
||||||
.addr-inline { margin-top: 6px; }
|
.addr-inline { margin-top: 6px; }
|
||||||
.addr-label { display:inline-block; margin-right:6px; color:#909399; font-size:12px; }
|
.addr-label { display:inline-block; margin-right:6px; color:#909399; font-size:12px; }
|
||||||
|
|||||||
Reference in New Issue
Block a user