Commit 4f196bc51f599867cfa30b3c76f059950bfd9747

Authored by zhongnanhuang
1 parent 96450634

feat: update 页面header调整,将用户和消息信息放到header中

.umirc.ts
@@ -49,7 +49,7 @@ export default defineConfig({ @@ -49,7 +49,7 @@ export default defineConfig({
49 path: '/orderReport', 49 path: '/orderReport',
50 component: './OrderReport', 50 component: './OrderReport',
51 icon: 'LineChartOutlined', 51 icon: 'LineChartOutlined',
52 - access: 'canReadAdmin', 52 + access: 'canReadAdminAndFinance',
53 }, 53 },
54 { 54 {
55 name: '发票管理', 55 name: '发票管理',
src/app.ts
@@ -6,6 +6,8 @@ import '@inspir/assembly-css/dist/special.css'; @@ -6,6 +6,8 @@ import '@inspir/assembly-css/dist/special.css';
6 import { message } from 'antd'; 6 import { message } from 'antd';
7 import { RESPONSE_CODE } from './constants/enum'; 7 import { RESPONSE_CODE } from './constants/enum';
8 8
  9 +import { RunTimeLayoutConfig } from '@umijs/max';
  10 +import GlobleHeader from './components/UserHeader';
9 import './style/global.css'; 11 import './style/global.css';
10 import { getUserInfo } from './utils'; 12 import { getUserInfo } from './utils';
11 13
@@ -15,19 +17,29 @@ export async function getInitialState() { @@ -15,19 +17,29 @@ export async function getInitialState() {
15 return getUserInfo(); 17 return getUserInfo();
16 } 18 }
17 19
18 -export const layout = () => { 20 +export const layout: RunTimeLayoutConfig = () => {
19 return { 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 export const request: RequestConfig = { 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 +15,9 @@ import {
15 } from '@/services'; 15 } from '@/services';
16 import { enumValueToLabel, formatDateTime } from '@/utils'; 16 import { enumValueToLabel, formatDateTime } from '@/utils';
17 import { formatDate } from '@/utils/time'; 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 import { useRef, useState } from 'react'; 21 import { useRef, useState } from 'react';
28 import { INVOCING_STATUS, PAYEE_OPTIONS } from '../Order/constant'; 22 import { INVOCING_STATUS, PAYEE_OPTIONS } from '../Order/constant';
29 import BankImportModal from './components/BankImportModal'; 23 import BankImportModal from './components/BankImportModal';
@@ -37,8 +31,6 @@ const InvoicePage = () =&gt; { @@ -37,8 +31,6 @@ const InvoicePage = () =&gt; {
37 useState(false); 31 useState(false);
38 const [invoiceId, setInvoiceId] = useState(undefined); 32 const [invoiceId, setInvoiceId] = useState(undefined);
39 33
40 - const userInfo = getUserInfo();  
41 -  
42 const reloadInvoiceTable = () => { 34 const reloadInvoiceTable = () => {
43 invoiceActionRef.current?.reload(); 35 invoiceActionRef.current?.reload();
44 }; 36 };
@@ -420,55 +412,18 @@ const InvoicePage = () =&gt; { @@ -420,55 +412,18 @@ const InvoicePage = () =&gt; {
420 }, 412 },
421 ]; 413 ];
422 return ( 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 {bankImportModalVisible ? ( 428 {bankImportModalVisible ? (
474 <BankImportModal 429 <BankImportModal
@@ -495,7 +450,7 @@ const InvoicePage = () =&gt; { @@ -495,7 +450,7 @@ const InvoicePage = () =&gt; {
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 &#39;@/services&#39;; @@ -3,7 +3,6 @@ import { postServiceOrderApplyInvoicing } from &#39;@/services&#39;;
3 import { enumToSelect, getAliYunOSSFileNameFromUrl } from '@/utils'; 3 import { enumToSelect, getAliYunOSSFileNameFromUrl } from '@/utils';
4 import { 4 import {
5 ModalForm, 5 ModalForm,
6 - ProFormDatePicker,  
7 ProFormSelect, 6 ProFormSelect,
8 ProFormTextArea, 7 ProFormTextArea,
9 ProFormUploadDragger, 8 ProFormUploadDragger,
@@ -172,13 +171,13 @@ export default ({ @@ -172,13 +171,13 @@ export default ({
172 }} 171 }}
173 /> 172 />
174 173
175 - <ProFormDatePicker 174 + {/* <ProFormDatePicker
176 key="deadline" 175 key="deadline"
177 label="期望开票时间" 176 label="期望开票时间"
178 name="deadline" 177 name="deadline"
179 rules={[{ required: isUrgent === 'true', message: '期望开票时间必填' }]} 178 rules={[{ required: isUrgent === 'true', message: '期望开票时间必填' }]}
180 hidden={isUrgent !== 'true'} 179 hidden={isUrgent !== 'true'}
181 - /> 180 + /> */}
182 181
183 <ProFormTextArea 182 <ProFormTextArea
184 key="invoicingUrgentCause" 183 key="invoicingUrgentCause"
src/pages/Order/constant.ts
1 import { postServiceOrderQueryCustomerInformation } from '@/services'; 1 import { postServiceOrderQueryCustomerInformation } from '@/services';
2 -import { enumToProTableEnumValue, getUserInfo } from '@/utils'; 2 +import { enumToProTableEnumValue } from '@/utils';
3 import { getReceivingCompanyOptions, isSupplier } from '@/utils/order'; 3 import { getReceivingCompanyOptions, isSupplier } from '@/utils/order';
4 export const COMFIR_RECEIPT_IMAGES_NUMBER = 3; 4 export const COMFIR_RECEIPT_IMAGES_NUMBER = 3;
5 5
@@ -7,6 +7,7 @@ export const PAYMENT_CHANNEL_OPTIONS = { @@ -7,6 +7,7 @@ export const PAYMENT_CHANNEL_OPTIONS = {
7 ALIPAY: '支付宝', 7 ALIPAY: '支付宝',
8 WECHAT: '微信', 8 WECHAT: '微信',
9 BANK_TRANSFER: '银行转账', 9 BANK_TRANSFER: '银行转账',
  10 + BALANCE: '预存款',
10 }; 11 };
11 12
12 export const RECEIPTS_RECORD_TYPES = { 13 export const RECEIPTS_RECORD_TYPES = {
@@ -25,7 +26,7 @@ export const PAYMENT_METHOD_OPTIONS = { @@ -25,7 +26,7 @@ export const PAYMENT_METHOD_OPTIONS = {
25 PLATFORM_SETTLEMENT: '平台结算', 26 PLATFORM_SETTLEMENT: '平台结算',
26 CASH_ON_DELIVERY: '货到付款', 27 CASH_ON_DELIVERY: '货到付款',
27 HIRE_PURCHASE: '分期付款', 28 HIRE_PURCHASE: '分期付款',
28 - PAYMENT_RECEIPT:'已回款' 29 + PAYMENT_RECEIPT: '已回款',
29 }; 30 };
30 31
31 export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { 32 export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
@@ -153,7 +154,7 @@ export const POST_AUDIT_OPTIONS = { @@ -153,7 +154,7 @@ export const POST_AUDIT_OPTIONS = {
153 export const PAYMENT_RECEIPTS_STATUS_OPTIONS = { 154 export const PAYMENT_RECEIPTS_STATUS_OPTIONS = {
154 WAIT_AUDIT: '回款待审核', 155 WAIT_AUDIT: '回款待审核',
155 AUDIT_PASS: '回款已审核', 156 AUDIT_PASS: '回款已审核',
156 - AUDIT_NOTPASS: '回款审核失败' 157 + AUDIT_NOTPASS: '回款审核失败',
157 }; 158 };
158 159
159 export const ORDER_STATUS_OPTIONS = { 160 export const ORDER_STATUS_OPTIONS = {
@@ -190,8 +191,8 @@ export const MODIFIED_AUDIT_STATUS_OPTIONS = { @@ -190,8 +191,8 @@ export const MODIFIED_AUDIT_STATUS_OPTIONS = {
190 * 采购筛选订单的主要订单状态 191 * 采购筛选订单的主要订单状态
191 */ 192 */
192 export const PROCURE_PRIMARY_ORDER_STATUS_OPTIONS = { 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 SHIPPED: '已发货', 196 SHIPPED: '已发货',
196 }; 197 };
197 198
@@ -253,10 +254,10 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([ @@ -253,10 +254,10 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
253 ['PARTIAL_INVOICING', 'processing'], 254 ['PARTIAL_INVOICING', 'processing'],
254 ['URGENT_INVOICE_AUDITING', 'warning'], 255 ['URGENT_INVOICE_AUDITING', 'warning'],
255 ['APPLY_FOR_INVOICING', 'processing'], 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 export const SALES_CODE_OPTIONS = [ 262 export const SALES_CODE_OPTIONS = [
262 { label: 'D-Linda', value: 'D-Linda' }, 263 { label: 'D-Linda', value: 'D-Linda' },
@@ -380,6 +381,7 @@ export const HISTORY_OPT_TYPE = new Map&lt;string, string&gt;([ @@ -380,6 +381,7 @@ export const HISTORY_OPT_TYPE = new Map&lt;string, string&gt;([
380 ['warehouse_audit', '仓库审核'], 381 ['warehouse_audit', '仓库审核'],
381 ['post_audit', '后置审核'], 382 ['post_audit', '后置审核'],
382 ['applyModify', '申请修改订单信息'], 383 ['applyModify', '申请修改订单信息'],
  384 + ['OUTSIDE_SYSTEM_PUSH', '外部系统推送了本订单'],
383 ]); 385 ]);
384 386
385 export const MAIN_ORDER_COLUMNS = [ 387 export const MAIN_ORDER_COLUMNS = [
src/pages/Order/index.tsx
@@ -3,7 +3,6 @@ import { RESPONSE_CODE } from &#39;@/constants/enum&#39;; @@ -3,7 +3,6 @@ import { RESPONSE_CODE } from &#39;@/constants/enum&#39;;
3 import { 3 import {
4 postKingdeeRepSalBillOutbound, 4 postKingdeeRepSalBillOutbound,
5 postKingdeeRepSalOrderSave, 5 postKingdeeRepSalOrderSave,
6 - postOrderErpMessageGetUnreadNum,  
7 postServiceOrderCancelSend, 6 postServiceOrderCancelSend,
8 postServiceOrderNoNeedSend, 7 postServiceOrderNoNeedSend,
9 postServiceOrderOrderCancel, 8 postServiceOrderOrderCancel,
@@ -24,30 +23,28 @@ import { @@ -24,30 +23,28 @@ import {
24 getAliYunOSSFileNameFromUrl, 23 getAliYunOSSFileNameFromUrl,
25 isImageName, 24 isImageName,
26 } from '@/utils'; 25 } from '@/utils';
27 -import { getReceivingCompanyOptions, isSupplier } from '@/utils/order'; 26 +import {
  27 + getReceivingCompanyOptions,
  28 + isExaminer,
  29 + isSupplier,
  30 +} from '@/utils/order';
28 import { getUserInfo } from '@/utils/user'; 31 import { getUserInfo } from '@/utils/user';
29 import { 32 import {
30 - BellOutlined,  
31 ClockCircleTwoTone, 33 ClockCircleTwoTone,
32 ContainerTwoTone, 34 ContainerTwoTone,
33 CopyOutlined, 35 CopyOutlined,
34 CopyTwoTone, 36 CopyTwoTone,
35 DownOutlined, 37 DownOutlined,
36 EditTwoTone, 38 EditTwoTone,
37 - EllipsisOutlined,  
38 QuestionCircleOutlined, 39 QuestionCircleOutlined,
39 } from '@ant-design/icons'; 40 } from '@ant-design/icons';
40 import { 41 import {
41 ActionType, 42 ActionType,
42 - PageContainer,  
43 ProColumns, 43 ProColumns,
44 ProFormInstance, 44 ProFormInstance,
45 ProTable, 45 ProTable,
46 } from '@ant-design/pro-components'; 46 } from '@ant-design/pro-components';
47 -import { history } from '@umijs/max';  
48 import { 47 import {
49 - Avatar,  
50 - Badge,  
51 Button, 48 Button,
52 Checkbox, 49 Checkbox,
53 Divider, 50 Divider,
@@ -79,8 +76,8 @@ import FinancialEditDrawer from &#39;./components/FinancialEditDrawer&#39;; @@ -79,8 +76,8 @@ import FinancialEditDrawer from &#39;./components/FinancialEditDrawer&#39;;
79 import FinancialMergeDrawer from './components/FinancialMergeDrawer'; 76 import FinancialMergeDrawer from './components/FinancialMergeDrawer';
80 import FinancialReceiptsModal from './components/FinancialReceiptsModal'; 77 import FinancialReceiptsModal from './components/FinancialReceiptsModal';
81 import HistoryModal from './components/HistoryModal'; 78 import HistoryModal from './components/HistoryModal';
  79 +import ImagesViewerModal from './components/ImagesViewerModal';
82 import ImportModal from './components/ImportModal'; 80 import ImportModal from './components/ImportModal';
83 -import MessageListDrawer from './components/MessageListDrawer';  
84 import ModifiedDiffModal from './components/ModifiedDiffModal'; 81 import ModifiedDiffModal from './components/ModifiedDiffModal';
85 import OrderDrawer from './components/OrderDrawer'; 82 import OrderDrawer from './components/OrderDrawer';
86 import OrderNotesEditModal from './components/OrderNotesEditModal'; 83 import OrderNotesEditModal from './components/OrderNotesEditModal';
@@ -88,6 +85,7 @@ import ProcureCheckModal from &#39;./components/ProcureCheckModal&#39;; @@ -88,6 +85,7 @@ import ProcureCheckModal from &#39;./components/ProcureCheckModal&#39;;
88 import ProcureConvertModal from './components/ProcureConvertModal'; 85 import ProcureConvertModal from './components/ProcureConvertModal';
89 import ProductionTimeModal from './components/ProductionTimeModal'; 86 import ProductionTimeModal from './components/ProductionTimeModal';
90 import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal'; 87 import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal';
  88 +import UploadPayBillModal from './components/UploadPayBillModal';
91 import { 89 import {
92 AFTER_INVOICING_STATUS, 90 AFTER_INVOICING_STATUS,
93 CHECK_TYPE, 91 CHECK_TYPE,
@@ -109,18 +107,14 @@ import { @@ -109,18 +107,14 @@ import {
109 } from './constant'; 107 } from './constant';
110 import './index.less'; 108 import './index.less';
111 import { OrderListItemType, OrderType } from './type.d'; 109 import { OrderListItemType, OrderType } from './type.d';
112 -import UploadPayBillModal from './components/UploadPayBillModal';  
113 -import ImagesViewerModal from './components/ImagesViewerModal';  
114 110
115 const OrderPage = () => { 111 const OrderPage = () => {
116 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); 112 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
117 const [checkVisible, setCheckVisible] = useState<boolean>(false); 113 const [checkVisible, setCheckVisible] = useState<boolean>(false);
118 const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false); 114 const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false);
119 const [allMainChecked, setAllMainChecked] = useState(false); 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 const [data, setData] = useState([]); //列表数据 118 const [data, setData] = useState([]); //列表数据
125 const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false); 119 const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false);
126 const [financialMergeDrawerVisible, setFinancialMergeDrawerVisible] = 120 const [financialMergeDrawerVisible, setFinancialMergeDrawerVisible] =
@@ -154,8 +148,6 @@ const OrderPage = () =&gt; { @@ -154,8 +148,6 @@ const OrderPage = () =&gt; {
154 useState<boolean>(false); 148 useState<boolean>(false);
155 const [productionTimeModalVisible, setProductionTimeModalVisible] = 149 const [productionTimeModalVisible, setProductionTimeModalVisible] =
156 useState<boolean>(false); 150 useState<boolean>(false);
157 - const [messageListDrawerVisible, setMessageListDrawerVisible] =  
158 - useState<boolean>(false);  
159 const [deliverVisible, setDeliverVisible] = useState<boolean>(false); 151 const [deliverVisible, setDeliverVisible] = useState<boolean>(false);
160 const [deliverInfoDrawerVisible, setDeliverInfoDrawerVisible] = 152 const [deliverInfoDrawerVisible, setDeliverInfoDrawerVisible] =
161 useState<boolean>(false); 153 useState<boolean>(false);
@@ -174,14 +166,13 @@ const OrderPage = () =&gt; { @@ -174,14 +166,13 @@ const OrderPage = () =&gt; {
174 const [pageSize, setPageSize] = useState(10); 166 const [pageSize, setPageSize] = useState(10);
175 const [currentPage, setCurrentPage] = useState(1); 167 const [currentPage, setCurrentPage] = useState(1);
176 const [orderCheckType, setOrderCheckType] = useState(''); 168 const [orderCheckType, setOrderCheckType] = useState('');
177 - const [imagesViewerOptType,setImagesViewerOptType] = useState(''); 169 + const [imagesViewerOptType, setImagesViewerOptType] = useState('');
178 const [filterCondifion, setFilterCondition] = useState(0); 170 const [filterCondifion, setFilterCondition] = useState(0);
179 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据 171 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
180 const [subOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合 172 const [subOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
181 const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id 173 const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
182 const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id 174 const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
183 const [subOrderCount, setSubOrderCount] = useState(0); 175 const [subOrderCount, setSubOrderCount] = useState(0);
184 - const [unreadMsgNum, setUnreadMsgNum] = useState(0);  
185 const [sorted, setSorted] = useState(false); 176 const [sorted, setSorted] = useState(false);
186 const mainTableRef = useRef<ActionType>(); 177 const mainTableRef = useRef<ActionType>();
187 const mainTableFormRef = useRef<ProFormInstance>(); 178 const mainTableFormRef = useRef<ProFormInstance>();
@@ -280,13 +271,6 @@ const OrderPage = () =&gt; { @@ -280,13 +271,6 @@ const OrderPage = () =&gt; {
280 } 271 }
281 272
282 /** 273 /**
283 - * 打开消息弹窗  
284 - */  
285 - function openMessageDrawer() {  
286 - setMessageListDrawerVisible(true);  
287 - }  
288 -  
289 - /**  
290 * 财务是否选中排序 274 * 财务是否选中排序
291 * @param e 275 * @param e
292 */ 276 */
@@ -764,7 +748,7 @@ const OrderPage = () =&gt; { @@ -764,7 +748,7 @@ const OrderPage = () =&gt; {
764 onConfirm={() => { 748 onConfirm={() => {
765 window.open( 749 window.open(
766 '/previewApi/onlinePreview?url=' + 750 '/previewApi/onlinePreview?url=' +
767 - encodeURIComponent(Base64.encode(item.url)), 751 + encodeURIComponent(Base64.encode(item.url)),
768 ); 752 );
769 }} 753 }}
770 onCancel={() => { 754 onCancel={() => {
@@ -836,7 +820,7 @@ const OrderPage = () =&gt; { @@ -836,7 +820,7 @@ const OrderPage = () =&gt; {
836 </span> 820 </span>
837 {(roleCode === 'salesRepresentative' || 821 {(roleCode === 'salesRepresentative' ||
838 roleCode === 'salesManager') && 822 roleCode === 'salesManager') &&
839 - !optRecord.isCurrentUserOrder ? ( 823 + !optRecord.isCurrentUserOrder ? (
840 <span className="text-[#f44e4e]">(非本账号订单)</span> 824 <span className="text-[#f44e4e]">(非本账号订单)</span>
841 ) : ( 825 ) : (
842 '' 826 ''
@@ -918,7 +902,7 @@ const OrderPage = () =&gt; { @@ -918,7 +902,7 @@ const OrderPage = () =&gt; {
918 {(roleCode === 'procure' || 902 {(roleCode === 'procure' ||
919 roleCode === 'warehouseKeeper' || 903 roleCode === 'warehouseKeeper' ||
920 roleCode === 'admin') && 904 roleCode === 'admin') &&
921 - !isSupplier() ? ( 905 + !isSupplier() ? (
922 <> 906 <>
923 <Flex title={optRecord.supplierName}> 907 <Flex title={optRecord.supplierName}>
924 <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> 908 <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis">
@@ -1055,20 +1039,29 @@ const OrderPage = () =&gt; { @@ -1055,20 +1039,29 @@ const OrderPage = () =&gt; {
1055 {/* 回款审核状态 */} 1039 {/* 回款审核状态 */}
1056 {optRecord.paymentReceiptStatus !== null ? ( 1040 {optRecord.paymentReceiptStatus !== null ? (
1057 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1041 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1058 - <Tag className='hover:cursor-pointer' 1042 + <Tag
  1043 + className="hover:cursor-pointer"
1059 onMouseEnter={(e: any) => { 1044 onMouseEnter={(e: any) => {
1060 - e.target.innerText = "点击查看回款凭证" 1045 + e.target.innerText = '点击查看回款凭证';
1061 }} 1046 }}
1062 onMouseLeave={(e: any) => { 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 setImagesViewerModalVisible(true); 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 </Tag> 1065 </Tag>
1073 </div> 1066 </div>
1074 ) : ( 1067 ) : (
@@ -1110,21 +1103,23 @@ const OrderPage = () =&gt; { @@ -1110,21 +1103,23 @@ const OrderPage = () =&gt; {
1110 )} 1103 )}
1111 1104
1112 {/* 开票状态 */} 1105 {/* 开票状态 */}
1113 - {optRecord.afterInvoicingStatus !== null ? 1106 + {optRecord.afterInvoicingStatus !== null ? (
1114 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1107 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1115 <Tooltip 1108 <Tooltip
1116 title={ 1109 title={
1117 optRecord.invoicingUrgentCause !== null && 1110 optRecord.invoicingUrgentCause !== null &&
1118 - optRecord.afterInvoicingStatus === 1111 + optRecord.afterInvoicingStatus ===
1119 'URGENT_INVOICE_AUDITING' 1112 'URGENT_INVOICE_AUDITING'
1120 ? optRecord.invoicingUrgentCause 1113 ? optRecord.invoicingUrgentCause
1121 : enumValueToLabel( 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 {enumValueToLabel( 1123 {enumValueToLabel(
1129 optRecord.afterInvoicingStatus, 1124 optRecord.afterInvoicingStatus,
1130 AFTER_INVOICING_STATUS, 1125 AFTER_INVOICING_STATUS,
@@ -1132,8 +1127,9 @@ const OrderPage = () =&gt; { @@ -1132,8 +1127,9 @@ const OrderPage = () =&gt; {
1132 </Tag> 1127 </Tag>
1133 </Tooltip> 1128 </Tooltip>
1134 </div> 1129 </div>
1135 - : ""  
1136 - } 1130 + ) : (
  1131 + ''
  1132 + )}
1137 1133
1138 {/* 是否加急图标显示 */} 1134 {/* 是否加急图标显示 */}
1139 {optRecord.isUrgent ? ( 1135 {optRecord.isUrgent ? (
@@ -1149,7 +1145,7 @@ const OrderPage = () =&gt; { @@ -1149,7 +1145,7 @@ const OrderPage = () =&gt; {
1149 )} 1145 )}
1150 1146
1151 {(roleCode === 'warehouseKeeper' || roleCode === 'admin') && 1147 {(roleCode === 'warehouseKeeper' || roleCode === 'admin') &&
1152 - optRecord.shippingWarehouse !== null ? ( 1148 + optRecord.shippingWarehouse !== null ? (
1153 <div 1149 <div
1154 className="overflow-hidden whitespace-no-wrap overflow-ellipsis" 1150 className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1155 title={enumValueToLabel( 1151 title={enumValueToLabel(
@@ -1171,7 +1167,7 @@ const OrderPage = () =&gt; { @@ -1171,7 +1167,7 @@ const OrderPage = () =&gt; {
1171 {/* 生产时间 */} 1167 {/* 生产时间 */}
1172 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1168 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1173 {optRecord.productionStartTime !== null || 1169 {optRecord.productionStartTime !== null ||
1174 - optRecord.productionEndTime !== null ? ( 1170 + optRecord.productionEndTime !== null ? (
1175 <MyToolTip 1171 <MyToolTip
1176 title={ 1172 title={
1177 formatdate(optRecord.productionStartTime) + 1173 formatdate(optRecord.productionStartTime) +
@@ -1201,7 +1197,7 @@ const OrderPage = () =&gt; { @@ -1201,7 +1197,7 @@ const OrderPage = () =&gt; {
1201 <Tag 1197 <Tag
1202 color={ 1198 color={
1203 optRecord.invoicingTime === null || 1199 optRecord.invoicingTime === null ||
1204 - optRecord.invoicingTime === undefined 1200 + optRecord.invoicingTime === undefined
1205 ? TAGS_COLOR.get(optRecord.invoicingStatus) 1201 ? TAGS_COLOR.get(optRecord.invoicingStatus)
1206 : 'success' 1202 : 'success'
1207 } 1203 }
@@ -1229,7 +1225,7 @@ const OrderPage = () =&gt; { @@ -1229,7 +1225,7 @@ const OrderPage = () =&gt; {
1229 1225
1230 {/**采购是否已下单状态 */} 1226 {/**采购是否已下单状态 */}
1231 {optRecord.procureOrderStatus !== null && 1227 {optRecord.procureOrderStatus !== null &&
1232 - optRecord.procureOrderStatus !== undefined ? ( 1228 + optRecord.procureOrderStatus !== undefined ? (
1233 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1229 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1234 <Tag color="success"> 1230 <Tag color="success">
1235 {enumValueToLabel( 1231 {enumValueToLabel(
@@ -1245,21 +1241,21 @@ const OrderPage = () =&gt; { @@ -1245,21 +1241,21 @@ const OrderPage = () =&gt; {
1245 {/* 物流信息 */} 1241 {/* 物流信息 */}
1246 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1242 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1247 {optRecord.orderStatus === 'CONFIRM_RECEIPT' || 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 <MyToolTip 1247 <MyToolTip
1252 title={ 1248 title={
1253 optRecord.serialNumber === undefined 1249 optRecord.serialNumber === undefined
1254 ? '暂无物流信息' 1250 ? '暂无物流信息'
1255 : enumValueToLabel( 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 content={ 1260 content={
1265 <Button type="link" size="small" style={{ padding: 0 }}> 1261 <Button type="link" size="small" style={{ padding: 0 }}>
@@ -1273,7 +1269,7 @@ const OrderPage = () =&gt; { @@ -1273,7 +1269,7 @@ const OrderPage = () =&gt; {
1273 1269
1274 {/* 修改审核状态 */} 1270 {/* 修改审核状态 */}
1275 {optRecord.modifiedAuditStatus !== null && 1271 {optRecord.modifiedAuditStatus !== null &&
1276 - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? ( 1272 + optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
1277 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1273 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1278 <Tooltip 1274 <Tooltip
1279 title={enumValueToLabel( 1275 title={enumValueToLabel(
@@ -1318,7 +1314,6 @@ const OrderPage = () =&gt; { @@ -1318,7 +1314,6 @@ const OrderPage = () =&gt; {
1318 </div> 1314 </div>
1319 </Flex> 1315 </Flex>
1320 <Flex className="w-[18%]" wrap="wrap" gap="small"> 1316 <Flex className="w-[18%]" wrap="wrap" gap="small">
1321 -  
1322 {optRecord.subPath?.includes('uploadPaymentReceiptBill') ? ( 1317 {optRecord.subPath?.includes('uploadPaymentReceiptBill') ? (
1323 <Button 1318 <Button
1324 className="p-0" 1319 className="p-0"
@@ -1334,7 +1329,6 @@ const OrderPage = () =&gt; { @@ -1334,7 +1329,6 @@ const OrderPage = () =&gt; {
1334 '' 1329 ''
1335 )} 1330 )}
1336 1331
1337 -  
1338 {optRecord.subPath?.includes('leaderAudit') ? ( 1332 {optRecord.subPath?.includes('leaderAudit') ? (
1339 <Button 1333 <Button
1340 className="p-0" 1334 className="p-0"
@@ -1572,7 +1566,7 @@ const OrderPage = () =&gt; { @@ -1572,7 +1566,7 @@ const OrderPage = () =&gt; {
1572 )} 1566 )}
1573 1567
1574 {optRecord.subPath?.includes('queryAnnex') && 1568 {optRecord.subPath?.includes('queryAnnex') &&
1575 - optRecord.listAnnex?.length > 0 ? ( 1569 + optRecord.listAnnex?.length > 0 ? (
1576 <Button 1570 <Button
1577 className="p-0" 1571 className="p-0"
1578 type="link" 1572 type="link"
@@ -1914,7 +1908,7 @@ const OrderPage = () =&gt; { @@ -1914,7 +1908,7 @@ const OrderPage = () =&gt; {
1914 type="link" 1908 type="link"
1915 onClick={() => { 1909 onClick={() => {
1916 createOptObject(optRecord.id, record.id); 1910 createOptObject(optRecord.id, record.id);
1917 - setImagesViewerOptType("shippingReceipt"); 1911 + setImagesViewerOptType('shippingReceipt');
1918 setImagesViewerModalVisible(true); 1912 setImagesViewerModalVisible(true);
1919 }} 1913 }}
1920 > 1914 >
@@ -1947,9 +1941,9 @@ const OrderPage = () =&gt; { @@ -1947,9 +1941,9 @@ const OrderPage = () =&gt; {
1947 </Flex> 1941 </Flex>
1948 1942
1949 {roleCode === 'admin' || 1943 {roleCode === 'admin' ||
1950 - roleCode === 'salesManager' ||  
1951 - roleCode === 'salesRepresentative' ||  
1952 - roleCode === 'finance' ? ( 1944 + roleCode === 'salesManager' ||
  1945 + roleCode === 'salesRepresentative' ||
  1946 + roleCode === 'finance' ? (
1953 <Flex title={optRecord.notes}> 1947 <Flex title={optRecord.notes}>
1954 <div className="flex items-center"> 1948 <div className="flex items-center">
1955 <div className="flex items-center max-w-[500px]"> 1949 <div className="flex items-center max-w-[500px]">
@@ -1961,7 +1955,7 @@ const OrderPage = () =&gt; { @@ -1961,7 +1955,7 @@ const OrderPage = () =&gt; {
1961 <span className="text-[#8C8C8C]"> 1955 <span className="text-[#8C8C8C]">
1962 申请开票备注: 1956 申请开票备注:
1963 {optRecord.applyInvoicingNotes === undefined || 1957 {optRecord.applyInvoicingNotes === undefined ||
1964 - optRecord.applyInvoicingNotes === null 1958 + optRecord.applyInvoicingNotes === null
1965 ? '暂无备注' 1959 ? '暂无备注'
1966 : optRecord.applyInvoicingNotes} 1960 : optRecord.applyInvoicingNotes}
1967 </span> 1961 </span>
@@ -1989,7 +1983,7 @@ const OrderPage = () =&gt; { @@ -1989,7 +1983,7 @@ const OrderPage = () =&gt; {
1989 <span className="text-[#8C8C8C] mr-3"> 1983 <span className="text-[#8C8C8C] mr-3">
1990 财务审核备注: 1984 财务审核备注:
1991 {optRecord.checkNotes === undefined || 1985 {optRecord.checkNotes === undefined ||
1992 - optRecord.checkNotes === null 1986 + optRecord.checkNotes === null
1993 ? '暂无备注' 1987 ? '暂无备注'
1994 : optRecord.checkNotes} 1988 : optRecord.checkNotes}
1995 </span> 1989 </span>
@@ -2282,9 +2276,9 @@ const OrderPage = () =&gt; { @@ -2282,9 +2276,9 @@ const OrderPage = () =&gt; {
2282 <span className="text-slate-700"> 2276 <span className="text-slate-700">
2283 {record.receivingCompany !== null 2277 {record.receivingCompany !== null
2284 ? enumValueToLabel( 2278 ? enumValueToLabel(
2285 - record.receivingCompany,  
2286 - getReceivingCompanyOptions(PAYEE_OPTIONS),  
2287 - ) 2279 + record.receivingCompany,
  2280 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  2281 + )
2288 : '暂无'} 2282 : '暂无'}
2289 </span> 2283 </span>
2290 </div> 2284 </div>
@@ -2325,44 +2319,43 @@ const OrderPage = () =&gt; { @@ -2325,44 +2319,43 @@ const OrderPage = () =&gt; {
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 </div> 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 </div> 2354 </div>
2363 - : ""  
2364 - }  
2365 - 2355 + </div>
  2356 + ) : (
  2357 + ''
  2358 + )}
2366 </Flex> 2359 </Flex>
2367 </Flex> 2360 </Flex>
2368 <Flex wrap="wrap" gap="middle" vertical> 2361 <Flex wrap="wrap" gap="middle" vertical>
@@ -2930,9 +2923,9 @@ const OrderPage = () =&gt; { @@ -2930,9 +2923,9 @@ const OrderPage = () =&gt; {
2930 for (let i = 0; i < selectedSubOrders.length; i++) { 2923 for (let i = 0; i < selectedSubOrders.length; i++) {
2931 if ( 2924 if (
2932 selectedSubOrders[i].invoicingStatus === 2925 selectedSubOrders[i].invoicingStatus ===
2933 - 'UN_INVOICE' || 2926 + 'UN_INVOICE' ||
2934 selectedSubOrders[i].afterInvoicingStatus === 2927 selectedSubOrders[i].afterInvoicingStatus ===
2935 - 'APPLY_FOR_INVOICING' 2928 + 'APPLY_FOR_INVOICING'
2936 ) { 2929 ) {
2937 message.error( 2930 message.error(
2938 '请选择需要开票且未申请开票的子订单进行申请', 2931 '请选择需要开票且未申请开票的子订单进行申请',
@@ -3121,13 +3114,13 @@ const OrderPage = () =&gt; { @@ -3121,13 +3114,13 @@ const OrderPage = () =&gt; {
3121 if ( 3114 if (
3122 selectedSubOrders[i].orderStatus !== 'AUDITED' && 3115 selectedSubOrders[i].orderStatus !== 'AUDITED' &&
3123 selectedSubOrders[i].orderStatus !== 3116 selectedSubOrders[i].orderStatus !==
3124 - 'PROCURE_PROCESS' && 3117 + 'PROCURE_PROCESS' &&
3125 selectedSubOrders[i].orderStatus !== 3118 selectedSubOrders[i].orderStatus !==
3126 - 'PROCURE_PROCESS_FOR_MINE' && 3119 + 'PROCURE_PROCESS_FOR_MINE' &&
3127 selectedSubOrders[i].orderStatus !== 3120 selectedSubOrders[i].orderStatus !==
3128 - 'PROCURE_WAIT_SHIP' && 3121 + 'PROCURE_WAIT_SHIP' &&
3129 selectedSubOrders[i].orderStatus !== 3122 selectedSubOrders[i].orderStatus !==
3130 - 'SUPPLIER_WAIT_SHIP' && 3123 + 'SUPPLIER_WAIT_SHIP' &&
3131 selectedSubOrders[i].orderStatus !== 'WAIT_SHIP' 3124 selectedSubOrders[i].orderStatus !== 'WAIT_SHIP'
3132 ) { 3125 ) {
3133 message.error( 3126 message.error(
@@ -3214,9 +3207,9 @@ const OrderPage = () =&gt; { @@ -3214,9 +3207,9 @@ const OrderPage = () =&gt; {
3214 if ( 3207 if (
3215 selectedSubOrders[i].orderStatus !== 'UNAUDITED' && 3208 selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
3216 selectedSubOrders[i].orderStatus !== 3209 selectedSubOrders[i].orderStatus !==
3217 - 'FINANCE_PROCESS' && 3210 + 'FINANCE_PROCESS' &&
3218 selectedSubOrders[i].orderStatus !== 3211 selectedSubOrders[i].orderStatus !==
3219 - 'LEADER_AUDITED' 3212 + 'LEADER_AUDITED'
3220 ) { 3213 ) {
3221 message.error( 3214 message.error(
3222 '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核', 3215 '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
@@ -3284,9 +3277,9 @@ const OrderPage = () =&gt; { @@ -3284,9 +3277,9 @@ const OrderPage = () =&gt; {
3284 for (let i = 0; i < selectedSubOrders.length; i++) { 3277 for (let i = 0; i < selectedSubOrders.length; i++) {
3285 if ( 3278 if (
3286 selectedSubOrders[i].orderStatus !== 3279 selectedSubOrders[i].orderStatus !==
3287 - 'CONFIRM_RECEIPT' && 3280 + 'CONFIRM_RECEIPT' &&
3288 selectedSubOrders[i].orderStatus !== 3281 selectedSubOrders[i].orderStatus !==
3289 - 'AFTER_SALES_FAILURE' 3282 + 'AFTER_SALES_FAILURE'
3290 ) { 3283 ) {
3291 message.error('请选择确认收货状态的子订单进行售后'); 3284 message.error('请选择确认收货状态的子订单进行售后');
3292 return; 3285 return;
@@ -3490,12 +3483,24 @@ const OrderPage = () =&gt; { @@ -3490,12 +3483,24 @@ const OrderPage = () =&gt; {
3490 (item) => { 3483 (item) => {
3491 //首能账号只能搜索订单编号 3484 //首能账号只能搜索订单编号
3492 let canSearchIndex = ['id', 'salesCode', 'subNotes', 'orderStatus']; 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 item.search = false; 3501 item.search = false;
3498 } 3502 }
  3503 +
3499 if (item.dataIndex === 'name') { 3504 if (item.dataIndex === 'name') {
3500 return { 3505 return {
3501 ...item, 3506 ...item,
@@ -3521,10 +3526,7 @@ const OrderPage = () =&gt; { @@ -3521,10 +3526,7 @@ const OrderPage = () =&gt; {
3521 /** 3526 /**
3522 * 采购可以筛选供应商备注 3527 * 采购可以筛选供应商备注
3523 */ 3528 */
3524 - if (  
3525 - (roleCode === 'procure' || roleCode === 'admin') &&  
3526 - !isSupplier()  
3527 - ) { 3529 + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3528 mainOrdersColumns.push({ 3530 mainOrdersColumns.push({
3529 title: '供应商备注', 3531 title: '供应商备注',
3530 width: 120, 3532 width: 120,
@@ -3537,10 +3539,7 @@ const OrderPage = () =&gt; { @@ -3537,10 +3539,7 @@ const OrderPage = () =&gt; {
3537 /** 3539 /**
3538 * 采购可以筛选其他采购 3540 * 采购可以筛选其他采购
3539 */ 3541 */
3540 - if (  
3541 - (roleCode === 'procure' || roleCode === 'admin') &&  
3542 - !isSupplier()  
3543 - ) { 3542 + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3544 mainOrdersColumns.push({ 3543 mainOrdersColumns.push({
3545 title: '采购名称', 3544 title: '采购名称',
3546 width: 120, 3545 width: 120,
@@ -3687,7 +3686,7 @@ const OrderPage = () =&gt; { @@ -3687,7 +3686,7 @@ const OrderPage = () =&gt; {
3687 3686
3688 const exportMenuProps = { 3687 const exportMenuProps = {
3689 items: exportItems, 3688 items: exportItems,
3690 - onClick: () => { }, 3689 + onClick: () => {},
3691 }; 3690 };
3692 3691
3693 //导出按钮配置 3692 //导出按钮配置
@@ -3723,7 +3722,7 @@ const OrderPage = () =&gt; { @@ -3723,7 +3722,7 @@ const OrderPage = () =&gt; {
3723 3722
3724 const auditProps = { 3723 const auditProps = {
3725 items: auditItems, 3724 items: auditItems,
3726 - onClick: () => { }, 3725 + onClick: () => {},
3727 }; 3726 };
3728 3727
3729 if (rolePath?.includes('leaderMergeAudit')) { 3728 if (rolePath?.includes('leaderMergeAudit')) {
@@ -3831,8 +3830,8 @@ const OrderPage = () =&gt; { @@ -3831,8 +3830,8 @@ const OrderPage = () =&gt; {
3831 if (errorIds.size > 0) { 3830 if (errorIds.size > 0) {
3832 message.error( 3831 message.error(
3833 '订单号为:' + 3832 '订单号为:' +
3834 - [...errorIds.values()].join(',') +  
3835 - '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!', 3833 + [...errorIds.values()].join(',') +
  3834 + '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!',
3836 ); 3835 );
3837 return; 3836 return;
3838 } 3837 }
@@ -3891,16 +3890,6 @@ const OrderPage = () =&gt; { @@ -3891,16 +3890,6 @@ const OrderPage = () =&gt; {
3891 return toolBtns; 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 useEffect(() => { 3893 useEffect(() => {
3905 // 使用URLSearchParams来解析查询参数 3894 // 使用URLSearchParams来解析查询参数
3906 const params = new URLSearchParams(location.search); 3895 const params = new URLSearchParams(location.search);
@@ -3908,62 +3897,10 @@ const OrderPage = () =&gt; { @@ -3908,62 +3897,10 @@ const OrderPage = () =&gt; {
3908 if (id) { 3897 if (id) {
3909 mainTableFormRef.current?.setFieldValue('id', id); 3898 mainTableFormRef.current?.setFieldValue('id', id);
3910 } 3899 }
3911 -  
3912 - //未读消息条数  
3913 - getUnreadMessageNum();  
3914 }, []); 3900 }, []);
3915 3901
3916 return ( 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 <div id="resizeDiv"></div> 3904 <div id="resizeDiv"></div>
3968 <ProTable 3905 <ProTable
3969 id="main-table" 3906 id="main-table"
@@ -4271,7 +4208,7 @@ const OrderPage = () =&gt; { @@ -4271,7 +4208,7 @@ const OrderPage = () =&gt; {
4271 4208
4272 {imagesViewerModalVisible && ( 4209 {imagesViewerModalVisible && (
4273 <ImagesViewerModal 4210 <ImagesViewerModal
4274 - optType={imagesViewerOptType} 4211 + optType={imagesViewerOptType}
4275 setVisible={(val: boolean) => { 4212 setVisible={(val: boolean) => {
4276 setImagesViewerModalVisible(val); 4213 setImagesViewerModalVisible(val);
4277 if (!val) { 4214 if (!val) {
@@ -4504,16 +4441,8 @@ const OrderPage = () =&gt; { @@ -4504,16 +4441,8 @@ const OrderPage = () =&gt; {
4504 /> 4441 />
4505 )} 4442 )}
4506 4443
4507 - {messageListDrawerVisible && (  
4508 - <MessageListDrawer  
4509 - setVisible={(val: any) => {  
4510 - setMessageListDrawerVisible(val);  
4511 - getUnreadMessageNum();  
4512 - }}  
4513 - />  
4514 - )}  
4515 {contextHolder} 4444 {contextHolder}
4516 - </PageContainer> 4445 + </div>
4517 ); 4446 );
4518 }; 4447 };
4519 4448
src/pages/OrderReport/index.tsx
@@ -3,33 +3,19 @@ import { @@ -3,33 +3,19 @@ import {
3 postServiceOrderQuerySalesCode, 3 postServiceOrderQuerySalesCode,
4 } from '@/services'; 4 } from '@/services';
5 import { enumToSelect } from '@/utils'; 5 import { enumToSelect } from '@/utils';
6 -import { getUserInfo } from '@/utils/user';  
7 -import { EllipsisOutlined } from '@ant-design/icons';  
8 import { 6 import {
9 - PageContainer,  
10 ProCard, 7 ProCard,
11 ProFormCheckbox, 8 ProFormCheckbox,
12 ProFormDigit, 9 ProFormDigit,
13 ProFormSelect, 10 ProFormSelect,
14 QueryFilter, 11 QueryFilter,
15 } from '@ant-design/pro-components'; 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 import { useEffect, useState } from 'react'; 14 import { useEffect, useState } from 'react';
27 import { PRODUCT_BELONG_DEPARTMENT_OPTIONS } from '../Order/constant'; 15 import { PRODUCT_BELONG_DEPARTMENT_OPTIONS } from '../Order/constant';
28 import OrderDualAxes from './components/OrderDualAxes'; 16 import OrderDualAxes from './components/OrderDualAxes';
29 import OrderStatisticCard from './components/OrderStatisticCard'; 17 import OrderStatisticCard from './components/OrderStatisticCard';
30 import './index.less'; 18 import './index.less';
31 -const userInfo = getUserInfo();  
32 -  
33 const OrderReportPage = () => { 19 const OrderReportPage = () => {
34 const [salesCodeOptions, setSalesCodeOptions] = useState([]); 20 const [salesCodeOptions, setSalesCodeOptions] = useState([]);
35 21
@@ -124,41 +110,7 @@ const OrderReportPage = () =&gt; { @@ -124,41 +110,7 @@ const OrderReportPage = () =&gt; {
124 // }, 110 // },
125 // ]; 111 // ];
126 return ( 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 <Space direction="vertical" size="middle" className="flex"> 114 <Space direction="vertical" size="middle" className="flex">
163 <Spin spinning={loading}> 115 <Spin spinning={loading}>
164 <OrderStatisticCard 116 <OrderStatisticCard
@@ -235,7 +187,7 @@ const OrderReportPage = () =&gt; { @@ -235,7 +187,7 @@ const OrderReportPage = () =&gt; {
235 </Spin> 187 </Spin>
236 </ProCard> 188 </ProCard>
237 </Space> 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,10 +6,18 @@ export function getReceivingCompanyOptions(PAYEE_OPTIONS: any) {
6 return payeeOptions; 6 return payeeOptions;
7 } 7 }
8 8
9 -export function isSupplier(){ 9 +export function isSupplier() {
10 let userInfo = getUserInfo(); 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 return false; 22 return false;
15 } 23 }