@@ -1018,7 +1015,7 @@ function renderPlanOverview() {
if (window.lucide) window.lucide.createIcons();
// 渲染图表(复用 home.js 的 moneyTick / chartOptions / monthLabels)
if (financeMonthly && window.Chart) {
- renderOverviewCharts(financeMonthly);
+ renderPlanCharts(financeMonthly);
}
}
@@ -1028,22 +1025,22 @@ function renderPlanCharts(data) {
const baseOpts = typeof chartOptions === 'function' ? chartOptions(moneyTick) : { responsive: true, maintainAspectRatio: false };
var iconf = { type: "line", options: baseOpts, data: { labels: labels } };
- var c1 = document.querySelector("#finChartSign");
+ var c1 = document.querySelector("#planChartSign");
if (c1 && window.Chart) {
if (state.planChart1) state.planChart1.destroy();
state.planChart1 = new Chart(c1, Object.assign({}, iconf, { data: { labels: labels, datasets: [{ label: "签约金额", data: data.map(function(x) { return x.sign || 0; }), borderColor: "#6366f1", backgroundColor: "rgba(99,102,241,0.06)", fill: true, tension: 0.3 }] } }));
}
- var c2 = document.querySelector("#finChartRev");
+ var c2 = document.querySelector("#planChartRev");
if (c2 && window.Chart) {
if (state.planChart2) state.planChart2.destroy();
state.planChart2 = new Chart(c2, Object.assign({}, iconf, { data: { labels: labels, datasets: [{ label: "确收", data: data.map(function(x) { return x.revenue || 0; }), borderColor: "#2563eb", backgroundColor: "rgba(37,99,235,0.06)", fill: true, tension: 0.3 }, { label: "毛利", data: data.map(function(x) { return x.gross || 0; }), borderColor: "#059669", backgroundColor: "rgba(5,150,105,0.06)", fill: true, tension: 0.3 }] } }));
}
- var c3 = document.querySelector("#finChartCash");
+ var c3 = document.querySelector("#planChartCash");
if (c3 && window.Chart) {
if (state.planChart3) state.planChart3.destroy();
state.planChart3 = new Chart(c3, Object.assign({}, iconf, { data: { labels: labels, datasets: [{ label: "回款", data: data.map(function(x) { return x.payment || 0; }), borderColor: "#d97706", backgroundColor: "rgba(217,119,6,0.06)", fill: true, tension: 0.3 }, { label: "已付", data: data.map(function(x) { return x.cost || 0; }), borderColor: "#7c3aed", backgroundColor: "rgba(124,58,237,0.06)", fill: true, tension: 0.3 }] } }));
}
- var c4 = document.querySelector("#finChartProfit");
+ var c4 = document.querySelector("#planChartProfit");
if (c4 && window.Chart) {
if (state.planChart4) state.planChart4.destroy();
state.planChart4 = new Chart(c4, Object.assign({}, iconf, { data: { labels: labels, datasets: [{ label: "利润", data: data.map(function(x) { return x.gross || 0; }), borderColor: "#6366f1", backgroundColor: "rgba(99,102,241,0.06)", fill: true, tension: 0.3 }] } }));
diff --git a/static/modules/utils.js b/static/modules/utils.js
index 45a04c1..79178b4 100644
--- a/static/modules/utils.js
+++ b/static/modules/utils.js
@@ -204,6 +204,8 @@ window.setFinView = (view) => {
state.finView = view;
renderFinance();
};
+window.setFinQuarter = (q) => { state.finQuarter = q; state.finView = 'quarterly'; renderFinance(); };
+window.setFinMonth = (month) => { state.finMonth = month; state.finView = 'monthly'; renderFinance(); };
window.switchFinFilter = (filter) => {
state.finFilter = filter;
state.finSort = null;
@@ -220,6 +222,8 @@ window.setPlanView = (view) => {
state.planView = view;
renderPlan();
};
+window.setPlanQuarter = (q) => { state.planQuarter = q; state.planView = 'quarterly'; renderPlan(); };
+window.setPlanMonth = (month) => { state.planMonth = month; state.planView = 'monthly'; renderPlan(); };
window.switchPlanFilter = (filter) => {
state.planFilter = filter;
state.planSort = null;
diff --git a/templates/index.html b/templates/index.html
index 17abc36..a2090c3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -80,7 +80,7 @@
-
OPC Manager v1.0.0.23
+
OPC Manager v1.0.0.24