Commit a948eae226a99dbc88b3ea38b3fd3fffbbd3c592

Authored by zhongnanhuang
1 parent 77954e9c

feat: update

src/pages/Order/components/HistoryModal.tsx
... ... @@ -54,7 +54,7 @@ export default ({ subOrders, onClose }) => {
54 54 <Row className="max-h-[500px] overflow-auto" gutter={[0, 14]}>
55 55 {data.map((item) => {
56 56 return (
57   - <Col span={24} key="key">
  57 + <Col span={24} key={i}>
58 58 <Flex vertical>
59 59 <div>
60 60 <span className="py-2 text-[#5E5E5E]">
... ... @@ -68,7 +68,7 @@ export default ({ subOrders, onClose }) =&gt; {
68 68 <Flex vertical>
69 69 {item.historySubOrderRecordDto?.map((history) => {
70 70 return (
71   - <div className="py-1" key="key">
  71 + <div className="py-1" key={history.id}>
72 72 <span className="pr-2 text-[#5E5E5E]">
73 73 {formatDateTime(history.createTime)}
74 74 </span>
... ...
src/pages/Order/components/OrderDrawer.tsx
... ... @@ -276,6 +276,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
276 276 >
277 277 <h2>订单基本信息</h2>
278 278 <ProFormText
  279 + key="id"
279 280 name="id"
280 281 width="lg"
281 282 disabled
... ... @@ -285,6 +286,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
285 286 />
286 287 <ProFormSelect
287 288 name="salesCode"
  289 + key="salesCode"
288 290 width="lg"
289 291 showSearch
290 292 label="销售代表"
... ... @@ -294,7 +296,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
294 296 // disabled={mainInfoDisbled}
295 297 />
296 298 <ProFormSelect
297   - key="key"
  299 + key="customerName"
298 300 label="收货人"
299 301 width="lg"
300 302 showSearch
... ... @@ -389,6 +391,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
389 391 />
390 392 <ProFormText
391 393 width="lg"
  394 + key="customerContactNumber"
392 395 name="customerContactNumber"
393 396 label="联系方式"
394 397 placeholder="请输入联系方式"
... ... @@ -397,6 +400,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
397 400 />
398 401 <ProFormText
399 402 width="lg"
  403 + key="institution"
400 404 name="institution"
401 405 label="单位"
402 406 placeholder="请输入单位"
... ... @@ -405,6 +409,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
405 409 />
406 410 <ProFormText
407 411 width="lg"
  412 + key="institutionContactName"
408 413 name="institutionContactName"
409 414 label="单位联系人"
410 415 placeholder="请输入单位联系人"
... ... @@ -413,6 +418,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
413 418 />
414 419 <ProFormTextArea
415 420 width="lg"
  421 + key="customerShippingAddress"
416 422 name="customerShippingAddress"
417 423 label="收货地址"
418 424 placeholder="请输入收货地址"
... ... @@ -423,6 +429,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
423 429 <ProFormDigit
424 430 name="totalPayment"
425 431 width="lg"
  432 + key="totalPayment"
426 433 label="支付总额(¥)"
427 434 rules={[{ required: true, message: '支付总额必填' }]}
428 435 tooltip="点击计算,合计所有子订单金额"
... ... @@ -445,6 +452,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
445 452 placeholder="请输入支付渠道"
446 453 name="paymentChannel"
447 454 width="lg"
  455 + key="paymentChannel"
448 456 label="支付渠道"
449 457 options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
450 458 rules={[{ required: true, message: '支付渠道必填' }]}
... ... @@ -454,6 +462,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
454 462 placeholder="请输入支付方式"
455 463 name="paymentMethod"
456 464 width="lg"
  465 + key="paymentMethod"
457 466 label="支付方式"
458 467 options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
459 468 rules={[{ required: true, message: '支付方式必填' }]}
... ... @@ -463,6 +472,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
463 472 placeholder="选择是否需要开票"
464 473 name="invoicingStatus"
465 474 width="lg"
  475 + key="invoicingStatus"
466 476 label="是否需要开票"
467 477 options={getInvoicingSelect()}
468 478 // disabled={mainInfoDisbled}
... ... @@ -480,6 +490,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
480 490 width="lg"
481 491 name="invoiceIdentificationNumber"
482 492 label="开票信息"
  493 + key="invoiceIdentificationNumber"
483 494 // disabled={mainInfoDisbled}
484 495 hidden={invoicingStatus === 'UN_INVOICE'}
485 496 placeholder="请输入开票信息"
... ... @@ -494,6 +505,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
494 505 {getUserInfo().roleSmallVO?.code === 'admin' ? (
495 506 <ProFormDateTimePicker
496 507 width="lg"
  508 + key="invoicingTime"
497 509 name="invoicingTime"
498 510 // disabled={mainInfoDisbled}
499 511 hidden={invoicingStatus === 'UN_INVOICE'}
... ... @@ -506,6 +518,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
506 518 <ProFormText
507 519 width="lg"
508 520 name="bank"
  521 + key="bank"
509 522 label="开户银行"
510 523 // disabled={mainInfoDisbled}
511 524 hidden={invoicingStatus === 'UN_INVOICE'}
... ... @@ -513,6 +526,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
513 526 />
514 527 <ProFormText
515 528 width="lg"
  529 + key="bankAccountNumber"
516 530 name="bankAccountNumber"
517 531 hidden={invoicingStatus === 'UN_INVOICE'}
518 532 label="银行账号"
... ... @@ -523,6 +537,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
523 537 width="lg"
524 538 name="notes"
525 539 label="备注"
  540 + key="notes"
526 541 // disabled={mainInfoDisbled}
527 542 placeholder="请输入备注"
528 543 rules={[
... ... @@ -668,7 +683,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
668 683 }}
669 684 />,
670 685 <ProFormText
671   - key="productCode"
  686 + key={'productCode' + listMeta.index}
672 687 width="lg"
673 688 name="productCode"
674 689 disabled
... ... @@ -683,7 +698,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
683 698 placeholder="未输入商品名称"
684 699 />,
685 700 <ProFormText
686   - key="parameters"
  701 + key={'parameters' + listMeta.index}
687 702 width="lg"
688 703 name="parameters"
689 704 label="商品参数"
... ... @@ -691,7 +706,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
691 706 rules={[{ required: true, message: '商品参数必填' }]}
692 707 />,
693 708 <ProFormDigit
694   - key="quantity"
  709 + key={'quantity' + listMeta.index}
695 710 width="lg"
696 711 name="quantity"
697 712 label="商品数量"
... ... @@ -705,7 +720,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
705 720 rules={[{ required: true, message: '商品数量必填' }]}
706 721 />,
707 722 <ProFormDigit
708   - key="productPrice"
  723 + key={'productPrice' + listMeta.index}
709 724 width="lg"
710 725 name="productPrice"
711 726 label="商品单价"
... ... @@ -719,7 +734,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
719 734 rules={[{ required: true, message: '商品单价必填' }]}
720 735 />,
721 736 <ProFormText
722   - key="unit"
  737 + key={'unit' + listMeta.index}
723 738 width="lg"
724 739 name="unit"
725 740 label="商品单位"
... ... @@ -729,7 +744,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
729 744  
730 745 <ProFormDigit
731 746 width="lg"
732   - key="subOrderPayment"
  747 + key={'subOrderPayment' + listMeta.index}
733 748 name="subOrderPayment"
734 749 label="子订单金额"
735 750 placeholder="请输入子订单金额"
... ... @@ -737,7 +752,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
737 752 rules={[{ required: true, message: '子订单金额必填' }]}
738 753 />,
739 754 <ProFormSelect
740   - key="productBelongBusiness"
  755 + key={'productBelongBusiness' + listMeta.index}
741 756 placeholder="请输入所属事业部"
742 757 name="productBelongBusiness"
743 758 width="lg"
... ... @@ -748,7 +763,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
748 763 // disabled={mainInfoDisbled}
749 764 />,
750 765 <ProFormText
751   - key="notes"
  766 + key={'notes' + listMeta.index}
752 767 width="lg"
753 768 name="notes"
754 769 label="备注"
... ... @@ -762,7 +777,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
762 777 />,
763 778 <>
764 779 <ProFormUploadDragger
765   - key="filePaths"
  780 + key={'filePaths' + listMeta.index}
766 781 label="附件"
767 782 name="filePaths"
768 783 action="/api/service/order/fileProcess"
... ...
src/pages/Order/index.less
... ... @@ -91,3 +91,8 @@
91 91 border-bottom: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */
92 92 border-right: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */
93 93 }
  94 +
  95 +//tooltip字体颜色自定义
  96 +// .order-tooltip .ant-tooltip-inner{
  97 +// color: black !important;
  98 +// }
... ...
src/pages/Order/index.tsx
... ... @@ -608,10 +608,13 @@ const OrderPage = () =&gt; {
608 608 <span className="text-[#8C8C8C]">代表:</span>
609 609 <span className="text-slate-700">{record.salesCode}</span>
610 610 </div>
611   - <span>
  611 + <div
  612 + title={record.institution}
  613 + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[256px]"
  614 + >
612 615 <span className="text-[#8C8C8C]">单位:</span>
613 616 <span className="text-slate-700">{record.institution}</span>
614   - </span>
  617 + </div>
615 618 <span>
616 619 <span className="text-[#8C8C8C]">联系人:</span>
617 620 <span className="text-slate-700">
... ... @@ -622,13 +625,15 @@ const OrderPage = () =&gt; {
622 625 <span className="text-[#8C8C8C]">收货人:</span>
623 626 <span className="text-slate-700">
624 627 {record.customerName + ' '}
625   - <ContainerTwoTone
626   - className="hover:curcor-pointer"
627   - onClick={() => {
628   - setDeliverInfoDrawerVisible(true);
629   - setOrderRow(record);
630   - }}
631   - />
  628 + <Tooltip className="order-tooltip" title="详情">
  629 + <ContainerTwoTone
  630 + className="hover:curcor-pointer"
  631 + onClick={() => {
  632 + setDeliverInfoDrawerVisible(true);
  633 + setOrderRow(record);
  634 + }}
  635 + />
  636 + </Tooltip>
632 637 </span>
633 638 </span>
634 639 </Space>
... ... @@ -643,14 +648,16 @@ const OrderPage = () =&gt; {
643 648 </span>
644 649 </div>
645 650 </div>
646   - <EditTwoTone
647   - className="hover:curcor-pointer"
648   - onClick={() => {
649   - setNotesEditVisible(true);
650   - setOrderRow(record);
651   - setIsMainOrder(true);
652   - }}
653   - />
  651 + <Tooltip title="编辑">
  652 + <EditTwoTone
  653 + className="hover:curcor-pointer"
  654 + onClick={() => {
  655 + setNotesEditVisible(true);
  656 + setOrderRow(record);
  657 + setIsMainOrder(true);
  658 + }}
  659 + />
  660 + </Tooltip>
654 661 </Flex>
655 662 </Flex>
656 663 <Flex wrap="wrap" gap="middle" vertical>
... ... @@ -663,34 +670,38 @@ const OrderPage = () =&gt; {
663 670 </span>
664 671 </div>
665 672 {rolePath?.includes('addOrder') ? (
666   - <CopyTwoTone
667   - className="hover:cursor-pointer"
668   - onClick={() => {
669   - setOrderOptType('copy');
670   - setOrderDrawerVisible(true);
671   - let copy = cloneDeep(record);
672   - copy.id = undefined;
673   - copy.subOrderInformationLists?.forEach((item) => {
674   - item.id = undefined;
675   - });
676   - setOrderRow(copy);
677   - }}
678   - />
  673 + <Tooltip title="复制">
  674 + <CopyTwoTone
  675 + className="hover:cursor-pointer"
  676 + onClick={() => {
  677 + setOrderOptType('copy');
  678 + setOrderDrawerVisible(true);
  679 + let copy = cloneDeep(record);
  680 + copy.id = undefined;
  681 + copy.subOrderInformationLists?.forEach((item) => {
  682 + item.id = undefined;
  683 + });
  684 + setOrderRow(copy);
  685 + }}
  686 + />
  687 + </Tooltip>
679 688 ) : (
680 689 ''
681 690 )}
682 691  
683   - <ClockCircleTwoTone
684   - className="hover:cursor-pointer"
685   - onClick={() => {
686   - setHistoryModalVisible(true);
687   - if (selectedRowObj[record.id]?.length) {
688   - setSelectedRows(selectedRowObj[record.id]);
689   - } else {
690   - setSelectedRows(record.subOrderInformationLists);
691   - }
692   - }}
693   - />
  692 + <Tooltip title="历史">
  693 + <ClockCircleTwoTone
  694 + className="hover:cursor-pointer"
  695 + onClick={() => {
  696 + setHistoryModalVisible(true);
  697 + if (selectedRowObj[record.id]?.length) {
  698 + setSelectedRows(selectedRowObj[record.id]);
  699 + } else {
  700 + setSelectedRows(record.subOrderInformationLists);
  701 + }
  702 + }}
  703 + />
  704 + </Tooltip>
694 705 </Flex>
695 706 </Flex>
696 707 <Flex justify="flex-end">
... ...