Commit 8efee6b5ad8cbc65f0571eacedc7a1cde022067d

Authored by PurelzMgnead
1 parent 4e3604e2

feat: 改进分期账单的显示

src/pages/Instalment/components/title/titletest.tsx
@@ -7,7 +7,7 @@ import { orderExport } from '@/services/order'; @@ -7,7 +7,7 @@ import { orderExport } from '@/services/order';
7 import { VerticalAlignTopOutlined } from '@ant-design/icons'; 7 import { VerticalAlignTopOutlined } from '@ant-design/icons';
8 import type { ProColumns } from '@ant-design/pro-components'; 8 import type { ProColumns } from '@ant-design/pro-components';
9 import { EditableProTable } from '@ant-design/pro-components'; 9 import { EditableProTable } from '@ant-design/pro-components';
10 -import { Button, Tag, message } from 'antd'; 10 +import { Badge, Button, Tag, message } from 'antd';
11 import { useRef } from 'react'; 11 import { useRef } from 'react';
12 import CheckModal from '../checkModal/checkModal'; 12 import CheckModal from '../checkModal/checkModal';
13 import Comfire from '../comfire/comfire'; 13 import Comfire from '../comfire/comfire';
@@ -67,7 +67,8 @@ type OrderStagesItem = { @@ -67,7 +67,8 @@ type OrderStagesItem = {
67 //审核备注 67 //审核备注
68 statusMark?: string; 68 statusMark?: string;
69 //子类 69 //子类
70 - children?: OrderStagesItem[]; 70 + // children?: OrderStagesItem[];
  71 + orderStagesDeviceVoList: orderStagesDevice[];
71 }; 72 };
72 73
73 type OrderStagesWithListItem = { 74 type OrderStagesWithListItem = {
@@ -206,13 +207,31 @@ export default () => { @@ -206,13 +207,31 @@ export default () => {
206 disable: true, 207 disable: true,
207 onFilter: true, 208 onFilter: true,
208 ellipsis: true, 209 ellipsis: true,
209 - // render: (_, record) => {  
210 - // if (record.id) {  
211 - // const text = record?.id.toString();  
212 - // const paddedText = '0'.repeat(4 - text.length) + text;  
213 - // return paddedText;  
214 - // }  
215 - // }, 210 + // align: 'center',
  211 + render: (_, record) => {
  212 + if (record?.id) {
  213 + const text = record?.id?.toString();
  214 + const paddedText = '0'.repeat(4 - text.length) + text;
  215 + return (
  216 + <>
  217 + {paddedText}
  218 + {record?.orderStagesDeviceVoList?.length > 1 && (
  219 + <>
  220 + <Badge
  221 + count={record?.orderStagesDeviceVoList?.length}
  222 + style={{
  223 + marginBlockStart: -2,
  224 + marginInlineStart: 4,
  225 + color: '#1890FF',
  226 + backgroundColor: '#E6F7FF',
  227 + }}
  228 + />
  229 + </>
  230 + )}
  231 + </>
  232 + );
  233 + }
  234 + },
216 }, 235 },
217 { 236 {
218 title: '签合同日期', 237 title: '签合同日期',
@@ -277,7 +296,7 @@ export default () =&gt; { @@ -277,7 +296,7 @@ export default () =&gt; {
277 return <Tag color="red">审核未通过</Tag>; 296 return <Tag color="red">审核未通过</Tag>;
278 } 297 }
279 } 298 }
280 - return <Tag color="orange">暂无状态</Tag>; 299 + // return <Tag color="orange">暂无状态</Tag>;
281 }, 300 },
282 }, 301 },
283 { 302 {
@@ -287,6 +306,8 @@ export default () =&gt; { @@ -287,6 +306,8 @@ export default () =&gt; {
287 disable: true, 306 disable: true,
288 onFilter: true, 307 onFilter: true,
289 ellipsis: true, 308 ellipsis: true,
  309 + hideInTable: true,
  310 + hideInSearch: true,
290 }, 311 },
291 { 312 {
292 title: '设备型号', 313 title: '设备型号',
@@ -296,6 +317,7 @@ export default () =&gt; { @@ -296,6 +317,7 @@ export default () =&gt; {
296 disable: true, 317 disable: true,
297 onFilter: true, 318 onFilter: true,
298 ellipsis: true, 319 ellipsis: true,
  320 + hideInTable: true,
299 }, 321 },
300 { 322 {
301 title: '数量', 323 title: '数量',
@@ -305,6 +327,7 @@ export default () =&gt; { @@ -305,6 +327,7 @@ export default () =&gt; {
305 disable: true, 327 disable: true,
306 onFilter: true, 328 onFilter: true,
307 ellipsis: true, 329 ellipsis: true,
  330 + hideInTable: true,
308 }, 331 },
309 { 332 {
310 title: '单价', 333 title: '单价',
@@ -314,6 +337,7 @@ export default () =&gt; { @@ -314,6 +337,7 @@ export default () =&gt; {
314 disable: true, 337 disable: true,
315 onFilter: true, 338 onFilter: true,
316 ellipsis: true, 339 ellipsis: true,
  340 + hideInTable: true,
317 }, 341 },
318 { 342 {
319 title: '总价', 343 title: '总价',
@@ -323,6 +347,7 @@ export default () =&gt; { @@ -323,6 +347,7 @@ export default () =&gt; {
323 disable: true, 347 disable: true,
324 onFilter: true, 348 onFilter: true,
325 ellipsis: true, 349 ellipsis: true,
  350 + hideInTable: true,
326 }, 351 },
327 { 352 {
328 title: '合同总金额', 353 title: '合同总金额',
@@ -456,6 +481,27 @@ export default () =&gt; { @@ -456,6 +481,27 @@ export default () =&gt; {
456 scroll={{ x: 1400, y: 360 }} 481 scroll={{ x: 1400, y: 360 }}
457 recordCreatorProps={false} 482 recordCreatorProps={false}
458 request={async (params) => { 483 request={async (params) => {
  484 + if (params.id === '') {
  485 + params.id = null;
  486 + }
  487 + if (params.contract === '') {
  488 + params.contract = null;
  489 + }
  490 + if (params.vendor === '') {
  491 + params.vendor = null;
  492 + }
  493 + if (params.terminal === '') {
  494 + params.terminal = null;
  495 + }
  496 + if (params.deviceName === '') {
  497 + params.deviceName = null;
  498 + }
  499 + if (params.dateRange === '') {
  500 + params.dateRange = null;
  501 + }
  502 + if (params.status === '') {
  503 + params.status = null;
  504 + }
459 if ( 505 if (
460 params.id !== null || 506 params.id !== null ||
461 params.contract !== null || 507 params.contract !== null ||
@@ -507,6 +553,7 @@ export default () =&gt; { @@ -507,6 +553,7 @@ export default () =&gt; {
507 opt: undefined, 553 opt: undefined,
508 status: undefined, 554 status: undefined,
509 statusMark: undefined, 555 statusMark: undefined,
  556 + orderStagesDeviceVoList: [],
510 }; 557 };
511 if (index === 0) { 558 if (index === 0) {
512 item.id = orderStagesWithList[ind].id; 559 item.id = orderStagesWithList[ind].id;
@@ -544,68 +591,72 @@ export default () =&gt; { @@ -544,68 +591,72 @@ export default () =&gt; {
544 item.remark = orderStagesWithList[ind].remark; 591 item.remark = orderStagesWithList[ind].remark;
545 item.status = orderStagesWithList[ind].status; 592 item.status = orderStagesWithList[ind].status;
546 item.statusMark = orderStagesWithList[ind].statusMark; 593 item.statusMark = orderStagesWithList[ind].statusMark;
  594 + item.orderStagesDeviceVoList =
  595 + orderStagesWithList[ind].orderStagesDeviceVoList;
  596 + // item.children = [];
547 if (orderStagesWithList[ind].paths) { 597 if (orderStagesWithList[ind].paths) {
548 item.opt = [...orderStagesWithList[ind].paths]; 598 item.opt = [...orderStagesWithList[ind].paths];
549 if (orderStagesWithList[ind]?.paths?.includes('READ')) { 599 if (orderStagesWithList[ind]?.paths?.includes('READ')) {
550 item.opt.push('ONLYREAD'); 600 item.opt.push('ONLYREAD');
551 } 601 }
552 } 602 }
553 - item.children = [];  
554 - if (  
555 - orderStagesWithList[ind].orderStagesDeviceVoList.length <=  
556 - 1  
557 - ) {  
558 - delete item.children;  
559 - } 603 + // item.children = [];
  604 + // if (
  605 + // orderStagesWithList[ind].orderStagesDeviceVoList.length <=
  606 + // 1
  607 + // ) {
  608 + // delete item.children;
  609 + // }
560 orderStagesList.push(item); 610 orderStagesList.push(item);
561 - } else {  
562 - item.id = orderStagesWithList[ind].id;  
563 - item.contract = orderStagesWithList[ind].contract;  
564 - item.vendor = orderStagesWithList[ind].vendor;  
565 - item.dateRange = orderStagesWithList[ind].dateRange;  
566 - item.terminal = orderStagesWithList[ind].terminal;  
567 - item.dId =  
568 - orderStagesWithList[ind].orderStagesDeviceVoList[  
569 - index  
570 - ].dId;  
571 - item.deviceName =  
572 - orderStagesWithList[ind].orderStagesDeviceVoList[  
573 - index  
574 - ].deviceName;  
575 - item.deviceModel =  
576 - orderStagesWithList[ind].orderStagesDeviceVoList[  
577 - index  
578 - ].deviceModel;  
579 - item.count =  
580 - orderStagesWithList[ind].orderStagesDeviceVoList[  
581 - index  
582 - ].count;  
583 - item.unitPrice =  
584 - orderStagesWithList[ind].orderStagesDeviceVoList[  
585 - index  
586 - ].unitPrice;  
587 - item.price =  
588 - orderStagesWithList[ind].orderStagesDeviceVoList[  
589 - index  
590 - ].price;  
591 - item.totalPrice = orderStagesWithList[ind].totalPrice;  
592 - item.payWay = orderStagesWithList[ind].payWay;  
593 - item.annex = orderStagesWithList[ind].annex;  
594 - item.remark = orderStagesWithList[ind].remark;  
595 - if (orderStagesWithList[ind].paths) {  
596 - if (orderStagesList[ind]?.opt?.includes('READ')) {  
597 - item.opt = ['ONLYREAD'];  
598 - }  
599 - }  
600 - item.status = orderStagesWithList[ind].status;  
601 - item.statusMark = orderStagesWithList[ind].statusMark;  
602 - if (  
603 - orderStagesWithList[ind].orderStagesDeviceVoList.length >  
604 - 1  
605 - ) {  
606 - orderStagesList[ind].children?.push(item);  
607 - }  
608 } 611 }
  612 + // else {
  613 + // item.id = orderStagesWithList[ind].id;
  614 + // item.contract = orderStagesWithList[ind].contract;
  615 + // item.vendor = orderStagesWithList[ind].vendor;
  616 + // item.dateRange = orderStagesWithList[ind].dateRange;
  617 + // item.terminal = orderStagesWithList[ind].terminal;
  618 + // item.dId =
  619 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  620 + // index
  621 + // ].dId;
  622 + // item.deviceName =
  623 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  624 + // index
  625 + // ].deviceName;
  626 + // item.deviceModel =
  627 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  628 + // index
  629 + // ].deviceModel;
  630 + // item.count =
  631 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  632 + // index
  633 + // ].count;
  634 + // item.unitPrice =
  635 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  636 + // index
  637 + // ].unitPrice;
  638 + // item.price =
  639 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  640 + // index
  641 + // ].price;
  642 + // item.totalPrice = orderStagesWithList[ind].totalPrice;
  643 + // item.payWay = orderStagesWithList[ind].payWay;
  644 + // item.annex = orderStagesWithList[ind].annex;
  645 + // item.remark = orderStagesWithList[ind].remark;
  646 + // if (orderStagesWithList[ind].paths) {
  647 + // if (orderStagesList[ind]?.opt?.includes('READ')) {
  648 + // item.opt = ['ONLYREAD'];
  649 + // }
  650 + // }
  651 + // item.status = orderStagesWithList[ind].status;
  652 + // item.statusMark = orderStagesWithList[ind].statusMark;
  653 + // if (
  654 + // orderStagesWithList[ind].orderStagesDeviceVoList.length >
  655 + // 1
  656 + // ) {
  657 + // orderStagesList[ind].children?.push(item);
  658 + // }
  659 + // }
609 } 660 }
610 } 661 }
611 return { 662 return {
@@ -642,9 +693,10 @@ export default () =&gt; { @@ -642,9 +693,10 @@ export default () =&gt; {
642 annex: undefined, 693 annex: undefined,
643 remark: undefined, 694 remark: undefined,
644 opt: undefined, 695 opt: undefined,
645 - children: undefined, 696 + // children: undefined,
646 status: undefined, 697 status: undefined,
647 statusMark: undefined, 698 statusMark: undefined,
  699 + orderStagesDeviceVoList: [],
648 }; 700 };
649 if (index === 0) { 701 if (index === 0) {
650 item.id = orderStagesWithList[ind].id; 702 item.id = orderStagesWithList[ind].id;
@@ -683,67 +735,70 @@ export default () =&gt; { @@ -683,67 +735,70 @@ export default () =&gt; {
683 item.opt = orderStagesWithList[ind].paths; 735 item.opt = orderStagesWithList[ind].paths;
684 item.status = orderStagesWithList[ind].status; 736 item.status = orderStagesWithList[ind].status;
685 item.statusMark = orderStagesWithList[ind].statusMark; 737 item.statusMark = orderStagesWithList[ind].statusMark;
  738 + item.orderStagesDeviceVoList =
  739 + orderStagesWithList[ind].orderStagesDeviceVoList;
686 if (orderStagesWithList[ind].paths) { 740 if (orderStagesWithList[ind].paths) {
687 item.opt = [...orderStagesWithList[ind].paths]; 741 item.opt = [...orderStagesWithList[ind].paths];
688 if (orderStagesWithList[ind]?.paths?.includes('READ')) { 742 if (orderStagesWithList[ind]?.paths?.includes('READ')) {
689 item.opt.push('ONLYREAD'); 743 item.opt.push('ONLYREAD');
690 } 744 }
691 } 745 }
692 - if (  
693 - orderStagesWithList[ind].orderStagesDeviceVoList.length <=  
694 - 1  
695 - ) {  
696 - delete item.children;  
697 - } 746 + // if (
  747 + // orderStagesWithList[ind].orderStagesDeviceVoList.length <=
  748 + // 1
  749 + // ) {
  750 + // delete item.children;
  751 + // }
698 orderStagesList.push(item); 752 orderStagesList.push(item);
699 - } else {  
700 - item.id = orderStagesWithList[ind].id;  
701 - item.contract = orderStagesWithList[ind].contract;  
702 - item.vendor = orderStagesWithList[ind].vendor;  
703 - item.dateRange = orderStagesWithList[ind].dateRange;  
704 - item.terminal = orderStagesWithList[ind].terminal;  
705 - item.dId =  
706 - orderStagesWithList[ind].orderStagesDeviceVoList[  
707 - index  
708 - ].dId;  
709 - item.deviceName =  
710 - orderStagesWithList[ind].orderStagesDeviceVoList[  
711 - index  
712 - ].deviceName;  
713 - item.deviceModel =  
714 - orderStagesWithList[ind].orderStagesDeviceVoList[  
715 - index  
716 - ].deviceModel;  
717 - item.count =  
718 - orderStagesWithList[ind].orderStagesDeviceVoList[  
719 - index  
720 - ].count;  
721 - item.unitPrice =  
722 - orderStagesWithList[ind].orderStagesDeviceVoList[  
723 - index  
724 - ].unitPrice;  
725 - item.price =  
726 - orderStagesWithList[ind].orderStagesDeviceVoList[  
727 - index  
728 - ].price;  
729 - item.totalPrice = orderStagesWithList[ind].totalPrice;  
730 - item.payWay = orderStagesWithList[ind].payWay;  
731 - item.annex = orderStagesWithList[ind].annex;  
732 - item.remark = orderStagesWithList[ind].remark;  
733 - if (orderStagesWithList[ind].paths) {  
734 - if (orderStagesList[ind]?.opt?.includes('READ')) {  
735 - item.opt = ['ONLYREAD'];  
736 - }  
737 - }  
738 - item.status = orderStagesWithList[ind].status;  
739 - item.statusMark = orderStagesWithList[ind].statusMark;  
740 - if (  
741 - orderStagesWithList[ind].orderStagesDeviceVoList.length >  
742 - 1  
743 - ) {  
744 - orderStagesList[ind].children?.push(item);  
745 - }  
746 } 753 }
  754 + // else {
  755 + // item.id = orderStagesWithList[ind].id;
  756 + // item.contract = orderStagesWithList[ind].contract;
  757 + // item.vendor = orderStagesWithList[ind].vendor;
  758 + // item.dateRange = orderStagesWithList[ind].dateRange;
  759 + // item.terminal = orderStagesWithList[ind].terminal;
  760 + // item.dId =
  761 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  762 + // index
  763 + // ].dId;
  764 + // item.deviceName =
  765 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  766 + // index
  767 + // ].deviceName;
  768 + // item.deviceModel =
  769 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  770 + // index
  771 + // ].deviceModel;
  772 + // item.count =
  773 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  774 + // index
  775 + // ].count;
  776 + // item.unitPrice =
  777 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  778 + // index
  779 + // ].unitPrice;
  780 + // item.price =
  781 + // orderStagesWithList[ind].orderStagesDeviceVoList[
  782 + // index
  783 + // ].price;
  784 + // item.totalPrice = orderStagesWithList[ind].totalPrice;
  785 + // item.payWay = orderStagesWithList[ind].payWay;
  786 + // item.annex = orderStagesWithList[ind].annex;
  787 + // item.remark = orderStagesWithList[ind].remark;
  788 + // if (orderStagesWithList[ind].paths) {
  789 + // if (orderStagesList[ind]?.opt?.includes('READ')) {
  790 + // item.opt = ['ONLYREAD'];
  791 + // }
  792 + // }
  793 + // item.status = orderStagesWithList[ind].status;
  794 + // item.statusMark = orderStagesWithList[ind].statusMark;
  795 + // if (
  796 + // orderStagesWithList[ind].orderStagesDeviceVoList.length >
  797 + // 1
  798 + // ) {
  799 + // orderStagesList[ind].children?.push(item);
  800 + // }
  801 + // }
747 } 802 }
748 } 803 }
749 return { 804 return {