From 13e63b98e3cb9650cb9b5a2d780400fc14c05a34 Mon Sep 17 00:00:00 2001 From: mac Date: Wed, 8 Jul 2026 16:14:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9E=E9=99=85=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE=E5=88=A9=E6=B6=A6=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SIGNED_COLS/UNSIGNED_COLS移除profit列 - tdRow/tdRowUnsigned移除pfCls/pfVal变量和单元格 - theadCols计数修正(13/6) - 版本号 v1.0.0.29 --- static/modules/finance.js | 22 ++++++++-------------- templates/index.html | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/static/modules/finance.js b/static/modules/finance.js index f056205..0f459c1 100644 --- a/static/modules/finance.js +++ b/static/modules/finance.js @@ -288,14 +288,14 @@ function renderFinance() { const SIGNED_COLS = [ { key: 'client_name', label: '客户' }, { key: 'customer_name', label: '项目名称' }, { key: 'sign_amount', label: '签约金额' }, { key: 'rev', label: '已确收' }, { key: 'gross', label: '毛利' }, { key: 'cost', label: '成本' }, - { key: 'profit', label: '项目利润' }, { key: 'payment', label: '已回款' }, { key: 'paid', label: '已付' }, + { key: 'payment', label: '已回款' }, { key: 'paid', label: '已付' }, { key: 'cashflow', label: '现金流' }, { key: 'exe_rate', label: '执行率' }, { key: 'gross_rate', label: '毛利率' }, { key: 'pay_rate', label: '回款率' }, { key: 'paid_rate', label: '付款率' }, ]; const UNSIGNED_COLS = [ { key: 'client_name', label: '客户' }, { key: 'customer_name', label: '项目名称' }, { key: 'sign_amount', label: '签约金额' }, { key: 'sign_month', label: '签约月份' }, { key: 'gross', label: '毛利' }, { key: 'cost', label: '成本' }, - { key: 'profit', label: '项目利润' }, + , ]; const renderView = (rows, sumRev, sumPay, sumCost, sumPaid, sumGross, signTotal, signCnt, emptyText) => { @@ -305,7 +305,7 @@ function renderFinance() { return typeof v === 'object' ? [c.label, v.val, v.cls] : [c.label, v, c.color]; }); const thead = isUnsigned ? buildThead(UNSIGNED_COLS, 'uns') : buildThead(SIGNED_COLS, 'sig'); - const theadCols = isUnsigned ? 7 : 14; + const theadCols = isUnsigned ? 6 : 13; const tbody = rows.length ? `${rows.join("")}` : `${emptyText}`; const cardGrid = isUnsigned ? 'grid-cols-4' : 'grid-cols-6'; @@ -327,17 +327,11 @@ 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'; - const profit = gross; - const pfCls = profit >= 0 ? 'text-green-600' : 'text-red-600'; - const pfVal = profit ? money(profit) : ''; - return `${esc(pf.client_name || "")}${esc(pf.customer_name)}${money(pf.sign_amount)}${fmtNoUnit(rev)}${fmtNoUnit(gross)}${fmtNoUnit(cost)}${pfVal}${fmtNoUnit(payment)}${fmtNoUnit(paid)}${cf}${exe}${grossR}${payR}${paidR}`; + return `${esc(pf.client_name || "")}${esc(pf.customer_name)}${money(pf.sign_amount)}${fmtNoUnit(rev)}${fmtNoUnit(gross)}${fmtNoUnit(cost)}${fmtNoUnit(payment)}${fmtNoUnit(paid)}${cf}${exe}${grossR}${payR}${paidR}`; }; // 待签约简版行 const tdRowUnsigned = (pf, cost, gross) => { - const profit = gross; - const pfCls = profit >= 0 ? 'text-green-600' : 'text-red-600'; - const pfVal = profit ? money(profit) : ''; - return `${esc(pf.customer_name)}${money(pf.sign_amount)}${pf.sign_month || '—'}${fmtNoUnit(gross)}${fmtNoUnit(cost)}${pfVal}`; + return `${esc(pf.customer_name)}${money(pf.sign_amount)}${pf.sign_month || '—'}${fmtNoUnit(gross)}${fmtNoUnit(cost)}`; }; if (state.finView === 'monthly') { @@ -360,7 +354,7 @@ function renderFinance() { if (!rev && !payment && !cost && !paid && !gross) return; dataItems.push({ pf: pf, customer_name: pf.customer_name || '', sign_amount: pf.sign_amount || 0, sign_month: pf.sign_month || '', - rev: rev, gross: gross, cost: cost, profit: gross, payment: payment, paid: paid, + rev: rev, gross: gross, cost: cost, payment: payment, paid: paid, cashflow: payment - paid, exe_rate: rev && pf.sign_amount ? Math.round(rev / pf.sign_amount * 100) : 0, gross_rate: rev && gross ? Math.round(gross / rev * 100) : 0, @@ -411,7 +405,7 @@ function renderFinance() { if (!rev && !payment && !cost && !paid && !gross) return; dataItems.push({ pf: pf, customer_name: pf.customer_name || '', sign_amount: pf.sign_amount || 0, sign_month: pf.sign_month || '', - rev: rev, gross: gross, cost: cost, profit: gross, payment: payment, paid: paid, + rev: rev, gross: gross, cost: cost, payment: payment, paid: paid, cashflow: payment - paid, exe_rate: rev && pf.sign_amount ? Math.round(rev / pf.sign_amount * 100) : 0, gross_rate: rev && gross ? Math.round(gross / rev * 100) : 0, @@ -447,7 +441,7 @@ function renderFinance() { var t = calcTotals(pf); return { pf: pf, customer_name: pf.customer_name || '', sign_amount: pf.sign_amount || 0, sign_month: pf.sign_month || '', - rev: t.rev, gross: t.gross, cost: t.cost, profit: t.gross, + rev: t.rev, gross: t.gross, cost: t.cost, payment: t.payment, paid: t.paid, cashflow: t.payment - t.paid, exe_rate: t.rev && pf.sign_amount ? Math.round(t.rev / pf.sign_amount * 100) : 0, gross_rate: t.rev && t.gross ? Math.round(t.gross / t.rev * 100) : 0, diff --git a/templates/index.html b/templates/index.html index 121c3ad..e3e50c2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -80,7 +80,7 @@
-

OPC Manager v1.0.0.28

+

OPC Manager v1.0.0.29

科普 OPC 工作台