feat: 经营概览四张汇总表透出成交量与净销量

This commit is contained in:
2026-09-02 22:43:06 +08:00
parent acf8e06c86
commit 76df7701b2
18 changed files with 260 additions and 37 deletions
@@ -100,6 +100,10 @@ export namespace CompanyOverviewVO {
salesOrderCount?: number;
/** 成交单量 */
dealOrderCount?: number;
/** 成交量(件数) */
dealQuantitySum?: number;
/** 净销量(件数) */
salesQuantitySum?: number;
/** 净销售客单价 */
salesAverageOrderValue?: number;
/** 成交客单价 */
@@ -129,6 +133,8 @@ export namespace CompanyOverviewVO {
dealAmount?: number;
salesOrderCount?: number;
dealOrderCount?: number;
dealQuantitySum?: number;
salesQuantitySum?: number;
salesAverageOrderValue?: number;
dealAverageOrderValue?: number;
productCost?: number;
@@ -158,6 +164,8 @@ export namespace CompanyOverviewVO {
dealAmount?: number;
salesOrderCount?: number;
dealOrderCount?: number;
dealQuantitySum?: number;
salesQuantitySum?: number;
salesAverageOrderValue?: number;
dealAverageOrderValue?: number;
productCost?: number;
@@ -99,6 +99,8 @@ export namespace ProductDTO {
skuCode?: string;
/** SKU 名称(模糊查询) */
skuName?: string;
/** 类目 ID(含自身及全部下级) */
categoryId?: number;
/** 关键字(模糊查询商品名称、商品编码、SKU 名称、SKU 编码) */
keywords?: string;
}
@@ -14,6 +14,8 @@ export const overviewTableHints = {
salesAmountShort: '成交金额 − 退款额(不含已取消、未知订单)。',
salesOrderCount: '净销售单量 = 成交单量 − 退款单量。',
dealOrderCount: '计入成交状态的订单笔数(不含已取消、未知)。',
dealQuantitySum: '计入成交状态的商品件数合计(不含已取消、未知)。',
salesQuantitySum: '净销量 = 成交量 − 退款件数。',
salesAverageOrderValue: '净销售额 / 净销售单量。',
dealAverageOrderValue: '成交金额 / 成交单量。',
/** @deprecated 使用 salesOrderCount */
@@ -148,7 +148,7 @@ const cellRoi = (v: number | null | undefined) =>
{{ props.firstColumnLabel }}
</th>
<th
colspan="6"
colspan="8"
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"
>
经营规模维度
@@ -181,6 +181,12 @@ const cellRoi = (v: number | null | undefined) =>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.salesOrderCount">净销售单量</OverviewColumnHint>
</th>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.dealQuantitySum">成交量</OverviewColumnHint>
</th>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.salesQuantitySum">净销量</OverviewColumnHint>
</th>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.dealAverageOrderValue">成交客单价</OverviewColumnHint>
</th>
@@ -281,6 +287,8 @@ const cellRoi = (v: number | null | undefined) =>
<td class="p-6 font-black"><AnimatedMoneyCell :value="cat.salesAmount" /></td>
<td class="p-6 font-medium">{{ formatIntCell(cat.dealOrderCount) }}</td>
<td class="p-6 font-medium">{{ formatIntCell(cat.salesOrderCount) }}</td>
<td class="p-6 font-medium">{{ formatIntCell(cat.dealQuantitySum) }}</td>
<td class="p-6 font-medium">{{ formatIntCell(cat.salesQuantitySum) }}</td>
<td class="p-6 font-medium"><AnimatedMoneyCell :value="cat.dealAverageOrderValue" /></td>
<td class="p-6 font-medium">
<AnimatedMoneyCell :value="cat.salesAverageOrderValue" />
@@ -332,6 +340,8 @@ const cellRoi = (v: number | null | undefined) =>
<td class="p-6"><AnimatedMoneyCell :value="categorySummary?.total?.salesAmount" /></td>
<td class="p-6">{{ formatIntCell(categorySummary?.total?.dealOrderCount) }}</td>
<td class="p-6">{{ formatIntCell(categorySummary?.total?.salesOrderCount) }}</td>
<td class="p-6">{{ formatIntCell(categorySummary?.total?.dealQuantitySum) }}</td>
<td class="p-6">{{ formatIntCell(categorySummary?.total?.salesQuantitySum) }}</td>
<td class="p-6"><AnimatedMoneyCell :value="categorySummary?.total?.dealAverageOrderValue" /></td>
<td class="p-6">
<AnimatedMoneyCell :value="categorySummary?.total?.salesAverageOrderValue" />
@@ -73,6 +73,8 @@ const platformData = computed(() => {
dealAmount: p.dealAmount ?? 0,
salesOrderCount: p.salesOrderCount ?? 0,
dealOrderCount: p.dealOrderCount ?? 0,
dealQuantitySum: p.dealQuantitySum ?? 0,
salesQuantitySum: p.salesQuantitySum ?? 0,
salesAverageOrderValue: p.salesAverageOrderValue ?? 0,
dealAverageOrderValue: p.dealAverageOrderValue ?? 0,
productCost: p.productCost ?? 0,
@@ -206,7 +208,7 @@ const sortedData = computed(() => {
</th>
<!-- 规模 -->
<th
colspan="6"
colspan="8"
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%)]"
>
经营规模维度
@@ -261,6 +263,12 @@ const sortedData = computed(() => {
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.salesOrderCount">净销售单量</OverviewColumnHint>
</th>
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.dealQuantitySum">成交量</OverviewColumnHint>
</th>
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.salesQuantitySum">净销量</OverviewColumnHint>
</th>
<th class="border-b border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.dealAverageOrderValue">成交客单价</OverviewColumnHint>
</th>
@@ -359,6 +367,8 @@ const sortedData = computed(() => {
<td class="p-6 font-black"><AnimatedMoneyCell :value="p.salesAmount" /></td>
<td class="p-6 font-medium">{{ formatIntCell(p.dealOrderCount) }}</td>
<td class="p-6 font-medium">{{ formatIntCell(p.salesOrderCount) }}</td>
<td class="p-6 font-medium">{{ formatIntCell(p.dealQuantitySum) }}</td>
<td class="p-6 font-medium">{{ formatIntCell(p.salesQuantitySum) }}</td>
<td class="p-6 font-medium"><AnimatedMoneyCell :value="p.dealAverageOrderValue" /></td>
<td class="p-6 font-medium"><AnimatedMoneyCell :value="p.salesAverageOrderValue" /></td>
<!-- 成本 -->
@@ -405,6 +415,8 @@ const sortedData = computed(() => {
<td class="p-6"><AnimatedMoneyCell :value="totalData.salesAmount" /></td>
<td class="p-6">{{ formatIntCell(totalData.dealOrderCount) }}</td>
<td class="p-6">{{ formatIntCell(totalData.salesOrderCount) }}</td>
<td class="p-6">{{ formatIntCell(totalData.dealQuantitySum) }}</td>
<td class="p-6">{{ formatIntCell(totalData.salesQuantitySum) }}</td>
<td class="p-6">
<AnimatedMoneyCell :value="totalData.dealAverageOrderValue" />
</td>
@@ -152,7 +152,7 @@ const cellRoi = (v: number | null | undefined) =>
目标达成维度
</th>
<th
colspan="6"
colspan="8"
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"
>
经营规模维度
@@ -205,6 +205,12 @@ const cellRoi = (v: number | null | undefined) =>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.salesOrderCount">净销售单量</OverviewColumnHint>
</th>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.dealQuantitySum">成交量</OverviewColumnHint>
</th>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.salesQuantitySum">净销量</OverviewColumnHint>
</th>
<th class="border-b px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.dealAverageOrderValue">成交客单价</OverviewColumnHint>
</th>
@@ -329,6 +335,12 @@ const cellRoi = (v: number | null | undefined) =>
<td class="p-6 font-medium">
{{ formatIntCell(shop.salesOrderCount) }}
</td>
<td class="p-6 font-medium">
{{ formatIntCell(shop.dealQuantitySum) }}
</td>
<td class="p-6 font-medium">
{{ formatIntCell(shop.salesQuantitySum) }}
</td>
<td class="p-6 font-medium">
<AnimatedMoneyCell :value="shop.dealAverageOrderValue" />
</td>
@@ -418,6 +430,8 @@ const cellRoi = (v: number | null | undefined) =>
<td class="p-6"><AnimatedMoneyCell :value="shopSummary?.total?.salesAmount" /></td>
<td class="p-6">{{ formatIntCell(shopSummary?.total?.dealOrderCount) }}</td>
<td class="p-6">{{ formatIntCell(shopSummary?.total?.salesOrderCount) }}</td>
<td class="p-6">{{ formatIntCell(shopSummary?.total?.dealQuantitySum) }}</td>
<td class="p-6">{{ formatIntCell(shopSummary?.total?.salesQuantitySum) }}</td>
<td class="p-6">
<AnimatedMoneyCell :value="shopSummary?.total?.dealAverageOrderValue" />
</td>
@@ -24,6 +24,7 @@ import {
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getProductPageApi } from '#/api/ec/product';
import { getCategoryTreeApi } from '#/api/ec/product/category';
import { PermissionGate } from '#/components/permission';
import { usePermission } from '#/composables/use-permission';
@@ -69,6 +70,7 @@ const searchForm = ref({
productCode: '',
skuCode: '',
skuName: '',
categoryId: undefined as number | undefined,
});
/** 提取 SKU 编码列表 */
@@ -199,6 +201,9 @@ const gridOptions: VxeGridProps<ProductVO.Info> = {
skuName:
String(searchParams.skuName ?? searchForm.value.skuName ?? '').trim() ||
undefined,
categoryId:
(searchParams.categoryId as number | undefined) ??
searchForm.value.categoryId,
};
const params: PageQueryDTO<ProductDTO.Filters> = {
page: page.currentPage,
@@ -281,6 +286,27 @@ const formOptions = computed(() => ({
fieldName: 'skuCode',
label: 'SKU 编码',
},
{
component: 'ApiTreeSelect',
componentProps: {
placeholder: '请选择类目(含下级)',
allowClear: true,
showSearch: true,
treeDefaultExpandAll: true,
treeNodeFilterProp: 'label',
api: getCategoryTreeApi,
labelField: 'name',
valueField: 'id',
childrenField: 'children',
class: 'w-full',
onChange: (val: number | undefined) => {
searchForm.value.categoryId = val;
gridReloadRef.value?.();
},
},
fieldName: 'categoryId',
label: '商品类目',
},
],
showDefaultActions: true,
collapsed: true,