hl-core 0.0.9-beta.41 → 0.0.9-beta.42

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.
package/api/base.api.ts CHANGED
@@ -750,7 +750,7 @@ export class ApiClass {
750
750
  });
751
751
  }
752
752
 
753
- async saveClientAcivityTypes(clientId: string | number, data: any) {
753
+ async saveClientActivityTypes(clientId: string | number, data: any) {
754
754
  return await this.axiosCall({
755
755
  method: Methods.POST,
756
756
  url: `/${this.productUrl}/api/Application/saveClientAcivityTypes/?clientId=${clientId}`,
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <vue-date-picker
3
+ class="base-datepicker"
3
4
  :model-value="modelValue"
4
5
  :clearable="false"
5
6
  :disabled="disabled"
@@ -10,12 +11,16 @@
10
11
  :teleport="true"
11
12
  :close-on-scroll="true"
12
13
  :enable-time-picker="false"
14
+ :six-weeks="true"
13
15
  cancel-text="Отменить"
14
16
  select-text="Выбрать"
15
17
  >
16
18
  <template #trigger>
17
19
  <v-icon icon="mdi mdi-calendar-blank-outline cursor-pointer" />
18
20
  </template>
21
+ <template #action-preview="{ value }">
22
+ {{ reformatDate(value) }}
23
+ </template>
19
24
  </vue-date-picker>
20
25
  </template>
21
26
 
@@ -36,3 +41,36 @@ export default defineComponent({
36
41
  },
37
42
  });
38
43
  </script>
44
+
45
+ <style>
46
+ :root {
47
+ --dp-menu-min-width: 300px;
48
+ --dp-border-radius: 10px;
49
+ --dp-cell-border-radius: 9999px;
50
+ }
51
+
52
+ .dp__calendar_item .dp__active_date {
53
+ @apply bg-[#A0B3D8];
54
+ }
55
+ .dp__calendar_item .dp__today {
56
+ @apply border-[#A0B3D8];
57
+ }
58
+ .dp__calendar_item .dp__today:not(.dp__active_date) {
59
+ @apply border-[#009C73];
60
+ }
61
+ .dp__overlay_cell_active {
62
+ @apply !bg-[#A0B3D8];
63
+ }
64
+ .dp__action_button {
65
+ @apply h-auto px-3 py-1 text-[14px] rounded-lg;
66
+ }
67
+ .dp__action_cancel {
68
+ @apply hover:border-[#A0B3D8];
69
+ }
70
+ .dp__action_select {
71
+ @apply bg-[#009C73] hover:bg-[#00a277] text-white px-4;
72
+ }
73
+ .dp__selection_preview[title*='/'] {
74
+ @apply rounded-lg border-[1px] px-3 py-1 text-[14px] text-[#009C73];
75
+ }
76
+ </style>
@@ -14,7 +14,11 @@
14
14
  :label="label"
15
15
  @click:append-inner="$emit('append-inner', $event)"
16
16
  @click:clear="$emit('on-clear')"
17
- />
17
+ >
18
+ <template v-slot:loader>
19
+ <v-progress-linear v-if="loading" color="#A0B3D8" height="3" indeterminate />
20
+ </template>
21
+ </v-file-input>
18
22
  </template>
19
23
 
20
24
  <script lang="ts">
@@ -34,6 +38,10 @@ export default defineComponent({
34
38
  return useDataStore().t('labels.chooseDoc');
35
39
  },
36
40
  },
41
+ loading: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
37
45
  },
38
46
  emits: ['input', 'append-inner', 'on-clear'],
39
47
  });
@@ -63,7 +63,8 @@ export default defineComponent({
63
63
  cancelText: 'Закрыть',
64
64
  closeOnScroll: true,
65
65
  transitions: false,
66
- teleport: true
66
+ teleport: true,
67
+ sixWeeks: true,
67
68
  };
68
69
  });
69
70
 
@@ -80,7 +80,7 @@ const hasHistory = computed(() => {
80
80
  return !dataStore.isLKA;
81
81
  });
82
82
 
83
- const hasFAQ = computed(() => !useEnv().isProduction && router.hasRoute('FAQ'));
83
+ const hasFAQ = computed(() => router.hasRoute('FAQ'));
84
84
 
85
85
  const openHistory = async () => {
86
86
  dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.isBridge || dataStore.isDSO || dataStore.isUU ? '' : dataStore.product);
@@ -243,16 +243,13 @@
243
243
  :label="$dataStore.t('productConditionsForm.statePremium7')"
244
244
  :suffix="$constants.currencySymbols.kzt"
245
245
  />
246
- <base-panel-input
246
+ <base-form-input
247
247
  v-if="hasAgencyPart"
248
- v-model="productConditionsForm.processTariff"
249
- :value="productConditionsForm.processTariff?.nameRu"
250
- :readonly="isDisabled"
251
- :clearable="!isDisabled"
252
- :rules="$rules.objectRequired"
248
+ v-model="productConditionsForm.agentCommission"
253
249
  :label="$dataStore.t('productConditionsForm.agencyPart')"
254
- append-inner-icon="mdi mdi-chevron-right"
255
- @append="openPanel($dataStore.t('productConditionsForm.agencyPart'), $dataStore.processTariff, 'processTariff', $dataStore.getProcessTariff)"
250
+ :readonly="isDisabledAgentCommission"
251
+ :clearable="!isDisabledAgentCommission"
252
+ :rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
256
253
  />
257
254
  <base-panel-input
258
255
  v-if="hasProcessGfot"
@@ -459,7 +456,13 @@
459
456
  :clearable="false"
460
457
  :label="coverTypeName(term)"
461
458
  append-inner-icon="mdi mdi-chevron-right"
462
- :suffix="!!term.amount ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}` : ''"
459
+ :suffix="
460
+ whichProduct === 'lifebusiness' && term.coverTypeCode === 6
461
+ ? String(term.coverPeriodName ?? '')
462
+ : !!term.amount
463
+ ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}`
464
+ : ''
465
+ "
463
466
  @append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
464
467
  />
465
468
  </div>
@@ -473,7 +476,7 @@
473
476
  @click="submitForm"
474
477
  />
475
478
  <div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
476
- <base-btn :text="$dataStore.t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
479
+ <base-btn :text="$dataStore.t('buttons.calcSum')" v-if="hasCalcSum" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
477
480
  <base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
478
481
  </div>
479
482
  <Teleport v-if="isPanelOpen" to="#right-panel-actions">
@@ -519,45 +522,23 @@
519
522
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
520
523
  <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
521
524
  <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
522
- <base-panel-select-item
523
- v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
524
- :key="index"
525
- :text="(item.nameRu as string)"
526
- :selected="item.nameRu === termValue?.coverSumName"
527
- @click="pickTermValue(item)"
528
- />
525
+ <div v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))">
526
+ <v-expansion-panels v-if="panelCodeList.includes(String(item.code)) && whichProduct === 'lifebusiness'" variant="accordion">
527
+ <v-expansion-panel class="hover:bg-[#f5f8fd]" elevation="0" bg-color="#F3F6FC">
528
+ <v-expansion-panel-title @click="pickTermValue(item)">
529
+ {{ item.nameRu }}
530
+ </v-expansion-panel-title>
531
+ <v-expansion-panel-text class="border-t-[1px] border-t-white cursor-pointer" :class="[$styles.textSimple]" v-for="(i, idx) of subPanelList">
532
+ <base-panel-select-item class="!p-0" :key="idx" :text="(i.nameRu as string)" :selected="i.code === subTermValue" @click="pickSubTermValue(item, i)" />
533
+ </v-expansion-panel-text>
534
+ </v-expansion-panel>
535
+ </v-expansion-panels>
536
+ <base-panel-select-item v-else :key="index" :text="(item.nameRu as string)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
537
+ </div>
529
538
  </div>
530
539
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
531
540
  </div>
532
541
  </Teleport>
533
- <Teleport v-if="isFixInsAmountPanelOpen" to="#right-panel-actions">
534
- <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
535
- <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
536
- <div class="w-full flex flex-col gap-2 p-2">
537
- <base-panel-select-item
538
- v-for="(item, index) of $constants.fixInsAmount.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
539
- :key="index"
540
- :text="(item.nameRu as string)"
541
- :selected="item.code === fixInsValue"
542
- @click="pickfixInsValue(item)"
543
- />
544
- </div>
545
- </div>
546
- </Teleport>
547
- <Teleport v-if="isCoverPeriodPanelOpen" to="#right-panel-actions">
548
- <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
549
- <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
550
- <div class="w-full flex flex-col gap-2 p-2">
551
- <base-panel-select-item
552
- v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
553
- :key="index"
554
- :text="(item.nameRu as string)"
555
- :selected="item.code === coverPeriodValue"
556
- @click="pickCoverPeriodValue(item)"
557
- />
558
- </div>
559
- </div>
560
- </Teleport>
561
542
  </section>
562
543
  </template>
563
544
 
@@ -588,18 +569,17 @@ export default defineComponent({
588
569
  const isPanelLoading = ref<boolean>(false);
589
570
  const isPanelOpen = ref<boolean>(false);
590
571
  const isTermsPanelOpen = ref<boolean>(false);
591
- const isFixInsAmountPanelOpen = ref<boolean>(false);
592
- const isCoverPeriodPanelOpen = ref<boolean>(false);
593
- const fixInsValue = ref<string | number>();
594
- const coverPeriodValue = ref<string>('');
595
572
  const panelValue = ref<Value>(new Value());
596
573
  const termValue = ref<AddCover>();
574
+ const subTermValue = ref<string>('');
597
575
  const panelList = ref<Value[]>([]);
576
+ const subPanelList = ref<Value[]>([]);
598
577
  const productConditionsForm = formStore.productConditionsForm;
599
578
  const currentPanel = ref<keyof typeof productConditionsForm>();
600
579
  const currentIndex = ref<number>();
601
580
  const searchQuery = ref<string>('');
602
581
  const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
582
+ const panelCodeList = ['processcovertypesum', 'fixedinssum'];
603
583
 
604
584
  const additionalTerms = ref<AddCover[]>([]);
605
585
 
@@ -628,6 +608,9 @@ export default defineComponent({
628
608
  if (whichProduct.value === 'gons') {
629
609
  return true;
630
610
  }
611
+ if (whichProduct.value === 'lifebusiness' && dataStore.isUnderwriter()) {
612
+ return false;
613
+ }
631
614
  return isDisabled.value;
632
615
  });
633
616
  const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask());
@@ -635,12 +618,12 @@ export default defineComponent({
635
618
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
636
619
  const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
637
620
  const insurancePremiumPerMonthDisabled = computed(() => {
638
- if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
639
- return false;
640
- }
641
621
  if (whichProduct.value === 'lifebusiness') {
642
622
  return true;
643
623
  }
624
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
625
+ return false;
626
+ }
644
627
  return isDisabled.value;
645
628
  });
646
629
  const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
@@ -797,12 +780,12 @@ export default defineComponent({
797
780
  if (whichProduct.value === 'halykkazyna') {
798
781
  return true;
799
782
  }
800
- if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
801
- return false;
802
- }
803
783
  if (whichProduct.value === 'lifebusiness' && productConditionsForm.processGfot.id !== null) {
804
784
  return true;
805
785
  }
786
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
787
+ return false;
788
+ }
806
789
  return isDisabled.value;
807
790
  });
808
791
  const isDisabledSumDollar = computed(() => {
@@ -837,8 +820,23 @@ export default defineComponent({
837
820
  if (whichProduct.value === 'lifebusiness' && !!productConditionsForm.requestedSumInsured) {
838
821
  return true;
839
822
  }
823
+ if (dataStore.isUnderwriter()) {
824
+ return false;
825
+ }
840
826
  return isDisabled.value;
841
827
  });
828
+ const isDisabledAgentCommission = computed(() => {
829
+ if (whichProduct.value === 'lifebusiness' || dataStore.isUnderwriter()) {
830
+ return false;
831
+ }
832
+ return isDisabled.value;
833
+ });
834
+ const hasCalcSum = computed(() => {
835
+ if (whichProduct.value === 'lifebusiness') {
836
+ return false;
837
+ }
838
+ return true;
839
+ });
842
840
  const formatTermValue = (term: number) => {
843
841
  if (term !== null) {
844
842
  const termNumber = Number(term);
@@ -907,36 +905,47 @@ export default defineComponent({
907
905
  }
908
906
  };
909
907
  const pickTermValue = async (item: Value) => {
910
- dataStore.rightPanel.open = false;
911
- isTermsPanelOpen.value = false;
908
+ if (!panelCodeList.includes(item.code as string) && whichProduct.value === 'lifebusiness') {
909
+ dataStore.rightPanel.open = false;
910
+ isTermsPanelOpen.value = false;
911
+ }
912
912
  if (typeof currentIndex.value !== 'number') return;
913
+
914
+ if (whichProduct.value === 'lifebusiness' && item.code === 'processcovertypesum') {
915
+ if (item.id !== additionalTerms.value[currentIndex.value].coverSumId) {
916
+ additionalTerms.value[currentIndex.value].coverPeriodCode = null;
917
+ additionalTerms.value[currentIndex.value].coverPeriodId = null;
918
+ additionalTerms.value[currentIndex.value].coverPeriodName = null;
919
+ }
920
+ }
921
+
913
922
  additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
914
923
  additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
924
+
915
925
  if (whichProduct.value === 'lifebusiness') {
916
- if (item.code === 'fixedinssum') {
917
- openFixInsPanel(dataStore.t('clients.selectInsSum'), additionalTerms.value[currentIndex.value].amount);
926
+ if (termValue.value && item.code === 'fixedinssum') {
927
+ subPanelList.value = constants.fixInsAmount;
928
+ subTermValue.value = String(termValue.value.amount);
918
929
  } else {
919
930
  additionalTerms.value[currentIndex.value].amount = 0;
920
931
  }
921
- if (termValue.value && termValue.value.coverTypeCode === 6) {
922
- const res = await dataStore.getFromApi('DicCoverTypePeriod', 'getArmDicts', 'DicCoverTypePeriod');
923
- panelList.value = filterList(res, '');
924
- const coverPeriodName = panelList.value.find(i => i.id === String(termValue.value!.coverPeriodId));
925
- if (coverPeriodName) coverPeriodValue.value = coverPeriodName.code as string;
926
- isPanelOpen.value = false;
927
- isTermsPanelOpen.value = false;
928
- isFixInsAmountPanelOpen.value = false;
929
- isCoverPeriodPanelOpen.value = true;
930
- dataStore.panelAction = null;
931
- dataStore.rightPanel.open = true;
932
- isMultiplePanelOpen.value = false;
933
- dataStore.rightPanel.title = dataStore.t('clients.coveragePeriod');
932
+
933
+ if (termValue.value && termValue.value.coverTypeCode === 6 && item.code === 'processcovertypesum') {
934
+ const response = await dataStore.getFromApi('DicCoverTypePeriod', 'getArmDicts', 'DicCoverTypePeriod');
935
+ subPanelList.value = response;
936
+ subTermValue.value = termValue.value.coverPeriodCode as string;
937
+ }
938
+
939
+ if (termValue.value && termValue.value.coverTypeCode === 6 && item.code !== 'processcovertypesum') {
940
+ additionalTerms.value[currentIndex.value].coverPeriodCode = null;
941
+ additionalTerms.value[currentIndex.value].coverPeriodId = null;
942
+ additionalTerms.value[currentIndex.value].coverPeriodName = null;
934
943
  }
935
944
  }
936
945
  };
937
946
 
938
947
  const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
939
- if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
948
+ if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value) || (key === 'processGfot' && !isDisabledProcessGfot.value)) {
940
949
  if (key === 'amount') {
941
950
  if (calculatorForm.type.nameRu === null || !calculatorForm.countries || (calculatorForm.countries && calculatorForm.countries.length === 0)) {
942
951
  return dataStore.showToaster('error', dataStore.t('toaster.noAmountBeforeTypeAndCountries'), 2000);
@@ -951,8 +960,6 @@ export default defineComponent({
951
960
  currentPanel.value = key as keyof typeof productConditionsForm;
952
961
  isPanelOpen.value = true;
953
962
  isTermsPanelOpen.value = false;
954
- isFixInsAmountPanelOpen.value = false;
955
- isCoverPeriodPanelOpen.value = false;
956
963
  dataStore.panelAction = null;
957
964
  dataStore.rightPanel.open = true;
958
965
  dataStore.rightPanel.title = title;
@@ -979,8 +986,6 @@ export default defineComponent({
979
986
  const openMultiplePanel = async (title: string, list: CountryValue[], key: string, asyncFunction?: Function, filterKey?: string) => {
980
987
  if (!isDisabled.value || !isRecalculationDisabled.value) {
981
988
  isPanelOpen.value = false;
982
- isFixInsAmountPanelOpen.value = false;
983
- isCoverPeriodPanelOpen.value = false;
984
989
  isMultiplePanelOpen.value = true;
985
990
  isPanelLoading.value = true;
986
991
  let newList = list;
@@ -1024,13 +1029,11 @@ export default defineComponent({
1024
1029
  };
1025
1030
 
1026
1031
  const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
1027
- if (!isDisabled.value) {
1032
+ if (!isDisabled.value || (whichProduct.value === 'lifebusiness' && dataStore.isUnderwriter())) {
1028
1033
  searchQuery.value = '';
1029
1034
  currentIndex.value = index;
1030
1035
  isPanelOpen.value = false;
1031
1036
  isMultiplePanelOpen.value = false;
1032
- isFixInsAmountPanelOpen.value = false;
1033
- isCoverPeriodPanelOpen.value = false;
1034
1037
  isTermsPanelOpen.value = true;
1035
1038
  dataStore.panelAction = null;
1036
1039
  dataStore.rightPanel.open = true;
@@ -1050,39 +1053,21 @@ export default defineComponent({
1050
1053
  }
1051
1054
  };
1052
1055
 
1053
- const openFixInsPanel = async (title: string, amount: number) => {
1054
- if (!isDisabled.value) {
1055
- searchQuery.value = '';
1056
- isPanelOpen.value = false;
1057
- isTermsPanelOpen.value = false;
1058
- isMultiplePanelOpen.value = false;
1059
- isCoverPeriodPanelOpen.value = false;
1060
- isFixInsAmountPanelOpen.value = true;
1061
- dataStore.panelAction = null;
1062
- dataStore.rightPanel.open = true;
1063
- dataStore.rightPanel.title = title;
1064
- panelList.value = constants.fixInsAmount;
1065
- fixInsValue.value = String(amount);
1066
- } else {
1067
- dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
1068
- }
1069
- };
1070
-
1071
- const pickfixInsValue = (item: Value) => {
1056
+ const pickSubTermValue = (item: Value, subItem: Value) => {
1072
1057
  dataStore.rightPanel.open = false;
1073
- isFixInsAmountPanelOpen.value = false;
1058
+ isTermsPanelOpen.value = false;
1059
+ subTermValue.value = item.code as string;
1074
1060
  if (typeof currentIndex.value !== 'number') return;
1075
- additionalTerms.value[currentIndex.value].amount = Number(item.code);
1076
- };
1077
1061
 
1078
- const pickCoverPeriodValue = (item: Value) => {
1079
- coverPeriodValue.value = item.code as string;
1080
- dataStore.rightPanel.open = false;
1081
- isCoverPeriodPanelOpen.value = false;
1082
- if (typeof currentIndex.value !== 'number') return;
1083
- additionalTerms.value[currentIndex.value].coverPeriodCode = item.code as string;
1084
- additionalTerms.value[currentIndex.value].coverPeriodId = item.id as string;
1085
- additionalTerms.value[currentIndex.value].coverPeriodName = item.nameRu as string;
1062
+ if (item.code === 'fixedinssum') {
1063
+ additionalTerms.value[currentIndex.value].amount = Number(subItem.code);
1064
+ }
1065
+
1066
+ if (item.code === 'processcovertypesum') {
1067
+ additionalTerms.value[currentIndex.value].coverPeriodCode = subItem.code as string;
1068
+ additionalTerms.value[currentIndex.value].coverPeriodId = subItem.id as string;
1069
+ additionalTerms.value[currentIndex.value].coverPeriodName = subItem.nameRu as string;
1070
+ }
1086
1071
  };
1087
1072
 
1088
1073
  const underwriterCalculate = async (type: 'sum' | 'premium') => {
@@ -1296,7 +1281,12 @@ export default defineComponent({
1296
1281
  recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
1297
1282
  recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
1298
1283
  isCalculating.value = true;
1299
- await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
1284
+ if (whichProduct.value === 'lifebusiness') {
1285
+ await dataStore.calculate(route.params.taskId as string);
1286
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1287
+ } else {
1288
+ await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
1289
+ }
1300
1290
  }
1301
1291
  isCalculating.value = true;
1302
1292
  if (props.isCalculator) {
@@ -1492,10 +1482,9 @@ export default defineComponent({
1492
1482
  whichSum,
1493
1483
  Value,
1494
1484
  calculatorForm,
1495
- isFixInsAmountPanelOpen,
1496
- isCoverPeriodPanelOpen,
1497
- fixInsValue,
1498
- coverPeriodValue,
1485
+ subPanelList,
1486
+ subTermValue,
1487
+ panelCodeList,
1499
1488
 
1500
1489
  // Computed
1501
1490
  isTask,
@@ -1536,6 +1525,8 @@ export default defineComponent({
1536
1525
  hasDefault,
1537
1526
  isDisabledProcessGfot,
1538
1527
  isShownAdditionalTerms,
1528
+ hasCalcSum,
1529
+ isDisabledAgentCommission,
1539
1530
 
1540
1531
  // Rules
1541
1532
  coverPeriodRule,
@@ -1562,10 +1553,8 @@ export default defineComponent({
1562
1553
  formatTermValue,
1563
1554
  filterTermConditions,
1564
1555
  selectOption,
1565
- pickfixInsValue,
1566
- openFixInsPanel,
1567
- pickCoverPeriodValue,
1568
1556
  coverTypeName,
1557
+ pickSubTermValue,
1569
1558
  };
1570
1559
  },
1571
1560
  });
@@ -148,27 +148,12 @@
148
148
  <base-btn :text="buttonText" :loading="loading" @click="submitForm" />
149
149
  </div>
150
150
  </section>
151
- <section v-if="templateAction">
152
- <div :class="[$styles.flexColNav]">
153
- <base-content-block>
154
- <base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded" @click.prevent="downloadTemplate(constants.documentTypes.insuredsList, 'vnd.ms-excel')">
155
- {{ $dataStore.t('downloadTemplate') }}
156
- <i class="mdi mdi-download text-2xl text-[#A0B3D8]"></i
157
- ></base-panel-item>
158
- </base-content-block>
159
- <base-content-block>
160
- <v-form ref="vForm" class="mb-3">
161
- <base-form-input v-model.trim="email" :label="$dataStore.t('form.email')" :rules="$rules.required" />
162
- </v-form>
163
- <base-btn :text="$dataStore.t('form.sendToEmail')" :loading="loading" @click="sendTemplateToEmail" />
164
- </base-content-block>
165
- </div>
166
- </section>
167
151
  </template>
168
152
 
169
153
  <script lang="ts">
170
154
  import { DocumentItem, Value } from '../../composables/classes';
171
155
  import { HubConnectionBuilder } from '@microsoft/signalr';
156
+ import { uuid } from 'vue-uuid';
172
157
 
173
158
  export default defineComponent({
174
159
  emits: ['task'],
@@ -182,7 +167,6 @@ export default defineComponent({
182
167
  const isScansDocuments = ref<boolean>(false);
183
168
  const isQr = ref<boolean>(false);
184
169
  const isElectronicContract = ref<boolean>(true);
185
- const email = ref<string>('');
186
170
  const qrUrl = ref<string>('');
187
171
  const connection = ref<any>(null);
188
172
  const isQrLoading = ref<boolean>(false);
@@ -367,25 +351,17 @@ export default defineComponent({
367
351
  case constants.actions.register:
368
352
  return dataStore.t('buttons.register');
369
353
  case constants.actions.affiliate:
370
- case constants.actions.template:
371
354
  return dataStore.t('buttons.send');
372
355
  default:
373
356
  return dataStore.t('buttons.send');
374
357
  }
375
358
  });
376
359
 
377
- const panelTitle = computed(() => {
378
- if (dataStore.isLifeBusiness && dataStore.panelAction === constants.actions.template) {
379
- return dataStore.t('template');
380
- }
381
- return buttonText.value;
382
- });
383
-
384
360
  watch(
385
361
  () => dataStore.panelAction,
386
362
  val => {
387
363
  if (!!val) {
388
- dataStore.panel.title = panelTitle.value;
364
+ dataStore.panel.title = buttonText.value;
389
365
  dataStore.panel.open = true;
390
366
  }
391
367
  },
@@ -403,7 +379,6 @@ export default defineComponent({
403
379
  () => dataStore.panelAction === constants.actions.reject || dataStore.panelAction === constants.actions.return || dataStore.panelAction === constants.actions.rejectclient,
404
380
  );
405
381
  const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
406
- const templateAction = computed(() => dataStore.panelAction === constants.actions.template);
407
382
  const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
408
383
  const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
409
384
  const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
@@ -456,21 +431,12 @@ export default defineComponent({
456
431
  await dataStore.downloadTemplate(documentType, fileType);
457
432
  };
458
433
 
459
- const sendTemplateToEmail = async () => {
460
- await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
461
- if (v.valid) {
462
- dataStore.panel.open = false;
463
- dataStore.panelAction = null;
464
- await dataStore.sendTemplateToEmail(email.value);
465
- }
466
- });
467
- };
468
-
469
434
  const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr') => {
470
435
  loading.value = true;
471
436
  if (type === 'electronic') {
472
437
  await dataStore.signDocument();
473
438
  isElectronicContract.value = true;
439
+ dataStore.panelAction = constants.actions.sign;
474
440
  }
475
441
  if (type === 'paper') {
476
442
  isPaperContract.value = true;
@@ -491,8 +457,8 @@ export default defineComponent({
491
457
 
492
458
  // TODO Рефактор QR c npm
493
459
  const generateQR = async (groupId: string) => {
494
- const uuid = crypto.randomUUID();
495
- const qrValue = `${getValuePerEnv('qrGenUrl')}/${uuid}/${groupId}`;
460
+ const uuidV4 = uuid.v4();
461
+ const qrValue = `${getValuePerEnv('qrGenUrl')}/${uuidV4}/${groupId}`;
496
462
  qrUrl.value = `https://api.qrserver.com/v1/create-qr-code/?size=135x135&data=${qrValue}`;
497
463
 
498
464
  if (dataStore.isLifeBusiness) {
@@ -503,7 +469,7 @@ export default defineComponent({
503
469
  urlCopy.value = `https://mgovsign.page.link/?link=${qrValue}?mgovSign&amp;apn=kz.mobile.mgov&amp;isi=1476128386&amp;ibi=kz.egov.mobile`;
504
470
  }
505
471
 
506
- await startConnection(uuid);
472
+ await startConnection(uuidV4);
507
473
  };
508
474
 
509
475
  const startConnection = async (uuid: string) => {
@@ -560,7 +526,6 @@ export default defineComponent({
560
526
  selectedClient,
561
527
  isPaperContract,
562
528
  isScansDocuments,
563
- email,
564
529
  isQr,
565
530
  qrUrl,
566
531
  scansFiles,
@@ -575,7 +540,6 @@ export default defineComponent({
575
540
  openEpayPanel,
576
541
  onFileChange,
577
542
  downloadTemplate,
578
- sendTemplateToEmail,
579
543
  onFileChangeScans,
580
544
  sendFiles,
581
545
  onClearFile,
@@ -596,7 +560,6 @@ export default defineComponent({
596
560
  hasConditionsInfo,
597
561
  price,
598
562
  insuredAmount,
599
- templateAction,
600
563
  isElectronicContract,
601
564
  handleSignAction,
602
565
  generateDocument,
@@ -754,6 +754,7 @@ export class ProductConditions {
754
754
  statePremium5: number | string | null;
755
755
  statePremium7: number | string | null;
756
756
  calculatorForm: CalculatorForm;
757
+ agentCommission: number | null;
757
758
  constructor(
758
759
  insuranceCase = null,
759
760
  coverPeriod = null,
@@ -796,6 +797,7 @@ export class ProductConditions {
796
797
  statePremium5 = null,
797
798
  statePremium7 = null,
798
799
  calculatorForm = new CalculatorForm(),
800
+ agentCommission = null,
799
801
  ) {
800
802
  this.requestedSumInsuredInDollar = null;
801
803
  this.insurancePremiumPerMonthInDollar = null;
@@ -843,6 +845,7 @@ export class ProductConditions {
843
845
  this.statePremium5 = statePremium5;
844
846
  this.statePremium7 = statePremium7;
845
847
  this.calculatorForm = calculatorForm;
848
+ this.agentCommission = agentCommission;
846
849
  }
847
850
  getSingleTripDays() {
848
851
  if (this.calculatorForm.startDate && this.calculatorForm.endDate) {
@@ -1238,13 +1241,7 @@ export class FormStoreClass {
1238
1241
  signedContractFormData: any;
1239
1242
  lfb: {
1240
1243
  clients: ClientV2[];
1241
- policyholder: {
1242
- isIpdl: boolean;
1243
- clientData: {
1244
- company: MemberV2;
1245
- authoritedPerson: MemberV2;
1246
- };
1247
- };
1244
+ policyholder: PolicyholderClass;
1248
1245
  hasAccidentIncidents: boolean;
1249
1246
  accidentIncidents: AccidentIncidents[];
1250
1247
  policyholderActivities: PolicyholderActivity[];
@@ -1352,13 +1349,7 @@ export class FormStoreClass {
1352
1349
  this.signedContractFormData = null;
1353
1350
  this.lfb = {
1354
1351
  clients: [],
1355
- policyholder: {
1356
- isIpdl: false,
1357
- clientData: {
1358
- company: new MemberV2(),
1359
- authoritedPerson: new MemberV2(),
1360
- },
1361
- },
1352
+ policyholder: new PolicyholderClass(),
1362
1353
  hasAccidentIncidents: true,
1363
1354
  policyholderActivities: [new PolicyholderActivity()],
1364
1355
  beneficialOwners: [new BeneficialOwner()],
@@ -1453,111 +1444,144 @@ export class FormStoreClass {
1453
1444
  }
1454
1445
  }
1455
1446
 
1456
- export class MemberV2 {
1457
- iin: string | null;
1458
- phoneNumber: string | null;
1459
- firstName?: string | null;
1460
- middleName?: string | null;
1461
- lastName?: string | null;
1462
- name?: string | null;
1463
- longName?: string | null;
1464
- nameKz?: string | null;
1465
- longNameKz?: string | null;
1447
+ export class Address {
1448
+ country: Value;
1449
+ region: Value;
1450
+ regionType: Value;
1451
+ city: Value;
1452
+ square: string | null;
1453
+ microdistrict: string | null;
1454
+ street: string | null;
1455
+ houseNumber: string | null;
1456
+ kato: string | null;
1457
+ longName: string | null;
1458
+ longNameKz: string | null;
1459
+ constructor() {
1460
+ this.country = new Value();
1461
+ this.region = new Value();
1462
+ this.regionType = new Value();
1463
+ this.city = new Value();
1464
+ this.square = null;
1465
+ this.microdistrict = null;
1466
+ this.street = null;
1467
+ this.houseNumber = null;
1468
+ this.kato = null;
1469
+ this.longName = null;
1470
+ this.longNameKz = null;
1471
+ }
1472
+ }
1473
+
1474
+ export class PolicyholderActivity {
1475
+ activityTypeName: string | null;
1476
+ empoloyeeCount: string | null;
1477
+ constructor() {
1478
+ this.activityTypeName = null;
1479
+ this.empoloyeeCount = null;
1480
+ }
1481
+ }
1482
+
1483
+ export class BaseGroupClass {
1484
+ id: string | number;
1485
+ longName: string;
1486
+ iin: string;
1487
+ phoneNumber: string;
1488
+ age: string;
1489
+ name: string;
1490
+ nameKz: string;
1491
+ longNameKz: string;
1466
1492
  citizenship: Value;
1467
- email: string | null;
1493
+ email: string;
1468
1494
  resident: Value;
1469
1495
  taxResidentCountry: Value;
1496
+ addTaxResidency: Value;
1470
1497
  economySectorCode: Value;
1498
+ hasAttachedFile: boolean;
1499
+ actualAddress: Address;
1471
1500
  isActualAddressEqualLegalAddres: boolean;
1472
- identityDocument?: {
1501
+ legalAddress: Address;
1502
+ identityDocument: {
1473
1503
  documentType: Value;
1474
- documentNumber: string | null;
1475
- series: string | null;
1504
+ documentNumber: string;
1505
+ series: string;
1476
1506
  issuedBy: Value;
1477
1507
  validUntil: string | null;
1478
1508
  };
1479
- bankInfo: {
1480
- bin: string | null;
1481
- bankName: Value;
1482
- iik: string | null;
1483
- bik: string | null;
1484
- kbe: string | null;
1485
- };
1486
- workDetails?: {
1487
- workplace: string | null;
1488
- position: string | null;
1489
- jobDuties: string | null;
1490
- };
1491
- authorityDetails: {
1492
- basis: string | null;
1493
- documentNumber: string | null;
1494
- date: string | null;
1495
- };
1496
- kbe: string | null;
1497
- typeOfEconomicActivity: Value;
1498
- legalAddress: Address;
1499
- actualAddress: Address;
1500
- activityTypes: {
1501
- activityTypeName: string | null;
1502
- empoloyeeCount: number | null;
1503
- }[];
1504
- isLeader?: boolean;
1505
- beneficalOwnerQuest?: {
1506
- order: number;
1507
- text: string | null;
1508
- answer: boolean | null;
1509
- }[];
1509
+ bankInfo: BankInfoClass;
1510
+ kbe: string;
1510
1511
  constructor() {
1511
- this.iin = null;
1512
- this.phoneNumber = null;
1513
- this.firstName = null;
1514
- this.middleName = null;
1515
- this.lastName = null;
1516
- this.name = null;
1517
- this.longName = null;
1518
- this.nameKz = null;
1519
- this.longNameKz = null;
1512
+ this.id = 0;
1513
+ this.longName = '';
1514
+ this.iin = '';
1515
+ this.phoneNumber = '';
1516
+ this.age = '';
1517
+ this.name = '';
1518
+ this.nameKz = '';
1519
+ this.longNameKz = '';
1520
1520
  this.citizenship = new Value();
1521
- this.email = null;
1521
+ this.email = '';
1522
1522
  this.resident = new Value();
1523
1523
  this.taxResidentCountry = new Value();
1524
+ this.addTaxResidency = new Value();
1524
1525
  this.economySectorCode = new Value();
1526
+ this.hasAttachedFile = false;
1527
+ this.actualAddress = new Address();
1525
1528
  this.isActualAddressEqualLegalAddres = true;
1529
+ this.legalAddress = new Address();
1526
1530
  this.identityDocument = {
1527
1531
  documentType: new Value(),
1528
- documentNumber: null,
1529
- series: null,
1532
+ documentNumber: '',
1533
+ series: '',
1530
1534
  issuedBy: new Value(),
1531
- validUntil: null,
1532
- };
1533
- this.bankInfo = {
1534
- bin: null,
1535
- bankName: new Value(),
1536
- iik: null,
1537
- bik: null,
1538
- kbe: null,
1539
- };
1540
- this.workDetails = {
1541
- workplace: null,
1542
- position: null,
1543
- jobDuties: null,
1535
+ validUntil: '',
1544
1536
  };
1537
+ this.bankInfo = new BankInfoClass();
1538
+ this.kbe = '';
1539
+ }
1540
+ }
1541
+
1542
+ export class PhysGroupClass extends BaseGroupClass {
1543
+ lastName: string;
1544
+ firstName: string;
1545
+ middleName: string;
1546
+ birthDate: string | null;
1547
+ placeOfBirth: Value;
1548
+ workDetails: { workplace: string; position: string; jobDuties: string };
1549
+ hasContactPerson: boolean;
1550
+ constructor() {
1551
+ super();
1552
+ this.lastName = '';
1553
+ this.firstName = '';
1554
+ this.middleName = '';
1555
+ this.birthDate = '';
1556
+ this.placeOfBirth = new Value();
1557
+ this.workDetails = { workplace: '', position: '', jobDuties: '' };
1558
+ this.hasContactPerson = false;
1559
+ }
1560
+ }
1561
+
1562
+ export class GroupMember extends PhysGroupClass {
1563
+ isLeader: boolean;
1564
+ authorityDetails: {
1565
+ basis: Value;
1566
+ documentNumber: string | null;
1567
+ date: string | null;
1568
+ };
1569
+ typeOfEconomicActivity: Value;
1570
+ activityTypes: { activityTypeName: string; empoloyeeCount: number }[];
1571
+ beneficalOwnerQuest: { order: number; text: string; answer: boolean | null }[];
1572
+ authoritedPerson: PhysGroupClass;
1573
+ insuredPolicyData: InsuredPolicyType;
1574
+ constructor() {
1575
+ super();
1576
+ // Client
1577
+ this.isLeader = false;
1545
1578
  this.authorityDetails = {
1546
- basis: null,
1579
+ basis: new Value(),
1547
1580
  documentNumber: null,
1548
1581
  date: null,
1549
1582
  };
1550
- this.kbe = null;
1551
1583
  this.typeOfEconomicActivity = new Value();
1552
- this.legalAddress = new Address();
1553
- this.actualAddress = new Address();
1554
- this.activityTypes = [
1555
- {
1556
- activityTypeName: null,
1557
- empoloyeeCount: null,
1558
- },
1559
- ];
1560
- this.isLeader = false;
1584
+ this.activityTypes = [];
1561
1585
  this.beneficalOwnerQuest = [
1562
1586
  {
1563
1587
  order: 0,
@@ -1575,82 +1599,60 @@ export class MemberV2 {
1575
1599
  answer: null,
1576
1600
  },
1577
1601
  ];
1602
+ this.authoritedPerson = new PhysGroupClass();
1603
+ // Insured
1604
+ this.insuredPolicyData = {
1605
+ insSum: 0,
1606
+ insSumWithLoad: 0,
1607
+ premium: 0,
1608
+ premiumWithLoad: 0,
1609
+ insuredRisk: {
1610
+ lifeMultiply: 0,
1611
+ lifeAdditive: 0,
1612
+ disabilityMultiply: 0,
1613
+ disabilityAdditive: 0,
1614
+ traumaTableMultiple: 0,
1615
+ accidentalLifeMultiply: 0,
1616
+ accidentalLifeAdditive: 0,
1617
+ criticalMultiply: 0,
1618
+ criticalAdditive: 0,
1619
+ },
1620
+ insuredCoverData: [],
1621
+ };
1578
1622
  }
1579
1623
  }
1580
1624
 
1581
- export class Address {
1582
- country: Value;
1583
- region: Value;
1584
- regionType: Value;
1585
- city: Value;
1586
- square: string | null;
1587
- microdistrict: string | null;
1588
- street: string | null;
1589
- houseNumber: string | null;
1590
- kato: string | null;
1625
+ export class BankInfoClass {
1626
+ bankName: Value;
1627
+ bin: string;
1628
+ iik: string;
1629
+ bik: string;
1630
+ kbe: string;
1591
1631
  constructor() {
1592
- this.country = new Value();
1593
- this.region = new Value();
1594
- this.regionType = new Value();
1595
- this.city = new Value();
1596
- this.square = null;
1597
- this.microdistrict = null;
1598
- this.street = null;
1599
- this.houseNumber = null;
1600
- this.kato = null;
1632
+ this.bankName = new Value();
1633
+ this.bin = '';
1634
+ this.iik = '';
1635
+ this.bik = '';
1636
+ this.kbe = '';
1601
1637
  }
1602
1638
  }
1603
1639
 
1604
- export class PolicyholderActivity {
1605
- activityTypeName: string | null;
1606
- empoloyeeCount: string | null;
1640
+ export class PolicyholderClass {
1641
+ isIpdl: boolean;
1642
+ clientData: GroupMember;
1607
1643
  constructor() {
1608
- this.activityTypeName = null;
1609
- this.empoloyeeCount = null;
1644
+ this.isIpdl = false;
1645
+ this.clientData = new GroupMember();
1610
1646
  }
1611
1647
  }
1612
1648
 
1613
1649
  export class BeneficialOwner {
1614
- id: string | null;
1615
- processInstanceId: string | number;
1616
- insisId: number;
1617
- iin: string | null;
1618
- longName: string | null;
1650
+ id: string;
1619
1651
  isIpdl: boolean;
1620
- isTerror: boolean;
1621
- isIpdlCompliance: boolean;
1622
- isTerrorCompliance: boolean;
1623
- personType: number;
1624
- lastName: string | null;
1625
- firstName: string | null;
1626
- middleName: string | null;
1627
- countryId: string | null;
1628
- countryName: string | null;
1629
- residentId: string | null;
1630
- residentName: string | null;
1631
- taxResidentId: string | null;
1632
- taxResidentName: string | null;
1633
- beneficialOwnerData: MemberV2;
1652
+ beneficialOwnerData: GroupMember;
1634
1653
  constructor() {
1635
- this.id = null;
1636
- this.processInstanceId = 0;
1637
- this.insisId = 0;
1638
- this.iin = null;
1639
- this.longName = null;
1640
1654
  this.isIpdl = false;
1641
- this.isTerror = true;
1642
- this.isIpdlCompliance = true;
1643
- this.isTerrorCompliance = true;
1644
- this.personType = 0;
1645
- this.lastName = null;
1646
- this.firstName = null;
1647
- this.middleName = null;
1648
- this.countryId = null;
1649
- this.countryName = null;
1650
- this.residentId = null;
1651
- this.residentName = null;
1652
- this.taxResidentId = null;
1653
- this.taxResidentName = null;
1654
- this.beneficialOwnerData = new MemberV2();
1655
+ this.beneficialOwnerData = new GroupMember();
1656
+ this.id = '';
1655
1657
  }
1656
1658
  }
package/locales/ru.json CHANGED
@@ -725,7 +725,11 @@
725
725
  "attachApplication": "Вложить приложение №1",
726
726
  "attachPowerOfAttorney": "Вложить доверенность",
727
727
  "noDocuments": "Нет документов для просмотра",
728
- "address": "Адрес"
728
+ "address": "Адрес",
729
+ "premiumWithLoad": "Страховая премия за факт период (с нагрузкой)",
730
+ "premiumWithoutLoad": "Страховая премия за факт период (без нагрузки)",
731
+ "policyStartDate": "Дата начала действия полиса",
732
+ "policyEndDate": "Дата окончания действия полиса",
729
733
  },
730
734
  "placeholders": {
731
735
  "login": "Логин",
@@ -761,7 +765,8 @@
761
765
  "calculationPreliminary": "Расчет предварительный. Требуется заполнить все необходимые данные",
762
766
  "planDate": "Дата должна превышать сегодняшнюю дату",
763
767
  "iik": "ИИК должен состоять из 20 символов",
764
- "dataInPast": "Указанная дата осталась в прошлом"
768
+ "dataInPast": "Указанная дата осталась в прошлом",
769
+ "agentCommission": "Агентская комиссия не должно превышать 50"
765
770
  },
766
771
  "code": "КСЭ",
767
772
  "fontSize": "Размер шрифта",
@@ -915,6 +920,7 @@
915
920
  "coveragePeriod": "Период покрытия",
916
921
  "attachScansSignDocs": "Вложить сканы подписанных документов",
917
922
  "declarationHealthInsured": "Декларация о здоровье Застрахованных",
923
+ "uploadInsured": "Загрузите застрахованных",
918
924
  "form": {
919
925
  "calculation": "Расчеты",
920
926
  "paymentAmount": "Размер выплаты",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.9-beta.41",
3
+ "version": "0.0.9-beta.42",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -3,7 +3,18 @@ import { rules } from './rules';
3
3
  import { i18n } from '../configs/i18n';
4
4
  import { Toast, Types, Positions, ToastOptions } from './toast';
5
5
  import { isValidGUID, yearEnding, jwtDecode, ErrorHandler, getKeyWithPattern, getNumber, getAgeByBirthDate } from '../composables';
6
- import { DataStoreClass, Contragent, DocumentItem, Member, Value, CountryValue, MemberV2, PolicyholderActivity, BeneficialOwner } from '../composables/classes';
6
+ import {
7
+ DataStoreClass,
8
+ Contragent,
9
+ DocumentItem,
10
+ Member,
11
+ Value,
12
+ CountryValue,
13
+ PolicyholderActivity,
14
+ BeneficialOwner,
15
+ GroupMember,
16
+ PolicyholderClass,
17
+ } from '../composables/classes';
7
18
  import { ApiClass } from '../api';
8
19
  import { useFormStore } from './form.store';
9
20
  import { AxiosError } from 'axios';
@@ -1038,7 +1049,7 @@ export const useDataStore = defineStore('data', {
1038
1049
  if (this.isLifeBusiness) {
1039
1050
  conditionsData.policyAppDto.insTermInMonth = Number(this.formStore.productConditionsForm.coverPeriod);
1040
1051
  conditionsData.policyAppDto.fixInsSum = getNumber(String(this.formStore.productConditionsForm.requestedSumInsured));
1041
- conditionsData.policyAppDto.tariffId = String(this.formStore.productConditionsForm.processTariff.id);
1052
+ conditionsData.policyAppDto.agentCommission = Number(this.formStore.productConditionsForm.agentCommission);
1042
1053
  conditionsData.policyAppDto.processDefinitionFgotId = (this.formStore.productConditionsForm.processGfot.id as string) ?? undefined;
1043
1054
  }
1044
1055
  return conditionsData;
@@ -1320,7 +1331,7 @@ export const useDataStore = defineStore('data', {
1320
1331
  }
1321
1332
  return this.cities;
1322
1333
  },
1323
- async getCitiesEfo(key?: string, member?: MemberV2, parentKey?: string) {
1334
+ async getCitiesEfo(key?: string, member?: any, parentKey?: string) {
1324
1335
  if (this.isLifeBusiness) {
1325
1336
  await this.getFromApi('cities', 'getCities');
1326
1337
  //@ts-ignore
@@ -1784,7 +1795,7 @@ export const useDataStore = defineStore('data', {
1784
1795
  calculationData.insrCount = this.formStore.lfb.clients.length;
1785
1796
  calculationData.insTermInMonth = Number(this.formStore.productConditionsForm.coverPeriod);
1786
1797
  calculationData.fixInsSum = getNumber(String(this.formStore.productConditionsForm.requestedSumInsured));
1787
- calculationData.agentCommission = this.formStore.productConditionsForm.processTariff.id;
1798
+ calculationData.agentCommission = Number(this.formStore.productConditionsForm.agentCommission);
1788
1799
  calculationData.processDefinitionFgotId = this.formStore.productConditionsForm.processGfot.id;
1789
1800
  }
1790
1801
  const calculationResponse = await this.api.calculateWithoutApplication(calculationData, this.isCalculator ? product : undefined);
@@ -1811,6 +1822,9 @@ export const useDataStore = defineStore('data', {
1811
1822
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.mainPremium);
1812
1823
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.fixInsSum === 0 ? null : calculationResponse.fixInsSum);
1813
1824
  this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
1825
+ if (calculationResponse.agentCommission) {
1826
+ this.formStore.productConditionsForm.agentCommission = calculationResponse.agentCommission;
1827
+ }
1814
1828
  if (calculationResponse.clients) {
1815
1829
  this.formStore.lfb.clients = calculationResponse.clients;
1816
1830
  }
@@ -3104,9 +3118,9 @@ export const useDataStore = defineStore('data', {
3104
3118
  const economySectorCode = this.economySectorCode.find((i: Value) => i.ids === '500003.9');
3105
3119
  if (economySectorCode) member.economySectorCode = economySectorCode;
3106
3120
  },
3107
- async startApplicationV2(data: any) {
3121
+ async startApplicationV2(data: PolicyholderClass) {
3108
3122
  const policyholder = data.clientData;
3109
- if (!policyholder.authoritedPerson.iin) return false;
3123
+ if (!policyholder.iin) return false;
3110
3124
  try {
3111
3125
  const response = await this.api.startApplication(data);
3112
3126
  this.sendToParent(constants.postActions.applicationCreated, response.processInstanceId);
@@ -3115,7 +3129,7 @@ export const useDataStore = defineStore('data', {
3115
3129
  return ErrorHandler(err);
3116
3130
  }
3117
3131
  },
3118
- async saveClient(policyholder: any) {
3132
+ async saveClient(policyholder: PolicyholderClass) {
3119
3133
  try {
3120
3134
  await this.api.saveClient(this.formStore.applicationData.processInstanceId, this.formStore.lfb.clientId, policyholder);
3121
3135
  } catch (err) {
@@ -3156,12 +3170,12 @@ export const useDataStore = defineStore('data', {
3156
3170
 
3157
3171
  this.formStore.applicationData.processInstanceId = applicationData.processInstanceId;
3158
3172
  this.formStore.lfb.policyholder.isIpdl = applicationData.clientApp.isIpdl;
3159
- this.formStore.lfb.policyholder.clientData.company = clientData;
3173
+ this.formStore.lfb.policyholder.clientData = clientData;
3160
3174
  this.formStore.lfb.policyholder.clientData.authoritedPerson = clientData.authoritedPerson;
3161
- this.formStore.lfb.policyholder.clientData.company.iin = reformatIin(clientData.iin);
3175
+ this.formStore.lfb.policyholder.clientData.iin = reformatIin(clientData.iin);
3162
3176
  this.formStore.lfb.policyholder.clientData.authoritedPerson.iin = reformatIin(clientData.authoritedPerson.iin);
3163
3177
  this.formStore.lfb.clientId = clientId;
3164
- this.formStore.lfb.policyholder.clientData.company.authorityDetails.date = reformatDate(clientData.authorityDetails.date);
3178
+ this.formStore.lfb.policyholder.clientData.authorityDetails.date = reformatDate(clientData.authorityDetails.date);
3165
3179
 
3166
3180
  if (clientData && clientData.activityTypes !== null) {
3167
3181
  this.formStore.lfb.policyholderActivities = clientData.activityTypes;
@@ -3171,6 +3185,7 @@ export const useDataStore = defineStore('data', {
3171
3185
  this.formStore.lfb.beneficialOwners = beneficialOwnerApp;
3172
3186
  this.formStore.lfb.isPolicyholderBeneficialOwner = clientData.authoritedPerson.iin.replace(/-/g, '') === beneficialOwnerApp[0].beneficialOwnerData.iin ? true : false;
3173
3187
  this.formStore.lfb.beneficialOwners.forEach(beneficial => {
3188
+ beneficial.beneficialOwnerData.birthDate = reformatDate(beneficial.beneficialOwnerData.birthDate as string);
3174
3189
  beneficial.beneficialOwnerData.identityDocument!.validUntil = reformatDate(beneficial.beneficialOwnerData.identityDocument!.validUntil as string);
3175
3190
  beneficial.beneficialOwnerData.iin = reformatIin(beneficial.beneficialOwnerData.iin as string);
3176
3191
  });
@@ -3189,6 +3204,7 @@ export const useDataStore = defineStore('data', {
3189
3204
  });
3190
3205
  }
3191
3206
 
3207
+ this.formStore.productConditionsForm.agentCommission = applicationData.policyAppDto.agentCommission === 0 ? null : applicationData.policyAppDto.agentCommission;
3192
3208
  this.formStore.productConditionsForm.coverPeriod = 12;
3193
3209
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(applicationData.policyAppDto.amount === 0 ? null : applicationData.policyAppDto.amount);
3194
3210
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(
@@ -3196,8 +3212,8 @@ export const useDataStore = defineStore('data', {
3196
3212
  );
3197
3213
  const paymentPeriod = this.processPaymentPeriod.find(item => item.id == applicationData.policyAppDto.paymentPeriodId);
3198
3214
  this.formStore.productConditionsForm.paymentPeriod = paymentPeriod ? paymentPeriod : new Value();
3199
- const processTariff = this.processTariff.find(item => item.id == applicationData.policyAppDto.tariffId);
3200
- this.formStore.productConditionsForm.processTariff = processTariff ? processTariff : new Value();
3215
+ // const processTariff = this.processTariff.find(item => item.id == applicationData.policyAppDto.tariffId);
3216
+ // this.formStore.productConditionsForm.processTariff = processTariff ? processTariff : new Value();
3201
3217
  const processGfot = this.processGfot.find(item => item.id == applicationData.policyAppDto.processDefinitionFgotId);
3202
3218
  this.formStore.productConditionsForm.processGfot = processGfot ? processGfot : new Value();
3203
3219
  } catch (err) {
@@ -3218,9 +3234,9 @@ export const useDataStore = defineStore('data', {
3218
3234
  return ErrorHandler(err);
3219
3235
  }
3220
3236
  },
3221
- async saveClientAcivityTypes(data: PolicyholderActivity[]) {
3237
+ async saveClientActivityTypes(data: PolicyholderActivity[]) {
3222
3238
  try {
3223
- const response = await this.api.saveClientAcivityTypes(this.formStore.applicationData.clientApp.id, data);
3239
+ const response = await this.api.saveClientActivityTypes(this.formStore.applicationData.clientApp.id, data);
3224
3240
  return response;
3225
3241
  } catch (err) {
3226
3242
  return ErrorHandler(err);
@@ -3236,7 +3252,7 @@ export const useDataStore = defineStore('data', {
3236
3252
  },
3237
3253
  async saveBeneficialOwner(beneficialOwner: BeneficialOwner) {
3238
3254
  try {
3239
- const response = await this.api.saveBeneficialOwner(this.formStore.applicationData.processInstanceId, beneficialOwner.id, beneficialOwner);
3255
+ const response = await this.api.saveBeneficialOwner(this.formStore.applicationData.processInstanceId, String(beneficialOwner.id), beneficialOwner);
3240
3256
  return response;
3241
3257
  } catch (err) {
3242
3258
  return ErrorHandler(err);
@@ -3265,7 +3281,7 @@ export const useDataStore = defineStore('data', {
3265
3281
  id: index,
3266
3282
  fullName: client.longName,
3267
3283
  gender: client.gender,
3268
- position: item.workDetails?.position,
3284
+ position: client.workDetails.position,
3269
3285
  birthDate: client.birthDate,
3270
3286
  iin: reformatIin(client.iin),
3271
3287
  insSum: client.insuredPolicyData.insSum,
@@ -3323,7 +3339,7 @@ export const useDataStore = defineStore('data', {
3323
3339
  if (this.validateMultipleMembersV2('beneficialOwners', 'beneficialOwnerApp', 'бенефициарных собственников') === false) {
3324
3340
  return false;
3325
3341
  }
3326
- const inStatement = this.formStore.lfb.beneficialOwners.every(i => i.id !== null);
3342
+ const inStatement = this.formStore.lfb.beneficialOwners.every(i => i.beneficialOwnerData.id !== null);
3327
3343
  if (inStatement === false) {
3328
3344
  this.showToaster('error', this.t('toaster.requiredMember', { text: this.t('toaster.beneficialOwner') }));
3329
3345
  return false;
package/store/rules.ts CHANGED
@@ -9,6 +9,7 @@ export const rules = {
9
9
  recalculationAdditive: [(v: any) => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween', { floor: '0', ceil: '100' })],
10
10
  required: [(v: any) => !!v || t('rules.required')],
11
11
  iik: [(v: any) => v.length === 20 || t('rules.iik')],
12
+ agentCommission: [(v: any) => v <= 50 || t('rules.agentCommission')],
12
13
  objectRequired: [
13
14
  (v: any) => {
14
15
  if (!!v && 'nameRu' in v && v.nameRu != null) {
package/types/enum.ts CHANGED
@@ -40,9 +40,6 @@ export enum Actions {
40
40
  affiliate = 'affiliate',
41
41
  affiliateCustom = 'affiliateCustom',
42
42
 
43
- template = 'template',
44
- templateCustom = 'templateCustom',
45
-
46
43
  chooseSign = 'chooseSign',
47
44
  chooseSignCustom = 'chooseSignCustom',
48
45
  }
package/types/index.ts CHANGED
@@ -81,6 +81,7 @@ declare global {
81
81
  status: string;
82
82
  userId: string;
83
83
  userName: string;
84
+ level?: string;
84
85
  }
85
86
  type TaskHistory = {
86
87
  appointmentDate: string | null;
@@ -267,7 +268,7 @@ declare global {
267
268
  fixInsSum?: number | null;
268
269
  tariffId?: string | number | null;
269
270
  clients?: ClientV2[];
270
- agentCommission?: any;
271
+ agentCommission?: number | null;
271
272
  processDefinitionFgotId?: any;
272
273
  };
273
274
 
@@ -306,6 +307,7 @@ declare global {
306
307
  mainPremium?: number;
307
308
  clients?: ClientV2[];
308
309
  fixInsSum?: number | null;
310
+ agentCommission?: number | null;
309
311
  };
310
312
 
311
313
  interface AddCover {
@@ -320,9 +322,9 @@ declare global {
320
322
  amount: number;
321
323
  premium: number;
322
324
  isMigrate: boolean;
323
- coverPeriodId?: string;
324
- coverPeriodName?: string;
325
- coverPeriodCode?: string;
325
+ coverPeriodId?: string | null;
326
+ coverPeriodName?: string | null;
327
+ coverPeriodCode?: string | null;
326
328
  calculatorValue?: number;
327
329
  coverTypeNameRu?: string;
328
330
  coverTypeNameKz?: string;
@@ -572,6 +574,7 @@ declare global {
572
574
  mainPremium?: number | string | null;
573
575
  processDefinitionFgotId?: string | number;
574
576
  mainInsSum?: number;
577
+ agentCommission?: number | null;
575
578
  };
576
579
 
577
580
  type InsisWorkDataApp = {
@@ -714,4 +717,26 @@ declare global {
714
717
  type LabelSize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
715
718
 
716
719
  type VuetifyAnimations = 'expand' | 'fab' | 'fade' | 'scale' | 'scroll-x' | 'scroll-y' | 'slide-x' | 'slide-x-r' | 'slide-y' | 'slide-y-r';
720
+
721
+ type InsuredPolicyType = {
722
+ insSum: number;
723
+ insSumWithLoad: number;
724
+ premium: number;
725
+ premiumWithLoad: number;
726
+ insuredRisk: {
727
+ lifeMultiply: number;
728
+ lifeAdditive: number;
729
+ disabilityMultiply: number;
730
+ disabilityAdditive: number;
731
+ traumaTableMultiple: number;
732
+ accidentalLifeMultiply: number;
733
+ accidentalLifeAdditive: number;
734
+ criticalMultiply: number;
735
+ criticalAdditive: number;
736
+ };
737
+ insuredCoverData: {
738
+ coverTypeEnum: number;
739
+ prmeium: number;
740
+ }[];
741
+ };
717
742
  }