diff --git a/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue b/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue index 8d42779..b7725de 100644 --- a/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue +++ b/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue @@ -983,6 +983,44 @@ export default { } }, 2000); // 每2秒轮询一次 }, + /** 查询失败记录列表 */ + getFailureList() { + this.failureLoading = true; + getImportFailures( + this.currentTaskId, + this.failureQueryParams.pageNum, + this.failureQueryParams.pageSize + ).then(response => { + this.failureList = response.rows; + this.failureTotal = response.total; + this.failureLoading = false; + }).catch(error => { + this.failureLoading = false; + + // 处理不同类型的错误 + if (error.response) { + const status = error.response.status; + + if (status === 404) { + // 记录不存在或已过期 + this.$modal.msgWarning('导入记录已过期,无法查看失败记录'); + this.clearImportTaskFromStorage(); + this.showFailureButton = false; + this.currentTaskId = null; + this.failureDialogVisible = false; + } else if (status === 500) { + this.$modal.msgError('服务器错误,请稍后重试'); + } else { + this.$modal.msgError(`查询失败: ${error.response.data.msg || '未知错误'}`); + } + } else if (error.request) { + // 请求发送了但没有收到响应 + this.$modal.msgError('网络连接失败,请检查网络'); + } else { + this.$modal.msgError('查询失败记录失败: ' + error.message); + } + }); + }, /** 查看导入失败记录 */ viewImportFailures() { this.failureDialogVisible = true;