diff --git a/static/modules/plan.js b/static/modules/plan.js index 0528752..e4d8f5c 100644 --- a/static/modules/plan.js +++ b/static/modules/plan.js @@ -257,9 +257,9 @@ function renderPlan() { { label: '已确收', hideUnsigned: true, value: ctx => moneyWan(ctx.sumRev), color: 'text-blue-700' }, { label: '待回款', hideUnsigned: true, value: ctx => { const v = ctx.sumRev - ctx.sumPay; return { val: v < 0 ? '超额回款 ' + moneyWan(Math.abs(v)) : moneyWan(v), cls: v > 0 ? 'text-red-600' : v < 0 ? 'text-green-600' : 'text-slate-400' }; }, color: null }, { label: '毛利', value: ctx => moneyWan(ctx.sumGross), color: 'text-green-700' }, - { label: '成本(不含平台费用)', value: ctx => moneyWan(ctx.sumCost), color: 'text-rose-700' }, + { label: '当期成本(不含平台费用)', value: ctx => moneyWan(ctx.sumCost), color: 'text-rose-700' }, { label: '回款', hideUnsigned: true, value: ctx => moneyWan(ctx.sumPay), color: 'text-amber-700' }, - { label: '已付', hideUnsigned: true, value: ctx => moneyWan(ctx.sumPaid), color: 'text-purple-700' }, + { label: '当期流出', hideUnsigned: true, value: ctx => moneyWan(ctx.sumPaid), color: 'text-purple-700' }, { label: '现金流(回款-支出)', hideUnsigned: true, value: ctx => { const v = ctx.sumPay - ctx.sumPaid; return { val: moneyWan(v), cls: v >= 0 ? 'text-green-600' : 'text-red-600' }; }, color: null }, { label: '毛利率', hideUnsigned: true, value: ctx => ctx.sumRev && ctx.sumGross ? Math.round(ctx.sumGross / ctx.sumRev * 100) + '%' : '—', color: 'text-slate-500' }, { label: '回款率', hideUnsigned: true, value: ctx => ctx.sumRev && ctx.sumPay ? Math.round(ctx.sumPay / ctx.sumRev * 100) + '%' : '—', color: 'text-slate-500' }, @@ -307,9 +307,8 @@ function renderPlan() { { key: 'gross_rate', label: '毛利率' }, { key: 'payment', label: '回款' }, { key: 'pay_rate', label: '回款率' }, - { key: 'cost', label: '成本' }, - { key: 'paid', label: '付款' }, - { key: 'paid_rate', label: '付款率' }, + { key: 'cost', label: '当期成本' }, + { key: 'paid', label: '当期流出' }, { key: 'cashflow', label: '现金流' }, { key: 'pending', label: '待回款' }, ]; @@ -321,7 +320,7 @@ function renderPlan() { { key: 'sign_amount', label: '签约金额' }, { key: 'sign_month', label: '签约月份' }, { key: 'gross', label: '毛利' }, - { key: 'cost', label: '成本' }, + { key: 'cost', label: '当期成本' }, { key: 'profit', label: '项目利润' }, ]; @@ -332,7 +331,7 @@ function renderPlan() { 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 ? 9 : 14; + const theadCols = isUnsigned ? 9 : 13; const tbody = rows.length ? `${rows.join("")}` : `${emptyText}`; const cardGrid = isUnsigned ? 'grid-cols-4' : 'grid-cols-5'; @@ -365,7 +364,6 @@ function renderPlan() { const payRVal = rev && payment ? Math.round(payment / rev * 100) : null; const payRCls = payRVal === null ? '' : payRVal < 30 ? 'text-red-600' : payRVal < 80 ? 'text-amber-600' : 'text-green-600'; const payR = payRVal !== null ? '' + payRVal + '%' : ''; - const paidR = cost && paid ? Math.round(paid / cost * 100) + '%' : ''; const grossR = rev && gross ? Math.round(gross / rev * 100) + '%' : ''; const cf = cashflow ? money(cashflow) : ''; const cfCls = cashflow >= 0 ? 'text-green-600' : 'text-red-600'; @@ -394,7 +392,7 @@ function renderPlan() { var bCf = bPay - ePaid; return '' + m + '' + (bRev ? money(bRev) : '—') + '' + (bGross ? money(bGross) : '—') + '' + (bPay ? money(bPay) : '—') + '' + (eCost ? money(eCost) : '—') + '' + (ePaid ? money(ePaid) : '—') + '' + (bCf ? money(bCf) : '—') + '' + (bRev - bPay ? money(bRev - bPay) : '—') + ''; }).join(''); - return `${esc(pf.client_name || "")}${esc(pf.customer_name)}${planInlineSelect('weight', pf.id, 'weight', pf.weight || '20%', ['20%','40%','60%','80%','100%'])}${planInlineSelect('ptype', pf.id, 'project_type', pf.project_type || '待签约', ['待签约','已签约'])}${money(pf.sign_amount)}${fmtNoUnit(rev)}${fmtNoUnit(gross)}${grossR}${fmtNoUnit(payment)}${payR}${fmtNoUnit(cost)}${fmtNoUnit(paid)}${paidR}${cf}${pendingVal}${detailRows}
月份确收毛利回款成本支出现金流待回款
`; + return `${esc(pf.client_name || "")}${esc(pf.customer_name)}${planInlineSelect('weight', pf.id, 'weight', pf.weight || '20%', ['20%','40%','60%','80%','100%'])}${planInlineSelect('ptype', pf.id, 'project_type', pf.project_type || '待签约', ['待签约','已签约'])}${money(pf.sign_amount)}${fmtNoUnit(rev)}${fmtNoUnit(gross)}${grossR}${fmtNoUnit(payment)}${payR}${fmtNoUnit(cost)}${fmtNoUnit(paid)}${cf}${pendingVal}${detailRows}
月份确收毛利回款当期成本当期流出现金流待回款
`; }; // 待签约简版行 const tdRowUnsigned = (pf, cost, gross) => { diff --git a/templates/index.html b/templates/index.html index df6cf46..5667480 100644 --- a/templates/index.html +++ b/templates/index.html @@ -76,7 +76,7 @@
-

OPC Manager v1.2.0.19

+

OPC Manager v1.2.0.20

科普 OPC 工作台