fix: 退款审批可以是0
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m43s

This commit is contained in:
sexygoat
2026-06-06 15:09:31 +08:00
parent c5e4082c26
commit d23e896f97
4 changed files with 177 additions and 13 deletions

View File

@@ -68,7 +68,7 @@
<span>{{ currentRefund?.refund_no }}</span>
</ElFormItem>
<ElFormItem label="申请退款金额">
<span>{{ formatCurrency(currentRefund?.requested_refund_amount || 0) }}</span>
<span>{{ formatCurrency(currentRefund?.requested_refund_amount) }}</span>
</ElFormItem>
<ElFormItem label="实际退款金额" prop="approved_refund_amount">
<ElInputNumber
@@ -410,7 +410,9 @@
const refundList = ref<Refund[]>([])
// 格式化货币 - 将分转换为元
const formatCurrency = (amount: number): string => {
const formatCurrency = (amount: number | null | undefined): string => {
if (amount === undefined || amount === null || Number.isNaN(amount)) return '-'
return `¥${(amount / 100).toFixed(2)}`
}
@@ -496,8 +498,7 @@
prop: 'approved_refund_amount',
label: '实际退款金额',
width: 150,
formatter: (row: Refund) =>
row.approved_refund_amount === null ? '-' : formatCurrency(row.approved_refund_amount)
formatter: (row: Refund) => formatCurrency(row.approved_refund_amount)
},
{
prop: 'actual_received_amount',
@@ -797,8 +798,8 @@
const handleShowResubmit = (row: Refund) => {
currentRefund.value = row
// 预填充原有数据
resubmitForm.requested_refund_amount = row.requested_refund_amount / 100
resubmitForm.actual_received_amount = fenToYuan(row.actual_received_amount)
resubmitForm.requested_refund_amount = fenToYuan(row.requested_refund_amount) || undefined
resubmitForm.actual_received_amount = fenToYuan(row.actual_received_amount) || undefined
resubmitForm.refund_reason = row.refund_reason
resubmitDialogVisible.value = true
}