feat: add withdrawal snapshot for review
This commit is contained in:
@@ -80,6 +80,27 @@ function formatCny(amountInCents) {
|
||||
return new Intl.NumberFormat('zh-CN', { style: 'currency', currency: 'CNY' }).format(amount);
|
||||
}
|
||||
|
||||
function resolveWithdrawalSnapshot(order) {
|
||||
const snapshot = order?.snapshot;
|
||||
if (!snapshot || typeof snapshot !== 'object') return null;
|
||||
const kind = snapshot.kind || snapshot.Kind;
|
||||
const data = snapshot.data ?? snapshot.Data;
|
||||
if (kind !== 'withdrawal') return null;
|
||||
if (!data || typeof data !== 'object') return null;
|
||||
return data;
|
||||
}
|
||||
|
||||
function formatWithdrawMethod(method) {
|
||||
switch (method) {
|
||||
case 'wallet':
|
||||
return '钱包';
|
||||
case 'external':
|
||||
return '外部打款';
|
||||
default:
|
||||
return method || '-';
|
||||
}
|
||||
}
|
||||
|
||||
function getStatusSeverity(value) {
|
||||
switch (value) {
|
||||
case 'paid':
|
||||
@@ -342,6 +363,18 @@ watch(
|
||||
<span v-else class="text-muted-color">{{ data.buyer?.id ?? '-' }}</span>
|
||||
</template>
|
||||
</Column>
|
||||
<Column header="收款账户" style="min-width: 16rem">
|
||||
<template #body="{ data }">
|
||||
<div v-if="resolveWithdrawalSnapshot(data)" class="flex flex-col">
|
||||
<span class="font-medium">{{ resolveWithdrawalSnapshot(data).account_realname || '-' }}</span>
|
||||
<span class="text-xs text-muted-color">
|
||||
{{ formatWithdrawMethod(resolveWithdrawalSnapshot(data).method) }} · {{ resolveWithdrawalSnapshot(data).account_type || '-' }} ·
|
||||
{{ resolveWithdrawalSnapshot(data).account || '-' }}
|
||||
</span>
|
||||
</div>
|
||||
<span v-else class="text-muted-color">-</span>
|
||||
</template>
|
||||
</Column>
|
||||
<Column field="amount_paid" header="金额" sortable style="min-width: 10rem">
|
||||
<template #body="{ data }">
|
||||
{{ formatCny(data.amount_paid) }}
|
||||
|
||||
Reference in New Issue
Block a user