diff --git a/web/app.js b/web/app.js
index 39c4036..64ee979 100644
--- a/web/app.js
+++ b/web/app.js
@@ -3395,7 +3395,7 @@ function yuanToWan(value) {
return n / 10000;
}
-function formatWan(value, { signed = false } = {}) {
+function formatWanHtml(value, { signed = false } = {}) {
const wan = yuanToWan(value);
if (wan === null) return "—";
const abs = Math.abs(wan).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
@@ -3472,13 +3472,13 @@ function renderWorkspaceTransfersCard(summary) {
const net = $("#wsTfNet");
const pendingEl = $("#wsTfPending");
const netLabel = $("#wsTfNetLabel");
- if (inflow) inflow.innerHTML = formatWan(confirmed.inflow_total, { signed: true });
+ if (inflow) inflow.innerHTML = formatWanHtml(confirmed.inflow_total, { signed: true });
if (outflow) {
- outflow.innerHTML = formatWan(
+ outflow.innerHTML = formatWanHtml(
confirmed.outflow_total != null ? -Math.abs(Number(confirmed.outflow_total)) : null,
{ signed: true },
);
- // formatWan with negative value already adds −; ensure unit
+ // formatWanHtml with negative value already adds −; ensure unit
if (confirmed.outflow_total != null) {
const wan = yuanToWan(confirmed.outflow_total);
const abs = Math.abs(wan).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
@@ -3488,12 +3488,12 @@ function renderWorkspaceTransfersCard(summary) {
if (netLabel) netLabel.textContent = `${netLabelForWindow(win)}${netMeta.label !== "持平" ? ` · ${netMeta.label}` : ""}`;
if (net) {
net.className = `ms-value ${netMeta.signedClass}`.trim();
- net.innerHTML = formatWan(confirmed.net_change, { signed: true });
+ net.innerHTML = formatWanHtml(confirmed.net_change, { signed: true });
}
if (pendingEl) {
const pCount = Number(pending.count) || 0;
pendingEl.innerHTML = pCount
- ? `${formatWan(pending.amount_total)} · ${pCount} 笔`
+ ? `${formatWanHtml(pending.amount_total)} · ${pCount} 笔`
: `0.00万元 · 0 笔`;
}
}
@@ -3564,7 +3564,7 @@ function renderTransfersOverview(summary) {
const netFoot = $("#tfStatNetFoot");
const netMeta = netDirectionMeta(confirmed.net_change, confirmed.net_direction);
if (companies) companies.innerHTML = `${cps.length}家`;
- if (inflow) inflow.innerHTML = formatWan(confirmed.inflow_total, { signed: true });
+ if (inflow) inflow.innerHTML = formatWanHtml(confirmed.inflow_total, { signed: true });
if (outflow) {
const wan = yuanToWan(confirmed.outflow_total);
const abs = wan === null ? "—" : Math.abs(wan).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
@@ -3575,7 +3575,7 @@ function renderTransfersOverview(summary) {
const tag = netMeta.label !== "持平"
? ` ${netMeta.label}`
: "";
- net.innerHTML = `${formatWan(confirmed.net_change, { signed: true })}${tag}`;
+ net.innerHTML = `${formatWanHtml(confirmed.net_change, { signed: true })}${tag}`;
}
if (netFoot) {
netFoot.textContent = win.has_opening
@@ -3589,7 +3589,7 @@ function renderTransfersOverview(summary) {
const tfPendingCount = $("#tfPendingCount");
const tfPendingAmount = $("#tfPendingAmount");
if (tfConfirmedCount) tfConfirmedCount.textContent = `${confirmedCount} 笔`;
- if (tfConfirmedNet) tfConfirmedNet.innerHTML = formatWan(confirmed.net_change, { signed: true });
+ if (tfConfirmedNet) tfConfirmedNet.innerHTML = formatWanHtml(confirmed.net_change, { signed: true });
const openingCard = $("#tfStatOpeningCard");
const endingCard = $("#tfStatEndingCard");
const openingEl = $("#tfStatOpening");
@@ -3597,15 +3597,15 @@ function renderTransfersOverview(summary) {
if (win.has_opening) {
if (openingCard) openingCard.hidden = false;
if (endingCard) endingCard.hidden = false;
- if (openingEl) openingEl.innerHTML = formatWan(win.opening, { signed: true });
- if (endingEl) endingEl.innerHTML = formatWan(win.ending, { signed: true });
+ if (openingEl) openingEl.innerHTML = formatWanHtml(win.opening, { signed: true });
+ if (endingEl) endingEl.innerHTML = formatWanHtml(win.ending, { signed: true });
} else {
if (openingCard) openingCard.hidden = true;
if (endingCard) endingCard.hidden = true;
}
if (tfPendingCount) tfPendingCount.textContent = `${pCount} 笔`;
- if (tfPendingAmount) tfPendingAmount.innerHTML = formatWan(pending.amount_total || 0);
+ if (tfPendingAmount) tfPendingAmount.innerHTML = formatWanHtml(pending.amount_total || 0);
const tbody = $("#transfersCpBody");
const tfoot = $("#transfersCpFoot");
@@ -3706,7 +3706,7 @@ async function openTransfersDetail(companyId, companyName, { keepFilters = false
$("#tfDetailCount").innerHTML = `—`;
$("#tfDetailCountFoot").textContent = pendingN ? `其中待确认 ${pendingN} 笔(汇总)` : "按筛选加载明细";
if (cp) {
- $("#tfDetailIn").innerHTML = formatWan(cp.confirmed_inflow, { signed: true });
+ $("#tfDetailIn").innerHTML = formatWanHtml(cp.confirmed_inflow, { signed: true });
const wan = yuanToWan(cp.confirmed_outflow);
$("#tfDetailOut").innerHTML = wan === null
? "—"