Commit 7495acf847cab0fdd1a2352640a70a9e59d0dcd5
1 parent
8f02eae3
feat(report): 添加支付记录查询错误处理
- 引入 ElMessage 组件用于显示错误提示 - 设置日期范围选择器为不可清除状态 - 增加 API 响应错误处理逻辑,当查询失败时显示错误消息
Showing
1 changed file
with
6 additions
and
1 deletions
apps/web-payment/src/views/report/thirdPayRecord/index.vue
| @@ -3,6 +3,7 @@ import type { VbenFormProps } from '#/adapter/form'; | @@ -3,6 +3,7 @@ import type { VbenFormProps } from '#/adapter/form'; | ||
| 3 | import type { VxeGridProps } from '#/adapter/vxe-table'; | 3 | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| 4 | 4 | ||
| 5 | import dayjs from 'dayjs'; | 5 | import dayjs from 'dayjs'; |
| 6 | +import { ElMessage } from 'element-plus'; | ||
| 6 | 7 | ||
| 7 | import { useVbenVxeGrid } from '#/adapter/vxe-table'; | 8 | import { useVbenVxeGrid } from '#/adapter/vxe-table'; |
| 8 | import { getPayRecordList } from '#/api/report'; | 9 | import { getPayRecordList } from '#/api/report'; |
| @@ -120,7 +121,7 @@ const formOptions: VbenFormProps = { | @@ -120,7 +121,7 @@ const formOptions: VbenFormProps = { | ||
| 120 | label: '创建时间', | 121 | label: '创建时间', |
| 121 | componentProps: { | 122 | componentProps: { |
| 122 | type: 'daterange', | 123 | type: 'daterange', |
| 123 | - // clearable: false, | 124 | + clearable: false, |
| 124 | }, | 125 | }, |
| 125 | defaultValue: [ | 126 | defaultValue: [ |
| 126 | dayjs().format('YYYY-MM-DD'), | 127 | dayjs().format('YYYY-MM-DD'), |
| @@ -197,6 +198,10 @@ const gridOptions: VxeGridProps = { | @@ -197,6 +198,10 @@ const gridOptions: VxeGridProps = { | ||
| 197 | : '', | 198 | : '', |
| 198 | ...formValues, | 199 | ...formValues, |
| 199 | }); | 200 | }); |
| 201 | + if (Number(res.code) !== 200) { | ||
| 202 | + ElMessage.error(res.message || '查询失败'); | ||
| 203 | + return; | ||
| 204 | + } | ||
| 200 | return { | 205 | return { |
| 201 | items: res.data, | 206 | items: res.data, |
| 202 | total: res.total, | 207 | total: res.total, |