diff --git a/static/modules/plan.js b/static/modules/plan.js
index 7dd85de..62f2324 100644
--- a/static/modules/plan.js
+++ b/static/modules/plan.js
@@ -109,7 +109,7 @@ function renderPlan() {
const activeQ = state.planQuarter !== undefined ? state.planQuarter : Math.floor(nowD.getMonth() / 3);
const activeMonths = qMonths[activeQ];
const yearOpts = [2024,2025,2026,2027];
- const finHeaderBase = `
|年份:|季度:${qLabels.map((q,i) => ``).join('')}|月度:${activeMonths.map(m => { const ms = `${state.planYear}-${String(m).padStart(2,'0')}`; return ``; }).join('')}
`;
+ const finHeaderBase = `|年份:|季度:${qLabels.map((q,i) => ``).join('')}|月度:${activeMonths.map(m => { const ms = `${state.planYear}-${String(m).padStart(2,'0')}`; return ``; }).join('')}|
`;
const finAddBtn = ``;
const isOverviewMode = false;
@@ -345,6 +345,21 @@ function renderPlan() {
};
const fmtNoUnit = (v) => v ? `${Number(v||0).toLocaleString('zh-CN')}` : '—';
+
+ // 状态过滤函数
+ const filterByStatus = (items) => {
+ var sf = state.planStatusFilter || 'all';
+ if (sf === 'all') return items;
+ return items.filter(d => {
+ if (sf === 'unsigned') return (d.pf.project_type || '待签约') === '待签约';
+ if (sf === 'signed') return (d.pf.project_type || '待签约') === '已签约';
+ if (sf === 'paymentonly') {
+ return (!d.rev && !d.gross && !d.payment) && (d.cost || d.paid);
+ }
+ return true;
+ });
+ };
+
const tdRow = (pf, rev, payment, cost, paid, gross) => {
const cashflow = payment - paid;
const payRVal = rev && payment ? Math.round(payment / rev * 100) : null;
@@ -422,7 +437,7 @@ function renderPlan() {
});
});
var sortK = state.planSort && state.planSort.key ? state.planSort.key.split('|')[1] : null;
- dataItems = sortData(dataItems, sortK);
+ dataItems = filterByStatus(sortData(dataItems, sortK));
const rows = [];
let sumRev = 0, sumPay = 0, sumCost = 0, sumPaid = 0, sumGross = 0;
dataItems.forEach(d => {
@@ -477,7 +492,7 @@ function renderPlan() {
});
});
var sortK = state.planSort && state.planSort.key ? state.planSort.key.split('|')[1] : null;
- dataItems = sortData(dataItems, sortK);
+ dataItems = filterByStatus(sortData(dataItems, sortK));
let sumRev = 0, sumPay = 0, sumCost = 0, sumPaid = 0, sumGross = 0;
const rows = [];
dataItems.forEach(d => {
@@ -518,7 +533,7 @@ function renderPlan() {
});
var sortK = null;
if (state.planSort && state.planSort.key && state.planSort.key.startsWith('sig|')) sortK = state.planSort.key.split('|')[1];
- dataItems = sortData(dataItems, sortK);
+ dataItems = filterByStatus(sortData(dataItems, sortK));
let sumRev = 0, sumPay = 0, sumCost = 0, sumPaid = 0, sumGross = 0;
const rows = [];
dataItems.forEach(d => {
diff --git a/static/modules/utils.js b/static/modules/utils.js
index a66393c..8bdc3b9 100644
--- a/static/modules/utils.js
+++ b/static/modules/utils.js
@@ -14,6 +14,7 @@ const state = {
planFilter: "projects",
planYear: new Date().getFullYear(),
finYear: new Date().getFullYear(),
+ planStatusFilter: "all",
planView: "overview",
planSort: null,
proposalTab: "standard",
@@ -355,6 +356,7 @@ window.setPlanView = (view) => {
window.setPlanQuarter = (q) => { state.planQuarter = q; state.planView = 'quarterly'; renderPlan(); };
window.setPlanMonth = (month) => { state.planMonth = month; state.planView = 'monthly'; renderPlan(); };
window.setPlanYear = (year) => { state.planYear = parseInt(year); renderPlan(); };
+window.setPlanStatusFilter = (filter) => { state.planStatusFilter = filter; renderPlan(); };
window.switchPlanFilter = (filter) => {
state.planFilter = filter;
state.planSort = null;
diff --git a/templates/index.html b/templates/index.html
index ca4abb0..b00988d 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -76,7 +76,7 @@
-
OPC Manager v1.2.0.16
+
OPC Manager v1.2.0.17