Commit fb5f200cb4e3e0b12ae71a8a8f86357d6512b833

Authored by shaofan
1 parent 5033c063

Refactor: 优化骑手提现审核页表格滚动与固定列样式,补充 rider.withdraw 菜单图标映射。

src/components/AppMenuTree.vue
... ... @@ -33,6 +33,7 @@ import {
33 33 TrophyOutlined,
34 34 UnorderedListOutlined,
35 35 UserOutlined,
  36 + WalletOutlined,
36 37 } from '@ant-design/icons-vue'
37 38  
38 39 withDefaults(defineProps<{ menus: MenuNode[] }>(), {
... ... @@ -53,11 +54,13 @@ const iconMap: Record&lt;string, Component&gt; = {
53 54 TrophyOutlined,
54 55 SettingOutlined,
55 56 MessageOutlined,
  57 + WalletOutlined,
56 58 }
57 59  
58 60 const codeIconMap: Record<string, Component> = {
59 61 'substation.user': TeamOutlined,
60 62 'rider.level': TrophyOutlined,
  63 + 'rider.withdraw': WalletOutlined,
61 64 'system.sub_root': SettingOutlined,
62 65 'system.sub_role': TeamOutlined,
63 66 'system.sub_role_menu': SettingOutlined,
... ...
src/views/rider/RiderWithdrawAudit.vue
1 1 <template>
2 2 <div>
3 3 <a-card title="骑手提现审核" :bordered="false" class="list-table-card">
4   - <div class="soft-page-stack">
  4 + <div class="soft-page-stack withdraw-audit-stack">
5 5 <div class="soft-note-card">
6 6 <strong>审核说明</strong>
7 7 <p>骑手申请提现时会先冻结可用余额;审核拒绝后解冻,审核通过后进入待打款,标记已打款后扣减冻结金额并写入提现流水。</p>
... ... @@ -26,19 +26,21 @@
26 26 <a-select-option :value="3">已打款</a-select-option>
27 27 <a-select-option :value="4">打款失败</a-select-option>
28 28 </a-select>
29   - <a-date-picker v-model:value="startDate" value-format="YYYY-MM-DD" placeholder="申请开始日期" class="list-filter" @change="handleFilterChange" />
30   - <a-date-picker v-model:value="endDate" value-format="YYYY-MM-DD" placeholder="申请结束日期" class="list-filter" @change="handleFilterChange" />
  29 + <a-date-picker v-model:value="startDate" value-format="YYYY-MM-DD" placeholder="开始日期" class="list-filter" @change="handleFilterChange" />
  30 + <a-date-picker v-model:value="endDate" value-format="YYYY-MM-DD" placeholder="结束日期" class="list-filter" @change="handleFilterChange" />
31 31 <a-input-search v-model:value="keyword" placeholder="搜索提现单号/骑手姓名/手机号" class="list-search" @search="handleKeywordSearch" />
32 32 </div>
33 33 </div>
34 34  
35 35 <a-table
  36 + class="withdraw-table"
36 37 :dataSource="list"
37 38 :columns="columns"
38 39 :loading="loading"
39 40 rowKey="id"
40 41 :pagination="pagination"
41   - :scroll="{ x: 1500 }"
  42 + sticky
  43 + :scroll="{ x: tableScrollX, y: 560 }"
42 44 @change="handleTableChange"
43 45 >
44 46 <template #bodyCell="{ column, record }">
... ... @@ -64,8 +66,8 @@
64 66 <a-space>
65 67 <a @click="openDetail(record)">详情</a>
66 68 <template v-if="record.status === 0">
67   - <a @click="openAction('approve', record)" style="color:green">通过</a>
68   - <a @click="openAction('reject', record)" style="color:red">拒绝</a>
  69 + <a @click="openAction('approve', record)" style="color: green">通过</a>
  70 + <a @click="openAction('reject', record)" style="color: red">拒绝</a>
69 71 </template>
70 72 <template v-else-if="record.status === 1">
71 73 <a @click="openAction('paid', record)">标记已打款</a>
... ... @@ -151,6 +153,8 @@ const keyword = ref(&#39;&#39;)
151 153 const actionForm = reactive({ remark: '', transferNo: '' })
152 154 const { isAdmin, managedCityId, cityList, loadCities, getCityName } = useRoleCityList()
153 155  
  156 +const tableScrollX = computed(() => (isAdmin.value ? 1780 : 1660))
  157 +
154 158 const statusMap: Record<number, string> = {
155 159 0: '待审核',
156 160 1: '待打款',
... ... @@ -175,19 +179,19 @@ const accountTypeMap: Record&lt;number, string&gt; = {
175 179  
176 180 const columns = computed(() => {
177 181 const base = [
178   - { title: '提现单号', dataIndex: 'withdrawNo', ellipsis: true, width: 180 },
179   - { title: '骑手', dataIndex: 'riderName', width: 120 },
180   - { title: '手机号', dataIndex: 'mobile', width: 130 },
181   - { title: '提现金额', key: 'amount', width: 110 },
182   - { title: '状态', key: 'status', width: 100 },
183   - { title: '账户类型', key: 'accountType', width: 100 },
184   - { title: '收款人', dataIndex: 'accountName', width: 110 },
  182 + { title: '提现单号', dataIndex: 'withdrawNo', ellipsis: true, width: 160 },
  183 + { title: '骑手', dataIndex: 'riderName', width: 100 },
  184 + { title: '手机号', dataIndex: 'mobile', width: 120 },
  185 + { title: '提现金额', key: 'amount', width: 100 },
  186 + { title: '状态', key: 'status', width: 90 },
  187 + { title: '账户类型', key: 'accountType', width: 90 },
  188 + { title: '收款人', dataIndex: 'accountName', width: 100 },
185 189 { title: '收款账号', key: 'accountNo', width: 140 },
186   - { title: '可用余额', key: 'riderBalance', width: 110 },
187   - { title: '冻结余额', key: 'riderFrozenBalance', width: 110 },
188   - { title: '申请时间', key: 'applyTime', width: 160 },
189   - { title: '审核人', dataIndex: 'auditorName', width: 120 },
190   - { title: '审核时间', key: 'auditTime', width: 160 },
  190 + { title: '可用余额', key: 'riderBalance', width: 100 },
  191 + { title: '冻结余额', key: 'riderFrozenBalance', width: 100 },
  192 + { title: '申请时间', key: 'applyTime', width: 150 },
  193 + { title: '审核人', dataIndex: 'auditorName', width: 100 },
  194 + { title: '审核时间', key: 'auditTime', width: 150 },
191 195 { title: '操作', key: 'action', fixed: 'right', width: 180 },
192 196 ]
193 197 return isAdmin.value ? [{ title: '租户', key: 'cityName', width: 120 }, ...base] : base
... ... @@ -322,3 +326,36 @@ onMounted(async () =&gt; {
322 326 await loadList()
323 327 })
324 328 </script>
  329 +
  330 +<style scoped>
  331 +.withdraw-audit-stack,
  332 +.withdraw-table {
  333 + min-width: 0;
  334 +}
  335 +
  336 +.withdraw-table {
  337 + --withdraw-fixed-bg: #fff;
  338 + --withdraw-fixed-hover-bg: #e6e2fc;
  339 +}
  340 +
  341 +.withdraw-table :deep(.ant-table-cell-fix-right) {
  342 + background: var(--withdraw-fixed-bg) !important;
  343 +}
  344 +
  345 +.withdraw-table :deep(.ant-table-tbody > tr:hover > td.ant-table-cell-fix-right) {
  346 + background: var(--withdraw-fixed-hover-bg) !important;
  347 +}
  348 +
  349 +:global(.dark) .withdraw-table {
  350 + --withdraw-fixed-bg: rgb(40, 36, 60);
  351 + --withdraw-fixed-hover-bg: #302c45;
  352 +}
  353 +
  354 +.withdraw-table :deep(.ant-table-cell-fix-right-first) {
  355 + box-shadow: -8px 0 12px -10px rgba(47, 41, 70, 0.45);
  356 +}
  357 +
  358 +.withdraw-table :deep(.ant-space) {
  359 + white-space: nowrap;
  360 +}
  361 +</style>
... ...