Browse Source

fix(warehouse): 解决IFS调用错误日志重试功能并发问题

- 使用全局重试状态控制按钮,避免多行同时重试
- 添加retryingRowId变量跟踪当前正在重试的行ID
- 重试时检查是否有其他行正在重试并显示警告提示
- 优化重试按钮的加载和禁用状态逻辑
- 完善重试过程中的UI反馈和状态同步
master
常熟吴彦祖 13 hours ago
parent
commit
55fb956c73
  1. 34
      src/views/modules/warehouse/ifsCallErrorLog.vue

34
src/views/modules/warehouse/ifsCallErrorLog.vue

@ -118,15 +118,16 @@
@click="showDetailDialog(scope.row)">
查看详情
</el-button>
<!-- rqrq - 使用全局重试状态控制按钮 -->
<el-button
v-if="scope.row.processStatus === 'PENDING'"
type="text"
size="small"
style="color: #E6A23C;"
:loading="scope.row._retrying"
:disabled="scope.row._retrying"
:loading="retryingRowId === scope.row.id"
:disabled="retryingRowId !== null"
@click="handleRetry(scope.row)">
{{ scope.row._retrying ? '重试中...' : '重试' }}
{{ retryingRowId === scope.row.id ? '重试中...' : '重试' }}
</el-button>
<span v-else>-</span>
</span>
@ -142,7 +143,21 @@
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="showDetailDialog(scope.row)">查看详情</a>
<a type="text" size="small" v-if="scope.row.processStatus === 'PENDING'" @click="handleRetry(scope.row)">重试</a>
<!-- rqrq - 当前行正在重试时显示"重试中..." -->
<span
v-if="scope.row.processStatus === 'PENDING' && retryingRowId === scope.row.id"
style="color: #E6A23C; margin-left: 10px;">重试中...</span>
<!-- rqrq - 其他行有重试时显示禁用状态的重试按钮 -->
<span
v-else-if="scope.row.processStatus === 'PENDING' && retryingRowId !== null"
style="color: #C0C4CC; margin-left: 10px; cursor: not-allowed;"
@click="handleRetry(scope.row)">重试</span>
<!-- rqrq - 没有重试时显示正常的重试按钮 -->
<a
type="text"
size="small"
v-else-if="scope.row.processStatus === 'PENDING'"
@click="handleRetry(scope.row)">重试</a>
<!-- <a type="text" size="small" v-if="scope.row.processStatus === 'PENDING'" @click="closeRetry(scope.row)">忽略</a>-->
</template>
</el-table-column>
@ -493,6 +508,7 @@ export default {
processRemark: '',
markProcessedLoading: false,
markIgnoredLoading: false,
retryingRowId: null, // ID - rqrq
// - rqrq
exportData: [],
exportName: 'IFS错误日志' + this.dayjs().format('YYYYMMDDHHmmss'),
@ -689,12 +705,19 @@ export default {
// IFS - rqrq
handleRetry(row) {
// - rqrq
if (this.retryingRowId !== null) {
this.$message.warning('请等待当前重试完成后再操作')
return
}
this.$confirm('确定要重试此记录的IFS接口调用吗?', '确认重试', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// loading - rqrq
// - rqrq
this.retryingRowId = row.id
this.$set(row, '_retrying', true)
const params = {
@ -719,6 +742,7 @@ export default {
}).finally(() => {
// loading - rqrq
this.$set(row, '_retrying', false)
this.retryingRowId = null
})
}).catch(() => {
//

Loading…
Cancel
Save