mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 05:09:19 +08:00
refactor(概览): 汇总字段 totalCost 重命名为 orderCost,列名统一为订单成本
This commit is contained in:
+3
-3
@@ -181,7 +181,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<OverviewColumnHint :title="storeOverviewHints.otherCost">其他成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalCost">总成本</OverviewColumnHint>
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCost">订单成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.refundAmount">退款金额</OverviewColumnHint>
|
||||
@@ -256,7 +256,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6">{{ cellMoney(cat.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(cat.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">
|
||||
{{ cellMoney(cat.totalCost) }}
|
||||
{{ cellMoney(cat.orderCost) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">
|
||||
{{ cellMoney(cat.refundAmount) }}
|
||||
@@ -301,7 +301,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(categorySummary?.total?.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(categorySummary?.total?.orderCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoney(categorySummary?.total?.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoney(categorySummary?.total?.brushFee) }}</td>
|
||||
|
||||
+4
-4
@@ -75,7 +75,7 @@ const platformData = computed(() => {
|
||||
productCost: p.productCost ?? 0,
|
||||
shippingCost: p.shippingCost ?? 0,
|
||||
otherCost: p.otherCost ?? 0,
|
||||
totalCost: p.totalCost ?? 0,
|
||||
orderCost: p.orderCost ?? 0,
|
||||
refundAmount: p.refundAmount ?? 0,
|
||||
totalPromotionFee: p.totalPromotionFee ?? 0,
|
||||
brushFee: p.brushFee ?? 0,
|
||||
@@ -265,7 +265,7 @@ const sortedData = computed(() => {
|
||||
<OverviewColumnHint :title="storeOverviewHints.otherCost">其他成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalCost">总成本</OverviewColumnHint>
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCost">订单成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.refundAmount">退款金额</OverviewColumnHint>
|
||||
@@ -346,7 +346,7 @@ const sortedData = computed(() => {
|
||||
<td class="p-6">{{ formatAmount(p.productCost) }}</td>
|
||||
<td class="p-6">{{ formatAmount(p.shippingCost) }}</td>
|
||||
<td class="p-6">{{ formatAmount(p.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ formatAmount(p.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ formatAmount(p.orderCost) }}</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">{{ formatAmount(p.refundAmount) }}</td>
|
||||
<td class="p-6">{{ formatAmount(p.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ formatAmount(p.brushFee) }}</td>
|
||||
@@ -388,7 +388,7 @@ const sortedData = computed(() => {
|
||||
<td class="p-6">{{ cellMoney(totalData.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(totalData.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(totalData.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(totalData.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(totalData.orderCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoney(totalData.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoney(totalData.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoney(totalData.brushFee) }}</td>
|
||||
|
||||
+3
-3
@@ -220,7 +220,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<OverviewColumnHint :title="storeOverviewHints.otherCost">其他成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalCost">总成本</OverviewColumnHint>
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCost">订单成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.refundAmount">退款金额</OverviewColumnHint>
|
||||
@@ -334,7 +334,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
{{ cellMoney(shop.otherCost) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">
|
||||
{{ cellMoney(shop.totalCost) }}
|
||||
{{ cellMoney(shop.orderCost) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">
|
||||
{{ cellMoney(shop.refundAmount) }}
|
||||
@@ -403,7 +403,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(shopSummary?.total?.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(shopSummary?.total?.orderCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoney(shopSummary?.total?.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoney(shopSummary?.total?.brushFee) }}</td>
|
||||
|
||||
+23
-7
@@ -109,6 +109,14 @@ function buildCompareMetrics(
|
||||
valueA: z(a, (r) => r.salesAmount),
|
||||
valueB: z(b, (r) => r.salesAmount),
|
||||
},
|
||||
{
|
||||
key: 'gmv',
|
||||
label: 'GMV',
|
||||
hint: overviewTableHints.gmv,
|
||||
format: 'money',
|
||||
valueA: z(a, (r) => r.gmv),
|
||||
valueB: z(b, (r) => r.gmv),
|
||||
},
|
||||
{
|
||||
key: 'orderCount',
|
||||
label: '单量',
|
||||
@@ -150,12 +158,12 @@ function buildCompareMetrics(
|
||||
valueB: z(b, (r) => r.otherCost),
|
||||
},
|
||||
{
|
||||
key: 'totalCost',
|
||||
label: '总成本',
|
||||
hint: overviewTableHints.totalCost,
|
||||
key: 'orderCost',
|
||||
label: '订单成本',
|
||||
hint: overviewTableHints.orderCost,
|
||||
format: 'money',
|
||||
valueA: z(a, (r) => r.totalCost),
|
||||
valueB: z(b, (r) => r.totalCost),
|
||||
valueA: z(a, (r) => r.orderCost),
|
||||
valueB: z(b, (r) => r.orderCost),
|
||||
},
|
||||
{
|
||||
key: 'refundAmount',
|
||||
@@ -189,9 +197,17 @@ function buildCompareMetrics(
|
||||
valueA: feeRatioAsPercent(a),
|
||||
valueB: feeRatioAsPercent(b),
|
||||
},
|
||||
{
|
||||
key: 'grossProfit',
|
||||
label: '毛利',
|
||||
hint: overviewTableHints.grossProfit,
|
||||
format: 'money',
|
||||
valueA: z(a, (r) => r.grossProfit),
|
||||
valueB: z(b, (r) => r.grossProfit),
|
||||
},
|
||||
{
|
||||
key: 'totalProfitBeforeTax',
|
||||
label: '税前盈亏',
|
||||
label: '税前净利',
|
||||
hint: overviewTableHints.totalProfitBeforeTax,
|
||||
format: 'money',
|
||||
valueA: z(a, (r) => r.totalProfitBeforeTax),
|
||||
@@ -215,7 +231,7 @@ function buildCompareMetrics(
|
||||
},
|
||||
{
|
||||
key: 'profitAfterTax',
|
||||
label: '税后盈亏',
|
||||
label: '税后净利',
|
||||
hint: overviewTableHints.profitAfterTax,
|
||||
format: 'money',
|
||||
valueA: z(a, (r) => r.profitAfterTax),
|
||||
|
||||
+21
-9
@@ -148,7 +148,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
{{ props.firstColumnLabel }}
|
||||
</th>
|
||||
<th
|
||||
colspan="3"
|
||||
colspan="4"
|
||||
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-slate-100/50 dark:bg-[hsl(240deg_3.7%_22%/50%)] p-3 text-center"
|
||||
>
|
||||
经营规模维度
|
||||
@@ -160,7 +160,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
成本费用维度
|
||||
</th>
|
||||
<th
|
||||
colspan="5"
|
||||
colspan="6"
|
||||
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%)] p-3 text-center text-emerald-700 dark:text-emerald-200"
|
||||
>
|
||||
盈利分析维度
|
||||
@@ -172,6 +172,9 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
实际销售额
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-black text-amber-700 dark:text-amber-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.gmv">GMV</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4">
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCount">单量</OverviewColumnHint>
|
||||
</th>
|
||||
@@ -188,7 +191,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<OverviewColumnHint :title="storeOverviewHints.otherCost">其他成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalCost">总成本</OverviewColumnHint>
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCost">订单成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.refundAmount">退款金额</OverviewColumnHint>
|
||||
@@ -202,9 +205,12 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<th class="border-b px-6 py-4 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
<OverviewColumnHint :title="storeOverviewHints.feeRatioCategoryRow">费比%</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-l px-6 py-4 font-bold">
|
||||
<th class="border-b border-l px-6 py-4 font-bold text-emerald-700 dark:text-emerald-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.grossProfit">毛利</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalProfitBeforeTax">
|
||||
税前盈亏
|
||||
税前净利
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 italic text-rose-500 dark:text-rose-400">
|
||||
@@ -217,7 +223,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
</th>
|
||||
<th class="border-b bg-emerald-600 dark:bg-emerald-600 px-6 py-4 font-black text-white">
|
||||
<OverviewColumnHint light :title="storeOverviewHints.profitAfterTax">
|
||||
税后盈亏
|
||||
税后净利
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -266,6 +272,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
</span>
|
||||
</td>
|
||||
<td class="p-6 font-black">{{ formatAmount(cat.salesAmount) }}</td>
|
||||
<td class="p-6 font-black text-amber-700 dark:text-amber-400">{{ formatAmount(cat.gmv) }}</td>
|
||||
<td class="p-6 font-medium">{{ formatIntCell(cat.orderCount) }}</td>
|
||||
<td class="p-6 font-medium">
|
||||
{{ cellMoney(cat.averageOrderValue) }}
|
||||
@@ -274,7 +281,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6">{{ cellMoney(cat.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(cat.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">
|
||||
{{ cellMoney(cat.totalCost) }}
|
||||
{{ cellMoney(cat.orderCost) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">
|
||||
{{ cellMoney(cat.refundAmount) }}
|
||||
@@ -286,6 +293,9 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
{{ cat.feeRatio !== undefined ? formatFeeRatioPercent(cat.feeRatio) : '-' }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-emerald-700 dark:text-emerald-400">
|
||||
{{ cellMoney(cat.grossProfit) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold">
|
||||
{{ cellMoney(cat.totalProfitBeforeTax) }}
|
||||
</td>
|
||||
@@ -300,7 +310,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!categorySummary?.categories?.length">
|
||||
<td :colspan="categoryExportMode ? 18 : 17" class="p-8 text-center text-gray-400">
|
||||
<td :colspan="categoryExportMode ? 20 : 19" class="p-8 text-center text-gray-400">
|
||||
暂无数据
|
||||
</td>
|
||||
</tr>
|
||||
@@ -311,6 +321,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="sticky-col bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] p-6 text-base">合计</td>
|
||||
<!-- 规模 -->
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.salesAmount) }}</td>
|
||||
<td class="p-6 text-amber-700 dark:text-amber-400">{{ cellMoney(categorySummary?.total?.gmv) }}</td>
|
||||
<td class="p-6">{{ formatIntCell(categorySummary?.total?.orderCount) }}</td>
|
||||
<td class="p-6">
|
||||
{{ cellMoney(categorySummary?.total?.averageOrderValue) }}
|
||||
@@ -319,12 +330,13 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(categorySummary?.total?.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(categorySummary?.total?.orderCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoney(categorySummary?.total?.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoney(categorySummary?.total?.brushFee) }}</td>
|
||||
<td class="p-6 text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]">{{ categorySummary?.total?.feeRatio !== undefined ? formatFeeRatioPercent(categorySummary?.total?.feeRatio) : '-' }}</td>
|
||||
<!-- 盈利 -->
|
||||
<td class="p-6 text-emerald-700 dark:text-emerald-400">{{ cellMoney(categorySummary?.total?.grossProfit) }}</td>
|
||||
<td class="p-6">{{ cellMoney(categorySummary?.total?.totalProfitBeforeTax) }}</td>
|
||||
<td class="p-6 italic text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoney(categorySummary?.total?.salesTaxAmount) }}</td>
|
||||
<td class="p-6 text-indigo-700 dark:text-indigo-400">{{ cellRoi(categorySummary?.total?.roi) }}</td>
|
||||
|
||||
+25
-9
@@ -70,16 +70,18 @@ const platformData = computed(() => {
|
||||
targetAmount: p.targetAmount ?? 0,
|
||||
salesAmountAchievementRate: p.salesAmountAchievementRate ?? 0,
|
||||
salesAmount: p.salesAmount ?? 0,
|
||||
gmv: p.gmv ?? 0,
|
||||
orderCount: p.orderCount ?? 0,
|
||||
averageOrderValue: p.averageOrderValue ?? 0,
|
||||
productCost: p.productCost ?? 0,
|
||||
shippingCost: p.shippingCost ?? 0,
|
||||
otherCost: p.otherCost ?? 0,
|
||||
totalCost: p.totalCost ?? 0,
|
||||
orderCost: p.orderCost ?? 0,
|
||||
refundAmount: p.refundAmount ?? 0,
|
||||
totalPromotionFee: p.totalPromotionFee ?? 0,
|
||||
brushFee: p.brushFee ?? 0,
|
||||
feeRatio: p.feeRatio ?? 0,
|
||||
grossProfit: p.grossProfit ?? 0,
|
||||
totalProfitBeforeTax: p.totalProfitBeforeTax ?? 0,
|
||||
salesTaxAmount: p.salesTaxAmount ?? 0,
|
||||
roi: p.roi ?? 0,
|
||||
@@ -202,7 +204,7 @@ const sortedData = computed(() => {
|
||||
</th>
|
||||
<!-- 规模 -->
|
||||
<th
|
||||
colspan="3"
|
||||
colspan="4"
|
||||
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] p-3 text-center bg-slate-100/50 dark:bg-[hsl(240deg_3.7%_22%/50%)]"
|
||||
>
|
||||
经营规模维度
|
||||
@@ -216,7 +218,7 @@ const sortedData = computed(() => {
|
||||
</th>
|
||||
<!-- 盈利 -->
|
||||
<th
|
||||
colspan="5"
|
||||
colspan="6"
|
||||
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] p-3 text-center bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%)] text-emerald-700 dark:text-emerald-200"
|
||||
>
|
||||
盈利分析维度
|
||||
@@ -248,6 +250,9 @@ const sortedData = computed(() => {
|
||||
实际销售额
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4 font-black text-amber-700 dark:text-amber-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.gmv">GMV</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4">
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCount">单量</OverviewColumnHint>
|
||||
</th>
|
||||
@@ -265,7 +270,7 @@ const sortedData = computed(() => {
|
||||
<OverviewColumnHint :title="storeOverviewHints.otherCost">其他成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalCost">总成本</OverviewColumnHint>
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCost">订单成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.refundAmount">退款金额</OverviewColumnHint>
|
||||
@@ -280,9 +285,12 @@ const sortedData = computed(() => {
|
||||
<OverviewColumnHint :title="storeOverviewHints.feeRatioPlatform">费比%</OverviewColumnHint>
|
||||
</th>
|
||||
<!-- 盈利子列 -->
|
||||
<th class="border-b border-l border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold text-emerald-700 dark:text-emerald-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.grossProfit">毛利</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-l border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalProfitBeforeTax">
|
||||
税前盈亏
|
||||
税前净利
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
@@ -295,7 +303,7 @@ const sortedData = computed(() => {
|
||||
</th>
|
||||
<th class="border-b bg-emerald-600 dark:bg-emerald-600 px-6 py-4 font-black text-white">
|
||||
<OverviewColumnHint light :title="storeOverviewHints.profitAfterTax">
|
||||
税后盈亏
|
||||
税后净利
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -340,18 +348,22 @@ const sortedData = computed(() => {
|
||||
<td class="p-6 font-black text-blue-600 dark:text-blue-400">{{ formatPercentPlain(p.salesAmountAchievementRate) }}</td>
|
||||
<!-- 规模 -->
|
||||
<td class="p-6 font-black">{{ formatAmount(p.salesAmount) }}</td>
|
||||
<td class="p-6 font-black text-amber-700 dark:text-amber-400">{{ formatAmount(p.gmv) }}</td>
|
||||
<td class="p-6 font-medium">{{ p.orderCount.toLocaleString('zh-CN') }}</td>
|
||||
<td class="p-6 font-medium">{{ formatAmount(p.averageOrderValue) }}</td>
|
||||
<!-- 成本 -->
|
||||
<td class="p-6">{{ formatAmount(p.productCost) }}</td>
|
||||
<td class="p-6">{{ formatAmount(p.shippingCost) }}</td>
|
||||
<td class="p-6">{{ formatAmount(p.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ formatAmount(p.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ formatAmount(p.orderCost) }}</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">{{ formatAmount(p.refundAmount) }}</td>
|
||||
<td class="p-6">{{ formatAmount(p.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ formatAmount(p.brushFee) }}</td>
|
||||
<td class="p-6 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ formatFeeRatioPercent(p.feeRatio) }}</td>
|
||||
<!-- 盈利 -->
|
||||
<td class="p-6 font-bold text-emerald-700 dark:text-emerald-400">
|
||||
{{ formatAmount(p.grossProfit) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold" :class="p.totalProfitBeforeTax >= 0 ? 'text-slate-800 dark:text-[hsl(0deg_0%_95%)]' : 'text-rose-600 dark:text-rose-400'">
|
||||
{{ formatAmount(p.totalProfitBeforeTax) }}
|
||||
</td>
|
||||
@@ -380,6 +392,7 @@ const sortedData = computed(() => {
|
||||
</td>
|
||||
<!-- 规模 -->
|
||||
<td class="p-6">{{ cellMoney(totalData.salesAmount) }}</td>
|
||||
<td class="p-6 text-amber-700 dark:text-amber-400">{{ cellMoney(totalData.gmv) }}</td>
|
||||
<td class="p-6">{{ formatIntCell(totalData.orderCount) }}</td>
|
||||
<td class="p-6">
|
||||
{{ cellMoney(totalData.averageOrderValue) }}
|
||||
@@ -388,7 +401,7 @@ const sortedData = computed(() => {
|
||||
<td class="p-6">{{ cellMoney(totalData.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(totalData.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(totalData.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(totalData.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(totalData.orderCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoney(totalData.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoney(totalData.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoney(totalData.brushFee) }}</td>
|
||||
@@ -396,6 +409,9 @@ const sortedData = computed(() => {
|
||||
{{ totalData.feeRatio !== undefined ? formatFeeRatioPercent(totalData.feeRatio) : '-' }}
|
||||
</td>
|
||||
<!-- 盈利 -->
|
||||
<td class="p-6 text-emerald-700 dark:text-emerald-400">
|
||||
{{ cellMoney(totalData.grossProfit) }}
|
||||
</td>
|
||||
<td class="p-6">
|
||||
{{ cellMoney(totalData.totalProfitBeforeTax) }}
|
||||
</td>
|
||||
@@ -415,7 +431,7 @@ const sortedData = computed(() => {
|
||||
</tfoot>
|
||||
<tfoot v-else class="bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)]">
|
||||
<tr class="text-center text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
<td :colspan="platformExportMode ? 22 : 21" class="p-6">暂无数据</td>
|
||||
<td :colspan="platformExportMode ? 24 : 23" class="p-6">暂无数据</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
+24
-10
@@ -159,7 +159,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
目标达成维度
|
||||
</th>
|
||||
<th
|
||||
colspan="3"
|
||||
colspan="4"
|
||||
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-slate-100/50 dark:bg-[hsl(240deg_3.7%_22%/50%)] p-3 text-center"
|
||||
>
|
||||
经营规模维度
|
||||
@@ -171,7 +171,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
成本费用维度
|
||||
</th>
|
||||
<th
|
||||
colspan="5"
|
||||
colspan="6"
|
||||
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%)] p-3 text-center text-emerald-700 dark:text-emerald-200"
|
||||
>
|
||||
盈利分析维度
|
||||
@@ -203,6 +203,9 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
实际销售额
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-black text-amber-700 dark:text-amber-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.gmv">GMV</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4">
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCount">单量</OverviewColumnHint>
|
||||
</th>
|
||||
@@ -220,7 +223,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<OverviewColumnHint :title="storeOverviewHints.otherCost">其他成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalCost">总成本</OverviewColumnHint>
|
||||
<OverviewColumnHint :title="storeOverviewHints.orderCost">订单成本</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.refundAmount">退款金额</OverviewColumnHint>
|
||||
@@ -235,9 +238,12 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<OverviewColumnHint :title="storeOverviewHints.feeRatioShopRow">费比%</OverviewColumnHint>
|
||||
</th>
|
||||
<!-- 盈利 -->
|
||||
<th class="border-b border-l border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold">
|
||||
<th class="border-b border-l border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] px-6 py-4 font-bold text-emerald-700 dark:text-emerald-400">
|
||||
<OverviewColumnHint :title="storeOverviewHints.grossProfit">毛利</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-bold">
|
||||
<OverviewColumnHint :title="storeOverviewHints.totalProfitBeforeTax">
|
||||
税前盈亏
|
||||
税前净利
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 italic text-rose-500 dark:text-rose-400">
|
||||
@@ -250,7 +256,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
</th>
|
||||
<th class="border-b bg-emerald-600 dark:bg-emerald-600 px-6 py-4 font-black text-white">
|
||||
<OverviewColumnHint light :title="storeOverviewHints.profitAfterTax">
|
||||
税后盈亏
|
||||
税后净利
|
||||
</OverviewColumnHint>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -317,6 +323,9 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6 font-black">
|
||||
{{ formatAmount(shop.salesAmount) }}
|
||||
</td>
|
||||
<td class="p-6 font-black text-amber-700 dark:text-amber-400">
|
||||
{{ formatAmount(shop.gmv) }}
|
||||
</td>
|
||||
<td class="p-6 font-medium">
|
||||
{{ formatIntCell(shop.orderCount) }}
|
||||
</td>
|
||||
@@ -334,7 +343,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
{{ cellMoney(shop.otherCost) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">
|
||||
{{ cellMoney(shop.totalCost) }}
|
||||
{{ cellMoney(shop.orderCost) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">
|
||||
{{ cellMoney(shop.refundAmount) }}
|
||||
@@ -353,6 +362,9 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
}}
|
||||
</td>
|
||||
<!-- 盈利 -->
|
||||
<td class="p-6 font-bold text-emerald-700 dark:text-emerald-400">
|
||||
{{ cellMoney(shop.grossProfit) }}
|
||||
</td>
|
||||
<td class="p-6 font-bold">
|
||||
{{ cellMoney(shop.totalProfitBeforeTax) }}
|
||||
</td>
|
||||
@@ -367,7 +379,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!shopSummary?.shops?.length">
|
||||
<td :colspan="shopExportMode ? 22 : 21" class="p-8 text-center text-gray-400">
|
||||
<td :colspan="shopExportMode ? 24 : 23" class="p-8 text-center text-gray-400">
|
||||
暂无数据
|
||||
</td>
|
||||
</tr>
|
||||
@@ -400,6 +412,7 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
</td>
|
||||
<!-- 规模 -->
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.salesAmount) }}</td>
|
||||
<td class="p-6 text-amber-700 dark:text-amber-400">{{ cellMoney(shopSummary?.total?.gmv) }}</td>
|
||||
<td class="p-6">{{ formatIntCell(shopSummary?.total?.orderCount) }}</td>
|
||||
<td class="p-6">
|
||||
{{ cellMoney(shopSummary?.total?.averageOrderValue) }}
|
||||
@@ -408,12 +421,13 @@ const cellRoi = (v: number | null | undefined) =>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(shopSummary?.total?.totalCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoney(shopSummary?.total?.orderCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoney(shopSummary?.total?.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoney(shopSummary?.total?.brushFee) }}</td>
|
||||
<td class="p-6 text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]">{{ shopSummary?.total?.feeRatio !== undefined ? formatFeeRatioPercent(shopSummary?.total?.feeRatio) : '-' }}</td>
|
||||
<!-- 盈利 -->
|
||||
<td class="p-6 text-emerald-700 dark:text-emerald-400">{{ cellMoney(shopSummary?.total?.grossProfit) }}</td>
|
||||
<td class="p-6">{{ cellMoney(shopSummary?.total?.totalProfitBeforeTax) }}</td>
|
||||
<td class="p-6 italic text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoney(shopSummary?.total?.salesTaxAmount) }}</td>
|
||||
<td class="p-6 text-indigo-700 dark:text-indigo-400">{{ cellRoi(shopSummary?.total?.roi) }}</td>
|
||||
@@ -446,7 +460,7 @@ thead {
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
/* 最后一列(税后盈亏)固定在右侧 */
|
||||
/* 最后一列(税后净利)固定在右侧 */
|
||||
thead tr:last-child th:last-child,
|
||||
tbody td:last-child:not([colspan]),
|
||||
tfoot td:last-child:not([colspan]) {
|
||||
|
||||
+27
-12
@@ -12,17 +12,19 @@ function dimRowToShopSummary(row: WorkbenchVO.DimRow): CompanyOverviewVO.ShopSum
|
||||
const refundAmount = yuanField(row.refundYuan);
|
||||
const grossYuan = yuanField(row.grossProfitYuan);
|
||||
const profitAfterTax = yuanField(row.netProfitYuan);
|
||||
const totalCost = Math.max(0, salesAmount - refundAmount - grossYuan);
|
||||
const orderCost = Math.max(0, salesAmount - refundAmount - grossYuan);
|
||||
const shopId = Number(row.key);
|
||||
return {
|
||||
shopId: Number.isFinite(shopId) ? shopId : 0,
|
||||
shopName: row.name,
|
||||
salesAmount,
|
||||
gmv: 0,
|
||||
refundAmount,
|
||||
totalCost,
|
||||
productCost: totalCost,
|
||||
orderCost,
|
||||
productCost: orderCost,
|
||||
shippingCost: 0,
|
||||
otherCost: 0,
|
||||
grossProfit: grossYuan,
|
||||
totalProfitBeforeTax: grossYuan,
|
||||
profitAfterTax,
|
||||
};
|
||||
@@ -46,16 +48,19 @@ function aggregateShopTotal(
|
||||
targetAmount: sum('targetAmount'),
|
||||
salesAmountAchievementRate: sum('salesAmountAchievementRate'),
|
||||
salesAmount,
|
||||
gmv: sum('gmv'),
|
||||
orderCount: sum('orderCount'),
|
||||
averageOrderValue,
|
||||
productCost: sum('productCost'),
|
||||
shippingCost: sum('shippingCost'),
|
||||
otherCost: sum('otherCost'),
|
||||
totalCost: sum('totalCost'),
|
||||
orderCost: sum('orderCost'),
|
||||
refundAmount: sum('refundAmount'),
|
||||
totalPromotionFee,
|
||||
brushFee: sum('brushFee'),
|
||||
feeRatio,
|
||||
gmv: 0,
|
||||
grossProfit: sum('grossProfit'),
|
||||
totalProfitBeforeTax: sum('totalProfitBeforeTax'),
|
||||
salesTaxAmount: sum('salesTaxAmount'),
|
||||
roi: totalPromotionFee ? salesAmount / totalPromotionFee : 0,
|
||||
@@ -77,7 +82,7 @@ function dimRowToCategorySummary(
|
||||
const refundAmount = yuanField(row.refundYuan);
|
||||
const grossYuan = yuanField(row.grossProfitYuan);
|
||||
const profitAfterTax = yuanField(row.netProfitYuan);
|
||||
const totalCost = Math.max(0, salesAmount - refundAmount - grossYuan);
|
||||
const orderCost = Math.max(0, salesAmount - refundAmount - grossYuan);
|
||||
const rawId = Number(row.key);
|
||||
const categoryId =
|
||||
row.key === '0' || !Number.isFinite(rawId) ? undefined : rawId;
|
||||
@@ -85,11 +90,13 @@ function dimRowToCategorySummary(
|
||||
categoryId,
|
||||
categoryName: row.name,
|
||||
salesAmount,
|
||||
gmv: 0,
|
||||
refundAmount,
|
||||
totalCost,
|
||||
productCost: totalCost,
|
||||
orderCost,
|
||||
productCost: orderCost,
|
||||
shippingCost: 0,
|
||||
otherCost: 0,
|
||||
grossProfit: grossYuan,
|
||||
totalProfitBeforeTax: grossYuan,
|
||||
profitAfterTax,
|
||||
};
|
||||
@@ -108,16 +115,19 @@ function aggregateCategoryTotal(
|
||||
return {
|
||||
categoryName: '合计',
|
||||
salesAmount,
|
||||
gmv: sum('gmv'),
|
||||
orderCount: sum('orderCount'),
|
||||
averageOrderValue,
|
||||
productCost: sum('productCost'),
|
||||
shippingCost: sum('shippingCost'),
|
||||
otherCost: sum('otherCost'),
|
||||
totalCost: sum('totalCost'),
|
||||
orderCost: sum('orderCost'),
|
||||
refundAmount: sum('refundAmount'),
|
||||
totalPromotionFee,
|
||||
brushFee: sum('brushFee'),
|
||||
feeRatio,
|
||||
gmv: 0,
|
||||
grossProfit: sum('grossProfit'),
|
||||
totalProfitBeforeTax: sum('totalProfitBeforeTax'),
|
||||
salesTaxAmount: sum('salesTaxAmount'),
|
||||
roi: totalPromotionFee ? salesAmount / totalPromotionFee : 0,
|
||||
@@ -139,17 +149,19 @@ function dimRowToPlatformSummary(
|
||||
const refundAmount = yuanField(row.refundYuan);
|
||||
const grossYuan = yuanField(row.grossProfitYuan);
|
||||
const profitAfterTax = yuanField(row.netProfitYuan);
|
||||
const totalCost = Math.max(0, salesAmount - refundAmount - grossYuan);
|
||||
const orderCost = Math.max(0, salesAmount - refundAmount - grossYuan);
|
||||
const platformId = Number(row.key);
|
||||
return {
|
||||
platformId: Number.isFinite(platformId) ? platformId : 0,
|
||||
platformName: row.name,
|
||||
salesAmount,
|
||||
gmv: 0,
|
||||
refundAmount,
|
||||
totalCost,
|
||||
productCost: totalCost,
|
||||
orderCost,
|
||||
productCost: orderCost,
|
||||
shippingCost: 0,
|
||||
otherCost: 0,
|
||||
grossProfit: grossYuan,
|
||||
totalProfitBeforeTax: grossYuan,
|
||||
profitAfterTax,
|
||||
};
|
||||
@@ -173,16 +185,19 @@ function aggregatePlatformTotal(
|
||||
targetAmount: sum('targetAmount'),
|
||||
salesAmountAchievementRate: sum('salesAmountAchievementRate'),
|
||||
salesAmount,
|
||||
gmv: sum('gmv'),
|
||||
orderCount: sum('orderCount'),
|
||||
averageOrderValue,
|
||||
productCost: sum('productCost'),
|
||||
shippingCost: sum('shippingCost'),
|
||||
otherCost: sum('otherCost'),
|
||||
totalCost: sum('totalCost'),
|
||||
orderCost: sum('orderCost'),
|
||||
refundAmount: sum('refundAmount'),
|
||||
totalPromotionFee,
|
||||
brushFee: sum('brushFee'),
|
||||
feeRatio,
|
||||
gmv: 0,
|
||||
grossProfit: sum('grossProfit'),
|
||||
totalProfitBeforeTax: sum('totalProfitBeforeTax'),
|
||||
salesTaxAmount: sum('salesTaxAmount'),
|
||||
roi: totalPromotionFee ? salesAmount / totalPromotionFee : 0,
|
||||
|
||||
Reference in New Issue
Block a user