Commit a2cdaefa2349778e1a5e7813e02e7260f72d420e
1 parent
35b61e1e
feat: update 尚未开票选项
Showing
3 changed files
with
615 additions
and
517 deletions
src/pages/Order/components/FinancialDrawer.tsx
... | ... | @@ -151,7 +151,11 @@ export default ({ |
151 | 151 | { label: '完全开票', value: 'COMPLETE_INVOICING' }, |
152 | 152 | ]} |
153 | 153 | // disabled={mainInfoDisbled} |
154 | - initialValue={subOrders[0]?.afterInvoicingStatus} | |
154 | + initialValue={ | |
155 | + subOrders[0]?.afterInvoicingStatus === 'APPLY_FOR_INVOICING' | |
156 | + ? 'PARTIAL_INVOICING' | |
157 | + : subOrders[0]?.afterInvoicingStatus | |
158 | + } | |
155 | 159 | rules={[{ required: true, message: '是否完全开票必填' }]} |
156 | 160 | /> |
157 | 161 | <ProFormTextArea | ... | ... |
src/pages/Order/constant.ts
src/pages/Order/index.tsx
... | ... | @@ -31,6 +31,7 @@ import { |
31 | 31 | Divider, |
32 | 32 | Dropdown, |
33 | 33 | Flex, |
34 | + Image, | |
34 | 35 | MenuProps, |
35 | 36 | Space, |
36 | 37 | Tag, |
... | ... | @@ -250,13 +251,13 @@ const OrderPage = () => { |
250 | 251 | <Flex className="w-[29%] ml-[4%]"> |
251 | 252 | <span className="font-medium">商品信息</span> |
252 | 253 | </Flex> |
253 | - <Flex className="w-[16%]"> | |
254 | + <Flex className="w-[13%]"> | |
254 | 255 | <span className="font-medium">交易金额</span> |
255 | 256 | </Flex> |
256 | 257 | <Flex className="w-[10%]"> |
257 | 258 | <span className="font-medium">支付</span> |
258 | 259 | </Flex> |
259 | - <Flex className="w-[14%]"> | |
260 | + <Flex className="w-[12%]"> | |
260 | 261 | <span className="font-medium">其他</span> |
261 | 262 | </Flex> |
262 | 263 | <Flex className="w-[10%]"> |
... | ... | @@ -359,43 +360,88 @@ const OrderPage = () => { |
359 | 360 | ); |
360 | 361 | } |
361 | 362 | |
362 | - return ( | |
363 | - <Flex className="w-full border-b-indigo-500"> | |
364 | - <Flex vertical className="w-[31%]" gap="small"> | |
365 | - {/* 商品名称 */} | |
366 | - <div | |
367 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
368 | - title={optRecord.productName} | |
369 | - > | |
370 | - <span className="font-medium text-black "> | |
371 | - {optRecord.productName} | |
372 | - </span> | |
373 | - </div> | |
374 | - <div | |
375 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
376 | - title={optRecord.parameters} | |
363 | + //申请开票附件处理 | |
364 | + const getAfterAnnexList = () => { | |
365 | + let links = []; | |
366 | + let afterAnnexList = optRecord.afterAnnexList; | |
367 | + let i = 1; | |
368 | + if (afterAnnexList?.length > 0) { | |
369 | + for (let url of afterAnnexList) { | |
370 | + links.push( | |
371 | + <a className="pl-2" href={url}> | |
372 | + 附件{i++} | |
373 | + </a>, | |
374 | + ); | |
375 | + } | |
376 | + } | |
377 | + | |
378 | + return links; | |
379 | + }; | |
380 | + | |
381 | + //财务审核附件处理 | |
382 | + const getInvoicingCheckAnnexList = () => { | |
383 | + let invoicingCheckAnnexList = optRecord.invoicingCheckAnnexList; | |
384 | + | |
385 | + return ( | |
386 | + <div> | |
387 | + <Image.PreviewGroup | |
388 | + className="mr-10" | |
389 | + preview={{ | |
390 | + onChange: (current, prev) => | |
391 | + console.log(`current index: ${current}, prev index: ${prev}`), | |
392 | + }} | |
377 | 393 | > |
378 | - <span className="text-[#8C8C8C]">参数:{optRecord.parameters}</span> | |
379 | - </div> | |
380 | - <Flex title={optRecord.notes}> | |
381 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
394 | + {invoicingCheckAnnexList.map((url) => ( | |
395 | + <> | |
396 | + <Image className="max-h-[50px] max-w-[70px]" src={url} />{' '} | |
397 | + <Divider type="vertical" /> | |
398 | + </> | |
399 | + ))} | |
400 | + </Image.PreviewGroup> | |
401 | + </div> | |
402 | + ); | |
403 | + }; | |
404 | + | |
405 | + return ( | |
406 | + <> | |
407 | + <Flex className="w-full border-b-indigo-500"> | |
408 | + <Flex vertical className="w-[31%]" gap="small"> | |
409 | + {/* 商品名称 */} | |
410 | + <div | |
411 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
412 | + title={optRecord.productName} | |
413 | + > | |
414 | + <span className="font-medium text-black "> | |
415 | + {optRecord.productName} | |
416 | + </span> | |
417 | + </div> | |
418 | + <div | |
419 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
420 | + title={optRecord.parameters} | |
421 | + > | |
382 | 422 | <span className="text-[#8C8C8C]"> |
383 | - 备注: | |
384 | - {optRecord.notes === undefined ? '暂无备注' : optRecord.notes} | |
423 | + 参数:{optRecord.parameters} | |
385 | 424 | </span> |
386 | 425 | </div> |
387 | - {/* 编辑备注按钮 */} | |
388 | - <EditTwoTone | |
389 | - onClick={() => { | |
390 | - setNotesEditVisible(true); | |
391 | - setOrderRow(optRecord); | |
392 | - setIsMainOrder(false); | |
393 | - }} | |
394 | - /> | |
395 | - </Flex> | |
426 | + <Flex title={optRecord.notes}> | |
427 | + <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
428 | + <span className="text-[#8C8C8C]"> | |
429 | + 备注: | |
430 | + {optRecord.notes === undefined ? '暂无备注' : optRecord.notes} | |
431 | + </span> | |
432 | + </div> | |
433 | + {/* 编辑备注按钮 */} | |
434 | + <EditTwoTone | |
435 | + onClick={() => { | |
436 | + setNotesEditVisible(true); | |
437 | + setOrderRow(optRecord); | |
438 | + setIsMainOrder(false); | |
439 | + }} | |
440 | + /> | |
441 | + </Flex> | |
396 | 442 | |
397 | - {optRecord.applyInvoicingNotes !== undefined && | |
398 | - optRecord.applyInvoicingNotes !== null ? ( | |
443 | + {/* {optRecord.applyInvoicingNotes !== undefined && | |
444 | + optRecord.applyInvoicingNotes !== null ? ( | |
399 | 445 | <Flex title={optRecord.notes}> |
400 | 446 | <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
401 | 447 | <span className="text-[#8C8C8C]"> |
... | ... | @@ -406,503 +452,550 @@ const OrderPage = () => { |
406 | 452 | </Flex> |
407 | 453 | ) : ( |
408 | 454 | '' |
409 | - )} | |
410 | - </Flex> | |
411 | - <Flex className="w-[16%]" vertical gap="small"> | |
412 | - <div | |
413 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
414 | - title={optRecord.productPrice} | |
415 | - > | |
416 | - <span className="text-[#8C8C8C]">单价:</span> | |
417 | - <span className="text-slate-700">¥{optRecord.productPrice}</span> | |
418 | - </div> | |
419 | - <div | |
420 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
421 | - title={optRecord.quantity} | |
422 | - > | |
423 | - <span className="text-[#8C8C8C]">数量:</span> | |
424 | - <span className="text-slate-700">x{optRecord.quantity}</span> | |
425 | - </div> | |
426 | - <div | |
427 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
428 | - title={optRecord.subOrderPayment} | |
429 | - > | |
430 | - <span className="text-[#8C8C8C]">合计:</span> | |
431 | - <span className="text-slate-700"> | |
432 | - ¥{optRecord.subOrderPayment} | |
433 | - </span> | |
434 | - </div> | |
435 | - </Flex> | |
436 | - <Flex className="w-[10%]" vertical gap="small"> | |
437 | - {/* 支付方式 */} | |
438 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
439 | - <span className="text-slate-700"> | |
440 | - {enumValueToLabel( | |
441 | - optRecord.paymentMethod, | |
442 | - PAYMENT_METHOD_OPTIONS, | |
443 | - )} | |
444 | - </span> | |
445 | - </div> | |
446 | - {/* 支付渠道 */} | |
447 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
448 | - <span className="text-slate-700"> | |
449 | - {enumValueToLabel( | |
450 | - optRecord.paymentChannel, | |
451 | - PAYMENT_CHANNEL_OPTIONS, | |
452 | - )} | |
453 | - </span> | |
454 | - </div> | |
455 | - </Flex> | |
456 | - <Flex className="w-[15%]" vertical gap="small"> | |
457 | - {/* 所属部门 */} | |
458 | - <div | |
459 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
460 | - title={enumValueToLabel( | |
461 | - optRecord.productBelongBusiness, | |
462 | - PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
463 | - )} | |
464 | - > | |
465 | - <span className="text-slate-700"> | |
466 | - {enumValueToLabel( | |
455 | + )} */} | |
456 | + </Flex> | |
457 | + <Flex className="w-[13%]" vertical gap="small"> | |
458 | + <div | |
459 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
460 | + title={optRecord.productPrice} | |
461 | + > | |
462 | + <span className="text-[#8C8C8C]">单价:</span> | |
463 | + <span className="text-slate-700">¥{optRecord.productPrice}</span> | |
464 | + </div> | |
465 | + <div | |
466 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
467 | + title={optRecord.quantity} | |
468 | + > | |
469 | + <span className="text-[#8C8C8C]">数量:</span> | |
470 | + <span className="text-slate-700">x{optRecord.quantity}</span> | |
471 | + </div> | |
472 | + <div | |
473 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
474 | + title={optRecord.subOrderPayment} | |
475 | + > | |
476 | + <span className="text-[#8C8C8C]">合计:</span> | |
477 | + <span className="text-slate-700"> | |
478 | + ¥{optRecord.subOrderPayment} | |
479 | + </span> | |
480 | + </div> | |
481 | + </Flex> | |
482 | + <Flex className="w-[10%]" vertical gap="small"> | |
483 | + {/* 支付方式 */} | |
484 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
485 | + <span className="text-slate-700"> | |
486 | + {enumValueToLabel( | |
487 | + optRecord.paymentMethod, | |
488 | + PAYMENT_METHOD_OPTIONS, | |
489 | + )} | |
490 | + </span> | |
491 | + </div> | |
492 | + {/* 支付渠道 */} | |
493 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
494 | + <span className="text-slate-700"> | |
495 | + {enumValueToLabel( | |
496 | + optRecord.paymentChannel, | |
497 | + PAYMENT_CHANNEL_OPTIONS, | |
498 | + )} | |
499 | + </span> | |
500 | + </div> | |
501 | + </Flex> | |
502 | + <Flex className="w-[13%]" vertical gap="small"> | |
503 | + {/* 所属部门 */} | |
504 | + <div | |
505 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
506 | + title={enumValueToLabel( | |
467 | 507 | optRecord.productBelongBusiness, |
468 | 508 | PRODUCT_BELONG_DEPARTMENT_OPTIONS, |
469 | 509 | )} |
470 | - </span> | |
471 | - </div> | |
510 | + > | |
511 | + <span className="text-slate-700"> | |
512 | + {enumValueToLabel( | |
513 | + optRecord.productBelongBusiness, | |
514 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
515 | + )} | |
516 | + </span> | |
517 | + </div> | |
518 | + | |
519 | + {/* 开票类型 */} | |
520 | + {getInvoicingType(optRecord) === undefined ? ( | |
521 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
522 | + <span className="text-slate-700"> | |
523 | + {getInvoicingType(optRecord)} | |
524 | + </span> | |
525 | + </div> | |
526 | + ) : ( | |
527 | + '' | |
528 | + )} | |
472 | 529 | |
473 | - {/* 开票类型 */} | |
474 | - {getInvoicingType(optRecord) === undefined ? ( | |
530 | + {/* 开票状态 */} | |
475 | 531 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
476 | 532 | <span className="text-slate-700"> |
477 | - {getInvoicingType(optRecord)} | |
533 | + {enumValueToLabel( | |
534 | + optRecord.afterInvoicingStatus, | |
535 | + AFTER_INVOICING_STATUS, | |
536 | + )} | |
478 | 537 | </span> |
479 | 538 | </div> |
480 | - ) : ( | |
481 | - '' | |
482 | - )} | |
483 | - | |
484 | - {/* 开票状态 */} | |
485 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
486 | - <span className="text-slate-700"> | |
487 | - {enumValueToLabel( | |
488 | - optRecord.afterInvoicingStatus, | |
489 | - AFTER_INVOICING_STATUS, | |
490 | - )} | |
491 | - </span> | |
492 | - </div> | |
493 | - </Flex> | |
539 | + </Flex> | |
494 | 540 | |
495 | - <Flex className="w-[10%]" vertical gap="small"> | |
496 | - {/* 开票状态 */} | |
497 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
498 | - <Tag | |
499 | - color={ | |
500 | - optRecord.invoicingTime === null || | |
501 | - optRecord.invoicingTime === undefined | |
502 | - ? TAGS_COLOR.get(optRecord.invoicingStatus) | |
503 | - : 'success' | |
504 | - } | |
505 | - > | |
506 | - {getNeedInvoicing(optRecord)} | |
507 | - </Tag> | |
508 | - </div> | |
509 | - {/* 订单状态 */} | |
510 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
511 | - {getOrderStatusTag(optRecord)} | |
512 | - </div> | |
513 | - | |
514 | - {/* 物流信息 */} | |
515 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
516 | - {optRecord.orderStatus === 'CONFIRM_RECEIPT' || | |
517 | - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' || | |
518 | - optRecord.orderStatus === 'IN_AFTER_SALES' || | |
519 | - optRecord.orderStatus === 'SHIPPED' ? ( | |
520 | - <MyToolTip | |
521 | - title={ | |
522 | - optRecord.serialNumber === undefined | |
523 | - ? '暂无物流信息' | |
524 | - : enumValueToLabel( | |
525 | - optRecord.logisticsMethod, | |
526 | - LOGISTICS_STATUS_OPTIONS, | |
527 | - ) + | |
528 | - ' ' + | |
529 | - optRecord.serialNumber | |
530 | - } | |
531 | - content={ | |
532 | - <Button type="link" size="small" style={{ padding: 0 }}> | |
533 | - 物流信息 | |
534 | - </Button> | |
541 | + <Flex className="w-[10%]" vertical gap="small"> | |
542 | + {/* 开票状态 */} | |
543 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
544 | + <Tag | |
545 | + color={ | |
546 | + optRecord.invoicingTime === null || | |
547 | + optRecord.invoicingTime === undefined | |
548 | + ? TAGS_COLOR.get(optRecord.invoicingStatus) | |
549 | + : 'success' | |
535 | 550 | } |
551 | + > | |
552 | + {getNeedInvoicing(optRecord)} | |
553 | + </Tag> | |
554 | + </div> | |
555 | + {/* 订单状态 */} | |
556 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
557 | + {getOrderStatusTag(optRecord)} | |
558 | + </div> | |
559 | + | |
560 | + {/* 物流信息 */} | |
561 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
562 | + {optRecord.orderStatus === 'CONFIRM_RECEIPT' || | |
563 | + optRecord.orderStatus === 'AFTER_SALES_COMPLETION' || | |
564 | + optRecord.orderStatus === 'IN_AFTER_SALES' || | |
565 | + optRecord.orderStatus === 'SHIPPED' ? ( | |
566 | + <MyToolTip | |
567 | + title={ | |
568 | + optRecord.serialNumber === undefined | |
569 | + ? '暂无物流信息' | |
570 | + : enumValueToLabel( | |
571 | + optRecord.logisticsMethod, | |
572 | + LOGISTICS_STATUS_OPTIONS, | |
573 | + ) + | |
574 | + ' ' + | |
575 | + optRecord.serialNumber | |
576 | + } | |
577 | + content={ | |
578 | + <Button type="link" size="small" style={{ padding: 0 }}> | |
579 | + 物流信息 | |
580 | + </Button> | |
581 | + } | |
582 | + /> | |
583 | + ) : ( | |
584 | + '' | |
585 | + )} | |
586 | + </div> | |
587 | + </Flex> | |
588 | + <Flex className="w-[18%]" wrap="wrap" gap="small"> | |
589 | + {optRecord.subPath?.includes('sendProduct') ? ( | |
590 | + <Button | |
591 | + className="p-0" | |
592 | + type="link" | |
593 | + onClick={() => { | |
594 | + optRecord.mainOrderId = record.id; | |
595 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
596 | + setDeliverVisible(true); | |
597 | + setIsSendProduct(true); | |
598 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
599 | + }} | |
600 | + > | |
601 | + 仓库发货 | |
602 | + </Button> | |
603 | + ) : ( | |
604 | + '' | |
605 | + )} | |
606 | + | |
607 | + {optRecord.subPath?.includes('supplierSendOrder') ? ( | |
608 | + <Button | |
609 | + className="p-0" | |
610 | + type="link" | |
611 | + onClick={() => { | |
612 | + optRecord.mainOrderId = record.id; | |
613 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
614 | + setDeliverVisible(true); | |
615 | + setIsSendProduct(true); | |
616 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
617 | + }} | |
618 | + > | |
619 | + 供应商发货 | |
620 | + </Button> | |
621 | + ) : ( | |
622 | + '' | |
623 | + )} | |
624 | + | |
625 | + {optRecord.subPath?.includes('procureSend') ? ( | |
626 | + <Button | |
627 | + className="p-0" | |
628 | + type="link" | |
629 | + onClick={() => { | |
630 | + optRecord.mainOrderId = record.id; | |
631 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
632 | + setDeliverVisible(true); | |
633 | + setIsSendProduct(true); | |
634 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
635 | + }} | |
636 | + > | |
637 | + 采购发货 | |
638 | + </Button> | |
639 | + ) : ( | |
640 | + '' | |
641 | + )} | |
642 | + | |
643 | + {optRecord.subPath?.includes('queryAnnex') && | |
644 | + optRecord.listAnnex?.length > 0 ? ( | |
645 | + <Button | |
646 | + className="p-0" | |
647 | + type="link" | |
648 | + onClick={() => { | |
649 | + optRecord.mainOrderId = record.id; | |
650 | + setAttachmentModalVisible(true); | |
651 | + setOrderRow(optRecord); | |
652 | + }} | |
653 | + > | |
654 | + 附件 | |
655 | + </Button> | |
656 | + ) : ( | |
657 | + '' | |
658 | + )} | |
659 | + | |
660 | + {optRecord.subPath?.includes('modifySendInformation') ? ( | |
661 | + <Button | |
662 | + className="p-0" | |
663 | + type="link" | |
664 | + onClick={() => { | |
665 | + optRecord.mainOrderId = record.id; | |
666 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
667 | + setDeliverVisible(true); | |
668 | + setIsSendProduct(false); | |
669 | + }} | |
670 | + > | |
671 | + 修改发货信息 | |
672 | + </Button> | |
673 | + ) : ( | |
674 | + '' | |
675 | + )} | |
676 | + | |
677 | + {optRecord.subPath?.includes('printOrder') ? ( | |
678 | + <Button | |
679 | + className="p-0" | |
680 | + type="link" | |
681 | + onClick={async () => { | |
682 | + setOrderPrintVisible(true); | |
683 | + setSelectedRows([optRecord]); | |
684 | + setOrderRow(record); | |
685 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
686 | + }} | |
687 | + > | |
688 | + 仓库打印 | |
689 | + </Button> | |
690 | + ) : ( | |
691 | + '' | |
692 | + )} | |
693 | + | |
694 | + {optRecord.subPath?.includes('supplierPrint') ? ( | |
695 | + <Button | |
696 | + className="p-0" | |
697 | + type="link" | |
698 | + onClick={async () => { | |
699 | + setOrderPrintVisible(true); | |
700 | + setSelectedRows([optRecord]); | |
701 | + setOrderRow(record); | |
702 | + setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
703 | + }} | |
704 | + > | |
705 | + 供应商打印 | |
706 | + </Button> | |
707 | + ) : ( | |
708 | + '' | |
709 | + )} | |
710 | + | |
711 | + {optRecord.subPath?.includes('procurePrint') ? ( | |
712 | + <Button | |
713 | + className="p-0" | |
714 | + type="link" | |
715 | + onClick={async () => { | |
716 | + setOrderPrintVisible(true); | |
717 | + setSelectedRows([optRecord]); | |
718 | + setOrderRow(record); | |
719 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
720 | + }} | |
721 | + > | |
722 | + 采购打印 | |
723 | + </Button> | |
724 | + ) : ( | |
725 | + '' | |
726 | + )} | |
727 | + | |
728 | + {optRecord.subPath?.includes('editOrder') ? ( | |
729 | + <Button | |
730 | + className="p-0" | |
731 | + type="link" | |
732 | + onClick={() => { | |
733 | + setFinancialVisible(true); | |
734 | + setOrderRow(record); | |
735 | + setSelectedRows([optRecord]); | |
736 | + setIsFinalcialEdit(true); | |
737 | + }} | |
738 | + > | |
739 | + 编辑 | |
740 | + </Button> | |
741 | + ) : ( | |
742 | + '' | |
743 | + )} | |
744 | + {optRecord.subPath?.includes('invoicing') ? ( | |
745 | + <Button | |
746 | + className="p-0" | |
747 | + type="link" | |
748 | + onClick={() => { | |
749 | + setFinancialVisible(true); | |
750 | + setIsFinalcialEdit(false); | |
751 | + setOrderRow(record); | |
752 | + setSelectedRows([optRecord]); | |
753 | + setIsMainOrder(false); | |
754 | + }} | |
755 | + > | |
756 | + 开票 | |
757 | + </Button> | |
758 | + ) : ( | |
759 | + '' | |
760 | + )} | |
761 | + | |
762 | + {optRecord.subPath?.includes('applyInvoicing') ? ( | |
763 | + <Button | |
764 | + className="p-0" | |
765 | + type="link" | |
766 | + onClick={() => { | |
767 | + setApplyForInvoicingVisible(true); | |
768 | + setSelectedRows([optRecord]); | |
769 | + }} | |
770 | + > | |
771 | + 申请开票 | |
772 | + </Button> | |
773 | + ) : ( | |
774 | + '' | |
775 | + )} | |
776 | + | |
777 | + {optRecord.subPath?.includes('checkOrder') ? ( | |
778 | + <Button | |
779 | + className="p-0" | |
780 | + type="link" | |
781 | + onClick={() => { | |
782 | + setOrderRow(optRecord); | |
783 | + setCheckVisible(true); | |
784 | + setSelectedRows([optRecord]); | |
785 | + setOrderCheckType(CHECK_TYPE.NORMAL); | |
786 | + }} | |
787 | + > | |
788 | + 审核 | |
789 | + </Button> | |
790 | + ) : ( | |
791 | + '' | |
792 | + )} | |
793 | + | |
794 | + {optRecord.subPath?.includes('financeCheckOrder') ? ( | |
795 | + <Button | |
796 | + className="p-0" | |
797 | + type="link" | |
798 | + onClick={() => { | |
799 | + setOrderRow(optRecord); | |
800 | + setCheckVisible(true); | |
801 | + setSelectedRows([optRecord]); | |
802 | + setOrderCheckType(CHECK_TYPE.FINALCIAL); | |
803 | + }} | |
804 | + > | |
805 | + 财务审核 | |
806 | + </Button> | |
807 | + ) : ( | |
808 | + '' | |
809 | + )} | |
810 | + | |
811 | + {optRecord.subPath?.includes('procureCheckOrder') ? ( | |
812 | + <Button | |
813 | + className="p-0" | |
814 | + type="link" | |
815 | + onClick={() => { | |
816 | + setOrderRow(optRecord); | |
817 | + setSelectedRows([optRecord]); | |
818 | + setOrderCheckType(CHECK_TYPE.PROCURE); | |
819 | + setProcureCheckModalVisible(true); | |
820 | + }} | |
821 | + > | |
822 | + 采购审核 | |
823 | + </Button> | |
824 | + ) : ( | |
825 | + '' | |
826 | + )} | |
827 | + | |
828 | + {optRecord.subPath?.includes('rePrintOrder') ? ( | |
829 | + <Button | |
830 | + className="p-0" | |
831 | + type="link" | |
832 | + onClick={() => { | |
833 | + setOrderPrintVisible(true); | |
834 | + setSelectedRows([optRecord]); | |
835 | + setOrderRow(record); | |
836 | + setIsRePrintOrder(true); | |
837 | + }} | |
838 | + > | |
839 | + 重新打印 | |
840 | + </Button> | |
841 | + ) : ( | |
842 | + '' | |
843 | + )} | |
844 | + | |
845 | + {optRecord.subPath?.includes('confirmReceipt') ? ( | |
846 | + <Button | |
847 | + className="p-0" | |
848 | + type="link" | |
849 | + onClick={() => { | |
850 | + setConfirmReceiptVisible(true); | |
851 | + setOrderRow(optRecord); | |
852 | + }} | |
853 | + > | |
854 | + 确认收货 | |
855 | + </Button> | |
856 | + ) : ( | |
857 | + '' | |
858 | + )} | |
859 | + | |
860 | + {optRecord.subPath?.includes('applyAfterSales') ? ( | |
861 | + <Button | |
862 | + className="p-0" | |
863 | + type="link" | |
864 | + onClick={() => { | |
865 | + setAfterSalesDrawerVisible(true); | |
866 | + setSelectedRows([optRecord]); | |
867 | + setOrderRow(record); | |
868 | + }} | |
869 | + > | |
870 | + 申请售后 | |
871 | + </Button> | |
872 | + ) : ( | |
873 | + '' | |
874 | + )} | |
875 | + | |
876 | + {optRecord.subPath?.includes('afterSalesCompletion') ? ( | |
877 | + <ButtonConfirm | |
878 | + className="p-0" | |
879 | + title="是否完成售后?" | |
880 | + text="完成售后" | |
881 | + onConfirm={async () => { | |
882 | + let res = await postServiceOrderAfterSalesCompletion({ | |
883 | + data: { ids: [optRecord.id] }, | |
884 | + }); | |
885 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
886 | + message.success(res.message); | |
887 | + refreshTable(); | |
888 | + return true; | |
889 | + } | |
890 | + }} | |
536 | 891 | /> |
537 | 892 | ) : ( |
538 | 893 | '' |
539 | 894 | )} |
540 | - </div> | |
541 | - </Flex> | |
542 | - <Flex className="w-[18%]" wrap="wrap" gap="small"> | |
543 | - {optRecord.subPath?.includes('sendProduct') ? ( | |
544 | - <Button | |
545 | - className="p-0" | |
546 | - type="link" | |
547 | - onClick={() => { | |
548 | - optRecord.mainOrderId = record.id; | |
549 | - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
550 | - setDeliverVisible(true); | |
551 | - setIsSendProduct(true); | |
552 | - setOrderCheckType(CHECK_TYPE.NORMAL); | |
553 | - }} | |
554 | - > | |
555 | - 仓库发货 | |
556 | - </Button> | |
557 | - ) : ( | |
558 | - '' | |
559 | - )} | |
560 | - | |
561 | - {optRecord.subPath?.includes('supplierSendOrder') ? ( | |
562 | - <Button | |
563 | - className="p-0" | |
564 | - type="link" | |
565 | - onClick={() => { | |
566 | - optRecord.mainOrderId = record.id; | |
567 | - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
568 | - setDeliverVisible(true); | |
569 | - setIsSendProduct(true); | |
570 | - setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
571 | - }} | |
572 | - > | |
573 | - 供应商发货 | |
574 | - </Button> | |
575 | - ) : ( | |
576 | - '' | |
577 | - )} | |
578 | - | |
579 | - {optRecord.subPath?.includes('procureSend') ? ( | |
580 | - <Button | |
581 | - className="p-0" | |
582 | - type="link" | |
583 | - onClick={() => { | |
584 | - optRecord.mainOrderId = record.id; | |
585 | - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
586 | - setDeliverVisible(true); | |
587 | - setIsSendProduct(true); | |
588 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
589 | - }} | |
590 | - > | |
591 | - 采购发货 | |
592 | - </Button> | |
593 | - ) : ( | |
594 | - '' | |
595 | - )} | |
596 | - | |
597 | - {optRecord.subPath?.includes('queryAnnex') && | |
598 | - optRecord.listAnnex?.length > 0 ? ( | |
599 | - <Button | |
600 | - className="p-0" | |
601 | - type="link" | |
602 | - onClick={() => { | |
603 | - optRecord.mainOrderId = record.id; | |
604 | - setAttachmentModalVisible(true); | |
605 | - setOrderRow(optRecord); | |
606 | - }} | |
607 | - > | |
608 | - 附件 | |
609 | - </Button> | |
610 | - ) : ( | |
611 | - '' | |
612 | - )} | |
613 | - | |
614 | - {optRecord.subPath?.includes('modifySendInformation') ? ( | |
615 | - <Button | |
616 | - className="p-0" | |
617 | - type="link" | |
618 | - onClick={() => { | |
619 | - optRecord.mainOrderId = record.id; | |
620 | - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
621 | - setDeliverVisible(true); | |
622 | - setIsSendProduct(false); | |
623 | - }} | |
624 | - > | |
625 | - 修改发货信息 | |
626 | - </Button> | |
627 | - ) : ( | |
628 | - '' | |
629 | - )} | |
630 | - | |
631 | - {optRecord.subPath?.includes('printOrder') ? ( | |
632 | - <Button | |
633 | - className="p-0" | |
634 | - type="link" | |
635 | - onClick={async () => { | |
636 | - setOrderPrintVisible(true); | |
637 | - setSelectedRows([optRecord]); | |
638 | - setOrderRow(record); | |
639 | - setOrderCheckType(CHECK_TYPE.NORMAL); | |
640 | - }} | |
641 | - > | |
642 | - 仓库打印 | |
643 | - </Button> | |
644 | - ) : ( | |
645 | - '' | |
646 | - )} | |
647 | - | |
648 | - {optRecord.subPath?.includes('supplierPrint') ? ( | |
649 | - <Button | |
650 | - className="p-0" | |
651 | - type="link" | |
652 | - onClick={async () => { | |
653 | - setOrderPrintVisible(true); | |
654 | - setSelectedRows([optRecord]); | |
655 | - setOrderRow(record); | |
656 | - setOrderCheckType(CHECK_TYPE.SUPPLIER); | |
657 | - }} | |
658 | - > | |
659 | - 供应商打印 | |
660 | - </Button> | |
661 | - ) : ( | |
662 | - '' | |
663 | - )} | |
664 | - | |
665 | - {optRecord.subPath?.includes('procurePrint') ? ( | |
666 | - <Button | |
667 | - className="p-0" | |
668 | - type="link" | |
669 | - onClick={async () => { | |
670 | - setOrderPrintVisible(true); | |
671 | - setSelectedRows([optRecord]); | |
672 | - setOrderRow(record); | |
673 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
674 | - }} | |
675 | - > | |
676 | - 采购打印 | |
677 | - </Button> | |
678 | - ) : ( | |
679 | - '' | |
680 | - )} | |
681 | - | |
682 | - {optRecord.subPath?.includes('editOrder') ? ( | |
683 | - <Button | |
684 | - className="p-0" | |
685 | - type="link" | |
686 | - onClick={() => { | |
687 | - setFinancialVisible(true); | |
688 | - setOrderRow(record); | |
689 | - setSelectedRows([optRecord]); | |
690 | - setIsFinalcialEdit(true); | |
691 | - }} | |
692 | - > | |
693 | - 编辑 | |
694 | - </Button> | |
695 | - ) : ( | |
696 | - '' | |
697 | - )} | |
698 | - {optRecord.subPath?.includes('invoicing') ? ( | |
699 | - <Button | |
700 | - className="p-0" | |
701 | - type="link" | |
702 | - onClick={() => { | |
703 | - setFinancialVisible(true); | |
704 | - setIsFinalcialEdit(false); | |
705 | - setOrderRow(record); | |
706 | - setSelectedRows([optRecord]); | |
707 | - setIsMainOrder(false); | |
708 | - }} | |
709 | - > | |
710 | - 开票 | |
711 | - </Button> | |
712 | - ) : ( | |
713 | - '' | |
714 | - )} | |
715 | - | |
716 | - {optRecord.subPath?.includes('applyInvoicing') ? ( | |
717 | - <Button | |
718 | - className="p-0" | |
719 | - type="link" | |
720 | - onClick={() => { | |
721 | - setApplyForInvoicingVisible(true); | |
722 | - setSelectedRows([optRecord]); | |
723 | - }} | |
724 | - > | |
725 | - 申请开票 | |
726 | - </Button> | |
727 | - ) : ( | |
728 | - '' | |
729 | - )} | |
730 | - | |
731 | - {optRecord.subPath?.includes('checkOrder') ? ( | |
732 | - <Button | |
733 | - className="p-0" | |
734 | - type="link" | |
735 | - onClick={() => { | |
736 | - setOrderRow(optRecord); | |
737 | - setCheckVisible(true); | |
738 | - setSelectedRows([optRecord]); | |
739 | - setOrderCheckType(CHECK_TYPE.NORMAL); | |
740 | - }} | |
741 | - > | |
742 | - 审核 | |
743 | - </Button> | |
744 | - ) : ( | |
745 | - '' | |
746 | - )} | |
747 | - | |
748 | - {optRecord.subPath?.includes('financeCheckOrder') ? ( | |
749 | - <Button | |
750 | - className="p-0" | |
751 | - type="link" | |
752 | - onClick={() => { | |
753 | - setOrderRow(optRecord); | |
754 | - setCheckVisible(true); | |
755 | - setSelectedRows([optRecord]); | |
756 | - setOrderCheckType(CHECK_TYPE.FINALCIAL); | |
757 | - }} | |
758 | - > | |
759 | - 财务审核 | |
760 | - </Button> | |
761 | - ) : ( | |
762 | - '' | |
763 | - )} | |
764 | - | |
765 | - {optRecord.subPath?.includes('procureCheckOrder') ? ( | |
766 | - <Button | |
767 | - className="p-0" | |
768 | - type="link" | |
769 | - onClick={() => { | |
770 | - setOrderRow(optRecord); | |
771 | - setSelectedRows([optRecord]); | |
772 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
773 | - setProcureCheckModalVisible(true); | |
774 | - }} | |
775 | - > | |
776 | - 采购审核 | |
777 | - </Button> | |
778 | - ) : ( | |
779 | - '' | |
780 | - )} | |
781 | - | |
782 | - {optRecord.subPath?.includes('rePrintOrder') ? ( | |
783 | - <Button | |
784 | - className="p-0" | |
785 | - type="link" | |
786 | - onClick={() => { | |
787 | - setOrderPrintVisible(true); | |
788 | - setSelectedRows([optRecord]); | |
789 | - setOrderRow(record); | |
790 | - setIsRePrintOrder(true); | |
791 | - }} | |
792 | - > | |
793 | - 重新打印 | |
794 | - </Button> | |
795 | - ) : ( | |
796 | - '' | |
797 | - )} | |
798 | - | |
799 | - {optRecord.subPath?.includes('confirmReceipt') ? ( | |
800 | - <Button | |
801 | - className="p-0" | |
802 | - type="link" | |
803 | - onClick={() => { | |
804 | - setConfirmReceiptVisible(true); | |
805 | - setOrderRow(optRecord); | |
806 | - }} | |
807 | - > | |
808 | - 确认收货 | |
809 | - </Button> | |
810 | - ) : ( | |
811 | - '' | |
812 | - )} | |
813 | - | |
814 | - {optRecord.subPath?.includes('applyAfterSales') ? ( | |
815 | - <Button | |
816 | - className="p-0" | |
817 | - type="link" | |
818 | - onClick={() => { | |
819 | - setAfterSalesDrawerVisible(true); | |
820 | - setSelectedRows([optRecord]); | |
821 | - setOrderRow(record); | |
822 | - }} | |
823 | - > | |
824 | - 申请售后 | |
825 | - </Button> | |
826 | - ) : ( | |
827 | - '' | |
828 | - )} | |
829 | - | |
830 | - {optRecord.subPath?.includes('afterSalesCompletion') ? ( | |
831 | - <ButtonConfirm | |
832 | - className="p-0" | |
833 | - title="是否完成售后?" | |
834 | - text="完成售后" | |
835 | - onConfirm={async () => { | |
836 | - let res = await postServiceOrderAfterSalesCompletion({ | |
837 | - data: { ids: [optRecord.id] }, | |
838 | - }); | |
839 | - if (res.result === RESPONSE_CODE.SUCCESS) { | |
840 | - message.success(res.message); | |
841 | - refreshTable(); | |
842 | - return true; | |
843 | - } | |
844 | - }} | |
845 | - /> | |
846 | - ) : ( | |
847 | - '' | |
848 | - )} | |
849 | - | |
850 | - {optRecord.subPath?.includes('noNeedSend') ? ( | |
851 | - <ButtonConfirm | |
852 | - className="p-0" | |
853 | - title="此订单是否无需发货?" | |
854 | - text="无需发货" | |
855 | - onConfirm={async () => { | |
856 | - let res = await postServiceOrderNoNeedSend({ | |
857 | - data: { ids: [optRecord.id] }, | |
858 | - }); | |
859 | - if (res.result === RESPONSE_CODE.SUCCESS) { | |
860 | - message.success(res.message); | |
861 | - refreshTable(); | |
862 | - return true; | |
863 | - } | |
864 | - }} | |
865 | - /> | |
866 | - ) : ( | |
867 | - '' | |
868 | - )} | |
869 | - | |
870 | - {optRecord.subPath?.includes('viewImages') ? ( | |
871 | - <Button | |
872 | - className="p-0" | |
873 | - type="link" | |
874 | - onClick={() => { | |
875 | - setSubOrderConfirmReceiptImagesVisible(true); | |
876 | - setOrderRow(optRecord); | |
877 | - }} | |
878 | - > | |
879 | - 查看收货凭证 | |
880 | - </Button> | |
881 | - ) : ( | |
882 | - '' | |
883 | - )} | |
884 | - | |
885 | - {optRecord.subPath?.includes('orderCancel') ? ( | |
886 | - <ButtonConfirm | |
887 | - className="p-0" | |
888 | - title="确认作废?" | |
889 | - text="作废" | |
890 | - onConfirm={async () => { | |
891 | - let body = { ids: [optRecord.id], checkIsMainOrderId: false }; | |
892 | - const data = await postServiceOrderOrderCancel({ | |
893 | - data: body, | |
894 | - }); | |
895 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
896 | - message.success(data.message); | |
897 | - refreshTable(); | |
898 | - } | |
899 | - }} | |
900 | - /> | |
901 | - ) : ( | |
902 | - '' | |
903 | - )} | |
895 | + | |
896 | + {optRecord.subPath?.includes('noNeedSend') ? ( | |
897 | + <ButtonConfirm | |
898 | + className="p-0" | |
899 | + title="此订单是否无需发货?" | |
900 | + text="无需发货" | |
901 | + onConfirm={async () => { | |
902 | + let res = await postServiceOrderNoNeedSend({ | |
903 | + data: { ids: [optRecord.id] }, | |
904 | + }); | |
905 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
906 | + message.success(res.message); | |
907 | + refreshTable(); | |
908 | + return true; | |
909 | + } | |
910 | + }} | |
911 | + /> | |
912 | + ) : ( | |
913 | + '' | |
914 | + )} | |
915 | + | |
916 | + {optRecord.subPath?.includes('viewImages') ? ( | |
917 | + <Button | |
918 | + className="p-0" | |
919 | + type="link" | |
920 | + onClick={() => { | |
921 | + setSubOrderConfirmReceiptImagesVisible(true); | |
922 | + setOrderRow(optRecord); | |
923 | + }} | |
924 | + > | |
925 | + 查看收货凭证 | |
926 | + </Button> | |
927 | + ) : ( | |
928 | + '' | |
929 | + )} | |
930 | + | |
931 | + {optRecord.subPath?.includes('orderCancel') ? ( | |
932 | + <ButtonConfirm | |
933 | + className="p-0" | |
934 | + title="确认作废?" | |
935 | + text="作废" | |
936 | + onConfirm={async () => { | |
937 | + let body = { ids: [optRecord.id], checkIsMainOrderId: false }; | |
938 | + const data = await postServiceOrderOrderCancel({ | |
939 | + data: body, | |
940 | + }); | |
941 | + if (data.result === RESPONSE_CODE.SUCCESS) { | |
942 | + message.success(data.message); | |
943 | + refreshTable(); | |
944 | + } | |
945 | + }} | |
946 | + /> | |
947 | + ) : ( | |
948 | + '' | |
949 | + )} | |
950 | + </Flex> | |
904 | 951 | </Flex> |
905 | - </Flex> | |
952 | + | |
953 | + {userInfo?.roleSmallVO?.code === 'admin' || | |
954 | + userInfo?.roleSmallVO?.code === 'salesManager' || | |
955 | + userInfo?.roleSmallVO?.code === 'salesRepresentative' || | |
956 | + userInfo?.roleSmallVO?.code === 'finance' ? ( | |
957 | + <Flex title={optRecord.notes}> | |
958 | + <div className="flex items-center"> | |
959 | + <div className="flex items-center max-w-[500px]"> | |
960 | + <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
961 | + <Tooltip | |
962 | + title={optRecord.applyInvoicingNotes} | |
963 | + placement="topLeft" | |
964 | + > | |
965 | + <span className="text-[#8C8C8C]"> | |
966 | + 销售申请开票备注: | |
967 | + {optRecord.applyInvoicingNotes === undefined || | |
968 | + optRecord.applyInvoicingNotes === null | |
969 | + ? '暂无备注' | |
970 | + : optRecord.applyInvoicingNotes} | |
971 | + </span> | |
972 | + </Tooltip> | |
973 | + </div> | |
974 | + | |
975 | + {getAfterAnnexList()} | |
976 | + </div> | |
977 | + <Divider type="vertical" className="mx-5" /> | |
978 | + <div className="flex items-center max-w-[500px]"> | |
979 | + <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
980 | + <Tooltip title={optRecord.checkNotes} placement="topLeft"> | |
981 | + <span className="text-[#8C8C8C] mr-3"> | |
982 | + 财务审核备注: | |
983 | + {optRecord.checkNotes === undefined || | |
984 | + optRecord.checkNotes === null | |
985 | + ? '暂无备注' | |
986 | + : optRecord.checkNotes} | |
987 | + </span> | |
988 | + </Tooltip> | |
989 | + </div> | |
990 | + | |
991 | + {getInvoicingCheckAnnexList()} | |
992 | + </div> | |
993 | + </div> | |
994 | + </Flex> | |
995 | + ) : ( | |
996 | + '' | |
997 | + )} | |
998 | + </> | |
906 | 999 | ); |
907 | 1000 | }; |
908 | 1001 | const expandedRowRender = (record) => { | ... | ... |