Commit 9f7619155a8422455093cdef481144a1fca43ad3
1 parent
31183be4
feat(Order): 临时隐藏某些预存账号的余额
Showing
1 changed file
with
8 additions
and
1 deletions
src/pages/Prepaid/index.tsx
@@ -8,6 +8,7 @@ import { | @@ -8,6 +8,7 @@ import { | ||
8 | postPrepaidList, | 8 | postPrepaidList, |
9 | } from '@/services'; | 9 | } from '@/services'; |
10 | import { enumValueToLabel, formatDateTime } from '@/utils'; | 10 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
11 | +import { getUserInfo } from '@/utils/user'; | ||
11 | import { PlusOutlined } from '@ant-design/icons'; | 12 | import { PlusOutlined } from '@ant-design/icons'; |
12 | import { ActionType, ProTable } from '@ant-design/pro-components'; | 13 | import { ActionType, ProTable } from '@ant-design/pro-components'; |
13 | import { Button, Divider, Image, Tabs, message } from 'antd'; | 14 | import { Button, Divider, Image, Tabs, message } from 'antd'; |
@@ -27,6 +28,7 @@ import { | @@ -27,6 +28,7 @@ import { | ||
27 | import './index.less'; | 28 | import './index.less'; |
28 | 29 | ||
29 | const PrepaidPage = () => { | 30 | const PrepaidPage = () => { |
31 | + const user = getUserInfo(); | ||
30 | const prepaidActionRef = useRef<ActionType>(); | 32 | const prepaidActionRef = useRef<ActionType>(); |
31 | const accountActionRef = useRef<ActionType>(); | 33 | const accountActionRef = useRef<ActionType>(); |
32 | const [rechargePrepaymentModalVisible, setRechargePrepaymentModalVisible] = | 34 | const [rechargePrepaymentModalVisible, setRechargePrepaymentModalVisible] = |
@@ -338,7 +340,12 @@ const PrepaidPage = () => { | @@ -338,7 +340,12 @@ const PrepaidPage = () => { | ||
338 | ]; | 340 | ]; |
339 | 341 | ||
340 | const processedData = data.map((item) => { | 342 | const processedData = data.map((item) => { |
341 | - if (targetPhones.includes(item.phone)) { | 343 | + const isAdmin = user.roles.includes('ADMIN'); |
344 | + const isSalesManager = user.roles.includes('SALES_MANAGER'); | ||
345 | + if ( | ||
346 | + targetPhones.includes(item.phone) && | ||
347 | + !(isAdmin || isSalesManager) | ||
348 | + ) { | ||
342 | return { | 349 | return { |
343 | ...item, | 350 | ...item, |
344 | nowMoney: '****', | 351 | nowMoney: '****', |