Browse Source

2026-08-03

TID接口
master
fengyuan_yang 4 hours ago
parent
commit
93a79dd990
  1. 84
      src/views/modules/yieldReport/com_tid_upload_order.vue

84
src/views/modules/yieldReport/com_tid_upload_order.vue

@ -165,17 +165,17 @@
<div class="panel-header list-header">
<span>上传结果</span>
</div>
<el-table :data="uploadResults" border :height="rightTableHeight" style="width: 100%;">
<el-table-column prop="fileName" header-align="center" label="文件名" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="statusText" header-align="center" label="状态" width="70" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.success ? 'success' : 'danger'" size="mini">
{{ scope.row.statusText }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="message" label="信息" header-align="center" min-width="100" show-overflow-tooltip></el-table-column>
</el-table>
<el-table :data="uploadResults" border :height="rightTableHeight" style="width: 100%;">
<el-table-column prop="fileName" header-align="center" label="文件名" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="statusText" header-align="center" label="状态" width="70" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.success ? 'success' : 'danger'">
{{ scope.row.statusText }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="message" label="信息" header-align="center" min-width="100" show-overflow-tooltip></el-table-column>
</el-table>
</div>
</div>
</div>
@ -190,7 +190,7 @@
</template>
<script>
import { getMesShiftData, uploadMesOrderLog } from '@/api/yieldReport/produce_report_normal.js'
import { getMesShiftData, uploadMesOrderLog, getScheduleDateShift } from '@/api/yieldReport/produce_report_normal.js'
import { getOperatorList2 } from '@/api/yieldReport/produce_order.js'
export default {
@ -263,6 +263,7 @@ export default {
this.operatorOptions = []
this.updateDialogLayout()
await this.loadCurrentScheduleShift()
await this.loadOperatorOptions()
await this.loadMesShiftData(false)
},
@ -291,6 +292,42 @@ export default {
this.rightTableHeight = nextRightTableHeight
},
getCurrentDateTimeString () {
const now = new Date()
const year = now.getFullYear()
const month = this.padZero(now.getMonth() + 1)
const day = this.padZero(now.getDate())
const hour = this.padZero(now.getHours())
const minute = this.padZero(now.getMinutes())
const second = this.padZero(now.getSeconds())
return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
},
async loadCurrentScheduleShift () {
if (!this.pageData.site || !this.pageData.resourceId) {
return
}
const params = {
site: this.pageData.site,
resourceId: this.pageData.resourceId,
currentDateTime: this.getCurrentDateTimeString()
}
try {
const { data } = await getScheduleDateShift(params)
const map = (data && data.map) || {}
const shiftNo = map.ShiftNo || map.shiftNo || ''
const scheduleDate = map.scheduleddate || map.scheduledDate || map.ScheduleDate || map.scheduleDate || ''
if (shiftNo) {
this.uploadForm.shift = shiftNo
}
if (scheduleDate) {
this.uploadForm.date = this.extractDatePart(scheduleDate)
}
} catch (e) {
// keep fallback values from schedule data when lookup fails
}
},
extractDatePart (dateValue) {
if (!dateValue) {
return this.getTodayDateString()
@ -360,14 +397,14 @@ export default {
},
async loadMesShiftData (showWarning = true) {
if (!this.uploadForm.machineNo || !this.uploadForm.date) {
if (!this.uploadForm.machineNo) {
this.mesShiftData = {}
this.mesShiftLogs = []
return
}
const params = {
machineNo: this.uploadForm.machineNo,
date: this.uploadForm.date,
date: this.getTodayDateString(),
shift: this.uploadForm.shift,
type: ''
}
@ -800,6 +837,25 @@ export default {
margin-top: 0;
}
.upload-result-wrap /deep/ .el-table td {
padding-top: 2px !important;
padding-bottom: 2px !important;
}
.upload-result-wrap /deep/ .el-table .cell {
height: auto !important;
line-height: 20px !important;
}
.upload-result-wrap /deep/ .el-tag {
height: 20px;
line-height: 18px;
display: inline-flex;
align-items: center;
justify-content: center;
white-space: nowrap;
}
.upload-panel /deep/ .el-form-item {
margin-bottom: 6px;
}

Loading…
Cancel
Save