ztxkui 4.2.18-111 → 4.2.18-113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/components/Table/hooks/useColumns.js +26 -2
  2. package/dist/components/electron-signatures/content.js +360 -340
  3. package/dist/components/electron-signatures/demoComponents/coUseDetail.d.ts +8 -0
  4. package/dist/components/electron-signatures/demoComponents/coUseDetail.js +255 -0
  5. package/dist/components/electron-signatures/demoComponents/index.js +4 -1
  6. package/dist/components/electron-signatures/demoComponents/makingData.d.ts +12 -0
  7. package/dist/components/electron-signatures/demoComponents/makingData.js +14 -0
  8. package/dist/components/electron-signatures/electron-signatures-fragment.js +74 -26
  9. package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.d.ts +35 -0
  10. package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.js +39 -0
  11. package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +20 -2
  12. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +4 -0
  13. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +103 -16
  14. package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +13 -4
  15. package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +238 -165
  16. package/dist/components/electron-signatures/index.d.ts +2 -0
  17. package/dist/components/electron-signatures/index.js +14 -5
  18. package/dist/components/electron-signatures/interface.d.ts +16 -0
  19. package/dist/components/electron-signatures/qunjComponents/qunj-list.js +14 -5
  20. package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +5 -0
  21. package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +2 -2
  22. package/dist/components/utils/ZtxkContext.d.ts +10 -0
  23. package/dist/components/utils/ZtxkContext.js +2 -0
  24. package/dist/components/utils/checkSealCoUse.d.ts +16 -0
  25. package/dist/components/utils/checkSealCoUse.js +83 -0
  26. package/dist/components/utils/useBaseContext.d.ts +2 -0
  27. package/dist/constants.d.ts +1 -1
  28. package/dist/constants.js +1 -1
  29. package/dist/index.css +52 -13
  30. package/dist/index.css.map +1 -1
  31. package/dist/index.js +10 -0
  32. package/package.json +1 -1
@@ -68,6 +68,7 @@ import useBaseContext from '../utils/useBaseContext';
68
68
  import { Modal, message, Button } from '../../index';
69
69
  import ElectronSignaturesFragment from './electron-signatures-fragment';
70
70
  import useMemoizedFn from '../utils/useMemoizedFn';
71
+ import checkSealCoUse from '../utils/checkSealCoUse';
71
72
  import useMergeRecords from './hooks/useMergeRecords';
72
73
  // 附件相关
73
74
  import useFileTypeColumns from './fileComponents/useFileTypeColumns';
@@ -453,6 +454,8 @@ var ElectronSignatures = function (props) {
453
454
  fileList: newRecords,
454
455
  qunjSeal: data.currentQunjSeal,
455
456
  electronicSealIdList: data.currentCheckedElectronicSealIdList,
457
+ /** 个人签署(手签章)已勾选用户 供业务系统保存并传给 final-seal */
458
+ personalSignUserIds: data.currentPersonalSignUserIds,
456
459
  docAttachMap: data.currentDocAttachMap,
457
460
  documentIdList: data.currentDocumentIdList,
458
461
  contractId: data.currentContractId,
@@ -486,380 +489,397 @@ var ElectronSignatures = function (props) {
486
489
  },
487
490
  /** 验证组件是否通过校验 */
488
491
  validateElectronTable: function (validateInfo) { return __awaiter(void 0, void 0, void 0, function () {
489
- var validateAttachType, resultData, submitData, currentData, _a, _b, isQunjKey, _c, qunjSealKey, fileList, hasElectronicSeal, electronicSealFileList, hasQunj, electronicSealIdList, docAttachMap, qunjSeal, contractId, isContranctNum, isEdit, needDg, needQys, needQj, preElectronicSealIdList, qunjChecked, isOnlyQj, isValidateAttachTypeIndex, msg, isValidateDgIndex, msg, isValidateAttachType, msg, msg, checkElectron, electronicSealedFileList_1, isMoreQunjCountIndex, msg, isMoreQunjCount, msg, isCheckTakeOutNoAddress, isCheckTakeOutNoAddressIndex, msg, msg, msg, hasNoWritContranctNum, msg, hasNoCheckedQjSeal, msg, noNumSealName_1, hasNoNumCheckedQjSeal, msg, msg, electronList, selectedSealIds_1, _i, electronList_1, seal, requiredIds, hasMatch, msg;
492
+ var validateAttachType, resultData, submitData, currentData, _a, _b, isQunjKey, _c, qunjSealKey, fileList, hasElectronicSeal, electronicSealFileList, hasQunj, electronicSealIdList, getTipSealName, docAttachMap, qunjSeal, contractId, isContranctNum, isEdit, needDg, needQys, needQj, preElectronicSealIdList, qunjChecked, isOnlyQj, isValidateAttachTypeIndex, msg, isValidateDgIndex, msg, isValidateAttachType, msg, msg, checkElectron, electronicSealedFileList_1, isMoreQunjCountIndex, msg, isMoreQunjCount, msg, isCheckTakeOutNoAddress, isCheckTakeOutNoAddressIndex, msg, msg, msg, hasNoWritContranctNum, msg, hasNoCheckedQjSeal, msg, noNumSealName_1, hasNoNumCheckedQjSeal, msg, msg, qjSealNos_1, isCoUsePass;
490
493
  var _d, _e, _f, _g, _h, _j, _k;
491
494
  return __generator(this, function (_l) {
492
- validateAttachType = (validateInfo || {}).validateAttachType;
493
- resultData = getAllData();
494
- submitData = resultData[firstDataType];
495
- currentData = allData[firstDataType];
496
- _a = ((_d = currentData.fileFieldsNameRef) === null || _d === void 0 ? void 0 : _d.current) || {}, _b = _a.isQunj, isQunjKey = _b === void 0 ? 'isQunj' : _b, _c = _a.qunjSeal, qunjSealKey = _c === void 0 ? 'qunjSeal' : _c;
497
- fileList = submitData.fileList;
498
- hasElectronicSeal = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!item.isElectronicSeal; });
499
- electronicSealFileList = (_g = (_f = (_e = fileList === null || fileList === void 0 ? void 0 : fileList.filter) === null || _e === void 0 ? void 0 : _e.call(fileList, function (item) { return !!item.isElectronicSeal; })) === null || _f === void 0 ? void 0 : _f.map) === null || _g === void 0 ? void 0 : _g.call(_f, function (item) { return item.attachId; });
500
- hasQunj = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!(item === null || item === void 0 ? void 0 : item[isQunjKey]); });
501
- electronicSealIdList = submitData.electronicSealIdList || [];
502
- docAttachMap = {};
503
- try {
504
- docAttachMap = submitData.docAttachMap
505
- ? JSON.parse(submitData.docAttachMap)
506
- : {};
507
- }
508
- catch (err) {
509
- console.log(i18next.t('解析数据失败!!!!!'));
510
- }
511
- qunjSeal = submitData.qunjSeal;
512
- contractId = submitData.contractId;
513
- isContranctNum = currentData.isContranctNum;
514
- isEdit = currentData.isEdit;
515
- needDg = currentData.needDg;
516
- needQys = currentData.needQys;
517
- needQj = currentData.needQj;
518
- preElectronicSealIdList = currentData === null || currentData === void 0 ? void 0 : currentData.clickElectronicSealIdList;
519
- qunjChecked = currentData.qunjChecked;
520
- isOnlyQj = fileList.length === 0;
521
- // 0. 智能合同比对相关验证
522
- if (isEdit && needDg) {
523
- if (isChoiseChangeTemplateValid) {
524
- isValidateAttachTypeIndex = fileList.findIndex(function (item) {
525
- return (item.attachId &&
526
- !item.templateAttachId &&
527
- (validateAttachType
528
- ? validateAttachType(item)
529
- : item.attachType === '001'));
530
- });
531
- if (isValidateAttachTypeIndex !== -1) {
532
- msg = i18next.t('第 {{slot0}} 行数据,附件类型为合同本身,需要挑选比对模板!', { slot0: isValidateAttachTypeIndex + 1 });
533
- message.warning(msg);
534
- return [2 /*return*/, Promise.reject(msg)];
495
+ switch (_l.label) {
496
+ case 0:
497
+ validateAttachType = (validateInfo || {}).validateAttachType;
498
+ resultData = getAllData();
499
+ submitData = resultData[firstDataType];
500
+ currentData = allData[firstDataType];
501
+ _a = ((_d = currentData.fileFieldsNameRef) === null || _d === void 0 ? void 0 : _d.current) || {}, _b = _a.isQunj, isQunjKey = _b === void 0 ? 'isQunj' : _b, _c = _a.qunjSeal, qunjSealKey = _c === void 0 ? 'qunjSeal' : _c;
502
+ fileList = submitData.fileList;
503
+ hasElectronicSeal = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!item.isElectronicSeal; });
504
+ electronicSealFileList = (_g = (_f = (_e = fileList === null || fileList === void 0 ? void 0 : fileList.filter) === null || _e === void 0 ? void 0 : _e.call(fileList, function (item) { return !!item.isElectronicSeal; })) === null || _f === void 0 ? void 0 : _f.map) === null || _g === void 0 ? void 0 : _g.call(_f, function (item) { return item.attachId; });
505
+ hasQunj = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!(item === null || item === void 0 ? void 0 : item[isQunjKey]); });
506
+ electronicSealIdList = submitData.electronicSealIdList || [];
507
+ getTipSealName = function (item) {
508
+ return isNewQunjSealStyle
509
+ ? (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName)
510
+ : item === null || item === void 0 ? void 0 : item.sealName;
511
+ };
512
+ docAttachMap = {};
513
+ try {
514
+ docAttachMap = submitData.docAttachMap
515
+ ? JSON.parse(submitData.docAttachMap)
516
+ : {};
535
517
  }
536
- }
537
- isValidateDgIndex = fileList.findIndex(function (item) {
538
- return (item.attachId &&
539
- item.templateAttachId &&
540
- !item.taskId &&
541
- (validateAttachType
542
- ? validateAttachType(item)
543
- : item.attachType === '001'));
544
- });
545
- if (isValidateDgIndex !== -1) {
546
- msg = i18next.t('第 {{slot0}} 行数据,没有生成任务id,请点击开始比对按钮!', { slot0: isValidateDgIndex + 1 });
547
- message.warning(msg);
548
- return [2 /*return*/, Promise.reject(msg)];
549
- }
550
- isValidateAttachType = fileList.findIndex(function (item) {
551
- return !item.attachType;
552
- });
553
- if (resetProps.isAllowedPatchFileType &&
554
- isValidateAttachType !== -1) {
555
- msg = i18next.t('第 {{slot0}} 行数据,没有选择附件类型,请选择!', { slot0: isValidateAttachType + 1 });
556
- message.warning(msg);
557
- return [2 /*return*/, Promise.reject(msg)];
558
- }
559
- }
560
- // 1. 指定盖章位置后,又修改了选中印章信息 并且本次一定手动指定了签署位置
561
- if (isEdit &&
562
- needQys &&
563
- !isClickElectronSureRef.current &&
564
- !isOnlyQj &&
565
- preElectronicSealIdList &&
566
- electronicSealIdList.length !== (preElectronicSealIdList === null || preElectronicSealIdList === void 0 ? void 0 : preElectronicSealIdList.length)) {
567
- Modal.confirm({
568
- title: i18next.t('当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?'),
569
- okText: i18next.t('是'),
570
- okType: 'danger',
571
- cancelText: i18next.t('否'),
572
- onOk: function () {
573
- isClickElectronSureRef.current = true;
574
- },
575
- onCancel: function () {
576
- isClickElectronSureRef.current = false;
577
- },
578
- });
579
- return [2 /*return*/, Promise.reject(i18next.t('当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?'))];
580
- }
581
- // 2. 给附件勾选了加盖电子印章 但是未选择电子印章列表
582
- if (isEdit &&
583
- needQys &&
584
- electronicSealIdList.length === 0 &&
585
- hasElectronicSeal &&
586
- !isOnlyQj) {
587
- msg = i18next.t('请勾选加盖电子印章所需要的印章列表!');
588
- message.warning(msg);
589
- return [2 /*return*/, Promise.reject(msg)];
590
- }
591
- checkElectron = (_h = fileList === null || fileList === void 0 ? void 0 : fileList.find) === null || _h === void 0 ? void 0 : _h.call(fileList, function (item) { return !!(item === null || item === void 0 ? void 0 : item.isElectronicSeal); });
592
- if (isEdit &&
593
- needQys &&
594
- contractId &&
595
- docAttachMap &&
596
- electronicSealFileList &&
597
- checkElectron) {
598
- electronicSealedFileList_1 = [];
599
- Object.keys(docAttachMap).forEach(function (key) {
600
- // const value = docAttachMap[key];
601
- if (electronicSealFileList.find(function (attachId) { return attachId === key; }) ||
602
- key !== 'needYjzrr') {
603
- // 将当前合同下已经盖章的附件 添加到 已盖章附件列表中
604
- electronicSealedFileList_1.push(key);
518
+ catch (err) {
519
+ console.log(i18next.t('解析数据失败!!!!!'));
605
520
  }
606
- });
607
- if (!isEqual(electronicSealFileList.sort(), electronicSealedFileList_1.sort())) {
608
- message.warning(i18next.t('附件盖章信息有变动,请重新确认盖章信息'));
609
- return [2 /*return*/, Promise.reject(i18next.t('附件盖章信息有变动,请重新确认盖章信息'))];
610
- }
611
- }
612
- // 3. 群杰超过4倍 禁止提交审批
613
- if (isEdit && needQj && isContranctNum) {
614
- // 单附件都需要选群杰章 校验逻辑
615
- if (isSingleQj && hasQunj) {
616
- isMoreQunjCountIndex = fileList.findIndex(function (file) {
617
- var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
618
- // 如果没有勾选,不需要验证
619
- if (!isQunj) {
620
- return false;
521
+ qunjSeal = submitData.qunjSeal;
522
+ contractId = submitData.contractId;
523
+ isContranctNum = currentData.isContranctNum;
524
+ isEdit = currentData.isEdit;
525
+ needDg = currentData.needDg;
526
+ needQys = currentData.needQys;
527
+ needQj = currentData.needQj;
528
+ preElectronicSealIdList = currentData === null || currentData === void 0 ? void 0 : currentData.clickElectronicSealIdList;
529
+ qunjChecked = currentData.qunjChecked;
530
+ isOnlyQj = fileList.length === 0;
531
+ // 0. 智能合同比对相关验证
532
+ if (isEdit && needDg) {
533
+ if (isChoiseChangeTemplateValid) {
534
+ isValidateAttachTypeIndex = fileList.findIndex(function (item) {
535
+ return (item.attachId &&
536
+ !item.templateAttachId &&
537
+ (validateAttachType
538
+ ? validateAttachType(item)
539
+ : item.attachType === '001'));
540
+ });
541
+ if (isValidateAttachTypeIndex !== -1) {
542
+ msg = i18next.t('第 {{slot0}} 行数据,附件类型为合同本身,需要挑选比对模板!', { slot0: isValidateAttachTypeIndex + 1 });
543
+ message.warning(msg);
544
+ return [2 /*return*/, Promise.reject(msg)];
545
+ }
621
546
  }
622
- var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
623
- var isMoreQunjCount = countIsValidate(qunjSeal, false);
624
- if (!isMoreQunjCount) {
625
- return true;
547
+ isValidateDgIndex = fileList.findIndex(function (item) {
548
+ return (item.attachId &&
549
+ item.templateAttachId &&
550
+ !item.taskId &&
551
+ (validateAttachType
552
+ ? validateAttachType(item)
553
+ : item.attachType === '001'));
554
+ });
555
+ if (isValidateDgIndex !== -1) {
556
+ msg = i18next.t('第 {{slot0}} 行数据,没有生成任务id,请点击开始比对按钮!', { slot0: isValidateDgIndex + 1 });
557
+ message.warning(msg);
558
+ return [2 /*return*/, Promise.reject(msg)];
559
+ }
560
+ isValidateAttachType = fileList.findIndex(function (item) {
561
+ return !item.attachType;
562
+ });
563
+ if (resetProps.isAllowedPatchFileType &&
564
+ isValidateAttachType !== -1) {
565
+ msg = i18next.t('第 {{slot0}} 行数据,没有选择附件类型,请选择!', { slot0: isValidateAttachType + 1 });
566
+ message.warning(msg);
567
+ return [2 /*return*/, Promise.reject(msg)];
626
568
  }
627
- return false;
628
- });
629
- if (isMoreQunjCountIndex !== -1) {
630
- msg = i18next.t('第{{slot0}}行数据,您的群杰章用印次数远远超过合理次数范围,请修改。', { slot0: isMoreQunjCountIndex + 1 });
631
- message.warning(msg);
632
- return [2 /*return*/, Promise.reject(msg)];
633
569
  }
634
- }
635
- // 整体盖群杰章校验逻辑
636
- if (!isSingleQj) {
637
- isMoreQunjCount = countIsValidate(qunjSeal, false);
638
- if (!isMoreQunjCount) {
639
- msg = i18next.t('您的群杰章用印次数远远超过合理次数范围,请修改。');
570
+ // 1. 指定盖章位置后,又修改了选中印章信息 并且本次一定手动指定了签署位置
571
+ if (isEdit &&
572
+ needQys &&
573
+ !isClickElectronSureRef.current &&
574
+ !isOnlyQj &&
575
+ preElectronicSealIdList &&
576
+ electronicSealIdList.length !== (preElectronicSealIdList === null || preElectronicSealIdList === void 0 ? void 0 : preElectronicSealIdList.length)) {
577
+ Modal.confirm({
578
+ title: i18next.t('当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?'),
579
+ okText: i18next.t('是'),
580
+ okType: 'danger',
581
+ cancelText: i18next.t('否'),
582
+ onOk: function () {
583
+ isClickElectronSureRef.current = true;
584
+ },
585
+ onCancel: function () {
586
+ isClickElectronSureRef.current = false;
587
+ },
588
+ });
589
+ return [2 /*return*/, Promise.reject(i18next.t('当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?'))];
590
+ }
591
+ // 2. 给附件勾选了加盖电子印章 但是未选择电子印章列表
592
+ if (isEdit &&
593
+ needQys &&
594
+ electronicSealIdList.length === 0 &&
595
+ hasElectronicSeal &&
596
+ !isOnlyQj) {
597
+ msg = i18next.t('请勾选加盖电子印章所需要的印章列表!');
640
598
  message.warning(msg);
641
599
  return [2 /*return*/, Promise.reject(msg)];
642
600
  }
643
- }
644
- }
645
- isCheckTakeOutNoAddress = function (data) {
646
- if (data &&
647
- data.qunjSeal &&
648
- data.qunjSeal.isTakeOut + '' === '1' &&
649
- (!data.qunjAddress || data.qunjAddress.length === 0)) {
650
- return true;
651
- }
652
- return false;
653
- };
654
- if (isEdit && needQj) {
655
- // 对于那种每个附件都需要选择群杰用印的逻辑
656
- if (isSingleQj) {
657
- isCheckTakeOutNoAddressIndex = fileList.findIndex(function (file) {
658
- var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
659
- // 如果没有勾选,不需要验证
660
- if (!isQunj) {
661
- return false;
662
- }
663
- var isCheckTakeOutNoAddressResult = isCheckTakeOutNoAddress(file);
664
- if (isCheckTakeOutNoAddressResult) {
665
- return true;
601
+ checkElectron = (_h = fileList === null || fileList === void 0 ? void 0 : fileList.find) === null || _h === void 0 ? void 0 : _h.call(fileList, function (item) { return !!(item === null || item === void 0 ? void 0 : item.isElectronicSeal); });
602
+ if (isEdit &&
603
+ needQys &&
604
+ contractId &&
605
+ docAttachMap &&
606
+ electronicSealFileList &&
607
+ checkElectron) {
608
+ electronicSealedFileList_1 = [];
609
+ Object.keys(docAttachMap).forEach(function (key) {
610
+ // const value = docAttachMap[key];
611
+ if (electronicSealFileList.find(function (attachId) { return attachId === key; }) ||
612
+ key !== 'needYjzrr') {
613
+ // 将当前合同下已经盖章的附件 添加到 已盖章附件列表中
614
+ electronicSealedFileList_1.push(key);
615
+ }
616
+ });
617
+ if (!isEqual(electronicSealFileList.sort(), electronicSealedFileList_1.sort())) {
618
+ message.warning(i18next.t('附件盖章信息有变动,请重新确认盖章信息'));
619
+ return [2 /*return*/, Promise.reject(i18next.t('附件盖章信息有变动,请重新确认盖章信息'))];
666
620
  }
667
- return false;
668
- });
669
- if (isCheckTakeOutNoAddressIndex !== -1) {
670
- msg = i18next.t('第{{slot0}}行数据,您的群杰章用选了外部用印,但是没有选择外部用印的地址!', { slot0: isCheckTakeOutNoAddressIndex + 1 });
671
- message.warning(msg);
672
- return [2 /*return*/, Promise.reject(msg)];
673
621
  }
674
- }
675
- else if (isCheckTakeOutNoAddress(submitData)) {
676
- msg = i18next.t('您的群杰印章选了外部用印,但是没有选择外部用印的地址!');
677
- message.warning(msg);
678
- return [2 /*return*/, Promise.reject(msg)];
679
- }
680
- }
681
- // 4. 没有确认盖章
682
- if (isEdit &&
683
- needQys &&
684
- hasElectronicSeal &&
685
- !contractId &&
686
- !isOnlyQj) {
687
- msg = i18next.t('请点击指定签署位置按钮,指定签署位置后方可提交!');
688
- message.warning(msg);
689
- return [2 /*return*/, Promise.reject(msg)];
690
- }
691
- // 5. 合同份数验证
692
- if (isEdit && needQj) {
693
- // 单附件都需要选群杰章 校验逻辑
694
- if (isSingleQj && hasQunj) {
695
- // 合同份数校验
696
- if (isContranctNum) {
697
- hasNoWritContranctNum = fileList.findIndex(function (file) {
698
- var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
699
- // 如果没有勾选,不需要验证
700
- if (!isQunj) {
622
+ // 3. 群杰超过4倍 禁止提交审批
623
+ if (isEdit && needQj && isContranctNum) {
624
+ // 单附件都需要选群杰章 校验逻辑
625
+ if (isSingleQj && hasQunj) {
626
+ isMoreQunjCountIndex = fileList.findIndex(function (file) {
627
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
628
+ // 如果没有勾选,不需要验证
629
+ if (!isQunj) {
630
+ return false;
631
+ }
632
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
633
+ var isMoreQunjCount = countIsValidate(qunjSeal, false);
634
+ if (!isMoreQunjCount) {
635
+ return true;
636
+ }
701
637
  return false;
638
+ });
639
+ if (isMoreQunjCountIndex !== -1) {
640
+ msg = i18next.t('第{{slot0}}行数据,您的群杰章用印次数远远超过合理次数范围,请修改。', { slot0: isMoreQunjCountIndex + 1 });
641
+ message.warning(msg);
642
+ return [2 /*return*/, Promise.reject(msg)];
702
643
  }
703
- var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
704
- if (!qunjSeal.contranctNum) {
705
- return true;
644
+ }
645
+ // 整体盖群杰章校验逻辑
646
+ if (!isSingleQj) {
647
+ isMoreQunjCount = countIsValidate(qunjSeal, false);
648
+ if (!isMoreQunjCount) {
649
+ msg = i18next.t('您的群杰章用印次数远远超过合理次数范围,请修改。');
650
+ message.warning(msg);
651
+ return [2 /*return*/, Promise.reject(msg)];
706
652
  }
707
- return false;
708
- });
709
- if (hasNoWritContranctNum !== -1) {
710
- msg = i18next.t('第{{slot0}}行数据,没有填写群杰章合同份数。', { slot0: hasNoWritContranctNum + 1 });
711
- message.warning(msg);
712
- return [2 /*return*/, Promise.reject(msg)];
713
653
  }
714
654
  }
715
- hasNoCheckedQjSeal = fileList.findIndex(function (file) {
716
- var _a, _b;
717
- var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
718
- // 如果没有勾选,不需要验证
719
- if (!isQunj) {
720
- return false;
721
- }
722
- var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
723
- if (!((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) ||
724
- ((_b = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _b === void 0 ? void 0 : _b.length) === 0) {
655
+ isCheckTakeOutNoAddress = function (data) {
656
+ if (data &&
657
+ data.qunjSeal &&
658
+ data.qunjSeal.isTakeOut + '' === '1' &&
659
+ (!data.qunjAddress || data.qunjAddress.length === 0)) {
725
660
  return true;
726
661
  }
727
662
  return false;
728
- });
729
- if (hasNoCheckedQjSeal !== -1) {
730
- msg = i18next.t('第{{slot0}}行数据,勾选了盖群杰章,但是没有选择群杰印章', { slot0: hasNoCheckedQjSeal + 1 });
731
- message.warning(msg);
732
- return [2 /*return*/, Promise.reject(msg)];
733
- }
734
- noNumSealName_1 = '';
735
- hasNoNumCheckedQjSeal = fileList.findIndex(function (file) {
736
- var _a;
737
- var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
738
- // 如果没有勾选,不需要验证
739
- if (!isQunj) {
740
- return false;
741
- }
742
- var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
743
- if (Array.isArray(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
744
- ((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
745
- var noNumItem = qunjSeal.details.find(function (item) { return !item.sealCount; });
746
- if (noNumItem) {
747
- noNumSealName_1 = noNumItem.sealName;
748
- return true;
663
+ };
664
+ if (isEdit && needQj) {
665
+ // 对于那种每个附件都需要选择群杰用印的逻辑
666
+ if (isSingleQj) {
667
+ isCheckTakeOutNoAddressIndex = fileList.findIndex(function (file) {
668
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
669
+ // 如果没有勾选,不需要验证
670
+ if (!isQunj) {
671
+ return false;
672
+ }
673
+ var isCheckTakeOutNoAddressResult = isCheckTakeOutNoAddress(file);
674
+ if (isCheckTakeOutNoAddressResult) {
675
+ return true;
676
+ }
677
+ return false;
678
+ });
679
+ if (isCheckTakeOutNoAddressIndex !== -1) {
680
+ msg = i18next.t('第{{slot0}}行数据,您的群杰章用选了外部用印,但是没有选择外部用印的地址!', { slot0: isCheckTakeOutNoAddressIndex + 1 });
681
+ message.warning(msg);
682
+ return [2 /*return*/, Promise.reject(msg)];
749
683
  }
750
684
  }
751
- return false;
752
- });
753
- if (hasNoNumCheckedQjSeal !== -1) {
754
- msg = i18next.t('第{{slot0}}行数据,请检查是否选了印章,但是没填用印次数的印章。如:{{noNumSealName}}', {
755
- slot0: hasNoNumCheckedQjSeal + 1,
756
- noNumSealName: noNumSealName_1,
757
- });
758
- message.warning(msg);
759
- return [2 /*return*/, Promise.reject(msg)];
760
- }
761
- }
762
- // 整体盖群杰章校验逻辑
763
- // 20250424 验证逻辑增加必须选择了群杰印章
764
- if (!isSingleQj &&
765
- qunjChecked &&
766
- (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
767
- ((_j = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _j === void 0 ? void 0 : _j.length) > 0) {
768
- // 合同份数为空
769
- if (isContranctNum && !qunjSeal.contranctNum) {
770
- message.warning(i18next.t('请填写合同份数!'));
771
- return [2 /*return*/, Promise.reject(i18next.t('请填写合同份数!'))];
772
- }
773
- // 勾选了群杰印章 没有填用印次数
774
- if (((_k = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _k === void 0 ? void 0 : _k.length) > 0) {
775
- qunjSeal.details.forEach(function (item) {
776
- if (!item.sealCount) {
777
- message.warning(i18next.t('请填写{{slot0}} 的用印次数!', {
778
- slot0: item.sealName,
779
- }));
780
- }
781
- });
782
- if (qunjSeal.details.filter(function (item) { return !item.sealCount; }).length > 0) {
783
- return [2 /*return*/, Promise.reject(i18next.t('请填写用印次数!'))];
685
+ else if (isCheckTakeOutNoAddress(submitData)) {
686
+ msg = i18next.t('您的群杰印章选了外部用印,但是没有选择外部用印的地址!');
687
+ message.warning(msg);
688
+ return [2 /*return*/, Promise.reject(msg)];
784
689
  }
785
690
  }
786
- else {
787
- msg = i18next.t('请选择群杰用印!');
691
+ // 4. 没有确认盖章
692
+ if (isEdit &&
693
+ needQys &&
694
+ hasElectronicSeal &&
695
+ !contractId &&
696
+ !isOnlyQj) {
697
+ msg = i18next.t('请点击指定签署位置按钮,指定签署位置后方可提交!');
788
698
  message.warning(msg);
789
699
  return [2 /*return*/, Promise.reject(msg)];
790
700
  }
791
- }
792
- }
793
- // 5.1 校验契约锁印章中带有"必须共同使用"标识的印章(mustUseWithOthers + useWithSealIds)
794
- if (isEdit && needQys && electronicSealIdList.length > 0) {
795
- electronList = currentData.electronList || [];
796
- selectedSealIds_1 = new Set(electronicSealIdList.map(function (id) { return id + ''; }));
797
- for (_i = 0, electronList_1 = electronList; _i < electronList_1.length; _i++) {
798
- seal = electronList_1[_i];
799
- if (selectedSealIds_1.has(seal.sealId + '') &&
800
- seal.mustUseWithOthers &&
801
- seal.useWithSealIds) {
802
- requiredIds = seal.useWithSealIds
803
- .split(',')
804
- .map(function (id) { return id.trim(); })
805
- .filter(Boolean);
806
- hasMatch = requiredIds.some(function (id) {
807
- return selectedSealIds_1.has(id);
808
- });
809
- if (!hasMatch) {
810
- msg = i18next.t('当前所选的{{sealName}},要求必须和{{requiredSealNames}}其中之一一起使用,请重新勾选印章。', {
811
- sealName: seal.sealName,
812
- requiredSealNames: seal.useWithSealNames,
701
+ // 5. 合同份数验证
702
+ if (isEdit && needQj) {
703
+ // 单附件都需要选群杰章 校验逻辑
704
+ if (isSingleQj && hasQunj) {
705
+ // 合同份数校验
706
+ if (isContranctNum) {
707
+ hasNoWritContranctNum = fileList.findIndex(function (file) {
708
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
709
+ // 如果没有勾选,不需要验证
710
+ if (!isQunj) {
711
+ return false;
712
+ }
713
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
714
+ if (!qunjSeal.contranctNum) {
715
+ return true;
716
+ }
717
+ return false;
718
+ });
719
+ if (hasNoWritContranctNum !== -1) {
720
+ msg = i18next.t('第{{slot0}}行数据,没有填写群杰章合同份数。', { slot0: hasNoWritContranctNum + 1 });
721
+ message.warning(msg);
722
+ return [2 /*return*/, Promise.reject(msg)];
723
+ }
724
+ }
725
+ hasNoCheckedQjSeal = fileList.findIndex(function (file) {
726
+ var _a, _b;
727
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
728
+ // 如果没有勾选,不需要验证
729
+ if (!isQunj) {
730
+ return false;
731
+ }
732
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
733
+ if (!((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) ||
734
+ ((_b = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _b === void 0 ? void 0 : _b.length) === 0) {
735
+ return true;
736
+ }
737
+ return false;
813
738
  });
814
- message.warning(msg);
815
- return [2 /*return*/, Promise.reject(msg)];
816
- }
817
- }
818
- }
819
- }
820
- // 6. 调接口检测 是否存在未确认盖章位置的印章
821
- if (needQys &&
822
- isEdit &&
823
- hasElectronicSeal &&
824
- electronicSealIdList.length > 0) {
825
- setLoading({
826
- spinning: true,
827
- tip: i18next.t('服务器验证中...'),
828
- });
829
- // 调用接口
830
- return [2 /*return*/, getNoSealInfoList({
831
- contractId: contractId,
832
- sealIdList: electronicSealIdList,
833
- deptId: resetProps.deptId,
834
- secondDepId: resetProps.secondDepId,
835
- needYjzrr: docAttachMap.needYjzrr === 'true' ||
836
- docAttachMap.needYjzrr === true
837
- ? true
838
- : false,
839
- })
840
- .then(function (res) {
841
- setLoading({
842
- spinning: false,
843
- });
844
- if (res.length > 0) {
845
- currentUnSealListRef.current = res;
846
- modalHandleRef.current.setInfo(true, {
847
- unSealList: res,
739
+ if (hasNoCheckedQjSeal !== -1) {
740
+ msg = i18next.t('第{{slot0}}行数据,勾选了盖群杰章,但是没有选择群杰印章', { slot0: hasNoCheckedQjSeal + 1 });
741
+ message.warning(msg);
742
+ return [2 /*return*/, Promise.reject(msg)];
743
+ }
744
+ noNumSealName_1 = '';
745
+ hasNoNumCheckedQjSeal = fileList.findIndex(function (file) {
746
+ var _a;
747
+ var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
748
+ // 如果没有勾选,不需要验证
749
+ if (!isQunj) {
750
+ return false;
751
+ }
752
+ var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
753
+ if (Array.isArray(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
754
+ ((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
755
+ var noNumItem = qunjSeal.details.find(function (item) { return !item.sealCount; });
756
+ if (noNumItem) {
757
+ noNumSealName_1 = getTipSealName(noNumItem);
758
+ return true;
759
+ }
760
+ }
761
+ return false;
848
762
  });
849
- return Promise.reject(i18next.t('还有印章未通过校验'));
763
+ if (hasNoNumCheckedQjSeal !== -1) {
764
+ msg = i18next.t('第{{slot0}}行数据,请检查是否选了印章,但是没填用印次数的印章。如:{{noNumSealName}}', {
765
+ slot0: hasNoNumCheckedQjSeal + 1,
766
+ noNumSealName: noNumSealName_1,
767
+ });
768
+ message.warning(msg);
769
+ return [2 /*return*/, Promise.reject(msg)];
770
+ }
850
771
  }
851
- else {
852
- return Promise.resolve(true);
772
+ // 整体盖群杰章校验逻辑
773
+ // 20250424 验证逻辑增加必须选择了群杰印章
774
+ if (!isSingleQj &&
775
+ qunjChecked &&
776
+ (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
777
+ ((_j = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _j === void 0 ? void 0 : _j.length) > 0) {
778
+ // 合同份数为空
779
+ if (isContranctNum && !qunjSeal.contranctNum) {
780
+ message.warning(i18next.t('请填写合同份数!'));
781
+ return [2 /*return*/, Promise.reject(i18next.t('请填写合同份数!'))];
782
+ }
783
+ // 勾选了群杰印章 没有填用印次数
784
+ if (((_k = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _k === void 0 ? void 0 : _k.length) > 0) {
785
+ qunjSeal.details.forEach(function (item) {
786
+ if (!item.sealCount) {
787
+ message.warning(i18next.t('请填写{{slot0}} 的用印次数!', {
788
+ slot0: getTipSealName(item),
789
+ }));
790
+ }
791
+ });
792
+ if (qunjSeal.details.filter(function (item) { return !item.sealCount; }).length > 0) {
793
+ return [2 /*return*/, Promise.reject(i18next.t('请填写用印次数!'))];
794
+ }
795
+ }
796
+ else {
797
+ msg = i18next.t('请选择群杰用印!');
798
+ message.warning(msg);
799
+ return [2 /*return*/, Promise.reject(msg)];
800
+ }
853
801
  }
854
- })
855
- .catch(function (err) {
802
+ }
803
+ if (!isEdit) return [3 /*break*/, 2];
804
+ qjSealNos_1 = new Set();
805
+ ((qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) || []).forEach(function (item) {
806
+ if (item === null || item === void 0 ? void 0 : item.sealNo) {
807
+ qjSealNos_1.add(item.sealNo + '');
808
+ }
809
+ });
810
+ (fileList || []).forEach(function (file) {
811
+ var _a;
812
+ var details = (_a = file === null || file === void 0 ? void 0 : file[qunjSealKey]) === null || _a === void 0 ? void 0 : _a.details;
813
+ (Array.isArray(details) ? details : []).forEach(function (item) {
814
+ if (item === null || item === void 0 ? void 0 : item.sealNo) {
815
+ qjSealNos_1.add(item.sealNo + '');
816
+ }
817
+ });
818
+ });
819
+ if (!(electronicSealIdList.length > 0 || qjSealNos_1.size > 0)) return [3 /*break*/, 2];
820
+ setLoading({
821
+ spinning: true,
822
+ tip: i18next.t('服务器验证中...'),
823
+ });
824
+ return [4 /*yield*/, checkSealCoUse({
825
+ request: request,
826
+ qysSealIds: electronicSealIdList,
827
+ qjSealNos: Array.from(qjSealNos_1),
828
+ })];
829
+ case 1:
830
+ isCoUsePass = _l.sent();
831
+ setLoading({
832
+ spinning: false,
833
+ });
834
+ if (!isCoUsePass) {
835
+ return [2 /*return*/, Promise.reject(false)];
836
+ }
837
+ _l.label = 2;
838
+ case 2:
839
+ // 6. 调接口检测 是否存在未确认盖章位置的印章
840
+ if (needQys &&
841
+ isEdit &&
842
+ hasElectronicSeal &&
843
+ electronicSealIdList.length > 0) {
856
844
  setLoading({
857
- spinning: false,
845
+ spinning: true,
846
+ tip: i18next.t('服务器验证中...'),
858
847
  });
859
- return Promise.reject(err);
860
- })];
848
+ // 调用接口
849
+ return [2 /*return*/, getNoSealInfoList({
850
+ contractId: contractId,
851
+ sealIdList: electronicSealIdList,
852
+ deptId: resetProps.deptId,
853
+ secondDepId: resetProps.secondDepId,
854
+ needYjzrr: docAttachMap.needYjzrr === 'true' ||
855
+ docAttachMap.needYjzrr === true
856
+ ? true
857
+ : false,
858
+ })
859
+ .then(function (res) {
860
+ setLoading({
861
+ spinning: false,
862
+ });
863
+ if (res.length > 0) {
864
+ currentUnSealListRef.current = res;
865
+ modalHandleRef.current.setInfo(true, {
866
+ unSealList: res,
867
+ });
868
+ return Promise.reject(i18next.t('还有印章未通过校验'));
869
+ }
870
+ else {
871
+ return Promise.resolve(true);
872
+ }
873
+ })
874
+ .catch(function (err) {
875
+ setLoading({
876
+ spinning: false,
877
+ });
878
+ return Promise.reject(err);
879
+ })];
880
+ }
881
+ return [2 /*return*/, Promise.resolve(true)];
861
882
  }
862
- return [2 /*return*/, Promise.resolve(true)];
863
883
  });
864
884
  }); },
865
885
  /** 切换部门时,应该清空电子印章相关数据 */