Commit 2505974c47062ab1bddae81fa8ccb92a577d8cde

Authored by zhongnanhuang
1 parent f7393b09

feat: update

src/components/ButtomConfirm/index.tsx
1 1 import { Button, Popconfirm } from 'antd';
  2 +import { TooltipPlacement } from 'antd/lib/tooltip';
2 3  
3 4 const ButtonConfirm = ({
4 5 title,
... ... @@ -6,16 +7,18 @@ const ButtonConfirm = ({
6 7 text,
7 8 className,
8 9 onConfirm,
  10 + placement,
9 11 }: {
10 12 title: string;
11 13 text: string;
12 14 description?: string;
13 15 className?: string;
14 16 onConfirm?: () => void;
  17 + placement?: TooltipPlacement;
15 18 }) => {
16 19 return (
17 20 <Popconfirm
18   - placement="topLeft"
  21 + placement={placement ? placement : 'topLeft'}
19 22 title={title}
20 23 description={description}
21 24 onConfirm={onConfirm}
... ...
src/pages/Order/components/ApplyForInvoicingModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2 2 import { postServiceOrderApplyInvoicing } from '@/services';
3   -import { FloatAdd, enumToSelect, getAliYunOSSFileNameFromUrl } from '@/utils';
  3 +import { enumToSelect, getAliYunOSSFileNameFromUrl } from '@/utils';
4 4 import {
5 5 ModalForm,
6 6 ProFormDatePicker,
... ... @@ -16,13 +16,13 @@ export default ({
16 16 isEdit,
17 17 subOrders,
18 18 isMainOrder,
  19 + totalPayment,
19 20 onClose,
20 21 }) => {
21 22 const [isUrgent, setIsUrgent] = useState('');
22   - let sumPrice = 0;
  23 + let sumPrice = totalPayment;
23 24  
24 25 let ids = subOrders?.map((item) => {
25   - sumPrice = FloatAdd(item.subOrderPayment, sumPrice);
26 26 return item.id;
27 27 });
28 28  
... ... @@ -180,6 +180,14 @@ export default ({
180 180 hidden={isUrgent !== 'true'}
181 181 />
182 182  
  183 + <ProFormTextArea
  184 + key="invoicingUrgentCause"
  185 + label="加急开票原因"
  186 + name="invoicingUrgentCause"
  187 + rules={[{ required: isUrgent === 'true', message: '加急开票原因' }]}
  188 + hidden={isUrgent !== 'true'}
  189 + />
  190 +
183 191 <ProFormUploadDragger
184 192 key="2"
185 193 label={
... ...
src/pages/Order/components/CheckModal.tsx
... ... @@ -402,6 +402,9 @@ export default ({
402 402 if (checkType(CHECK_TYPE.MODIFY_LEADER_AUDIT)) {
403 403 type = 'modify_leader_audit';
404 404 }
  405 + if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING)) {
  406 + type = 'urgent_invoice_audit';
  407 + }
405 408 doCheck({
406 409 pass: false,
407 410 subOrderIds: subOrderIds,
... ... @@ -493,6 +496,9 @@ export default ({
493 496 if (checkType(CHECK_TYPE.MODIFY_LEADER_AUDIT)) {
494 497 type = 'modify_leader_audit';
495 498 }
  499 + if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING)) {
  500 + type = 'urgent_invoice_audit';
  501 + }
496 502 doCheck({
497 503 pass: true,
498 504 subOrderIds: subOrderIds,
... ...
src/pages/Order/components/DeliverModal.tsx
... ... @@ -15,6 +15,7 @@ import {
15 15 import {
16 16 Button,
17 17 Col,
  18 + Flex,
18 19 Input,
19 20 InputNumber,
20 21 Modal,
... ... @@ -66,16 +67,19 @@ const DeliverModal = ({
66 67 {
67 68 title: 'ID',
68 69 dataIndex: 'id',
  70 + width: 120,
69 71 render: (_, record) => <Input value={record.id} disabled />,
70 72 },
71 73 {
72 74 title: '商品编号',
73 75 dataIndex: 'productCode',
  76 + width: 120,
74 77 render: (_, record) => <Input value={record.productCode} disabled />,
75 78 },
76 79 {
77 80 title: '商品名称',
78 81 dataIndex: 'productName',
  82 + width: 120,
79 83 render: (_, record) => <Input value={record.productName} disabled />,
80 84 },
81 85 {
... ... @@ -149,7 +153,7 @@ const DeliverModal = ({
149 153 return (
150 154 <Modal
151 155 open
152   - width={900}
  156 + width={1000}
153 157 title={isSendProduct ? '发货' : '修改发货信息'}
154 158 onOk={async () => {
155 159 //请求体封装
... ... @@ -202,7 +206,13 @@ const DeliverModal = ({
202 206 setVisible(false);
203 207 }}
204 208 >
205   - <strong>将物流方式和物流单号更新到下方所有订单</strong>
  209 + <Flex vertical>
  210 + <strong>将物流方式和物流单号更新到下方所有订单</strong>
  211 + <span className="text-[red] py-1">
  212 + 选择【其他物流方式】时,需要将对应的物流方式填写在备注中。例如:如果发圆通快递,系统上没有这个选项,就需要选【其他物流方式】,然后把“圆通快递”填在备注上。
  213 + </span>
  214 + </Flex>
  215 +
206 216 <ProForm
207 217 layout="inline"
208 218 submitter={false}
... ...
src/pages/Order/components/MessageListDrawer.tsx
  1 +import ButtonConfirm from '@/components/ButtomConfirm';
1 2 import { RESPONSE_CODE } from '@/constants/enum';
2 3 import {
3 4 postOrderErpMessageQueryMyMessage,
4 5 postOrderErpMessageRead,
  6 + postOrderErpMessageReadAll,
5 7 } from '@/services';
6 8 import { formatDateTime, getUserInfo } from '@/utils';
7 9 import { UserOutlined } from '@ant-design/icons';
... ... @@ -25,7 +27,7 @@ export default ({ setVisible }) =&gt; {
25 27 const [loading, setLoading] = useState(false);
26 28 const [initLoading, setInitLoading] = useState(true);
27 29 const [onlyUnread, setOnlyUnread] = useState(false);
28   - const [unreadNumList, setUnreadNumList] = useState<any[]>([]); //消息未读标识
  30 + const [readFlagList, setReadFlagList] = useState<any[]>([]); //消息未读标识
29 31  
30 32 /**
31 33 * 获取消息列表
... ... @@ -36,7 +38,7 @@ export default ({ setVisible }) =&gt; {
36 38 data: {
37 39 username: userInfo.username,
38 40 current: current,
39   - isReaded: onlyUnread,
  41 + isReaded: onlyUnread ? onlyUnread : null,
40 42 },
41 43 }).finally(() => {
42 44 setLoading(false);
... ... @@ -44,9 +46,10 @@ export default ({ setVisible }) =&gt; {
44 46 if (res && res.result === RESPONSE_CODE.SUCCESS) {
45 47 setMessageListData([...messageListData, ...res?.data?.data]);
46 48 let reqReadNumList = res?.data?.data?.map((item: any) => {
47   - return item.unreadNum;
  49 + return item.isReaded;
48 50 });
49   - setUnreadNumList([...unreadNumList, ...reqReadNumList]);
  51 +
  52 + setReadFlagList([...readFlagList, ...reqReadNumList]);
50 53 setTotal(res?.data?.total);
51 54 }
52 55 }
... ... @@ -65,7 +68,7 @@ export default ({ setVisible }) =&gt; {
65 68 setOnlyUnread(!onlyUnread);
66 69 setCurrent(1);
67 70 setMessageListData([]);
68   - setUnreadNumList([]);
  71 + setReadFlagList([]);
69 72 }
70 73  
71 74 /**
... ... @@ -84,6 +87,18 @@ export default ({ setVisible }) =&gt; {
84 87 return false;
85 88 }
86 89  
  90 + /**
  91 + * 全部标记为已读
  92 + */
  93 + async function readAll() {
  94 + let res = await postOrderErpMessageReadAll();
  95 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  96 + message.success(res.message);
  97 + let newReadFlagList = readFlagList.map(() => true);
  98 + setReadFlagList(newReadFlagList);
  99 + }
  100 + }
  101 +
87 102 const loadMore =
88 103 !initLoading && !loading && messageListData.length < total ? (
89 104 <div
... ... @@ -102,7 +117,7 @@ export default ({ setVisible }) =&gt; {
102 117 加载更多
103 118 </Button>
104 119 </div>
105   - ) : messageListData.length >= total ? (
  120 + ) : messageListData.length > 0 && messageListData.length >= total ? (
106 121 <span>没有更多消息了</span>
107 122 ) : null;
108 123  
... ... @@ -130,9 +145,13 @@ export default ({ setVisible }) =&gt; {
130 145 </Checkbox>
131 146 </div>
132 147  
133   - <Button className="p-0" type="link">
134   - 全部标为已读
135   - </Button>
  148 + <ButtonConfirm
  149 + title={'是否全部标记为已读?'}
  150 + text={'全部标记为已读'}
  151 + className="p-0"
  152 + onConfirm={readAll}
  153 + placement="bottomLeft"
  154 + />
136 155 </Flex>
137 156  
138 157 <List
... ... @@ -145,7 +164,7 @@ export default ({ setVisible }) =&gt; {
145 164 <List.Item key={item.id}>
146 165 <List.Item.Meta
147 166 avatar={
148   - <Badge dot={unreadNumList[index] > 0}>
  167 + <Badge dot={!readFlagList[index]}>
149 168 <Avatar shape="square" icon={<UserOutlined />} />
150 169 </Badge>
151 170 }
... ... @@ -156,11 +175,11 @@ export default ({ setVisible }) =&gt; {
156 175 onClick={async () => {
157 176 toOrderList(item.mainOrderId);
158 177  
159   - let readSuccess = await read([item.id]);
  178 + let readSuccess = await read([item.mesUsrRelId]);
160 179 if (readSuccess) {
161   - let newUnreadNumList = [...unreadNumList];
162   - newUnreadNumList[index] = 0;
163   - setUnreadNumList([...newUnreadNumList]);
  180 + let newUnreadNumList = [...readFlagList];
  181 + newUnreadNumList[index] = true;
  182 + setReadFlagList([...newUnreadNumList]);
164 183 }
165 184 }}
166 185 >
... ...
src/pages/Order/components/ModifiedDiffModal.tsx
1 1 import { postServiceOrderModifiedDiff } from '@/services';
2   -import { enumValueToLabel, getAliYunOSSFileNameFromUrl } from '@/utils';
  2 +import {
  3 + enumValueToLabel,
  4 + getAliYunOSSFileNameFromUrl,
  5 + getUserInfo,
  6 +} from '@/utils';
3 7 import { getReceivingCompanyOptions } from '@/utils/order';
4 8 import { Button, Divider, Modal, Space, Table, TableProps } from 'antd';
5 9 import Base64 from 'base-64';
... ... @@ -12,6 +16,7 @@ import {
12 16 import '../table.less';
13 17  
14 18 export default ({ setVisible, subOrders, mainOrder, onClose }) => {
  19 + const userInfo = getUserInfo();
15 20 let subIds = subOrders?.map((item: any) => {
16 21 return item.id;
17 22 });
... ... @@ -21,6 +26,31 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
21 26 const [subOrderDiffs, setSubOrderDiffs] = useState([]);
22 27 const [mainOrderDiffs, setMainOrderDiffs] = useState([]);
23 28  
  29 + function isSupplierUnvisibleField(field: any) {
  30 + //主订单字段
  31 + let unvisibleFields = [
  32 + 'receivingCompany',
  33 + 'invoiceIdentificationNumber',
  34 + 'bankAccountNumber',
  35 + 'bank',
  36 + 'totalPayment',
  37 + 'institution',
  38 + 'institutionContactName',
  39 + ];
  40 + //子订单字段
  41 + unvisibleFields.push(
  42 + ...[
  43 + 'listAnnex',
  44 + 'shippingWarehouse',
  45 + 'productBelongBusiness',
  46 + 'subOrderPayment',
  47 + 'productPrice',
  48 + ],
  49 + );
  50 +
  51 + return userInfo?.username === '首能' && unvisibleFields.includes(field);
  52 + }
  53 +
24 54 async function loadData() {
25 55 let res = await postServiceOrderModifiedDiff({
26 56 data: {
... ... @@ -28,8 +58,11 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
28 58 mainOrderId: mainId,
29 59 },
30 60 });
31   - setSubOrderDiffs(res?.data?.subOrderDiffs);
32   - setMainOrderDiffs(res?.data?.mainOrderDiffs);
  61 + let subOrderDiffs = res?.data?.subOrderDiffs;
  62 + let mainOrderDiffs = res?.data?.mainOrderDiffs;
  63 +
  64 + setSubOrderDiffs(subOrderDiffs);
  65 + setMainOrderDiffs(mainOrderDiffs);
33 66 }
34 67  
35 68 useEffect(() => {
... ... @@ -158,12 +191,15 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
158 191 for (let field of visibleFields) {
159 192 let filedKey = field[0];
160 193 let filedName = field[1];
161   - tableData.push({
162   - fieldName: filedName,
163   - oldValue: oldDatas[filedKey],
164   - newValue: curDatas[filedKey],
165   - isDiff: diffFiledNames?.includes(filedKey),
166   - });
  194 +
  195 + if (!isSupplierUnvisibleField(filedKey)) {
  196 + tableData.push({
  197 + fieldName: filedName,
  198 + oldValue: oldDatas[filedKey],
  199 + newValue: curDatas[filedKey],
  200 + isDiff: diffFiledNames?.includes(filedKey),
  201 + });
  202 + }
167 203 }
168 204 return (
169 205 <>
... ... @@ -207,12 +243,15 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
207 243 for (let field of visibleFields) {
208 244 let filedKey = field[0];
209 245 let filedName = field[1];
210   - tableData.push({
211   - fieldName: filedName,
212   - oldValue: oldDatas[filedKey],
213   - newValue: curDatas[filedKey],
214   - isDiff: diffFiledNames?.includes(filedKey),
215   - });
  246 +
  247 + if (!isSupplierUnvisibleField(filedKey)) {
  248 + tableData.push({
  249 + fieldName: filedName,
  250 + oldValue: oldDatas[filedKey],
  251 + newValue: curDatas[filedKey],
  252 + isDiff: diffFiledNames?.includes(filedKey),
  253 + });
  254 + }
216 255 }
217 256 return (
218 257 <Table
... ...
src/pages/Order/constant.ts
1 1 import { postServiceOrderQueryCustomerInformation } from '@/services';
2   -import { enumToProTableEnumValue } from '@/utils';
  2 +import { enumToProTableEnumValue, getUserInfo } from '@/utils';
3 3 import { getReceivingCompanyOptions } from '@/utils/order';
4 4 export const COMFIR_RECEIPT_IMAGES_NUMBER = 3;
5 5  
... ... @@ -99,6 +99,7 @@ export const CHECK_TYPE = {
99 99 WAITING_FOR_POST_AUDIT: 'WAITING_FOR_POST_AUDIT',
100 100 NODE_OPERATING_AUDIT: 'NODE_OPERATING_AUDIT',
101 101 MODIFY_LEADER_AUDIT: 'MODIFY_LEADER_AUDIT',
  102 + URGENT_INVOICE_AUDITING: 'URGENT_INVOICE_AUDITING',
102 103 };
103 104  
104 105 /**
... ... @@ -157,7 +158,8 @@ export const ORDER_STATUS_OPTIONS = {
157 158 PROCURE_UN_PROCESS: '采购待审核',
158 159 PROCURE_PROCESS: '采购已审核',
159 160 PROCURE_PROCESS_FOR_MINE: '采购待打印',
160   - PROCURE_WAIT_SHIP: '采购待发货',
  161 + PROCURE_WAIT_SHIP:
  162 + getUserInfo()?.username === '首能' ? '待发货' : '采购待发货',
161 163 SUPPLIER_WAIT_SHIP: '供应商待发货',
162 164 WAIT_SHIP: '待发货',
163 165 SHIPPED: '已发货',
... ... @@ -202,6 +204,7 @@ export const FINANCIAL_STATUS_OPTIONS = {
202 204 export const AFTER_INVOICING_STATUS = {
203 205 NOT_YET_INVOICED: '尚未开票',
204 206 APPLY_FOR_INVOICING: '申请开票',
  207 + URGENT_INVOICE_AUDITING: '加急待审核',
205 208 PARTIAL_INVOICING: '部分开票',
206 209 COMPLETE_INVOICING: '完全开票',
207 210 };
... ... @@ -239,7 +242,10 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
239 242 ['AFTER_SALES_FAILURE', 'red'],
240 243 ['WAITING_FOR_POST_AUDIT', 'purple'],
241 244 ['POST_AUDITED', 'success'],
242   - ['POST_AUDIT_FAIL', 'error'],
  245 + ['COMPLETE_INVOICING', 'success'],
  246 + ['PARTIAL_INVOICING', 'processing'],
  247 + ['URGENT_INVOICE_AUDITING', 'warning'],
  248 + ['APPLY_FOR_INVOICING', 'processing'],
243 249 ]);
244 250 export const SALES_CODE_OPTIONS = [
245 251 { label: 'D-Linda', value: 'D-Linda' },
... ...
src/pages/Order/index.tsx
... ... @@ -15,6 +15,7 @@ import {
15 15 } from '@/services';
16 16 import { orderExport } from '@/services/order';
17 17 import {
  18 + FloatAdd,
18 19 copyToClipboard,
19 20 enumToProTableEnumValue,
20 21 enumValueToLabel,
... ... @@ -217,17 +218,24 @@ const OrderPage = () =&gt; {
217 218 text += record?.id;
218 219 text += ',' + record?.salesCode;
219 220 text += ',' + record?.customerName;
  221 +
220 222 text += ',' + record?.customerContactNumber;
  223 +
221 224 text += ',' + record?.customerShippingAddress;
222   - text += ',' + record?.institutionContactName;
223   - text += ',' + record?.institution;
  225 +
  226 + if (userInfo.username !== '首能') {
  227 + text += ',' + record?.institutionContactName;
  228 + text += ',' + record?.institution;
  229 + }
224 230 record?.subOrderInformationLists?.forEach((item) => {
225 231 text += '\n';
226 232 text += item?.productName;
227 233 text += ' ' + item?.parameters;
228 234 text += ' ' + item?.quantity;
229 235 text += ' ' + item?.unit;
230   - text += ' ¥' + item?.subOrderPayment;
  236 + if (userInfo.username !== '首能') {
  237 + text += ' ¥' + item?.subOrderPayment;
  238 + }
231 239 text += ' ' + item?.id;
232 240 });
233 241 if (copyToClipboard(text)) {
... ... @@ -373,7 +381,6 @@ const OrderPage = () =&gt; {
373 381 * 返回当前操作的子订单集合
374 382 */
375 383 function buildSubOrders() {
376   - console.log('here');
377 384 if (currentOptMainId === undefined || currentOptMainId === null) {
378 385 message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
379 386 return;
... ... @@ -421,12 +428,41 @@ const OrderPage = () =&gt; {
421 428 return;
422 429 }
423 430  
424   - console.log(cloneSubOrders);
425   -
426 431 return cloneSubOrders;
427 432 }
428 433  
429 434 /**
  435 + * 获取当前操作申请开票的订单总金额
  436 + */
  437 + function getApplyInvoicingTotalPayment() {
  438 + let subOrders = isMainOrder
  439 + ? [...subOrderSelectedMap.values()].flat()
  440 + : buildSubOrders();
  441 +
  442 + let totalPayment = 0;
  443 + if (subOrders && subOrders.length > 0) {
  444 + let mainIds = subOrders?.map((item: any) => {
  445 + return item.mainOrderId;
  446 + });
  447 +
  448 + let uniqueMainIds = [...new Set(mainIds)];
  449 +
  450 + let dataMap = data.reduce((map, obj: any) => {
  451 + map.set(obj.id, obj);
  452 + return map;
  453 + }, new Map());
  454 +
  455 + uniqueMainIds.forEach((id: any) => {
  456 + let o = dataMap.get(id);
  457 + if (o) {
  458 + totalPayment = FloatAdd(totalPayment, o.totalPayment);
  459 + }
  460 + });
  461 + }
  462 + return totalPayment;
  463 + }
  464 +
  465 + /**
430 466 * 根据主订单id,将该主订单下的所有子订单取消选中
431 467 */
432 468 const removeSelectedSubOrderKeysByMainOrderId = (id: any) => {
... ... @@ -497,9 +533,6 @@ const OrderPage = () =&gt; {
497 533 }
498 534 }
499 535 setSelectedMainOrderKeys(newSelectedMainOrderKeys);
500   -
501   - console.log(mainOrderSelectedMap);
502   - console.log(subOrderSelectedMap);
503 536 };
504 537 // const handleTableExpand = (mainOrderIds: any) => {
505 538 // setExpandedRowKeys(mainOrderIds);
... ... @@ -1055,12 +1088,25 @@ const OrderPage = () =&gt; {
1055 1088  
1056 1089 {/* 开票状态 */}
1057 1090 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1058   - <span className="text-slate-700">
1059   - {enumValueToLabel(
1060   - optRecord.afterInvoicingStatus,
1061   - AFTER_INVOICING_STATUS,
1062   - )}
1063   - </span>
  1091 + <Tooltip
  1092 + title={
  1093 + optRecord.invoicingUrgentCause !== null &&
  1094 + optRecord.afterInvoicingStatus ===
  1095 + 'URGENT_INVOICE_AUDITING'
  1096 + ? optRecord.invoicingUrgentCause
  1097 + : enumValueToLabel(
  1098 + optRecord.afterInvoicingStatus,
  1099 + AFTER_INVOICING_STATUS,
  1100 + )
  1101 + }
  1102 + >
  1103 + <Tag color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)}>
  1104 + {enumValueToLabel(
  1105 + optRecord.afterInvoicingStatus,
  1106 + AFTER_INVOICING_STATUS,
  1107 + )}
  1108 + </Tag>
  1109 + </Tooltip>
1064 1110 </div>
1065 1111  
1066 1112 {/* 是否加急图标显示 */}
... ... @@ -1264,6 +1310,25 @@ const OrderPage = () =&gt; {
1264 1310 ''
1265 1311 )}
1266 1312  
  1313 + {/* 加急审核 */}
  1314 + {optRecord.subPath?.includes('URGENT_INVOICE_AUDITING') ? (
  1315 + <Button
  1316 + className="p-0"
  1317 + type="link"
  1318 + onClick={() => {
  1319 + console.log('here');
  1320 + setCurrentMainId(record.id);
  1321 + setCurretnOptSubId(optRecord.id);
  1322 + setCheckVisible(true);
  1323 + setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING);
  1324 + }}
  1325 + >
  1326 + 加急审核
  1327 + </Button>
  1328 + ) : (
  1329 + ''
  1330 + )}
  1331 +
1267 1332 {optRecord.subPath?.includes('postAudit') ? (
1268 1333 <Button
1269 1334 className="p-0"
... ... @@ -2122,6 +2187,28 @@ const OrderPage = () =&gt; {
2122 2187 </Space>
2123 2188 </Flex>
2124 2189 </Flex>
  2190 +
  2191 + {userInfo.username === '首能' ? (
  2192 + <Flex className="pl-6" align="center">
  2193 + <Flex
  2194 + className="hover:cursor-pointer"
  2195 + onClick={() => {
  2196 + copyToClipboard(record.customerContactNumber);
  2197 + message.info(
  2198 + '联系电话复制成功:' + record.customerContactNumber,
  2199 + );
  2200 + }}
  2201 + >
  2202 + <span className="text-[#8C8C8C]">联系电话:</span>
  2203 + <span className="text-slate-700">
  2204 + {record.customerContactNumber + ' '}
  2205 + </span>
  2206 + </Flex>
  2207 + </Flex>
  2208 + ) : (
  2209 + ''
  2210 + )}
  2211 +
2125 2212 <Flex className="pl-6" align="center">
2126 2213 {roleCode === 'finance' ? (
2127 2214 <div
... ... @@ -2183,50 +2270,52 @@ const OrderPage = () =&gt; {
2183 2270 <Flex justify="flex-end">
2184 2271 <Flex wrap="wrap" gap="middle" align="center">
2185 2272 {userInfo.username !== '首能' ? (
2186   - <>
2187   - <div>
2188   - <span className="text-[#8C8C8C]">总金额:¥</span>
2189   - <span className="text-lg font-medium">
2190   - {record.totalPayment}
2191   - </span>
2192   - </div>
2193   - {rolePath?.includes('addOrder') ? (
2194   - <Tooltip title="复制">
2195   - <CopyTwoTone
2196   - className="hover:cursor-pointer"
2197   - onClick={() => {
2198   - createOptObject(null, record.id);
2199   - copyOrderToClipboard(record);
2200   - setOrderOptType('copy');
2201   - setOrderDrawerVisible(true);
2202   - }}
2203   - />
2204   - </Tooltip>
2205   - ) : (
2206   - <Tooltip title="复制文本">
2207   - <CopyTwoTone
2208   - className="hover:cursor-pointer"
2209   - onClick={() => {
2210   - copyOrderToClipboard(record);
2211   - }}
2212   - />
2213   - </Tooltip>
2214   - )}
  2273 + <div>
  2274 + <span className="text-[#8C8C8C]">总金额:¥</span>
  2275 + <span className="text-lg font-medium">
  2276 + {record.totalPayment}
  2277 + </span>
  2278 + </div>
  2279 + ) : (
  2280 + ''
  2281 + )}
2215 2282  
2216   - <Tooltip title="历史">
2217   - <ClockCircleTwoTone
2218   - className="hover:cursor-pointer"
2219   - onClick={() => {
2220   - setHistoryModalVisible(true);
2221   - if (subOrderSelectedMap.get(record.id)?.length) {
2222   - setSelectedRows(subOrderSelectedMap.get(record.id));
2223   - } else {
2224   - setSelectedRows(record.subOrderInformationLists);
2225   - }
2226   - }}
2227   - />
2228   - </Tooltip>
2229   - </>
  2283 + {rolePath?.includes('addOrder') ? (
  2284 + <Tooltip title="复制">
  2285 + <CopyTwoTone
  2286 + className="hover:cursor-pointer"
  2287 + onClick={() => {
  2288 + createOptObject(null, record.id);
  2289 + copyOrderToClipboard(record);
  2290 + setOrderOptType('copy');
  2291 + setOrderDrawerVisible(true);
  2292 + }}
  2293 + />
  2294 + </Tooltip>
  2295 + ) : (
  2296 + <Tooltip title="复制文本">
  2297 + <CopyTwoTone
  2298 + className="hover:cursor-pointer"
  2299 + onClick={() => {
  2300 + copyOrderToClipboard(record);
  2301 + }}
  2302 + />
  2303 + </Tooltip>
  2304 + )}
  2305 + {userInfo.username !== '首能' ? (
  2306 + <Tooltip title="历史">
  2307 + <ClockCircleTwoTone
  2308 + className="hover:cursor-pointer"
  2309 + onClick={() => {
  2310 + setHistoryModalVisible(true);
  2311 + if (subOrderSelectedMap.get(record.id)?.length) {
  2312 + setSelectedRows(subOrderSelectedMap.get(record.id));
  2313 + } else {
  2314 + setSelectedRows(record.subOrderInformationLists);
  2315 + }
  2316 + }}
  2317 + />
  2318 + </Tooltip>
2230 2319 ) : (
2231 2320 ''
2232 2321 )}
... ... @@ -2251,6 +2340,22 @@ const OrderPage = () =&gt; {
2251 2340 ''
2252 2341 )}
2253 2342  
  2343 + {record.mainPath?.includes('URGENT_INVOICE_AUDITING') ? (
  2344 + <Button
  2345 + className="p-0"
  2346 + type="link"
  2347 + onClick={() => {
  2348 + createOptObject(null, record.id);
  2349 + setCheckVisible(true);
  2350 + setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING);
  2351 + }}
  2352 + >
  2353 + 加急审核
  2354 + </Button>
  2355 + ) : (
  2356 + ''
  2357 + )}
  2358 +
2254 2359 {record.mainPath?.includes('modifiedLeaderAuditRequest') ? (
2255 2360 <Button
2256 2361 className="p-0"
... ... @@ -3905,6 +4010,7 @@ const OrderPage = () =&gt; {
3905 4010 ? [...subOrderSelectedMap.values()].flat()
3906 4011 : buildSubOrders()
3907 4012 }
  4013 + totalPayment={getApplyInvoicingTotalPayment()}
3908 4014 isMainOrder={isMainOrder}
3909 4015 isEdit={isEdit}
3910 4016 onClose={() => {
... ... @@ -4250,7 +4356,12 @@ const OrderPage = () =&gt; {
4250 4356 )}
4251 4357  
4252 4358 {messageListDrawerVisible && (
4253   - <MessageListDrawer setVisible={setMessageListDrawerVisible} />
  4359 + <MessageListDrawer
  4360 + setVisible={(val: any) => {
  4361 + setMessageListDrawerVisible(val);
  4362 + getUnreadMessageNum();
  4363 + }}
  4364 + />
4254 4365 )}
4255 4366 {contextHolder}
4256 4367 </PageContainer>
... ...
src/pages/OrderReport/index.tsx
1   -import { postServiceOrderQueryReportFormsInformation } from '@/services';
  1 +import {
  2 + postServiceOrderQueryReportFormsInformation,
  3 + postServiceOrderQuerySalesCode,
  4 +} from '@/services';
2 5 import { enumToSelect } from '@/utils';
3 6 import { getUserInfo } from '@/utils/user';
4 7 import { EllipsisOutlined } from '@ant-design/icons';
... ... @@ -21,16 +24,30 @@ import {
21 24 Tag,
22 25 } from 'antd';
23 26 import { useEffect, useState } from 'react';
24   -import {
25   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
26   - SALES_CODE_OPTIONS,
27   -} from '../Order/constant';
  27 +import { PRODUCT_BELONG_DEPARTMENT_OPTIONS } from '../Order/constant';
28 28 import OrderDualAxes from './components/OrderDualAxes';
29 29 import OrderStatisticCard from './components/OrderStatisticCard';
30 30 import './index.less';
31 31 const userInfo = getUserInfo();
32 32  
33 33 const OrderReportPage = () => {
  34 + const [salesCodeOptions, setSalesCodeOptions] = useState([]);
  35 +
  36 + /**
  37 + * 获取销售代码枚举,在复制和编辑的时候判断是否为旧的代码
  38 + */
  39 + const getSalesCodeOptions = async () => {
  40 + const res = await postServiceOrderQuerySalesCode();
  41 + let options = res.data?.map((item) => {
  42 + return {
  43 + label: item.userName,
  44 + value: item.userName,
  45 + number: item.number,
  46 + };
  47 + });
  48 + setSalesCodeOptions(options);
  49 + };
  50 +
34 51 const [form] = Form.useForm<{
35 52 salesCode: '';
36 53 productBelongBusiness: '';
... ... @@ -91,6 +108,7 @@ const OrderReportPage = () =&gt; {
91 108  
92 109 useEffect(() => {
93 110 loadData();
  111 + getSalesCodeOptions();
94 112 }, []);
95 113  
96 114 // const items: TabsProps['items'] = [
... ... @@ -165,10 +183,11 @@ const OrderReportPage = () =&gt; {
165 183 <ProFormSelect
166 184 name="salesCode"
167 185 key="salesCode"
  186 + width="lg"
168 187 showSearch
169 188 label="销售代表"
170   - placeholder="请输入销售代表"
171   - options={SALES_CODE_OPTIONS}
  189 + placeholder="请选择销售代表"
  190 + options={salesCodeOptions}
172 191 />
173 192 <ProFormSelect
174 193 key="productBelongBusiness"
... ...
src/services/definition.ts
... ... @@ -808,6 +808,7 @@ export interface MeasureUnitListResRow {
808 808 export interface MessageQueryDTO {
809 809 /** @format int32 */
810 810 current?: number;
  811 + isReaded?: string;
811 812 /** @format int32 */
812 813 pageSize?: number;
813 814 /** @format int32 */
... ...
src/services/request.ts
... ... @@ -42,6 +42,7 @@ import type {
42 42 MaterialUnitListRes,
43 43 MeasureUnitListRes,
44 44 MessageQueryDTO,
  45 + ModelAndView,
45 46 OrderAddVO,
46 47 OrderAuditLogQueryVO,
47 48 OrderBaseInfoQueryVO,
... ... @@ -253,9 +254,7 @@ export interface GetErrorResponse {
253 254 * @description
254 255 * OK
255 256 */
256   - 200: {
257   - [propertyName: string]: any;
258   - };
  257 + 200: ModelAndView;
259 258 /**
260 259 * @description
261 260 * Unauthorized
... ... @@ -276,9 +275,9 @@ export interface GetErrorResponse {
276 275 export type GetErrorResponseSuccess = GetErrorResponse[200];
277 276 /**
278 277 * @description
279   - * error
  278 + * errorHtml
280 279 * @tags basic-error-controller
281   - * @produces *
  280 + * @produces text/html
282 281 */
283 282 export const getError = /* #__PURE__ */ (() => {
284 283 const method = 'get';
... ... @@ -302,9 +301,7 @@ export interface PutErrorResponse {
302 301 * @description
303 302 * OK
304 303 */
305   - 200: {
306   - [propertyName: string]: any;
307   - };
  304 + 200: ModelAndView;
308 305 /**
309 306 * @description
310 307 * Created
... ... @@ -330,9 +327,9 @@ export interface PutErrorResponse {
330 327 export type PutErrorResponseSuccess = PutErrorResponse[200];
331 328 /**
332 329 * @description
333   - * error
  330 + * errorHtml
334 331 * @tags basic-error-controller
335   - * @produces *
  332 + * @produces text/html
336 333 * @consumes application/json
337 334 */
338 335 export const putError = /* #__PURE__ */ (() => {
... ... @@ -357,9 +354,7 @@ export interface PostErrorResponse {
357 354 * @description
358 355 * OK
359 356 */
360   - 200: {
361   - [propertyName: string]: any;
362   - };
  357 + 200: ModelAndView;
363 358 /**
364 359 * @description
365 360 * Created
... ... @@ -385,9 +380,9 @@ export interface PostErrorResponse {
385 380 export type PostErrorResponseSuccess = PostErrorResponse[200];
386 381 /**
387 382 * @description
388   - * error
  383 + * errorHtml
389 384 * @tags basic-error-controller
390   - * @produces *
  385 + * @produces text/html
391 386 * @consumes application/json
392 387 */
393 388 export const postError = /* #__PURE__ */ (() => {
... ... @@ -412,9 +407,7 @@ export interface DeleteErrorResponse {
412 407 * @description
413 408 * OK
414 409 */
415   - 200: {
416   - [propertyName: string]: any;
417   - };
  410 + 200: ModelAndView;
418 411 /**
419 412 * @description
420 413 * No Content
... ... @@ -435,9 +428,9 @@ export interface DeleteErrorResponse {
435 428 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
436 429 /**
437 430 * @description
438   - * error
  431 + * errorHtml
439 432 * @tags basic-error-controller
440   - * @produces *
  433 + * @produces text/html
441 434 */
442 435 export const deleteError = /* #__PURE__ */ (() => {
443 436 const method = 'delete';
... ... @@ -461,9 +454,7 @@ export interface OptionsErrorResponse {
461 454 * @description
462 455 * OK
463 456 */
464   - 200: {
465   - [propertyName: string]: any;
466   - };
  457 + 200: ModelAndView;
467 458 /**
468 459 * @description
469 460 * No Content
... ... @@ -484,9 +475,9 @@ export interface OptionsErrorResponse {
484 475 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
485 476 /**
486 477 * @description
487   - * error
  478 + * errorHtml
488 479 * @tags basic-error-controller
489   - * @produces *
  480 + * @produces text/html
490 481 * @consumes application/json
491 482 */
492 483 export const optionsError = /* #__PURE__ */ (() => {
... ... @@ -511,9 +502,7 @@ export interface HeadErrorResponse {
511 502 * @description
512 503 * OK
513 504 */
514   - 200: {
515   - [propertyName: string]: any;
516   - };
  505 + 200: ModelAndView;
517 506 /**
518 507 * @description
519 508 * No Content
... ... @@ -534,9 +523,9 @@ export interface HeadErrorResponse {
534 523 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
535 524 /**
536 525 * @description
537   - * error
  526 + * errorHtml
538 527 * @tags basic-error-controller
539   - * @produces *
  528 + * @produces text/html
540 529 * @consumes application/json
541 530 */
542 531 export const headError = /* #__PURE__ */ (() => {
... ... @@ -561,9 +550,7 @@ export interface PatchErrorResponse {
561 550 * @description
562 551 * OK
563 552 */
564   - 200: {
565   - [propertyName: string]: any;
566   - };
  553 + 200: ModelAndView;
567 554 /**
568 555 * @description
569 556 * No Content
... ... @@ -584,9 +571,9 @@ export interface PatchErrorResponse {
584 571 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
585 572 /**
586 573 * @description
587   - * error
  574 + * errorHtml
588 575 * @tags basic-error-controller
589   - * @produces *
  576 + * @produces text/html
590 577 * @consumes application/json
591 578 */
592 579 export const patchError = /* #__PURE__ */ (() => {
... ... @@ -4159,6 +4146,60 @@ export const postOrderErpMessageRead = /* #__PURE__ */ (() =&gt; {
4159 4146 return request;
4160 4147 })();
4161 4148  
  4149 +/** @description response type for postOrderErpMessageReadAll */
  4150 +export interface PostOrderErpMessageReadAllResponse {
  4151 + /**
  4152 + * @description
  4153 + * OK
  4154 + */
  4155 + 200: ServerResult;
  4156 + /**
  4157 + * @description
  4158 + * Created
  4159 + */
  4160 + 201: any;
  4161 + /**
  4162 + * @description
  4163 + * Unauthorized
  4164 + */
  4165 + 401: any;
  4166 + /**
  4167 + * @description
  4168 + * Forbidden
  4169 + */
  4170 + 403: any;
  4171 + /**
  4172 + * @description
  4173 + * Not Found
  4174 + */
  4175 + 404: any;
  4176 +}
  4177 +
  4178 +export type PostOrderErpMessageReadAllResponseSuccess =
  4179 + PostOrderErpMessageReadAllResponse[200];
  4180 +/**
  4181 + * @description
  4182 + * queryMyMessage
  4183 + * @tags message-controller
  4184 + * @produces *
  4185 + * @consumes application/json
  4186 + */
  4187 +export const postOrderErpMessageReadAll = /* #__PURE__ */ (() => {
  4188 + const method = 'post';
  4189 + const url = '/order/erp/message/readAll';
  4190 + function request(): Promise<PostOrderErpMessageReadAllResponseSuccess> {
  4191 + return requester(request.url, {
  4192 + method: request.method,
  4193 + }) as unknown as Promise<PostOrderErpMessageReadAllResponseSuccess>;
  4194 + }
  4195 +
  4196 + /** http method */
  4197 + request.method = method;
  4198 + /** request url */
  4199 + request.url = url;
  4200 + return request;
  4201 +})();
  4202 +
4162 4203 /** @description request parameter type for postOrderErpOptLogListByPage */
4163 4204 export interface PostOrderErpOptLogListByPageOption {
4164 4205 /**
... ...