优化提现订单跳转与按钮样式
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Refresh, Search } from '@element-plus/icons-vue'
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ArrowLeft, Refresh, Search } from '@element-plus/icons-vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { fetchAdminOrders, type AdminOrderQuery, type Order } from '@/features/orders'
|
||||
import {
|
||||
@@ -29,6 +29,8 @@ const total = ref(0)
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(20)
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const canReturnToWithdrawals = computed(() => route.query.from === 'withdrawals')
|
||||
|
||||
const orderStatusOptions = [
|
||||
{ label: '待支付', value: 'pending_payment' },
|
||||
@@ -121,6 +123,23 @@ function resetFilters() {
|
||||
void queryOrders()
|
||||
}
|
||||
|
||||
function returnToWithdrawals() {
|
||||
const query: Record<string, string> = {}
|
||||
const returnQueryKeys = [
|
||||
'withdrawal_status',
|
||||
'withdrawal_user_id',
|
||||
'withdrawal_page',
|
||||
'withdrawal_page_size',
|
||||
] as const
|
||||
|
||||
for (const key of returnQueryKeys) {
|
||||
const value = route.query[key]
|
||||
if (typeof value === 'string' && value) query[key] = value
|
||||
}
|
||||
|
||||
void router.push({ path: adminPath('withdrawals'), query })
|
||||
}
|
||||
|
||||
function amountYuan(cent: unknown) {
|
||||
if (cent !== undefined && cent !== null) return centToYuan(Number(cent || 0))
|
||||
return 0
|
||||
@@ -148,6 +167,9 @@ function isPlatformManaged(row: Order) {
|
||||
<p>查看全量订单、交接状态、金额和结算状态。</p>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<el-button v-if="canReturnToWithdrawals" :icon="ArrowLeft" @click="returnToWithdrawals">
|
||||
返回提现审核
|
||||
</el-button>
|
||||
<el-button :icon="Refresh" @click="loadOrders">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user