Commit 7780aaa40fd15cb24138718b3b5b49ee79f897ea
1 parent
04acf26a
feat: update
Showing
1 changed file
with
49 additions
and
41 deletions
src/pages/Order/index.tsx
@@ -7,9 +7,10 @@ import { | @@ -7,9 +7,10 @@ import { | ||
7 | import { orderExport } from '@/services/order'; | 7 | import { orderExport } from '@/services/order'; |
8 | import { enumValueToLabel, formatDateTime } from '@/utils'; | 8 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
9 | import { | 9 | import { |
10 | - ClockCircleOutlined, | ||
11 | - CopyOutlined, | 10 | + ClockCircleTwoTone, |
11 | + CopyTwoTone, | ||
12 | DownOutlined, | 12 | DownOutlined, |
13 | + EditTwoTone, | ||
13 | EllipsisOutlined, | 14 | EllipsisOutlined, |
14 | } from '@ant-design/icons'; | 15 | } from '@ant-design/icons'; |
15 | import { | 16 | import { |
@@ -22,6 +23,7 @@ import { | @@ -22,6 +23,7 @@ import { | ||
22 | Avatar, | 23 | Avatar, |
23 | Button, | 24 | Button, |
24 | Checkbox, | 25 | Checkbox, |
26 | + Divider, | ||
25 | Dropdown, | 27 | Dropdown, |
26 | Flex, | 28 | Flex, |
27 | MenuProps, | 29 | MenuProps, |
@@ -181,32 +183,32 @@ const OrderPage = () => { | @@ -181,32 +183,32 @@ const OrderPage = () => { | ||
181 | {optRecord.productName} | 183 | {optRecord.productName} |
182 | </div> | 184 | </div> |
183 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 185 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
184 | - {optRecord.parameters} | 186 | + <span className="text-gray-500">参数:{optRecord.parameters}</span> |
185 | </div> | 187 | </div> |
186 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
187 | - {optRecord.notes} | ||
188 | - <Button | ||
189 | - type="dashed" | ||
190 | - size="small" | 188 | + <Flex title={optRecord.notes}> |
189 | + <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
190 | + <span className="text-gray-500">备注:{optRecord.notes}</span> | ||
191 | + </div> | ||
192 | + <EditTwoTone | ||
191 | onClick={() => { | 193 | onClick={() => { |
192 | setNotesEditVisible(true); | 194 | setNotesEditVisible(true); |
193 | setOrderRow(optRecord); | 195 | setOrderRow(optRecord); |
194 | setIsMainOrder(false); | 196 | setIsMainOrder(false); |
195 | }} | 197 | }} |
196 | - > | ||
197 | - 详情 | ||
198 | - </Button> | ||
199 | - </div> | 198 | + /> |
199 | + </Flex> | ||
200 | </Flex> | 200 | </Flex> |
201 | <Flex className="w-[16%]" vertical gap="small"> | 201 | <Flex className="w-[16%]" vertical gap="small"> |
202 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 202 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
203 | - 单价:¥{optRecord.productPrice} | 203 | + <span className="text-gray-500">单价:</span>¥ |
204 | + {optRecord.productPrice} | ||
204 | </div> | 205 | </div> |
205 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 206 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
206 | - 数量:x{optRecord.quantity} | 207 | + <span className="text-gray-500">数量:</span>x{optRecord.quantity} |
207 | </div> | 208 | </div> |
208 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 209 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
209 | - 合计:¥{optRecord.subOrderPayment} | 210 | + <span className="text-gray-500">合计:</span>¥ |
211 | + {optRecord.subOrderPayment} | ||
210 | </div> | 212 | </div> |
211 | </Flex> | 213 | </Flex> |
212 | <Flex className="w-[10%]" vertical gap="small"> | 214 | <Flex className="w-[10%]" vertical gap="small"> |
@@ -448,13 +450,6 @@ const OrderPage = () => { | @@ -448,13 +450,6 @@ const OrderPage = () => { | ||
448 | 450 | ||
449 | // 主订单内容渲染 | 451 | // 主订单内容渲染 |
450 | const MainOrderColumnRender = ({ record }: { record: OrderListItemType }) => { | 452 | const MainOrderColumnRender = ({ record }: { record: OrderListItemType }) => { |
451 | - // const handleExpand = (key: number) => { | ||
452 | - // const newExpandedRowKeys = expandedRowKeys.includes(key) | ||
453 | - // ? expandedRowKeys.filter((k) => k !== key) | ||
454 | - // : [...expandedRowKeys, key]; | ||
455 | - | ||
456 | - // setExpandedRowKeys(newExpandedRowKeys); | ||
457 | - // }; | ||
458 | return ( | 453 | return ( |
459 | <Flex vertical={true}> | 454 | <Flex vertical={true}> |
460 | {/* 编号、时间、销售信息 */} | 455 | {/* 编号、时间、销售信息 */} |
@@ -469,43 +464,56 @@ const OrderPage = () => { | @@ -469,43 +464,56 @@ const OrderPage = () => { | ||
469 | onChange={() => onCheckboxChange(record.id)} | 464 | onChange={() => onCheckboxChange(record.id)} |
470 | checked={selectedItems.includes(record.id)} | 465 | checked={selectedItems.includes(record.id)} |
471 | > | 466 | > |
467 | + <Space split={<Divider type="vertical" />}> | ||
468 | + <div> | ||
469 | + <span className="text-gray-500">订单号:</span> | ||
470 | + <span>{record.id}</span> | ||
471 | + </div> | ||
472 | + <span>{formatDateTime(record.createTime)}</span> | ||
473 | + </Space> | ||
474 | + </Checkbox> | ||
475 | + <Space split={<Divider type="vertical" />}> | ||
472 | <div> | 476 | <div> |
473 | - 订单号:{record.id} | ||
474 | - {' ' + formatDateTime(record.createTime)} | 477 | + <span className="text-gray-500">代表:</span> |
478 | + {record.salesCode} | ||
475 | </div> | 479 | </div> |
476 | - </Checkbox> | ||
477 | - <div>代表:{record.salesCode}</div> | ||
478 | - <span>单位:{record.institution}</span> | ||
479 | - <span>联系人:{record.institutionContactName}</span> | 480 | + <span> |
481 | + <span className="text-gray-500">单位:</span> | ||
482 | + {record.institution} | ||
483 | + </span> | ||
484 | + <span> | ||
485 | + <span className="text-gray-500">联系人:</span> | ||
486 | + {record.institutionContactName} | ||
487 | + </span> | ||
488 | + </Space> | ||
480 | </Flex> | 489 | </Flex> |
481 | </Flex> | 490 | </Flex> |
482 | <Flex className="pl-6" align="center"> | 491 | <Flex className="pl-6" align="center"> |
483 | - <div> | ||
484 | - 备注: | ||
485 | - <span className="ml-2">{record.notes}</span> | 492 | + <div title={record.notes}> |
493 | + <div className="max-w-md whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
494 | + <span className="text-gray-500">备注:</span> | ||
495 | + <span className="ml-2">{record.notes}</span> | ||
496 | + </div> | ||
486 | </div> | 497 | </div> |
487 | - <Button | ||
488 | - className="p-0" | ||
489 | - type="link" | 498 | + <EditTwoTone |
499 | + className="hover:curcor-pointer" | ||
490 | onClick={() => { | 500 | onClick={() => { |
491 | setNotesEditVisible(true); | 501 | setNotesEditVisible(true); |
492 | setOrderRow(record); | 502 | setOrderRow(record); |
493 | setIsMainOrder(true); | 503 | setIsMainOrder(true); |
494 | }} | 504 | }} |
495 | - > | ||
496 | - 备注 | ||
497 | - </Button> | 505 | + /> |
498 | </Flex> | 506 | </Flex> |
499 | </Flex> | 507 | </Flex> |
500 | <Flex wrap="wrap" gap="middle" vertical> | 508 | <Flex wrap="wrap" gap="middle" vertical> |
501 | <Flex justify="flex-end"> | 509 | <Flex justify="flex-end"> |
502 | <Flex wrap="wrap" gap="middle" align="center"> | 510 | <Flex wrap="wrap" gap="middle" align="center"> |
503 | <div> | 511 | <div> |
504 | - 总金额: | 512 | + <span>总金额:</span> |
505 | <span className="text-lg">{record.totalPayment}¥</span> | 513 | <span className="text-lg">{record.totalPayment}¥</span> |
506 | </div> | 514 | </div> |
507 | {rolePath?.includes('addOrder') ? ( | 515 | {rolePath?.includes('addOrder') ? ( |
508 | - <CopyOutlined | 516 | + <CopyTwoTone |
509 | className="hover:cursor-pointer" | 517 | className="hover:cursor-pointer" |
510 | onClick={() => { | 518 | onClick={() => { |
511 | setOrderOptType('copy'); | 519 | setOrderOptType('copy'); |
@@ -522,7 +530,7 @@ const OrderPage = () => { | @@ -522,7 +530,7 @@ const OrderPage = () => { | ||
522 | '' | 530 | '' |
523 | )} | 531 | )} |
524 | 532 | ||
525 | - <ClockCircleOutlined | 533 | + <ClockCircleTwoTone |
526 | className="hover:cursor-pointer" | 534 | className="hover:cursor-pointer" |
527 | onClick={() => { | 535 | onClick={() => { |
528 | setHistoryModalVisible(true); | 536 | setHistoryModalVisible(true); |
@@ -939,7 +947,7 @@ const OrderPage = () => { | @@ -939,7 +947,7 @@ const OrderPage = () => { | ||
939 | // expandable={{ expandedRowRender }} | 947 | // expandable={{ expandedRowRender }} |
940 | dateFormatter="string" | 948 | dateFormatter="string" |
941 | options={false} | 949 | options={false} |
942 | - headerTitle="订单列表" | 950 | + headerTitle="" |
943 | search={{ | 951 | search={{ |
944 | labelWidth: 'auto', | 952 | labelWidth: 'auto', |
945 | // onCollapse: resize, | 953 | // onCollapse: resize, |