修复平台代管订单流程
This commit is contained in:
@@ -33,7 +33,15 @@ export interface Order {
|
||||
counter_info?: string
|
||||
status: OrderStatus
|
||||
handoff_status: HandoffStatus
|
||||
handoff_mode?: string
|
||||
settlement_mode?: string
|
||||
managed_admin_id?: number
|
||||
settlement_status: SettlementStatus
|
||||
offline_settlement_status?: string
|
||||
offline_settlement_amount_cent?: number
|
||||
offline_settlement_remark?: string
|
||||
offline_settled_by?: number
|
||||
offline_settled_at?: string
|
||||
refund_status?: string
|
||||
refund_amount_cent?: number
|
||||
deposit_hold_status?: string
|
||||
@@ -51,6 +59,11 @@ export interface Order {
|
||||
|
||||
export interface AdminActions {
|
||||
reset_handoff?: AdminAction
|
||||
platform_handoff?: AdminAction
|
||||
platform_checkout_confirm?: AdminAction
|
||||
platform_checkout_counter?: AdminAction
|
||||
platform_checkout_dispute?: AdminAction
|
||||
platform_offline_settlement?: AdminAction
|
||||
}
|
||||
|
||||
export interface AdminAction {
|
||||
@@ -373,6 +386,46 @@ export async function adminResetHandoff(id: number, reason: string) {
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminPlatformHandoff(id: number, content: string, reason: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<HandoffRecord>>(
|
||||
`/admin/orders/${id}/platform-handoff`,
|
||||
{ content, reason }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminPlatformCheckoutConfirm(id: number, reason: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<{ confirmed: boolean }>>(
|
||||
`/admin/orders/${id}/platform-checkout/confirm`,
|
||||
{ reason }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminPlatformCheckoutCounter(id: number, payload: SubmitCheckoutPayload) {
|
||||
const { data } = await apiClient.post<ApiResponse<Checkout>>(
|
||||
`/admin/orders/${id}/platform-checkout/counter`,
|
||||
toCheckoutRequest(payload)
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminPlatformCheckoutDispute(id: number, reason: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<{ disputed: boolean }>>(
|
||||
`/admin/orders/${id}/platform-checkout/dispute`,
|
||||
{ reason }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminMarkOfflineSettlement(id: number, remark: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<{ settled: boolean }>>(
|
||||
`/admin/orders/${id}/offline-settlement`,
|
||||
{ remark }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function adminRefundStatus(id: number) {
|
||||
const { data } = await apiClient.get<ApiResponse<RefundStatus>>(
|
||||
`/admin/orders/${id}/refund-status`
|
||||
|
||||
@@ -234,13 +234,16 @@ export function ownerActualIncome(item: Order, userID: number | undefined | null
|
||||
export function formatHandoffRecordType(type: string) {
|
||||
const typeMap: Record<string, string> = {
|
||||
owner_handoff: '卖家交接',
|
||||
platform_handoff: '客服代交接',
|
||||
renter_checkout: '买家结账',
|
||||
owner_counter_checkout: '卖家反驳结账',
|
||||
platform_checkout_counter: '客服修改结账',
|
||||
renter_confirm_checkout: '买家确认结账',
|
||||
owner_accept_checkout: '卖家接受结账',
|
||||
admin_arbitration: '客服仲裁',
|
||||
dispute_opened: '发起申诉',
|
||||
checkout_dispute_opened: '发起结账争议',
|
||||
platform_checkout_dispute_opened: '客服发起结账争议',
|
||||
dispute_cancelled: '取消申诉',
|
||||
checkout_dispute_cancelled: '取消结账争议',
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
OrderHandoffTimeline,
|
||||
OrderResourceUsageEditor,
|
||||
} from '@/features/orders'
|
||||
import { handoffStatusLabel, orderStatusLabel } from '@/shared/utils/statusLabels'
|
||||
import { orderHandoffStatusLabel, orderStatusLabel } from '@/shared/utils/statusLabels'
|
||||
import { formatDateTime } from '@/shared/utils/time'
|
||||
|
||||
// 移动端支付收银台(基于通用 useOrderPaymentCashier 的薄封装:注入 vant toast + App 浏览器跳转)。
|
||||
@@ -202,7 +202,7 @@ async function copyListingCode() {
|
||||
</div>
|
||||
<div class="meta-item">
|
||||
<span class="meta-label">交接状态</span>
|
||||
<strong class="meta-value">{{ handoffStatusLabel(order.handoff_status) }}</strong>
|
||||
<strong class="meta-value">{{ orderHandoffStatusLabel(order) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { useOrderActions } from '@/features/orders/composables/useOrderActions'
|
||||
import { useOrderPaymentCashier } from '@/features/orders/composables/useOrderPaymentCashier'
|
||||
import { formatCent } from '@/shared/utils/money'
|
||||
import { handoffStatusLabel, orderStatusLabel } from '@/shared/utils/statusLabels'
|
||||
import { orderHandoffStatusLabel, orderStatusLabel } from '@/shared/utils/statusLabels'
|
||||
import { formatDateTime } from '@/shared/utils/time'
|
||||
import type { PaymentPayWay } from '@/features/orders/api/orders'
|
||||
|
||||
@@ -302,7 +302,7 @@ watch([() => route.query.focus, order, loading], () => {
|
||||
<el-step
|
||||
title="待交接"
|
||||
:description="
|
||||
order.status === 'pending_handoff' ? handoffStatusLabel(order.handoff_status) : ''
|
||||
order.status === 'pending_handoff' ? orderHandoffStatusLabel(order) : ''
|
||||
"
|
||||
/>
|
||||
<el-step
|
||||
@@ -383,7 +383,7 @@ watch([() => route.query.focus, order, loading], () => {
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span class="metric-label">交接状态</span>
|
||||
<strong class="metric-value">{{ handoffStatusLabel(order.handoff_status) }}</strong>
|
||||
<strong class="metric-value">{{ orderHandoffStatusLabel(order) }}</strong>
|
||||
</div>
|
||||
<div class="metric-card highlight">
|
||||
<span class="metric-label">{{ orderAmountLabel }}</span>
|
||||
|
||||
Reference in New Issue
Block a user