mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:59:19 +08:00
fix: 修复合计行达成率和客单价显示,切换默认标签页为店铺汇总
This commit is contained in:
+7
-1
@@ -284,7 +284,13 @@ const formatAmount = (amount: number) => {
|
||||
<!-- 规模 -->
|
||||
<td class="p-6">{{ categoryComparisons?.total?.salesAmount ? formatAmount(categoryComparisons?.total?.salesAmount) : '-' }}</td>
|
||||
<td class="p-6">{{ categoryComparisons?.total?.orderCount ? categoryComparisons?.total?.orderCount.toLocaleString() : '-' }}</td>
|
||||
<td class="p-6">-</td>
|
||||
<td class="p-6">
|
||||
{{
|
||||
categoryComparisons?.total?.averageOrderValue
|
||||
? formatAmount(categoryComparisons?.total?.averageOrderValue)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<!-- 成本 -->
|
||||
<td class="p-6">{{ categoryComparisons?.total?.productCost ? formatAmount(categoryComparisons?.total?.productCost) : '-' }}</td>
|
||||
<td class="p-6">{{ categoryComparisons?.total?.shippingCost ? formatAmount(categoryComparisons?.total?.shippingCost) : '-' }}</td>
|
||||
|
||||
+2
-2
@@ -44,14 +44,14 @@ const STORAGE_KEY = 'store-overview-tab';
|
||||
const getDefaultMode = (): 'platform' | 'shop' | 'category' => {
|
||||
const stored = localStorage.getItem(STORAGE_KEY);
|
||||
if (stored === 'platform' || stored === 'shop' || stored === 'category') return stored;
|
||||
return 'platform';
|
||||
return 'shop';
|
||||
};
|
||||
const activeMode = ref<'platform' | 'shop' | 'category'>(getDefaultMode());
|
||||
watch(activeMode, (val) => localStorage.setItem(STORAGE_KEY, val));
|
||||
|
||||
const modeOptions = [
|
||||
{ label: '平台汇总', value: 'platform' },
|
||||
{ label: '店铺汇总', value: 'shop' },
|
||||
{ label: '平台汇总', value: 'platform' },
|
||||
{ label: '品类汇总', value: 'category' },
|
||||
];
|
||||
</script>
|
||||
|
||||
+9
-3
@@ -362,13 +362,19 @@ const sortedData = computed(() => {
|
||||
<td class="sticky-col border-r-2 border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] p-6 text-base">合计</td>
|
||||
<!-- 目标 -->
|
||||
<td class="p-6">{{ totalData.targetOrderCount?.toLocaleString() }}</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">-</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">
|
||||
{{ totalData.orderCountAchievementRate !== undefined ? formatPercentPlain(totalData.orderCountAchievementRate) : '-' }}
|
||||
</td>
|
||||
<td class="p-6">{{ totalData.targetAmount ? formatAmount(totalData.targetAmount) : '-' }}</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">-</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">
|
||||
{{ totalData.salesAmountAchievementRate !== undefined ? formatPercentPlain(totalData.salesAmountAchievementRate) : '-' }}
|
||||
</td>
|
||||
<!-- 规模 -->
|
||||
<td class="p-6">{{ totalData.salesAmount ? formatAmount(totalData.salesAmount) : '-' }}</td>
|
||||
<td class="p-6">{{ totalData.orderCount ? totalData.orderCount.toLocaleString() : '-' }}</td>
|
||||
<td class="p-6">-</td>
|
||||
<td class="p-6">
|
||||
{{ totalData.averageOrderValue ? formatAmount(totalData.averageOrderValue) : '-' }}
|
||||
</td>
|
||||
<!-- 成本 -->
|
||||
<td class="p-6">{{ totalData.productCost ? formatAmount(totalData.productCost) : '-' }}</td>
|
||||
<td class="p-6">{{ totalData.shippingCost ? formatAmount(totalData.shippingCost) : '-' }}</td>
|
||||
|
||||
+21
-3
@@ -394,13 +394,31 @@ const formatPercentPlain = (value: number | undefined) => {
|
||||
<td class="p-6 text-base" :class="shopExportMode ? 'border-l-0' : ''">合计</td>
|
||||
<!-- 目标 -->
|
||||
<td class="p-6">{{ shopComparisons?.total?.targetOrderCount?.toLocaleString() }}</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">-</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">
|
||||
{{
|
||||
shopComparisons?.total?.orderCountAchievementRate !== undefined
|
||||
? formatPercentPlain(shopComparisons?.total?.orderCountAchievementRate)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<td class="p-6">{{ shopComparisons?.total?.targetAmount ? formatAmount(shopComparisons?.total?.targetAmount) : '-' }}</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">-</td>
|
||||
<td class="p-6 text-blue-600 dark:text-blue-400">
|
||||
{{
|
||||
shopComparisons?.total?.salesAmountAchievementRate !== undefined
|
||||
? formatPercentPlain(shopComparisons?.total?.salesAmountAchievementRate)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<!-- 规模 -->
|
||||
<td class="p-6">{{ shopComparisons?.total?.salesAmount ? formatAmount(shopComparisons?.total?.salesAmount) : '-' }}</td>
|
||||
<td class="p-6">{{ shopComparisons?.total?.orderCount ? shopComparisons?.total?.orderCount.toLocaleString() : '-' }}</td>
|
||||
<td class="p-6">-</td>
|
||||
<td class="p-6">
|
||||
{{
|
||||
shopComparisons?.total?.averageOrderValue
|
||||
? formatAmount(shopComparisons?.total?.averageOrderValue)
|
||||
: '-'
|
||||
}}
|
||||
</td>
|
||||
<!-- 成本 -->
|
||||
<td class="p-6">{{ shopComparisons?.total?.productCost ? formatAmount(shopComparisons?.total?.productCost) : '-' }}</td>
|
||||
<td class="p-6">{{ shopComparisons?.total?.shippingCost ? formatAmount(shopComparisons?.total?.shippingCost) : '-' }}</td>
|
||||
|
||||
Reference in New Issue
Block a user