From e38413cb2e8a446dca2c503cc8b6138f618fb192 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Sun, 8 Feb 2026 14:00:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(purchase-transaction):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0getFailureList=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调用API获取失败记录列表 - 支持分页查询 - 完善错误处理机制: - 404: 记录过期,清除本地状态 - 500: 服务器错误提示 - 网络错误: 检查网络连接 - 其他错误: 显示详细错误信息 Co-Authored-By: Claude Sonnet 4.5 --- .../views/ccdiPurchaseTransaction/index.vue | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) 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;