Commit 4f196bc51f599867cfa30b3c76f059950bfd9747
1 parent
96450634
feat: update 页面header调整,将用户和消息信息放到header中
Showing
11 changed files
with
407 additions
and
343 deletions
.umirc.ts
src/app.ts
... | ... | @@ -6,6 +6,8 @@ import '@inspir/assembly-css/dist/special.css'; |
6 | 6 | import { message } from 'antd'; |
7 | 7 | import { RESPONSE_CODE } from './constants/enum'; |
8 | 8 | |
9 | +import { RunTimeLayoutConfig } from '@umijs/max'; | |
10 | +import GlobleHeader from './components/UserHeader'; | |
9 | 11 | import './style/global.css'; |
10 | 12 | import { getUserInfo } from './utils'; |
11 | 13 | |
... | ... | @@ -15,19 +17,29 @@ export async function getInitialState() { |
15 | 17 | return getUserInfo(); |
16 | 18 | } |
17 | 19 | |
18 | -export const layout = () => { | |
20 | +export const layout: RunTimeLayoutConfig = () => { | |
19 | 21 | return { |
20 | - menu: { | |
21 | - locale: false, | |
22 | - // header: true, | |
23 | - headerRender: true, | |
24 | - // rightContentRender: () => <RightContent />, | |
25 | - // footerRender: () => <Footer />, | |
26 | - }, | |
27 | - collapsed: true, | |
28 | - // breakpoint:false | |
22 | + headerRender: GlobleHeader, | |
23 | + siderWidth: '190px', | |
24 | + | |
25 | + layout: 'mix', | |
26 | + | |
27 | + // 其他属性见:https://procomponents.ant.design/components/layout#prolayout | |
29 | 28 | }; |
30 | 29 | }; |
30 | +// export const layout = () => { | |
31 | +// return { | |
32 | +// menu: { | |
33 | +// locale: false, | |
34 | +// header: GlobleHeader, | |
35 | +// headerRender:GlobleHeader, | |
36 | +// rightContentRender: () => GlobleHeader, | |
37 | +// // footerRender: () => <Footer />, | |
38 | +// }, | |
39 | +// // collapsed: true, | |
40 | +// // breakpoint:false | |
41 | +// }; | |
42 | +// }; | |
31 | 43 | |
32 | 44 | export const request: RequestConfig = { |
33 | 45 | // 错误处理 | ... | ... |
src/assets/logo/logo.png
0 → 100644
4.17 KB
src/components/UserHeader/index.less
0 → 100644
1 | +@import (reference) '~antd/es/style/themes/index'; | |
2 | + | |
3 | +@pro-header-hover-bg: rgba(0, 0, 0, 0.025); | |
4 | + | |
5 | +.menu { | |
6 | + :global(.anticon) { | |
7 | + margin-right: 8px; | |
8 | + } | |
9 | + | |
10 | + :global(.ant-dropdown-menu-item) { | |
11 | + min-width: 160px; | |
12 | + } | |
13 | +} | |
14 | + | |
15 | +.right { | |
16 | + display: flex; | |
17 | + float: right; | |
18 | + height: 48px; | |
19 | + margin-left: auto; | |
20 | + overflow: hidden; | |
21 | + | |
22 | + .action { | |
23 | + display: flex; | |
24 | + align-items: center; | |
25 | + height: 48px; | |
26 | + padding: 0 12px; | |
27 | + cursor: pointer; | |
28 | + transition: all 0.3s; | |
29 | + | |
30 | + > span { | |
31 | + vertical-align: middle; | |
32 | + } | |
33 | + | |
34 | + &:hover { | |
35 | + background: @pro-header-hover-bg; | |
36 | + } | |
37 | + | |
38 | + &:global(.opened) { | |
39 | + background: @pro-header-hover-bg; | |
40 | + } | |
41 | + } | |
42 | + | |
43 | + .search { | |
44 | + padding: 0 12px; | |
45 | + | |
46 | + &:hover { | |
47 | + background: transparent; | |
48 | + } | |
49 | + } | |
50 | + | |
51 | + .account { | |
52 | + .avatar { | |
53 | + margin-right: 8px; | |
54 | + color: @primary-color; | |
55 | + vertical-align: top; | |
56 | + background: rgba(255, 255, 255, 85%); | |
57 | + } | |
58 | + } | |
59 | +} | |
60 | + | |
61 | +.dark { | |
62 | + .action { | |
63 | + &:hover { | |
64 | + background: #252a3d; | |
65 | + } | |
66 | + | |
67 | + &:global(.opened) { | |
68 | + background: #252a3d; | |
69 | + } | |
70 | + } | |
71 | +} | |
72 | + | |
73 | +@media only screen and (max-width: @screen-md) { | |
74 | + :global(.ant-divider-vertical) { | |
75 | + vertical-align: unset; | |
76 | + } | |
77 | + | |
78 | + .name { | |
79 | + display: none; | |
80 | + } | |
81 | + | |
82 | + .right { | |
83 | + position: absolute; | |
84 | + top: 0; | |
85 | + right: 12px; | |
86 | + | |
87 | + .account { | |
88 | + .avatar { | |
89 | + margin-right: 0; | |
90 | + } | |
91 | + } | |
92 | + | |
93 | + .search { | |
94 | + display: none; | |
95 | + } | |
96 | + } | |
97 | +} | ... | ... |
src/components/UserHeader/index.tsx
0 → 100644
1 | +import { RESPONSE_CODE } from '@/constants/enum'; | |
2 | +import MessageListDrawer from '@/pages/Order/components/MessageListDrawer'; | |
3 | +import { postOrderErpMessageGetUnreadNum } from '@/services'; | |
4 | +import { getUserInfo } from '@/utils'; | |
5 | +import { BellOutlined, EllipsisOutlined } from '@ant-design/icons'; | |
6 | +import { history } from '@umijs/max'; | |
7 | +import { Avatar, Badge, Button, Dropdown, Space, Tag } from 'antd'; | |
8 | +import { useEffect, useState } from 'react'; | |
9 | + | |
10 | +const userInfo = getUserInfo(); | |
11 | + | |
12 | +const GlobleHeader = () => { | |
13 | + const [unreadMsgNum, setUnreadMsgNum] = useState(0); | |
14 | + const [messageListDrawerVisible, setMessageListDrawerVisible] = | |
15 | + useState<boolean>(false); | |
16 | + /** | |
17 | + * 打开消息弹窗 | |
18 | + */ | |
19 | + function openMessageDrawer() { | |
20 | + setMessageListDrawerVisible(true); | |
21 | + } | |
22 | + | |
23 | + /** | |
24 | + * 获取当前用户未读消息条数 | |
25 | + */ | |
26 | + async function getUnreadMessageNum() { | |
27 | + let res = await postOrderErpMessageGetUnreadNum(); | |
28 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
29 | + setUnreadMsgNum(res.data); | |
30 | + } | |
31 | + } | |
32 | + | |
33 | + useEffect(() => { | |
34 | + //未读消息条数 | |
35 | + getUnreadMessageNum(); | |
36 | + }, []); | |
37 | + return ( | |
38 | + <> | |
39 | + <Space className="flex flex-row items-center justify-between ml-4 mr-4"> | |
40 | + {/* left extra start */} | |
41 | + <Space className="flex flex-row items-center"> | |
42 | + <Avatar | |
43 | + size="large" | |
44 | + src={<img src={require('@/assets/logo/logo.png')} alt="canrd" />} | |
45 | + /> | |
46 | + <span className="text-lg font-semibold">订单管理系统</span> | |
47 | + </Space> | |
48 | + {/* left extra end */} | |
49 | + | |
50 | + {/* right extra start */} | |
51 | + <Space> | |
52 | + <Badge | |
53 | + key="message" | |
54 | + count={unreadMsgNum} | |
55 | + className="hover:cursor-pointer top-1" | |
56 | + > | |
57 | + <BellOutlined | |
58 | + style={{ fontSize: '24px' }} | |
59 | + onClick={openMessageDrawer} | |
60 | + /> | |
61 | + </Badge> | |
62 | + <Avatar | |
63 | + key="0" | |
64 | + style={{ verticalAlign: 'middle', marginLeft: '10px' }} | |
65 | + size="large" | |
66 | + > | |
67 | + {userInfo?.roleSmallVO?.name} | |
68 | + </Avatar> | |
69 | + <Tag key="nickName">{userInfo?.username}</Tag> | |
70 | + <Dropdown | |
71 | + key="dropdown" | |
72 | + trigger={['click']} | |
73 | + menu={{ | |
74 | + items: [ | |
75 | + { | |
76 | + label: '退出登录', | |
77 | + key: '1', | |
78 | + onClick: () => { | |
79 | + localStorage.removeItem('token'); | |
80 | + history.push('/login'); | |
81 | + }, | |
82 | + }, | |
83 | + // { | |
84 | + // label: '修改密码', | |
85 | + // key: '2', | |
86 | + // }, | |
87 | + ], | |
88 | + }} | |
89 | + > | |
90 | + <Button key="4" style={{ padding: '0 8px' }}> | |
91 | + <EllipsisOutlined /> | |
92 | + </Button> | |
93 | + </Dropdown> | |
94 | + </Space> | |
95 | + {/* right extra end */} | |
96 | + </Space> | |
97 | + | |
98 | + {messageListDrawerVisible && ( | |
99 | + <MessageListDrawer | |
100 | + setVisible={(val: any) => { | |
101 | + setMessageListDrawerVisible(val); | |
102 | + getUnreadMessageNum(); | |
103 | + }} | |
104 | + /> | |
105 | + )} | |
106 | + </> | |
107 | + ); | |
108 | +}; | |
109 | + | |
110 | +export default GlobleHeader; | ... | ... |
src/pages/Invoice/index.tsx
... | ... | @@ -15,15 +15,9 @@ import { |
15 | 15 | } from '@/services'; |
16 | 16 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
17 | 17 | import { formatDate } from '@/utils/time'; |
18 | -import { getUserInfo } from '@/utils/user'; | |
19 | -import { EllipsisOutlined, PlusOutlined } from '@ant-design/icons'; | |
20 | -import { | |
21 | - ActionType, | |
22 | - PageContainer, | |
23 | - ProTable, | |
24 | -} from '@ant-design/pro-components'; | |
25 | -import { history } from '@umijs/max'; | |
26 | -import { Avatar, Button, Dropdown, Tabs, Tag, message } from 'antd'; | |
18 | +import { PlusOutlined } from '@ant-design/icons'; | |
19 | +import { ActionType, ProTable } from '@ant-design/pro-components'; | |
20 | +import { Button, Tabs, message } from 'antd'; | |
27 | 21 | import { useRef, useState } from 'react'; |
28 | 22 | import { INVOCING_STATUS, PAYEE_OPTIONS } from '../Order/constant'; |
29 | 23 | import BankImportModal from './components/BankImportModal'; |
... | ... | @@ -37,8 +31,6 @@ const InvoicePage = () => { |
37 | 31 | useState(false); |
38 | 32 | const [invoiceId, setInvoiceId] = useState(undefined); |
39 | 33 | |
40 | - const userInfo = getUserInfo(); | |
41 | - | |
42 | 34 | const reloadInvoiceTable = () => { |
43 | 35 | invoiceActionRef.current?.reload(); |
44 | 36 | }; |
... | ... | @@ -420,55 +412,18 @@ const InvoicePage = () => { |
420 | 412 | }, |
421 | 413 | ]; |
422 | 414 | return ( |
423 | - <> | |
424 | - <PageContainer | |
425 | - className="invoice-index" | |
426 | - header={{ | |
427 | - title: '发票管理', | |
428 | - extra: [ | |
429 | - <Avatar key="0" style={{ verticalAlign: 'middle' }} size="large"> | |
430 | - {userInfo?.username} | |
431 | - </Avatar>, | |
432 | - <Tag key="nickName">{userInfo?.nickName}</Tag>, | |
433 | - <Dropdown | |
434 | - key="dropdown" | |
435 | - trigger={['click']} | |
436 | - menu={{ | |
437 | - items: [ | |
438 | - { | |
439 | - label: '退出登录', | |
440 | - key: '1', | |
441 | - onClick: () => { | |
442 | - localStorage.removeItem('token'); | |
443 | - history.push('/login'); | |
444 | - }, | |
445 | - }, | |
446 | - // { | |
447 | - // label: '修改密码', | |
448 | - // key: '2', | |
449 | - // }, | |
450 | - ], | |
451 | - }} | |
452 | - > | |
453 | - <Button key="4" style={{ padding: '0 8px' }}> | |
454 | - <EllipsisOutlined /> | |
455 | - </Button> | |
456 | - </Dropdown>, | |
457 | - ], | |
415 | + <div className="invoice-index"> | |
416 | + <Tabs | |
417 | + defaultActiveKey="1" | |
418 | + items={tabsItems} | |
419 | + onChange={(value) => { | |
420 | + if (value === 1) { | |
421 | + invoiceActionRef.current?.reload(); | |
422 | + } else { | |
423 | + bankActionRef.current?.reload(); | |
424 | + } | |
458 | 425 | }} |
459 | - > | |
460 | - <Tabs | |
461 | - defaultActiveKey="1" | |
462 | - items={tabsItems} | |
463 | - onChange={(value) => { | |
464 | - if (value === 1) { | |
465 | - invoiceActionRef.current?.reload(); | |
466 | - } else { | |
467 | - bankActionRef.current?.reload(); | |
468 | - } | |
469 | - }} | |
470 | - /> | |
471 | - </PageContainer> | |
426 | + /> | |
472 | 427 | |
473 | 428 | {bankImportModalVisible ? ( |
474 | 429 | <BankImportModal |
... | ... | @@ -495,7 +450,7 @@ const InvoicePage = () => { |
495 | 450 | ) : ( |
496 | 451 | '' |
497 | 452 | )} |
498 | - </> | |
453 | + </div> | |
499 | 454 | ); |
500 | 455 | }; |
501 | 456 | ... | ... |
src/pages/Order/components/ApplyForInvoicingModal.tsx
... | ... | @@ -3,7 +3,6 @@ import { postServiceOrderApplyInvoicing } from '@/services'; |
3 | 3 | import { enumToSelect, getAliYunOSSFileNameFromUrl } from '@/utils'; |
4 | 4 | import { |
5 | 5 | ModalForm, |
6 | - ProFormDatePicker, | |
7 | 6 | ProFormSelect, |
8 | 7 | ProFormTextArea, |
9 | 8 | ProFormUploadDragger, |
... | ... | @@ -172,13 +171,13 @@ export default ({ |
172 | 171 | }} |
173 | 172 | /> |
174 | 173 | |
175 | - <ProFormDatePicker | |
174 | + {/* <ProFormDatePicker | |
176 | 175 | key="deadline" |
177 | 176 | label="期望开票时间" |
178 | 177 | name="deadline" |
179 | 178 | rules={[{ required: isUrgent === 'true', message: '期望开票时间必填' }]} |
180 | 179 | hidden={isUrgent !== 'true'} |
181 | - /> | |
180 | + /> */} | |
182 | 181 | |
183 | 182 | <ProFormTextArea |
184 | 183 | key="invoicingUrgentCause" | ... | ... |
src/pages/Order/constant.ts
1 | 1 | import { postServiceOrderQueryCustomerInformation } from '@/services'; |
2 | -import { enumToProTableEnumValue, getUserInfo } from '@/utils'; | |
2 | +import { enumToProTableEnumValue } from '@/utils'; | |
3 | 3 | import { getReceivingCompanyOptions, isSupplier } from '@/utils/order'; |
4 | 4 | export const COMFIR_RECEIPT_IMAGES_NUMBER = 3; |
5 | 5 | |
... | ... | @@ -7,6 +7,7 @@ export const PAYMENT_CHANNEL_OPTIONS = { |
7 | 7 | ALIPAY: '支付宝', |
8 | 8 | WECHAT: '微信', |
9 | 9 | BANK_TRANSFER: '银行转账', |
10 | + BALANCE: '预存款', | |
10 | 11 | }; |
11 | 12 | |
12 | 13 | export const RECEIPTS_RECORD_TYPES = { |
... | ... | @@ -25,7 +26,7 @@ export const PAYMENT_METHOD_OPTIONS = { |
25 | 26 | PLATFORM_SETTLEMENT: '平台结算', |
26 | 27 | CASH_ON_DELIVERY: '货到付款', |
27 | 28 | HIRE_PURCHASE: '分期付款', |
28 | - PAYMENT_RECEIPT:'已回款' | |
29 | + PAYMENT_RECEIPT: '已回款', | |
29 | 30 | }; |
30 | 31 | |
31 | 32 | export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { |
... | ... | @@ -153,7 +154,7 @@ export const POST_AUDIT_OPTIONS = { |
153 | 154 | export const PAYMENT_RECEIPTS_STATUS_OPTIONS = { |
154 | 155 | WAIT_AUDIT: '回款待审核', |
155 | 156 | AUDIT_PASS: '回款已审核', |
156 | - AUDIT_NOTPASS: '回款审核失败' | |
157 | + AUDIT_NOTPASS: '回款审核失败', | |
157 | 158 | }; |
158 | 159 | |
159 | 160 | export const ORDER_STATUS_OPTIONS = { |
... | ... | @@ -190,8 +191,8 @@ export const MODIFIED_AUDIT_STATUS_OPTIONS = { |
190 | 191 | * 采购筛选订单的主要订单状态 |
191 | 192 | */ |
192 | 193 | export const PROCURE_PRIMARY_ORDER_STATUS_OPTIONS = { |
193 | - PROCURE_UN_PROCESS: isSupplier()?'未审核':'采购未审核', | |
194 | - PROCURE_WAIT_SHIP: isSupplier()?'待发货':'采购待发货', | |
194 | + PROCURE_UN_PROCESS: isSupplier() ? '未审核' : '采购未审核', | |
195 | + PROCURE_WAIT_SHIP: isSupplier() ? '待发货' : '采购待发货', | |
195 | 196 | SHIPPED: '已发货', |
196 | 197 | }; |
197 | 198 | |
... | ... | @@ -253,10 +254,10 @@ export const TAGS_COLOR = new Map<string, string>([ |
253 | 254 | ['PARTIAL_INVOICING', 'processing'], |
254 | 255 | ['URGENT_INVOICE_AUDITING', 'warning'], |
255 | 256 | ['APPLY_FOR_INVOICING', 'processing'], |
256 | - ['AUDIT_FAILURE','error'], | |
257 | - ['WAIT_AUDIT','warning'], | |
258 | - ['AUDIT_PASS','success'], | |
259 | - ['AUDIT_NOTPASS','error'] | |
257 | + ['AUDIT_FAILURE', 'error'], | |
258 | + ['WAIT_AUDIT', 'warning'], | |
259 | + ['AUDIT_PASS', 'success'], | |
260 | + ['AUDIT_NOTPASS', 'error'], | |
260 | 261 | ]); |
261 | 262 | export const SALES_CODE_OPTIONS = [ |
262 | 263 | { label: 'D-Linda', value: 'D-Linda' }, |
... | ... | @@ -380,6 +381,7 @@ export const HISTORY_OPT_TYPE = new Map<string, string>([ |
380 | 381 | ['warehouse_audit', '仓库审核'], |
381 | 382 | ['post_audit', '后置审核'], |
382 | 383 | ['applyModify', '申请修改订单信息'], |
384 | + ['OUTSIDE_SYSTEM_PUSH', '外部系统推送了本订单'], | |
383 | 385 | ]); |
384 | 386 | |
385 | 387 | export const MAIN_ORDER_COLUMNS = [ | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -3,7 +3,6 @@ import { RESPONSE_CODE } from '@/constants/enum'; |
3 | 3 | import { |
4 | 4 | postKingdeeRepSalBillOutbound, |
5 | 5 | postKingdeeRepSalOrderSave, |
6 | - postOrderErpMessageGetUnreadNum, | |
7 | 6 | postServiceOrderCancelSend, |
8 | 7 | postServiceOrderNoNeedSend, |
9 | 8 | postServiceOrderOrderCancel, |
... | ... | @@ -24,30 +23,28 @@ import { |
24 | 23 | getAliYunOSSFileNameFromUrl, |
25 | 24 | isImageName, |
26 | 25 | } from '@/utils'; |
27 | -import { getReceivingCompanyOptions, isSupplier } from '@/utils/order'; | |
26 | +import { | |
27 | + getReceivingCompanyOptions, | |
28 | + isExaminer, | |
29 | + isSupplier, | |
30 | +} from '@/utils/order'; | |
28 | 31 | import { getUserInfo } from '@/utils/user'; |
29 | 32 | import { |
30 | - BellOutlined, | |
31 | 33 | ClockCircleTwoTone, |
32 | 34 | ContainerTwoTone, |
33 | 35 | CopyOutlined, |
34 | 36 | CopyTwoTone, |
35 | 37 | DownOutlined, |
36 | 38 | EditTwoTone, |
37 | - EllipsisOutlined, | |
38 | 39 | QuestionCircleOutlined, |
39 | 40 | } from '@ant-design/icons'; |
40 | 41 | import { |
41 | 42 | ActionType, |
42 | - PageContainer, | |
43 | 43 | ProColumns, |
44 | 44 | ProFormInstance, |
45 | 45 | ProTable, |
46 | 46 | } from '@ant-design/pro-components'; |
47 | -import { history } from '@umijs/max'; | |
48 | 47 | import { |
49 | - Avatar, | |
50 | - Badge, | |
51 | 48 | Button, |
52 | 49 | Checkbox, |
53 | 50 | Divider, |
... | ... | @@ -79,8 +76,8 @@ import FinancialEditDrawer from './components/FinancialEditDrawer'; |
79 | 76 | import FinancialMergeDrawer from './components/FinancialMergeDrawer'; |
80 | 77 | import FinancialReceiptsModal from './components/FinancialReceiptsModal'; |
81 | 78 | import HistoryModal from './components/HistoryModal'; |
79 | +import ImagesViewerModal from './components/ImagesViewerModal'; | |
82 | 80 | import ImportModal from './components/ImportModal'; |
83 | -import MessageListDrawer from './components/MessageListDrawer'; | |
84 | 81 | import ModifiedDiffModal from './components/ModifiedDiffModal'; |
85 | 82 | import OrderDrawer from './components/OrderDrawer'; |
86 | 83 | import OrderNotesEditModal from './components/OrderNotesEditModal'; |
... | ... | @@ -88,6 +85,7 @@ import ProcureCheckModal from './components/ProcureCheckModal'; |
88 | 85 | import ProcureConvertModal from './components/ProcureConvertModal'; |
89 | 86 | import ProductionTimeModal from './components/ProductionTimeModal'; |
90 | 87 | import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal'; |
88 | +import UploadPayBillModal from './components/UploadPayBillModal'; | |
91 | 89 | import { |
92 | 90 | AFTER_INVOICING_STATUS, |
93 | 91 | CHECK_TYPE, |
... | ... | @@ -109,18 +107,14 @@ import { |
109 | 107 | } from './constant'; |
110 | 108 | import './index.less'; |
111 | 109 | import { OrderListItemType, OrderType } from './type.d'; |
112 | -import UploadPayBillModal from './components/UploadPayBillModal'; | |
113 | -import ImagesViewerModal from './components/ImagesViewerModal'; | |
114 | 110 | |
115 | 111 | const OrderPage = () => { |
116 | 112 | const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); |
117 | 113 | const [checkVisible, setCheckVisible] = useState<boolean>(false); |
118 | 114 | const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false); |
119 | 115 | const [allMainChecked, setAllMainChecked] = useState(false); |
120 | - const [ | |
121 | - imagesViewerModalVisible, | |
122 | - setImagesViewerModalVisible, | |
123 | - ] = useState<boolean>(false); | |
116 | + const [imagesViewerModalVisible, setImagesViewerModalVisible] = | |
117 | + useState<boolean>(false); | |
124 | 118 | const [data, setData] = useState([]); //列表数据 |
125 | 119 | const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false); |
126 | 120 | const [financialMergeDrawerVisible, setFinancialMergeDrawerVisible] = |
... | ... | @@ -154,8 +148,6 @@ const OrderPage = () => { |
154 | 148 | useState<boolean>(false); |
155 | 149 | const [productionTimeModalVisible, setProductionTimeModalVisible] = |
156 | 150 | useState<boolean>(false); |
157 | - const [messageListDrawerVisible, setMessageListDrawerVisible] = | |
158 | - useState<boolean>(false); | |
159 | 151 | const [deliverVisible, setDeliverVisible] = useState<boolean>(false); |
160 | 152 | const [deliverInfoDrawerVisible, setDeliverInfoDrawerVisible] = |
161 | 153 | useState<boolean>(false); |
... | ... | @@ -174,14 +166,13 @@ const OrderPage = () => { |
174 | 166 | const [pageSize, setPageSize] = useState(10); |
175 | 167 | const [currentPage, setCurrentPage] = useState(1); |
176 | 168 | const [orderCheckType, setOrderCheckType] = useState(''); |
177 | - const [imagesViewerOptType,setImagesViewerOptType] = useState(''); | |
169 | + const [imagesViewerOptType, setImagesViewerOptType] = useState(''); | |
178 | 170 | const [filterCondifion, setFilterCondition] = useState(0); |
179 | 171 | const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据 |
180 | 172 | const [subOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合 |
181 | 173 | const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id |
182 | 174 | const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id |
183 | 175 | const [subOrderCount, setSubOrderCount] = useState(0); |
184 | - const [unreadMsgNum, setUnreadMsgNum] = useState(0); | |
185 | 176 | const [sorted, setSorted] = useState(false); |
186 | 177 | const mainTableRef = useRef<ActionType>(); |
187 | 178 | const mainTableFormRef = useRef<ProFormInstance>(); |
... | ... | @@ -280,13 +271,6 @@ const OrderPage = () => { |
280 | 271 | } |
281 | 272 | |
282 | 273 | /** |
283 | - * 打开消息弹窗 | |
284 | - */ | |
285 | - function openMessageDrawer() { | |
286 | - setMessageListDrawerVisible(true); | |
287 | - } | |
288 | - | |
289 | - /** | |
290 | 274 | * 财务是否选中排序 |
291 | 275 | * @param e |
292 | 276 | */ |
... | ... | @@ -764,7 +748,7 @@ const OrderPage = () => { |
764 | 748 | onConfirm={() => { |
765 | 749 | window.open( |
766 | 750 | '/previewApi/onlinePreview?url=' + |
767 | - encodeURIComponent(Base64.encode(item.url)), | |
751 | + encodeURIComponent(Base64.encode(item.url)), | |
768 | 752 | ); |
769 | 753 | }} |
770 | 754 | onCancel={() => { |
... | ... | @@ -836,7 +820,7 @@ const OrderPage = () => { |
836 | 820 | </span> |
837 | 821 | {(roleCode === 'salesRepresentative' || |
838 | 822 | roleCode === 'salesManager') && |
839 | - !optRecord.isCurrentUserOrder ? ( | |
823 | + !optRecord.isCurrentUserOrder ? ( | |
840 | 824 | <span className="text-[#f44e4e]">(非本账号订单)</span> |
841 | 825 | ) : ( |
842 | 826 | '' |
... | ... | @@ -918,7 +902,7 @@ const OrderPage = () => { |
918 | 902 | {(roleCode === 'procure' || |
919 | 903 | roleCode === 'warehouseKeeper' || |
920 | 904 | roleCode === 'admin') && |
921 | - !isSupplier() ? ( | |
905 | + !isSupplier() ? ( | |
922 | 906 | <> |
923 | 907 | <Flex title={optRecord.supplierName}> |
924 | 908 | <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
... | ... | @@ -1055,20 +1039,29 @@ const OrderPage = () => { |
1055 | 1039 | {/* 回款审核状态 */} |
1056 | 1040 | {optRecord.paymentReceiptStatus !== null ? ( |
1057 | 1041 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1058 | - <Tag className='hover:cursor-pointer' | |
1042 | + <Tag | |
1043 | + className="hover:cursor-pointer" | |
1059 | 1044 | onMouseEnter={(e: any) => { |
1060 | - e.target.innerText = "点击查看回款凭证" | |
1045 | + e.target.innerText = '点击查看回款凭证'; | |
1061 | 1046 | }} |
1062 | 1047 | onMouseLeave={(e: any) => { |
1063 | - e.target.innerText = enumValueToLabel(optRecord.paymentReceiptStatus, PAYMENT_RECEIPTS_STATUS_OPTIONS); | |
1048 | + e.target.innerText = enumValueToLabel( | |
1049 | + optRecord.paymentReceiptStatus, | |
1050 | + PAYMENT_RECEIPTS_STATUS_OPTIONS, | |
1051 | + ); | |
1064 | 1052 | }} |
1065 | - onClick={()=>{ | |
1066 | - createOptObject(optRecord.id,record.id); | |
1067 | - setImagesViewerOptType("paymentReceipt"); | |
1053 | + onClick={() => { | |
1054 | + createOptObject(optRecord.id, record.id); | |
1055 | + setImagesViewerOptType('paymentReceipt'); | |
1068 | 1056 | setImagesViewerModalVisible(true); |
1069 | 1057 | }} |
1070 | - key="key" color={TAGS_COLOR.get(optRecord.paymentReceiptStatus)}> | |
1071 | - {enumValueToLabel(optRecord.paymentReceiptStatus, PAYMENT_RECEIPTS_STATUS_OPTIONS)} | |
1058 | + key="key" | |
1059 | + color={TAGS_COLOR.get(optRecord.paymentReceiptStatus)} | |
1060 | + > | |
1061 | + {enumValueToLabel( | |
1062 | + optRecord.paymentReceiptStatus, | |
1063 | + PAYMENT_RECEIPTS_STATUS_OPTIONS, | |
1064 | + )} | |
1072 | 1065 | </Tag> |
1073 | 1066 | </div> |
1074 | 1067 | ) : ( |
... | ... | @@ -1110,21 +1103,23 @@ const OrderPage = () => { |
1110 | 1103 | )} |
1111 | 1104 | |
1112 | 1105 | {/* 开票状态 */} |
1113 | - {optRecord.afterInvoicingStatus !== null ? | |
1106 | + {optRecord.afterInvoicingStatus !== null ? ( | |
1114 | 1107 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1115 | 1108 | <Tooltip |
1116 | 1109 | title={ |
1117 | 1110 | optRecord.invoicingUrgentCause !== null && |
1118 | - optRecord.afterInvoicingStatus === | |
1111 | + optRecord.afterInvoicingStatus === | |
1119 | 1112 | 'URGENT_INVOICE_AUDITING' |
1120 | 1113 | ? optRecord.invoicingUrgentCause |
1121 | 1114 | : enumValueToLabel( |
1122 | - optRecord.afterInvoicingStatus, | |
1123 | - AFTER_INVOICING_STATUS, | |
1124 | - ) | |
1115 | + optRecord.afterInvoicingStatus, | |
1116 | + AFTER_INVOICING_STATUS, | |
1117 | + ) | |
1125 | 1118 | } |
1126 | 1119 | > |
1127 | - <Tag color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)}> | |
1120 | + <Tag | |
1121 | + color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)} | |
1122 | + > | |
1128 | 1123 | {enumValueToLabel( |
1129 | 1124 | optRecord.afterInvoicingStatus, |
1130 | 1125 | AFTER_INVOICING_STATUS, |
... | ... | @@ -1132,8 +1127,9 @@ const OrderPage = () => { |
1132 | 1127 | </Tag> |
1133 | 1128 | </Tooltip> |
1134 | 1129 | </div> |
1135 | - : "" | |
1136 | - } | |
1130 | + ) : ( | |
1131 | + '' | |
1132 | + )} | |
1137 | 1133 | |
1138 | 1134 | {/* 是否加急图标显示 */} |
1139 | 1135 | {optRecord.isUrgent ? ( |
... | ... | @@ -1149,7 +1145,7 @@ const OrderPage = () => { |
1149 | 1145 | )} |
1150 | 1146 | |
1151 | 1147 | {(roleCode === 'warehouseKeeper' || roleCode === 'admin') && |
1152 | - optRecord.shippingWarehouse !== null ? ( | |
1148 | + optRecord.shippingWarehouse !== null ? ( | |
1153 | 1149 | <div |
1154 | 1150 | className="overflow-hidden whitespace-no-wrap overflow-ellipsis" |
1155 | 1151 | title={enumValueToLabel( |
... | ... | @@ -1171,7 +1167,7 @@ const OrderPage = () => { |
1171 | 1167 | {/* 生产时间 */} |
1172 | 1168 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1173 | 1169 | {optRecord.productionStartTime !== null || |
1174 | - optRecord.productionEndTime !== null ? ( | |
1170 | + optRecord.productionEndTime !== null ? ( | |
1175 | 1171 | <MyToolTip |
1176 | 1172 | title={ |
1177 | 1173 | formatdate(optRecord.productionStartTime) + |
... | ... | @@ -1201,7 +1197,7 @@ const OrderPage = () => { |
1201 | 1197 | <Tag |
1202 | 1198 | color={ |
1203 | 1199 | optRecord.invoicingTime === null || |
1204 | - optRecord.invoicingTime === undefined | |
1200 | + optRecord.invoicingTime === undefined | |
1205 | 1201 | ? TAGS_COLOR.get(optRecord.invoicingStatus) |
1206 | 1202 | : 'success' |
1207 | 1203 | } |
... | ... | @@ -1229,7 +1225,7 @@ const OrderPage = () => { |
1229 | 1225 | |
1230 | 1226 | {/**采购是否已下单状态 */} |
1231 | 1227 | {optRecord.procureOrderStatus !== null && |
1232 | - optRecord.procureOrderStatus !== undefined ? ( | |
1228 | + optRecord.procureOrderStatus !== undefined ? ( | |
1233 | 1229 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1234 | 1230 | <Tag color="success"> |
1235 | 1231 | {enumValueToLabel( |
... | ... | @@ -1245,21 +1241,21 @@ const OrderPage = () => { |
1245 | 1241 | {/* 物流信息 */} |
1246 | 1242 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1247 | 1243 | {optRecord.orderStatus === 'CONFIRM_RECEIPT' || |
1248 | - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' || | |
1249 | - optRecord.orderStatus === 'IN_AFTER_SALES' || | |
1250 | - optRecord.orderStatus === 'SHIPPED' ? ( | |
1244 | + optRecord.orderStatus === 'AFTER_SALES_COMPLETION' || | |
1245 | + optRecord.orderStatus === 'IN_AFTER_SALES' || | |
1246 | + optRecord.orderStatus === 'SHIPPED' ? ( | |
1251 | 1247 | <MyToolTip |
1252 | 1248 | title={ |
1253 | 1249 | optRecord.serialNumber === undefined |
1254 | 1250 | ? '暂无物流信息' |
1255 | 1251 | : enumValueToLabel( |
1256 | - optRecord.logisticsMethod, | |
1257 | - LOGISTICS_STATUS_OPTIONS, | |
1258 | - ) + | |
1259 | - ' ' + | |
1260 | - optRecord.serialNumber + | |
1261 | - ' ' + | |
1262 | - optRecord.logisticsNotes | |
1252 | + optRecord.logisticsMethod, | |
1253 | + LOGISTICS_STATUS_OPTIONS, | |
1254 | + ) + | |
1255 | + ' ' + | |
1256 | + optRecord.serialNumber + | |
1257 | + ' ' + | |
1258 | + optRecord.logisticsNotes | |
1263 | 1259 | } |
1264 | 1260 | content={ |
1265 | 1261 | <Button type="link" size="small" style={{ padding: 0 }}> |
... | ... | @@ -1273,7 +1269,7 @@ const OrderPage = () => { |
1273 | 1269 | |
1274 | 1270 | {/* 修改审核状态 */} |
1275 | 1271 | {optRecord.modifiedAuditStatus !== null && |
1276 | - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? ( | |
1272 | + optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? ( | |
1277 | 1273 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1278 | 1274 | <Tooltip |
1279 | 1275 | title={enumValueToLabel( |
... | ... | @@ -1318,7 +1314,6 @@ const OrderPage = () => { |
1318 | 1314 | </div> |
1319 | 1315 | </Flex> |
1320 | 1316 | <Flex className="w-[18%]" wrap="wrap" gap="small"> |
1321 | - | |
1322 | 1317 | {optRecord.subPath?.includes('uploadPaymentReceiptBill') ? ( |
1323 | 1318 | <Button |
1324 | 1319 | className="p-0" |
... | ... | @@ -1334,7 +1329,6 @@ const OrderPage = () => { |
1334 | 1329 | '' |
1335 | 1330 | )} |
1336 | 1331 | |
1337 | - | |
1338 | 1332 | {optRecord.subPath?.includes('leaderAudit') ? ( |
1339 | 1333 | <Button |
1340 | 1334 | className="p-0" |
... | ... | @@ -1572,7 +1566,7 @@ const OrderPage = () => { |
1572 | 1566 | )} |
1573 | 1567 | |
1574 | 1568 | {optRecord.subPath?.includes('queryAnnex') && |
1575 | - optRecord.listAnnex?.length > 0 ? ( | |
1569 | + optRecord.listAnnex?.length > 0 ? ( | |
1576 | 1570 | <Button |
1577 | 1571 | className="p-0" |
1578 | 1572 | type="link" |
... | ... | @@ -1914,7 +1908,7 @@ const OrderPage = () => { |
1914 | 1908 | type="link" |
1915 | 1909 | onClick={() => { |
1916 | 1910 | createOptObject(optRecord.id, record.id); |
1917 | - setImagesViewerOptType("shippingReceipt"); | |
1911 | + setImagesViewerOptType('shippingReceipt'); | |
1918 | 1912 | setImagesViewerModalVisible(true); |
1919 | 1913 | }} |
1920 | 1914 | > |
... | ... | @@ -1947,9 +1941,9 @@ const OrderPage = () => { |
1947 | 1941 | </Flex> |
1948 | 1942 | |
1949 | 1943 | {roleCode === 'admin' || |
1950 | - roleCode === 'salesManager' || | |
1951 | - roleCode === 'salesRepresentative' || | |
1952 | - roleCode === 'finance' ? ( | |
1944 | + roleCode === 'salesManager' || | |
1945 | + roleCode === 'salesRepresentative' || | |
1946 | + roleCode === 'finance' ? ( | |
1953 | 1947 | <Flex title={optRecord.notes}> |
1954 | 1948 | <div className="flex items-center"> |
1955 | 1949 | <div className="flex items-center max-w-[500px]"> |
... | ... | @@ -1961,7 +1955,7 @@ const OrderPage = () => { |
1961 | 1955 | <span className="text-[#8C8C8C]"> |
1962 | 1956 | 申请开票备注: |
1963 | 1957 | {optRecord.applyInvoicingNotes === undefined || |
1964 | - optRecord.applyInvoicingNotes === null | |
1958 | + optRecord.applyInvoicingNotes === null | |
1965 | 1959 | ? '暂无备注' |
1966 | 1960 | : optRecord.applyInvoicingNotes} |
1967 | 1961 | </span> |
... | ... | @@ -1989,7 +1983,7 @@ const OrderPage = () => { |
1989 | 1983 | <span className="text-[#8C8C8C] mr-3"> |
1990 | 1984 | 财务审核备注: |
1991 | 1985 | {optRecord.checkNotes === undefined || |
1992 | - optRecord.checkNotes === null | |
1986 | + optRecord.checkNotes === null | |
1993 | 1987 | ? '暂无备注' |
1994 | 1988 | : optRecord.checkNotes} |
1995 | 1989 | </span> |
... | ... | @@ -2282,9 +2276,9 @@ const OrderPage = () => { |
2282 | 2276 | <span className="text-slate-700"> |
2283 | 2277 | {record.receivingCompany !== null |
2284 | 2278 | ? enumValueToLabel( |
2285 | - record.receivingCompany, | |
2286 | - getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2287 | - ) | |
2279 | + record.receivingCompany, | |
2280 | + getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2281 | + ) | |
2288 | 2282 | : '暂无'} |
2289 | 2283 | </span> |
2290 | 2284 | </div> |
... | ... | @@ -2325,44 +2319,43 @@ const OrderPage = () => { |
2325 | 2319 | '' |
2326 | 2320 | )} |
2327 | 2321 | |
2328 | - { | |
2329 | - record.goodsWeight !== null ? | |
2330 | - <div title={record.goodsWeight + "kg"} className='pl-3'> | |
2331 | - <div | |
2332 | - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer" | |
2333 | - onClick={() => { | |
2334 | - copyToClipboard(record.goodsWeight + "kg"); | |
2335 | - message.info('包裹重量复制成功:' + record.goodsWeight + "kg"); | |
2336 | - }} | |
2337 | - > | |
2338 | - <span className="text-[#8C8C8C]">包裹重量:</span> | |
2339 | - <span className="ml-2"> | |
2340 | - {record.goodsWeight + "kg"} | |
2341 | - </span> | |
2342 | - </div> | |
2322 | + {record.goodsWeight !== null ? ( | |
2323 | + <div title={record.goodsWeight + 'kg'} className="pl-3"> | |
2324 | + <div | |
2325 | + className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer" | |
2326 | + onClick={() => { | |
2327 | + copyToClipboard(record.goodsWeight + 'kg'); | |
2328 | + message.info( | |
2329 | + '包裹重量复制成功:' + record.goodsWeight + 'kg', | |
2330 | + ); | |
2331 | + }} | |
2332 | + > | |
2333 | + <span className="text-[#8C8C8C]">包裹重量:</span> | |
2334 | + <span className="ml-2">{record.goodsWeight + 'kg'}</span> | |
2343 | 2335 | </div> |
2344 | - : "" | |
2345 | - } | |
2336 | + </div> | |
2337 | + ) : ( | |
2338 | + '' | |
2339 | + )} | |
2346 | 2340 | |
2347 | - { | |
2348 | - record.goodsVolume !== null ? | |
2349 | - <div title={record.goodsVolume + "m³"} className='pl-3'> | |
2350 | - <div | |
2351 | - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer" | |
2352 | - onClick={() => { | |
2353 | - copyToClipboard(record.goodsVolume + "m³"); | |
2354 | - message.info('包裹体积复制成功:' + record.goodsVolume + "m³"); | |
2355 | - }} | |
2356 | - > | |
2357 | - <span className="text-[#8C8C8C]">包裹体积:</span> | |
2358 | - <span className="ml-2"> | |
2359 | - {record.goodsVolume + "m³"} | |
2360 | - </span> | |
2361 | - </div> | |
2341 | + {record.goodsVolume !== null ? ( | |
2342 | + <div title={record.goodsVolume + 'm³'} className="pl-3"> | |
2343 | + <div | |
2344 | + className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer" | |
2345 | + onClick={() => { | |
2346 | + copyToClipboard(record.goodsVolume + 'm³'); | |
2347 | + message.info( | |
2348 | + '包裹体积复制成功:' + record.goodsVolume + 'm³', | |
2349 | + ); | |
2350 | + }} | |
2351 | + > | |
2352 | + <span className="text-[#8C8C8C]">包裹体积:</span> | |
2353 | + <span className="ml-2">{record.goodsVolume + 'm³'}</span> | |
2362 | 2354 | </div> |
2363 | - : "" | |
2364 | - } | |
2365 | - | |
2355 | + </div> | |
2356 | + ) : ( | |
2357 | + '' | |
2358 | + )} | |
2366 | 2359 | </Flex> |
2367 | 2360 | </Flex> |
2368 | 2361 | <Flex wrap="wrap" gap="middle" vertical> |
... | ... | @@ -2930,9 +2923,9 @@ const OrderPage = () => { |
2930 | 2923 | for (let i = 0; i < selectedSubOrders.length; i++) { |
2931 | 2924 | if ( |
2932 | 2925 | selectedSubOrders[i].invoicingStatus === |
2933 | - 'UN_INVOICE' || | |
2926 | + 'UN_INVOICE' || | |
2934 | 2927 | selectedSubOrders[i].afterInvoicingStatus === |
2935 | - 'APPLY_FOR_INVOICING' | |
2928 | + 'APPLY_FOR_INVOICING' | |
2936 | 2929 | ) { |
2937 | 2930 | message.error( |
2938 | 2931 | '请选择需要开票且未申请开票的子订单进行申请', |
... | ... | @@ -3121,13 +3114,13 @@ const OrderPage = () => { |
3121 | 3114 | if ( |
3122 | 3115 | selectedSubOrders[i].orderStatus !== 'AUDITED' && |
3123 | 3116 | selectedSubOrders[i].orderStatus !== |
3124 | - 'PROCURE_PROCESS' && | |
3117 | + 'PROCURE_PROCESS' && | |
3125 | 3118 | selectedSubOrders[i].orderStatus !== |
3126 | - 'PROCURE_PROCESS_FOR_MINE' && | |
3119 | + 'PROCURE_PROCESS_FOR_MINE' && | |
3127 | 3120 | selectedSubOrders[i].orderStatus !== |
3128 | - 'PROCURE_WAIT_SHIP' && | |
3121 | + 'PROCURE_WAIT_SHIP' && | |
3129 | 3122 | selectedSubOrders[i].orderStatus !== |
3130 | - 'SUPPLIER_WAIT_SHIP' && | |
3123 | + 'SUPPLIER_WAIT_SHIP' && | |
3131 | 3124 | selectedSubOrders[i].orderStatus !== 'WAIT_SHIP' |
3132 | 3125 | ) { |
3133 | 3126 | message.error( |
... | ... | @@ -3214,9 +3207,9 @@ const OrderPage = () => { |
3214 | 3207 | if ( |
3215 | 3208 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && |
3216 | 3209 | selectedSubOrders[i].orderStatus !== |
3217 | - 'FINANCE_PROCESS' && | |
3210 | + 'FINANCE_PROCESS' && | |
3218 | 3211 | selectedSubOrders[i].orderStatus !== |
3219 | - 'LEADER_AUDITED' | |
3212 | + 'LEADER_AUDITED' | |
3220 | 3213 | ) { |
3221 | 3214 | message.error( |
3222 | 3215 | '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核', |
... | ... | @@ -3284,9 +3277,9 @@ const OrderPage = () => { |
3284 | 3277 | for (let i = 0; i < selectedSubOrders.length; i++) { |
3285 | 3278 | if ( |
3286 | 3279 | selectedSubOrders[i].orderStatus !== |
3287 | - 'CONFIRM_RECEIPT' && | |
3280 | + 'CONFIRM_RECEIPT' && | |
3288 | 3281 | selectedSubOrders[i].orderStatus !== |
3289 | - 'AFTER_SALES_FAILURE' | |
3282 | + 'AFTER_SALES_FAILURE' | |
3290 | 3283 | ) { |
3291 | 3284 | message.error('请选择确认收货状态的子订单进行售后'); |
3292 | 3285 | return; |
... | ... | @@ -3490,12 +3483,24 @@ const OrderPage = () => { |
3490 | 3483 | (item) => { |
3491 | 3484 | //首能账号只能搜索订单编号 |
3492 | 3485 | let canSearchIndex = ['id', 'salesCode', 'subNotes', 'orderStatus']; |
3493 | - if ( | |
3494 | - isSupplier() && | |
3495 | - !canSearchIndex.includes(item.dataIndex) | |
3496 | - ) { | |
3486 | + if (isSupplier() && !canSearchIndex.includes(item.dataIndex)) { | |
3487 | + item.search = false; | |
3488 | + } | |
3489 | + | |
3490 | + canSearchIndex = [ | |
3491 | + 'id', | |
3492 | + 'salesCode', | |
3493 | + 'customerName', | |
3494 | + 'institution', | |
3495 | + 'productName', | |
3496 | + 'orderStatus', | |
3497 | + 'createTime', | |
3498 | + ]; | |
3499 | + | |
3500 | + if (isExaminer() && !canSearchIndex.includes(item.dataIndex)) { | |
3497 | 3501 | item.search = false; |
3498 | 3502 | } |
3503 | + | |
3499 | 3504 | if (item.dataIndex === 'name') { |
3500 | 3505 | return { |
3501 | 3506 | ...item, |
... | ... | @@ -3521,10 +3526,7 @@ const OrderPage = () => { |
3521 | 3526 | /** |
3522 | 3527 | * 采购可以筛选供应商备注 |
3523 | 3528 | */ |
3524 | - if ( | |
3525 | - (roleCode === 'procure' || roleCode === 'admin') && | |
3526 | - !isSupplier() | |
3527 | - ) { | |
3529 | + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) { | |
3528 | 3530 | mainOrdersColumns.push({ |
3529 | 3531 | title: '供应商备注', |
3530 | 3532 | width: 120, |
... | ... | @@ -3537,10 +3539,7 @@ const OrderPage = () => { |
3537 | 3539 | /** |
3538 | 3540 | * 采购可以筛选其他采购 |
3539 | 3541 | */ |
3540 | - if ( | |
3541 | - (roleCode === 'procure' || roleCode === 'admin') && | |
3542 | - !isSupplier() | |
3543 | - ) { | |
3542 | + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) { | |
3544 | 3543 | mainOrdersColumns.push({ |
3545 | 3544 | title: '采购名称', |
3546 | 3545 | width: 120, |
... | ... | @@ -3687,7 +3686,7 @@ const OrderPage = () => { |
3687 | 3686 | |
3688 | 3687 | const exportMenuProps = { |
3689 | 3688 | items: exportItems, |
3690 | - onClick: () => { }, | |
3689 | + onClick: () => {}, | |
3691 | 3690 | }; |
3692 | 3691 | |
3693 | 3692 | //导出按钮配置 |
... | ... | @@ -3723,7 +3722,7 @@ const OrderPage = () => { |
3723 | 3722 | |
3724 | 3723 | const auditProps = { |
3725 | 3724 | items: auditItems, |
3726 | - onClick: () => { }, | |
3725 | + onClick: () => {}, | |
3727 | 3726 | }; |
3728 | 3727 | |
3729 | 3728 | if (rolePath?.includes('leaderMergeAudit')) { |
... | ... | @@ -3831,8 +3830,8 @@ const OrderPage = () => { |
3831 | 3830 | if (errorIds.size > 0) { |
3832 | 3831 | message.error( |
3833 | 3832 | '订单号为:' + |
3834 | - [...errorIds.values()].join(',') + | |
3835 | - '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!', | |
3833 | + [...errorIds.values()].join(',') + | |
3834 | + '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!', | |
3836 | 3835 | ); |
3837 | 3836 | return; |
3838 | 3837 | } |
... | ... | @@ -3891,16 +3890,6 @@ const OrderPage = () => { |
3891 | 3890 | return toolBtns; |
3892 | 3891 | } |
3893 | 3892 | |
3894 | - /** | |
3895 | - * 获取当前用户未读消息条数 | |
3896 | - */ | |
3897 | - async function getUnreadMessageNum() { | |
3898 | - let res = await postOrderErpMessageGetUnreadNum(); | |
3899 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3900 | - setUnreadMsgNum(res.data); | |
3901 | - } | |
3902 | - } | |
3903 | - | |
3904 | 3893 | useEffect(() => { |
3905 | 3894 | // 使用URLSearchParams来解析查询参数 |
3906 | 3895 | const params = new URLSearchParams(location.search); |
... | ... | @@ -3908,62 +3897,10 @@ const OrderPage = () => { |
3908 | 3897 | if (id) { |
3909 | 3898 | mainTableFormRef.current?.setFieldValue('id', id); |
3910 | 3899 | } |
3911 | - | |
3912 | - //未读消息条数 | |
3913 | - getUnreadMessageNum(); | |
3914 | 3900 | }, []); |
3915 | 3901 | |
3916 | 3902 | return ( |
3917 | - <PageContainer | |
3918 | - className="order-page-container" | |
3919 | - header={{ | |
3920 | - title: '订单管理', | |
3921 | - extra: [ | |
3922 | - <Badge | |
3923 | - key="message" | |
3924 | - count={unreadMsgNum} | |
3925 | - className="hover:cursor-pointer" | |
3926 | - > | |
3927 | - <BellOutlined | |
3928 | - style={{ fontSize: '24px' }} | |
3929 | - onClick={openMessageDrawer} | |
3930 | - /> | |
3931 | - </Badge>, | |
3932 | - <Avatar | |
3933 | - key="0" | |
3934 | - style={{ verticalAlign: 'middle', marginLeft: '10px' }} | |
3935 | - size="large" | |
3936 | - > | |
3937 | - {userInfo?.username} | |
3938 | - </Avatar>, | |
3939 | - <Tag key="nickName">{userInfo?.nickName}</Tag>, | |
3940 | - <Dropdown | |
3941 | - key="dropdown" | |
3942 | - trigger={['click']} | |
3943 | - menu={{ | |
3944 | - items: [ | |
3945 | - { | |
3946 | - label: '退出登录', | |
3947 | - key: '1', | |
3948 | - onClick: () => { | |
3949 | - localStorage.removeItem('token'); | |
3950 | - history.push('/login'); | |
3951 | - }, | |
3952 | - }, | |
3953 | - // { | |
3954 | - // label: '修改密码', | |
3955 | - // key: '2', | |
3956 | - // }, | |
3957 | - ], | |
3958 | - }} | |
3959 | - > | |
3960 | - <Button key="4" style={{ padding: '0 8px' }}> | |
3961 | - <EllipsisOutlined /> | |
3962 | - </Button> | |
3963 | - </Dropdown>, | |
3964 | - ], | |
3965 | - }} | |
3966 | - > | |
3903 | + <div className="order-page-container"> | |
3967 | 3904 | <div id="resizeDiv"></div> |
3968 | 3905 | <ProTable |
3969 | 3906 | id="main-table" |
... | ... | @@ -4271,7 +4208,7 @@ const OrderPage = () => { |
4271 | 4208 | |
4272 | 4209 | {imagesViewerModalVisible && ( |
4273 | 4210 | <ImagesViewerModal |
4274 | - optType={imagesViewerOptType} | |
4211 | + optType={imagesViewerOptType} | |
4275 | 4212 | setVisible={(val: boolean) => { |
4276 | 4213 | setImagesViewerModalVisible(val); |
4277 | 4214 | if (!val) { |
... | ... | @@ -4504,16 +4441,8 @@ const OrderPage = () => { |
4504 | 4441 | /> |
4505 | 4442 | )} |
4506 | 4443 | |
4507 | - {messageListDrawerVisible && ( | |
4508 | - <MessageListDrawer | |
4509 | - setVisible={(val: any) => { | |
4510 | - setMessageListDrawerVisible(val); | |
4511 | - getUnreadMessageNum(); | |
4512 | - }} | |
4513 | - /> | |
4514 | - )} | |
4515 | 4444 | {contextHolder} |
4516 | - </PageContainer> | |
4445 | + </div> | |
4517 | 4446 | ); |
4518 | 4447 | }; |
4519 | 4448 | ... | ... |
src/pages/OrderReport/index.tsx
... | ... | @@ -3,33 +3,19 @@ import { |
3 | 3 | postServiceOrderQuerySalesCode, |
4 | 4 | } from '@/services'; |
5 | 5 | import { enumToSelect } from '@/utils'; |
6 | -import { getUserInfo } from '@/utils/user'; | |
7 | -import { EllipsisOutlined } from '@ant-design/icons'; | |
8 | 6 | import { |
9 | - PageContainer, | |
10 | 7 | ProCard, |
11 | 8 | ProFormCheckbox, |
12 | 9 | ProFormDigit, |
13 | 10 | ProFormSelect, |
14 | 11 | QueryFilter, |
15 | 12 | } from '@ant-design/pro-components'; |
16 | -import { | |
17 | - Avatar, | |
18 | - Button, | |
19 | - Dropdown, | |
20 | - Form, | |
21 | - Segmented, | |
22 | - Space, | |
23 | - Spin, | |
24 | - Tag, | |
25 | -} from 'antd'; | |
13 | +import { Form, Segmented, Space, Spin } from 'antd'; | |
26 | 14 | import { useEffect, useState } from 'react'; |
27 | 15 | import { PRODUCT_BELONG_DEPARTMENT_OPTIONS } from '../Order/constant'; |
28 | 16 | import OrderDualAxes from './components/OrderDualAxes'; |
29 | 17 | import OrderStatisticCard from './components/OrderStatisticCard'; |
30 | 18 | import './index.less'; |
31 | -const userInfo = getUserInfo(); | |
32 | - | |
33 | 19 | const OrderReportPage = () => { |
34 | 20 | const [salesCodeOptions, setSalesCodeOptions] = useState([]); |
35 | 21 | |
... | ... | @@ -124,41 +110,7 @@ const OrderReportPage = () => { |
124 | 110 | // }, |
125 | 111 | // ]; |
126 | 112 | return ( |
127 | - <PageContainer | |
128 | - header={{ | |
129 | - title: '订单汇总', | |
130 | - extra: [ | |
131 | - <Avatar key="0" style={{ verticalAlign: 'middle' }} size="large"> | |
132 | - {userInfo?.username} | |
133 | - </Avatar>, | |
134 | - <Tag key="nickName">{userInfo?.nickName}</Tag>, | |
135 | - <Dropdown | |
136 | - key="dropdown" | |
137 | - trigger={['click']} | |
138 | - menu={{ | |
139 | - items: [ | |
140 | - { | |
141 | - label: '退出登录', | |
142 | - key: '1', | |
143 | - onClick: () => { | |
144 | - localStorage.removeItem('token'); | |
145 | - history.push('/login'); | |
146 | - }, | |
147 | - }, | |
148 | - // { | |
149 | - // label: '修改密码', | |
150 | - // key: '2', | |
151 | - // }, | |
152 | - ], | |
153 | - }} | |
154 | - > | |
155 | - <Button key="4" style={{ padding: '0 8px' }}> | |
156 | - <EllipsisOutlined /> | |
157 | - </Button> | |
158 | - </Dropdown>, | |
159 | - ], | |
160 | - }} | |
161 | - > | |
113 | + <div> | |
162 | 114 | <Space direction="vertical" size="middle" className="flex"> |
163 | 115 | <Spin spinning={loading}> |
164 | 116 | <OrderStatisticCard |
... | ... | @@ -235,7 +187,7 @@ const OrderReportPage = () => { |
235 | 187 | </Spin> |
236 | 188 | </ProCard> |
237 | 189 | </Space> |
238 | - </PageContainer> | |
190 | + </div> | |
239 | 191 | ); |
240 | 192 | }; |
241 | 193 | ... | ... |
src/utils/order.ts
... | ... | @@ -6,10 +6,18 @@ export function getReceivingCompanyOptions(PAYEE_OPTIONS: any) { |
6 | 6 | return payeeOptions; |
7 | 7 | } |
8 | 8 | |
9 | -export function isSupplier(){ | |
9 | +export function isSupplier() { | |
10 | 10 | let userInfo = getUserInfo(); |
11 | - if(userInfo){ | |
12 | - return ['首能','枭源'].includes(userInfo.username); | |
11 | + if (userInfo) { | |
12 | + return ['首能', '枭源'].includes(userInfo.username); | |
13 | + } | |
14 | + return false; | |
15 | +} | |
16 | + | |
17 | +export function isExaminer() { | |
18 | + let userInfo = getUserInfo(); | |
19 | + if (userInfo) { | |
20 | + return userInfo.roleSmallVO?.code === 'examiner'; | |
13 | 21 | } |
14 | 22 | return false; |
15 | 23 | } | ... | ... |