update order items

This commit is contained in:
2026-04-03 10:17:03 +08:00
parent 51292b618a
commit 5189798732
2 changed files with 160 additions and 20 deletions
+34 -18
View File
@@ -96,17 +96,20 @@ function formatTime(time: string | null) {
return time.replace('T', ' ').substring(0, 16)
}
async function handleCopyOrderId(platformOrderId: string) {
async function handleCopy(text: string, label: string = 'ID') {
try {
await navigator.clipboard.writeText(platformOrderId)
message.success('已复制平台订单ID')
await navigator.clipboard.writeText(text)
message.success(`已复制${label}`)
} catch {
message.error('复制失败')
}
}
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' },
})
}
async function handleViewDetail(record: { id: number }) {
@@ -137,7 +140,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>
@@ -207,22 +210,35 @@ async function handleViewDetail(record: { id: number }) {
{{ store.storeMap.get(record.store_id) || record.store_id }}
</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="handleCopyOrderId(record.platform_order_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 === 'sub_order_id'">
{{ record.sub_order_id || '-' }}
<span v-if="record.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.sub_order_id, '子订单ID')"
/>
<span class="truncate">{{ record.sub_order_id }}</span>
</span>
<span v-else>-</span>
</template>
<template v-else-if="column.key === 'platform_product_id'">
{{ record.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 === 'product_sku'">
{{ record.product_sku || '-' }}
@@ -318,7 +334,7 @@ async function handleViewDetail(record: { id: number }) {
</a>
<CopyOutlined
class="ml-2 cursor-pointer text-blue-500"
@click="handleCopyOrderId(itemDetail.parent_order.platform_order_id)"
@click="handleCopy(itemDetail.parent_order.platform_order_id, '平台订单ID')"
/>
</a-descriptions-item>
<a-descriptions-item label="订单状态">