mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 06:29:20 +08:00
fix: 统一表格数字单元格显示逻辑,0值显示为数字而非'-'
This commit is contained in:
+17
-9
@@ -8,6 +8,7 @@ import {
|
||||
overviewTableHints,
|
||||
salesTaxColumnHint,
|
||||
} from '#/utils/overview-table-hints';
|
||||
import { formatNumberCell } from '#/utils/overview-table-cells';
|
||||
|
||||
interface SpecData {
|
||||
specId: number;
|
||||
@@ -47,6 +48,13 @@ const formatAmount = (amount: number | undefined) => {
|
||||
return `¥${amount.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
||||
};
|
||||
|
||||
const cellMoney = (v: number | null | undefined) =>
|
||||
formatNumberCell(v, (n) =>
|
||||
`¥${n.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`,
|
||||
);
|
||||
const cellRoi = (v: number | null | undefined) =>
|
||||
formatNumberCell(v, (n) => n.toFixed(2));
|
||||
|
||||
const formatPercent = (value: number | undefined) => {
|
||||
if (value === undefined || value === null) return '-';
|
||||
return `${value.toFixed(1)}%`;
|
||||
@@ -233,23 +241,23 @@ const footerRow = computed(() => props.footerTotal ?? computedFooter.value);
|
||||
</td>
|
||||
<td class="p-5 font-medium">{{ formatAmount(item.averageOrderValue) }}</td>
|
||||
<!-- 成本 -->
|
||||
<td class="p-5">{{ item.productCost ? formatAmount(item.productCost) : '-' }}</td>
|
||||
<td class="p-5">{{ item.shippingCost ? formatAmount(item.shippingCost) : '-' }}</td>
|
||||
<td class="p-5">{{ item.otherCost ? formatAmount(item.otherCost) : '-' }}</td>
|
||||
<td class="p-5">{{ cellMoney(item.productCost) }}</td>
|
||||
<td class="p-5">{{ cellMoney(item.shippingCost) }}</td>
|
||||
<td class="p-5">{{ cellMoney(item.otherCost) }}</td>
|
||||
<td class="p-5 font-bold text-orange-800 dark:text-orange-300">
|
||||
{{ item.totalCost != null ? formatAmount(item.totalCost) : '-' }}
|
||||
{{ cellMoney(item.totalCost) }}
|
||||
</td>
|
||||
<td class="p-5 font-bold text-rose-600 dark:text-rose-400">
|
||||
{{ item.refundAmount ? formatAmount(item.refundAmount) : '-' }}
|
||||
{{ cellMoney(item.refundAmount) }}
|
||||
</td>
|
||||
<td class="p-5">{{ item.promotionFee ? formatAmount(item.promotionFee) : '-' }}</td>
|
||||
<td class="p-5">{{ cellMoney(item.promotionFee) }}</td>
|
||||
<td class="p-5 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ formatPercent(item.feeRatio) }}</td>
|
||||
<!-- 盈利 -->
|
||||
<td class="p-5 font-bold" :class="item.profitBeforeTax >= 0 ? 'text-slate-800 dark:text-[hsl(0deg_0%_95%)]' : 'text-rose-600 dark:text-rose-400'">
|
||||
{{ formatAmount(item.profitBeforeTax) }}
|
||||
</td>
|
||||
<td class="p-5 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ item.salesTaxAmount ? formatAmount(item.salesTaxAmount) : '-' }}</td>
|
||||
<td class="p-5 font-black text-indigo-700 dark:text-indigo-400">{{ item.roi ? item.roi.toFixed(2) : '-' }}</td>
|
||||
<td class="p-5 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoney(item.salesTaxAmount) }}</td>
|
||||
<td class="p-5 font-black text-indigo-700 dark:text-indigo-400">{{ cellRoi(item.roi) }}</td>
|
||||
<td class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-5 text-base font-black" :class="item.profitAfterTax >= 0 ? 'text-emerald-600 dark:text-emerald-400' : 'text-rose-600 dark:text-rose-400'">
|
||||
{{ formatAmount(item.profitAfterTax) }}
|
||||
</td>
|
||||
@@ -279,7 +287,7 @@ const footerRow = computed(() => props.footerTotal ?? computedFooter.value);
|
||||
<td class="p-5 text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]">{{ formatPercent(footerRow.feeRatio) }}</td>
|
||||
<td class="p-5">{{ formatAmount(footerRow.profitBeforeTax) }}</td>
|
||||
<td class="p-5 italic text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]">{{ formatAmount(footerRow.salesTaxAmount) }}</td>
|
||||
<td class="p-5 text-indigo-700 dark:text-indigo-400">{{ footerRow.roi ? footerRow.roi.toFixed(2) : '-' }}</td>
|
||||
<td class="p-5 text-indigo-700 dark:text-indigo-400">{{ cellRoi(footerRow.roi) }}</td>
|
||||
<td class="bg-emerald-100 dark:bg-emerald-900/30 p-5 text-base text-emerald-600 dark:text-emerald-400">{{ formatAmount(footerRow.profitAfterTax) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
+29
-37
@@ -2,6 +2,7 @@
|
||||
import type { ShopVO } from '#/api/ecommerce/shop/types';
|
||||
|
||||
import { formatFeeRatioPercent } from '#/utils/overview-fee-ratio';
|
||||
import { formatIntCell, formatNumberCell } from '#/utils/overview-table-cells';
|
||||
import {
|
||||
formatCurrencyZhFromApi,
|
||||
formatNumberZhFromApiOptional,
|
||||
@@ -29,6 +30,9 @@ interface Emits {
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const cellMoneyApi = (v: number | null | undefined) =>
|
||||
formatNumberCell(v, formatCurrencyZhFromApi);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -203,24 +207,20 @@ const emit = defineEmits<Emits>();
|
||||
</span>
|
||||
</td>
|
||||
<td class="p-6 font-black">{{ formatCurrencyZhFromApi(cat.salesAmount) }}</td>
|
||||
<td class="p-6">{{ cat.orderCount?.toLocaleString('zh-CN') || '-' }}</td>
|
||||
<td class="p-6">{{
|
||||
cat.averageOrderValue != null
|
||||
? formatCurrencyZhFromApi(cat.averageOrderValue)
|
||||
: '-'
|
||||
}}</td>
|
||||
<td class="border-l dark:border-l-[hsl(240deg_3.7%_22%)] p-6 text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">{{ cat.productCost ? formatCurrencyZhFromApi(cat.productCost) : '-' }}</td>
|
||||
<td class="p-6 text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">{{ cat.shippingCost ? formatCurrencyZhFromApi(cat.shippingCost) : '-' }}</td>
|
||||
<td class="p-6 text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">{{ cat.otherCost ? formatCurrencyZhFromApi(cat.otherCost) : '-' }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cat.totalCost != null ? formatCurrencyZhFromApi(cat.totalCost) : '-' }}</td>
|
||||
<td class="border-l dark:border-l-[hsl(240deg_3.7%_22%)] p-6 font-bold text-rose-600 dark:text-rose-400">{{ cat.refundAmount ? formatCurrencyZhFromApi(cat.refundAmount) : '-' }}</td>
|
||||
<td class="p-6 text-amber-600 dark:text-amber-400">{{ cat.totalPromotionFee ? formatCurrencyZhFromApi(cat.totalPromotionFee) : '-' }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cat.brushFee ? formatCurrencyZhFromApi(cat.brushFee) : '-' }}</td>
|
||||
<td class="p-6">{{ formatIntCell(cat.orderCount) }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(cat.averageOrderValue) }}</td>
|
||||
<td class="border-l dark:border-l-[hsl(240deg_3.7%_22%)] p-6 text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoneyApi(cat.productCost) }}</td>
|
||||
<td class="p-6 text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoneyApi(cat.shippingCost) }}</td>
|
||||
<td class="p-6 text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoneyApi(cat.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoneyApi(cat.totalCost) }}</td>
|
||||
<td class="border-l dark:border-l-[hsl(240deg_3.7%_22%)] p-6 font-bold text-rose-600 dark:text-rose-400">{{ cellMoneyApi(cat.refundAmount) }}</td>
|
||||
<td class="p-6 text-amber-600 dark:text-amber-400">{{ cellMoneyApi(cat.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoneyApi(cat.brushFee) }}</td>
|
||||
<td class="p-6 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ cat.feeRatio !== undefined ? formatFeeRatioPercent(cat.feeRatio) : '-' }}</td>
|
||||
<td class="border-l border-slate-100 p-6 font-bold dark:border-l-[hsl(240deg_3.7%_22%)]">
|
||||
{{ cat.totalProfitBeforeTax ? formatCurrencyZhFromApi(cat.totalProfitBeforeTax) : '-' }}
|
||||
{{ cellMoneyApi(cat.totalProfitBeforeTax) }}
|
||||
</td>
|
||||
<td class="p-6 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ cat.salesTaxAmount ? formatCurrencyZhFromApi(cat.salesTaxAmount) : '-' }}</td>
|
||||
<td class="p-6 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ cellMoneyApi(cat.salesTaxAmount) }}</td>
|
||||
<td class="p-6 font-black text-indigo-700 dark:text-indigo-400">{{
|
||||
formatNumberZhFromApiOptional(cat.roi)
|
||||
}}</td>
|
||||
@@ -228,11 +228,7 @@ const emit = defineEmits<Emits>();
|
||||
class="bg-emerald-50 p-6 text-base font-black dark:bg-emerald-950"
|
||||
:class="(cat.profitAfterTax ?? 0) < 0 ? 'text-rose-600 dark:text-rose-400' : 'text-emerald-600 dark:text-emerald-300'"
|
||||
>
|
||||
{{
|
||||
cat.profitAfterTax != null
|
||||
? formatCurrencyZhFromApi(cat.profitAfterTax)
|
||||
: '-'
|
||||
}}
|
||||
{{ cellMoneyApi(cat.profitAfterTax) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!props.data?.categoryOverview?.categories?.length">
|
||||
@@ -245,30 +241,26 @@ const emit = defineEmits<Emits>();
|
||||
<tr class="font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]">
|
||||
<td v-if="props.categoryExportMode" class="sticky-col border-r border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] p-6 text-center" style="left: 40px; position: sticky; z-index: 10;"></td>
|
||||
<td class="sticky-col border-r-2 border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4 text-base font-black" style="left: 0; position: sticky; z-index: 10;">合计</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.salesAmount ? formatCurrencyZhFromApi(props.data.categoryOverview.total.salesAmount) : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.orderCount ? props.data.categoryOverview.total.orderCount.toLocaleString() : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.averageOrderValue != null ? formatCurrencyZhFromApi(props.data.categoryOverview.total.averageOrderValue) : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.productCost ? formatCurrencyZhFromApi(props.data.categoryOverview.total.productCost) : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.shippingCost ? formatCurrencyZhFromApi(props.data.categoryOverview.total.shippingCost) : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.otherCost ? formatCurrencyZhFromApi(props.data.categoryOverview.total.otherCost) : '-' }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ props.data.categoryOverview.total.totalCost != null ? formatCurrencyZhFromApi(props.data.categoryOverview.total.totalCost) : '-' }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ props.data.categoryOverview.total.refundAmount ? formatCurrencyZhFromApi(props.data.categoryOverview.total.refundAmount) : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.totalPromotionFee ? formatCurrencyZhFromApi(props.data.categoryOverview.total.totalPromotionFee) : '-' }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ props.data.categoryOverview.total.brushFee ? formatCurrencyZhFromApi(props.data.categoryOverview.total.brushFee) : '-' }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.salesAmount) }}</td>
|
||||
<td class="p-6">{{ formatIntCell(props.data.categoryOverview.total.orderCount) }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.averageOrderValue) }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.productCost) }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.shippingCost) }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.otherCost) }}</td>
|
||||
<td class="p-6 font-bold text-orange-800 dark:text-orange-300">{{ cellMoneyApi(props.data.categoryOverview.total.totalCost) }}</td>
|
||||
<td class="p-6 text-rose-600 dark:text-rose-400">{{ cellMoneyApi(props.data.categoryOverview.total.refundAmount) }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.totalPromotionFee) }}</td>
|
||||
<td class="p-6 text-orange-600 dark:text-orange-400">{{ cellMoneyApi(props.data.categoryOverview.total.brushFee) }}</td>
|
||||
<td class="p-6 text-slate-400">{{ props.data.categoryOverview.total.feeRatio !== undefined ? formatFeeRatioPercent(props.data.categoryOverview.total.feeRatio) : '-' }}</td>
|
||||
<td class="p-6">{{ props.data.categoryOverview.total.totalProfitBeforeTax ? formatCurrencyZhFromApi(props.data.categoryOverview.total.totalProfitBeforeTax) : '-' }}</td>
|
||||
<td class="p-6 italic text-slate-400">{{ props.data.categoryOverview.total.salesTaxAmount ? formatCurrencyZhFromApi(props.data.categoryOverview.total.salesTaxAmount) : '-' }}</td>
|
||||
<td class="p-6">{{ cellMoneyApi(props.data.categoryOverview.total.totalProfitBeforeTax) }}</td>
|
||||
<td class="p-6 italic text-slate-400">{{ cellMoneyApi(props.data.categoryOverview.total.salesTaxAmount) }}</td>
|
||||
<td class="p-6 text-indigo-700 dark:text-indigo-400">{{
|
||||
formatNumberZhFromApiOptional(props.data.categoryOverview.total.roi)
|
||||
}}</td>
|
||||
<td
|
||||
class="bg-emerald-100 p-6 text-base dark:bg-emerald-950"
|
||||
:class="(props.data.categoryOverview.total.profitAfterTax ?? 0) < 0 ? 'text-rose-600 dark:text-rose-400' : 'text-emerald-800 dark:text-emerald-300'"
|
||||
>{{
|
||||
props.data.categoryOverview.total.profitAfterTax != null
|
||||
? formatCurrencyZhFromApi(props.data.categoryOverview.total.profitAfterTax)
|
||||
: '-'
|
||||
}}</td>
|
||||
>{{ cellMoneyApi(props.data.categoryOverview.total.profitAfterTax) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
+29
-37
@@ -6,6 +6,7 @@ import { Button } from 'ant-design-vue';
|
||||
|
||||
import { getOverviewDateQueryFromLocation } from '#/utils/overview-date-range';
|
||||
import { formatFeeRatioPercent } from '#/utils/overview-fee-ratio';
|
||||
import { formatIntCell, formatNumberCell } from '#/utils/overview-table-cells';
|
||||
import {
|
||||
formatCurrencyZhFromApi,
|
||||
formatNumberZhFromApiOptional,
|
||||
@@ -31,6 +32,9 @@ const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
const router = useRouter();
|
||||
|
||||
const cellMoneyApi = (v: number | null | undefined) =>
|
||||
formatNumberCell(v, formatCurrencyZhFromApi);
|
||||
|
||||
function goToProductOverview(productId: number) {
|
||||
const q = getOverviewDateQueryFromLocation();
|
||||
router.push(
|
||||
@@ -192,24 +196,20 @@ function goToProductOverview(productId: number) {
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 font-black">{{ formatCurrencyZhFromApi(product.salesAmount) }}</td>
|
||||
<td class="px-6 py-4 font-medium">{{ product.orderCount?.toLocaleString('zh-CN') || '-' }}</td>
|
||||
<td class="px-6 py-4">{{
|
||||
product.averageOrderValue != null
|
||||
? formatCurrencyZhFromApi(product.averageOrderValue)
|
||||
: '-'
|
||||
}}</td>
|
||||
<td class="px-6 py-4">{{ product.productCost ? formatCurrencyZhFromApi(product.productCost) : '-' }}</td>
|
||||
<td class="px-6 py-4">{{ product.shippingCost ? formatCurrencyZhFromApi(product.shippingCost) : '-' }}</td>
|
||||
<td class="px-6 py-4">{{ product.otherCost ? formatCurrencyZhFromApi(product.otherCost) : '-' }}</td>
|
||||
<td class="px-6 py-4 font-medium">{{ formatIntCell(product.orderCount) }}</td>
|
||||
<td class="px-6 py-4">{{ cellMoneyApi(product.averageOrderValue) }}</td>
|
||||
<td class="px-6 py-4">{{ cellMoneyApi(product.productCost) }}</td>
|
||||
<td class="px-6 py-4">{{ cellMoneyApi(product.shippingCost) }}</td>
|
||||
<td class="px-6 py-4">{{ cellMoneyApi(product.otherCost) }}</td>
|
||||
<td class="px-6 py-4 font-bold text-orange-800 dark:text-orange-300">
|
||||
{{ product.totalCost != null ? formatCurrencyZhFromApi(product.totalCost) : '-' }}
|
||||
{{ cellMoneyApi(product.totalCost) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 font-bold text-rose-500 dark:text-rose-400">
|
||||
{{ product.refundAmount ? formatCurrencyZhFromApi(product.refundAmount) : '-' }}
|
||||
{{ cellMoneyApi(product.refundAmount) }}
|
||||
</td>
|
||||
<td class="px-6 py-4">{{ product.totalPromotionFee ? formatCurrencyZhFromApi(product.totalPromotionFee) : '-' }}</td>
|
||||
<td class="px-6 py-4">{{ cellMoneyApi(product.totalPromotionFee) }}</td>
|
||||
<td class="px-6 py-4 text-amber-500 dark:text-amber-400">
|
||||
{{ product.brushFee ? formatCurrencyZhFromApi(product.brushFee) : '-' }}
|
||||
{{ cellMoneyApi(product.brushFee) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
{{ product.feeRatio !== undefined ? formatFeeRatioPercent(product.feeRatio) : '-' }}
|
||||
@@ -218,20 +218,16 @@ function goToProductOverview(productId: number) {
|
||||
{{ formatNumberZhFromApiOptional(product.roi) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 font-bold text-slate-600 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
{{ product.totalProfitBeforeTax ? formatCurrencyZhFromApi(product.totalProfitBeforeTax) : '-' }}
|
||||
{{ cellMoneyApi(product.totalProfitBeforeTax) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">
|
||||
{{ product.salesTaxAmount ? formatCurrencyZhFromApi(product.salesTaxAmount) : '-' }}
|
||||
{{ cellMoneyApi(product.salesTaxAmount) }}
|
||||
</td>
|
||||
<td
|
||||
class="bg-emerald-50/30 dark:bg-[hsl(142deg_71.8%_29%/20%)] px-6 py-4 text-base font-black"
|
||||
:class="(product.profitAfterTax ?? 0) < 0 ? 'text-rose-500 dark:text-rose-400' : 'text-emerald-600 dark:text-emerald-400'"
|
||||
>
|
||||
{{
|
||||
product.profitAfterTax != null
|
||||
? formatCurrencyZhFromApi(product.profitAfterTax)
|
||||
: '-'
|
||||
}}
|
||||
{{ cellMoneyApi(product.profitAfterTax) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!data?.productOverview?.products?.length">
|
||||
@@ -243,30 +239,26 @@ function goToProductOverview(productId: number) {
|
||||
<tfoot v-if="data?.productOverview?.total">
|
||||
<tr class="font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]">
|
||||
<td class="sticky-col sticky bottom-0 border-r-2 border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4 text-base font-black" style="left: 0; z-index: 30;">合计</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.salesAmount ? formatCurrencyZhFromApi(data.productOverview.total.salesAmount) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.orderCount ? data.productOverview.total.orderCount.toLocaleString() : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.averageOrderValue != null ? formatCurrencyZhFromApi(data.productOverview.total.averageOrderValue) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.productCost ? formatCurrencyZhFromApi(data.productOverview.total.productCost) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.shippingCost ? formatCurrencyZhFromApi(data.productOverview.total.shippingCost) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.otherCost ? formatCurrencyZhFromApi(data.productOverview.total.otherCost) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 font-bold text-orange-800 dark:text-orange-300 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.totalCost != null ? formatCurrencyZhFromApi(data.productOverview.total.totalCost) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 text-rose-500 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-rose-400 px-6 py-4">{{ data.productOverview.total.refundAmount ? formatCurrencyZhFromApi(data.productOverview.total.refundAmount) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.totalPromotionFee ? formatCurrencyZhFromApi(data.productOverview.total.totalPromotionFee) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 text-amber-500 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-amber-400 px-6 py-4">{{ data.productOverview.total.brushFee ? formatCurrencyZhFromApi(data.productOverview.total.brushFee) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.salesAmount) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ formatIntCell(data.productOverview.total.orderCount) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.averageOrderValue) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.productCost) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.shippingCost) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.otherCost) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 font-bold text-orange-800 dark:text-orange-300 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.totalCost) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 text-rose-500 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-rose-400 px-6 py-4">{{ cellMoneyApi(data.productOverview.total.refundAmount) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.totalPromotionFee) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 text-amber-500 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-amber-400 px-6 py-4">{{ cellMoneyApi(data.productOverview.total.brushFee) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 text-slate-400 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-[hsl(240deg_5%_64.9%)] px-6 py-4">{{ data.productOverview.total.feeRatio !== undefined ? formatFeeRatioPercent(data.productOverview.total.feeRatio) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 text-indigo-700 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-indigo-400 px-6 py-4">{{
|
||||
formatNumberZhFromApiOptional(data.productOverview.total.roi)
|
||||
}}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ data.productOverview.total.totalProfitBeforeTax ? formatCurrencyZhFromApi(data.productOverview.total.totalProfitBeforeTax) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 italic text-slate-400 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-[hsl(240deg_5%_64.9%)] px-6 py-4">{{ data.productOverview.total.salesTaxAmount ? formatCurrencyZhFromApi(data.productOverview.total.salesTaxAmount) : '-' }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.totalProfitBeforeTax) }}</td>
|
||||
<td class="sticky bottom-0 bg-slate-100 italic text-slate-400 dark:bg-[hsl(240deg_3.7%_22%)] dark:text-[hsl(240deg_5%_64.9%)] px-6 py-4">{{ cellMoneyApi(data.productOverview.total.salesTaxAmount) }}</td>
|
||||
<td
|
||||
class="sticky bottom-0 bg-emerald-100 px-6 py-4 text-base dark:bg-emerald-950"
|
||||
:class="(data.productOverview.total.profitAfterTax ?? 0) < 0 ? 'text-rose-600 dark:text-rose-400' : 'text-emerald-800 dark:text-emerald-300'"
|
||||
>{{
|
||||
data.productOverview.total.profitAfterTax != null
|
||||
? formatCurrencyZhFromApi(data.productOverview.total.profitAfterTax)
|
||||
: '-'
|
||||
}}</td>
|
||||
>{{ cellMoneyApi(data.productOverview.total.profitAfterTax) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user