增加零号主收入结算确认

This commit is contained in:
yml2213
2026-08-29 01:31:08 +08:00
parent 527e5ed228
commit 2487a2d83f
7 changed files with 101 additions and 5 deletions
@@ -68,6 +68,7 @@ type OrderActionType =
| ''
const actionType = ref<OrderActionType>('')
const reason = ref('')
const zeroOwnerIncomeConfirmed = ref(false)
const refundStatus = ref<RefundStatus | null>(null)
const platformHandoffVisible = ref(false)
const platformHandoffContent = ref('')
@@ -476,7 +477,11 @@ async function submitAction() {
await adminResetHandoff(order.value.id, reason.value)
ElMessage.success(`${resetActionLabel.value}成功`)
} else if (actionType.value === 'platform_checkout_confirm') {
await adminPlatformCheckoutConfirm(order.value.id, reason.value)
await adminPlatformCheckoutConfirm(
order.value.id,
reason.value,
zeroOwnerIncomeConfirmed.value
)
ElMessage.success('结账已确认')
} else if (actionType.value === 'platform_checkout_dispute') {
await adminPlatformCheckoutDispute(order.value.id, reason.value)
@@ -500,6 +505,28 @@ async function submitAction() {
}
}
async function confirmPlatformCheckout() {
if (!order.value) return
zeroOwnerIncomeConfirmed.value = false
if (Number(order.value.checkout?.owner_income_amount_cent ?? 0) === 0) {
try {
await ElMessageBox.confirm(
'本次结算的号主收入为 ¥0.0。确认后将完成结算,请再次确认是否继续。',
'号主收入为零',
{
confirmButtonText: '仍确认结算',
cancelButtonText: '取消',
type: 'warning',
}
)
} catch {
return
}
zeroOwnerIncomeConfirmed.value = true
}
openAction('platform_checkout_confirm')
}
function openPlatformHandoff() {
platformHandoffContent.value = ''
platformHandoffReason.value = ''
@@ -952,7 +979,7 @@ function paymentPaidAt(record: AdminPayment) {
<el-button
v-if="canPlatformCheckoutConfirm"
type="primary"
@click="openAction('platform_checkout_confirm')"
@click="confirmPlatformCheckout"
>
{{ platformCheckoutConfirmAction?.label || '客服确认结账' }}
</el-button>
@@ -1500,6 +1527,17 @@ function paymentPaidAt(record: AdminPayment) {
<p>
<strong>{{ order.order_no }}</strong> · 商品编号 {{ listingCode }} · {{ order.title }}
</p>
<el-alert
v-if="
actionType === 'platform_checkout_confirm' &&
Number(order.checkout?.owner_income_amount_cent ?? 0) === 0
"
title="号主收入为零"
description="本次结算将按号主收入 ¥0.0 完成,请确认无误后再继续。"
type="warning"
:closable="false"
show-icon
/>
<el-input
v-model="reason"
type="textarea"
+6 -2
View File
@@ -458,10 +458,14 @@ export async function adminForceHandoff(id: number, content: string, reason: str
return data.data
}
export async function adminPlatformCheckoutConfirm(id: number, reason: string) {
export async function adminPlatformCheckoutConfirm(
id: number,
reason: string,
confirmZeroOwnerIncome = false
) {
const { data } = await apiClient.post<ApiResponse<{ confirmed: boolean }>>(
`/admin/orders/${id}/platform-checkout/confirm`,
{ reason }
{ reason, confirm_zero_owner_income: confirmZeroOwnerIncome }
)
return data.data
}