feat: 总部驾驶舱增加理论/实际净利润、净利率、食材成本率指标
This commit is contained in:
@@ -190,12 +190,12 @@ export function DashboardPage() {
|
||||
|
||||
{/* 利润与成本 */}
|
||||
{ex && (
|
||||
<CollapsibleSection title="利润与成本" subtitle="食材成本、人工房租、门店贡献利润等财务指标">
|
||||
<CollapsibleSection title="利润与成本" subtitle="食材成本、经营费用、净利润等财务指标">
|
||||
<div className="grid grid-cols-2 gap-3 md:grid-cols-4">
|
||||
<MetricCard title="食材成本" value={ex.total_food_cost} format="currency" description="全部门店实际食材成本合计" />
|
||||
<MetricCard title="经营费用" value={ex.total_expense} format="currency" description={`人工 ${formatCurrency(ex.total_wage)} · 房租 ${formatCurrency(ex.total_rent)} · 水电 ${formatCurrency(ex.total_utility)}`} />
|
||||
<MetricCard title="门店贡献利润" value={ex.total_contribution} format="currency" description={`贡献率 ${formatPercent(ex.overall_contribution_rate_pct)} · 盈利 ${ex.profitable_stores}家 / 亏损 ${ex.loss_stores}家`} />
|
||||
<MetricCard title="费用率" value={ex.overall_expense_rate_pct} format="percent" description={`人工 ${formatPercent(ex.overall_wage_rate_pct)} · 房租 ${formatPercent(ex.overall_rent_rate_pct)} · 水电 ${formatPercent(ex.overall_utility_rate_pct)}`} />
|
||||
<MetricCard title="理论净利润" value={ex.theoretical_net_profit} format="currency" description={`净利率 ${formatPercent(ex.theoretical_net_margin_pct)} · 按标准成本计算的理论利润`} />
|
||||
<MetricCard title="实际净利润" value={ex.actual_net_profit} format="currency" description={`净利率 ${formatPercent(ex.actual_net_margin_pct)} · 盈利 ${ex.profitable_stores}家 / 亏损 ${ex.loss_stores}家`} />
|
||||
<MetricCard title="食材成本" value={ex.total_food_cost} format="currency" description={`成本率 ${formatPercent(ex.actual_food_cost_rate_pct)} · 理论成本率 ${formatPercent(ex.theoretical_food_cost_rate_pct)}`} />
|
||||
<MetricCard title="经营费用" value={ex.total_expense} format="currency" description={`费用率 ${formatPercent(ex.overall_expense_rate_pct)} · 人工 ${formatCurrency(ex.total_wage)} · 房租 ${formatCurrency(ex.total_rent)}`} />
|
||||
</div>
|
||||
<div className="mt-3 grid grid-cols-2 gap-3 md:grid-cols-4">
|
||||
<MetricCard title="人工费用" value={ex.total_wage} format="currency" description={`占实收 ${formatPercent(ex.overall_wage_rate_pct)}`} />
|
||||
|
||||
@@ -26,10 +26,18 @@ router.get('/overview', async (req: AuthRequest, res) => {
|
||||
round(sum(card_fee_expense)::numeric, 2) AS total_card_fee,
|
||||
round(sum(repair_clean_expense)::numeric, 2) AS total_repair,
|
||||
round(sum(actual_food_cost)::numeric, 2) AS total_food_cost,
|
||||
round(sum(theoretical_cost)::numeric, 2) AS total_theoretical_cost,
|
||||
round(sum(actual_store_contribution)::numeric, 2) AS total_contribution,
|
||||
round(sum(theoretical_store_contribution)::numeric, 2) AS total_theoretical_contribution,
|
||||
round(sum(received) - sum(theoretical_cost) - sum(operating_expense), 2) AS theoretical_net_profit,
|
||||
round(sum(received) - sum(actual_food_cost) - sum(operating_expense), 2) AS actual_net_profit,
|
||||
round(sum(area_sqm)::numeric, 2) AS total_area,
|
||||
round((1 - sum(operating_expense) / nullif(sum(received), 0)) * 100, 2) AS overall_expense_rate_pct,
|
||||
round((1 - (sum(actual_food_cost) + sum(operating_expense)) / nullif(sum(received), 0)) * 100, 2) AS overall_contribution_rate_pct,
|
||||
round((sum(received) - sum(theoretical_cost) - sum(operating_expense)) / nullif(sum(received), 0) * 100, 2) AS theoretical_net_margin_pct,
|
||||
round((sum(received) - sum(actual_food_cost) - sum(operating_expense)) / nullif(sum(received), 0) * 100, 2) AS actual_net_margin_pct,
|
||||
round(sum(theoretical_cost) / nullif(sum(received), 0) * 100, 2) AS theoretical_food_cost_rate_pct,
|
||||
round(sum(actual_food_cost) / nullif(sum(received), 0) * 100, 2) AS actual_food_cost_rate_pct,
|
||||
round(sum(wage_expense) / nullif(sum(received), 0) * 100, 2) AS overall_wage_rate_pct,
|
||||
round(sum(rent_expense) / nullif(sum(received), 0) * 100, 2) AS overall_rent_rate_pct,
|
||||
round(sum(utility_expense) / nullif(sum(received), 0) * 100, 2) AS overall_utility_rate_pct
|
||||
|
||||
Reference in New Issue
Block a user