This commit is contained in:
@@ -40,24 +40,24 @@
|
||||
<!-- 拒绝提现对话框 -->
|
||||
<ElDialog
|
||||
v-model="rejectDialogVisible"
|
||||
:title="$t('commission.dialog.reject')"
|
||||
title="拒绝提现申请"
|
||||
width="500px"
|
||||
>
|
||||
<ElForm ref="rejectFormRef" :model="rejectForm" :rules="rejectRules" label-width="100px">
|
||||
<ElFormItem :label="$t('commission.form.rejectReason')" prop="reject_reason">
|
||||
<ElFormItem label="拒绝原因" prop="reject_reason">
|
||||
<ElInput
|
||||
v-model="rejectForm.reject_reason"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:placeholder="$t('commission.form.rejectReasonPlaceholder')"
|
||||
placeholder="请输入拒绝原因"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem :label="$t('commission.form.remark')" prop="remark">
|
||||
<ElFormItem label="备注" prop="remark">
|
||||
<ElInput
|
||||
v-model="rejectForm.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
:placeholder="$t('commission.form.remarkPlaceholder')"
|
||||
placeholder="请输入备注信息"
|
||||
/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
defineOptions({ name: 'WithdrawalApproval' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n() // 仅保留用于 common.tips, common.confirm, common.cancel
|
||||
|
||||
const rejectDialogVisible = ref(false)
|
||||
const loading = ref(false)
|
||||
@@ -116,50 +116,50 @@
|
||||
|
||||
// 提现状态选项
|
||||
const withdrawalStatusOptions = [
|
||||
{ label: t('commission.status.pending'), value: 1 },
|
||||
{ label: t('commission.status.approved'), value: 2 },
|
||||
{ label: t('commission.status.rejected'), value: 3 },
|
||||
{ label: t('commission.status.completed'), value: 4 }
|
||||
{ label: '待审核', value: 1 },
|
||||
{ label: '已通过', value: 2 },
|
||||
{ label: '已拒绝', value: 3 },
|
||||
{ label: '已到账', value: 4 }
|
||||
]
|
||||
|
||||
// 搜索表单配置
|
||||
const searchFormItems: SearchFormItem[] = [
|
||||
{
|
||||
label: t('commission.searchForm.status'),
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
options: withdrawalStatusOptions,
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: t('commission.searchForm.statusPlaceholder')
|
||||
placeholder: '请选择状态'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: t('commission.searchForm.withdrawalNo'),
|
||||
label: '提现单号',
|
||||
prop: 'withdrawal_no',
|
||||
type: 'input',
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: t('commission.searchForm.withdrawalNoPlaceholder')
|
||||
placeholder: '请输入提现单号'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: t('commission.searchForm.shopName'),
|
||||
label: '店铺名称',
|
||||
prop: 'shop_name',
|
||||
type: 'input',
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: t('commission.searchForm.shopNamePlaceholder')
|
||||
placeholder: '请输入店铺名称'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: t('commission.searchForm.dateRange'),
|
||||
label: '申请时间',
|
||||
prop: 'dateRange',
|
||||
type: 'daterange',
|
||||
config: {
|
||||
clearable: true,
|
||||
startPlaceholder: t('commission.searchForm.dateRangePlaceholder.0'),
|
||||
endPlaceholder: t('commission.searchForm.dateRangePlaceholder.1'),
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
onChange: (val: [string, string] | null) => {
|
||||
if (val && val.length === 2) {
|
||||
@@ -183,27 +183,27 @@
|
||||
|
||||
// 列配置
|
||||
const columnOptions = [
|
||||
{ label: t('commission.table.withdrawalNo'), prop: 'withdrawal_no' },
|
||||
{ label: t('commission.table.shopName'), prop: 'shop_name' },
|
||||
{ label: t('commission.table.applicant'), prop: 'applicant_name' },
|
||||
{ label: t('commission.table.withdrawalAmount'), prop: 'amount' },
|
||||
{ label: t('commission.table.fee'), prop: 'fee' },
|
||||
{ label: t('commission.table.actualAmount'), prop: 'actual_amount' },
|
||||
{ label: t('commission.table.withdrawalMethod'), prop: 'withdrawal_method' },
|
||||
{ label: t('commission.table.status'), prop: 'status' },
|
||||
{ label: t('commission.table.applyTime'), prop: 'created_at' },
|
||||
{ label: t('commission.table.approveTime'), prop: 'processed_at' },
|
||||
{ label: t('commission.table.actions'), prop: 'operation' }
|
||||
{ label: '提现单号', prop: 'withdrawal_no' },
|
||||
{ label: '店铺名称', prop: 'shop_name' },
|
||||
{ label: '申请人', prop: 'applicant_name' },
|
||||
{ label: '提现金额', prop: 'amount' },
|
||||
{ label: '手续费', prop: 'fee' },
|
||||
{ label: '实际到账', prop: 'actual_amount' },
|
||||
{ label: '提现方式', prop: 'withdrawal_method' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
{ label: '申请时间', prop: 'created_at' },
|
||||
{ label: '审批时间', prop: 'processed_at' },
|
||||
{ label: '操作', prop: 'operation' }
|
||||
]
|
||||
|
||||
const rejectFormRef = ref<FormInstance>()
|
||||
|
||||
const rejectRules = reactive<FormRules>({
|
||||
reject_reason: [
|
||||
{ required: true, message: t('commission.validation.rejectReasonRequired'), trigger: 'blur' }
|
||||
{ required: true, message: '请输入拒绝原因', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: t('commission.validation.remarkRequired'), trigger: 'blur' }
|
||||
{ required: true, message: '请输入备注', trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
|
||||
@@ -218,43 +218,43 @@
|
||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
||||
{
|
||||
prop: 'withdrawal_no',
|
||||
label: t('commission.table.withdrawalNo'),
|
||||
label: '提现单号',
|
||||
minWidth: 180
|
||||
},
|
||||
{
|
||||
prop: 'shop_name',
|
||||
label: t('commission.table.shopName'),
|
||||
label: '店铺名称',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'applicant_name',
|
||||
label: t('commission.table.applicant'),
|
||||
label: '申请人',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
prop: 'amount',
|
||||
label: t('commission.table.withdrawalAmount'),
|
||||
label: '提现金额',
|
||||
width: 120,
|
||||
align: 'right',
|
||||
formatter: (row: WithdrawalRequestItem) => formatMoney(row.amount)
|
||||
},
|
||||
{
|
||||
prop: 'fee',
|
||||
label: t('commission.table.fee'),
|
||||
label: '手续费',
|
||||
width: 100,
|
||||
align: 'right',
|
||||
formatter: (row: WithdrawalRequestItem) => formatMoney(row.fee)
|
||||
},
|
||||
{
|
||||
prop: 'actual_amount',
|
||||
label: t('commission.table.actualAmount'),
|
||||
label: '实际到账',
|
||||
width: 120,
|
||||
align: 'right',
|
||||
formatter: (row: WithdrawalRequestItem) => formatMoney(row.actual_amount)
|
||||
},
|
||||
{
|
||||
prop: 'withdrawal_method',
|
||||
label: t('commission.table.withdrawalMethod'),
|
||||
label: '提现方式',
|
||||
width: 120,
|
||||
formatter: (row: WithdrawalRequestItem) => {
|
||||
const method = WithdrawalMethodMap[row.withdrawal_method as WithdrawalMethod]
|
||||
@@ -263,7 +263,7 @@
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: t('commission.table.status'),
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: WithdrawalRequestItem) => {
|
||||
const statusInfo = WithdrawalStatusMap[row.status as keyof typeof WithdrawalStatusMap]
|
||||
@@ -272,19 +272,19 @@
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: t('commission.table.applyTime'),
|
||||
label: '申请时间',
|
||||
width: 180,
|
||||
formatter: (row: WithdrawalRequestItem) => formatDateTime(row.created_at)
|
||||
},
|
||||
{
|
||||
prop: 'processed_at',
|
||||
label: t('commission.table.approveTime'),
|
||||
label: '审批时间',
|
||||
width: 180,
|
||||
formatter: (row: WithdrawalRequestItem) => formatDateTime(row.processed_at)
|
||||
},
|
||||
{
|
||||
prop: 'operation',
|
||||
label: t('commission.table.actions'),
|
||||
label: '操作',
|
||||
width: 150,
|
||||
fixed: 'right',
|
||||
formatter: (row: WithdrawalRequestItem) => {
|
||||
@@ -292,12 +292,12 @@
|
||||
if (row.status === 1) {
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, [
|
||||
h(ArtButtonTable, {
|
||||
text: t('commission.buttons.approve'),
|
||||
text: '审批通过',
|
||||
iconColor: '#67C23A',
|
||||
onClick: () => handleApprove(row)
|
||||
}),
|
||||
h(ArtButtonTable, {
|
||||
text: t('commission.buttons.reject'),
|
||||
text: '拒绝',
|
||||
iconColor: '#F56C6C',
|
||||
onClick: () => showRejectDialog(row)
|
||||
})
|
||||
@@ -368,7 +368,7 @@
|
||||
|
||||
// 审批通过
|
||||
const handleApprove = (row: WithdrawalRequestItem) => {
|
||||
ElMessageBox.confirm(t('commission.messages.approveConfirm'), t('common.tips'), {
|
||||
ElMessageBox.confirm('确定要通过该提现申请吗?', t('common.tips'), {
|
||||
confirmButtonText: t('common.confirm'),
|
||||
cancelButtonText: t('common.cancel'),
|
||||
type: 'warning'
|
||||
@@ -376,7 +376,7 @@
|
||||
.then(async () => {
|
||||
try {
|
||||
await CommissionService.approveWithdrawal(row.id)
|
||||
ElMessage.success(t('commission.messages.approveSuccess'))
|
||||
ElMessage.success('审批通过成功')
|
||||
getTableData()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
@@ -407,7 +407,7 @@
|
||||
reject_reason: rejectForm.reject_reason,
|
||||
remark: rejectForm.remark
|
||||
})
|
||||
ElMessage.success(t('commission.messages.rejectSuccess'))
|
||||
ElMessage.success('拒绝成功')
|
||||
rejectDialogVisible.value = false
|
||||
rejectFormRef.value?.resetFields()
|
||||
getTableData()
|
||||
|
||||
Reference in New Issue
Block a user