This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
<ElButton type="primary" @click="showCreateDialog" v-if="hasAuth('refund:create')"
|
||||
>创建退款申请</ElButton
|
||||
>
|
||||
<ElButton v-if="hasAuth('refund:export')" @click="exportDialogVisible = true">
|
||||
导出
|
||||
</ElButton>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
|
||||
@@ -48,6 +51,15 @@
|
||||
<!-- 创建退款申请对话框 -->
|
||||
<CreateRefundDialog v-model="createDialogVisible" @success="handleCreateSuccess" />
|
||||
|
||||
<!-- 导出任务对话框 -->
|
||||
<ExportTaskCreateDialog
|
||||
v-model="exportDialogVisible"
|
||||
scene="refund"
|
||||
:query="exportQuery"
|
||||
confirm-permission="refund:export"
|
||||
title="导出退款"
|
||||
/>
|
||||
|
||||
<!-- 退款凭证预览 -->
|
||||
<PaymentVoucherDialog
|
||||
:file-keys="refundVoucherFileKeys"
|
||||
@@ -147,7 +159,6 @@
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { fenToYuan, formatDateTime, yuanToFen } from '@/utils/business/format'
|
||||
import {
|
||||
getApprovalStatusText,
|
||||
getCurrentApproverSummaryText,
|
||||
getProcessingStatusText
|
||||
} from '@/utils/business/approvalSummary'
|
||||
@@ -155,6 +166,7 @@
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
||||
import VoucherUpload from '@/components/business/VoucherUpload.vue'
|
||||
import ExportTaskCreateDialog from '@/components/business/ExportTaskCreateDialog.vue'
|
||||
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
|
||||
@@ -170,6 +182,7 @@
|
||||
const tableRef = ref()
|
||||
const resubmitUploadRef = ref<InstanceType<typeof VoucherUpload>>()
|
||||
const createDialogVisible = ref(false)
|
||||
const exportDialogVisible = ref(false)
|
||||
const resubmitDialogVisible = ref(false)
|
||||
const currentRefund = ref<Refund | null>(null)
|
||||
const refundVoucherFileKeys = ref<string[]>([])
|
||||
@@ -269,6 +282,7 @@
|
||||
{ label: '实际退款金额', prop: 'approved_refund_amount' },
|
||||
{ label: '实收金额', prop: 'actual_received_amount' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
{ label: '审批渠道', prop: 'approval_provider' },
|
||||
{ label: '提交人', prop: 'submitter_name' },
|
||||
{ label: '审批状态', prop: 'approval_status' },
|
||||
{ label: '当前审批人摘要', prop: 'current_approver_summary' },
|
||||
@@ -279,7 +293,8 @@
|
||||
{ label: '资产重置', prop: 'asset_reset' },
|
||||
{ label: '佣金扣除', prop: 'commission_deducted' },
|
||||
{ label: '创建时间', prop: 'created_at' },
|
||||
{ label: '审批时间', prop: 'processed_at' }
|
||||
{ label: '审批时间', prop: 'processed_at' },
|
||||
{ label: '更新时间', prop: 'updated_at' }
|
||||
]
|
||||
|
||||
const resubmitFormRef = ref<FormInstance>()
|
||||
@@ -320,17 +335,6 @@
|
||||
return statusMap[status] || 'info'
|
||||
}
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: RefundStatus): string => {
|
||||
const statusMap: Record<RefundStatus, string> = {
|
||||
1: '待审批',
|
||||
2: '已通过',
|
||||
3: '已拒绝',
|
||||
4: '已退回'
|
||||
}
|
||||
return statusMap[status] || '-'
|
||||
}
|
||||
|
||||
// 动态列配置
|
||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
||||
{
|
||||
@@ -404,7 +408,17 @@
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: Refund) => {
|
||||
return h(ElTag, { type: getStatusType(row.status) }, () => getStatusText(row.status))
|
||||
return h(ElTag, { type: getStatusType(row.status) }, () => row.status_name || '-')
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'approval_provider',
|
||||
label: '审批渠道',
|
||||
width: 110,
|
||||
formatter: (row: Refund) => {
|
||||
if (row.approval_provider === 'wecom' || row.approval_source === 'wecom') return '企微'
|
||||
if (row.approval_source === 'legacy') return '历史审批'
|
||||
return row.approval_provider || row.approval_source || '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -418,7 +432,7 @@
|
||||
prop: 'approval_status',
|
||||
label: '审批状态',
|
||||
width: 120,
|
||||
formatter: (row: Refund) => getApprovalStatusText(row)
|
||||
formatter: (row: Refund) => row.approval_status_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'current_approver_summary',
|
||||
@@ -483,6 +497,12 @@
|
||||
label: '审批时间',
|
||||
width: 180,
|
||||
formatter: (row: Refund) => (row.processed_at ? formatDateTime(row.processed_at) : '-')
|
||||
},
|
||||
{
|
||||
prop: 'updated_at',
|
||||
label: '更新时间',
|
||||
width: 180,
|
||||
formatter: (row: Refund) => formatDateTime(row.updated_at)
|
||||
}
|
||||
])
|
||||
|
||||
@@ -564,6 +584,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
const exportQuery = computed(() => ({
|
||||
status: searchForm.status,
|
||||
order_id: searchForm.order_id,
|
||||
shop_id: searchForm.shop_id,
|
||||
asset_identifier: searchForm.asset_identifier?.trim() || undefined
|
||||
}))
|
||||
|
||||
// 重置搜索
|
||||
const handleReset = () => {
|
||||
Object.assign(searchForm, { ...initialSearchState })
|
||||
|
||||
Reference in New Issue
Block a user