fix(admin): 主站分销管理按最新分成与释放口径改展示

规则页按模式展示收号/卖出/服务费,通道费标明主站承担;订单改为释放状态筛选;结算区分自动与人工批次。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-10 17:36:49 +08:00
co-authored by Cursor
parent 647fdc0b4a
commit e621722218
10 changed files with 677 additions and 138 deletions
@@ -7,8 +7,14 @@ import {
type DistributionOrder,
type DistributionSite,
} from '@/features/admin/api/adminDistribution'
import {
DISTRIBUTION_MODES,
distributionModeLabel,
distributorReleaseLabel,
} from '@/features/admin/utils/distributionLabels'
import { formatCent } from '@/shared/utils/money'
import { formatDateTime } from '@/shared/utils/time'
import { orderStatusLabel, refundStatusLabel } from '@/shared/utils/statusLabels'
import { readError } from '@/shared/utils/error'
const loading = ref(false)
@@ -18,18 +24,13 @@ const total = ref(0)
const query = reactive({
siteID: undefined as number | undefined,
kind: '' as string,
status: '' as string,
mode: '',
status: '',
financialStatus: '',
page: 1,
pageSize: 20,
})
const modeMap: Record<string, string> = {
two_party_distributor_receive: '收号',
two_party_platform_receive: '售出',
three_party: '三方',
}
async function loadSites() {
try {
sites.value = await fetchDistributionSites()
@@ -43,8 +44,9 @@ async function loadOrders() {
try {
const res = await fetchDistributionOrders({
siteID: query.siteID,
kind: query.kind || undefined,
mode: query.mode || undefined,
status: query.status || undefined,
financialStatus: query.financialStatus || undefined,
page: query.page,
pageSize: query.pageSize,
})
@@ -64,15 +66,16 @@ function handleSearch() {
function handleReset() {
query.siteID = undefined
query.kind = ''
query.mode = ''
query.status = ''
query.financialStatus = ''
query.page = 1
loadOrders()
}
function getSiteName(siteId: number) {
const site = sites.value.find(s => s.id === siteId)
return site ? `${site.site_name}` : `站点 #${siteId}`
return site ? site.site_name : `站点 #${siteId}`
}
onMounted(async () => {
@@ -85,9 +88,9 @@ onMounted(async () => {
<div class="distribution-orders-view">
<div class="page-header">
<div>
<h2 class="page-title">分销订单监控</h2>
<h2 class="page-title">分销订单</h2>
<p class="page-subtitle">
全览各合作分销站点的收号与售出订单明细、渠道手续费、单笔服务费及利润分成流水。
查看分销订单的利润基数、主站承担的通道费,以及冷却期释放状态。不要把订单履约结算和分销入账混为一谈。
</p>
</div>
</div>
@@ -104,17 +107,33 @@ onMounted(async () => {
/>
</el-select>
</el-form-item>
<el-form-item label="交易类型">
<el-select v-model="query.kind" clearable placeholder="全部模式" style="width: 140px">
<el-option label="分销收号" value="receive" />
<el-option label="分销售出" value="sold" />
<el-option label="全部" value="all" />
<el-form-item label="分销模式">
<el-select v-model="query.mode" clearable placeholder="全部模式" style="width: 180px">
<el-option
v-for="item in DISTRIBUTION_MODES"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="结算状态">
<el-select v-model="query.status" clearable placeholder="全部状态" style="width: 140px">
<el-option label="待结算" value="pending" />
<el-option label="已结算" value="settled" />
<el-form-item label="订单状态">
<el-select v-model="query.status" clearable placeholder="全部" style="width: 140px">
<el-option label="已完成" value="completed" />
<el-option label="使用中" value="renting" />
<el-option label="申诉中" value="disputing" />
<el-option label="已关闭" value="closed" />
</el-select>
</el-form-item>
<el-form-item label="释放状态">
<el-select
v-model="query.financialStatus"
clearable
placeholder="全部"
style="width: 140px"
>
<el-option label="待释放" value="pending" />
<el-option label="已释放入账" value="settled" />
</el-select>
</el-form-item>
<el-form-item>
@@ -127,53 +146,62 @@ onMounted(async () => {
<el-card shadow="never" style="margin-top: 16px">
<el-table v-loading="loading" :data="orders" stripe style="width: 100%">
<el-table-column label="订单号" prop="order_no" min-width="160" />
<el-table-column label="分销站点" min-width="140">
<el-table-column label="分销站点" min-width="130">
<template #default="{ row }">
<el-tag size="small">{{ getSiteName(row.site_id) }}</el-tag>
</template>
</el-table-column>
<el-table-column label="模式" width="90" align="center">
<el-table-column label="模式" min-width="140">
<template #default="{ row }">
<el-tag type="info" size="small">
{{ modeMap[row.distribution_mode] || row.distribution_mode }}
</el-tag>
{{ distributionModeLabel(row.distribution_mode) }}
</template>
</el-table-column>
<el-table-column label="订单实付" min-width="110" align="right">
<el-table-column label="净付款" min-width="100" align="right">
<template #default="{ row }">
<strong>{{ formatCent(row.net_paid_amount_cent) }}</strong>
</template>
</el-table-column>
<el-table-column label="渠道手续费" min-width="100" align="right">
<el-table-column label="分站加价" min-width="100" align="right">
<template #default="{ row }">
{{ formatCent(row.payment_fee_cent) }}
{{ formatCent(row.markup_amount_cent) }}
</template>
</el-table-column>
<el-table-column label="固定服务费" min-width="100" align="right">
<el-table-column label="利润基数" min-width="100" align="right">
<template #default="{ row }">
{{ formatCent(row.split_base_amount_cent) }}
</template>
</el-table-column>
<el-table-column label="通道费" min-width="110" align="right">
<template #default="{ row }">
<div>{{ formatCent(row.payment_fee_cent) }}</div>
<small class="muted">主站承担</small>
</template>
</el-table-column>
<el-table-column label="服务费" min-width="90" align="right">
<template #default="{ row }">
{{ formatCent(row.service_fee_cent) }}
</template>
</el-table-column>
<el-table-column label="税费" min-width="90" align="right">
<template #default="{ row }">
{{ formatCent(row.tax_amount_cent) }}
</template>
</el-table-column>
<el-table-column label="订单状态" width="100" align="center">
<el-table-column label="订单状态" width="110" align="center">
<template #default="{ row }">
<el-tag :type="row.status === 'completed' ? 'success' : 'warning'" size="small">
{{ row.status }}
{{ orderStatusLabel(row.status) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="结算状态" width="100" align="center">
<el-table-column label="退款" width="110" align="center">
<template #default="{ row }">
<el-tag :type="row.settlement_status === 'settled' ? 'success' : 'info'" size="small">
{{ row.settlement_status === 'settled' ? '已结算' : '待结算' }}
<span>{{ refundStatusLabel(row.refund_status) }}</span>
</template>
</el-table-column>
<el-table-column label="分销入账" min-width="120" align="center">
<template #default="{ row }">
<el-tag :type="distributorReleaseLabel(row).type" size="small">
{{ distributorReleaseLabel(row).label }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" min-width="160">
<el-table-column label="下单时间" min-width="160">
<template #default="{ row }">
{{ formatDateTime(row.created_at) }}
</template>
@@ -215,6 +243,7 @@ onMounted(async () => {
font-size: 13px;
color: #6b7280;
margin: 0;
max-width: 720px;
}
.filter-card {
@@ -226,4 +255,9 @@ onMounted(async () => {
justify-content: flex-end;
margin-top: 16px;
}
.muted {
color: #9ca3af;
font-size: 12px;
}
</style>