Browse Source

2026-08-07

TID接口
master
fengyuan_yang 2 months ago
parent
commit
57dddc8e49
  1. 47
      src/views/modules/yieldReport/com_tid_upload_mt_log.vue

47
src/views/modules/yieldReport/com_tid_upload_mt_log.vue

@ -71,19 +71,20 @@
</div>
<el-form label-position="top" label-width="90px" class="upload-form">
<el-row :gutter="10">
<el-col :span="8">
<el-col :span="12">
<el-form-item label="机器账号">
<el-input v-model="uploadForm.machineNo" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班次">
<el-input v-model="uploadForm.shift" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="12">
<el-form-item label="日期">
<el-input v-model="uploadForm.date" readonly></el-input>
<el-date-picker
v-model="uploadForm.date"
type="date"
placeholder="请选择日期"
value-format="yyyy-MM-dd"
style="width: 100%;">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
@ -299,7 +300,6 @@ export default {
if (!this.pageData.site || !this.pageData.resourceId) {
return
}
this.uploadForm.date = this.getTodayDateString()
const params = {
site: this.pageData.site,
resourceId: this.pageData.resourceId,
@ -323,12 +323,12 @@ export default {
this.mesShiftLogs = []
return
}
const currentDate = this.getTodayDateString()
const queryDate = this.normalizeDateValue(this.uploadForm.date) || this.getTodayDateString()
const shiftValue = this.getShiftValueForApi()
this.uploadForm.date = currentDate
this.uploadForm.date = queryDate
const params = {
machineNo: this.uploadForm.machineNo,
date: currentDate,
date: queryDate,
shift: shiftValue,
type: 'MT'
}
@ -547,6 +547,23 @@ export default {
return (size / 1024).toFixed(2)
},
normalizeDateValue (dateValue) {
if (!dateValue) {
return ''
}
if (Object.prototype.toString.call(dateValue) === '[object Date]') {
return this.formatDateValue(dateValue)
}
const value = String(dateValue)
if (value.indexOf(' ') > -1) {
return value.split(' ')[0]
}
if (value.indexOf('T') > -1) {
return value.split('T')[0]
}
return value
},
validateUploadMtForm () {
if (this.saveLoading) {
return false
@ -622,8 +639,8 @@ export default {
if (!this.validateUploadMtForm()) {
return
}
const currentDate = this.getTodayDateString()
this.uploadForm.date = currentDate
const uploadDate = this.normalizeDateValue(this.uploadForm.date) || this.getTodayDateString()
this.uploadForm.date = uploadDate
this.saveLoading = true
this.uploadResults = []
this.resetUploadProgress()
@ -636,7 +653,7 @@ export default {
for (let i = 0; i < taskFileList.length; i++) {
const currentFileItem = taskFileList[i]
this.uploadProgress.running = 1
const result = await this.uploadSingleMtFile(currentFileItem, i, currentDate)
const result = await this.uploadSingleMtFile(currentFileItem, i, uploadDate)
this.uploadProgress.running = 0
resultList.push(result)

Loading…
Cancel
Save