Compare commits
120 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd4baffc28 | ||
|
|
2e5704a615 | ||
|
|
65f1487add | ||
|
|
d4fb9a0349 | ||
|
|
056933110d | ||
|
|
56b8bfbf84 | ||
|
|
ad4f6a7c20 | ||
|
|
d3a7252e26 | ||
|
|
21b5c40626 | ||
|
|
3930451ce8 | ||
|
|
e2a421cde7 | ||
|
|
aa3ec75179 | ||
|
|
4ad19d438f | ||
|
|
30b1a50490 | ||
|
|
01718e9acc | ||
|
|
87f0abbbd8 | ||
|
|
c2ed20caeb | ||
|
|
a3f269046d | ||
|
|
ec062fb2ec | ||
|
|
c4af452115 | ||
|
|
8c318fb3ad | ||
|
|
9c2beee51e | ||
|
|
6a582c65b8 | ||
|
|
3fff80425b | ||
|
|
02abe41793 | ||
|
|
f30d40fe70 | ||
|
|
eb300731a3 | ||
|
|
67bc00314c | ||
|
|
d34e52eff4 | ||
|
|
8e38f50c99 | ||
|
|
3a40e78c3e | ||
|
|
a1a4f41d79 | ||
|
|
d4889d56ec | ||
|
|
35706f123d | ||
|
|
e4d1cd59f3 | ||
|
|
1673603b02 | ||
|
|
db93eb8d31 | ||
|
|
94ad7aed55 | ||
|
|
043938670a | ||
|
|
9862d9fe56 | ||
|
|
150e627811 | ||
|
|
295bf5a81c | ||
|
|
e8a26059d5 | ||
|
|
543d620384 | ||
|
|
975034c589 | ||
|
|
71e90bd55f | ||
|
|
3042791a90 | ||
|
|
a8243acc5a | ||
|
|
cb0e3fdac2 | ||
|
|
f5c92d09af | ||
|
|
e18626105b | ||
|
|
b587530437 | ||
|
|
9a1260db68 | ||
|
|
7c33bc05f2 | ||
|
|
9de0a63be2 | ||
|
|
f3c94c57d6 | ||
|
|
9db627770b | ||
|
|
75b988c77a | ||
|
|
2b7f67436e | ||
|
|
ed5455f309 | ||
|
|
452d410843 | ||
|
|
c95373b85e | ||
|
|
6be10481d5 | ||
|
|
4ce0e66d90 | ||
|
|
0f9e1b6cf2 | ||
|
|
dc8d3d59d2 | ||
|
|
1e5c5b5706 | ||
|
|
b68144ebb0 | ||
|
|
3cae1d85cf | ||
|
|
ca0cd9eab1 | ||
|
|
2bdc0e0779 | ||
|
|
93dca56c3f | ||
|
|
8c4f50fc52 | ||
|
|
13864f1968 | ||
|
|
d11e8f9313 | ||
|
|
02a12a208c | ||
|
|
b977627895 | ||
|
|
edf8e6179c | ||
|
|
3148af05b3 | ||
|
|
4029933ada | ||
|
|
95d3f9809c | ||
|
|
8b040489e2 | ||
|
|
db9700c8ee | ||
|
|
11e30f33b9 | ||
|
|
95f52b61d0 | ||
|
|
a4012f2189 | ||
|
|
e1c5e65c1e | ||
|
|
a3d78b3ca0 | ||
|
|
9dc5631574 | ||
|
|
c5a59508d2 | ||
|
|
ab1d57492c | ||
|
|
9a81a30feb | ||
|
|
d6d21b03dd | ||
|
|
b9a05e8732 | ||
|
|
440707e19a | ||
|
|
e0dc1a56b2 | ||
|
|
f45afd954d | ||
|
|
664da22329 | ||
|
|
73a6ac126c | ||
|
|
878e26d4ca | ||
|
|
e12ed0936b | ||
|
|
8edb74f173 | ||
|
|
1a42c6e6f3 | ||
|
|
d21497bce3 | ||
|
|
574e3c5700 | ||
|
|
c70293b447 | ||
|
|
adeff08827 | ||
|
|
8bd40de41d | ||
|
|
ac6eacea82 | ||
|
|
83c2a5ca94 | ||
|
|
fbd2290d29 | ||
|
|
97fcf88c61 | ||
|
|
a01afef599 | ||
|
|
28fa244fe5 | ||
|
|
ad3885e0be | ||
|
|
0fb7ee2992 | ||
|
|
f6792cad39 | ||
|
|
bed6e9192a | ||
|
|
aaa213a765 | ||
|
|
207629a9bb |
@@ -53,3 +53,4 @@ curl http://127.0.0.1:5177/api/health
|
|||||||
- 产品:慰心斋产品路线图中的 5 个产品版本
|
- 产品:慰心斋产品路线图中的 5 个产品版本
|
||||||
- 财务:首版财务样例和原财务 manager 合并方向
|
- 财务:首版财务样例和原财务 manager 合并方向
|
||||||
|
|
||||||
|
# test trigger
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ function openDrawer(resource, id) {
|
|||||||
const fields = resource === "sales"
|
const fields = resource === "sales"
|
||||||
? [["target_customer","业务机会"],["priority","优先级"],["status","状态"]]
|
? [["target_customer","业务机会"],["priority","优先级"],["status","状态"]]
|
||||||
: resource === "operations"
|
: resource === "operations"
|
||||||
? [["project_name","项目名称"],["owner","负责人"],["expected_sign_date","截止时间"],["expected_contract_amount","金额"],["notes","项目说明"]]
|
? [["project_name","项目名称"],["notes","项目说明"]]
|
||||||
: resource === "proposals"
|
: resource === "proposals"
|
||||||
? [["customer_or_project_name","客户/项目"],["proposal_type","方案类型"],["notes","备注"]]
|
? [["customer_or_project_name","客户/项目"],["proposal_type","方案类型"],["notes","备注"]]
|
||||||
: [["product_name","版本名称"],["version","版本号"],["priority","优先级"],["version_goal","版本目标"],["start_date","启动时间"],["plan_date","产品方案"],["dev_done_date","研发完成"],["test_date","测试完成"],["launch_date","上线时间"],["notes","进展备注"]];
|
: [["product_name","版本名称"],["version","版本号"],["priority","优先级"],["version_goal","版本目标"],["start_date","启动时间"],["plan_date","产品方案"],["dev_done_date","研发完成"],["test_date","测试完成"],["launch_date","上线时间"],["notes","进展备注"]];
|
||||||
@@ -36,7 +36,7 @@ function openDrawer(resource, id) {
|
|||||||
test_date: "bug", devs: "users", testers: "shield-check"
|
test_date: "bug", devs: "users", testers: "shield-check"
|
||||||
};
|
};
|
||||||
const multilineFields = ["customer_need", "current_deliverable", "risks", "next_action", "version_goal", "feature_list", "notes"];
|
const multilineFields = ["customer_need", "current_deliverable", "risks", "next_action", "version_goal", "feature_list", "notes"];
|
||||||
const followupTarget = resource === "sales" ? "sales" : resource === "proposals" ? "proposal" : resource === "operations" ? "operation" : resource === "products" ? "product" : "";
|
const followupTarget = resource === "sales" ? "sales" : resource === "proposals" ? "proposal" : resource === "products" ? "product" : "";
|
||||||
const title = esc(item.target_customer || item.project_name || (item.customer_or_project_name ? `${item.customer_or_project_name} · ${item.proposal_type || ''}` : "") || item.product_name);
|
const title = esc(item.target_customer || item.project_name || (item.customer_or_project_name ? `${item.customer_or_project_name} · ${item.proposal_type || ''}` : "") || item.product_name);
|
||||||
const titleForAttr = esc(item.target_customer || item.project_name || (item.customer_or_project_name ? `${item.customer_or_project_name} · ${item.proposal_type || ''}` : "") || item.product_name);
|
const titleForAttr = esc(item.target_customer || item.project_name || (item.customer_or_project_name ? `${item.customer_or_project_name} · ${item.proposal_type || ''}` : "") || item.product_name);
|
||||||
drawer.innerHTML = `<div class="drawer-panel"><div class="sticky top-0 z-10 flex items-center justify-between border-b border-slate-200 bg-white/95 px-5 py-3 backdrop-blur"><div><p class="text-[10px] font-semibold uppercase tracking-[0.18em] text-slate-400">Detail Drawer</p><div class="flex items-center gap-2"><h2 class="drawer-title text-[17px] font-semibold leading-6 text-slate-900">${title}</h2><span id="drawerSaveStatus" class="save-status"></span></div></div><div class="flex items-center gap-2"><button class="btn btn-ghost btn-sm text-red-600 hover:bg-red-50" onclick="deleteDrawerItem('${resource}', ${id})"><i data-lucide="trash-2"></i>删除</button><button class="btn btn-ghost btn-sm" onclick="closeDrawer()">关闭</button></div></div><div class="grid gap-5 p-5">
|
drawer.innerHTML = `<div class="drawer-panel"><div class="sticky top-0 z-10 flex items-center justify-between border-b border-slate-200 bg-white/95 px-5 py-3 backdrop-blur"><div><p class="text-[10px] font-semibold uppercase tracking-[0.18em] text-slate-400">Detail Drawer</p><div class="flex items-center gap-2"><h2 class="drawer-title text-[17px] font-semibold leading-6 text-slate-900">${title}</h2><span id="drawerSaveStatus" class="save-status"></span></div></div><div class="flex items-center gap-2"><button class="btn btn-ghost btn-sm text-red-600 hover:bg-red-50" onclick="deleteDrawerItem('${resource}', ${id})"><i data-lucide="trash-2"></i>删除</button><button class="btn btn-ghost btn-sm" onclick="closeDrawer()">关闭</button></div></div><div class="grid gap-5 p-5">
|
||||||
|
|||||||
@@ -367,15 +367,21 @@ function renderFinance() {
|
|||||||
expenseArr.forEach(function(e) { allMonths[e.month || ''] = true; });
|
expenseArr.forEach(function(e) { allMonths[e.month || ''] = true; });
|
||||||
var detailRows = Object.keys(allMonths).filter(function(m) {
|
var detailRows = Object.keys(allMonths).filter(function(m) {
|
||||||
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
||||||
var exp = expenseArr.find(function(x) { return x.month === m; }) || {};
|
|
||||||
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
||||||
var eCost = parseFloat(exp.cost || 0), ePaid = parseFloat(exp.paid || 0);
|
var eCost = 0, ePaid = 0;
|
||||||
|
expenseArr.filter(function(x) { return x.month === m; }).forEach(function(e) {
|
||||||
|
eCost += parseFloat(e.cost || 0) || 0;
|
||||||
|
ePaid += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
return bRev || bGross || bPay || eCost || ePaid;
|
return bRev || bGross || bPay || eCost || ePaid;
|
||||||
}).sort().map(function(m) {
|
}).sort().map(function(m) {
|
||||||
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
||||||
var exp = expenseArr.find(function(x) { return x.month === m; }) || {};
|
var eCost = 0, ePaid = 0;
|
||||||
|
expenseArr.filter(function(x) { return x.month === m; }).forEach(function(e) {
|
||||||
|
eCost += parseFloat(e.cost || 0) || 0;
|
||||||
|
ePaid += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
||||||
var eCost = parseFloat(exp.cost || 0), ePaid = parseFloat(exp.paid || 0);
|
|
||||||
var bCf = bPay - ePaid;
|
var bCf = bPay - ePaid;
|
||||||
return '<tr class="bg-slate-50"><td class="px-2 py-px"></td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-slate-600">' + m + '</td><td class="px-2 py-px text-center text-xs text-brand-600">' + (bRev ? money(bRev) : '—') + '</td><td class="px-2 py-px text-center text-xs text-green-600">' + (bGross ? money(bGross) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-amber-600">' + (bPay ? money(bPay) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-rose-600">' + (eCost ? money(eCost) : '—') + '</td><td class="px-2 py-px text-center text-xs text-purple-600">' + (ePaid ? money(ePaid) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs ' + (bCf >= 0 ? 'text-green-600' : 'text-red-600') + '">' + (bCf ? money(bCf) : '—') + '</td><td class="px-2 py-px text-center text-xs ' + (bRev - bPay > 0 ? 'text-red-600' : bRev - bPay < 0 ? 'text-green-600' : 'text-slate-300') + '">' + (bRev - bPay ? money(bRev - bPay) : '—') + '</td></tr>';
|
return '<tr class="bg-slate-50"><td class="px-2 py-px"></td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-slate-600">' + m + '</td><td class="px-2 py-px text-center text-xs text-brand-600">' + (bRev ? money(bRev) : '—') + '</td><td class="px-2 py-px text-center text-xs text-green-600">' + (bGross ? money(bGross) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-amber-600">' + (bPay ? money(bPay) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-rose-600">' + (eCost ? money(eCost) : '—') + '</td><td class="px-2 py-px text-center text-xs text-purple-600">' + (ePaid ? money(ePaid) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs ' + (bCf >= 0 ? 'text-green-600' : 'text-red-600') + '">' + (bCf ? money(bCf) : '—') + '</td><td class="px-2 py-px text-center text-xs ' + (bRev - bPay > 0 ? 'text-red-600' : bRev - bPay < 0 ? 'text-green-600' : 'text-slate-300') + '">' + (bRev - bPay ? money(bRev - bPay) : '—') + '</td></tr>';
|
||||||
}).join('');
|
}).join('');
|
||||||
@@ -405,12 +411,16 @@ function renderFinance() {
|
|||||||
rev = Math.round(rev); payment = Math.round(payment); gross = Math.round(gross); cost = Math.round(cost); paid = Math.round(paid);
|
rev = Math.round(rev); payment = Math.round(payment); gross = Math.round(gross); cost = Math.round(cost); paid = Math.round(paid);
|
||||||
} else {
|
} else {
|
||||||
const b = bd.find(x => (x.month || "") === selMonth) || {};
|
const b = bd.find(x => (x.month || "") === selMonth) || {};
|
||||||
const e = ed.find(x => (x.month || "") === selMonth) || {};
|
let cost2 = 0, paid2 = 0;
|
||||||
|
ed.filter(x => (x.month || "") === selMonth).forEach(e => {
|
||||||
|
cost2 += parseFloat(e.cost || 0) || 0;
|
||||||
|
paid2 += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
rev = Math.round(parseFloat(b.rev || 0) || 0);
|
rev = Math.round(parseFloat(b.rev || 0) || 0);
|
||||||
payment = Math.round(parseFloat(b.payment || 0) || 0);
|
payment = Math.round(parseFloat(b.payment || 0) || 0);
|
||||||
gross = Math.round(parseFloat(b.gross || 0) || 0);
|
gross = Math.round(parseFloat(b.gross || 0) || 0);
|
||||||
cost = Math.round(parseFloat(e.cost || 0) || 0);
|
cost = Math.round(cost2);
|
||||||
paid = Math.round(parseFloat(e.paid || 0) || 0);
|
paid = Math.round(paid2);
|
||||||
}
|
}
|
||||||
if (!rev && !payment && !cost && !paid && !gross) return;
|
if (!rev && !payment && !cost && !paid && !gross) return;
|
||||||
dataItems.push({
|
dataItems.push({
|
||||||
|
|||||||
@@ -3,35 +3,93 @@ window.renderPerformance = () => {
|
|||||||
const data = state.data;
|
const data = state.data;
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
|
// 确保预算和已发生数据已加载
|
||||||
|
if (!data._perfDataLoaded) {
|
||||||
|
loadPerfData().then(() => { data._perfDataLoaded = true; renderPerformance(); });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 状态初始化 ──
|
||||||
|
if (state.planYear == null) state.planYear = new Date().getFullYear();
|
||||||
|
const planYear = state.planYear;
|
||||||
|
if (!['annual','quarterly','monthly'].includes(state.perfView)) state.perfView = 'quarterly';
|
||||||
if (state.perfQuarter === undefined) state.perfQuarter = Math.floor(new Date().getMonth() / 3);
|
if (state.perfQuarter === undefined) state.perfQuarter = Math.floor(new Date().getMonth() / 3);
|
||||||
const q = state.perfQuarter;
|
const nowD = new Date();
|
||||||
const qLabel = ['Q1 (1-3月)', 'Q2 (4-6月)', 'Q3 (7-9月)', 'Q4 (10-12月)'];
|
const activeQ = state.perfQuarter;
|
||||||
|
|
||||||
const qRanges = [[1,2,3],[4,5,6],[7,8,9],[10,11,12]];
|
const qRanges = [[1,2,3],[4,5,6],[7,8,9],[10,11,12]];
|
||||||
const qRange = qRanges[q];
|
const activeMonths = qRanges[activeQ];
|
||||||
const storageKey = 'opc-performance-Q' + (q + 1);
|
const qLabels = ['Q1','Q2','Q3','Q4'];
|
||||||
|
|
||||||
const pfs = (data.projectFinances || []);
|
// 当前聚合范围
|
||||||
|
let aggMonths = [];
|
||||||
|
if (state.perfView === 'annual') {
|
||||||
|
for (var mi = 1; mi <= 12; mi++) aggMonths.push(mi);
|
||||||
|
} else if (state.perfView === 'quarterly') {
|
||||||
|
aggMonths = qRanges[activeQ];
|
||||||
|
} else if (state.perfView === 'monthly') {
|
||||||
|
const m = state.perfMonth;
|
||||||
|
aggMonths = m ? [parseInt(m.substring(5))] : [];
|
||||||
|
}
|
||||||
|
|
||||||
const sumQ = (field) => {
|
// 月度选择器默认值
|
||||||
|
if (state.perfView === 'monthly' && !state.perfMonth) {
|
||||||
|
state.perfMonth = planYear + '-' + String(nowD.getMonth() + 1).padStart(2, '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 数据源 ──
|
||||||
|
const pfs = (data.projectFinances || []); // 已发生 → 完成情况
|
||||||
|
const planPfs = (data.planFinances || []); // 预算 → 目标
|
||||||
|
|
||||||
|
// ── 通用聚合(支持年份过滤 + 月度范围)──
|
||||||
|
function sumByMonths(items, field, useSign, months) {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
pfs.forEach(p => {
|
items.forEach(p => {
|
||||||
try { JSON.parse(p.budget_data || '[]').forEach(b => { const m = parseInt((b.month || '').substring(5)) || 0; if (qRange.includes(m)) total += parseFloat(b[field] || 0); }); } catch (e) {}
|
if (useSign) {
|
||||||
|
const sm = p.sign_month || '';
|
||||||
|
const smY = parseInt(sm.substring(0, 4)) || 0;
|
||||||
|
const smM = parseInt(sm.substring(5)) || 0;
|
||||||
|
if (!months.includes(smM)) return;
|
||||||
|
if (planYear !== 0 && smY && smY !== planYear) return;
|
||||||
|
total += parseFloat(p.sign_amount || 0);
|
||||||
|
} else {
|
||||||
|
let bd = [];
|
||||||
|
try { bd = JSON.parse(p.budget_data || '[]'); } catch (e) {}
|
||||||
|
bd.forEach(b => {
|
||||||
|
const m = parseInt((b.month || '').substring(5)) || 0;
|
||||||
|
const y = parseInt((b.month || '').substring(0, 4)) || 0;
|
||||||
|
if (!months.includes(m)) return;
|
||||||
|
if (planYear !== 0 && y && y !== planYear) return;
|
||||||
|
total += parseFloat(b[field] || 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return Math.round(total);
|
return Math.round(total);
|
||||||
};
|
}
|
||||||
|
|
||||||
const signTotal = Math.round(pfs.filter(x => { const m = parseInt((x.sign_month || '0').substring(5)) || 0; return qRange.includes(m); }).reduce((a, p) => a + (p.sign_amount || 0), 0));
|
// ── 计算 ──
|
||||||
const revTotal = sumQ('rev');
|
const signActual = sumByMonths(pfs, '', true, aggMonths);
|
||||||
const grossTotal = sumQ('gross');
|
const revActual = sumByMonths(pfs, 'rev', false, aggMonths);
|
||||||
const paymentTotal = sumQ('payment');
|
const grossActual = sumByMonths(pfs, 'gross', false, aggMonths);
|
||||||
|
const paymentActual = sumByMonths(pfs, 'payment', false, aggMonths);
|
||||||
|
|
||||||
|
const signPlan = sumByMonths(planPfs, '', true, aggMonths);
|
||||||
|
const revPlan = sumByMonths(planPfs, 'rev', false, aggMonths);
|
||||||
|
const grossPlan = sumByMonths(planPfs, 'gross', false, aggMonths);
|
||||||
|
const paymentPlan = sumByMonths(planPfs, 'payment', false, aggMonths);
|
||||||
|
|
||||||
const rows = [
|
const rows = [
|
||||||
{ key: 'sign', label: '签约', complete: signTotal, icon: 'file-text', defWeight: 10 },
|
{ key: 'sign', label: '签约', complete: signActual, plan: signPlan, icon: 'file-text', defWeight: 10 },
|
||||||
{ key: 'rev', label: '收入', complete: revTotal, icon: 'dollar-sign', defWeight: 20 },
|
{ key: 'rev', label: '收入', complete: revActual, plan: revPlan, icon: 'dollar-sign', defWeight: 20 },
|
||||||
{ key: 'gross', label: '毛利', complete: grossTotal, icon: 'trending-up', defWeight: 50 },
|
{ key: 'gross', label: '毛利', complete: grossActual, plan: grossPlan, icon: 'trending-up', defWeight: 50 },
|
||||||
{ key: 'payment', label: '回款', complete: paymentTotal, icon: 'coins', defWeight: 20 },
|
{ key: 'payment', label: '回款', complete: paymentActual, plan: paymentPlan, icon: 'coins', defWeight: 20 },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// 存储 key 基于当前视图模式
|
||||||
|
let storageKey = 'opc-perf-t'; // default annual
|
||||||
|
if (state.perfView === 'quarterly') storageKey = 'opc-perf-Q' + (activeQ + 1);
|
||||||
|
else if (state.perfView === 'monthly') storageKey = 'opc-perf-M' + (state.perfMonth || '');
|
||||||
|
|
||||||
const saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
|
const saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
|
||||||
|
|
||||||
function val(key, field, def) {
|
function val(key, field, def) {
|
||||||
@@ -40,27 +98,23 @@ window.renderPerformance = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function moneyWan(v) {
|
function moneyWan(v) {
|
||||||
if (v >= 10000) return (v / 10000).toFixed(1) + '万';
|
if (Math.abs(v) >= 10000) return (v / 10000).toFixed(1) + '万';
|
||||||
return v.toLocaleString();
|
return v.toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
let totalScore = 0;
|
let totalScore = 0;
|
||||||
const tableRows = rows.map(r => {
|
const tableRows = rows.map(r => {
|
||||||
const targetWan = val(r.key, 'targetWan', 0);
|
const target = r.plan;
|
||||||
const target = Math.round(targetWan * 10000);
|
|
||||||
const weight = val(r.key, 'weight', r.defWeight);
|
const weight = val(r.key, 'weight', r.defWeight);
|
||||||
const score = target > 0 ? Math.round((r.complete / target) * weight * 10) / 10 : 0;
|
const score = target > 0 ? Math.round((r.complete / target) * weight * 10) / 10 : 0;
|
||||||
|
const rate = target > 0 ? Math.round((r.complete / target) * 100) : 0;
|
||||||
totalScore += score;
|
totalScore += score;
|
||||||
|
|
||||||
return `<tr class="border-b border-slate-100">
|
return `<tr class="border-b border-slate-100">
|
||||||
<td class="p-3 align-middle text-left font-medium text-slate-700"><i data-lucide="${r.icon}" style="width:16px;height:16px;display:inline-block;vertical-align:-3px;margin-right:6px" class="text-brand-500"></i>${r.label}</td>
|
<td class="p-3 align-middle text-left font-medium text-slate-700"><i data-lucide="${r.icon}" style="width:16px;height:16px;display:inline-block;vertical-align:-3px;margin-right:6px" class="text-brand-500"></i>${r.label}</td>
|
||||||
<td class="p-3 align-middle text-center">
|
<td class="p-3 align-middle text-center text-slate-700 font-mono text-sm">${moneyWan(target)}</td>
|
||||||
<div class="inline-flex items-center gap-1">
|
|
||||||
<input type="number" step="0.1" min="0" value="${targetWan.toFixed(1)}" class="perf-target form-ctrl form-ctrl-sm w-20 text-center" style="appearance:none;-webkit-appearance:none" data-key="${r.key}" onchange="updatePerfScore('${r.key}','targetWan',this.value)">
|
|
||||||
<span class="text-xs text-slate-400">万</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="p-3 align-middle text-center text-slate-700 font-mono text-sm">${moneyWan(r.complete)}</td>
|
<td class="p-3 align-middle text-center text-slate-700 font-mono text-sm">${moneyWan(r.complete)}</td>
|
||||||
|
<td class="p-3 align-middle text-center font-semibold text-sm ${rate >= 100 ? 'text-green-600' : rate >= 50 ? 'text-amber-600' : 'text-red-500'}">${rate}%</td>
|
||||||
<td class="p-3 align-middle text-center">
|
<td class="p-3 align-middle text-center">
|
||||||
<div class="inline-flex justify-center">
|
<div class="inline-flex justify-center">
|
||||||
<input type="number" step="0.1" min="0" max="100" value="${weight}" class="perf-weight form-ctrl form-ctrl-sm w-16 text-center" style="appearance:none;-webkit-appearance:none" data-key="${r.key}" onchange="updatePerfScore('${r.key}','weight',this.value)">
|
<input type="number" step="0.1" min="0" max="100" value="${weight}" class="perf-weight form-ctrl form-ctrl-sm w-16 text-center" style="appearance:none;-webkit-appearance:none" data-key="${r.key}" onchange="updatePerfScore('${r.key}','weight',this.value)">
|
||||||
@@ -70,9 +124,27 @@ window.renderPerformance = () => {
|
|||||||
</tr>`;
|
</tr>`;
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|
||||||
const quarterTabs = `<div class="finance-tabs" style="padding:0;border-bottom:1px solid #e2e8f0;margin-bottom:0">` + qLabel.map((l, i) => {
|
// ── Header: 仿预算/已发生模块的年/季/月筛选区 ──
|
||||||
return `<button onclick="switchPerfQuarter(${i})" class="finance-tab${i === q ? ' active' : ''}" style="font-size:14px;font-weight:600">${l}</button>`;
|
const yearOpts = [2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027];
|
||||||
}).join('') + `</div>`;
|
const yearSelect = `<span class="text-sm text-slate-500">年份:</span><select onchange="setPerfYear(this.value)" class="px-2 py-0.5 pr-6 rounded text-sm font-medium border border-slate-200 bg-white"><option value="0"${planYear===0?' selected':''}>所有年份</option>${yearOpts.map(y => `<option value="${y}" ${planYear===y?'selected':''}>${y}年</option>`).join('')}</select>`;
|
||||||
|
|
||||||
|
const viewBtns = `<button onclick="setPerfView('annual')" class="px-3 py-0.5 rounded text-sm font-medium ${state.perfView==='annual'?'bg-brand-600 text-white':'bg-slate-100 text-slate-600 hover:bg-slate-200'}">全年</button>`;
|
||||||
|
|
||||||
|
const quarterBtns = qLabels.map((ql, i) =>
|
||||||
|
`<button onclick="setPerfQuarter(${i})" class="px-3 py-0.5 rounded text-sm font-medium ${state.perfView==='quarterly'&&activeQ===i?'bg-brand-600 text-white':'bg-slate-100 text-slate-600 hover:bg-slate-200'}">${ql}</button>`
|
||||||
|
).join('');
|
||||||
|
|
||||||
|
const monthBtns = activeMonths.map(m => {
|
||||||
|
const ms = planYear + '-' + String(m).padStart(2, '0');
|
||||||
|
return `<button onclick="setPerfMonth('${ms}')" class="px-3 py-0.5 rounded text-sm font-medium ${state.perfView==='monthly'&&state.perfMonth===ms?'bg-brand-600 text-white':'bg-slate-100 text-slate-600 hover:bg-slate-200'}">${m}月</button>`;
|
||||||
|
}).join('');
|
||||||
|
|
||||||
|
const headerBar = `<div class="flex items-center gap-2 flex-wrap">
|
||||||
|
${yearSelect}<span class="text-slate-300 mx-1">|</span>
|
||||||
|
${viewBtns}
|
||||||
|
<span class="text-slate-300 mx-1">|</span><span class="text-sm text-slate-500">季度:</span>${quarterBtns}
|
||||||
|
<span class="text-slate-300 mx-1">|</span><span class="text-sm text-slate-500">月度:</span>${monthBtns}
|
||||||
|
</div>`;
|
||||||
|
|
||||||
document.querySelector("#performance").innerHTML = `
|
document.querySelector("#performance").innerHTML = `
|
||||||
<style>
|
<style>
|
||||||
@@ -83,13 +155,14 @@ window.renderPerformance = () => {
|
|||||||
.perf-target, .perf-weight { -moz-appearance: textfield; }
|
.perf-target, .perf-weight { -moz-appearance: textfield; }
|
||||||
</style>
|
</style>
|
||||||
<div class="grid gap-4">
|
<div class="grid gap-4">
|
||||||
${quarterTabs}
|
<div class="card py-2 px-4">${headerBar}</div>
|
||||||
<section class="card p-4">
|
<section class="card p-4">
|
||||||
<table class="w-full text-sm">
|
<table class="w-full text-sm">
|
||||||
<thead><tr class="bg-slate-50 border-b border-slate-200">
|
<thead><tr class="bg-slate-50 border-b border-slate-200">
|
||||||
<th class="p-3 text-left font-semibold text-slate-500">指标</th>
|
<th class="p-3 text-left font-semibold text-slate-500">指标</th>
|
||||||
<th class="p-3 text-center font-semibold text-slate-500">目标(万)</th>
|
<th class="p-3 text-center font-semibold text-slate-500">目标(万)</th>
|
||||||
<th class="p-3 text-center font-semibold text-slate-500">完成情况</th>
|
<th class="p-3 text-center font-semibold text-slate-500">完成情况</th>
|
||||||
|
<th class="p-3 text-center font-semibold text-slate-500">完成率</th>
|
||||||
<th class="p-3 text-center font-semibold text-slate-500">权重</th>
|
<th class="p-3 text-center font-semibold text-slate-500">权重</th>
|
||||||
<th class="p-3 text-center font-semibold text-slate-500">评分</th>
|
<th class="p-3 text-center font-semibold text-slate-500">评分</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
@@ -98,6 +171,7 @@ window.renderPerformance = () => {
|
|||||||
<td class="p-3 text-left text-slate-700">合计</td>
|
<td class="p-3 text-left text-slate-700">合计</td>
|
||||||
<td class="p-3 text-center text-slate-500">—</td>
|
<td class="p-3 text-center text-slate-500">—</td>
|
||||||
<td class="p-3 text-center text-slate-500">—</td>
|
<td class="p-3 text-center text-slate-500">—</td>
|
||||||
|
<td class="p-3 text-center text-slate-500">—</td>
|
||||||
<td class="p-3 text-center text-slate-700">100</td>
|
<td class="p-3 text-center text-slate-700">100</td>
|
||||||
<td class="p-3 text-center text-brand-700 text-base">${totalScore.toFixed(1)}</td>
|
<td class="p-3 text-center text-brand-700 text-base">${totalScore.toFixed(1)}</td>
|
||||||
</tr></tfoot>
|
</tr></tfoot>
|
||||||
@@ -108,17 +182,47 @@ window.renderPerformance = () => {
|
|||||||
if (window.lucide) window.lucide.createIcons();
|
if (window.lucide) window.lucide.createIcons();
|
||||||
};
|
};
|
||||||
|
|
||||||
window.switchPerfQuarter = (q) => {
|
// ── 筛选切换函数 ──
|
||||||
|
window.setPerfYear = (y) => {
|
||||||
|
state.planYear = parseInt(y);
|
||||||
|
renderPerformance();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.setPerfView = (v) => {
|
||||||
|
state.perfView = v;
|
||||||
|
renderPerformance();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.setPerfQuarter = (q) => {
|
||||||
|
state.perfView = 'quarterly';
|
||||||
state.perfQuarter = q;
|
state.perfQuarter = q;
|
||||||
renderPerformance();
|
renderPerformance();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.setPerfMonth = (m) => {
|
||||||
|
state.perfView = 'monthly';
|
||||||
|
state.perfMonth = m;
|
||||||
|
renderPerformance();
|
||||||
|
};
|
||||||
|
|
||||||
|
// ── 编辑保存 ──
|
||||||
window.updatePerfScore = (key, field, value) => {
|
window.updatePerfScore = (key, field, value) => {
|
||||||
const q = state.perfQuarter || 0;
|
let storageKey = 'opc-perf-t';
|
||||||
const storageKey = 'opc-performance-Q' + (q + 1);
|
if (state.perfView === 'quarterly') storageKey = 'opc-perf-Q' + ((state.perfQuarter || 0) + 1);
|
||||||
|
else if (state.perfView === 'monthly') storageKey = 'opc-perf-M' + (state.perfMonth || '');
|
||||||
const saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
|
const saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
|
||||||
saved[key] = saved[key] || {};
|
saved[key] = saved[key] || {};
|
||||||
saved[key][field] = value;
|
saved[key][field] = value;
|
||||||
localStorage.setItem(storageKey, JSON.stringify(saved));
|
localStorage.setItem(storageKey, JSON.stringify(saved));
|
||||||
renderPerformance();
|
renderPerformance();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ── 数据加载 ──
|
||||||
|
async function loadPerfData() {
|
||||||
|
for (var i = 0; i < 2; i++) {
|
||||||
|
var r = i === 0 ? 'planFinances' : 'projectFinances';
|
||||||
|
try {
|
||||||
|
state.data[r] = await api("/api/" + r + "/list?tenant=" + encodeURIComponent(state.tenant));
|
||||||
|
} catch(e) { console.error('loadPerfData failed:', r, e.message); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -383,16 +383,23 @@ function renderPlan() {
|
|||||||
budgetArr.forEach(function(b) { allMonths[b.month || ''] = true; });
|
budgetArr.forEach(function(b) { allMonths[b.month || ''] = true; });
|
||||||
expenseArr.forEach(function(e) { allMonths[e.month || ''] = true; });
|
expenseArr.forEach(function(e) { allMonths[e.month || ''] = true; });
|
||||||
var detailRows = Object.keys(allMonths).filter(function(m) {
|
var detailRows = Object.keys(allMonths).filter(function(m) {
|
||||||
|
if (state.planYear !== 0 && parseInt(m.substring(0, 4)) !== state.planYear) return false;
|
||||||
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
||||||
var exp = expenseArr.find(function(x) { return x.month === m; }) || {};
|
|
||||||
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
||||||
var eCost = parseFloat(exp.cost || 0), ePaid = parseFloat(exp.paid || 0);
|
var eCost = 0, ePaid = 0;
|
||||||
|
expenseArr.filter(function(x) { return x.month === m; }).forEach(function(e) {
|
||||||
|
eCost += parseFloat(e.cost || 0) || 0;
|
||||||
|
ePaid += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
return bRev || bGross || bPay || eCost || ePaid;
|
return bRev || bGross || bPay || eCost || ePaid;
|
||||||
}).sort().map(function(m) {
|
}).sort().map(function(m) {
|
||||||
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
var b = budgetArr.find(function(x) { return x.month === m; }) || {};
|
||||||
var exp = expenseArr.find(function(x) { return x.month === m; }) || {};
|
var eCost = 0, ePaid = 0;
|
||||||
|
expenseArr.filter(function(x) { return x.month === m; }).forEach(function(e) {
|
||||||
|
eCost += parseFloat(e.cost || 0) || 0;
|
||||||
|
ePaid += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
var bRev = parseFloat(b.rev || 0), bGross = parseFloat(b.gross || 0), bPay = parseFloat(b.payment || 0);
|
||||||
var eCost = parseFloat(exp.cost || 0), ePaid = parseFloat(exp.paid || 0);
|
|
||||||
var bCf = bPay - ePaid;
|
var bCf = bPay - ePaid;
|
||||||
return '<tr class="bg-slate-50"><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-slate-600">' + m + '</td><td class="px-2 py-px text-center text-xs text-brand-600">' + (bRev ? money(bRev) : '—') + '</td><td class="px-2 py-px text-center text-xs text-green-600">' + (bGross ? money(bGross) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-amber-600">' + (bPay ? money(bPay) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-rose-600">' + (eCost ? money(eCost) : '—') + '</td><td class="px-2 py-px text-center text-xs text-purple-600">' + (ePaid ? money(ePaid) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs ' + (bCf >= 0 ? 'text-green-600' : 'text-red-600') + '">' + (bCf ? money(bCf) : '—') + '</td><td class="px-2 py-px text-center text-xs ' + (bRev - bPay > 0 ? 'text-red-600' : bRev - bPay < 0 ? 'text-green-600' : 'text-slate-300') + '">' + (bRev - bPay ? money(bRev - bPay) : '—') + '</td></tr>';
|
return '<tr class="bg-slate-50"><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-slate-600">' + m + '</td><td class="px-2 py-px text-center text-xs text-brand-600">' + (bRev ? money(bRev) : '—') + '</td><td class="px-2 py-px text-center text-xs text-green-600">' + (bGross ? money(bGross) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-amber-600">' + (bPay ? money(bPay) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs text-rose-600">' + (eCost ? money(eCost) : '—') + '</td><td class="px-2 py-px text-center text-xs text-purple-600">' + (ePaid ? money(ePaid) : '—') + '</td><td class="px-2 py-px"></td><td class="px-2 py-px text-center text-xs ' + (bCf >= 0 ? 'text-green-600' : 'text-red-600') + '">' + (bCf ? money(bCf) : '—') + '</td><td class="px-2 py-px text-center text-xs ' + (bRev - bPay > 0 ? 'text-red-600' : bRev - bPay < 0 ? 'text-green-600' : 'text-slate-300') + '">' + (bRev - bPay ? money(bRev - bPay) : '—') + '</td></tr>';
|
||||||
}).join('');
|
}).join('');
|
||||||
@@ -417,12 +424,17 @@ function renderPlan() {
|
|||||||
let bd = []; try { bd = JSON.parse(pf.budget_data || "[]"); } catch (e) {}
|
let bd = []; try { bd = JSON.parse(pf.budget_data || "[]"); } catch (e) {}
|
||||||
let ed = []; try { ed = JSON.parse(pf.expense_data || "[]"); } catch (e) {}
|
let ed = []; try { ed = JSON.parse(pf.expense_data || "[]"); } catch (e) {}
|
||||||
const b = bd.find(x => (x.month || "") === selMonth) || {};
|
const b = bd.find(x => (x.month || "") === selMonth) || {};
|
||||||
const e = ed.find(x => (x.month || "") === selMonth) || {};
|
let rev = Math.round(parseFloat(b.rev || 0) || 0);
|
||||||
const rev = Math.round(parseFloat(b.rev || 0) || 0);
|
let payment2 = Math.round(parseFloat(b.payment || 0) || 0);
|
||||||
const payment = Math.round(parseFloat(b.payment || 0) || 0);
|
let gross = Math.round(parseFloat(b.gross || 0) || 0);
|
||||||
const gross = Math.round(parseFloat(b.gross || 0) || 0);
|
let cost = 0, paid = 0;
|
||||||
const cost = Math.round(parseFloat(e.cost || 0) || 0);
|
ed.filter(x => (x.month || "") === selMonth).forEach(e => {
|
||||||
const paid = Math.round(parseFloat(e.paid || 0) || 0);
|
cost += parseFloat(e.cost || 0) || 0;
|
||||||
|
paid += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
|
cost = Math.round(cost);
|
||||||
|
paid = Math.round(paid);
|
||||||
|
payment = payment2;
|
||||||
if (!rev && !payment && !cost && !paid && !gross) return;
|
if (!rev && !payment && !cost && !paid && !gross) return;
|
||||||
dataItems.push({
|
dataItems.push({
|
||||||
pf: pf,
|
pf: pf,
|
||||||
@@ -511,9 +523,15 @@ function renderPlan() {
|
|||||||
let budget = []; try { budget = JSON.parse(pf.budget_data || "[]"); } catch (e) {}
|
let budget = []; try { budget = JSON.parse(pf.budget_data || "[]"); } catch (e) {}
|
||||||
let expense = []; try { expense = JSON.parse(pf.expense_data || "[]"); } catch (e) {}
|
let expense = []; try { expense = JSON.parse(pf.expense_data || "[]"); } catch (e) {}
|
||||||
let rev = 0, payment = 0, gross = 0;
|
let rev = 0, payment = 0, gross = 0;
|
||||||
budget.forEach(b => { rev += parseFloat(b.rev || 0) || 0; gross += parseFloat(b.gross || 0) || 0; payment += parseFloat(b.payment || 0) || 0; });
|
budget.forEach(b => {
|
||||||
|
if (state.planYear !== 0 && parseInt((b.month || '').substring(0, 4)) !== state.planYear) return;
|
||||||
|
rev += parseFloat(b.rev || 0) || 0; gross += parseFloat(b.gross || 0) || 0; payment += parseFloat(b.payment || 0) || 0;
|
||||||
|
});
|
||||||
let cost = 0, paid = 0;
|
let cost = 0, paid = 0;
|
||||||
expense.forEach(e => { cost += parseFloat(e.cost || 0) || 0; paid += parseFloat(e.paid || 0) || 0; });
|
expense.forEach(e => {
|
||||||
|
if (state.planYear !== 0 && parseInt((e.month || '').substring(0, 4)) !== state.planYear) return;
|
||||||
|
cost += parseFloat(e.cost || 0) || 0; paid += parseFloat(e.paid || 0) || 0;
|
||||||
|
});
|
||||||
return { rev: Math.round(rev), payment: Math.round(payment), cost: Math.round(cost), paid: Math.round(paid), gross: Math.round(gross) };
|
return { rev: Math.round(rev), payment: Math.round(payment), cost: Math.round(cost), paid: Math.round(paid), gross: Math.round(gross) };
|
||||||
};
|
};
|
||||||
const allPfs = pfs;
|
const allPfs = pfs;
|
||||||
@@ -1049,11 +1067,13 @@ function computePlanMonthly(planFinances, year) {
|
|||||||
var pf = pfs[j];
|
var pf = pfs[j];
|
||||||
if ((pf.sign_month || '') === month) sign += parseFloat(pf.sign_amount || 0);
|
if ((pf.sign_month || '') === month) sign += parseFloat(pf.sign_amount || 0);
|
||||||
var bd = []; try { bd = JSON.parse(pf.budget_data || '[]'); } catch(e) {}
|
var bd = []; try { bd = JSON.parse(pf.budget_data || '[]'); } catch(e) {}
|
||||||
var b = bd.find(function(x) { return (x.month || '') === month; });
|
bd.filter(function(x) { return (x.month || '') === month; }).forEach(function(b) {
|
||||||
if (b) { revenue += parseFloat(b.rev || 0); gross += parseFloat(b.gross || 0); payment += parseFloat(b.payment || 0); }
|
revenue += parseFloat(b.rev || 0); gross += parseFloat(b.gross || 0); payment += parseFloat(b.payment || 0);
|
||||||
|
});
|
||||||
var ed = []; try { ed = JSON.parse(pf.expense_data || '[]'); } catch(e) {}
|
var ed = []; try { ed = JSON.parse(pf.expense_data || '[]'); } catch(e) {}
|
||||||
var e = ed.find(function(x) { return (x.month || '') === month; });
|
ed.filter(function(x) { return (x.month || '') === month; }).forEach(function(e) {
|
||||||
if (e) { cost += parseFloat(e.cost || 0); paid += parseFloat(e.paid || 0); }
|
cost += parseFloat(e.cost || 0); paid += parseFloat(e.paid || 0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
data.push({ month: month, sign: Math.round(sign), revenue: Math.round(revenue), gross: Math.round(gross), payment: Math.round(payment), cost: Math.round(cost), paid: Math.round(paid) });
|
data.push({ month: month, sign: Math.round(sign), revenue: Math.round(revenue), gross: Math.round(gross), payment: Math.round(payment), cost: Math.round(cost), paid: Math.round(paid) });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ function switchTab(tab) {
|
|||||||
document.querySelectorAll(".panel").forEach((panel) => panel.classList.toggle("active", panel.id === tab));
|
document.querySelectorAll(".panel").forEach((panel) => panel.classList.toggle("active", panel.id === tab));
|
||||||
|
|
||||||
// 更新顶部标题
|
// 更新顶部标题
|
||||||
const titles = { finance: '执行管理', plan: '预算管理', projects: '重点工作台账', proposals: '业务方案', products: '版本与运营', performance: '季度绩效考核', overview_plan: '预算总览', overview_finance: '发生总览' };
|
const titles = { finance: '执行管理', plan: '预算管理', projects: '重点工作台账', proposals: 'wiki', products: '版本与运营', performance: '季度绩效考核', overview_plan: '预算总览', overview_finance: '发生总览' };
|
||||||
const titleEl = document.querySelector('#workspaceTitle');
|
const titleEl = document.querySelector('#workspaceTitle');
|
||||||
if (titleEl) titleEl.textContent = titles[tab] || state.tenant + ' OPC 工作台';
|
if (titleEl) titleEl.textContent = titles[tab] || state.tenant + ' OPC 工作台';
|
||||||
|
|
||||||
|
|||||||
@@ -83,10 +83,6 @@
|
|||||||
<i data-lucide="file-text" style="width:20px;height:20px"></i>
|
<i data-lucide="file-text" style="width:20px;height:20px"></i>
|
||||||
<span class="text-[10px] mt-1">Focus</span>
|
<span class="text-[10px] mt-1">Focus</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-tab" data-tab="proposals" onclick="switchTab('proposals')" title="业务方案">
|
|
||||||
<i data-lucide="package" style="width:20px;height:20px"></i>
|
|
||||||
<span class="text-[10px] mt-1">方案</span>
|
|
||||||
</div>
|
|
||||||
<div class="sidebar-tab" data-tab="products" onclick="switchTab('products')" title="产品迭代">
|
<div class="sidebar-tab" data-tab="products" onclick="switchTab('products')" title="产品迭代">
|
||||||
<i data-lucide="wallet-cards" style="width:20px;height:20px"></i>
|
<i data-lucide="wallet-cards" style="width:20px;height:20px"></i>
|
||||||
<span class="text-[10px] mt-1">产品</span>
|
<span class="text-[10px] mt-1">产品</span>
|
||||||
@@ -95,6 +91,10 @@
|
|||||||
<i data-lucide="target" style="width:20px;height:20px"></i>
|
<i data-lucide="target" style="width:20px;height:20px"></i>
|
||||||
<span class="text-[10px] mt-1">绩效</span>
|
<span class="text-[10px] mt-1">绩效</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="sidebar-tab" data-tab="proposals" onclick="switchTab('proposals')" title="wiki">
|
||||||
|
<i data-lucide="package" style="width:20px;height:20px"></i>
|
||||||
|
<span class="text-[10px] mt-1">wiki</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
<!-- 主内容区 -->
|
<!-- 主内容区 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user