mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 06:29:20 +08:00
feat: 公司概览新增各品类多维度经营明细对比表
- CompanyOverviewVO: 新增CategoryComparison品类对比数据VO - CompanyOverviewServiceImpl: 新增calculateCategoryComparisons()按品类汇总订单数据 - 按商品categoryId分组,未分配品类的归入其他品类 - 推广费/刷单费按品类各店铺销售额占比分摊 - types.vo.ts: 新增CategoryComparison接口 - company-overview/index.vue: 新增品类经营明细对比表格
This commit is contained in:
@@ -1200,6 +1200,189 @@ const handleExportSelectedShops = async () => {
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第四层:品类多维度经营明细对比 -->
|
||||
<div
|
||||
class="overflow-hidden rounded-2xl border border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] bg-white/90 dark:bg-[hsl(222.34deg_10.43%_12.27%)] shadow-[0_4px_12px_rgba(0,0,0,0.03)] dark:shadow-none backdrop-blur-[10px]"
|
||||
>
|
||||
<div
|
||||
class="flex flex-col items-start justify-between gap-4 border-b border-slate-100 dark:border-b-[hsl(240deg_3.7%_22%)] p-8 md:flex-row md:items-center"
|
||||
>
|
||||
<div>
|
||||
<h3 class="text-xl font-black text-slate-800 dark:text-[hsl(0deg_0%_95%)]">
|
||||
各品类多维度经营明细对比
|
||||
</h3>
|
||||
<p class="mt-1 text-xs font-bold text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
包含:规模、成本及最终损益所有维度
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-container overflow-x-auto">
|
||||
<table class="w-full whitespace-nowrap text-left text-sm">
|
||||
<thead
|
||||
class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-xs font-black uppercase text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]"
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
rowspan="2"
|
||||
class="sticky-col border-b p-6 text-base font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)] border-r-2 border-slate-100 dark:border-[hsl(240deg_3.7%_22%)] bg-white dark:bg-[hsl(222.34deg_10.43%_12.27%)] shadow-sm dark:shadow-none"
|
||||
>
|
||||
品类名称
|
||||
</th>
|
||||
<th
|
||||
colspan="3"
|
||||
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"
|
||||
>
|
||||
经营规模维度
|
||||
</th>
|
||||
<th
|
||||
colspan="5"
|
||||
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-orange-50/50 dark:bg-[hsl(24deg_9.8%_15%/50%)] p-3 text-center text-orange-700 dark:text-orange-400"
|
||||
>
|
||||
成本费用维度
|
||||
</th>
|
||||
<th
|
||||
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-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-3 text-center text-emerald-700 dark:text-emerald-400"
|
||||
>
|
||||
盈利分析维度
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="bg-slate-50/80 dark:bg-[hsl(240deg_3.7%_15.9%/80)] text-sm">
|
||||
<th
|
||||
class="border-b border-l px-6 py-4 font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]"
|
||||
>
|
||||
实际销售额
|
||||
</th>
|
||||
<th class="border-b px-6 py-4">单量</th>
|
||||
<th class="border-b px-6 py-4">客单价</th>
|
||||
<th class="border-b border-l px-6 py-4">商品成本</th>
|
||||
<th class="border-b px-6 py-4">运费</th>
|
||||
<th class="border-b px-6 py-4">其他成本</th>
|
||||
<th class="border-b px-6 py-4 font-bold text-rose-600 dark:text-rose-400">
|
||||
退款金额
|
||||
</th>
|
||||
<th class="border-b px-6 py-4">推广费</th>
|
||||
<th class="border-b px-6 py-4 text-orange-600 dark:text-orange-400">刷单费用</th>
|
||||
<th class="border-b px-6 py-4 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">费比 %</th>
|
||||
<th class="border-b border-l px-6 py-4 font-bold">
|
||||
税前盈亏
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 italic text-rose-500 dark:text-rose-400">
|
||||
{{ (taxRate * 100).toFixed(0) }}%税额
|
||||
</th>
|
||||
<th class="border-b px-6 py-4 font-black text-indigo-700 dark:text-indigo-400">
|
||||
ROI
|
||||
</th>
|
||||
<th
|
||||
class="border-b bg-emerald-600 dark:bg-emerald-600 px-6 py-4 font-black text-white"
|
||||
>
|
||||
税后盈亏
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100 dark:divide-[hsl(240deg_3.7%_22%)]">
|
||||
<tr
|
||||
v-for="cat in overviewData?.categoryComparisons"
|
||||
:key="cat.categoryId ?? 'uncategorized'"
|
||||
class="transition-colors hover:bg-blue-50/50 dark:hover:bg-[hsl(217.2deg_32.6%_17.5%/30%)] dark:bg-[hsl(217.2deg_32.6%_17.5%/50%)]"
|
||||
>
|
||||
<td
|
||||
class="sticky-col border-r-2 border-slate-100 dark:border-[hsl(240deg_3.7%_22%)] bg-white dark:bg-[hsl(222.34deg_10.43%_12.27%)] p-6 font-bold shadow-sm dark:shadow-none"
|
||||
>
|
||||
<span
|
||||
class="text-blue-600 dark:text-blue-400 transition-colors hover:text-blue-300 hover:underline"
|
||||
>
|
||||
{{ cat.categoryName }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="p-6 font-black">
|
||||
{{ formatAmount(cat.salesAmount) }}
|
||||
</td>
|
||||
<td class="p-6 font-medium">
|
||||
{{ cat.orderCount?.toLocaleString('zh-CN') || '-' }}
|
||||
</td>
|
||||
<td class="p-6 font-medium">
|
||||
{{
|
||||
cat.averageOrderValue
|
||||
? formatAmount(cat.averageOrderValue)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6">
|
||||
{{
|
||||
cat.productCost ? formatAmount(cat.productCost) : '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6">
|
||||
{{
|
||||
cat.shippingCost ? formatAmount(cat.shippingCost) : '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6">
|
||||
{{
|
||||
cat.otherCost ? formatAmount(cat.otherCost) : '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6 font-bold text-rose-600 dark:text-rose-400">
|
||||
{{
|
||||
cat.refundAmount ? formatAmount(cat.refundAmount) : '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6">
|
||||
{{
|
||||
cat.totalPromotionFee
|
||||
? formatAmount(cat.totalPromotionFee)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">
|
||||
{{ cat.brushFee ? formatAmount(cat.brushFee) : '-' }}
|
||||
</td>
|
||||
<td class="p-6 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
{{
|
||||
cat.feeRatio !== undefined
|
||||
? formatPercentPlain(cat.feeRatio)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6 font-bold">
|
||||
{{
|
||||
cat.totalProfitBeforeTax
|
||||
? formatAmount(cat.totalProfitBeforeTax)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
{{
|
||||
cat.salesTaxAmount
|
||||
? formatAmount(cat.salesTaxAmount)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6 font-black text-indigo-700 dark:text-indigo-400">
|
||||
{{ cat.roi?.toFixed(2) || '-' }}
|
||||
</td>
|
||||
<td
|
||||
class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-6 text-base font-black text-emerald-600"
|
||||
>
|
||||
{{
|
||||
cat.profitAfterTax
|
||||
? formatAmount(cat.profitAfterTax)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!overviewData?.categoryComparisons?.length">
|
||||
<td colspan="12" class="p-8 text-center text-gray-400">
|
||||
暂无数据
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user