1
This commit is contained in:
@@ -61,27 +61,33 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-show="showStatistics" class="statistics-content">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-row :gutter="16" type="flex" justify="start" class="stat-summary-row">
|
||||
<el-col :xs="12" :sm="8" :md="4" :lg="4">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">总订单数</div>
|
||||
<div class="stat-value">{{ statistics.totalOrders }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :xs="12" :sm="8" :md="4" :lg="4">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">总计佣金额</div>
|
||||
<div class="stat-value">¥{{ statistics.totalCosPrice.toFixed(2) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="stat-item">
|
||||
<el-col :xs="12" :sm="8" :md="4" :lg="4">
|
||||
<div class="stat-item" title="排除取消单(validCode=3),其余状态预估佣金累加">
|
||||
<div class="stat-label">预估佣金</div>
|
||||
<div class="stat-value">¥{{ statistics.totalEstimateFee.toFixed(2) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="stat-item">
|
||||
<el-col :xs="12" :sm="8" :md="4" :lg="4">
|
||||
<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-value">¥{{ statistics.totalActualFee.toFixed(2) }}</div>
|
||||
</div>
|
||||
@@ -111,8 +117,8 @@
|
||||
<span class="status-count">{{ stat.count }}单</span>
|
||||
</div>
|
||||
<div class="status-item-amounts">
|
||||
<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-est" title="分组内预估;顶部「预估佣金」为排除取消后的合计">预估 ¥{{ stat.estimateAmount.toFixed(2) }}</span>
|
||||
<span class="status-amt-act" title="分组内实际;顶部「实际佣金」仅统计已完成(17)">实际 ¥{{ stat.actualAmount.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -392,6 +398,7 @@ export default {
|
||||
totalOrders: 0,
|
||||
totalCosPrice: 0,
|
||||
totalEstimateFee: 0,
|
||||
estimatePaidPending: 0,
|
||||
totalActualFee: 0,
|
||||
statusStats: {}
|
||||
},
|
||||
@@ -479,15 +486,16 @@ export default {
|
||||
applyStatistics(data) {
|
||||
if (!data) {
|
||||
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;
|
||||
}
|
||||
const groupStats = data.groupStats || {};
|
||||
this.statistics = {
|
||||
totalOrders: data.totalOrders || 0,
|
||||
totalCosPrice: data.totalCosPrice != null ? data.totalCosPrice : 0,
|
||||
totalEstimateFee: data.totalCommission || 0,
|
||||
totalActualFee: data.totalActualFee || 0,
|
||||
totalEstimateFee: data.totalCommission != null ? data.totalCommission : 0,
|
||||
estimatePaidPending: data.estimatePaidPending != null ? data.estimatePaidPending : 0,
|
||||
totalActualFee: data.totalActualFee != null ? data.totalActualFee : 0,
|
||||
statusStats: {
|
||||
cancel: this.convertGroupStat(groupStats.cancel),
|
||||
invalid: this.convertGroupStat(groupStats.invalid),
|
||||
@@ -587,7 +595,7 @@ export default {
|
||||
{ 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: 'pending', codes: ['15'] },
|
||||
{ label: '已付款', value: 'paid', codes: ['16'] },
|
||||
{ label: '已付款(待结算)', value: 'paid', codes: ['16'] },
|
||||
{ label: '已完成', value: 'finished', codes: ['17'] },
|
||||
{ label: '已付定金', value: 'deposit', codes: ['24'] },
|
||||
{ label: '违规', value: 'illegal', codes: ['25','26','27','28'] }
|
||||
@@ -841,6 +849,7 @@ export default {
|
||||
totalOrders: this.orderrowsList.length,
|
||||
totalCosPrice: 0,
|
||||
totalEstimateFee: 0,
|
||||
estimatePaidPending: 0,
|
||||
totalActualFee: 0,
|
||||
statusStats: {}
|
||||
};
|
||||
@@ -849,7 +858,7 @@ export default {
|
||||
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'] },
|
||||
pending: { label: '待付款', codes: ['15'] },
|
||||
paid: { label: '已付款', codes: ['16'] },
|
||||
paid: { label: '已付款(待结算)', codes: ['16'] },
|
||||
finished: { label: '已完成', codes: ['17'] },
|
||||
deposit: { label: '已付定金', codes: ['24'] },
|
||||
illegal: { label: '违规', codes: ['25', '26', '27', '28'] }
|
||||
@@ -904,8 +913,16 @@ export default {
|
||||
actualFeeAmount = actFee;
|
||||
}
|
||||
|
||||
stats.totalEstimateFee += commissionAmount;
|
||||
stats.totalActualFee += actualFeeAmount;
|
||||
// 与 OrderRowsController.buildStatistics:预估汇总排除取消;实际汇总仅已完成(17)
|
||||
if (validCode !== '3') {
|
||||
stats.totalEstimateFee += commissionAmount;
|
||||
}
|
||||
if (validCode === '16') {
|
||||
stats.estimatePaidPending += commissionAmount;
|
||||
}
|
||||
if (validCode === '17') {
|
||||
stats.totalActualFee += actualFeeAmount;
|
||||
}
|
||||
|
||||
let statusKey = 'invalid';
|
||||
for (const [key, group] of Object.entries(statusGroups)) {
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<el-col :xs="24" :lg="12">
|
||||
<el-card shadow="hover">
|
||||
<div slot="header" class="card-header-plain">
|
||||
<span>佣金分布(预估口径)</span>
|
||||
<span>佣金分布(预估,按状态分组)</span>
|
||||
</div>
|
||||
<div class="chart-container">
|
||||
<div ref="commissionChart" class="chart-el" />
|
||||
@@ -123,7 +123,7 @@
|
||||
<el-table-column prop="commission" label="预估佣金" min-width="110" align="right">
|
||||
<template slot-scope="scope">¥{{ formatMoney(scope.row.commission) }}</template>
|
||||
</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>
|
||||
</el-table-column>
|
||||
<el-table-column prop="percentage" label="占比" width="88" align="center">
|
||||
@@ -169,6 +169,7 @@ export default {
|
||||
totalOrders: 0,
|
||||
totalCosPrice: 0,
|
||||
totalCommission: 0,
|
||||
estimatePaidPending: 0,
|
||||
totalSkuNum: 0,
|
||||
totalActualFee: 0,
|
||||
groupStats: {}
|
||||
@@ -202,7 +203,14 @@ export default {
|
||||
title: '预估佣金',
|
||||
money: true,
|
||||
display: this.formatMoney(s.totalCommission),
|
||||
hint: '与列表页「预估佣金」同口径'
|
||||
hint: '排除取消单(3),其余状态预估佣金累加'
|
||||
},
|
||||
{
|
||||
key: 'paidPending',
|
||||
title: '已付款(待结算)',
|
||||
money: true,
|
||||
display: this.formatMoney(s.estimatePaidPending),
|
||||
hint: 'validCode=16 的预估佣金(未完结收货)'
|
||||
},
|
||||
{
|
||||
key: 'sku',
|
||||
@@ -213,10 +221,10 @@ export default {
|
||||
},
|
||||
{
|
||||
key: 'actual',
|
||||
title: '实际费用',
|
||||
title: '实际佣金',
|
||||
money: true,
|
||||
display: this.formatMoney(s.totalActualFee),
|
||||
hint: 'actualFee 汇总'
|
||||
hint: '仅已完成(17) 的实际佣金'
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -296,6 +304,7 @@ export default {
|
||||
totalOrders: 0,
|
||||
totalCosPrice: 0,
|
||||
totalCommission: 0,
|
||||
estimatePaidPending: 0,
|
||||
totalSkuNum: 0,
|
||||
totalActualFee: 0,
|
||||
groupStats: {}
|
||||
|
||||
Reference in New Issue
Block a user