完善订单交接结账流程留痕

This commit is contained in:
yml2213
2026-08-28 23:48:32 +08:00
parent a9a9127076
commit c87883cc65
27 changed files with 915 additions and 5 deletions
@@ -20,9 +20,11 @@ import {
adminResetHandoff,
adminSealOrder,
fetchAdminHandoffRecords,
fetchAdminOrderProcessEvents,
fetchAdminOrder,
type HandoffRecord,
type Order,
type ProcessEvent,
type RefundStatus,
} from '@/features/orders'
import { adminCreateOrderDispute } from '@/features/disputes'
@@ -44,6 +46,7 @@ import {
} from '@/shared/utils/statusLabels'
import { formatDateTime } from '@/shared/utils/time'
import { formatGameName, formatListingNo } from '@/shared/utils/listingDisplay'
import ProcessTimeline from '../components/ProcessTimeline.vue'
const route = useRoute()
const router = useRouter()
@@ -51,6 +54,7 @@ const loading = ref(false)
const submitting = ref(false)
const order = ref<Order | null>(null)
const handoffRecords = ref<HandoffRecord[]>([])
const processEvents = ref<ProcessEvent[]>([])
const paymentRecords = ref<AdminPayment[]>([])
type OrderActionType =
| 'close'
@@ -355,8 +359,14 @@ async function loadOrder() {
loading.value = true
try {
order.value = await fetchAdminOrder(String(route.params.id))
handoffRecords.value = await fetchAdminHandoffRecords(String(route.params.id))
paymentRecords.value = (await fetchAdminPayments({ order_id: String(route.params.id) })).items
const [handoffs, events, payments] = await Promise.all([
fetchAdminHandoffRecords(String(route.params.id)),
fetchAdminOrderProcessEvents(String(route.params.id)),
fetchAdminPayments({ order_id: String(route.params.id) }),
])
handoffRecords.value = handoffs
processEvents.value = events
paymentRecords.value = payments.items
await loadRefundStatus()
} finally {
loading.value = false
@@ -783,6 +793,10 @@ function settlementModeLabel(mode?: string) {
return map[mode || 'owner_wallet'] || mode || '-'
}
function accountSourceLabel(source?: string) {
return source === 'external' ? '外部上传' : '站内上传'
}
function offlineSettlementStatusLabel(status?: string) {
const map: Record<string, string> = {
none: '无需线下结算',
@@ -1132,6 +1146,34 @@ function paymentPaidAt(record: AdminPayment) {
</dl>
</section>
<section class="dashboard-panel detail-panel">
<div class="panel-heading">
<h2>账号来源与处理方式</h2>
</div>
<dl class="detail-list">
<div>
<dt>账号来源</dt>
<dd>{{ accountSourceLabel(order.account_source) }}</dd>
</div>
<div v-if="order.source_channel">
<dt>外部渠道</dt>
<dd>{{ order.source_channel }}</dd>
</div>
<div>
<dt>交接责任</dt>
<dd>{{ handoffModeLabel(order.handoff_mode) }}</dd>
</div>
<div>
<dt>结算方式</dt>
<dd>{{ settlementModeLabel(order.settlement_mode) }}</dd>
</div>
<div v-if="order.managed_admin_id">
<dt>负责客服</dt>
<dd>ID {{ order.managed_admin_id }}</dd>
</div>
</dl>
</section>
<section v-if="isPlatformManaged" class="dashboard-panel detail-panel">
<div class="panel-heading">
<h2>平台代管</h2>
@@ -1373,6 +1415,17 @@ function paymentPaidAt(record: AdminPayment) {
</div>
</section>
<section class="dashboard-panel detail-panel order-wide-panel">
<div class="panel-heading">
<h2>交易全流程</h2>
<span class="panel-subtitle">每次提交、修改、确认及结算均单独留痕</span>
</div>
<ProcessTimeline
:events="processEvents"
empty-text="暂无新版过程记录;旧订单仍可查看下方原始交接记录"
/>
</section>
<section class="dashboard-panel detail-panel order-wide-panel">
<div class="panel-heading">
<h2>交接记录</h2>
@@ -7,11 +7,13 @@ import { useRoute } from 'vue-router'
import {
fetchAdminPickup,
fetchAdminPickupFinancialAdjustments,
fetchAdminPickupProcessEvents,
createAdminPickupFinancialAdjustment,
settleAdminPickupFinancialAdjustment,
updateAdminPickupProfit,
type AdminPickup,
type AdminPickupFinancialAdjustment,
type AdminPickupProcessEvent,
} from '@/features/admin/api/adminPickup'
import { quantity, readNumber, readUnitPrice } from '@/features/orders/composables/useOrderSnapshot'
import { adminPath } from '@/shared/utils/adminPath'
@@ -24,6 +26,7 @@ import {
} from '@/shared/utils/money'
import { pickupStatusLabel } from '@/shared/utils/statusLabels'
import { formatDateTime } from '@/shared/utils/time'
import ProcessTimeline from '../components/ProcessTimeline.vue'
interface SnapshotResource {
key: string
@@ -38,6 +41,7 @@ const route = useRoute()
const loading = ref(false)
const pickup = ref<AdminPickup | null>(null)
const financialAdjustments = ref<AdminPickupFinancialAdjustment[]>([])
const processEvents = ref<AdminPickupProcessEvent[]>([])
const profitDialogVisible = ref(false)
const financialAdjustmentDialogVisible = ref(false)
const profitSaving = ref(false)
@@ -117,12 +121,14 @@ onMounted(loadPickup)
async function loadPickup() {
loading.value = true
try {
const [item, adjustments] = await Promise.all([
const [item, adjustments, events] = await Promise.all([
fetchAdminPickup(String(route.params.id)),
fetchAdminPickupFinancialAdjustments(String(route.params.id)),
fetchAdminPickupProcessEvents(String(route.params.id)),
])
pickup.value = item
financialAdjustments.value = adjustments
processEvents.value = events
} finally {
loading.value = false
}
@@ -467,6 +473,17 @@ function readSnapshotResources(summary: Record<string, unknown> | null): Snapsho
</dl>
</section>
<section class="dashboard-panel detail-panel pickup-wide-panel">
<div class="panel-heading">
<h2>提号全流程</h2>
<span class="panel-subtitle">创建、完成、调整及线下结算均单独留痕</span>
</div>
<ProcessTimeline
:events="processEvents"
empty-text="暂无新版过程记录;可先查看下方备注和财务调整记录"
/>
</section>
<section
v-if="financialAdjustments.length"
class="dashboard-panel detail-panel pickup-wide-panel"