feat(fulfillment): 增加统一结算与多渠道人工履约

This commit is contained in:
yml2213
2026-11-05 16:14:56 +08:00
parent 548070c2ad
commit 4e83dbb84c
43 changed files with 1582 additions and 334 deletions
@@ -46,6 +46,7 @@ import type {
} from '@/types/admin'
import type { UploadedFile } from '@/types/worker-platform'
import { formatAdminDateTime } from '@/utils/admin-time'
import { formatCreditUnitPriceLabel } from '@/utils/credit-unit-price'
import {
FUND_ACCOUNT_STATUS_LABELS,
FUND_CATEGORY_LABELS,
@@ -387,7 +388,7 @@ export default function FundSupportView() {
<section className="page-stack">
<PageHeader
title="我的钱包"
description="四个平台钱包:南航 / 乐玩 / ROCK 积分与备用金现金。余额由流水自动计算,不能手工修改。"
description="五种履约方式:南航 / 乐玩 / ROCK 积分、备用金现金、统一结算。积分余额与现金余额由流水自动计算,不能手工修改。"
extra={
<Button
icon={<ReloadOutlined />}
@@ -418,51 +419,61 @@ export default function FundSupportView() {
/>
) : null}
<Row gutter={[16, 16]}>
<div className="support-wallet-grid">
{myCreditWallets.map((wallet) => (
<Col xs={24} sm={12} lg={6} key={wallet.platform.key}>
<Card>
<Statistic
title={
<Space size={6}>
<span>{wallet.platform.label}</span>
<Tag color={wallet.platform.creditUnitPriceFen >= 100 ? 'cyan' : 'blue'}>
1积分=
{wallet.platform.creditUnitPriceFen >= 100 ? '1元' : '1分'}
</Tag>
</Space>
}
value={wallet.balanceQuantity}
suffix="积分"
valueStyle={{
color: wallet.balanceQuantity > 0 ? undefined : '#999',
}}
/>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
折合 ¥{(wallet.balanceAmountFen / 100).toFixed(2)}
</Typography.Text>
</Card>
</Col>
))}
<Col xs={24} sm={12} lg={6}>
<Card>
<Card key={wallet.platform.key}>
<Statistic
title="备用金现金"
value={account ? account.balanceFen / 100 : 0}
precision={2}
prefix="¥"
title={
<Space size={6}>
<span>{wallet.platform.label}</span>
<Tag color={wallet.platform.creditUnitPriceFen >= 100 ? 'cyan' : 'blue'}>
{formatCreditUnitPriceLabel(wallet.platform.creditUnitPriceFen)}
</Tag>
</Space>
}
value={wallet.balanceQuantity}
suffix="积分"
valueStyle={{
color: account && account.balanceFen > 0 ? undefined : '#999',
color: wallet.balanceQuantity > 0 ? undefined : '#999',
}}
/>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
{account
? `本月发放 ¥${(account.monthInFen / 100).toFixed(2)} · 支出/缴回 ¥${(account.monthOutFen / 100).toFixed(2)}`
: '尚未开通备用金账户'}
折合 ¥{(wallet.balanceAmountFen / 100).toFixed(2)}
</Typography.Text>
</Card>
</Col>
</Row>
))}
<Card>
<Statistic
title="备用金现金"
value={account ? account.balanceFen / 100 : 0}
precision={2}
prefix="¥"
valueStyle={{
color: account && account.balanceFen > 0 ? undefined : '#999',
}}
/>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
{account
? `本月发放 ¥${(account.monthInFen / 100).toFixed(2)} · 支出/缴回 ¥${(account.monthOutFen / 100).toFixed(2)}`
: '尚未开通备用金账户'}
</Typography.Text>
</Card>
<Card>
<Statistic
title={
<Space size={6}>
<span>统一结算</span>
<Tag color="gold">后对账</Tag>
</Space>
}
value="按单生成"
valueStyle={{ color: '#8c6d1f', fontSize: 22 }}
/>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
生成虚拟账单,不扣积分或备用金
</Typography.Text>
</Card>
</div>
{account ? (
<Card>
@@ -42,6 +42,7 @@ import type { PlatformCreditAccount, PlatformCreditEntry, PlatformCreditOwner }
import { hasAdminPermission } from '@/utils/admin-auth'
import { formatAdminDateTime } from '@/utils/admin-time'
import { buildAdminLocalTablePagination } from '@/utils/admin-pagination'
import { formatCreditUnitPriceLabel } from '@/utils/credit-unit-price'
const PLATFORM_TAG_COLORS: Record<string, string> = {
nanhang: 'blue',
@@ -342,7 +343,7 @@ export function PlatformCreditPanel() {
showIcon
style={{ marginBottom: 14 }}
message="南航 / 乐玩 / ROCK 三平台积分互不通用,每平台一个钱包"
description="换算率按平台:南航、乐玩 1 积分 = 1 分;ROCK 1 积分 = 1 元。可在下方按客服直接分配或调整积分;备用金现金在「现金钱包 / 对账中心」管理。"
description="换算率按平台展示为人民币金额;南航、乐玩默认 1 积分 = 0.01 元,ROCK 默认 1 积分 = 1.00 元。可在下方按客服直接分配或调整积分;备用金现金在「现金钱包 / 对账中心」管理。"
/>
<Row gutter={[12, 12]} style={{ marginBottom: 12 }}>
@@ -359,7 +360,7 @@ export function PlatformCreditPanel() {
suffix="积分"
prefix={
<Tag color={PLATFORM_TAG_COLORS[platform.key] || 'default'}>
1积分={platform.creditUnitPriceFen >= 100 ? '1元' : '1分'}
{formatCreditUnitPriceLabel(platform.creditUnitPriceFen)}
</Tag>
}
/>
@@ -459,7 +460,7 @@ export function PlatformCreditPanel() {
<Select
options={platforms.map((item) => ({
value: item.key,
label: `${item.label}(1积分=${item.creditUnitPriceFen >= 100 ? '1元' : '1分'})`,
label: `${item.label} · ${formatCreditUnitPriceLabel(item.creditUnitPriceFen)}`,
}))}
/>
</Form.Item>