|
|
|
@ -66,6 +66,14 @@ |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="getDataList()">查询</el-button> |
|
|
|
<el-button @click="resetQuery()">重置</el-button> |
|
|
|
<!-- rqrq - 一键重试按钮(后端批量处理) --> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
:loading="batchRetrying" |
|
|
|
:disabled="batchRetrying || selectedRows.length === 0" |
|
|
|
@click="handleBatchRetry()"> |
|
|
|
{{ batchRetrying ? '批量重试中...' : `一键重试(${selectedRows.length})` }} |
|
|
|
</el-button> |
|
|
|
<!-- 导出按钮 - rqrq --> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
@ -86,12 +94,20 @@ |
|
|
|
|
|
|
|
<!-- 数据表格 --> |
|
|
|
<el-table |
|
|
|
ref="dataTable" |
|
|
|
:data="dataList" |
|
|
|
:height="height" |
|
|
|
border |
|
|
|
highlight-current-row |
|
|
|
v-loading="dataListLoading" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
style="width: 100%;"> |
|
|
|
<!-- rqrq - 多选列,只允许选择PENDING状态的记录 --> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
width="50" |
|
|
|
:selectable="checkSelectable"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -321,7 +337,9 @@ import { |
|
|
|
markErrorAsProcessed, |
|
|
|
markErrorAsIgnored, |
|
|
|
getUserAuthorizedSites, |
|
|
|
retryIfsCall,closeIfsCall |
|
|
|
retryIfsCall, |
|
|
|
closeIfsCall, |
|
|
|
batchRetryIfsCall |
|
|
|
} from '@/api/warehouse/ifsCallErrorLog.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -509,6 +527,11 @@ export default { |
|
|
|
markProcessedLoading: false, |
|
|
|
markIgnoredLoading: false, |
|
|
|
retryingRowId: null, // 正在重试的行ID,全局唯一 - rqrq |
|
|
|
// 批量重试相关 - rqrq |
|
|
|
selectedRows: [], // 选中的行 |
|
|
|
batchRetrying: false, // 批量重试中 |
|
|
|
batchRetryProgress: 0, // 批量重试进度 |
|
|
|
batchRetryTotal: 0, // 批量重试总数 |
|
|
|
// 导出相关 - rqrq |
|
|
|
exportData: [], |
|
|
|
exportName: 'IFS错误日志' + this.dayjs().format('YYYYMMDDHHmmss'), |
|
|
|
@ -704,7 +727,90 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 手工重试IFS接口调用 - rqrq |
|
|
|
// 多选变化处理 - rqrq |
|
|
|
handleSelectionChange(selection) { |
|
|
|
// 只保留PENDING状态的记录 - rqrq |
|
|
|
this.selectedRows = selection.filter(row => row.processStatus === 'PENDING') |
|
|
|
}, |
|
|
|
|
|
|
|
// 检查行是否可选(只允许选择PENDING状态)- rqrq |
|
|
|
checkSelectable(row) { |
|
|
|
return row.processStatus === 'PENDING' |
|
|
|
}, |
|
|
|
|
|
|
|
// 延时函数 - rqrq |
|
|
|
sleep(ms) { |
|
|
|
return new Promise(resolve => setTimeout(resolve, ms)) |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量重试(调用后端接口,由后端按时间顺序执行)- rqrq |
|
|
|
handleBatchRetry() { |
|
|
|
if (this.selectedRows.length === 0) { |
|
|
|
this.$message.warning('请先选择要重试的记录') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 检查是否有单个重试正在进行 - rqrq |
|
|
|
if (this.retryingRowId !== null) { |
|
|
|
this.$message.warning('请等待当前重试完成后再操作') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm(`确定要重试选中的 ${this.selectedRows.length} 条记录吗?将按时间顺序从最早开始逐个重试。`, '批量重试确认', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// 获取选中行的ID列表 - rqrq |
|
|
|
const ids = this.selectedRows.map(row => row.id) |
|
|
|
|
|
|
|
// 开始批量重试 - rqrq |
|
|
|
this.batchRetrying = true |
|
|
|
this.batchRetryTotal = ids.length |
|
|
|
this.batchRetryProgress = 0 |
|
|
|
|
|
|
|
// 调用后端批量重试接口 - rqrq |
|
|
|
batchRetryIfsCall({ ids }).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const successCount = data.successCount || 0 |
|
|
|
const failCount = data.failCount || 0 |
|
|
|
|
|
|
|
// 显示结果 - rqrq |
|
|
|
this.$alert( |
|
|
|
`批量重试完成!<br/>成功:<span style="color: #67C23A; font-weight: bold;">${successCount}</span> 条<br/>失败:<span style="color: #F56C6C; font-weight: bold;">${failCount}</span> 条`, |
|
|
|
'重试结果', |
|
|
|
{ |
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
confirmButtonText: '确定' |
|
|
|
} |
|
|
|
) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '批量重试失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error('批量重试失败:', error) |
|
|
|
this.$alert('批量重试失败,请稍后再试', '错误', { confirmButtonText: '确定' }) |
|
|
|
}).finally(() => { |
|
|
|
// 重试完成,重置状态 - rqrq |
|
|
|
this.batchRetrying = false |
|
|
|
this.batchRetryProgress = 0 |
|
|
|
this.batchRetryTotal = 0 |
|
|
|
this.selectedRows = [] |
|
|
|
// 刷新列表 - rqrq |
|
|
|
this.getDataList() |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
// 用户取消操作 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleRetry(row) { |
|
|
|
// 检查是否有批量重试正在进行 - rqrq |
|
|
|
if (this.batchRetrying) { |
|
|
|
this.$message.warning('批量重试进行中,请等待完成') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 检查是否有其他行正在重试 - rqrq |
|
|
|
if (this.retryingRowId !== null) { |
|
|
|
this.$message.warning('请等待当前重试完成后再操作') |
|
|
|
|