update refund items

This commit is contained in:
2026-04-03 10:18:05 +08:00
parent 783715bead
commit 2f5af0538e
3 changed files with 171 additions and 33 deletions
+53 -26
View File
@@ -45,8 +45,8 @@ const columns = [
{ title: '退款单ID', key: 'refund_id', width: 100 },
{ title: '平台退款ID', key: 'platform_refund_id', width: 160, ellipsis: true },
{ title: '关联订单ID', key: 'platform_order_id', width: 160, ellipsis: true },
{ title: '子订单ID', dataIndex: 'platform_sub_order_id', width: 140, ellipsis: true },
{ title: '平台商品ID', dataIndex: 'platform_product_id', width: 140, ellipsis: true },
{ title: '子订单ID', key: 'platform_sub_order_id', width: 140, ellipsis: true },
{ title: '平台商品ID', key: 'platform_product_id', width: 140, ellipsis: true },
{ title: '退款状态', key: 'refund_status', width: 110 },
{ title: '退款类型', key: 'refund_type', width: 130 },
{ title: '数量', dataIndex: 'quantity', width: 80 },
@@ -103,7 +103,7 @@ function formatTime(time: string | null) {
return time.replace('T', ' ').substring(0, 16)
}
async function handleCopyId(text: string, label: string) {
async function handleCopy(text: string, label: string) {
try {
await navigator.clipboard.writeText(text)
message.success(`已复制${label}`)
@@ -113,11 +113,17 @@ async function handleCopyId(text: string, label: string) {
}
function handleGoToOrder(platformOrderId: string) {
router.push({ path: '/orders', query: { platform_order_id: platformOrderId } })
router.push({
path: '/orders',
query: { platform_order_id: platformOrderId, auto_submit: '1' },
})
}
function handleGoToRefund(refundId: number) {
router.push({ path: '/refunds', query: { id: String(refundId) } })
function handleGoToRefund(platformRefundId: string) {
router.push({
path: '/refunds',
query: { platform_refund_id: platformRefundId, auto_submit: '1' },
})
}
async function handleViewDetail(record: { id: number }) {
@@ -147,7 +153,7 @@ async function handleViewDetail(record: { id: number }) {
<!-- Filter area -->
<a-card class="mb-4">
<a-form layout="inline" @submit.prevent="handleSearch">
<a-form layout="inline" class="filter-form" @submit.prevent="handleSearch">
<a-form-item>
<CascadeFilter v-model="store.cascadeValue" />
</a-form-item>
@@ -260,29 +266,50 @@ async function handleViewDetail(record: { id: number }) {
<template v-else-if="column.key === 'refund_id'">
<a
class="text-blue-500 cursor-pointer"
@click="handleGoToRefund(record.refund_id)"
@click="handleGoToRefund(record.platform_refund_id)"
>
{{ record.refund_id }}
</a>
</template>
<template v-else-if="column.key === 'platform_refund_id'">
{{ record.platform_refund_id }}
<CopyOutlined
class="ml-1 cursor-pointer text-gray-400 hover:text-blue-500"
@click.stop="handleCopyId(record.platform_refund_id, '平台退款ID')"
/>
<span class="inline-flex items-center gap-1">
<CopyOutlined
class="flex-shrink-0 cursor-pointer text-gray-400 hover:text-blue-500"
@click.stop="handleCopy(record.platform_refund_id, '平台退款ID')"
/>
<span class="truncate">{{ record.platform_refund_id }}</span>
</span>
</template>
<template v-else-if="column.key === 'platform_order_id'">
<a
class="text-blue-500 cursor-pointer"
@click="handleGoToOrder(record.platform_order_id)"
>
{{ record.platform_order_id }}
</a>
<CopyOutlined
class="ml-1 cursor-pointer text-gray-400 hover:text-blue-500"
@click.stop="handleCopyId(record.platform_order_id, '平台订单ID')"
/>
<span class="inline-flex items-center gap-1">
<CopyOutlined
class="flex-shrink-0 cursor-pointer text-gray-400 hover:text-blue-500"
@click.stop="handleCopy(record.platform_order_id, '平台订单ID')"
/>
<a class="truncate text-blue-500 cursor-pointer"
@click="handleGoToOrder(record.platform_order_id)">
{{ record.platform_order_id }}
</a>
</span>
</template>
<template v-else-if="column.key === 'platform_sub_order_id'">
<span v-if="record.platform_sub_order_id" class="inline-flex items-center gap-1">
<CopyOutlined
class="flex-shrink-0 cursor-pointer text-gray-400 hover:text-blue-500"
@click.stop="handleCopy(record.platform_sub_order_id, '子订单ID')"
/>
<span class="truncate">{{ record.platform_sub_order_id }}</span>
</span>
<span v-else>-</span>
</template>
<template v-else-if="column.key === 'platform_product_id'">
<span class="inline-flex items-center gap-1">
<CopyOutlined
class="flex-shrink-0 cursor-pointer text-gray-400 hover:text-blue-500"
@click.stop="handleCopy(record.platform_product_id, '平台商品ID')"
/>
<span class="truncate">{{ record.platform_product_id }}</span>
</span>
</template>
<template v-else-if="column.key === 'refund_status'">
<a-tag
@@ -351,7 +378,7 @@ async function handleViewDetail(record: { id: number }) {
<a-descriptions-item label="退款单ID">
<a
class="text-blue-500 cursor-pointer"
@click="handleGoToRefund(refundItemDetail.refund_id)"
@click="handleGoToRefund(refundItemDetail.platform_refund_id)"
>
{{ refundItemDetail.refund_id }}
</a>
@@ -360,7 +387,7 @@ async function handleViewDetail(record: { id: number }) {
{{ refundItemDetail.platform_refund_id }}
<CopyOutlined
class="ml-2 cursor-pointer text-blue-500"
@click="handleCopyId(refundItemDetail.platform_refund_id, '平台退款ID')"
@click="handleCopy(refundItemDetail.platform_refund_id, '平台退款ID')"
/>
</a-descriptions-item>
<a-descriptions-item label="父退款ID">
@@ -375,7 +402,7 @@ async function handleViewDetail(record: { id: number }) {
</a>
<CopyOutlined
class="ml-2 cursor-pointer text-blue-500"
@click="handleCopyId(refundItemDetail.platform_order_id, '平台订单ID')"
@click="handleCopy(refundItemDetail.platform_order_id, '平台订单ID')"
/>
</a-descriptions-item>
<a-descriptions-item label="子订单ID">