Commit a45593e06b460ca04c8f961fc89535b8ac4609d7
1 parent
ca07bc32
feat: 开票查询
Showing
3 changed files
with
1585 additions
and
1530 deletions
src/pages/Order/FeedBack/constant.ts
... | ... | @@ -251,13 +251,8 @@ export const FINANCIAL_STATUS_OPTIONS = { |
251 | 251 | export const AFTER_INVOICING_STATUS = { |
252 | 252 | NOT_YET_INVOICED: '尚未开票', |
253 | 253 | APPLY_FOR_INVOICING: '申请开票', |
254 | - URGENT_INVOICE_AUDITING: '加急待审核', | |
255 | - URGENT_INVOICE_AUDIT_NOTPASS: '加急审核失败', | |
256 | 254 | PARTIAL_INVOICING: '部分开票', |
257 | 255 | COMPLETE_INVOICING: '完全开票', |
258 | - INVOICING: '开票中', | |
259 | - REISSUE: '重新开票', | |
260 | - UN_INVOICE: '不需开票', | |
261 | 256 | }; |
262 | 257 | |
263 | 258 | export const TAGS_COLOR = new Map<string, string>([ | ... | ... |
src/pages/Order/OrderList/OrderList.tsx
... | ... | @@ -2556,1518 +2556,1565 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { |
2556 | 2556 | ); |
2557 | 2557 | }; |
2558 | 2558 | |
2559 | + // 检查主订单是否包含待冲红的子订单 | |
2560 | + const hasWaitFlushSubOrder = (record: OrderListItemType): boolean => { | |
2561 | + return ( | |
2562 | + record.subOrderInformationLists?.some( | |
2563 | + (subOrder: any) => subOrder.afterInvoicingStatus === 'WAIT_FLUSH', | |
2564 | + ) || false | |
2565 | + ); | |
2566 | + }; | |
2567 | + | |
2559 | 2568 | // 主订单内容渲染 |
2560 | 2569 | const MainOrderColumnRender = ({ record }: { record: OrderListItemType }) => { |
2570 | + const showWaitFlushBadge = hasWaitFlushSubOrder(record); | |
2571 | + | |
2561 | 2572 | return ( |
2562 | - <Flex vertical={true}> | |
2563 | - {/* 编号、时间、销售信息 */} | |
2564 | - <Flex | |
2565 | - className="px-4 py-4 bg-white rounded-t-lg" | |
2566 | - justify="space-between" | |
2567 | - > | |
2568 | - <Flex wrap="wrap" gap="middle" vertical> | |
2569 | - <Flex> | |
2573 | + <div style={{ position: 'relative', overflow: 'visible' }}> | |
2574 | + {showWaitFlushBadge && ( | |
2575 | + <div | |
2576 | + style={{ | |
2577 | + position: 'absolute', | |
2578 | + top: 4, | |
2579 | + left: 4, | |
2580 | + zIndex: 10, | |
2581 | + backgroundColor: 'rgba(255, 255, 255, 0.85)', | |
2582 | + color: '#ff4d4f', | |
2583 | + border: '1px solid #ff4d4f', | |
2584 | + borderRadius: '20px', | |
2585 | + fontSize: '24px', | |
2586 | + fontWeight: 'normal', | |
2587 | + padding: '8px 16px', | |
2588 | + height: 'auto', | |
2589 | + minWidth: 'auto', | |
2590 | + lineHeight: '32px', | |
2591 | + whiteSpace: 'nowrap', | |
2592 | + pointerEvents: 'none', | |
2593 | + boxShadow: '0 2px 8px rgba(255, 77, 79, 0.15)', | |
2594 | + }} | |
2595 | + > | |
2596 | + 待冲红 | |
2597 | + </div> | |
2598 | + )} | |
2599 | + <Flex vertical={true}> | |
2600 | + {/* 编号、时间、销售信息 */} | |
2601 | + <Flex | |
2602 | + className="px-4 py-4 bg-white rounded-t-lg" | |
2603 | + justify="space-between" | |
2604 | + > | |
2605 | + <Flex wrap="wrap" gap="middle" vertical> | |
2570 | 2606 | <Flex> |
2571 | - <Checkbox | |
2572 | - onChange={() => onCheckboxChange(record)} | |
2573 | - checked={selectedMainOrderKeys.includes(record.id)} | |
2574 | - > | |
2575 | - <Space split={<Divider type="vertical" />}> | |
2576 | - <div> | |
2577 | - <span className="text-[#8C8C8C]">订单号:</span> | |
2578 | - <span className="text-slate-700">{record.id}</span> | |
2579 | - {record.modified ? ( | |
2580 | - <Tooltip title="点击查看详情"> | |
2581 | - <span | |
2582 | - className="text-[#f44e4e] cursor-pointer" | |
2583 | - onClick={async () => { | |
2584 | - createOptObject(null, record.id); | |
2585 | - setModifiedDiffModalVisible(true); | |
2586 | - }} | |
2587 | - > | |
2588 | - (修改过) | |
2589 | - </span> | |
2590 | - </Tooltip> | |
2591 | - ) : ( | |
2592 | - '' | |
2593 | - )} | |
2594 | - </div> | |
2595 | - </Space> | |
2596 | - </Checkbox> | |
2597 | - <Tooltip title="点击复制订单号"> | |
2598 | - <CopyOutlined | |
2599 | - className="hover:cursor-pointer" | |
2600 | - style={{ color: '#8C8C8C' }} | |
2601 | - onClick={() => { | |
2602 | - copyToClipboard(record.id); | |
2603 | - message.info('订单号复制成功!'); | |
2604 | - }} | |
2605 | - /> | |
2606 | - </Tooltip> | |
2607 | - <Divider type="vertical" /> | |
2608 | - <span>{formatDateTime(record.createTime)}</span> | |
2609 | - <Divider type="vertical" /> | |
2610 | - <Space split={<Divider type="vertical" />}> | |
2611 | - <div | |
2612 | - className="hover:cursor-pointer" | |
2613 | - onClick={() => { | |
2614 | - copyToClipboard(record.salesCode); | |
2615 | - message.info('代表复制成功:' + record.salesCode); | |
2616 | - }} | |
2607 | + <Flex> | |
2608 | + <Checkbox | |
2609 | + onChange={() => onCheckboxChange(record)} | |
2610 | + checked={selectedMainOrderKeys.includes(record.id)} | |
2617 | 2611 | > |
2618 | - <span className="text-[#8C8C8C]">代表:</span> | |
2619 | - <span className="text-slate-700">{record.salesCode}</span> | |
2620 | - </div> | |
2621 | - {!isSupplier() ? ( | |
2622 | - <> | |
2623 | - <div | |
2624 | - title={record.institution} | |
2625 | - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
2626 | - > | |
2627 | - <span className="text-[#8C8C8C]">单位:</span> | |
2628 | - <span className="text-slate-700"> | |
2629 | - {record.institution} | |
2630 | - </span> | |
2612 | + <Space split={<Divider type="vertical" />}> | |
2613 | + <div> | |
2614 | + <span className="text-[#8C8C8C]">订单号:</span> | |
2615 | + <span className="text-slate-700">{record.id}</span> | |
2616 | + {record.modified ? ( | |
2617 | + <Tooltip title="点击查看详情"> | |
2618 | + <span | |
2619 | + className="text-[#f44e4e] cursor-pointer" | |
2620 | + onClick={async () => { | |
2621 | + createOptObject(null, record.id); | |
2622 | + setModifiedDiffModalVisible(true); | |
2623 | + }} | |
2624 | + > | |
2625 | + (修改过) | |
2626 | + </span> | |
2627 | + </Tooltip> | |
2628 | + ) : ( | |
2629 | + '' | |
2630 | + )} | |
2631 | 2631 | </div> |
2632 | - <span> | |
2633 | - <span className="text-[#8C8C8C]">课题组:</span> | |
2634 | - <span className="text-slate-700"> | |
2635 | - {record.institutionContactName | |
2636 | - ? record.institutionContactName + ' ' | |
2637 | - : '企业'} | |
2638 | - </span> | |
2639 | - </span> | |
2640 | - </> | |
2641 | - ) : ( | |
2642 | - '' | |
2643 | - )} | |
2644 | - <div | |
2645 | - title={record.institution} | |
2646 | - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
2647 | - > | |
2648 | - <span | |
2632 | + </Space> | |
2633 | + </Checkbox> | |
2634 | + <Tooltip title="点击复制订单号"> | |
2635 | + <CopyOutlined | |
2649 | 2636 | className="hover:cursor-pointer" |
2637 | + style={{ color: '#8C8C8C' }} | |
2650 | 2638 | onClick={() => { |
2651 | - copyToClipboard(record.customerName); | |
2652 | - message.info('收货人复制成功:' + record.customerName); | |
2639 | + copyToClipboard(record.id); | |
2640 | + message.info('订单号复制成功!'); | |
2653 | 2641 | }} |
2654 | - > | |
2655 | - <span className="text-[#8C8C8C]">收货人:</span> | |
2656 | - {!isSupplier() && ( | |
2657 | - <Tooltip className="order-tooltip" title="详情"> | |
2658 | - <ContainerTwoTone | |
2659 | - className="px-1 hover:curcor-pointer" | |
2660 | - onClick={() => { | |
2661 | - createOptObject(null, record.id); | |
2662 | - setDeliverInfoDrawerVisible(true); | |
2663 | - }} | |
2664 | - /> | |
2665 | - </Tooltip> | |
2666 | - )} | |
2667 | - <span className="text-slate-700"> | |
2668 | - {record.customerName + ' '} | |
2669 | - </span> | |
2670 | - </span> | |
2671 | - </div> | |
2672 | - | |
2673 | - {isSupplier() ? ( | |
2642 | + /> | |
2643 | + </Tooltip> | |
2644 | + <Divider type="vertical" /> | |
2645 | + <span>{formatDateTime(record.createTime)}</span> | |
2646 | + <Divider type="vertical" /> | |
2647 | + <Space split={<Divider type="vertical" />}> | |
2674 | 2648 | <div |
2675 | - title={record.customerShippingAddress} | |
2676 | - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px] hover:cursor-pointer" | |
2649 | + className="hover:cursor-pointer" | |
2677 | 2650 | onClick={() => { |
2678 | - copyToClipboard(record.customerShippingAddress); | |
2679 | - message.info( | |
2680 | - '收货地址复制成功:' + record.customerShippingAddress, | |
2681 | - ); | |
2651 | + copyToClipboard(record.salesCode); | |
2652 | + message.info('代表复制成功:' + record.salesCode); | |
2682 | 2653 | }} |
2683 | 2654 | > |
2684 | - <span className="text-[#8C8C8C]">收货地址:</span> | |
2685 | - <span className="text-slate-700"> | |
2686 | - {record.customerShippingAddress} | |
2655 | + <span className="text-[#8C8C8C]">代表:</span> | |
2656 | + <span className="text-slate-700">{record.salesCode}</span> | |
2657 | + </div> | |
2658 | + {!isSupplier() ? ( | |
2659 | + <> | |
2660 | + <div | |
2661 | + title={record.institution} | |
2662 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
2663 | + > | |
2664 | + <span className="text-[#8C8C8C]">单位:</span> | |
2665 | + <span className="text-slate-700"> | |
2666 | + {record.institution} | |
2667 | + </span> | |
2668 | + </div> | |
2669 | + <span> | |
2670 | + <span className="text-[#8C8C8C]">课题组:</span> | |
2671 | + <span className="text-slate-700"> | |
2672 | + {record.institutionContactName | |
2673 | + ? record.institutionContactName + ' ' | |
2674 | + : '企业'} | |
2675 | + </span> | |
2676 | + </span> | |
2677 | + </> | |
2678 | + ) : ( | |
2679 | + '' | |
2680 | + )} | |
2681 | + <div | |
2682 | + title={record.institution} | |
2683 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
2684 | + > | |
2685 | + <span | |
2686 | + className="hover:cursor-pointer" | |
2687 | + onClick={() => { | |
2688 | + copyToClipboard(record.customerName); | |
2689 | + message.info( | |
2690 | + '收货人复制成功:' + record.customerName, | |
2691 | + ); | |
2692 | + }} | |
2693 | + > | |
2694 | + <span className="text-[#8C8C8C]">收货人:</span> | |
2695 | + {!isSupplier() && ( | |
2696 | + <Tooltip className="order-tooltip" title="详情"> | |
2697 | + <ContainerTwoTone | |
2698 | + className="px-1 hover:curcor-pointer" | |
2699 | + onClick={() => { | |
2700 | + createOptObject(null, record.id); | |
2701 | + setDeliverInfoDrawerVisible(true); | |
2702 | + }} | |
2703 | + /> | |
2704 | + </Tooltip> | |
2705 | + )} | |
2706 | + <span className="text-slate-700"> | |
2707 | + {record.customerName + ' '} | |
2708 | + </span> | |
2687 | 2709 | </span> |
2688 | 2710 | </div> |
2689 | - ) : ( | |
2690 | - '' | |
2691 | - )} | |
2692 | - </Space> | |
2693 | - </Flex> | |
2694 | - </Flex> | |
2695 | 2711 | |
2696 | - {isSupplier() ? ( | |
2697 | - <Flex className="pl-6" align="center"> | |
2698 | - <Flex | |
2699 | - className="hover:cursor-pointer" | |
2700 | - onClick={() => { | |
2701 | - copyToClipboard(record.customerContactNumber); | |
2702 | - message.info( | |
2703 | - '联系电话复制成功:' + record.customerContactNumber, | |
2704 | - ); | |
2705 | - }} | |
2706 | - > | |
2707 | - <span className="text-[#8C8C8C]">联系电话:</span> | |
2708 | - <span className="text-slate-700"> | |
2709 | - {record.customerContactNumber + ' '} | |
2710 | - </span> | |
2712 | + {isSupplier() ? ( | |
2713 | + <div | |
2714 | + title={record.customerShippingAddress} | |
2715 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px] hover:cursor-pointer" | |
2716 | + onClick={() => { | |
2717 | + copyToClipboard(record.customerShippingAddress); | |
2718 | + message.info( | |
2719 | + '收货地址复制成功:' + | |
2720 | + record.customerShippingAddress, | |
2721 | + ); | |
2722 | + }} | |
2723 | + > | |
2724 | + <span className="text-[#8C8C8C]">收货地址:</span> | |
2725 | + <span className="text-slate-700"> | |
2726 | + {record.customerShippingAddress} | |
2727 | + </span> | |
2728 | + </div> | |
2729 | + ) : ( | |
2730 | + '' | |
2731 | + )} | |
2732 | + </Space> | |
2711 | 2733 | </Flex> |
2712 | 2734 | </Flex> |
2713 | - ) : ( | |
2714 | - '' | |
2715 | - )} | |
2716 | 2735 | |
2717 | - <Flex className="pl-6" align="center"> | |
2718 | - {roleCode === 'finance' ? ( | |
2719 | - <div | |
2720 | - title={enumValueToLabel( | |
2721 | - record.receivingCompany, | |
2722 | - getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2723 | - )} | |
2724 | - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px]" | |
2725 | - > | |
2726 | - <span className="text-[#8C8C8C]">开票收款单位:</span> | |
2727 | - <span className="text-slate-700"> | |
2728 | - {record.receivingCompany !== null | |
2729 | - ? enumValueToLabel( | |
2730 | - record.receivingCompany, | |
2731 | - getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2732 | - ) | |
2733 | - : '暂无'} | |
2734 | - </span> | |
2735 | - </div> | |
2736 | + {isSupplier() ? ( | |
2737 | + <Flex className="pl-6" align="center"> | |
2738 | + <Flex | |
2739 | + className="hover:cursor-pointer" | |
2740 | + onClick={() => { | |
2741 | + copyToClipboard(record.customerContactNumber); | |
2742 | + message.info( | |
2743 | + '联系电话复制成功:' + record.customerContactNumber, | |
2744 | + ); | |
2745 | + }} | |
2746 | + > | |
2747 | + <span className="text-[#8C8C8C]">联系电话:</span> | |
2748 | + <span className="text-slate-700"> | |
2749 | + {record.customerContactNumber + ' '} | |
2750 | + </span> | |
2751 | + </Flex> | |
2752 | + </Flex> | |
2736 | 2753 | ) : ( |
2737 | 2754 | '' |
2738 | 2755 | )} |
2739 | 2756 | |
2740 | - {roleCode === 'finance' ? <Divider type="vertical" /> : ''} | |
2741 | - | |
2742 | - {/* 添加付款审核状态 */} | |
2743 | - <div> | |
2744 | - <span className="text-[#8C8C8C]">付款状态:</span> | |
2745 | - <span className="text-slate-700"> | |
2746 | - {getPaymentStatusText(record.paymentAuditStatus)} | |
2747 | - </span> | |
2748 | - </div> | |
2749 | - <Divider type="vertical" /> | |
2750 | - | |
2751 | - {/* 开票状态 */} | |
2752 | - <div> | |
2753 | - <span className="text-[#8C8C8C]">开票状态:</span> | |
2754 | - <span className="text-slate-700"> | |
2755 | - {enumValueToLabel( | |
2756 | - record.afterInvoicingStatus, | |
2757 | - AFTER_INVOICING_STATUS, | |
2758 | - ) || '尚未开票'} | |
2759 | - </span> | |
2760 | - </div> | |
2761 | - <Divider type="vertical" /> | |
2757 | + <Flex className="pl-6" align="center"> | |
2758 | + {roleCode === 'finance' ? ( | |
2759 | + <div | |
2760 | + title={enumValueToLabel( | |
2761 | + record.receivingCompany, | |
2762 | + getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2763 | + )} | |
2764 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px]" | |
2765 | + > | |
2766 | + <span className="text-[#8C8C8C]">开票收款单位:</span> | |
2767 | + <span className="text-slate-700"> | |
2768 | + {record.receivingCompany !== null | |
2769 | + ? enumValueToLabel( | |
2770 | + record.receivingCompany, | |
2771 | + getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2772 | + ) | |
2773 | + : '暂无'} | |
2774 | + </span> | |
2775 | + </div> | |
2776 | + ) : ( | |
2777 | + '' | |
2778 | + )} | |
2762 | 2779 | |
2763 | - {/* 添加已回款金额 */} | |
2764 | - <div> | |
2765 | - <span className="text-[#8C8C8C]">已回款金额:¥</span> | |
2766 | - <span className="text-slate-700"> | |
2767 | - {record.payedMoney || '0'} | |
2768 | - </span> | |
2769 | - </div> | |
2770 | - <Divider type="vertical" /> | |
2780 | + {roleCode === 'finance' ? <Divider type="vertical" /> : ''} | |
2771 | 2781 | |
2772 | - {/* 添加未回款金额 */} | |
2773 | - <div> | |
2774 | - <span className="text-[#8C8C8C]">未回款金额:¥</span> | |
2775 | - <span className="text-slate-700"> | |
2776 | - {record.unPayedMoney || '0'} | |
2777 | - </span> | |
2778 | - </div> | |
2779 | - <Divider type="vertical" /> | |
2780 | - </Flex> | |
2781 | - <Flex className="pl-6" align="center"> | |
2782 | - <div> | |
2783 | - <span className="text-[#8C8C8C]">开票中金额:¥</span> | |
2784 | - <span className="text-slate-700"> | |
2785 | - {record.invoicePendingAmount || '-'} | |
2786 | - </span> | |
2787 | - </div> | |
2788 | - <Divider type="vertical" /> | |
2789 | - <div> | |
2790 | - <span className="text-[#8C8C8C]">已开票金额:¥</span> | |
2791 | - <span className="text-slate-700"> | |
2792 | - {record.invoiceIssuedAmount || '-'} | |
2793 | - </span> | |
2794 | - </div> | |
2795 | - <Divider type="vertical" /> | |
2796 | - {/* 添加发票核销金额 */} | |
2797 | - <div> | |
2798 | - <span className="text-[#8C8C8C]">发票核销金额:¥</span> | |
2799 | - <span className="text-slate-700"> | |
2800 | - {record.invoiceMoney || '-'} | |
2801 | - </span> | |
2802 | - </div> | |
2803 | - <Divider type="vertical" /> | |
2804 | - </Flex> | |
2805 | - <Flex className="pl-6" align="center"> | |
2806 | - <div title={record.notes}> | |
2807 | - <div | |
2808 | - className="max-w-[850px] whitespace-normal overflow-hidden overflow-ellipsis hover:cursor-pointer" | |
2809 | - onClick={() => { | |
2810 | - copyToClipboard(record.notes); | |
2811 | - message.info('备注复制成功:' + record.notes); | |
2812 | - }} | |
2813 | - > | |
2814 | - <span className="text-[#8C8C8C]">备注:</span> | |
2815 | - <span className="ml-2"> | |
2816 | - {record.notes === null ? '暂无备注' : record.notes} | |
2782 | + {/* 添加付款审核状态 */} | |
2783 | + <div> | |
2784 | + <span className="text-[#8C8C8C]">付款状态:</span> | |
2785 | + <span className="text-slate-700"> | |
2786 | + {getPaymentStatusText(record.paymentAuditStatus)} | |
2817 | 2787 | </span> |
2818 | 2788 | </div> |
2819 | - </div> | |
2789 | + <Divider type="vertical" /> | |
2820 | 2790 | |
2821 | - {!isSupplier() ? ( | |
2822 | - <Tooltip title="编辑"> | |
2823 | - <EditTwoTone | |
2824 | - className="pl-1 hover:curcor-pointer" | |
2825 | - onClick={() => { | |
2826 | - setNotesEditVisible(true); | |
2827 | - setSelectedRows([record.id]); | |
2828 | - setNotes(record.notes); | |
2829 | - setNotesType(0); | |
2830 | - }} | |
2831 | - /> | |
2832 | - </Tooltip> | |
2833 | - ) : ( | |
2834 | - '' | |
2835 | - )} | |
2791 | + {/* 开票状态 */} | |
2792 | + <div> | |
2793 | + <span className="text-[#8C8C8C]">开票状态:</span> | |
2794 | + <span className="text-slate-700"> | |
2795 | + {enumValueToLabel( | |
2796 | + record.afterInvoicingStatus, | |
2797 | + AFTER_INVOICING_STATUS, | |
2798 | + ) || '尚未开票'} | |
2799 | + </span> | |
2800 | + </div> | |
2801 | + <Divider type="vertical" /> | |
2836 | 2802 | |
2837 | - {record.goodsWeight !== null ? ( | |
2838 | - <div title={record.goodsWeight + 'kg'} className="pl-3"> | |
2839 | - <div | |
2840 | - className="overflow-hidden max-w-md overflow-ellipsis whitespace-no-wrap hover:cursor-pointer" | |
2841 | - onClick={() => { | |
2842 | - copyToClipboard(record.goodsWeight + 'kg'); | |
2843 | - message.info( | |
2844 | - '包裹重量复制成功:' + record.goodsWeight + 'kg', | |
2845 | - ); | |
2846 | - }} | |
2847 | - > | |
2848 | - <span className="text-[#8C8C8C]">包裹重量:</span> | |
2849 | - <span className="ml-2">{record.goodsWeight + 'kg'}</span> | |
2850 | - </div> | |
2803 | + {/* 添加已回款金额 */} | |
2804 | + <div> | |
2805 | + <span className="text-[#8C8C8C]">已回款金额:¥</span> | |
2806 | + <span className="text-slate-700"> | |
2807 | + {record.payedMoney || '0'} | |
2808 | + </span> | |
2851 | 2809 | </div> |
2852 | - ) : ( | |
2853 | - '' | |
2854 | - )} | |
2810 | + <Divider type="vertical" /> | |
2855 | 2811 | |
2856 | - {record.goodsVolume !== null ? ( | |
2857 | - <div title={record.goodsVolume + 'm³'} className="pl-3"> | |
2812 | + {/* 添加未回款金额 */} | |
2813 | + <div> | |
2814 | + <span className="text-[#8C8C8C]">未回款金额:¥</span> | |
2815 | + <span className="text-slate-700"> | |
2816 | + {record.unPayedMoney || '0'} | |
2817 | + </span> | |
2818 | + </div> | |
2819 | + <Divider type="vertical" /> | |
2820 | + </Flex> | |
2821 | + <Flex className="pl-6" align="center"> | |
2822 | + <div> | |
2823 | + <span className="text-[#8C8C8C]">开票中金额:¥</span> | |
2824 | + <span className="text-slate-700"> | |
2825 | + {record.invoicePendingAmount || '-'} | |
2826 | + </span> | |
2827 | + </div> | |
2828 | + <Divider type="vertical" /> | |
2829 | + <div> | |
2830 | + <span className="text-[#8C8C8C]">已开票金额:¥</span> | |
2831 | + <span className="text-slate-700"> | |
2832 | + {record.invoiceIssuedAmount || '-'} | |
2833 | + </span> | |
2834 | + </div> | |
2835 | + <Divider type="vertical" /> | |
2836 | + {/* 添加发票核销金额 */} | |
2837 | + <div> | |
2838 | + <span className="text-[#8C8C8C]">发票核销金额:¥</span> | |
2839 | + <span className="text-slate-700"> | |
2840 | + {record.invoiceMoney || '-'} | |
2841 | + </span> | |
2842 | + </div> | |
2843 | + <Divider type="vertical" /> | |
2844 | + </Flex> | |
2845 | + <Flex className="pl-6" align="center"> | |
2846 | + <div title={record.notes}> | |
2858 | 2847 | <div |
2859 | - className="overflow-hidden max-w-md overflow-ellipsis whitespace-no-wrap hover:cursor-pointer" | |
2848 | + className="max-w-[850px] whitespace-normal overflow-hidden overflow-ellipsis hover:cursor-pointer" | |
2860 | 2849 | onClick={() => { |
2861 | - copyToClipboard(record.goodsVolume + 'm³'); | |
2862 | - message.info( | |
2863 | - '包裹体积复制成功:' + record.goodsVolume + 'm³', | |
2864 | - ); | |
2850 | + copyToClipboard(record.notes); | |
2851 | + message.info('备注复制成功:' + record.notes); | |
2865 | 2852 | }} |
2866 | 2853 | > |
2867 | - <span className="text-[#8C8C8C]">包裹体积:</span> | |
2868 | - <span className="ml-2">{record.goodsVolume + 'm³'}</span> | |
2869 | - </div> | |
2870 | - </div> | |
2871 | - ) : ( | |
2872 | - '' | |
2873 | - )} | |
2874 | - </Flex> | |
2875 | - </Flex> | |
2876 | - <Flex wrap="wrap" gap="middle" vertical> | |
2877 | - <Flex justify="flex-end"> | |
2878 | - <Flex wrap="wrap" gap="middle" align="center"> | |
2879 | - {!isSupplier() ? ( | |
2880 | - <div> | |
2881 | - <span className="text-[#8C8C8C]">总金额:¥</span> | |
2882 | - <span className="text-lg font-medium"> | |
2883 | - {record.totalPayment || '0'} | |
2854 | + <span className="text-[#8C8C8C]">备注:</span> | |
2855 | + <span className="ml-2"> | |
2856 | + {record.notes === null ? '暂无备注' : record.notes} | |
2884 | 2857 | </span> |
2885 | 2858 | </div> |
2886 | - ) : ( | |
2887 | - '' | |
2888 | - )} | |
2859 | + </div> | |
2889 | 2860 | |
2890 | - {rolePath?.includes('addOrder') ? ( | |
2891 | - <Tooltip title="复制"> | |
2892 | - <CopyTwoTone | |
2893 | - className="hover:cursor-pointer" | |
2894 | - onClick={() => { | |
2895 | - createOptObject(null, record.id); | |
2896 | - copyOrderToClipboard(record); | |
2897 | - setOrderOptType('copy'); | |
2898 | - setOrderDrawerVisible(true); | |
2899 | - }} | |
2900 | - /> | |
2901 | - </Tooltip> | |
2902 | - ) : ( | |
2903 | - <Tooltip title="复制文本"> | |
2904 | - <CopyTwoTone | |
2905 | - className="hover:cursor-pointer" | |
2906 | - onClick={() => { | |
2907 | - copyOrderToClipboard(record); | |
2908 | - }} | |
2909 | - /> | |
2910 | - </Tooltip> | |
2911 | - )} | |
2912 | 2861 | {!isSupplier() ? ( |
2913 | - <Tooltip title="历史"> | |
2914 | - <ClockCircleTwoTone | |
2915 | - className="hover:cursor-pointer" | |
2862 | + <Tooltip title="编辑"> | |
2863 | + <EditTwoTone | |
2864 | + className="pl-1 hover:curcor-pointer" | |
2916 | 2865 | onClick={() => { |
2917 | - setHistoryModalVisible(true); | |
2918 | - if (subOrderSelectedMap.get(record.id)?.length) { | |
2919 | - setSelectedRows(subOrderSelectedMap.get(record.id)); | |
2920 | - } else { | |
2921 | - setSelectedRows(record.subOrderInformationLists); | |
2922 | - } | |
2866 | + setNotesEditVisible(true); | |
2867 | + setSelectedRows([record.id]); | |
2868 | + setNotes(record.notes); | |
2869 | + setNotesType(0); | |
2923 | 2870 | }} |
2924 | 2871 | /> |
2925 | 2872 | </Tooltip> |
2926 | 2873 | ) : ( |
2927 | 2874 | '' |
2928 | 2875 | )} |
2929 | - </Flex> | |
2930 | - </Flex> | |
2931 | - <Flex justify="flex-end"> | |
2932 | - <Space.Compact direction="vertical" align="end"> | |
2933 | - <Space wrap> | |
2934 | - {record.paths?.includes('postAudit') ? ( | |
2935 | - <Button | |
2936 | - className="p-0" | |
2937 | - type="link" | |
2876 | + | |
2877 | + {record.goodsWeight !== null ? ( | |
2878 | + <div title={record.goodsWeight + 'kg'} className="pl-3"> | |
2879 | + <div | |
2880 | + className="overflow-hidden max-w-md overflow-ellipsis whitespace-no-wrap hover:cursor-pointer" | |
2938 | 2881 | onClick={() => { |
2939 | - setCurrentMainId(record.id); | |
2940 | - setCurretnOptSubId(null); | |
2941 | - setCheckVisible(true); | |
2942 | - setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT); | |
2882 | + copyToClipboard(record.goodsWeight + 'kg'); | |
2883 | + message.info( | |
2884 | + '包裹重量复制成功:' + record.goodsWeight + 'kg', | |
2885 | + ); | |
2943 | 2886 | }} |
2944 | 2887 | > |
2945 | - 后置审核 | |
2946 | - </Button> | |
2947 | - ) : ( | |
2948 | - '' | |
2949 | - )} | |
2950 | - {record.paths?.includes('URGENT_INVOICE_AUDITING') ? ( | |
2951 | - <Button | |
2952 | - className="p-0" | |
2953 | - type="link" | |
2954 | - onClick={() => { | |
2955 | - createOptObject(null, record.id); | |
2956 | - setCheckVisible(true); | |
2957 | - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING); | |
2958 | - }} | |
2959 | - > | |
2960 | - 加急审核(新) | |
2961 | - </Button> | |
2962 | - ) : ( | |
2963 | - '' | |
2964 | - )} | |
2965 | - {record.paths?.includes('URGENT_INVOICE_AUDITING_old') ? ( | |
2966 | - <Button | |
2967 | - className="p-0" | |
2968 | - type="link" | |
2888 | + <span className="text-[#8C8C8C]">包裹重量:</span> | |
2889 | + <span className="ml-2">{record.goodsWeight + 'kg'}</span> | |
2890 | + </div> | |
2891 | + </div> | |
2892 | + ) : ( | |
2893 | + '' | |
2894 | + )} | |
2895 | + | |
2896 | + {record.goodsVolume !== null ? ( | |
2897 | + <div title={record.goodsVolume + 'm³'} className="pl-3"> | |
2898 | + <div | |
2899 | + className="overflow-hidden max-w-md overflow-ellipsis whitespace-no-wrap hover:cursor-pointer" | |
2969 | 2900 | onClick={() => { |
2970 | - createOptObject(null, record.id); | |
2971 | - setCheckVisible(true); | |
2972 | - setOrderCheckType( | |
2973 | - CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD, | |
2901 | + copyToClipboard(record.goodsVolume + 'm³'); | |
2902 | + message.info( | |
2903 | + '包裹体积复制成功:' + record.goodsVolume + 'm³', | |
2974 | 2904 | ); |
2975 | 2905 | }} |
2976 | 2906 | > |
2977 | - 加急审核(旧) | |
2978 | - </Button> | |
2907 | + <span className="text-[#8C8C8C]">包裹体积:</span> | |
2908 | + <span className="ml-2">{record.goodsVolume + 'm³'}</span> | |
2909 | + </div> | |
2910 | + </div> | |
2911 | + ) : ( | |
2912 | + '' | |
2913 | + )} | |
2914 | + </Flex> | |
2915 | + </Flex> | |
2916 | + <Flex wrap="wrap" gap="middle" vertical> | |
2917 | + <Flex justify="flex-end"> | |
2918 | + <Flex wrap="wrap" gap="middle" align="center"> | |
2919 | + {!isSupplier() ? ( | |
2920 | + <div> | |
2921 | + <span className="text-[#8C8C8C]">总金额:¥</span> | |
2922 | + <span className="text-lg font-medium"> | |
2923 | + {record.totalPayment || '0'} | |
2924 | + </span> | |
2925 | + </div> | |
2979 | 2926 | ) : ( |
2980 | 2927 | '' |
2981 | 2928 | )} |
2982 | - {record.paths?.includes('salesConfirm') && ( | |
2983 | - <ButtonConfirm | |
2984 | - className="p-0" | |
2985 | - title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。" | |
2986 | - text="订单确认" | |
2987 | - onConfirm={async () => { | |
2988 | - let subIds = subOrderSelectedMap | |
2989 | - .get(record.id) | |
2990 | - ?.map((item) => { | |
2991 | - return item.id; | |
2992 | - }); | |
2993 | - if (subIds === null || subIds === undefined) { | |
2994 | - subIds = record.subOrderInformationLists.map( | |
2995 | - (item) => { | |
2996 | - return item.id; | |
2997 | - }, | |
2998 | - ); | |
2999 | - } | |
3000 | - let res = await postServiceOrderSalesConfirm({ | |
3001 | - data: { | |
3002 | - subOrderIds: subIds, | |
3003 | - }, | |
3004 | - }); | |
3005 | 2929 | |
3006 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3007 | - message.success(res.message); | |
3008 | - refreshTable(); | |
3009 | - } | |
3010 | - }} | |
3011 | - /> | |
3012 | - )} | |
3013 | - {record.paths?.includes('uploadPaymentReceiptBill') ? ( | |
3014 | - <Button | |
3015 | - className="p-0" | |
3016 | - type="link" | |
3017 | - onClick={() => { | |
3018 | - createOptObject(null, record.id); | |
3019 | - setUploadPayBillModalVisible(true); | |
3020 | - }} | |
3021 | - > | |
3022 | - 回款 | |
3023 | - </Button> | |
2930 | + {rolePath?.includes('addOrder') ? ( | |
2931 | + <Tooltip title="复制"> | |
2932 | + <CopyTwoTone | |
2933 | + className="hover:cursor-pointer" | |
2934 | + onClick={() => { | |
2935 | + createOptObject(null, record.id); | |
2936 | + copyOrderToClipboard(record); | |
2937 | + setOrderOptType('copy'); | |
2938 | + setOrderDrawerVisible(true); | |
2939 | + }} | |
2940 | + /> | |
2941 | + </Tooltip> | |
3024 | 2942 | ) : ( |
3025 | - '' | |
2943 | + <Tooltip title="复制文本"> | |
2944 | + <CopyTwoTone | |
2945 | + className="hover:cursor-pointer" | |
2946 | + onClick={() => { | |
2947 | + copyOrderToClipboard(record); | |
2948 | + }} | |
2949 | + /> | |
2950 | + </Tooltip> | |
3026 | 2951 | )} |
3027 | - {record.paths?.includes('updateHirePurchase') ? ( | |
3028 | - <Button | |
3029 | - className="p-0" | |
3030 | - type="link" | |
3031 | - onClick={() => { | |
3032 | - createOptObject(record.id, record.id); | |
3033 | - setHirePurchaseUploadPayBillModalVisible(true); | |
3034 | - }} | |
3035 | - > | |
3036 | - 回款 | |
3037 | - </Button> | |
2952 | + {!isSupplier() ? ( | |
2953 | + <Tooltip title="历史"> | |
2954 | + <ClockCircleTwoTone | |
2955 | + className="hover:cursor-pointer" | |
2956 | + onClick={() => { | |
2957 | + setHistoryModalVisible(true); | |
2958 | + if (subOrderSelectedMap.get(record.id)?.length) { | |
2959 | + setSelectedRows(subOrderSelectedMap.get(record.id)); | |
2960 | + } else { | |
2961 | + setSelectedRows(record.subOrderInformationLists); | |
2962 | + } | |
2963 | + }} | |
2964 | + /> | |
2965 | + </Tooltip> | |
3038 | 2966 | ) : ( |
3039 | 2967 | '' |
3040 | 2968 | )} |
2969 | + </Flex> | |
2970 | + </Flex> | |
2971 | + <Flex justify="flex-end"> | |
2972 | + <Space.Compact direction="vertical" align="end"> | |
2973 | + <Space wrap> | |
2974 | + {record.paths?.includes('postAudit') ? ( | |
2975 | + <Button | |
2976 | + className="p-0" | |
2977 | + type="link" | |
2978 | + onClick={() => { | |
2979 | + setCurrentMainId(record.id); | |
2980 | + setCurretnOptSubId(null); | |
2981 | + setCheckVisible(true); | |
2982 | + setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT); | |
2983 | + }} | |
2984 | + > | |
2985 | + 后置审核 | |
2986 | + </Button> | |
2987 | + ) : ( | |
2988 | + '' | |
2989 | + )} | |
2990 | + {record.paths?.includes('URGENT_INVOICE_AUDITING') ? ( | |
2991 | + <Button | |
2992 | + className="p-0" | |
2993 | + type="link" | |
2994 | + onClick={() => { | |
2995 | + createOptObject(null, record.id); | |
2996 | + setCheckVisible(true); | |
2997 | + setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING); | |
2998 | + }} | |
2999 | + > | |
3000 | + 加急审核(新) | |
3001 | + </Button> | |
3002 | + ) : ( | |
3003 | + '' | |
3004 | + )} | |
3005 | + {record.paths?.includes('URGENT_INVOICE_AUDITING_old') ? ( | |
3006 | + <Button | |
3007 | + className="p-0" | |
3008 | + type="link" | |
3009 | + onClick={() => { | |
3010 | + createOptObject(null, record.id); | |
3011 | + setCheckVisible(true); | |
3012 | + setOrderCheckType( | |
3013 | + CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD, | |
3014 | + ); | |
3015 | + }} | |
3016 | + > | |
3017 | + 加急审核(旧) | |
3018 | + </Button> | |
3019 | + ) : ( | |
3020 | + '' | |
3021 | + )} | |
3022 | + {record.paths?.includes('salesConfirm') && ( | |
3023 | + <ButtonConfirm | |
3024 | + className="p-0" | |
3025 | + title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。" | |
3026 | + text="订单确认" | |
3027 | + onConfirm={async () => { | |
3028 | + let subIds = subOrderSelectedMap | |
3029 | + .get(record.id) | |
3030 | + ?.map((item) => { | |
3031 | + return item.id; | |
3032 | + }); | |
3033 | + if (subIds === null || subIds === undefined) { | |
3034 | + subIds = record.subOrderInformationLists.map( | |
3035 | + (item) => { | |
3036 | + return item.id; | |
3037 | + }, | |
3038 | + ); | |
3039 | + } | |
3040 | + let res = await postServiceOrderSalesConfirm({ | |
3041 | + data: { | |
3042 | + subOrderIds: subIds, | |
3043 | + }, | |
3044 | + }); | |
3041 | 3045 | |
3042 | - {record.paths?.includes('refundHistory') ? ( | |
3043 | - <Button | |
3044 | - className="p-0" | |
3045 | - type="link" | |
3046 | - onClick={() => { | |
3047 | - createOptObject(record.id, record.id); | |
3048 | - setPaymentRecordModalVisible(true); | |
3049 | - }} | |
3050 | - > | |
3051 | - 付款记录 | |
3052 | - </Button> | |
3053 | - ) : ( | |
3054 | - '' | |
3055 | - )} | |
3046 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3047 | + message.success(res.message); | |
3048 | + refreshTable(); | |
3049 | + } | |
3050 | + }} | |
3051 | + /> | |
3052 | + )} | |
3053 | + {record.paths?.includes('uploadPaymentReceiptBill') ? ( | |
3054 | + <Button | |
3055 | + className="p-0" | |
3056 | + type="link" | |
3057 | + onClick={() => { | |
3058 | + createOptObject(null, record.id); | |
3059 | + setUploadPayBillModalVisible(true); | |
3060 | + }} | |
3061 | + > | |
3062 | + 回款 | |
3063 | + </Button> | |
3064 | + ) : ( | |
3065 | + '' | |
3066 | + )} | |
3067 | + {record.paths?.includes('updateHirePurchase') ? ( | |
3068 | + <Button | |
3069 | + className="p-0" | |
3070 | + type="link" | |
3071 | + onClick={() => { | |
3072 | + createOptObject(record.id, record.id); | |
3073 | + setHirePurchaseUploadPayBillModalVisible(true); | |
3074 | + }} | |
3075 | + > | |
3076 | + 回款 | |
3077 | + </Button> | |
3078 | + ) : ( | |
3079 | + '' | |
3080 | + )} | |
3056 | 3081 | |
3057 | - {/* 输出日志以检查权限和支付方式 */} | |
3058 | - {console.log('Order info:', record.id, record.paths)} | |
3059 | - {record.paths?.includes('auditPartialPaymentReceipt') ? ( | |
3060 | - <Button | |
3061 | - className="p-0" | |
3062 | - type="link" | |
3063 | - onClick={() => { | |
3064 | - createOptObject(null, record.id); | |
3065 | - setCheckVisible(true); | |
3066 | - setOrderCheckType( | |
3067 | - CHECK_TYPE.PARTIAL_PAYMENT_RECEIPTS_AUDIT, | |
3068 | - ); | |
3069 | - }} | |
3070 | - > | |
3071 | - 回款审核 | |
3072 | - </Button> | |
3073 | - ) : ( | |
3074 | - '' | |
3075 | - )} | |
3082 | + {record.paths?.includes('refundHistory') ? ( | |
3083 | + <Button | |
3084 | + className="p-0" | |
3085 | + type="link" | |
3086 | + onClick={() => { | |
3087 | + createOptObject(record.id, record.id); | |
3088 | + setPaymentRecordModalVisible(true); | |
3089 | + }} | |
3090 | + > | |
3091 | + 付款记录 | |
3092 | + </Button> | |
3093 | + ) : ( | |
3094 | + '' | |
3095 | + )} | |
3076 | 3096 | |
3077 | - {record.paths?.includes('modifiedAuditRequest') ? ( | |
3078 | - <Button | |
3079 | - className="p-0" | |
3080 | - type="link" | |
3081 | - onClick={() => { | |
3082 | - createOptObject(null, record.id); | |
3083 | - setCheckVisible(true); | |
3084 | - setOrderCheckType(CHECK_TYPE.NODE_OPERATING_AUDIT); | |
3085 | - }} | |
3086 | - > | |
3087 | - 节点修改审核 | |
3088 | - </Button> | |
3089 | - ) : ( | |
3090 | - '' | |
3091 | - )} | |
3097 | + {/* 输出日志以检查权限和支付方式 */} | |
3098 | + {console.log('Order info:', record.id, record.paths)} | |
3099 | + {record.paths?.includes('auditPartialPaymentReceipt') ? ( | |
3100 | + <Button | |
3101 | + className="p-0" | |
3102 | + type="link" | |
3103 | + onClick={() => { | |
3104 | + createOptObject(null, record.id); | |
3105 | + setCheckVisible(true); | |
3106 | + setOrderCheckType( | |
3107 | + CHECK_TYPE.PARTIAL_PAYMENT_RECEIPTS_AUDIT, | |
3108 | + ); | |
3109 | + }} | |
3110 | + > | |
3111 | + 回款审核 | |
3112 | + </Button> | |
3113 | + ) : ( | |
3114 | + '' | |
3115 | + )} | |
3092 | 3116 | |
3093 | - {record.paths?.includes('auditPaymentReceipt') ? ( | |
3094 | - <Button | |
3095 | - className="p-0" | |
3096 | - type="link" | |
3097 | - onClick={() => { | |
3098 | - createOptObject(null, record.id); | |
3099 | - setCheckVisible(true); | |
3100 | - setOrderCheckType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT); | |
3101 | - }} | |
3102 | - > | |
3103 | - 回款审核 | |
3104 | - </Button> | |
3105 | - ) : ( | |
3106 | - '' | |
3107 | - )} | |
3117 | + {record.paths?.includes('modifiedAuditRequest') ? ( | |
3118 | + <Button | |
3119 | + className="p-0" | |
3120 | + type="link" | |
3121 | + onClick={() => { | |
3122 | + createOptObject(null, record.id); | |
3123 | + setCheckVisible(true); | |
3124 | + setOrderCheckType(CHECK_TYPE.NODE_OPERATING_AUDIT); | |
3125 | + }} | |
3126 | + > | |
3127 | + 节点修改审核 | |
3128 | + </Button> | |
3129 | + ) : ( | |
3130 | + '' | |
3131 | + )} | |
3108 | 3132 | |
3109 | - {/* 第二个回款审核(分期)按钮已被移除,使用上面的带权限检查的按钮 */} | |
3133 | + {record.paths?.includes('auditPaymentReceipt') ? ( | |
3134 | + <Button | |
3135 | + className="p-0" | |
3136 | + type="link" | |
3137 | + onClick={() => { | |
3138 | + createOptObject(null, record.id); | |
3139 | + setCheckVisible(true); | |
3140 | + setOrderCheckType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT); | |
3141 | + }} | |
3142 | + > | |
3143 | + 回款审核 | |
3144 | + </Button> | |
3145 | + ) : ( | |
3146 | + '' | |
3147 | + )} | |
3110 | 3148 | |
3111 | - {record.paths?.includes('modifiedLeaderAuditRequest') ? ( | |
3112 | - <Button | |
3113 | - className="p-0" | |
3114 | - type="link" | |
3115 | - onClick={() => { | |
3116 | - createOptObject(null, record.id); | |
3117 | - setCheckVisible(true); | |
3118 | - setOrderCheckType(CHECK_TYPE.MODIFY_LEADER_AUDIT); | |
3119 | - }} | |
3120 | - > | |
3121 | - 领导修改审核 | |
3122 | - </Button> | |
3123 | - ) : ( | |
3124 | - '' | |
3125 | - )} | |
3149 | + {/* 第二个回款审核(分期)按钮已被移除,使用上面的带权限检查的按钮 */} | |
3150 | + | |
3151 | + {record.paths?.includes('modifiedLeaderAuditRequest') ? ( | |
3152 | + <Button | |
3153 | + className="p-0" | |
3154 | + type="link" | |
3155 | + onClick={() => { | |
3156 | + createOptObject(null, record.id); | |
3157 | + setCheckVisible(true); | |
3158 | + setOrderCheckType(CHECK_TYPE.MODIFY_LEADER_AUDIT); | |
3159 | + }} | |
3160 | + > | |
3161 | + 领导修改审核 | |
3162 | + </Button> | |
3163 | + ) : ( | |
3164 | + '' | |
3165 | + )} | |
3126 | 3166 | |
3127 | - {false ? ( | |
3128 | - <Button | |
3129 | - className="p-0" | |
3130 | - type="link" | |
3131 | - onClick={() => { | |
3132 | - createOptObject(null, record.id); | |
3133 | - setFinancialReceiptsModalVisible(true); | |
3134 | - setIsEdit(true); | |
3135 | - }} | |
3136 | - > | |
3137 | - 收款记录 | |
3138 | - </Button> | |
3139 | - ) : ( | |
3140 | - '' | |
3141 | - )} | |
3167 | + {false ? ( | |
3168 | + <Button | |
3169 | + className="p-0" | |
3170 | + type="link" | |
3171 | + onClick={() => { | |
3172 | + createOptObject(null, record.id); | |
3173 | + setFinancialReceiptsModalVisible(true); | |
3174 | + setIsEdit(true); | |
3175 | + }} | |
3176 | + > | |
3177 | + 收款记录 | |
3178 | + </Button> | |
3179 | + ) : ( | |
3180 | + '' | |
3181 | + )} | |
3142 | 3182 | |
3143 | - {record.paths?.includes('confirmReissue_old') ? ( | |
3144 | - <Button | |
3145 | - className="p-0" | |
3146 | - type="link" | |
3147 | - onClick={() => { | |
3148 | - setCurrentMainId(record.id); | |
3149 | - setCurretnOptSubId(null); | |
3150 | - setCheckVisible(true); | |
3151 | - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE_OLD); | |
3152 | - }} | |
3153 | - > | |
3154 | - 重新开票审核(旧) | |
3155 | - </Button> | |
3156 | - ) : ( | |
3157 | - '' | |
3158 | - )} | |
3183 | + {record.paths?.includes('confirmReissue_old') ? ( | |
3184 | + <Button | |
3185 | + className="p-0" | |
3186 | + type="link" | |
3187 | + onClick={() => { | |
3188 | + setCurrentMainId(record.id); | |
3189 | + setCurretnOptSubId(null); | |
3190 | + setCheckVisible(true); | |
3191 | + setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE_OLD); | |
3192 | + }} | |
3193 | + > | |
3194 | + 重新开票审核(旧) | |
3195 | + </Button> | |
3196 | + ) : ( | |
3197 | + '' | |
3198 | + )} | |
3159 | 3199 | |
3160 | - {record.paths?.includes('confirmReissue') ? ( | |
3161 | - <Button | |
3162 | - className="p-0" | |
3163 | - type="link" | |
3164 | - onClick={() => { | |
3165 | - setCurrentMainId(record.id); | |
3166 | - setCurretnOptSubId(null); | |
3167 | - setCheckVisible(true); | |
3168 | - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE); | |
3169 | - }} | |
3170 | - > | |
3171 | - 重新开票审核(新) | |
3172 | - </Button> | |
3173 | - ) : ( | |
3174 | - '' | |
3175 | - )} | |
3200 | + {record.paths?.includes('confirmReissue') ? ( | |
3201 | + <Button | |
3202 | + className="p-0" | |
3203 | + type="link" | |
3204 | + onClick={() => { | |
3205 | + setCurrentMainId(record.id); | |
3206 | + setCurretnOptSubId(null); | |
3207 | + setCheckVisible(true); | |
3208 | + setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE); | |
3209 | + }} | |
3210 | + > | |
3211 | + 重新开票审核(新) | |
3212 | + </Button> | |
3213 | + ) : ( | |
3214 | + '' | |
3215 | + )} | |
3176 | 3216 | |
3177 | - {record.paths?.includes('procureOrder') ? ( | |
3178 | - <ButtonConfirm | |
3179 | - className="p-0" | |
3180 | - title="是否下单?" | |
3181 | - text="下单" | |
3182 | - onConfirm={async () => { | |
3183 | - let subIds = subOrderSelectedMap | |
3184 | - .get(record.id) | |
3185 | - ?.map((item) => { | |
3186 | - return item.id; | |
3187 | - }); | |
3188 | - if (subIds === null || subIds === undefined) { | |
3189 | - subIds = record.subOrderInformationLists.map( | |
3190 | - (item) => { | |
3217 | + {record.paths?.includes('procureOrder') ? ( | |
3218 | + <ButtonConfirm | |
3219 | + className="p-0" | |
3220 | + title="是否下单?" | |
3221 | + text="下单" | |
3222 | + onConfirm={async () => { | |
3223 | + let subIds = subOrderSelectedMap | |
3224 | + .get(record.id) | |
3225 | + ?.map((item) => { | |
3191 | 3226 | return item.id; |
3192 | - }, | |
3193 | - ); | |
3194 | - } | |
3195 | - let res = await postServiceOrderProcureOrder({ | |
3196 | - data: { subIds: subIds }, | |
3197 | - }); | |
3198 | - if (res.result === RESPONSE_CODE.SUCCESS) { | |
3199 | - message.success(res.message); | |
3200 | - refreshTable(); | |
3201 | - return true; | |
3202 | - } | |
3203 | - }} | |
3204 | - /> | |
3205 | - ) : ( | |
3206 | - '' | |
3207 | - )} | |
3208 | - | |
3209 | - {record.paths?.includes('cancelSend') ? ( | |
3210 | - <ButtonConfirm | |
3211 | - className="p-0" | |
3212 | - title="是否取消发货?" | |
3213 | - text="取消发货" | |
3214 | - onConfirm={async () => { | |
3215 | - let subIds = subOrderSelectedMap | |
3216 | - .get(record.id) | |
3217 | - ?.map((item) => { | |
3218 | - return item.id; | |
3227 | + }); | |
3228 | + if (subIds === null || subIds === undefined) { | |
3229 | + subIds = record.subOrderInformationLists.map( | |
3230 | + (item) => { | |
3231 | + return item.id; | |
3232 | + }, | |
3233 | + ); | |
3234 | + } | |
3235 | + let res = await postServiceOrderProcureOrder({ | |
3236 | + data: { subIds: subIds }, | |
3219 | 3237 | }); |
3220 | - if (subIds === null || subIds === undefined) { | |
3221 | - subIds = record.subOrderInformationLists.map( | |
3222 | - (item) => { | |
3238 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
3239 | + message.success(res.message); | |
3240 | + refreshTable(); | |
3241 | + return true; | |
3242 | + } | |
3243 | + }} | |
3244 | + /> | |
3245 | + ) : ( | |
3246 | + '' | |
3247 | + )} | |
3248 | + | |
3249 | + {record.paths?.includes('cancelSend') ? ( | |
3250 | + <ButtonConfirm | |
3251 | + className="p-0" | |
3252 | + title="是否取消发货?" | |
3253 | + text="取消发货" | |
3254 | + onConfirm={async () => { | |
3255 | + let subIds = subOrderSelectedMap | |
3256 | + .get(record.id) | |
3257 | + ?.map((item) => { | |
3223 | 3258 | return item.id; |
3224 | - }, | |
3225 | - ); | |
3226 | - } | |
3227 | - let res = await postServiceOrderCancelSend({ | |
3228 | - data: { subIds: subIds }, | |
3229 | - }); | |
3230 | - if (res.result === RESPONSE_CODE.SUCCESS) { | |
3231 | - message.success(res.message); | |
3232 | - refreshTable(); | |
3233 | - return true; | |
3234 | - } | |
3235 | - }} | |
3236 | - /> | |
3237 | - ) : ( | |
3238 | - '' | |
3239 | - )} | |
3259 | + }); | |
3260 | + if (subIds === null || subIds === undefined) { | |
3261 | + subIds = record.subOrderInformationLists.map( | |
3262 | + (item) => { | |
3263 | + return item.id; | |
3264 | + }, | |
3265 | + ); | |
3266 | + } | |
3267 | + let res = await postServiceOrderCancelSend({ | |
3268 | + data: { subIds: subIds }, | |
3269 | + }); | |
3270 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
3271 | + message.success(res.message); | |
3272 | + refreshTable(); | |
3273 | + return true; | |
3274 | + } | |
3275 | + }} | |
3276 | + /> | |
3277 | + ) : ( | |
3278 | + '' | |
3279 | + )} | |
3240 | 3280 | |
3241 | - {record.paths?.includes('applyModify') ? ( | |
3242 | - <Button | |
3243 | - className="p-0" | |
3244 | - type="link" | |
3245 | - onClick={() => { | |
3246 | - createOptObject(null, record.id); | |
3247 | - setOrderDrawerVisible(true); | |
3248 | - setOrderOptType('order-change-normal'); | |
3249 | - }} | |
3250 | - > | |
3251 | - 申请修改 | |
3252 | - </Button> | |
3253 | - ) : ( | |
3254 | - '' | |
3255 | - )} | |
3256 | - {record.paths?.includes('saleCancelInvoicing') ? ( | |
3257 | - <ButtonConfirm | |
3258 | - className="p-0" | |
3259 | - title="确认取消申请开票?" | |
3260 | - text="取消申请(新)" | |
3261 | - onConfirm={async () => { | |
3262 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3263 | - record.id, | |
3264 | - ); | |
3265 | - if (selectedSubOrders === undefined) { | |
3266 | - selectedSubOrders = record.subOrderInformationLists; | |
3267 | - } | |
3268 | - let subOrderIds = selectedSubOrders.map( | |
3269 | - (item) => item.id, | |
3270 | - ); | |
3271 | - let res = await postServiceInvoiceCancelApply({ | |
3272 | - data: { | |
3273 | - subOrderIds: subOrderIds, | |
3274 | - }, | |
3275 | - }); | |
3281 | + {record.paths?.includes('applyModify') ? ( | |
3282 | + <Button | |
3283 | + className="p-0" | |
3284 | + type="link" | |
3285 | + onClick={() => { | |
3286 | + createOptObject(null, record.id); | |
3287 | + setOrderDrawerVisible(true); | |
3288 | + setOrderOptType('order-change-normal'); | |
3289 | + }} | |
3290 | + > | |
3291 | + 申请修改 | |
3292 | + </Button> | |
3293 | + ) : ( | |
3294 | + '' | |
3295 | + )} | |
3296 | + {record.paths?.includes('saleCancelInvoicing') ? ( | |
3297 | + <ButtonConfirm | |
3298 | + className="p-0" | |
3299 | + title="确认取消申请开票?" | |
3300 | + text="取消申请(新)" | |
3301 | + onConfirm={async () => { | |
3302 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3303 | + record.id, | |
3304 | + ); | |
3305 | + if (selectedSubOrders === undefined) { | |
3306 | + selectedSubOrders = record.subOrderInformationLists; | |
3307 | + } | |
3308 | + let subOrderIds = selectedSubOrders.map( | |
3309 | + (item) => item.id, | |
3310 | + ); | |
3311 | + let res = await postServiceInvoiceCancelApply({ | |
3312 | + data: { | |
3313 | + subOrderIds: subOrderIds, | |
3314 | + }, | |
3315 | + }); | |
3276 | 3316 | |
3277 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3278 | - message.success(res.message); | |
3279 | - refreshTable(); | |
3280 | - } | |
3281 | - }} | |
3282 | - /> | |
3283 | - ) : ( | |
3284 | - '' | |
3285 | - )} | |
3317 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3318 | + message.success(res.message); | |
3319 | + refreshTable(); | |
3320 | + } | |
3321 | + }} | |
3322 | + /> | |
3323 | + ) : ( | |
3324 | + '' | |
3325 | + )} | |
3286 | 3326 | |
3287 | - {record.paths?.includes('leaderAudit') ? ( | |
3288 | - <Button | |
3289 | - className="p-0" | |
3290 | - type="link" | |
3291 | - onClick={() => { | |
3292 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3293 | - record.id, | |
3294 | - ); | |
3295 | - setSelectedRows(selectedSubOrders); | |
3296 | - if (selectedSubOrders === undefined) { | |
3297 | - selectedSubOrders = record.subOrderInformationLists; | |
3298 | - } | |
3299 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3300 | - if ( | |
3301 | - selectedSubOrders[i].orderStatus !== | |
3302 | - 'LEADER_PROCESS' | |
3303 | - ) { | |
3304 | - message.error('请选择领导待审核的子订单进行审核'); | |
3305 | - return; | |
3327 | + {record.paths?.includes('leaderAudit') ? ( | |
3328 | + <Button | |
3329 | + className="p-0" | |
3330 | + type="link" | |
3331 | + onClick={() => { | |
3332 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3333 | + record.id, | |
3334 | + ); | |
3335 | + setSelectedRows(selectedSubOrders); | |
3336 | + if (selectedSubOrders === undefined) { | |
3337 | + selectedSubOrders = record.subOrderInformationLists; | |
3306 | 3338 | } |
3307 | - } | |
3308 | - createOptObject(null, record.id); | |
3309 | - setCheckVisible(true); | |
3310 | - setOrderCheckType(CHECK_TYPE.LEADER_AUDIT); | |
3311 | - }} | |
3312 | - > | |
3313 | - 审核 | |
3314 | - </Button> | |
3315 | - ) : ( | |
3316 | - '' | |
3317 | - )} | |
3339 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3340 | + if ( | |
3341 | + selectedSubOrders[i].orderStatus !== | |
3342 | + 'LEADER_PROCESS' | |
3343 | + ) { | |
3344 | + message.error('请选择领导待审核的子订单进行审核'); | |
3345 | + return; | |
3346 | + } | |
3347 | + } | |
3348 | + createOptObject(null, record.id); | |
3349 | + setCheckVisible(true); | |
3350 | + setOrderCheckType(CHECK_TYPE.LEADER_AUDIT); | |
3351 | + }} | |
3352 | + > | |
3353 | + 审核 | |
3354 | + </Button> | |
3355 | + ) : ( | |
3356 | + '' | |
3357 | + )} | |
3318 | 3358 | |
3319 | - {record.paths?.includes('changeOrderAudit') ? ( | |
3320 | - <Button | |
3321 | - className="p-0" | |
3322 | - type="link" | |
3323 | - onClick={() => { | |
3324 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3325 | - record.id, | |
3326 | - ); | |
3327 | - setSelectedRows(selectedSubOrders); | |
3328 | - if (selectedSubOrders === undefined) { | |
3329 | - selectedSubOrders = record.subOrderInformationLists; | |
3330 | - } | |
3331 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3332 | - if ( | |
3333 | - selectedSubOrders[i].orderStatus !== | |
3334 | - 'MODIFY_APPLY_WAIT_FOR_AUDIT' | |
3335 | - ) { | |
3336 | - message.error('请选择[修改待审核]的子订单进行审核'); | |
3337 | - return; | |
3359 | + {record.paths?.includes('changeOrderAudit') ? ( | |
3360 | + <Button | |
3361 | + className="p-0" | |
3362 | + type="link" | |
3363 | + onClick={() => { | |
3364 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3365 | + record.id, | |
3366 | + ); | |
3367 | + setSelectedRows(selectedSubOrders); | |
3368 | + if (selectedSubOrders === undefined) { | |
3369 | + selectedSubOrders = record.subOrderInformationLists; | |
3338 | 3370 | } |
3339 | - } | |
3340 | - createOptObject(null, record.id); | |
3341 | - setCheckVisible(true); | |
3342 | - setOrderCheckType( | |
3343 | - CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT, | |
3344 | - ); | |
3345 | - }} | |
3346 | - > | |
3347 | - 审核 | |
3348 | - </Button> | |
3349 | - ) : ( | |
3350 | - '' | |
3351 | - )} | |
3371 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3372 | + if ( | |
3373 | + selectedSubOrders[i].orderStatus !== | |
3374 | + 'MODIFY_APPLY_WAIT_FOR_AUDIT' | |
3375 | + ) { | |
3376 | + message.error( | |
3377 | + '请选择[修改待审核]的子订单进行审核', | |
3378 | + ); | |
3379 | + return; | |
3380 | + } | |
3381 | + } | |
3382 | + createOptObject(null, record.id); | |
3383 | + setCheckVisible(true); | |
3384 | + setOrderCheckType( | |
3385 | + CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT, | |
3386 | + ); | |
3387 | + }} | |
3388 | + > | |
3389 | + 审核 | |
3390 | + </Button> | |
3391 | + ) : ( | |
3392 | + '' | |
3393 | + )} | |
3352 | 3394 | |
3353 | - {record.paths?.includes('creditAudit') ? ( | |
3354 | - <Button | |
3355 | - className="p-0" | |
3356 | - type="link" | |
3357 | - onClick={() => { | |
3358 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3359 | - record.id, | |
3360 | - ); | |
3361 | - setSelectedRows(selectedSubOrders); | |
3362 | - if (selectedSubOrders === undefined) { | |
3363 | - selectedSubOrders = record.subOrderInformationLists; | |
3364 | - } | |
3365 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3366 | - if ( | |
3367 | - selectedSubOrders[i].orderStatus !== | |
3368 | - 'CREDIT_CONFIRM' | |
3369 | - ) { | |
3370 | - message.error('请选择[赊账待审核]的子订单进行审核'); | |
3371 | - return; | |
3395 | + {record.paths?.includes('creditAudit') ? ( | |
3396 | + <Button | |
3397 | + className="p-0" | |
3398 | + type="link" | |
3399 | + onClick={() => { | |
3400 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3401 | + record.id, | |
3402 | + ); | |
3403 | + setSelectedRows(selectedSubOrders); | |
3404 | + if (selectedSubOrders === undefined) { | |
3405 | + selectedSubOrders = record.subOrderInformationLists; | |
3372 | 3406 | } |
3373 | - } | |
3374 | - createOptObject(null, record.id); | |
3375 | - setCheckVisible(true); | |
3376 | - setOrderCheckType(CHECK_TYPE.CREDIT_AUDIT); | |
3377 | - }} | |
3378 | - > | |
3379 | - 赊账审核 | |
3380 | - </Button> | |
3381 | - ) : ( | |
3382 | - '' | |
3383 | - )} | |
3407 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3408 | + if ( | |
3409 | + selectedSubOrders[i].orderStatus !== | |
3410 | + 'CREDIT_CONFIRM' | |
3411 | + ) { | |
3412 | + message.error( | |
3413 | + '请选择[赊账待审核]的子订单进行审核', | |
3414 | + ); | |
3415 | + return; | |
3416 | + } | |
3417 | + } | |
3418 | + createOptObject(null, record.id); | |
3419 | + setCheckVisible(true); | |
3420 | + setOrderCheckType(CHECK_TYPE.CREDIT_AUDIT); | |
3421 | + }} | |
3422 | + > | |
3423 | + 赊账审核 | |
3424 | + </Button> | |
3425 | + ) : ( | |
3426 | + '' | |
3427 | + )} | |
3384 | 3428 | |
3385 | - {record.paths?.includes('editProductionTime') ? ( | |
3386 | - <Button | |
3387 | - className="p-0" | |
3388 | - type="link" | |
3389 | - onClick={() => { | |
3390 | - createOptObject(null, record.id); | |
3391 | - setProductionTimeModalVisible(true); | |
3392 | - }} | |
3393 | - > | |
3394 | - 生产时间 | |
3395 | - </Button> | |
3396 | - ) : ( | |
3397 | - '' | |
3398 | - )} | |
3429 | + {record.paths?.includes('editProductionTime') ? ( | |
3430 | + <Button | |
3431 | + className="p-0" | |
3432 | + type="link" | |
3433 | + onClick={() => { | |
3434 | + createOptObject(null, record.id); | |
3435 | + setProductionTimeModalVisible(true); | |
3436 | + }} | |
3437 | + > | |
3438 | + 生产时间 | |
3439 | + </Button> | |
3440 | + ) : ( | |
3441 | + '' | |
3442 | + )} | |
3399 | 3443 | |
3400 | - {record.paths?.includes('procureConvertProcure') ? ( | |
3401 | - <Button | |
3402 | - className="p-0" | |
3403 | - type="link" | |
3404 | - onClick={() => { | |
3405 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3406 | - record.id, | |
3407 | - ); | |
3408 | - if (selectedSubOrders === undefined) { | |
3409 | - selectedSubOrders = record.subOrderInformationLists; | |
3410 | - } | |
3444 | + {record.paths?.includes('procureConvertProcure') ? ( | |
3445 | + <Button | |
3446 | + className="p-0" | |
3447 | + type="link" | |
3448 | + onClick={() => { | |
3449 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3450 | + record.id, | |
3451 | + ); | |
3452 | + if (selectedSubOrders === undefined) { | |
3453 | + selectedSubOrders = record.subOrderInformationLists; | |
3454 | + } | |
3411 | 3455 | |
3412 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3413 | - if ( | |
3414 | - !selectedSubOrders[i].paths.includes( | |
3415 | - 'procureConvertProcure', | |
3416 | - ) | |
3417 | - ) { | |
3418 | - message.error('请选择允许转发的子订单进行转发'); | |
3419 | - return; | |
3456 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3457 | + if ( | |
3458 | + !selectedSubOrders[i].paths.includes( | |
3459 | + 'procureConvertProcure', | |
3460 | + ) | |
3461 | + ) { | |
3462 | + message.error('请选择允许转发的子订单进行转发'); | |
3463 | + return; | |
3464 | + } | |
3420 | 3465 | } |
3421 | - } | |
3422 | - createOptObject(null, record.id); | |
3423 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
3424 | - setProcureConvertModalVisible(true); | |
3425 | - }} | |
3426 | - > | |
3427 | - 转发 | |
3428 | - </Button> | |
3429 | - ) : ( | |
3430 | - '' | |
3431 | - )} | |
3432 | - {record.paths?.includes('sendProduct') ? ( | |
3433 | - <Button | |
3434 | - className="p-0" | |
3435 | - type="link" | |
3436 | - onClick={() => { | |
3437 | - if (!subOrderSelectedMap.get(record.id)?.length) { | |
3438 | - return message.error('请选择选择子订单'); | |
3439 | - } | |
3440 | - createOptObject(null, record.id); | |
3441 | - setDeliverVisible(true); | |
3442 | - setIsSendProduct(true); | |
3443 | - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
3444 | - }} | |
3445 | - > | |
3446 | - 仓库发货 | |
3447 | - </Button> | |
3448 | - ) : ( | |
3449 | - '' | |
3450 | - )} | |
3466 | + createOptObject(null, record.id); | |
3467 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
3468 | + setProcureConvertModalVisible(true); | |
3469 | + }} | |
3470 | + > | |
3471 | + 转发 | |
3472 | + </Button> | |
3473 | + ) : ( | |
3474 | + '' | |
3475 | + )} | |
3476 | + {record.paths?.includes('sendProduct') ? ( | |
3477 | + <Button | |
3478 | + className="p-0" | |
3479 | + type="link" | |
3480 | + onClick={() => { | |
3481 | + if (!subOrderSelectedMap.get(record.id)?.length) { | |
3482 | + return message.error('请选择选择子订单'); | |
3483 | + } | |
3484 | + createOptObject(null, record.id); | |
3485 | + setDeliverVisible(true); | |
3486 | + setIsSendProduct(true); | |
3487 | + setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
3488 | + }} | |
3489 | + > | |
3490 | + 仓库发货 | |
3491 | + </Button> | |
3492 | + ) : ( | |
3493 | + '' | |
3494 | + )} | |
3451 | 3495 | |
3452 | - {/* 供应商发货 */} | |
3453 | - {record.paths?.includes('supplierSendOrder') ? ( | |
3454 | - <Button | |
3455 | - className="p-0" | |
3456 | - type="link" | |
3457 | - onClick={() => { | |
3458 | - if (!subOrderSelectedMap.get(record.id)?.length) { | |
3459 | - return message.error('请选择选择子订单'); | |
3460 | - } | |
3461 | - createOptObject(null, record.id); | |
3462 | - setDeliverVisible(true); | |
3463 | - setIsSendProduct(true); | |
3464 | - setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
3465 | - }} | |
3466 | - > | |
3467 | - 供应商发货 | |
3468 | - </Button> | |
3469 | - ) : ( | |
3470 | - '' | |
3471 | - )} | |
3496 | + {/* 供应商发货 */} | |
3497 | + {record.paths?.includes('supplierSendOrder') ? ( | |
3498 | + <Button | |
3499 | + className="p-0" | |
3500 | + type="link" | |
3501 | + onClick={() => { | |
3502 | + if (!subOrderSelectedMap.get(record.id)?.length) { | |
3503 | + return message.error('请选择选择子订单'); | |
3504 | + } | |
3505 | + createOptObject(null, record.id); | |
3506 | + setDeliverVisible(true); | |
3507 | + setIsSendProduct(true); | |
3508 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
3509 | + }} | |
3510 | + > | |
3511 | + 供应商发货 | |
3512 | + </Button> | |
3513 | + ) : ( | |
3514 | + '' | |
3515 | + )} | |
3472 | 3516 | |
3473 | - {record.paths?.includes('procureSend') ? ( | |
3474 | - <Button | |
3475 | - className="p-0" | |
3476 | - type="link" | |
3477 | - onClick={() => { | |
3478 | - if (!subOrderSelectedMap.get(record.id)?.length) { | |
3479 | - return message.error('请选择选择子订单'); | |
3480 | - } | |
3481 | - createOptObject(null, record.id); | |
3482 | - setDeliverVisible(true); | |
3483 | - setIsSendProduct(true); | |
3484 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
3485 | - }} | |
3486 | - > | |
3487 | - {isSupplier() ? '发货' : '采购发货'} | |
3488 | - </Button> | |
3489 | - ) : ( | |
3490 | - '' | |
3491 | - )} | |
3517 | + {record.paths?.includes('procureSend') ? ( | |
3518 | + <Button | |
3519 | + className="p-0" | |
3520 | + type="link" | |
3521 | + onClick={() => { | |
3522 | + if (!subOrderSelectedMap.get(record.id)?.length) { | |
3523 | + return message.error('请选择选择子订单'); | |
3524 | + } | |
3525 | + createOptObject(null, record.id); | |
3526 | + setDeliverVisible(true); | |
3527 | + setIsSendProduct(true); | |
3528 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
3529 | + }} | |
3530 | + > | |
3531 | + {isSupplier() ? '发货' : '采购发货'} | |
3532 | + </Button> | |
3533 | + ) : ( | |
3534 | + '' | |
3535 | + )} | |
3492 | 3536 | |
3493 | - {record.paths?.includes('printOrder') ? ( | |
3494 | - <Button | |
3495 | - className="p-0" | |
3496 | - type="link" | |
3497 | - onClick={() => { | |
3498 | - const selectedSubOrders = subOrderSelectedMap.get( | |
3499 | - record.id, | |
3500 | - ); | |
3501 | - if (!selectedSubOrders?.length) { | |
3502 | - return message.error('请选择选择子订单'); | |
3503 | - } | |
3537 | + {record.paths?.includes('printOrder') ? ( | |
3538 | + <Button | |
3539 | + className="p-0" | |
3540 | + type="link" | |
3541 | + onClick={() => { | |
3542 | + const selectedSubOrders = subOrderSelectedMap.get( | |
3543 | + record.id, | |
3544 | + ); | |
3545 | + if (!selectedSubOrders?.length) { | |
3546 | + return message.error('请选择选择子订单'); | |
3547 | + } | |
3504 | 3548 | |
3505 | - for (let subOrderRecord of selectedSubOrders) { | |
3506 | - let paths = subOrderRecord.paths; | |
3507 | - if (!checkePrintable(paths)) { | |
3508 | - return message.error('请选择可以打印的子订单'); | |
3549 | + for (let subOrderRecord of selectedSubOrders) { | |
3550 | + let paths = subOrderRecord.paths; | |
3551 | + if (!checkePrintable(paths)) { | |
3552 | + return message.error('请选择可以打印的子订单'); | |
3553 | + } | |
3509 | 3554 | } |
3510 | - } | |
3511 | - createOptObject(null, record.id); | |
3512 | - setOrderPrintVisible(true); | |
3513 | - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
3514 | - }} | |
3515 | - > | |
3516 | - 仓库打印 | |
3517 | - </Button> | |
3518 | - ) : ( | |
3519 | - '' | |
3520 | - )} | |
3555 | + createOptObject(null, record.id); | |
3556 | + setOrderPrintVisible(true); | |
3557 | + setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
3558 | + }} | |
3559 | + > | |
3560 | + 仓库打印 | |
3561 | + </Button> | |
3562 | + ) : ( | |
3563 | + '' | |
3564 | + )} | |
3521 | 3565 | |
3522 | - {record.paths?.includes('supplierPrint') ? ( | |
3523 | - <Button | |
3524 | - className="p-0" | |
3525 | - type="link" | |
3526 | - onClick={() => { | |
3527 | - if (!subOrderSelectedMap.get(record.id)?.length) { | |
3528 | - return message.error('请选择选择子订单'); | |
3529 | - } | |
3566 | + {record.paths?.includes('supplierPrint') ? ( | |
3567 | + <Button | |
3568 | + className="p-0" | |
3569 | + type="link" | |
3570 | + onClick={() => { | |
3571 | + if (!subOrderSelectedMap.get(record.id)?.length) { | |
3572 | + return message.error('请选择选择子订单'); | |
3573 | + } | |
3530 | 3574 | |
3531 | - createOptObject(null, record.id); | |
3532 | - setOrderPrintVisible(true); | |
3533 | - setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
3534 | - }} | |
3535 | - > | |
3536 | - 供应商打印 | |
3537 | - </Button> | |
3538 | - ) : ( | |
3539 | - '' | |
3540 | - )} | |
3575 | + createOptObject(null, record.id); | |
3576 | + setOrderPrintVisible(true); | |
3577 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
3578 | + }} | |
3579 | + > | |
3580 | + 供应商打印 | |
3581 | + </Button> | |
3582 | + ) : ( | |
3583 | + '' | |
3584 | + )} | |
3541 | 3585 | |
3542 | - {record.paths?.includes('rePrintOrder') ? ( | |
3543 | - <Button | |
3544 | - className="p-0" | |
3545 | - type="link" | |
3546 | - onClick={() => { | |
3547 | - if (!subOrderSelectedMap.get(record.id)?.length) { | |
3548 | - return message.error('请选择选择子订单'); | |
3549 | - } | |
3550 | - createOptObject(null, record.id); | |
3551 | - setOrderPrintVisible(true); | |
3552 | - setIsRePrintOrder(true); | |
3553 | - }} | |
3554 | - > | |
3555 | - 重新打印 | |
3556 | - </Button> | |
3557 | - ) : ( | |
3558 | - '' | |
3559 | - )} | |
3560 | - {record.paths?.includes('confirmReceipt') ? ( | |
3561 | - <Button | |
3562 | - className="p-0" | |
3563 | - type="link" | |
3564 | - onClick={() => { | |
3565 | - createOptObject(null, record.id); | |
3566 | - setConfirmReceiptVisible(true); | |
3567 | - }} | |
3568 | - > | |
3569 | - 确认收货 | |
3570 | - </Button> | |
3571 | - ) : ( | |
3572 | - '' | |
3573 | - )} | |
3574 | - {record.paths?.includes('modifySendInformation') ? ( | |
3575 | - <Button | |
3576 | - className="p-0" | |
3577 | - type="link" | |
3578 | - onClick={() => { | |
3579 | - if (!subOrderSelectedMap.get(record.id)?.length) { | |
3580 | - return message.error( | |
3581 | - '请选择已经发货或者已经确认收货的子订单', | |
3582 | - ); | |
3583 | - } | |
3584 | - for (let row of subOrderSelectedMap.get(record.id)) { | |
3585 | - if ( | |
3586 | - row.orderStatus !== 'CONFIRM_RECEIPT' && | |
3587 | - row.orderStatus !== 'SHIPPED' | |
3588 | - ) { | |
3586 | + {record.paths?.includes('rePrintOrder') ? ( | |
3587 | + <Button | |
3588 | + className="p-0" | |
3589 | + type="link" | |
3590 | + onClick={() => { | |
3591 | + if (!subOrderSelectedMap.get(record.id)?.length) { | |
3592 | + return message.error('请选择选择子订单'); | |
3593 | + } | |
3594 | + createOptObject(null, record.id); | |
3595 | + setOrderPrintVisible(true); | |
3596 | + setIsRePrintOrder(true); | |
3597 | + }} | |
3598 | + > | |
3599 | + 重新打印 | |
3600 | + </Button> | |
3601 | + ) : ( | |
3602 | + '' | |
3603 | + )} | |
3604 | + {record.paths?.includes('confirmReceipt') ? ( | |
3605 | + <Button | |
3606 | + className="p-0" | |
3607 | + type="link" | |
3608 | + onClick={() => { | |
3609 | + createOptObject(null, record.id); | |
3610 | + setConfirmReceiptVisible(true); | |
3611 | + }} | |
3612 | + > | |
3613 | + 确认收货 | |
3614 | + </Button> | |
3615 | + ) : ( | |
3616 | + '' | |
3617 | + )} | |
3618 | + {record.paths?.includes('modifySendInformation') ? ( | |
3619 | + <Button | |
3620 | + className="p-0" | |
3621 | + type="link" | |
3622 | + onClick={() => { | |
3623 | + if (!subOrderSelectedMap.get(record.id)?.length) { | |
3589 | 3624 | return message.error( |
3590 | 3625 | '请选择已经发货或者已经确认收货的子订单', |
3591 | 3626 | ); |
3592 | 3627 | } |
3593 | - } | |
3594 | - createOptObject(null, record.id); | |
3595 | - setDeliverVisible(true); | |
3596 | - setIsSendProduct(false); | |
3597 | - }} | |
3598 | - > | |
3599 | - 修改发货信息 | |
3600 | - </Button> | |
3601 | - ) : ( | |
3602 | - '' | |
3603 | - )} | |
3604 | - {record.paths?.includes('invoicing') ? ( | |
3605 | - <Button | |
3606 | - type="link" | |
3607 | - className="p-0" | |
3608 | - onClick={() => { | |
3609 | - createOptObject(null, record.id); | |
3610 | - setFinancialVisible(true); | |
3611 | - setIsEdit(false); | |
3612 | - }} | |
3613 | - > | |
3614 | - 开票 | |
3615 | - </Button> | |
3616 | - ) : ( | |
3617 | - '' | |
3618 | - )} | |
3619 | - | |
3620 | - {record.paths?.includes('applyInvoicing_old') ? ( | |
3621 | - <Button | |
3622 | - type="link" | |
3623 | - className="p-0" | |
3624 | - onClick={() => { | |
3625 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3626 | - record.id, | |
3627 | - ); | |
3628 | - if (selectedSubOrders === undefined) { | |
3629 | - selectedSubOrders = record.subOrderInformationLists; | |
3630 | - } | |
3631 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3632 | - if ( | |
3633 | - selectedSubOrders[i].invoicingStatus === | |
3634 | - 'UN_INVOICE' || | |
3635 | - selectedSubOrders[i].afterInvoicingStatus === | |
3636 | - 'APPLY_FOR_INVOICING' | |
3637 | - ) { | |
3638 | - message.error( | |
3639 | - '请选择需要开票且未申请开票的子订单进行申请', | |
3640 | - ); | |
3641 | - return; | |
3628 | + for (let row of subOrderSelectedMap.get(record.id)) { | |
3629 | + if ( | |
3630 | + row.orderStatus !== 'CONFIRM_RECEIPT' && | |
3631 | + row.orderStatus !== 'SHIPPED' | |
3632 | + ) { | |
3633 | + return message.error( | |
3634 | + '请选择已经发货或者已经确认收货的子订单', | |
3635 | + ); | |
3636 | + } | |
3642 | 3637 | } |
3643 | - } | |
3644 | - | |
3645 | - createOptObject(null, record.id); | |
3646 | - setApplyForInvoicingVisible(true); | |
3647 | - setIsEdit(false); | |
3648 | - setIsMainOrder(false); | |
3649 | - }} | |
3650 | - > | |
3651 | - 申请开票(旧) | |
3652 | - </Button> | |
3653 | - ) : ( | |
3654 | - '' | |
3655 | - )} | |
3638 | + createOptObject(null, record.id); | |
3639 | + setDeliverVisible(true); | |
3640 | + setIsSendProduct(false); | |
3641 | + }} | |
3642 | + > | |
3643 | + 修改发货信息 | |
3644 | + </Button> | |
3645 | + ) : ( | |
3646 | + '' | |
3647 | + )} | |
3648 | + {record.paths?.includes('invoicing') ? ( | |
3649 | + <Button | |
3650 | + type="link" | |
3651 | + className="p-0" | |
3652 | + onClick={() => { | |
3653 | + createOptObject(null, record.id); | |
3654 | + setFinancialVisible(true); | |
3655 | + setIsEdit(false); | |
3656 | + }} | |
3657 | + > | |
3658 | + 开票 | |
3659 | + </Button> | |
3660 | + ) : ( | |
3661 | + '' | |
3662 | + )} | |
3656 | 3663 | |
3657 | - {record.paths?.includes('applyInvoicing') ? ( | |
3658 | - <Button | |
3659 | - type="link" | |
3660 | - className="p-0" | |
3661 | - onClick={() => { | |
3662 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3663 | - record.id, | |
3664 | - ); | |
3665 | - if (selectedSubOrders === undefined) { | |
3666 | - selectedSubOrders = record.subOrderInformationLists; | |
3667 | - } | |
3668 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3669 | - if ( | |
3670 | - selectedSubOrders[i].invoicingStatus === | |
3671 | - 'UN_INVOICE' || | |
3672 | - selectedSubOrders[i].afterInvoicingStatus === | |
3673 | - 'APPLY_FOR_INVOICING' | |
3674 | - ) { | |
3675 | - message.error( | |
3676 | - '请选择需要开票且未申请开票的子订单进行申请', | |
3677 | - ); | |
3678 | - return; | |
3664 | + {record.paths?.includes('applyInvoicing_old') ? ( | |
3665 | + <Button | |
3666 | + type="link" | |
3667 | + className="p-0" | |
3668 | + onClick={() => { | |
3669 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3670 | + record.id, | |
3671 | + ); | |
3672 | + if (selectedSubOrders === undefined) { | |
3673 | + selectedSubOrders = record.subOrderInformationLists; | |
3679 | 3674 | } |
3680 | - } | |
3681 | - | |
3682 | - createOptObject(null, record.id); | |
3683 | - setInvoicingDrawerFormVisible(true); | |
3684 | - setIsEdit(false); | |
3685 | - setIsMainOrder(false); | |
3686 | - }} | |
3687 | - > | |
3688 | - 申请开票(新) | |
3689 | - </Button> | |
3690 | - ) : ( | |
3691 | - '' | |
3692 | - )} | |
3693 | - | |
3694 | - {record.paths?.includes('updateOrder') ? ( | |
3695 | - <Button | |
3696 | - className="p-0" | |
3697 | - type="link" | |
3698 | - onClick={() => { | |
3699 | - //勾选的子订单:如果有勾选,后面只校验有勾选的 | |
3700 | - | |
3701 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3702 | - record.id, | |
3703 | - ); | |
3704 | - if ( | |
3705 | - selectedSubOrders === undefined || | |
3706 | - selectedSubOrders.length === 0 | |
3707 | - ) { | |
3708 | - selectedSubOrders = record.subOrderInformationLists; | |
3709 | - } | |
3710 | - for ( | |
3711 | - let index = 0; | |
3712 | - index < selectedSubOrders.length; | |
3713 | - index++ | |
3714 | - ) { | |
3715 | - let orderStatus = | |
3716 | - selectedSubOrders[index].orderStatus; | |
3717 | - //仓库管理员在审核之后的任何时候都可以编辑 | |
3718 | - if ( | |
3719 | - roleCode !== 'warehouseKeeper' && | |
3720 | - roleCode !== 'admin' | |
3721 | - ) { | |
3722 | - //是审核通过及之后的订单 | |
3675 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3723 | 3676 | if ( |
3724 | - orderStatus !== 'UNAUDITED' && | |
3725 | - orderStatus !== 'PROCURE_REJECT' && | |
3726 | - orderStatus !== 'AUDIT_FAILED' && | |
3727 | - orderStatus !== 'LEADER_PROCESS' && | |
3728 | - orderStatus !== 'SALES_CONFIRM' && | |
3729 | - orderStatus !== 'CREDIT_CONFIRM' | |
3677 | + selectedSubOrders[i].invoicingStatus === | |
3678 | + 'UN_INVOICE' || | |
3679 | + selectedSubOrders[i].afterInvoicingStatus === | |
3680 | + 'APPLY_FOR_INVOICING' | |
3730 | 3681 | ) { |
3731 | 3682 | message.error( |
3732 | - '请选择【未审核、审核失败、销售待确认、赊账待审核】的订单进行编辑', | |
3683 | + '请选择需要开票且未申请开票的子订单进行申请', | |
3733 | 3684 | ); |
3734 | 3685 | return; |
3735 | 3686 | } |
3736 | - } else { | |
3737 | - //仓库管理员只能编辑是还未审核的订单 | |
3687 | + } | |
3688 | + | |
3689 | + createOptObject(null, record.id); | |
3690 | + setApplyForInvoicingVisible(true); | |
3691 | + setIsEdit(false); | |
3692 | + setIsMainOrder(false); | |
3693 | + }} | |
3694 | + > | |
3695 | + 申请开票(旧) | |
3696 | + </Button> | |
3697 | + ) : ( | |
3698 | + '' | |
3699 | + )} | |
3700 | + | |
3701 | + {record.paths?.includes('applyInvoicing') ? ( | |
3702 | + <Button | |
3703 | + type="link" | |
3704 | + className="p-0" | |
3705 | + onClick={() => { | |
3706 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3707 | + record.id, | |
3708 | + ); | |
3709 | + if (selectedSubOrders === undefined) { | |
3710 | + selectedSubOrders = record.subOrderInformationLists; | |
3711 | + } | |
3712 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3738 | 3713 | if ( |
3739 | - roleCode !== 'admin' && | |
3740 | - (orderStatus === 'UNAUDITED' || | |
3741 | - orderStatus === 'PROCURE_REJECT' || | |
3742 | - orderStatus === 'AUDIT_FAILED') | |
3714 | + selectedSubOrders[i].invoicingStatus === | |
3715 | + 'UN_INVOICE' || | |
3716 | + selectedSubOrders[i].afterInvoicingStatus === | |
3717 | + 'APPLY_FOR_INVOICING' | |
3743 | 3718 | ) { |
3744 | - message.error('请选择已审核的订单进行编辑'); | |
3719 | + message.error( | |
3720 | + '请选择需要开票且未申请开票的子订单进行申请', | |
3721 | + ); | |
3745 | 3722 | return; |
3746 | 3723 | } |
3747 | 3724 | } |
3748 | - } | |
3749 | 3725 | |
3750 | - createOptObject(null, record.id); | |
3751 | - setOrderDrawerVisible(true); | |
3752 | - setOrderOptType('edit'); | |
3753 | - }} | |
3754 | - > | |
3755 | - 编辑 | |
3756 | - </Button> | |
3757 | - ) : ( | |
3758 | - '' | |
3759 | - )} | |
3726 | + createOptObject(null, record.id); | |
3727 | + setInvoicingDrawerFormVisible(true); | |
3728 | + setIsEdit(false); | |
3729 | + setIsMainOrder(false); | |
3730 | + }} | |
3731 | + > | |
3732 | + 申请开票(新) | |
3733 | + </Button> | |
3734 | + ) : ( | |
3735 | + '' | |
3736 | + )} | |
3760 | 3737 | |
3761 | - {record?.subOrderInformationLists[0].paths?.includes( | |
3762 | - 'noNeedInvoicingEdit', | |
3763 | - ) ? ( | |
3764 | - <Button | |
3765 | - className="p-0" | |
3766 | - type="link" | |
3767 | - onClick={() => { | |
3768 | - createOptObject(null, record.id); | |
3769 | - setFinancialEditVisible(true); | |
3770 | - setIsMainOrder(true); | |
3771 | - }} | |
3772 | - > | |
3773 | - 财务编辑 | |
3774 | - </Button> | |
3775 | - ) : ( | |
3776 | - '' | |
3777 | - )} | |
3738 | + {record.paths?.includes('updateOrder') ? ( | |
3739 | + <Button | |
3740 | + className="p-0" | |
3741 | + type="link" | |
3742 | + onClick={() => { | |
3743 | + //勾选的子订单:如果有勾选,后面只校验有勾选的 | |
3778 | 3744 | |
3779 | - {record.paths?.includes('checkOrder') ? ( | |
3780 | - <Button | |
3781 | - className="p-0" | |
3782 | - type="link" | |
3783 | - onClick={() => { | |
3784 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3785 | - record.id, | |
3786 | - ); | |
3787 | - setSelectedRows(selectedSubOrders); | |
3788 | - if (selectedSubOrders === undefined) { | |
3789 | - selectedSubOrders = record.subOrderInformationLists; | |
3790 | - } | |
3791 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3792 | - let orderStatus = selectedSubOrders[i].orderStatus; | |
3745 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3746 | + record.id, | |
3747 | + ); | |
3793 | 3748 | if ( |
3794 | - orderStatus !== 'UNAUDITED' && | |
3795 | - orderStatus !== 'PROCURE_REJECT' && | |
3796 | - orderStatus !== 'FINANCE_PROCESS' && | |
3797 | - orderStatus !== 'LEADER_AUDITED' | |
3749 | + selectedSubOrders === undefined || | |
3750 | + selectedSubOrders.length === 0 | |
3798 | 3751 | ) { |
3799 | - message.error( | |
3800 | - '请选择未审核或者领导已审核的子订单进行审核', | |
3801 | - ); | |
3802 | - return; | |
3752 | + selectedSubOrders = record.subOrderInformationLists; | |
3753 | + } | |
3754 | + for ( | |
3755 | + let index = 0; | |
3756 | + index < selectedSubOrders.length; | |
3757 | + index++ | |
3758 | + ) { | |
3759 | + let orderStatus = | |
3760 | + selectedSubOrders[index].orderStatus; | |
3761 | + //仓库管理员在审核之后的任何时候都可以编辑 | |
3762 | + if ( | |
3763 | + roleCode !== 'warehouseKeeper' && | |
3764 | + roleCode !== 'admin' | |
3765 | + ) { | |
3766 | + //是审核通过及之后的订单 | |
3767 | + if ( | |
3768 | + orderStatus !== 'UNAUDITED' && | |
3769 | + orderStatus !== 'PROCURE_REJECT' && | |
3770 | + orderStatus !== 'AUDIT_FAILED' && | |
3771 | + orderStatus !== 'LEADER_PROCESS' && | |
3772 | + orderStatus !== 'SALES_CONFIRM' && | |
3773 | + orderStatus !== 'CREDIT_CONFIRM' | |
3774 | + ) { | |
3775 | + message.error( | |
3776 | + '请选择【未审核、审核失败、销售待确认、赊账待审核】的订单进行编辑', | |
3777 | + ); | |
3778 | + return; | |
3779 | + } | |
3780 | + } else { | |
3781 | + //仓库管理员只能编辑是还未审核的订单 | |
3782 | + if ( | |
3783 | + roleCode !== 'admin' && | |
3784 | + (orderStatus === 'UNAUDITED' || | |
3785 | + orderStatus === 'PROCURE_REJECT' || | |
3786 | + orderStatus === 'AUDIT_FAILED') | |
3787 | + ) { | |
3788 | + message.error('请选择已审核的订单进行编辑'); | |
3789 | + return; | |
3790 | + } | |
3791 | + } | |
3803 | 3792 | } |
3804 | - } | |
3805 | 3793 | |
3806 | - createOptObject(null, record.id); | |
3807 | - setCheckVisible(true); | |
3808 | - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
3809 | - }} | |
3810 | - > | |
3811 | - 审核 | |
3812 | - </Button> | |
3813 | - ) : ( | |
3814 | - '' | |
3815 | - )} | |
3794 | + createOptObject(null, record.id); | |
3795 | + setOrderDrawerVisible(true); | |
3796 | + setOrderOptType('edit'); | |
3797 | + }} | |
3798 | + > | |
3799 | + 编辑 | |
3800 | + </Button> | |
3801 | + ) : ( | |
3802 | + '' | |
3803 | + )} | |
3816 | 3804 | |
3817 | - {record.paths?.includes('afterSalesCheck') ? ( | |
3818 | - <Button | |
3819 | - className="p-0" | |
3820 | - type="link" | |
3821 | - onClick={() => { | |
3822 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3823 | - record.id, | |
3824 | - ); | |
3825 | - setSelectedRows(selectedSubOrders); | |
3826 | - if (selectedSubOrders === undefined) { | |
3827 | - selectedSubOrders = record.subOrderInformationLists; | |
3828 | - } | |
3829 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3830 | - if ( | |
3831 | - selectedSubOrders[i].orderStatus !== | |
3832 | - 'IN_AFTER_SALES' | |
3833 | - ) { | |
3834 | - message.error('请选择售后中的子订单进行审核'); | |
3835 | - return; | |
3805 | + {record?.subOrderInformationLists[0].paths?.includes( | |
3806 | + 'noNeedInvoicingEdit', | |
3807 | + ) ? ( | |
3808 | + <Button | |
3809 | + className="p-0" | |
3810 | + type="link" | |
3811 | + onClick={() => { | |
3812 | + createOptObject(null, record.id); | |
3813 | + setFinancialEditVisible(true); | |
3814 | + setIsMainOrder(true); | |
3815 | + }} | |
3816 | + > | |
3817 | + 财务编辑 | |
3818 | + </Button> | |
3819 | + ) : ( | |
3820 | + '' | |
3821 | + )} | |
3822 | + | |
3823 | + {record.paths?.includes('checkOrder') ? ( | |
3824 | + <Button | |
3825 | + className="p-0" | |
3826 | + type="link" | |
3827 | + onClick={() => { | |
3828 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3829 | + record.id, | |
3830 | + ); | |
3831 | + setSelectedRows(selectedSubOrders); | |
3832 | + if (selectedSubOrders === undefined) { | |
3833 | + selectedSubOrders = record.subOrderInformationLists; | |
3834 | + } | |
3835 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3836 | + let orderStatus = selectedSubOrders[i].orderStatus; | |
3837 | + if ( | |
3838 | + orderStatus !== 'UNAUDITED' && | |
3839 | + orderStatus !== 'PROCURE_REJECT' && | |
3840 | + orderStatus !== 'FINANCE_PROCESS' && | |
3841 | + orderStatus !== 'LEADER_AUDITED' | |
3842 | + ) { | |
3843 | + message.error( | |
3844 | + '请选择未审核或者领导已审核的子订单进行审核', | |
3845 | + ); | |
3846 | + return; | |
3847 | + } | |
3836 | 3848 | } |
3837 | - } | |
3838 | 3849 | |
3839 | - createOptObject(null, record.id); | |
3840 | - setCheckVisible(true); | |
3841 | - setOrderCheckType(CHECK_TYPE.AFTER_SALES); | |
3842 | - }} | |
3843 | - > | |
3844 | - 售后审核 | |
3845 | - </Button> | |
3846 | - ) : ( | |
3847 | - '' | |
3848 | - )} | |
3850 | + createOptObject(null, record.id); | |
3851 | + setCheckVisible(true); | |
3852 | + setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
3853 | + }} | |
3854 | + > | |
3855 | + 审核 | |
3856 | + </Button> | |
3857 | + ) : ( | |
3858 | + '' | |
3859 | + )} | |
3849 | 3860 | |
3850 | - {record.paths?.includes('afterSalesConfirm') ? ( | |
3851 | - <Button | |
3852 | - className="p-0" | |
3853 | - type="link" | |
3854 | - onClick={() => { | |
3855 | - setCurrentMainId(record.id); | |
3856 | - createOptObject(null, record.id); | |
3857 | - setStoreCheckModalVisible(true); | |
3858 | - setOrderCheckType(CHECK_TYPE.AFTER_SALES); | |
3859 | - }} | |
3860 | - > | |
3861 | - 仓库确认 | |
3862 | - </Button> | |
3863 | - ) : ( | |
3864 | - '' | |
3865 | - )} | |
3861 | + {record.paths?.includes('afterSalesCheck') ? ( | |
3862 | + <Button | |
3863 | + className="p-0" | |
3864 | + type="link" | |
3865 | + onClick={() => { | |
3866 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3867 | + record.id, | |
3868 | + ); | |
3869 | + setSelectedRows(selectedSubOrders); | |
3870 | + if (selectedSubOrders === undefined) { | |
3871 | + selectedSubOrders = record.subOrderInformationLists; | |
3872 | + } | |
3873 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3874 | + if ( | |
3875 | + selectedSubOrders[i].orderStatus !== | |
3876 | + 'IN_AFTER_SALES' | |
3877 | + ) { | |
3878 | + message.error('请选择售后中的子订单进行审核'); | |
3879 | + return; | |
3880 | + } | |
3881 | + } | |
3866 | 3882 | |
3867 | - {record.paths?.includes('noNeedSend') ? ( | |
3868 | - <ButtonConfirm | |
3869 | - className="p-0" | |
3870 | - title="此订单是否无需发货?" | |
3871 | - text="无需发货" | |
3872 | - onConfirm={async () => { | |
3873 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3874 | - record.id, | |
3875 | - ); | |
3876 | - if (selectedSubOrders === undefined) { | |
3877 | - selectedSubOrders = record.subOrderInformationLists; | |
3878 | - } | |
3879 | - setSelectedRows(selectedSubOrders); | |
3880 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3881 | - if ( | |
3882 | - selectedSubOrders[i].orderStatus !== 'AUDITED' && | |
3883 | - selectedSubOrders[i].orderStatus !== | |
3884 | - 'PROCURE_PROCESS' && | |
3885 | - selectedSubOrders[i].orderStatus !== | |
3886 | - 'PROCURE_PROCESS_FOR_MINE' && | |
3887 | - selectedSubOrders[i].orderStatus !== | |
3888 | - 'PROCURE_WAIT_SHIP' && | |
3889 | - selectedSubOrders[i].orderStatus !== | |
3890 | - 'SUPPLIER_WAIT_SHIP' && | |
3891 | - selectedSubOrders[i].orderStatus !== 'WAIT_SHIP' | |
3892 | - ) { | |
3893 | - message.error( | |
3894 | - '请选择未发货的子订单进行无需发货操作', | |
3895 | - ); | |
3896 | - return; | |
3883 | + createOptObject(null, record.id); | |
3884 | + setCheckVisible(true); | |
3885 | + setOrderCheckType(CHECK_TYPE.AFTER_SALES); | |
3886 | + }} | |
3887 | + > | |
3888 | + 售后审核 | |
3889 | + </Button> | |
3890 | + ) : ( | |
3891 | + '' | |
3892 | + )} | |
3893 | + | |
3894 | + {record.paths?.includes('afterSalesConfirm') ? ( | |
3895 | + <Button | |
3896 | + className="p-0" | |
3897 | + type="link" | |
3898 | + onClick={() => { | |
3899 | + setCurrentMainId(record.id); | |
3900 | + createOptObject(null, record.id); | |
3901 | + setStoreCheckModalVisible(true); | |
3902 | + setOrderCheckType(CHECK_TYPE.AFTER_SALES); | |
3903 | + }} | |
3904 | + > | |
3905 | + 仓库确认 | |
3906 | + </Button> | |
3907 | + ) : ( | |
3908 | + '' | |
3909 | + )} | |
3910 | + | |
3911 | + {record.paths?.includes('noNeedSend') ? ( | |
3912 | + <ButtonConfirm | |
3913 | + className="p-0" | |
3914 | + title="此订单是否无需发货?" | |
3915 | + text="无需发货" | |
3916 | + onConfirm={async () => { | |
3917 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3918 | + record.id, | |
3919 | + ); | |
3920 | + if (selectedSubOrders === undefined) { | |
3921 | + selectedSubOrders = record.subOrderInformationLists; | |
3922 | + } | |
3923 | + setSelectedRows(selectedSubOrders); | |
3924 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3925 | + if ( | |
3926 | + selectedSubOrders[i].orderStatus !== 'AUDITED' && | |
3927 | + selectedSubOrders[i].orderStatus !== | |
3928 | + 'PROCURE_PROCESS' && | |
3929 | + selectedSubOrders[i].orderStatus !== | |
3930 | + 'PROCURE_PROCESS_FOR_MINE' && | |
3931 | + selectedSubOrders[i].orderStatus !== | |
3932 | + 'PROCURE_WAIT_SHIP' && | |
3933 | + selectedSubOrders[i].orderStatus !== | |
3934 | + 'SUPPLIER_WAIT_SHIP' && | |
3935 | + selectedSubOrders[i].orderStatus !== 'WAIT_SHIP' | |
3936 | + ) { | |
3937 | + message.error( | |
3938 | + '请选择未发货的子订单进行无需发货操作', | |
3939 | + ); | |
3940 | + return; | |
3941 | + } | |
3897 | 3942 | } |
3898 | - } | |
3899 | 3943 | |
3900 | - const data = await postServiceOrderNoNeedSend({ | |
3901 | - data: { | |
3902 | - ids: selectedSubOrders.map((item) => { | |
3903 | - return item.id; | |
3904 | - }), | |
3905 | - }, | |
3906 | - }); | |
3907 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
3908 | - message.success(data.message); | |
3909 | - refreshTable(); | |
3910 | - } | |
3911 | - }} | |
3912 | - /> | |
3913 | - ) : ( | |
3914 | - '' | |
3915 | - )} | |
3944 | + const data = await postServiceOrderNoNeedSend({ | |
3945 | + data: { | |
3946 | + ids: selectedSubOrders.map((item) => { | |
3947 | + return item.id; | |
3948 | + }), | |
3949 | + }, | |
3950 | + }); | |
3951 | + if (data.result === RESPONSE_CODE.SUCCESS) { | |
3952 | + message.success(data.message); | |
3953 | + refreshTable(); | |
3954 | + } | |
3955 | + }} | |
3956 | + /> | |
3957 | + ) : ( | |
3958 | + '' | |
3959 | + )} | |
3916 | 3960 | |
3917 | - {record.paths?.includes('saleCancelInvoicing_old') ? ( | |
3918 | - <ButtonConfirm | |
3919 | - className="p-0" | |
3920 | - title="确认取消申请开票?" | |
3921 | - text="取消申请(旧)" | |
3922 | - onConfirm={async () => { | |
3923 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3924 | - record.id, | |
3925 | - ); | |
3926 | - if (selectedSubOrders === undefined) { | |
3927 | - selectedSubOrders = record.subOrderInformationLists; | |
3928 | - } | |
3961 | + {record.paths?.includes('saleCancelInvoicing_old') ? ( | |
3962 | + <ButtonConfirm | |
3963 | + className="p-0" | |
3964 | + title="确认取消申请开票?" | |
3965 | + text="取消申请(旧)" | |
3966 | + onConfirm={async () => { | |
3967 | + let selectedSubOrders = subOrderSelectedMap.get( | |
3968 | + record.id, | |
3969 | + ); | |
3970 | + if (selectedSubOrders === undefined) { | |
3971 | + selectedSubOrders = record.subOrderInformationLists; | |
3972 | + } | |
3929 | 3973 | |
3930 | - console.log(selectedSubOrders); | |
3931 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3932 | - if ( | |
3933 | - selectedSubOrders[i].afterInvoicingStatus !== | |
3934 | - 'APPLY_FOR_INVOICING' | |
3935 | - ) { | |
3936 | - message.error( | |
3937 | - '请选择已[申请开票]的子订单进行取消申请', | |
3938 | - ); | |
3939 | - return; | |
3974 | + console.log(selectedSubOrders); | |
3975 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
3976 | + if ( | |
3977 | + selectedSubOrders[i].afterInvoicingStatus !== | |
3978 | + 'APPLY_FOR_INVOICING' | |
3979 | + ) { | |
3980 | + message.error( | |
3981 | + '请选择已[申请开票]的子订单进行取消申请', | |
3982 | + ); | |
3983 | + return; | |
3984 | + } | |
3940 | 3985 | } |
3941 | - } | |
3942 | - let res = await postServiceOrderSaleCancelInvoicing({ | |
3943 | - data: { | |
3944 | - subOrderIds: selectedSubOrders.map((item) => { | |
3945 | - return item.id; | |
3946 | - }), | |
3947 | - }, | |
3948 | - }); | |
3986 | + let res = await postServiceOrderSaleCancelInvoicing({ | |
3987 | + data: { | |
3988 | + subOrderIds: selectedSubOrders.map((item) => { | |
3989 | + return item.id; | |
3990 | + }), | |
3991 | + }, | |
3992 | + }); | |
3949 | 3993 | |
3950 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3951 | - message.success(res.message); | |
3952 | - refreshTable(); | |
3953 | - } | |
3954 | - }} | |
3955 | - /> | |
3956 | - ) : ( | |
3957 | - '' | |
3958 | - )} | |
3959 | - {/* 财务审核:主订单暂无 */} | |
3960 | - {record.paths?.includes('financeCheckOrder') ? ( | |
3961 | - <Button | |
3962 | - className="p-0" | |
3963 | - type="link" | |
3964 | - onClick={() => { | |
3965 | - let selectedSubOrders = subOrderSelectedMap.get( | |
3966 | - record.id, | |
3967 | - ); | |
3968 | - setSelectedRows(selectedSubOrders); | |
3969 | - if (selectedSubOrders === undefined) { | |
3970 | - selectedSubOrders = record.subOrderInformationLists; | |
3971 | - } | |
3972 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
3973 | - if ( | |
3974 | - selectedSubOrders[i].orderStatus !== 'UNAUDITED' && | |
3975 | - selectedSubOrders[i].orderStatus !== | |
3976 | - 'PROCURE_REJECT' && | |
3977 | - selectedSubOrders[i].orderStatus !== | |
3978 | - 'FINANCE_PROCESS' && | |
3979 | - selectedSubOrders[i].orderStatus !== | |
3980 | - 'LEADER_AUDITED' | |
3981 | - ) { | |
3982 | - message.error( | |
3983 | - '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核', | |
3984 | - ); | |
3985 | - return; | |
3994 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
3995 | + message.success(res.message); | |
3996 | + refreshTable(); | |
3986 | 3997 | } |
3987 | - } | |
3988 | - createOptObject(null, record.id); | |
3989 | - setCheckVisible(true); | |
3990 | - setOrderCheckType(CHECK_TYPE.FINALCIAL); | |
3991 | - }} | |
3992 | - > | |
3993 | - 财务审核 | |
3994 | - </Button> | |
3995 | - ) : ( | |
3996 | - '' | |
3997 | - )} | |
3998 | + }} | |
3999 | + /> | |
4000 | + ) : ( | |
4001 | + '' | |
4002 | + )} | |
4003 | + {/* 财务审核:主订单暂无 */} | |
4004 | + {record.paths?.includes('financeCheckOrder') ? ( | |
4005 | + <Button | |
4006 | + className="p-0" | |
4007 | + type="link" | |
4008 | + onClick={() => { | |
4009 | + let selectedSubOrders = subOrderSelectedMap.get( | |
4010 | + record.id, | |
4011 | + ); | |
4012 | + setSelectedRows(selectedSubOrders); | |
4013 | + if (selectedSubOrders === undefined) { | |
4014 | + selectedSubOrders = record.subOrderInformationLists; | |
4015 | + } | |
4016 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
4017 | + if ( | |
4018 | + selectedSubOrders[i].orderStatus !== | |
4019 | + 'UNAUDITED' && | |
4020 | + selectedSubOrders[i].orderStatus !== | |
4021 | + 'PROCURE_REJECT' && | |
4022 | + selectedSubOrders[i].orderStatus !== | |
4023 | + 'FINANCE_PROCESS' && | |
4024 | + selectedSubOrders[i].orderStatus !== | |
4025 | + 'LEADER_AUDITED' | |
4026 | + ) { | |
4027 | + message.error( | |
4028 | + '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核', | |
4029 | + ); | |
4030 | + return; | |
4031 | + } | |
4032 | + } | |
4033 | + createOptObject(null, record.id); | |
4034 | + setCheckVisible(true); | |
4035 | + setOrderCheckType(CHECK_TYPE.FINALCIAL); | |
4036 | + }} | |
4037 | + > | |
4038 | + 财务审核 | |
4039 | + </Button> | |
4040 | + ) : ( | |
4041 | + '' | |
4042 | + )} | |
3998 | 4043 | |
3999 | - {/* 采购审核 */} | |
4000 | - {record.paths?.includes('procureCheckOrder') ? ( | |
4001 | - <Button | |
4002 | - className="p-0" | |
4003 | - type="link" | |
4004 | - onClick={() => { | |
4005 | - let selectedSubOrders = subOrderSelectedMap.get( | |
4006 | - record.id, | |
4007 | - ); | |
4008 | - setSelectedRows(selectedSubOrders); | |
4009 | - if (selectedSubOrders === undefined) { | |
4010 | - selectedSubOrders = record.subOrderInformationLists; | |
4011 | - } | |
4012 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
4013 | - if ( | |
4014 | - selectedSubOrders[i].orderStatus !== | |
4015 | - 'PROCURE_UN_PROCESS' | |
4016 | - ) { | |
4017 | - message.error('请选择未审核的子订单进行审核'); | |
4018 | - return; | |
4044 | + {/* 采购审核 */} | |
4045 | + {record.paths?.includes('procureCheckOrder') ? ( | |
4046 | + <Button | |
4047 | + className="p-0" | |
4048 | + type="link" | |
4049 | + onClick={() => { | |
4050 | + let selectedSubOrders = subOrderSelectedMap.get( | |
4051 | + record.id, | |
4052 | + ); | |
4053 | + setSelectedRows(selectedSubOrders); | |
4054 | + if (selectedSubOrders === undefined) { | |
4055 | + selectedSubOrders = record.subOrderInformationLists; | |
4056 | + } | |
4057 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
4058 | + if ( | |
4059 | + selectedSubOrders[i].orderStatus !== | |
4060 | + 'PROCURE_UN_PROCESS' | |
4061 | + ) { | |
4062 | + message.error('请选择未审核的子订单进行审核'); | |
4063 | + return; | |
4064 | + } | |
4019 | 4065 | } |
4020 | - } | |
4021 | 4066 | |
4022 | - createOptObject(null, record.id); | |
4023 | - setProcureCheckModalVisible(true); | |
4024 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
4025 | - }} | |
4026 | - > | |
4027 | - 采购审核 | |
4028 | - </Button> | |
4029 | - ) : ( | |
4030 | - '' | |
4031 | - )} | |
4067 | + createOptObject(null, record.id); | |
4068 | + setProcureCheckModalVisible(true); | |
4069 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
4070 | + }} | |
4071 | + > | |
4072 | + 采购审核 | |
4073 | + </Button> | |
4074 | + ) : ( | |
4075 | + '' | |
4076 | + )} | |
4032 | 4077 | |
4033 | - {record.paths?.includes('applyAfterSales') ? ( | |
4034 | - <Button | |
4035 | - className="p-0" | |
4036 | - type="link" | |
4037 | - onClick={() => { | |
4038 | - let selectedSubOrders = subOrderSelectedMap.get( | |
4039 | - record.id, | |
4040 | - ); | |
4041 | - if (selectedSubOrders === undefined) { | |
4042 | - selectedSubOrders = record.subOrderInformationLists; | |
4043 | - } | |
4044 | - setSelectedRows(selectedSubOrders); | |
4045 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
4046 | - if ( | |
4047 | - selectedSubOrders[i].orderStatus !== | |
4048 | - 'CONFIRM_RECEIPT' && | |
4049 | - selectedSubOrders[i].orderStatus !== | |
4050 | - 'AFTER_SALES_FAILURE' && | |
4051 | - selectedSubOrders[i].orderStatus !== | |
4052 | - 'AFTER_SALES_COMPLETION' | |
4053 | - ) { | |
4054 | - message.error('请选择确认收货状态的子订单进行售后'); | |
4055 | - return; | |
4078 | + {record.paths?.includes('applyAfterSales') ? ( | |
4079 | + <Button | |
4080 | + className="p-0" | |
4081 | + type="link" | |
4082 | + onClick={() => { | |
4083 | + let selectedSubOrders = subOrderSelectedMap.get( | |
4084 | + record.id, | |
4085 | + ); | |
4086 | + if (selectedSubOrders === undefined) { | |
4087 | + selectedSubOrders = record.subOrderInformationLists; | |
4088 | + } | |
4089 | + setSelectedRows(selectedSubOrders); | |
4090 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
4091 | + if ( | |
4092 | + selectedSubOrders[i].orderStatus !== | |
4093 | + 'CONFIRM_RECEIPT' && | |
4094 | + selectedSubOrders[i].orderStatus !== | |
4095 | + 'AFTER_SALES_FAILURE' && | |
4096 | + selectedSubOrders[i].orderStatus !== | |
4097 | + 'AFTER_SALES_COMPLETION' | |
4098 | + ) { | |
4099 | + message.error( | |
4100 | + '请选择确认收货状态的子订单进行售后', | |
4101 | + ); | |
4102 | + return; | |
4103 | + } | |
4056 | 4104 | } |
4057 | - } | |
4058 | 4105 | |
4059 | - createOptObject(null, record.id); | |
4060 | - setOrderDrawerVisible(true); | |
4061 | - setOrderOptType('after-sales'); | |
4062 | - }} | |
4063 | - > | |
4064 | - 申请售后 | |
4065 | - </Button> | |
4066 | - ) : ( | |
4067 | - '' | |
4068 | - )} | |
4106 | + createOptObject(null, record.id); | |
4107 | + setOrderDrawerVisible(true); | |
4108 | + setOrderOptType('after-sales'); | |
4109 | + }} | |
4110 | + > | |
4111 | + 申请售后 | |
4112 | + </Button> | |
4113 | + ) : ( | |
4114 | + '' | |
4115 | + )} | |
4069 | 4116 | |
4070 | - {/* {record.paths?.includes('afterSalesCompletion') ? ( | |
4117 | + {/* {record.paths?.includes('afterSalesCompletion') ? ( | |
4071 | 4118 | <ButtonConfirm |
4072 | 4119 | className="p-0" |
4073 | 4120 | title="售后是否已完成?" |
... | ... | @@ -4111,164 +4158,165 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { |
4111 | 4158 | '' |
4112 | 4159 | )} */} |
4113 | 4160 | |
4114 | - {record.paths?.includes('salOrderSave') ? ( | |
4115 | - <ButtonConfirm | |
4116 | - className="p-0" | |
4117 | - title="是否推送至金蝶ERP?" | |
4118 | - text="推送ERP" | |
4119 | - onConfirm={async () => { | |
4120 | - let res = await postKingdeeRepSalOrderSave({ | |
4121 | - data: { | |
4122 | - id: record.id, | |
4123 | - }, | |
4124 | - }); | |
4161 | + {record.paths?.includes('salOrderSave') ? ( | |
4162 | + <ButtonConfirm | |
4163 | + className="p-0" | |
4164 | + title="是否推送至金蝶ERP?" | |
4165 | + text="推送ERP" | |
4166 | + onConfirm={async () => { | |
4167 | + let res = await postKingdeeRepSalOrderSave({ | |
4168 | + data: { | |
4169 | + id: record.id, | |
4170 | + }, | |
4171 | + }); | |
4125 | 4172 | |
4126 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
4127 | - message.success('推送成功'); | |
4128 | - mainTableRef.current.reload(); | |
4129 | - } | |
4130 | - }} | |
4131 | - /> | |
4132 | - ) : ( | |
4133 | - '' | |
4134 | - )} | |
4173 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
4174 | + message.success('推送成功'); | |
4175 | + mainTableRef.current.reload(); | |
4176 | + } | |
4177 | + }} | |
4178 | + /> | |
4179 | + ) : ( | |
4180 | + '' | |
4181 | + )} | |
4135 | 4182 | |
4136 | - {record.paths?.includes('salBillOutbound') ? ( | |
4137 | - <ButtonConfirm | |
4138 | - className="p-0" | |
4139 | - title="是否下推金蝶ERP出库单?" | |
4140 | - text="下推出库" | |
4141 | - onConfirm={async () => { | |
4142 | - let res = await postKingdeeRepSalBillOutbound({ | |
4143 | - data: { | |
4144 | - id: record.id, | |
4145 | - }, | |
4146 | - }); | |
4183 | + {record.paths?.includes('salBillOutbound') ? ( | |
4184 | + <ButtonConfirm | |
4185 | + className="p-0" | |
4186 | + title="是否下推金蝶ERP出库单?" | |
4187 | + text="下推出库" | |
4188 | + onConfirm={async () => { | |
4189 | + let res = await postKingdeeRepSalBillOutbound({ | |
4190 | + data: { | |
4191 | + id: record.id, | |
4192 | + }, | |
4193 | + }); | |
4147 | 4194 | |
4148 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
4149 | - message.success('下推成功'); | |
4150 | - mainTableRef.current.reload(); | |
4151 | - } | |
4152 | - }} | |
4153 | - /> | |
4154 | - ) : ( | |
4155 | - '' | |
4156 | - )} | |
4195 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | |
4196 | + message.success('下推成功'); | |
4197 | + mainTableRef.current.reload(); | |
4198 | + } | |
4199 | + }} | |
4200 | + /> | |
4201 | + ) : ( | |
4202 | + '' | |
4203 | + )} | |
4157 | 4204 | |
4158 | - {record.paths?.includes('confirmInvoice') ? ( | |
4159 | - <ButtonConfirm | |
4160 | - className="p-0" | |
4161 | - title="已和客户确认发票?" | |
4162 | - text="确认发票" | |
4163 | - onConfirm={async () => { | |
4164 | - let body = [ | |
4165 | - ...record.subOrderInformationLists.map( | |
4166 | - (subOrder) => subOrder.id, | |
4167 | - ), | |
4168 | - ]; | |
4169 | - const data = await postServiceOrderConfirmInvoice({ | |
4170 | - data: body, | |
4171 | - }); | |
4172 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
4173 | - message.success(data.message); | |
4174 | - refreshTable(); | |
4175 | - } | |
4176 | - }} | |
4177 | - /> | |
4178 | - ) : ( | |
4179 | - '' | |
4180 | - )} | |
4205 | + {record.paths?.includes('confirmInvoice') ? ( | |
4206 | + <ButtonConfirm | |
4207 | + className="p-0" | |
4208 | + title="已和客户确认发票?" | |
4209 | + text="确认发票" | |
4210 | + onConfirm={async () => { | |
4211 | + let body = [ | |
4212 | + ...record.subOrderInformationLists.map( | |
4213 | + (subOrder) => subOrder.id, | |
4214 | + ), | |
4215 | + ]; | |
4216 | + const data = await postServiceOrderConfirmInvoice({ | |
4217 | + data: body, | |
4218 | + }); | |
4219 | + if (data.result === RESPONSE_CODE.SUCCESS) { | |
4220 | + message.success(data.message); | |
4221 | + refreshTable(); | |
4222 | + } | |
4223 | + }} | |
4224 | + /> | |
4225 | + ) : ( | |
4226 | + '' | |
4227 | + )} | |
4181 | 4228 | |
4182 | - {record.paths?.includes('orderCancel') ? ( | |
4183 | - <ButtonConfirm | |
4184 | - className="p-0" | |
4185 | - title="确认作废?" | |
4186 | - text="作废" | |
4187 | - onConfirm={async () => { | |
4188 | - let body = { | |
4189 | - ids: [record.id], | |
4190 | - checkIsMainOrderId: true, | |
4191 | - }; | |
4192 | - const data = await postServiceOrderOrderCancel({ | |
4193 | - data: body, | |
4194 | - }); | |
4195 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
4196 | - message.success(data.message); | |
4197 | - refreshTable(); | |
4198 | - } | |
4199 | - }} | |
4200 | - /> | |
4201 | - ) : ( | |
4202 | - '' | |
4203 | - )} | |
4229 | + {record.paths?.includes('orderCancel') ? ( | |
4230 | + <ButtonConfirm | |
4231 | + className="p-0" | |
4232 | + title="确认作废?" | |
4233 | + text="作废" | |
4234 | + onConfirm={async () => { | |
4235 | + let body = { | |
4236 | + ids: [record.id], | |
4237 | + checkIsMainOrderId: true, | |
4238 | + }; | |
4239 | + const data = await postServiceOrderOrderCancel({ | |
4240 | + data: body, | |
4241 | + }); | |
4242 | + if (data.result === RESPONSE_CODE.SUCCESS) { | |
4243 | + message.success(data.message); | |
4244 | + refreshTable(); | |
4245 | + } | |
4246 | + }} | |
4247 | + /> | |
4248 | + ) : ( | |
4249 | + '' | |
4250 | + )} | |
4204 | 4251 | |
4205 | - {record.paths?.includes('procurePrint') ? ( | |
4206 | - <ButtonConfirm | |
4207 | - className="p-0" | |
4208 | - title="确认打印?" | |
4209 | - text="采购打印" | |
4210 | - onConfirm={async () => { | |
4211 | - let selectedSubOrders = subOrderSelectedMap.get( | |
4212 | - record.id, | |
4213 | - ); | |
4214 | - if (selectedSubOrders === undefined) { | |
4215 | - selectedSubOrders = record.subOrderInformationLists; | |
4216 | - } | |
4217 | - for (let i = 0; i < selectedSubOrders.length; i++) { | |
4218 | - if ( | |
4219 | - selectedSubOrders[i].orderStatus !== | |
4220 | - 'PROCURE_PROCESS_FOR_MINE' | |
4221 | - ) { | |
4222 | - message.error( | |
4223 | - '请选择采购待打印状态的子订单进行打印', | |
4224 | - ); | |
4225 | - return false; | |
4252 | + {record.paths?.includes('procurePrint') ? ( | |
4253 | + <ButtonConfirm | |
4254 | + className="p-0" | |
4255 | + title="确认打印?" | |
4256 | + text="采购打印" | |
4257 | + onConfirm={async () => { | |
4258 | + let selectedSubOrders = subOrderSelectedMap.get( | |
4259 | + record.id, | |
4260 | + ); | |
4261 | + if (selectedSubOrders === undefined) { | |
4262 | + selectedSubOrders = record.subOrderInformationLists; | |
4263 | + } | |
4264 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
4265 | + if ( | |
4266 | + selectedSubOrders[i].orderStatus !== | |
4267 | + 'PROCURE_PROCESS_FOR_MINE' | |
4268 | + ) { | |
4269 | + message.error( | |
4270 | + '请选择采购待打印状态的子订单进行打印', | |
4271 | + ); | |
4272 | + return false; | |
4273 | + } | |
4226 | 4274 | } |
4227 | - } | |
4228 | 4275 | |
4229 | - const ids = selectedSubOrders?.map((item) => { | |
4230 | - return item.id; | |
4231 | - }); | |
4232 | - let res = await postServiceOrderProcurePrint({ | |
4233 | - data: { | |
4234 | - ids: ids, | |
4235 | - }, | |
4236 | - }); | |
4276 | + const ids = selectedSubOrders?.map((item) => { | |
4277 | + return item.id; | |
4278 | + }); | |
4279 | + let res = await postServiceOrderProcurePrint({ | |
4280 | + data: { | |
4281 | + ids: ids, | |
4282 | + }, | |
4283 | + }); | |
4237 | 4284 | |
4238 | - if (res.result === RESPONSE_CODE.SUCCESS) { | |
4239 | - message.success(res.message); | |
4240 | - refreshTable(); | |
4241 | - } | |
4242 | - }} | |
4243 | - /> | |
4244 | - ) : ( | |
4245 | - // <Button | |
4246 | - // className="p-0" | |
4247 | - // type="link" | |
4248 | - // onClick={() => { | |
4249 | - // if (!subOrderSelectedMap.get(record.id)?.length) { | |
4250 | - // return message.error('请选择选择子订单'); | |
4251 | - // } | |
4252 | - // setSelectedRows(subOrderSelectedMap.get(record.id)); | |
4253 | - // setOrderRow(record); | |
4254 | - // setOrderPrintVisible(true); | |
4255 | - // setOrderCheckType(CHECK_TYPE.PROCURE); | |
4256 | - // }} | |
4257 | - // > | |
4258 | - // 采购打印 | |
4259 | - // </Button> | |
4260 | - '' | |
4261 | - )} | |
4262 | - </Space> | |
4263 | - </Space.Compact> | |
4285 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
4286 | + message.success(res.message); | |
4287 | + refreshTable(); | |
4288 | + } | |
4289 | + }} | |
4290 | + /> | |
4291 | + ) : ( | |
4292 | + // <Button | |
4293 | + // className="p-0" | |
4294 | + // type="link" | |
4295 | + // onClick={() => { | |
4296 | + // if (!subOrderSelectedMap.get(record.id)?.length) { | |
4297 | + // return message.error('请选择选择子订单'); | |
4298 | + // } | |
4299 | + // setSelectedRows(subOrderSelectedMap.get(record.id)); | |
4300 | + // setOrderRow(record); | |
4301 | + // setOrderPrintVisible(true); | |
4302 | + // setOrderCheckType(CHECK_TYPE.PROCURE); | |
4303 | + // }} | |
4304 | + // > | |
4305 | + // 采购打印 | |
4306 | + // </Button> | |
4307 | + '' | |
4308 | + )} | |
4309 | + </Space> | |
4310 | + </Space.Compact> | |
4311 | + </Flex> | |
4264 | 4312 | </Flex> |
4265 | 4313 | </Flex> |
4266 | - </Flex> | |
4267 | 4314 | |
4268 | - <Flex className="p-0 pb-[24px] pt-[4px] pl-[23px] pr-[5px] bg-white rounded-b-lg"> | |
4269 | - {expandedRowRender(record)} | |
4315 | + <Flex className="p-0 pb-[24px] pt-[4px] pl-[23px] pr-[5px] bg-white rounded-b-lg"> | |
4316 | + {expandedRowRender(record)} | |
4317 | + </Flex> | |
4270 | 4318 | </Flex> |
4271 | - </Flex> | |
4319 | + </div> | |
4272 | 4320 | ); |
4273 | 4321 | }; |
4274 | 4322 | ... | ... |
src/pages/Order/constant.ts
... | ... | @@ -265,15 +265,13 @@ export const FINANCIAL_STATUS_OPTIONS = { |
265 | 265 | export const AFTER_INVOICING_STATUS = { |
266 | 266 | NOT_YET_INVOICED: '尚未开票', |
267 | 267 | UN_INVOICE: '不需开票', |
268 | - APPLY_FOR_INVOICING: '申请开票', | |
269 | - URGENT_INVOICE_AUDITING: '加急待审核', | |
270 | - URGENT_INVOICE_AUDIT_NOTPASS: '加急审核失败', | |
271 | 268 | PARTIAL_INVOICING: '部分开票', |
272 | 269 | COMPLETE_INVOICING: '完全开票', |
273 | - INVOICING: '开票中', | |
274 | - REISSUE: '重新开票', | |
275 | - WAIT_FLUSH: '待冲红', | |
276 | - FLUSHED: '已冲红', | |
270 | +}; | |
271 | + | |
272 | +export const IS_WAIT_FLUSHED_OPTIONS = { | |
273 | + true: '是', | |
274 | + false: '否', | |
277 | 275 | }; |
278 | 276 | |
279 | 277 | export const TAGS_COLOR = new Map<string, string>([ |
... | ... | @@ -712,6 +710,20 @@ export const MAIN_ORDER_COLUMNS = [ |
712 | 710 | valueEnum: enumToProTableEnumValue(AFTER_INVOICING_STATUS), |
713 | 711 | }, |
714 | 712 | { |
713 | + title: '是否待冲红', | |
714 | + dataIndex: 'isWaitFlushed', | |
715 | + valueType: 'select', | |
716 | + hideInTable: true, | |
717 | + valueEnum: enumToProTableEnumValue(IS_WAIT_FLUSHED_OPTIONS), | |
718 | + search: { | |
719 | + transform: (value) => { | |
720 | + return { | |
721 | + isWaitFlushed: value === 'true', | |
722 | + }; | |
723 | + }, | |
724 | + }, | |
725 | + }, | |
726 | + { | |
715 | 727 | title: '发票号码', |
716 | 728 | dataIndex: 'invoiceNumberLike', |
717 | 729 | valueType: 'text', | ... | ... |