This commit is contained in:
van
2026-05-06 01:51:33 +08:00
parent c848772e5a
commit 0db5477ed1
2 changed files with 47 additions and 21 deletions

View File

@@ -61,27 +61,33 @@
</el-button> </el-button>
</div> </div>
<div v-show="showStatistics" class="statistics-content"> <div v-show="showStatistics" class="statistics-content">
<el-row :gutter="20"> <el-row :gutter="16" type="flex" justify="start" class="stat-summary-row">
<el-col :span="6"> <el-col :xs="12" :sm="8" :md="4" :lg="4">
<div class="stat-item"> <div class="stat-item">
<div class="stat-label">总订单数</div> <div class="stat-label">总订单数</div>
<div class="stat-value">{{ statistics.totalOrders }}</div> <div class="stat-value">{{ statistics.totalOrders }}</div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :xs="12" :sm="8" :md="4" :lg="4">
<div class="stat-item"> <div class="stat-item">
<div class="stat-label">总计佣金额</div> <div class="stat-label">总计佣金额</div>
<div class="stat-value">¥{{ statistics.totalCosPrice.toFixed(2) }}</div> <div class="stat-value">¥{{ statistics.totalCosPrice.toFixed(2) }}</div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :xs="12" :sm="8" :md="4" :lg="4">
<div class="stat-item"> <div class="stat-item" title="排除取消单validCode=3其余状态预估佣金累加">
<div class="stat-label">预估佣金</div> <div class="stat-label">预估佣金</div>
<div class="stat-value">¥{{ statistics.totalEstimateFee.toFixed(2) }}</div> <div class="stat-value">¥{{ statistics.totalEstimateFee.toFixed(2) }}</div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :xs="12" :sm="8" :md="4" :lg="4">
<div class="stat-item"> <div class="stat-item" title="已付款未收货结算validCode=16的预估佣金合计">
<div class="stat-label">已付款待结算</div>
<div class="stat-value">¥{{ (statistics.estimatePaidPending || 0).toFixed(2) }}</div>
</div>
</el-col>
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="stat-item" title="仅已完成validCode=17的实际佣金累加">
<div class="stat-label">实际佣金</div> <div class="stat-label">实际佣金</div>
<div class="stat-value">¥{{ statistics.totalActualFee.toFixed(2) }}</div> <div class="stat-value">¥{{ statistics.totalActualFee.toFixed(2) }}</div>
</div> </div>
@@ -111,8 +117,8 @@
<span class="status-count">{{ stat.count }}</span> <span class="status-count">{{ stat.count }}</span>
</div> </div>
<div class="status-item-amounts"> <div class="status-item-amounts">
<span class="status-amt-est" title="顶部「预估佣金」同口径">预估 ¥{{ stat.estimateAmount.toFixed(2) }}</span> <span class="status-amt-est" title="分组内预估;顶部「预估佣金」为排除取消后的合计">预估 ¥{{ stat.estimateAmount.toFixed(2) }}</span>
<span class="status-amt-act" title="顶部「实际佣金」同口径">实际 ¥{{ stat.actualAmount.toFixed(2) }}</span> <span class="status-amt-act" title="分组内实际;顶部「实际佣金」仅统计已完成(17)">实际 ¥{{ stat.actualAmount.toFixed(2) }}</span>
</div> </div>
</div> </div>
</div> </div>
@@ -392,6 +398,7 @@ export default {
totalOrders: 0, totalOrders: 0,
totalCosPrice: 0, totalCosPrice: 0,
totalEstimateFee: 0, totalEstimateFee: 0,
estimatePaidPending: 0,
totalActualFee: 0, totalActualFee: 0,
statusStats: {} statusStats: {}
}, },
@@ -479,15 +486,16 @@ export default {
applyStatistics(data) { applyStatistics(data) {
if (!data) { if (!data) {
if (this.orderrowsList.length > 0) this.calculateStatistics(); if (this.orderrowsList.length > 0) this.calculateStatistics();
else this.statistics = { totalOrders: 0, totalCosPrice: 0, totalEstimateFee: 0, totalActualFee: 0, statusStats: {} }; else this.statistics = { totalOrders: 0, totalCosPrice: 0, totalEstimateFee: 0, estimatePaidPending: 0, totalActualFee: 0, statusStats: {} };
return; return;
} }
const groupStats = data.groupStats || {}; const groupStats = data.groupStats || {};
this.statistics = { this.statistics = {
totalOrders: data.totalOrders || 0, totalOrders: data.totalOrders || 0,
totalCosPrice: data.totalCosPrice != null ? data.totalCosPrice : 0, totalCosPrice: data.totalCosPrice != null ? data.totalCosPrice : 0,
totalEstimateFee: data.totalCommission || 0, totalEstimateFee: data.totalCommission != null ? data.totalCommission : 0,
totalActualFee: data.totalActualFee || 0, estimatePaidPending: data.estimatePaidPending != null ? data.estimatePaidPending : 0,
totalActualFee: data.totalActualFee != null ? data.totalActualFee : 0,
statusStats: { statusStats: {
cancel: this.convertGroupStat(groupStats.cancel), cancel: this.convertGroupStat(groupStats.cancel),
invalid: this.convertGroupStat(groupStats.invalid), invalid: this.convertGroupStat(groupStats.invalid),
@@ -587,7 +595,7 @@ export default {
{ label: '取消', value: 'cancel', codes: ['3'] }, { label: '取消', value: 'cancel', codes: ['3'] },
{ label: '无效', value: 'invalid', codes: ['2','4','5','6','7','8','9','10','11','14','19','20','21','22','23','29','30','31','32','33','34'] }, { label: '无效', value: 'invalid', codes: ['2','4','5','6','7','8','9','10','11','14','19','20','21','22','23','29','30','31','32','33','34'] },
{ label: '待付款', value: 'pending', codes: ['15'] }, { label: '待付款', value: 'pending', codes: ['15'] },
{ label: '已付款', value: 'paid', codes: ['16'] }, { label: '已付款(待结算)', value: 'paid', codes: ['16'] },
{ label: '已完成', value: 'finished', codes: ['17'] }, { label: '已完成', value: 'finished', codes: ['17'] },
{ label: '已付定金', value: 'deposit', codes: ['24'] }, { label: '已付定金', value: 'deposit', codes: ['24'] },
{ label: '违规', value: 'illegal', codes: ['25','26','27','28'] } { label: '违规', value: 'illegal', codes: ['25','26','27','28'] }
@@ -841,6 +849,7 @@ export default {
totalOrders: this.orderrowsList.length, totalOrders: this.orderrowsList.length,
totalCosPrice: 0, totalCosPrice: 0,
totalEstimateFee: 0, totalEstimateFee: 0,
estimatePaidPending: 0,
totalActualFee: 0, totalActualFee: 0,
statusStats: {} statusStats: {}
}; };
@@ -849,7 +858,7 @@ export default {
cancel: { label: '取消', codes: ['3'] }, cancel: { label: '取消', codes: ['3'] },
invalid: { label: '无效', codes: ['2', '4', '5', '6', '7', '8', '9', '10', '11', '14', '19', '20', '21', '22', '23', '29', '30', '31', '32', '33', '34'] }, invalid: { label: '无效', codes: ['2', '4', '5', '6', '7', '8', '9', '10', '11', '14', '19', '20', '21', '22', '23', '29', '30', '31', '32', '33', '34'] },
pending: { label: '待付款', codes: ['15'] }, pending: { label: '待付款', codes: ['15'] },
paid: { label: '已付款', codes: ['16'] }, paid: { label: '已付款(待结算)', codes: ['16'] },
finished: { label: '已完成', codes: ['17'] }, finished: { label: '已完成', codes: ['17'] },
deposit: { label: '已付定金', codes: ['24'] }, deposit: { label: '已付定金', codes: ['24'] },
illegal: { label: '违规', codes: ['25', '26', '27', '28'] } illegal: { label: '违规', codes: ['25', '26', '27', '28'] }
@@ -904,8 +913,16 @@ export default {
actualFeeAmount = actFee; actualFeeAmount = actFee;
} }
stats.totalEstimateFee += commissionAmount; // 与 OrderRowsController.buildStatistics预估汇总排除取消实际汇总仅已完成(17)
stats.totalActualFee += actualFeeAmount; if (validCode !== '3') {
stats.totalEstimateFee += commissionAmount;
}
if (validCode === '16') {
stats.estimatePaidPending += commissionAmount;
}
if (validCode === '17') {
stats.totalActualFee += actualFeeAmount;
}
let statusKey = 'invalid'; let statusKey = 'invalid';
for (const [key, group] of Object.entries(statusGroups)) { for (const [key, group] of Object.entries(statusGroups)) {

View File

@@ -100,7 +100,7 @@
<el-col :xs="24" :lg="12"> <el-col :xs="24" :lg="12">
<el-card shadow="hover"> <el-card shadow="hover">
<div slot="header" class="card-header-plain"> <div slot="header" class="card-header-plain">
<span>佣金分布预估口径</span> <span>佣金分布预估按状态分组</span>
</div> </div>
<div class="chart-container"> <div class="chart-container">
<div ref="commissionChart" class="chart-el" /> <div ref="commissionChart" class="chart-el" />
@@ -123,7 +123,7 @@
<el-table-column prop="commission" label="预估佣金" min-width="110" align="right"> <el-table-column prop="commission" label="预估佣金" min-width="110" align="right">
<template slot-scope="scope">¥{{ formatMoney(scope.row.commission) }}</template> <template slot-scope="scope">¥{{ formatMoney(scope.row.commission) }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="actualFee" label="实际费用" min-width="110" align="right"> <el-table-column prop="actualFee" label="实际(分组)" min-width="110" align="right">
<template slot-scope="scope">¥{{ formatMoney(scope.row.actualFee) }}</template> <template slot-scope="scope">¥{{ formatMoney(scope.row.actualFee) }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="percentage" label="占比" width="88" align="center"> <el-table-column prop="percentage" label="占比" width="88" align="center">
@@ -169,6 +169,7 @@ export default {
totalOrders: 0, totalOrders: 0,
totalCosPrice: 0, totalCosPrice: 0,
totalCommission: 0, totalCommission: 0,
estimatePaidPending: 0,
totalSkuNum: 0, totalSkuNum: 0,
totalActualFee: 0, totalActualFee: 0,
groupStats: {} groupStats: {}
@@ -202,7 +203,14 @@ export default {
title: '预估佣金', title: '预估佣金',
money: true, money: true,
display: this.formatMoney(s.totalCommission), display: this.formatMoney(s.totalCommission),
hint: '与列表页「预估佣金」同口径' hint: '排除取消单(3),其余状态预估佣金累加'
},
{
key: 'paidPending',
title: '已付款(待结算)',
money: true,
display: this.formatMoney(s.estimatePaidPending),
hint: 'validCode=16 的预估佣金(未完结收货)'
}, },
{ {
key: 'sku', key: 'sku',
@@ -213,10 +221,10 @@ export default {
}, },
{ {
key: 'actual', key: 'actual',
title: '实际费用', title: '实际佣金',
money: true, money: true,
display: this.formatMoney(s.totalActualFee), display: this.formatMoney(s.totalActualFee),
hint: 'actualFee 汇总' hint: '仅已完成(17) 的实际佣金'
} }
] ]
}, },
@@ -296,6 +304,7 @@ export default {
totalOrders: 0, totalOrders: 0,
totalCosPrice: 0, totalCosPrice: 0,
totalCommission: 0, totalCommission: 0,
estimatePaidPending: 0,
totalSkuNum: 0, totalSkuNum: 0,
totalActualFee: 0, totalActualFee: 0,
groupStats: {} groupStats: {}