Commit 9f7619155a8422455093cdef481144a1fca43ad3

Authored by 曾国涛
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 8 postPrepaidList,
9 9 } from '@/services';
10 10 import { enumValueToLabel, formatDateTime } from '@/utils';
  11 +import { getUserInfo } from '@/utils/user';
11 12 import { PlusOutlined } from '@ant-design/icons';
12 13 import { ActionType, ProTable } from '@ant-design/pro-components';
13 14 import { Button, Divider, Image, Tabs, message } from 'antd';
... ... @@ -27,6 +28,7 @@ import {
27 28 import './index.less';
28 29  
29 30 const PrepaidPage = () => {
  31 + const user = getUserInfo();
30 32 const prepaidActionRef = useRef<ActionType>();
31 33 const accountActionRef = useRef<ActionType>();
32 34 const [rechargePrepaymentModalVisible, setRechargePrepaymentModalVisible] =
... ... @@ -338,7 +340,12 @@ const PrepaidPage = () =&gt; {
338 340 ];
339 341  
340 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 349 return {
343 350 ...item,
344 351 nowMoney: '****',
... ...