This commit is contained in:
@@ -94,9 +94,7 @@
|
||||
title: '订单信息',
|
||||
fields: [
|
||||
{ label: '充值单号', prop: 'recharge_no' },
|
||||
{ label: '充值记录ID', prop: 'id' },
|
||||
{ label: '店铺名称', prop: 'shop_name' },
|
||||
{ label: '店铺ID', prop: 'shop_id' },
|
||||
{
|
||||
label: '充值金额',
|
||||
formatter: (_, data) => formatCurrency(data.amount)
|
||||
@@ -122,15 +120,6 @@
|
||||
prop: 'payment_channel',
|
||||
formatter: (value) => value || '-'
|
||||
},
|
||||
{
|
||||
label: '支付配置ID',
|
||||
prop: 'payment_config_id',
|
||||
formatter: (value) => value || '-'
|
||||
},
|
||||
{
|
||||
label: '代理钱包ID',
|
||||
prop: 'agent_wallet_id'
|
||||
},
|
||||
{
|
||||
label: '第三方支付流水号',
|
||||
prop: 'payment_transaction_id',
|
||||
|
||||
@@ -14,12 +14,6 @@
|
||||
<ElTag :type="getStatusType(refund.status)">{{ getStatusText(refund.status) }}</ElTag>
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="订单ID">{{ refund.order_id }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="店铺ID">{{ refund.shop_id }}</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="套餐使用记录ID">
|
||||
{{ refund.package_usage_id || '-' }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="申请退款金额">
|
||||
{{ formatCurrency(refund.requested_refund_amount) }}
|
||||
</ElDescriptionsItem>
|
||||
@@ -42,34 +36,29 @@
|
||||
</ElTag>
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="退款原因" :span="2">
|
||||
<ElDescriptionsItem label="退款原因">
|
||||
{{ refund.refund_reason || '-' }}
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="拒绝原因" :span="2">
|
||||
<ElDescriptionsItem label="拒绝原因">
|
||||
{{ refund.reject_reason || '-' }}
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="审批备注" :span="2">
|
||||
{{ refund.remark || '-' }}
|
||||
<ElDescriptionsItem label="审批时间">
|
||||
{{ refund.processed_at ? formatDateTime(refund.processed_at) : '-' }}
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="创建人ID">{{ refund.creator }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="审批人ID">
|
||||
{{ refund.processor_id || '-' }}
|
||||
<ElDescriptionsItem label="审批备注">
|
||||
{{ refund.remark || '-' }}
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="创建时间">
|
||||
{{ formatDateTime(refund.created_at) }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="审批时间">
|
||||
{{ refund.processed_at ? formatDateTime(refund.processed_at) : '-' }}
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="更新时间">
|
||||
{{ formatDateTime(refund.updated_at) }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="更新人ID">{{ refund.updater }}</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
|
||||
<div class="action-buttons" v-if="refund">
|
||||
|
||||
@@ -63,11 +63,12 @@
|
||||
placeholder="请输入订单号搜索"
|
||||
style="width: 100%"
|
||||
@focus="handleOrderSelectFocus"
|
||||
@change="handleOrderSelectChange"
|
||||
>
|
||||
<ElOption
|
||||
v-for="order in orderSearchOptions"
|
||||
:key="order.id"
|
||||
:label="`订单号: ${order.order_no} (ID: ${order.id})`"
|
||||
:label="order.order_no"
|
||||
:value="order.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
@@ -75,21 +76,18 @@
|
||||
<ElFormItem label="申请退款金额" prop="requested_refund_amount">
|
||||
<ElInputNumber
|
||||
v-model="createForm.requested_refund_amount"
|
||||
:min="1"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
style="width: 100%"
|
||||
placeholder="请输入申请退款金额(元)"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="实收金额" prop="actual_received_amount">
|
||||
<ElInputNumber
|
||||
v-model="createForm.actual_received_amount"
|
||||
:min="1"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
<ElFormItem label="实收金额">
|
||||
<ElInput
|
||||
:model-value="selectedOrderActualPaid"
|
||||
disabled
|
||||
style="width: 100%"
|
||||
placeholder="请输入实收金额(元)"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="退款原因">
|
||||
@@ -434,8 +432,7 @@
|
||||
|
||||
const createRules = reactive<FormRules>({
|
||||
order_id: [{ required: true, message: '请输入订单ID', trigger: 'blur' }],
|
||||
requested_refund_amount: [{ required: true, message: '请输入申请退款金额', trigger: 'blur' }],
|
||||
actual_received_amount: [{ required: true, message: '请输入实收金额', trigger: 'blur' }]
|
||||
requested_refund_amount: [{ required: true, message: '请输入申请退款金额', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const approveRules = reactive<FormRules>({})
|
||||
@@ -485,6 +482,15 @@
|
||||
|
||||
const refundList = ref<Refund[]>([])
|
||||
|
||||
// 选中的订单实收金额
|
||||
const selectedOrderActualPaid = computed(() => {
|
||||
if (!createForm.order_id) return 0
|
||||
const selectedOrder = orderSearchOptions.value.find((o) => o.id === createForm.order_id)
|
||||
if (!selectedOrder?.actual_paid_amount) return 0
|
||||
const amount = selectedOrder.actual_paid_amount / 100
|
||||
return isNaN(amount) ? 0 : amount
|
||||
})
|
||||
|
||||
// 格式化货币 - 将分转换为元
|
||||
const formatCurrency = (amount: number): string => {
|
||||
return `¥${(amount / 100).toFixed(2)}`
|
||||
@@ -684,6 +690,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 订单选择变化 - 自动填充实收金额
|
||||
const handleOrderSelectChange = (orderId: number | null) => {
|
||||
if (!orderId) {
|
||||
createForm.actual_received_amount = 0
|
||||
return
|
||||
}
|
||||
const selectedOrder = orderSearchOptions.value.find((o) => o.id === orderId)
|
||||
if (selectedOrder) {
|
||||
createForm.actual_received_amount = selectedOrder.actual_paid_amount / 100
|
||||
}
|
||||
}
|
||||
|
||||
// 获取退款申请列表
|
||||
const getTableData = async () => {
|
||||
loading.value = true
|
||||
|
||||
Reference in New Issue
Block a user