|
@@ -1,59 +1,59 @@
|
|
<template>
|
|
<template>
|
|
- <doc-alert title="【统计】会员、商品、交易统计" url="https://doc.iocoder.cn/mall/statistics/" />
|
|
|
|
|
|
+ <doc-alert title="【统计】会员、产品、交易统计" url="https://doc.iocoder.cn/mall/statistics/" />
|
|
|
|
|
|
<div class="flex flex-col">
|
|
<div class="flex flex-col">
|
|
<el-row :gutter="16" class="summary">
|
|
<el-row :gutter="16" class="summary">
|
|
<el-col :sm="6" :xs="12">
|
|
<el-col :sm="6" :xs="12">
|
|
<TradeStatisticValue
|
|
<TradeStatisticValue
|
|
- tooltip="昨日订单数量"
|
|
|
|
- title="昨日订单数量"
|
|
|
|
- :value="summary?.value?.yesterdayOrderCount || 0"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
summary?.value?.yesterdayOrderCount,
|
|
summary?.value?.yesterdayOrderCount,
|
|
summary?.reference?.yesterdayOrderCount
|
|
summary?.reference?.yesterdayOrderCount
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="summary?.value?.yesterdayOrderCount || 0"
|
|
|
|
+ title="昨日订单数量"
|
|
|
|
+ tooltip="昨日订单数量"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :sm="6" :xs="12">
|
|
<el-col :sm="6" :xs="12">
|
|
<TradeStatisticValue
|
|
<TradeStatisticValue
|
|
- tooltip="本月订单数量"
|
|
|
|
- title="本月订单数量"
|
|
|
|
- :value="summary?.value?.monthOrderCount || 0"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
summary?.value?.monthOrderCount,
|
|
summary?.value?.monthOrderCount,
|
|
summary?.reference?.monthOrderCount
|
|
summary?.reference?.monthOrderCount
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="summary?.value?.monthOrderCount || 0"
|
|
|
|
+ title="本月订单数量"
|
|
|
|
+ tooltip="本月订单数量"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :sm="6" :xs="12">
|
|
<el-col :sm="6" :xs="12">
|
|
<TradeStatisticValue
|
|
<TradeStatisticValue
|
|
- tooltip="昨日支付金额"
|
|
|
|
- title="昨日支付金额"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(summary?.value?.yesterdayPayPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
summary?.value?.yesterdayPayPrice,
|
|
summary?.value?.yesterdayPayPrice,
|
|
summary?.reference?.yesterdayPayPrice
|
|
summary?.reference?.yesterdayPayPrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(summary?.value?.yesterdayPayPrice || 0)"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="昨日支付金额"
|
|
|
|
+ tooltip="昨日支付金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :sm="6" :xs="12">
|
|
<el-col :sm="6" :xs="12">
|
|
<TradeStatisticValue
|
|
<TradeStatisticValue
|
|
- tooltip="本月支付金额"
|
|
|
|
- title="本月支付金额"
|
|
|
|
- prefix="¥"
|
|
|
|
::decimals="2"
|
|
::decimals="2"
|
|
- :value="fenToYuan(summary?.value?.monthPayPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(summary?.value?.monthPayPrice, summary?.reference?.monthPayPrice)
|
|
calculateRelativeRate(summary?.value?.monthPayPrice, summary?.reference?.monthPayPrice)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(summary?.value?.monthPayPrice || 0)"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="本月支付金额"
|
|
|
|
+ tooltip="本月支付金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -65,12 +65,13 @@
|
|
<!-- 查询条件 -->
|
|
<!-- 查询条件 -->
|
|
<ShortcutDateRangePicker ref="shortcutDateRangePicker" @change="getTradeTrendData">
|
|
<ShortcutDateRangePicker ref="shortcutDateRangePicker" @change="getTradeTrendData">
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-hasPermi="['statistics:trade:export']"
|
|
|
|
+ :loading="exportLoading"
|
|
class="ml-4"
|
|
class="ml-4"
|
|
@click="handleExport"
|
|
@click="handleExport"
|
|
- :loading="exportLoading"
|
|
|
|
- v-hasPermi="['statistics:trade:export']"
|
|
|
|
>
|
|
>
|
|
- <Icon icon="ep:download" class="mr-1" />导出
|
|
|
|
|
|
+ <Icon class="mr-1" icon="ep:download" />
|
|
|
|
+ 导出
|
|
</el-button>
|
|
</el-button>
|
|
</ShortcutDateRangePicker>
|
|
</ShortcutDateRangePicker>
|
|
</div>
|
|
</div>
|
|
@@ -79,128 +80,128 @@
|
|
<el-row :gutter="16">
|
|
<el-row :gutter="16">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="营业额"
|
|
|
|
- tooltip="商品支付金额、充值金额"
|
|
|
|
- icon="fa-solid:yen-sign"
|
|
|
|
- icon-color="bg-blue-100"
|
|
|
|
- icon-bg-color="text-blue-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.turnoverPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.turnoverPrice,
|
|
trendSummary?.value?.turnoverPrice,
|
|
trendSummary?.reference?.turnoverPrice
|
|
trendSummary?.reference?.turnoverPrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.turnoverPrice || 0)"
|
|
|
|
+ icon="fa-solid:yen-sign"
|
|
|
|
+ icon-bg-color="text-blue-500"
|
|
|
|
+ icon-color="bg-blue-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="营业额"
|
|
|
|
+ tooltip="产品支付金额、充值金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="商品支付金额"
|
|
|
|
- tooltip="用户购买商品的实际支付金额,包括微信支付、余额支付、支付宝支付、线下支付金额(拼团商品在成团之后计入,线下支付订单在后台确认支付后计入)"
|
|
|
|
- icon="fa-solid:shopping-cart"
|
|
|
|
- icon-color="bg-purple-100"
|
|
|
|
- icon-bg-color="text-purple-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.orderPayPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.orderPayPrice,
|
|
trendSummary?.value?.orderPayPrice,
|
|
trendSummary?.reference?.orderPayPrice
|
|
trendSummary?.reference?.orderPayPrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.orderPayPrice || 0)"
|
|
|
|
+ icon="fa-solid:shopping-cart"
|
|
|
|
+ icon-bg-color="text-purple-500"
|
|
|
|
+ icon-color="bg-purple-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="产品支付金额"
|
|
|
|
+ tooltip="用户购买产品的实际支付金额,包括微信支付、余额支付、支付宝支付、线下支付金额(拼团产品在成团之后计入,线下支付订单在后台确认支付后计入)"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="充值金额"
|
|
|
|
- tooltip="用户成功充值的金额"
|
|
|
|
- icon="fa-solid:money-check-alt"
|
|
|
|
- icon-color="bg-yellow-100"
|
|
|
|
- icon-bg-color="text-yellow-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.rechargePrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.rechargePrice,
|
|
trendSummary?.value?.rechargePrice,
|
|
trendSummary?.reference?.rechargePrice
|
|
trendSummary?.reference?.rechargePrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.rechargePrice || 0)"
|
|
|
|
+ icon="fa-solid:money-check-alt"
|
|
|
|
+ icon-bg-color="text-yellow-500"
|
|
|
|
+ icon-color="bg-yellow-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="充值金额"
|
|
|
|
+ tooltip="用户成功充值的金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="支出金额"
|
|
|
|
- tooltip="余额支付金额、支付佣金金额、商品退款金额"
|
|
|
|
- icon="ep:warning-filled"
|
|
|
|
- icon-color="bg-green-100"
|
|
|
|
- icon-bg-color="text-green-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.expensePrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.expensePrice,
|
|
trendSummary?.value?.expensePrice,
|
|
trendSummary?.reference?.expensePrice
|
|
trendSummary?.reference?.expensePrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.expensePrice || 0)"
|
|
|
|
+ icon="ep:warning-filled"
|
|
|
|
+ icon-bg-color="text-green-500"
|
|
|
|
+ icon-color="bg-green-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="支出金额"
|
|
|
|
+ tooltip="余额支付金额、支付佣金金额、产品退款金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="余额支付金额"
|
|
|
|
- tooltip="用户下单时使用余额实际支付的金额"
|
|
|
|
- icon="fa-solid:wallet"
|
|
|
|
- icon-color="bg-cyan-100"
|
|
|
|
- icon-bg-color="text-cyan-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.walletPayPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.walletPayPrice,
|
|
trendSummary?.value?.walletPayPrice,
|
|
trendSummary?.reference?.walletPayPrice
|
|
trendSummary?.reference?.walletPayPrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.walletPayPrice || 0)"
|
|
|
|
+ icon="fa-solid:wallet"
|
|
|
|
+ icon-bg-color="text-cyan-500"
|
|
|
|
+ icon-color="bg-cyan-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="余额支付金额"
|
|
|
|
+ tooltip="用户下单时使用余额实际支付的金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="支付佣金金额"
|
|
|
|
- tooltip="后台给推广员支付的推广佣金,以实际支付为准"
|
|
|
|
- icon="fa-solid:award"
|
|
|
|
- icon-color="bg-yellow-100"
|
|
|
|
- icon-bg-color="text-yellow-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.brokerageSettlementPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.brokerageSettlementPrice,
|
|
trendSummary?.value?.brokerageSettlementPrice,
|
|
trendSummary?.reference?.brokerageSettlementPrice
|
|
trendSummary?.reference?.brokerageSettlementPrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.brokerageSettlementPrice || 0)"
|
|
|
|
+ icon="fa-solid:award"
|
|
|
|
+ icon-bg-color="text-yellow-500"
|
|
|
|
+ icon-color="bg-yellow-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="支付佣金金额"
|
|
|
|
+ tooltip="后台给推广员支付的推广佣金,以实际支付为准"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<el-col :md="6" :sm="12" :xs="24">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
- title="商品退款金额"
|
|
|
|
- tooltip="用户成功退款的商品金额"
|
|
|
|
- icon="fa-solid:times-circle"
|
|
|
|
- icon-color="bg-blue-100"
|
|
|
|
- icon-bg-color="text-blue-500"
|
|
|
|
- prefix="¥"
|
|
|
|
:decimals="2"
|
|
:decimals="2"
|
|
- :value="fenToYuan(trendSummary?.value?.afterSaleRefundPrice || 0)"
|
|
|
|
:percent="
|
|
:percent="
|
|
calculateRelativeRate(
|
|
calculateRelativeRate(
|
|
trendSummary?.value?.afterSaleRefundPrice,
|
|
trendSummary?.value?.afterSaleRefundPrice,
|
|
trendSummary?.reference?.afterSaleRefundPrice
|
|
trendSummary?.reference?.afterSaleRefundPrice
|
|
)
|
|
)
|
|
"
|
|
"
|
|
|
|
+ :value="fenToYuan(trendSummary?.value?.afterSaleRefundPrice || 0)"
|
|
|
|
+ icon="fa-solid:times-circle"
|
|
|
|
+ icon-bg-color="text-blue-500"
|
|
|
|
+ icon-color="bg-blue-100"
|
|
|
|
+ prefix="¥"
|
|
|
|
+ title="产品退款金额"
|
|
|
|
+ tooltip="用户成功退款的产品金额"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -213,11 +214,11 @@
|
|
</template>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
|
|
import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
|
|
|
|
+import { TradeSummaryRespVO, TradeTrendSummaryRespVO } from '@/api/mall/statistics/trade'
|
|
import TradeStatisticValue from './components/TradeStatisticValue.vue'
|
|
import TradeStatisticValue from './components/TradeStatisticValue.vue'
|
|
import SummaryCard from '@/components/SummaryCard/index.vue'
|
|
import SummaryCard from '@/components/SummaryCard/index.vue'
|
|
import { EChartsOption } from 'echarts'
|
|
import { EChartsOption } from 'echarts'
|
|
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
|
|
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
|
|
-import { TradeSummaryRespVO, TradeTrendSummaryRespVO } from '@/api/mall/statistics/trade'
|
|
|
|
import { calculateRelativeRate, fenToYuan } from '@/utils'
|
|
import { calculateRelativeRate, fenToYuan } from '@/utils'
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
import { CardTitle } from '@/components/Card'
|
|
import { CardTitle } from '@/components/Card'
|
|
@@ -253,7 +254,7 @@ const lineChartOptions = reactive<EChartsOption>({
|
|
},
|
|
},
|
|
series: [
|
|
series: [
|
|
{ name: '营业额', type: 'line', smooth: true },
|
|
{ name: '营业额', type: 'line', smooth: true },
|
|
- { name: '商品支付金额', type: 'line', smooth: true },
|
|
|
|
|
|
+ { name: '产品支付金额', type: 'line', smooth: true },
|
|
{ name: '充值金额', type: 'line', smooth: true },
|
|
{ name: '充值金额', type: 'line', smooth: true },
|
|
{ name: '支出金额', type: 'line', smooth: true }
|
|
{ name: '支出金额', type: 'line', smooth: true }
|
|
],
|
|
],
|