diff --git a/static/modules/home.js b/static/modules/home.js index 3012885..5574e15 100644 --- a/static/modules/home.js +++ b/static/modules/home.js @@ -7,11 +7,14 @@ function renderHome() { // 回款提醒 const yrRev = m.revenue_annual || 0, yrPay = m.payment_annual || 0, yrUnpaid = yrRev - yrPay; const yrPayRate = yrRev > 0 ? Math.round(yrPay / yrRev * 100) : 0; - const yrUnpaidWan = Math.round(yrUnpaid / 10000); + const yrUnpaidWan = Math.round(Math.abs(yrUnpaid) / 10000); const payRateCls = yrPayRate < 30 ? 'text-red-600' : yrPayRate < 80 ? 'text-amber-600' : 'text-green-600'; + const unpaidLabel = yrUnpaid >= 0 + ? '你还有 ' + yrUnpaidWan + '万 未回款' + : '超额回款 ' + yrUnpaidWan + '万'; const payReminder = yrRev > 0 ? '
' + '' + - '回款提醒:本年度确收 ' + moneyInt(yrRev) + ',回款 ' + moneyInt(yrPay) + ',你还有 ' + yrUnpaidWan + '万 未回款,当前回款率:' + yrPayRate + '%' + + '回款提醒:本年度确收 ' + moneyInt(yrRev) + ',回款 ' + moneyInt(yrPay) + ',' + unpaidLabel + ',当前回款率:' + yrPayRate + '%' + '
' : ''; const rows1 = [ ["年度累计", moneyInt(m.signed_annual || m.signed_amount)], diff --git a/templates/index.html b/templates/index.html index 5ed371b..c8e0cf3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -76,7 +76,7 @@
-

OPC Manager v1.0.0.9

+

OPC Manager v1.0.0.10

科普 OPC 工作台