fix(web): EQD-5320 批量发送确认书按钮点击无反应——$.ajax原无error回调,/trs_hub_api代理不通/超时/返回非JSON(如被登录页重定向)时完全静默;补error回调给HTTP状态+排查指引(控制台同步详错),success兜底非标准返回结构并提示笔数,成功后刷新列表;232/232前端测试通过

This commit is contained in:
hjhan
2026-08-21 09:16:28 +08:00
parent 640c78b5a9
commit 433bca9530
@@ -176,12 +176,22 @@ function SendEmailEitherReport() {
dataType: "json",
contentType:"application/json",
success: function (res) {
if (res.success) {
main.message("发送成功");
// 代理/网关异常时可能返回非标准结构——统一兜底提示,绝不让点击"无反应"
if (res && res.success) {
main.message("发送成功(共" + selIds.length + "笔),详情见bond-oms日志[结算确认书邮件]");
SearchClick(); // 刷新列表以反映发送状态
} else {
main.message(res.message);
var msg = (res && (res.message || res.msg)) || "发送失败:服务返回异常结构";
main.message(msg);
console.error("[批量发送确认书] 业务失败:", res);
}
},
error: function (xhr, textStatus, errThrown) {
// 请求层失败:代理不通/超时/返回非JSON(如被登录页重定向)——此前无error回调导致点击"毫无反应"
var detail = "HTTP " + xhr.status + " " + (textStatus || "") + (errThrown ? " " + errThrown : "");
main.message("发送请求失败(" + detail + "):请检查服务是否可用(含/trs_hub_api代理),详情见控制台与网络面板");
console.error("[批量发送确认书] 请求失败:", detail, xhr);
},
beforeSend(jqXHR) {
main.waitMe(true);
},