feat: 订单详情新增尝试再次退款入口
退款中的订单可重新发起原路退款,并保留人工核销兜底。
This commit is contained in:
@@ -54,4 +54,10 @@ export const escortApi = {
|
|||||||
request<{ record: EscortRecord }>(`/health/escort-record/${id}/refund/manual`, {
|
request<{ record: EscortRecord }>(`/health/escort-record/${id}/refund/manual`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
refundRetry: (id: string) =>
|
||||||
|
request<{ refund: Record<string, unknown> | null; paymentStatus: string }>(
|
||||||
|
`/health/escort-record/${id}/refund/retry`,
|
||||||
|
{ method: 'POST' }
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,14 @@
|
|||||||
>
|
>
|
||||||
查询退款结果
|
查询退款结果
|
||||||
</BButton>
|
</BButton>
|
||||||
|
<BButton
|
||||||
|
v-if="record.payment?.status === 'refunding'"
|
||||||
|
variant="primary"
|
||||||
|
:disabled="actionLoading"
|
||||||
|
@click="retryRefundVisible = true"
|
||||||
|
>
|
||||||
|
尝试再次退款
|
||||||
|
</BButton>
|
||||||
<BButton
|
<BButton
|
||||||
v-if="record.payment?.status === 'refunding'"
|
v-if="record.payment?.status === 'refunding'"
|
||||||
variant="danger"
|
variant="danger"
|
||||||
@@ -345,6 +353,17 @@
|
|||||||
<p class="text-muted mb-0 fs-12">核销后订单支付状态将变为「已退款」,且不可撤销。</p>
|
<p class="text-muted mb-0 fs-12">核销后订单支付状态将变为「已退款」,且不可撤销。</p>
|
||||||
</ConfirmModal>
|
</ConfirmModal>
|
||||||
|
|
||||||
|
<ConfirmModal
|
||||||
|
v-model="retryRefundVisible"
|
||||||
|
title="尝试再次退款"
|
||||||
|
ok-title="确认退款"
|
||||||
|
ok-variant="warning"
|
||||||
|
@confirm="submitRetryRefund"
|
||||||
|
>
|
||||||
|
<p class="mb-1">将按原退款单号再次向微信发起原路退款。</p>
|
||||||
|
<p class="text-muted mb-0 fs-12">若上次退款已受理,微信会返回原退款结果,不会重复退款。</p>
|
||||||
|
</ConfirmModal>
|
||||||
|
|
||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
v-model="deleteVisible"
|
v-model="deleteVisible"
|
||||||
title="删除订单"
|
title="删除订单"
|
||||||
@@ -405,6 +424,7 @@ const paymentVisible = ref(false)
|
|||||||
const paymentForm = reactive({ method: 'offline_cash', amount: 0 })
|
const paymentForm = reactive({ method: 'offline_cash', amount: 0 })
|
||||||
|
|
||||||
const manualRefundVisible = ref(false)
|
const manualRefundVisible = ref(false)
|
||||||
|
const retryRefundVisible = ref(false)
|
||||||
const deleteVisible = ref(false)
|
const deleteVisible = ref(false)
|
||||||
|
|
||||||
const sexRequirementLabel = computed(() => {
|
const sexRequirementLabel = computed(() => {
|
||||||
@@ -528,6 +548,21 @@ const queryRefund = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const submitRetryRefund = async () => {
|
||||||
|
if (!record.value) return
|
||||||
|
actionLoading.value = true
|
||||||
|
try {
|
||||||
|
const result = await escortApi.refundRetry(record.value._id)
|
||||||
|
notify.success(`已重新发起退款,支付状态:${PAYMENT_LABELS[result.paymentStatus] || result.paymentStatus}`)
|
||||||
|
retryRefundVisible.value = false
|
||||||
|
await load()
|
||||||
|
} catch {
|
||||||
|
// 错误提示由请求层统一弹出
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const submitManualRefund = async () => {
|
const submitManualRefund = async () => {
|
||||||
if (!record.value) return
|
if (!record.value) return
|
||||||
actionLoading.value = true
|
actionLoading.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user