refactor(callback): 回调记录展示支付产品与通道商户列

去掉支付通道列,产品与通道商户后移;通道商户双行展示并同步 i18n。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
DaxPay Dev
2026-07-22 14:27:29 +08:00
parent c3bc348f13
commit 4397d43eff
12 changed files with 67 additions and 48 deletions

View File

@@ -24,7 +24,7 @@ export interface PayCallbackRecordQuery {
channelMchNo?: string;
tradeNo?: string;
outTradeNo?: string;
channel?: string;
product?: string;
callbackType?: string;
status?: string;
}
@@ -33,9 +33,10 @@ export interface PayCallbackRecordQuery {
export interface PayCallbackRecordResult extends MchEntity {
appId?: string;
channelMchNo?: string;
channelMerchantName?: string;
tradeNo?: string;
outTradeNo?: string;
channel?: string;
product?: string;
callbackType?: string;
notifyInfo?: string;
status?: string;

View File

@@ -2,7 +2,6 @@
"title": "Callback Records",
"tradeNo": "Trade No.",
"outTradeNo": "Channel Trade No.",
"channel": "Channel",
"callbackType": "Callback Type",
"status": "Status",
"errorMsg": "Error",
@@ -13,6 +12,6 @@
"typePay": "Pay",
"typeRefund": "Refund",
"detail": "Callback Detail",
"channelMchNo": "Channel Merchant No.",
"channelMchNo": "Channel Merchant",
"placeholderChannelMchNo": "Enter channel merchant no."
}

View File

@@ -2,7 +2,6 @@
"title": "Catatan Callback",
"tradeNo": "No. Transaksi",
"outTradeNo": "No. Transaksi Channel",
"channel": "Channel",
"callbackType": "Jenis Callback",
"status": "Status",
"errorMsg": "Kesalahan",
@@ -13,6 +12,6 @@
"typePay": "Bayar",
"typeRefund": "Refund",
"detail": "Detail Callback",
"channelMchNo": "No. Pedagang Saluran",
"channelMchNo": "Pedagang Saluran",
"placeholderChannelMchNo": "Masukkan no. pedagang saluran"
}

View File

@@ -2,7 +2,6 @@
"title": "コールバック記録",
"tradeNo": "取引番号",
"outTradeNo": "チャネル取引番号",
"channel": "決済チャネル",
"callbackType": "コールバック種別",
"status": "処理状態",
"errorMsg": "エラー情報",
@@ -13,6 +12,6 @@
"typePay": "支払",
"typeRefund": "返金",
"detail": "コールバック詳細",
"channelMchNo": "チャネル加盟店番号",
"channelMchNo": "チャネル加盟店",
"placeholderChannelMchNo": "チャネル加盟店番号を入力"
}

View File

@@ -2,7 +2,6 @@
"title": "콜백 기록",
"tradeNo": "거래번호",
"outTradeNo": "채널 거래번호",
"channel": "결제 채널",
"callbackType": "콜백 유형",
"status": "처리 상태",
"errorMsg": "오류 정보",
@@ -13,6 +12,6 @@
"typePay": "결제",
"typeRefund": "환불",
"detail": "콜백 상세",
"channelMchNo": "채널 가맹점번호",
"channelMchNo": "채널 가맹점",
"placeholderChannelMchNo": "채널 가맹점번호 입력"
}

View File

@@ -2,7 +2,6 @@
"title": "Rekod Callback",
"tradeNo": "No. Dagangan",
"outTradeNo": "No. Dagangan Saluran",
"channel": "Saluran",
"callbackType": "Jenis Callback",
"status": "Status",
"errorMsg": "Ralat",
@@ -13,6 +12,6 @@
"typePay": "Bayar",
"typeRefund": "Bayaran Balik",
"detail": "Butiran Callback",
"channelMchNo": "No. Pedagang Saluran",
"channelMchNo": "Peniaga Saluran",
"placeholderChannelMchNo": "Masukkan no. pedagang saluran"
}

View File

@@ -2,7 +2,6 @@
"title": "บันทึกการเรียกกลับ",
"tradeNo": "หมายเลขธุรกรรม",
"outTradeNo": "หมายเลขธุรกรรมช่องทาง",
"channel": "ช่องทางชำระเงิน",
"callbackType": "ประเภทการเรียกกลับ",
"status": "สถานะ",
"errorMsg": "ข้อผิดพลาด",
@@ -13,6 +12,6 @@
"typePay": "ชำระเงิน",
"typeRefund": "คืนเงิน",
"detail": "รายละเอียดการเรียกกลับ",
"channelMchNo": "รหัสร้านค้าช่องทาง",
"channelMchNo": "พ่อค้าช่องทาง",
"placeholderChannelMchNo": "กรอกรหัสร้านค้าช่องทาง"
}

View File

@@ -2,7 +2,6 @@
"title": "Bản ghi callback",
"tradeNo": "Mã giao dịch",
"outTradeNo": "Mã giao dịch kênh",
"channel": "Kênh thanh toán",
"callbackType": "Loại callback",
"status": "Trạng thái",
"errorMsg": "Lỗi",
@@ -13,6 +12,6 @@
"typePay": "Thanh toán",
"typeRefund": "Hoàn tiền",
"detail": "Chi tiết callback",
"channelMchNo": "Mã merchant kênh",
"channelMchNo": "Người bán kênh",
"placeholderChannelMchNo": "Nhập mã merchant kênh"
}

View File

@@ -2,7 +2,6 @@
"title": "回调记录",
"tradeNo": "交易号",
"outTradeNo": "通道交易号",
"channel": "支付通道",
"callbackType": "回调类型",
"status": "处理状态",
"errorMsg": "错误信息",
@@ -13,6 +12,6 @@
"typePay": "支付",
"typeRefund": "退款",
"detail": "回调详情",
"channelMchNo": "通道商户",
"channelMchNo": "通道商户",
"placeholderChannelMchNo": "请输入通道商户号"
}

View File

@@ -2,7 +2,6 @@
"title": "回調記錄",
"tradeNo": "交易號",
"outTradeNo": "通道交易號",
"channel": "支付通道",
"callbackType": "回調類型",
"status": "處理狀態",
"errorMsg": "錯誤資訊",
@@ -13,6 +12,6 @@
"typePay": "支付",
"typeRefund": "退款",
"detail": "回調詳情",
"channelMchNo": "通道商戶",
"channelMchNo": "通道商戶",
"placeholderChannelMchNo": "請輸入通道商戶號"
}

View File

@@ -2,7 +2,6 @@
"title": "回調記錄",
"tradeNo": "交易號",
"outTradeNo": "通道交易號",
"channel": "支付通道",
"callbackType": "回調類型",
"status": "處理狀態",
"errorMsg": "錯誤資訊",
@@ -13,6 +12,6 @@
"typePay": "支付",
"typeRefund": "退款",
"detail": "回調詳情",
"channelMchNo": "通道商戶",
"channelMchNo": "通道商戶",
"placeholderChannelMchNo": "請輸入通道商戶號"
}

View File

@@ -11,12 +11,12 @@
type PayCallbackRecordResult,
} from '#/api/payment/record/callback-record.api';
import { BQuery, type QueryField } from '#/components/query';
import { productI18nMap, productNameMap } from '#/enums/payment';
import { useDict } from '#/hooks/useDict';
defineOptions({ name: 'PayCallbackRecordList' });
const { dictConvert, dictItems: channelOptions } = useDict('channel');
const { dictItems: statusOptions } = useDict('callback_status');
const { dictConvert, dictItems: statusOptions } = useDict('callback_status');
const loading = ref(false);
const xTable = ref<VxeTableInstance>();
@@ -35,11 +35,19 @@
{ label: $t('payment.record.callbackRecord.typeRefund'), value: 'refund' },
]);
// 支付产品
const productOptions = computed(() =>
Object.keys(productNameMap).map((code) => ({
label: productLabel(code),
value: code,
})),
);
const queryFields = computed<QueryField[]>(() => [
{
type: 'string',
field: 'channelMchNo',
// 通道商户
// 通道商户
name: $t('payment.record.callbackRecord.channelMchNo'),
placeholder: $t('payment.record.callbackRecord.placeholderChannelMchNo'),
},
@@ -58,25 +66,25 @@
placeholder: $t('payment.record.callbackRecord.placeholderOutTradeNo'),
},
{
type: 'select',
field: 'channel',
// 支付通道
name: $t('payment.record.callbackRecord.channel'),
options: channelOptions.value,
type: 'list',
field: 'product',
// 支付产品
name: $t('payment.order.field.product'),
selectList: productOptions.value,
},
{
type: 'select',
type: 'list',
field: 'callbackType',
// 回调类型
name: $t('payment.record.callbackRecord.callbackType'),
options: callbackTypeOptions.value,
selectList: callbackTypeOptions.value,
},
{
type: 'select',
type: 'list',
field: 'status',
// 处理状态
name: $t('payment.record.callbackRecord.status'),
options: statusOptions.value,
selectList: statusOptions.value,
},
{
type: 'string',
@@ -91,6 +99,18 @@
return type || '-';
}
function productLabel(code?: string): string {
if (!code) return '-';
const i18nKey = productI18nMap[code];
if (i18nKey) {
const text = $t(i18nKey);
if (text && text !== i18nKey) {
return text;
}
}
return productNameMap[code] || code;
}
function formatNotifyInfo(raw?: string) {
if (!raw) return '-';
try {
@@ -157,12 +177,6 @@
</div>
</template>
</vxe-column>
<vxe-column
field="channelMchNo"
:title="$t('payment.record.callbackRecord.channelMchNo')"
:min-width="160"
show-overflow
/>
<vxe-column
field="tradeNo"
:title="$t('payment.record.callbackRecord.tradeNo')"
@@ -175,11 +189,6 @@
:min-width="200"
show-overflow
/>
<vxe-column field="channel" :title="$t('payment.record.callbackRecord.channel')" :min-width="120">
<template #default="{ row }">
{{ dictConvert('channel', row.channel) || row.channel || '-' }}
</template>
</vxe-column>
<vxe-column
field="callbackType"
:title="$t('payment.record.callbackRecord.callbackType')"
@@ -198,6 +207,21 @@
:min-width="180"
show-overflow
/>
<vxe-column field="product" :title="$t('payment.order.field.product')" :min-width="140" show-overflow>
<template #default="{ row }">{{ productLabel(row.product) }}</template>
</vxe-column>
<vxe-column
field="channelMchNo"
:title="$t('payment.record.callbackRecord.channelMchNo')"
:min-width="160"
>
<template #default="{ row }">
<div class="flex flex-col">
<span>{{ row.channelMerchantName || row.channelMchNo || '-' }}</span>
<span v-if="row.channelMchNo" class="text-xs text-muted-foreground">{{ row.channelMchNo }}</span>
</div>
</template>
</vxe-column>
<vxe-column
field="createTime"
:title="$t('payment.record.callbackRecord.createTime')"
@@ -239,11 +263,15 @@
<div>{{ $t('payment.record.callbackRecord.tradeNo') }}: {{ detail.tradeNo || '-' }}</div>
<div>{{ $t('payment.record.callbackRecord.outTradeNo') }}: {{ detail.outTradeNo || '-' }}</div>
<div>
{{ $t('payment.record.callbackRecord.channelMchNo') }}: {{ detail.channelMchNo || '-' }}
{{ $t('payment.order.field.product') }}:
{{ productLabel(detail.product) }}
</div>
<div>
{{ $t('payment.record.callbackRecord.channel') }}:
{{ dictConvert('channel', detail.channel) || detail.channel || '-' }}
{{ $t('payment.record.callbackRecord.channelMchNo') }}:
{{ detail.channelMerchantName || detail.channelMchNo || '-' }}
<span v-if="detail.channelMerchantName && detail.channelMchNo" class="text-muted-foreground">
({{ detail.channelMchNo }})
</span>
</div>
<div>
{{ $t('payment.record.callbackRecord.callbackType') }}: {{ callbackTypeLabel(detail.callbackType) }}