From 7bf30a7cc2d0516dd54efc3337423da83c3d8f81 Mon Sep 17 00:00:00 2001 From: mac Date: Fri, 10 Jul 2026 13:38:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=A7=E8=A1=8C=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A2=9E=E5=8A=A0=E8=A1=8C?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 项目财务明细表格最左侧增加展开箭头 - 点击展开月度确收回款明细(同预算模块) - 自动过滤全0月份 - 版本号 v1.2.0.7 --- static/modules/finance.js | 33 ++++++++++++++++++++++++++++++++- templates/index.html | 2 +- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/static/modules/finance.js b/static/modules/finance.js index 5d30463..620ec32 100644 --- a/static/modules/finance.js +++ b/static/modules/finance.js @@ -290,6 +290,7 @@ function renderFinance() { return h; }; const SIGNED_COLS = [ + { key: '_expand', label: '' }, { key: 'client_name', label: '客户' }, { key: 'customer_name', label: '项目名称' }, { key: 'sign_amount', label: '签约金额' }, { key: 'rev', label: '已确收' }, { key: 'gross', label: '毛利' }, { key: 'gross_rate', label: '毛利率' }, { key: 'payment', label: '回款' }, { key: 'pay_rate', label: '回款率' }, @@ -331,7 +332,24 @@ function renderFinance() { const grossR = rev && gross ? Math.round(gross / rev * 100) + '%' : ''; const cf = cashflow ? money(cashflow) : ''; const cfCls = cashflow >= 0 ? 'text-green-600' : 'text-red-600'; - return `${esc(pf.client_name || "")}${esc(pf.customer_name)}${money(pf.sign_amount)}${fmtNoUnit(rev)}${fmtNoUnit(gross)}${grossR}${fmtNoUnit(payment)}${payR}${fmtNoUnit(cost)}${fmtNoUnit(paid)}${paidR}${cf}`; + var budgetArr = []; + var expenseArr = []; + try { budgetArr = JSON.parse(pf.budget_data || "[]"); } catch(e) {} + try { expenseArr = JSON.parse(pf.expense_data || "[]"); } catch(e) {} + var detailRows = budgetArr.filter(function(b) { + var exp = expenseArr.find(function(e) { return e.month === (b.month || ''); }) || {}; + 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); + return bRev || bGross || bPay || eCost || ePaid; + }).map(function(b) { + var m = b.month || ''; + var exp = expenseArr.find(function(e) { return e.month === m; }) || {}; + 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; + return '' + m + '' + (bRev ? money(bRev) : '—') + '' + (bGross ? money(bGross) : '—') + '' + (bPay ? money(bPay) : '—') + '' + (eCost ? money(eCost) : '—') + '' + (ePaid ? money(ePaid) : '—') + '' + (bCf ? money(bCf) : '—') + ''; + }).join(''); + return `${esc(pf.client_name || "")}${esc(pf.customer_name)}${money(pf.sign_amount)}${fmtNoUnit(rev)}${fmtNoUnit(gross)}${grossR}${fmtNoUnit(payment)}${payR}${fmtNoUnit(cost)}${fmtNoUnit(paid)}${paidR}${cf}${detailRows}
月份确收毛利回款成本支出现金流
`; }; // 待签约简版行 const tdRowUnsigned = (pf, cost, gross) => { @@ -752,6 +770,19 @@ window.deleteFinFollowup = async (event, followupId) => { if (pfId) await loadFinFollowups(pfId); }; +window.finToggleExpand = (pfId) => { + var row = document.getElementById('fin_expand_' + pfId); + var icon = document.getElementById('fin_expand_icon_' + pfId); + if (!row) return; + if (row.classList.contains('hidden')) { + row.classList.remove('hidden'); + if (icon) { icon.setAttribute('data-lucide', 'chevron-down'); if (window.lucide) window.lucide.createIcons(); } + } else { + row.classList.add('hidden'); + if (icon) { icon.setAttribute('data-lucide', 'chevron-right'); if (window.lucide) window.lucide.createIcons(); } + } +}; + window.openPfEditModal = (pfId) => { const pf = (state.data.projectFinances || []).find(x => x.id === pfId); if (!pf) return; diff --git a/templates/index.html b/templates/index.html index 771920f..5141179 100644 --- a/templates/index.html +++ b/templates/index.html @@ -76,7 +76,7 @@
-

OPC Manager v1.2.0.6

+

OPC Manager v1.2.0.7

科普 OPC 工作台