feat(withdrawal): 开放售后提现审核权限

This commit is contained in:
yml
2026-11-26 22:15:40 +08:00
parent abbb977ca6
commit 128301f47a
6 changed files with 57 additions and 12 deletions
@@ -13,12 +13,17 @@ import AuthImage from '@/shared/components/business/AuthImage.vue'
import { formatCent, formatCentWithSymbol } from '@/shared/utils/money'
import { orderStatusLabel, settlementStatusLabel } from '@/shared/utils/statusLabels'
import { formatDateTime } from '@/shared/utils/time'
import { useAdminSessionStore } from '@/stores/adminSession'
const props = defineProps<{
modelValue: boolean
withdrawal: WithdrawalDetail | null
}>()
const adminSession = useAdminSessionStore()
const canReview = computed(() => adminSession.hasPermission('withdrawal:review'))
const canPay = computed(() => adminSession.hasPermission('withdrawal:pay'))
const emit = defineEmits<{
(e: 'update:modelValue', val: boolean): void
(e: 'saved'): void
@@ -607,7 +612,7 @@ function incomeText(income?: number) {
<div class="dialog-footer">
<div>
<el-button
v-if="withdrawal?.status === 'pending'"
v-if="withdrawal?.status === 'pending' && canReview"
type="success"
:loading="submitting"
@click="handleReview(true)"
@@ -615,7 +620,7 @@ function incomeText(income?: number) {
通过审核
</el-button>
<el-button
v-if="withdrawal?.status === 'pending'"
v-if="withdrawal?.status === 'pending' && canReview"
type="danger"
:loading="submitting"
@click="handleReview(false)"
@@ -623,7 +628,7 @@ function incomeText(income?: number) {
拒绝
</el-button>
<el-button
v-if="withdrawal?.status === 'processing'"
v-if="withdrawal?.status === 'processing' && canPay"
type="primary"
:loading="submitting"
@click="handleConfirmPayment"
@@ -25,10 +25,12 @@ import {
} from '@/features/admin/api/adminWithdrawal'
import { formatCentWithSymbol } from '@/shared/utils/money'
import { formatDateTime } from '@/shared/utils/time'
import { useAdminSessionStore } from '@/stores/adminSession'
import AdminTablePagination from '../components/AdminTablePagination.vue'
import WithdrawalDetailDialog from '../components/WithdrawalDetailDialog.vue'
const route = useRoute()
const adminSession = useAdminSessionStore()
const loading = ref(false)
const withdrawals = ref<WithdrawalListItem[]>([])
@@ -63,6 +65,8 @@ const completedAmount = computed(() =>
.filter(w => w.status === 'completed')
.reduce((sum, w) => sum + Number(w.actual_amount_cent || w.amount_cent || 0), 0)
)
const canReview = computed(() => adminSession.hasPermission('withdrawal:review'))
const canPay = computed(() => adminSession.hasPermission('withdrawal:pay'))
onMounted(() => {
restoreListState()
@@ -438,7 +442,7 @@ function money(cent: number | undefined | null) {
详情
</el-button>
<el-button
v-if="row.status === 'pending'"
v-if="row.status === 'pending' && canReview"
link
type="success"
@click="handleReview(row, true)"
@@ -446,7 +450,7 @@ function money(cent: number | undefined | null) {
通过
</el-button>
<el-button
v-if="row.status === 'pending'"
v-if="row.status === 'pending' && canReview"
link
type="danger"
@click="handleReview(row, false)"
@@ -454,7 +458,7 @@ function money(cent: number | undefined | null) {
拒绝
</el-button>
<el-button
v-if="row.status === 'processing'"
v-if="row.status === 'processing' && canPay"
link
type="primary"
@click="handleConfirmPayment(row)"