feat(finance): include pickup profit in dashboard

This commit is contained in:
yml2213
2026-08-09 20:36:19 +08:00
parent 8fb7d3bac0
commit 211b9f012a
4 changed files with 136 additions and 13 deletions
@@ -11,6 +11,8 @@ export interface FinanceSummary {
pending_refund_amount_cent: number
channel_net_amount_cent: number
platform_income_amount_cent: number
normal_order_profit_amount_cent: number
pickup_profit_amount_cent: number
owner_should_income_amount_cent: number
owner_wallet_income_amount_cent: number
owner_effective_settlement_amount_cent: number
@@ -67,6 +69,13 @@ export interface FinancePickupSummary {
in_progress_count: number
}
export interface FinanceMohongSummary {
flow_amount_cent: number
refund_amount_cent: number
net_amount_cent: number
paid_order_count: number
}
export interface FinanceDisbursementSummary {
paid_amount_cent: number
paid_count: number
@@ -183,6 +192,7 @@ export interface FinanceDashboard {
summary: FinanceSummary
daily_items: FinanceDailyItem[]
pickup_summary: FinancePickupSummary
mohong_summary: FinanceMohongSummary
disbursement_summary: FinanceDisbursementSummary
generated_at: string
}
@@ -260,6 +270,12 @@ export async function fetchFinanceDashboard(query: FinanceDateQuery = {}) {
completed_count: 0,
in_progress_count: 0,
},
mohong_summary: data.data?.mohong_summary ?? {
flow_amount_cent: 0,
refund_amount_cent: 0,
net_amount_cent: 0,
paid_order_count: 0,
},
disbursement_summary: data.data?.disbursement_summary ?? {
paid_amount_cent: 0,
paid_count: 0,
@@ -66,7 +66,7 @@ function rowOfflinePendingClass(row: FinanceDailyItem) {
<div class="page-header">
<p class="eyebrow">Finance Dashboard</p>
<h1>财务仪表盘</h1>
<p>按天查看收付款平台收入号主结算及全部资金出款</p>
<p>按天查看收付款平台利润号主结算及全部资金出款</p>
</div>
<div class="toolbar-actions">
<el-date-picker
@@ -108,9 +108,12 @@ function rowOfflinePendingClass(row: FinanceDailyItem) {
<small>成功收款 - 成功退款</small>
</div>
<div class="metric-card">
<span>平台收入</span>
<span>平台利润</span>
<strong>{{ moneyCent(dashboard.summary.platform_income_amount_cent) }}</strong>
<small>{{ dashboard.summary.settled_order_count }} 个已结算订单</small>
<small>
普通订单 {{ moneyCent(dashboard.summary.normal_order_profit_amount_cent) }} + 线下提号
{{ moneyCent(dashboard.summary.pickup_profit_amount_cent) }}
</small>
</div>
<div class="metric-card">
<span>号主应得</span>
@@ -142,12 +145,37 @@ function rowOfflinePendingClass(row: FinanceDailyItem) {
<small>{{ dashboard.summary.financial_exception_count }} 个异常订单</small>
</div>
<div class="metric-card">
<span>预计收入</span>
<span>预计利润</span>
<strong>{{ moneyCent(dashboard.summary.estimated_income_amount_cent) }}</strong>
<small>{{ dashboard.summary.pending_settle_order_count }} 个待结算订单</small>
</div>
</div>
<div v-if="dashboard?.mohong_summary" class="section-heading">
<div>
<h2>撞车商城</h2>
<p>商城交易流水单独统计不计入平台利润</p>
</div>
</div>
<div v-if="dashboard?.mohong_summary" class="metric-grid mohong-grid">
<div class="metric-card mohong-card">
<span>商城成交额</span>
<strong>{{ moneyCent(dashboard.mohong_summary.flow_amount_cent) }}</strong>
<small>{{ dashboard.mohong_summary.paid_order_count }} 笔成功订单</small>
</div>
<div class="metric-card mohong-card">
<span>商城退款</span>
<strong>{{ moneyCent(dashboard.mohong_summary.refund_amount_cent) }}</strong>
<small>已完成退款</small>
</div>
<div class="metric-card mohong-card">
<span>商城渠道净流入</span>
<strong>{{ moneyCent(dashboard.mohong_summary.net_amount_cent) }}</strong>
<small>成交额 - 已退款</small>
</div>
</div>
<div v-if="dashboard?.disbursement_summary" class="section-heading">
<div>
<h2>资金出款</h2>
@@ -241,7 +269,7 @@ function rowOfflinePendingClass(row: FinanceDailyItem) {
<el-table-column label="渠道净流入" width="140">
<template #default="{ row }">{{ moneyCent(row.channel_net_amount_cent) }}</template>
</el-table-column>
<el-table-column label="平台收入" width="130">
<el-table-column label="平台利润" width="130">
<template #default="{ row }">{{ moneyCent(row.platform_income_amount_cent) }}</template>
</el-table-column>
<el-table-column label="号主应得" width="130">
@@ -322,6 +350,10 @@ function rowOfflinePendingClass(row: FinanceDailyItem) {
margin-top: 12px;
}
.mohong-grid {
margin-bottom: 20px;
}
.section-heading {
display: flex;
align-items: flex-end;
@@ -362,6 +394,10 @@ function rowOfflinePendingClass(row: FinanceDailyItem) {
border-left: 3px solid #6366f1;
}
.mohong-card {
border-left: 3px solid #2563eb;
}
.generated-at {
margin: 12px 0 0;
color: #64748b;