diff --git a/static/modules/home.js b/static/modules/home.js
index 5574e15..04daa11 100644
--- a/static/modules/home.js
+++ b/static/modules/home.js
@@ -126,8 +126,7 @@ function renderHome() {
].map(([label, value, tab]) => ``).join("")}
`}
${payReminder}
- ${card(`
部门经营情况
| 指标 | 年度累计 | 上季度累计 | 上月累计 | 本季度累计 | 季环比 | 本月累计 | 月环比 |
- ${(() => {
+ ${(() => {
var d = [
['项目毛利', [m.profit_annual||0, m.profit_q2||0, m.profit_month||0, m.profit_prev_q||0, m.profit_prev_month||0],
[m.profit_q2||0,m.profit_prev_q||0], [m.profit_month||0,m.profit_prev_month||0]],
@@ -148,22 +147,27 @@ function renderHome() {
['部门现金流', [m.dept_cf_annual||0, m.dept_cf_q2||0, m.dept_cf_month||0, m.dept_cf_prev_q||0, m.dept_cf_prev_month||0],
[m.dept_cf_q2||0,m.dept_cf_prev_q||0], [m.dept_cf_month||0,m.dept_cf_prev_month||0]]
];
- var h = '';
- var netCls = function(di, raw) { if (di === 2 || di === 5) return raw >= 0 ? 'text-green-600' : 'text-red-600'; if (di === 3) return raw >= 0 ? 'text-green-600' : 'text-red-600'; return 'text-slate-800'; };
- for (var di = 0; di < 6; di++) {
- var r = d[di];
- h += '| ' + r[0] + ' | ' +
- '' + moneyInt(r[1][0]) + ' | ' +
- '' + moneyInt(r[1][3]) + ' | ' +
- '' + moneyInt(r[1][4]) + ' | ' +
- '' + moneyInt(r[1][1]) + ' | ' +
- '' + qoq(r[2][0], r[2][1]) + ' | ' +
- '' + moneyInt(r[1][2]) + ' | ' +
- '' + qoq(r[3][0], r[3][1]) + ' |
';
- }
- return h;
+ var buildDeptTable = function(title, dataRows) {
+ var h = '';
+ for (var di = 0; di < dataRows.length; di++) {
+ var r = dataRows[di];
+ var rawNet = r[1][0];
+ var isNet = r[0] === '部门净利' || r[0] === '部门现金流';
+ var isCF = r[0] === '项目现金流';
+ var cls = isNet ? (rawNet >= 0 ? 'text-green-600' : 'text-red-600') : isCF ? (rawNet >= 0 ? 'text-green-600' : 'text-red-600') : 'text-slate-800';
+ h += '| ' + r[0] + ' | ' +
+ '' + moneyInt(r[1][0]) + ' | ' +
+ '' + moneyInt(r[1][3]) + ' | ' +
+ '' + moneyInt(r[1][4]) + ' | ' +
+ '' + moneyInt(r[1][1]) + ' | ' +
+ '' + qoq(r[2][0], r[2][1]) + ' | ' +
+ '' + moneyInt(r[1][2]) + ' | ' +
+ '' + qoq(r[3][0], r[3][1]) + ' |
';
+ }
+ return card('' + title + '
| 指标 | 年度累计 | 上季度累计 | 上月累计 | 本季度累计 | 季环比 | 本月累计 | 月环比 |
' + h + '
', 'p-4');
+ };
+ return buildDeptTable('部门经营情况', d.slice(0, 3)) + buildDeptTable('部门现金流', d.slice(3, 6));
})()}
-
`, "p-4")}
${card(`业务(项目)财务概览
合同 → 确收 → 毛利 → 成本 → 项目利润 → 回款 → 已付 → 现金流
`, "p-4")}
${card(`
月度签约趋势
2026`, "p-4")}
diff --git a/templates/index.html b/templates/index.html
index c8e0cf3..86e1248 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -76,7 +76,7 @@
-
OPC Manager v1.0.0.10
+
OPC Manager v1.0.0.11