hl-core 0.0.10-beta.73 → 0.0.10-beta.75

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
@@ -965,9 +965,7 @@ export class ApiClass {
965
965
  return await this.axiosCall<number>({
966
966
  method: Methods.POST,
967
967
  url: `/${this.productUrl}/api/Application/Calculator`,
968
- ...(typeof processInstanceIdOrData === 'string'
969
- ? { params: { processInstanceId: processInstanceIdOrData } }
970
- : { data: processInstanceIdOrData }),
968
+ ...(typeof processInstanceIdOrData === 'string' ? { params: { processInstanceId: processInstanceIdOrData } } : { data: processInstanceIdOrData }),
971
969
  });
972
970
  }
973
971
 
@@ -1211,6 +1209,14 @@ export class ApiClass {
1211
1209
  params: { processInstanceId },
1212
1210
  });
1213
1211
  },
1212
+ getEnpfExpirationDate: async (processInstanceId: string | number) => {
1213
+ return await this.axiosCall<void>({
1214
+ method: Methods.GET,
1215
+ baseURL: getStrValuePerEnv('efoBaseApi'),
1216
+ url: `${this.pensionannuityNew.base}/GetEnpfExpirationDate`,
1217
+ params: { processInstanceId },
1218
+ });
1219
+ },
1214
1220
  };
1215
1221
 
1216
1222
  externalServices = {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-dialog class="base-dialog" :model-value="Boolean(modelValue)" @update:modelValue="$emit('update:modelValue', $event)" :persistent="persistent">
3
- <v-card class="self-center w-full sm:w-4/4 md:w-2/3 lg:w-[35%] xl:w-[500px] rounded-lg !px-[15px] !py-[30px] sm:!p-[36px]">
3
+ <v-card class="self-center w-full sm:w-4/4 md:w-2/3 lg:w-[35%] xl:w-[500px] rounded-lg !px-[15px] !py-[30px] sm:!p-[36px]" :class="innerClass">
4
4
  <div class="flex sm:flex-row flex-col place-items-center sm:place-items-start">
5
5
  <div class="h-20 w-20 place-items-start pt-1">
6
6
  <div class="bg-[#F7F7F7] h-24 w-24 sm:h-16 sm:w-16 rounded grid place-items-center invisible sm:visible">
@@ -75,6 +75,10 @@ export default defineComponent({
75
75
  color: '#FAB31C',
76
76
  },
77
77
  },
78
+ innerClass: {
79
+ type: String,
80
+ default: '',
81
+ },
78
82
  },
79
83
  emits: ['update:modelValue', 'yes', 'no'],
80
84
  });
@@ -16,7 +16,10 @@
16
16
  </div>
17
17
  <div
18
18
  class="ml-5 mt-6 grid auto-rows-fr items-center"
19
- :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2 mb-6' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 ']"
19
+ :class="[
20
+ isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2 mb-6' : 'grid-cols-4 md:gap-5 md:grid-cols-4',
21
+ !isShort && (isVisible ? 'lg:grid-cols-8' : 'lg:grid-cols-7'),
22
+ ]"
20
23
  >
21
24
  <span :class="[$styles.textSimple]" class="font-medium">{{ $appContextStore.t('form.fullName') }}</span>
22
25
  <span :class="[$styles.textSimple]" class="font-medium">{{ $appContextStore.t('form.iin') }}</span>
@@ -24,13 +27,17 @@
24
27
  <span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium"> {{ $appContextStore.t('form.birthDate') }} </span>
25
28
  <span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $appContextStore.t('form.Country') }} </span>
26
29
  <span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium hidden lg:block"> {{ $appContextStore.t('code') }}</span>
30
+ <span v-if="!isShort && isVisible" :class="[$styles.textSimple]" class="font-medium hidden lg:block">ManId</span>
27
31
  </div>
28
32
  <div v-if="isMultiple && multipleMember !== null" class="ml-5 flex flex-col" :class="[isShort ? 'mb-6' : '']">
29
33
  <div
30
34
  v-for="(each, index) of multipleMember"
31
35
  :key="index"
32
36
  class="grid auto-rows-fr items-center relative"
33
- :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
37
+ :class="[
38
+ isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4',
39
+ !isShort && (isVisible ? 'lg:grid-cols-8' : 'lg:grid-cols-7'),
40
+ ]"
34
41
  >
35
42
  <span :class="[getMemberInfo(each).fullName === null && $styles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
36
43
  <span :class="[getMemberInfo(each).iin === null && $styles.emptyBlockCol]">{{ getMemberIIN(each) }}</span>
@@ -38,6 +45,7 @@
38
45
  <span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $styles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
39
46
  <span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
40
47
  <span v-if="!isShort" :class="[getMemberInfo(each).sectorCode === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
48
+ <span v-if="!isShort && isVisible" :class="[getMemberInfo(each).id === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).id }} </span>
41
49
  <div
42
50
  v-if="!isShort"
43
51
  class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
@@ -51,7 +59,10 @@
51
59
  <div
52
60
  v-if="singleMember !== null"
53
61
  class="ml-5 grid auto-rows-fr items-center relative"
54
- :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
62
+ :class="[
63
+ isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4',
64
+ !isShort && (isVisible ? 'lg:grid-cols-8' : 'lg:grid-cols-7'),
65
+ ]"
55
66
  >
56
67
  <span :class="[getMemberInfo(singleMember).fullName === null && $styles.emptyBlockCol]">{{ getMemberInfo(singleMember).fullName }}</span>
57
68
  <span :class="[getMemberInfo(singleMember).iin === null && $styles.emptyBlockCol]">{{ getMemberInfo(singleMember).iin }}</span>
@@ -63,6 +74,9 @@
63
74
  <span v-if="!isShort" :class="[getMemberInfo(singleMember).sectorCode === null && $styles.emptyBlockCol]" class="hidden lg:block">
64
75
  {{ getMemberInfo(singleMember).sectorCode }}
65
76
  </span>
77
+ <span v-if="!isShort && isVisible" :class="[getMemberInfo(singleMember).id === null && $styles.emptyBlockCol]" class="hidden lg:block">
78
+ {{ getMemberInfo(singleMember).id }}
79
+ </span>
66
80
  <div
67
81
  v-if="!isShort"
68
82
  class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
@@ -129,6 +143,7 @@ export default defineComponent({
129
143
 
130
144
  const isShort = computed(() => props.type === 'short');
131
145
  const isActionsAvailable = computed(() => memberStore.isStatementEditible(props.whichForm));
146
+ const isVisible = computed(() => dataStore.isSupport() || dataStore.isAdmin());
132
147
  const getMemberIIN = (each: Member) => {
133
148
  const iin = getMemberInfo(each).iin;
134
149
  if (dataStore.isFinCenter() && iin) {
@@ -145,6 +160,7 @@ export default defineComponent({
145
160
  birthDate: computed(() => (memberData && memberData.birthDate ? memberData.birthDate : null)).value,
146
161
  birthPlace: computed(() => (memberData && memberData.birthPlace.nameRu ? (memberData.birthPlace.nameRu as string).substring(0, 3) : null)).value,
147
162
  sectorCode: computed(() => (memberData && memberData.economySectorCode.ids ? (memberData.economySectorCode.ids as string).slice(-1) : null)).value,
163
+ id: computed(() => (memberData && memberData.id ? memberData.id : null)).value,
148
164
  };
149
165
  };
150
166
 
@@ -158,6 +174,7 @@ export default defineComponent({
158
174
 
159
175
  // Computed
160
176
  isShort,
177
+ isVisible,
161
178
  isActionsAvailable,
162
179
 
163
180
  // Functions
@@ -30,7 +30,11 @@
30
30
  <v-col v-if="row.every((i: any) => !i)" :class="[$styles.textSimple, $styles.blueText]">{{
31
31
  block.noValueText ?? $appContextStore.t('clients.necessaryFillForm')
32
32
  }}</v-col>
33
- <v-col v-else v-for="each of row.filter((_: any, i: number) => ($display().lgAndUp.value ? true : block.labels[i].hideOnMobile === false))" :key="each">
33
+ <v-col
34
+ v-else
35
+ v-for="each of row.filter((_: any, i: number) => ($display().lgAndUp.value ? true : block.labels[i].hideOnMobile === false) && block.labels[i].visible)"
36
+ :key="each"
37
+ >
34
38
  <p :class="[$styles.textSimple]">
35
39
  {{ each }}
36
40
  </p>
@@ -78,7 +82,7 @@ export default defineComponent({
78
82
  },
79
83
  setup(props) {
80
84
  const display = useDisplayInfo();
81
- const visibleLabels = computed(() => (display.lgAndUp.value ? props.block.labels : props.block.labels.filter(i => i.hideOnMobile === false)));
85
+ const visibleLabels = computed(() => (display.lgAndUp.value ? props.block.labels : props.block.labels.filter(i => i.hideOnMobile === false)).filter(j => j.visible));
82
86
 
83
87
  const hasBlockData = (data: ComputedRefWithControl<any> | string[][]) => {
84
88
  if (data) {
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <v-text-field
3
3
  class="form-input"
4
+ :class="{ 'show-hint': !!hint && isFocused }"
4
5
  :model-value="modelValue"
5
6
  v-maska="maska"
6
7
  :rules="rules"
@@ -21,6 +22,7 @@
21
22
  :prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
22
23
  :bg-color="bgColor ? bgColor : ''"
23
24
  :suffix="suffix"
25
+ :prefix="prefix"
24
26
  @input="$emit('input', $event)"
25
27
  @keyup.enter.prevent="submitted"
26
28
  @click:append="!props.readonly && $emit('append-out')"
@@ -28,6 +30,8 @@
28
30
  @click:prepend-inner="!props.readonly && $emit('prepend')"
29
31
  @click:clear="!props.readonly && $emit('on-clear')"
30
32
  @update:modelValue="$emit('update:modelValue', $event)"
33
+ @focus="isFocused = true"
34
+ @blur="isFocused = false"
31
35
  >
32
36
  <template v-if="appendInnerIcon && appendInnerIcon.length" v-slot:append-inner>
33
37
  <v-icon
@@ -88,11 +92,15 @@ export default defineComponent({
88
92
  type: String,
89
93
  default: '',
90
94
  },
95
+ prefix: {
96
+ type: String,
97
+ default: '',
98
+ },
91
99
  messages: {
92
100
  type: [String, Array<string>],
93
101
  },
94
102
  maska: {
95
- type: String,
103
+ type: [String, Object],
96
104
  default: '',
97
105
  },
98
106
  hint: {
@@ -152,9 +160,11 @@ export default defineComponent({
152
160
  const submitted = (event: any) => {
153
161
  emit('submitted', event);
154
162
  };
163
+ const isFocused = ref(false);
155
164
  return {
156
165
  props,
157
166
  submitted,
167
+ isFocused,
158
168
  };
159
169
  },
160
170
  });
@@ -189,7 +199,8 @@ export default defineComponent({
189
199
  .form-input.v-input--error {
190
200
  border-color: #ff5449;
191
201
  }
192
- .form-input.v-input--error .v-input__details {
202
+ .form-input.v-input--error .v-input__details,
203
+ .form-input.show-hint .v-input__details {
193
204
  display: block;
194
205
  }
195
206
  .form-input .v-input__details {
@@ -204,4 +215,11 @@ export default defineComponent({
204
215
  padding-top: 30px;
205
216
  font-size: 16px !important;
206
217
  }
218
+ .v-text-field--prefixed.v-text-field .v-field__input {
219
+ padding-left: 0.5px;
220
+ }
221
+ .v-text-field__prefix__text {
222
+ color: #000000 !important;
223
+ font-size: 16px !important;
224
+ }
207
225
  </style>
@@ -141,3 +141,17 @@ export default defineComponent({
141
141
  },
142
142
  });
143
143
  </script>
144
+
145
+ <style>
146
+ .form-input .v-field.v-field--appended {
147
+ padding-right: 0px !important;
148
+ }
149
+ @media (max-width: 640px) {
150
+ .form-input .v-field__input {
151
+ padding-right: 10px;
152
+ }
153
+ .form-input .v-field-label {
154
+ max-width: 95% !important;
155
+ }
156
+ }
157
+ </style>
@@ -5,10 +5,15 @@
5
5
  Шрифт
6
6
  <v-btn size="x-small" icon="mdi-plus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('increase')" />
7
7
  </base-panel-item>
8
+ <base-panel-item>
9
+ <v-btn size="small" :color="locale.currentLocale.value === 'ru' ? '#A0B3D8' : '#E0E0E0'" class="text-white" variant="flat" @click="handleLocaleChange('ru')"> РУС </v-btn>
10
+ Язык / Тіл
11
+ <v-btn size="small" :color="locale.currentLocale.value === 'kz' ? '#A0B3D8' : '#E0E0E0'" class="text-white" variant="flat" @click="handleLocaleChange('kz')"> ҚАЗ </v-btn>
12
+ </base-panel-item>
8
13
  <base-panel-item>
9
14
  <v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')" />
10
- <i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"></i
11
- ></base-panel-item>
15
+ <i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"> </i>
16
+ </base-panel-item>
12
17
  <base-panel-item
13
18
  v-if="authStore.accessToken && (($appContextStore.isEFO && $dataStore.hasAccess().toLKA) || ($appContextStore.isAULETTI && $dataStore.hasAccess().toLKA_A))"
14
19
  @click="changeBridge('lka', authStore.accessToken)"
@@ -65,8 +70,8 @@
65
70
 
66
71
  <script lang="ts" setup>
67
72
  import { changeBridge } from '#imports';
68
-
69
73
  import packageJson from '../../package.json';
74
+
70
75
  const dialogSignOut = ref(false);
71
76
  const dataStore = useDataStore();
72
77
  const authStore = useAuthStore();
@@ -74,6 +79,7 @@ const appContextStore = useAppContextStore();
74
79
  const router = useRouter();
75
80
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION ?? '');
76
81
  const pkg = packageJson as { version: string };
82
+ const locale = useLocale();
77
83
 
78
84
  const handleFontSize = (action: 'increase' | 'decrease') => {
79
85
  if (action === 'increase' && dataStore.fontSize < 24) dataStore.fontSize += 2;
@@ -85,6 +91,17 @@ const handleFontSize = (action: 'increase' | 'decrease') => {
85
91
  }
86
92
  };
87
93
 
94
+ const handleLocaleChange = (newLocale: 'ru' | 'kz') => {
95
+ if (locale.currentLocale.value !== newLocale) {
96
+ locale.setLocale(newLocale);
97
+ if (appContextStore.isBridge) {
98
+ window.location.reload();
99
+ } else {
100
+ dataStore.sendToParent(constants.postActions.locale, newLocale);
101
+ }
102
+ }
103
+ };
104
+
88
105
  const logoutUser = async () => {
89
106
  dialogSignOut.value = false;
90
107
  await authStore.logoutUser();
@@ -48,8 +48,11 @@
48
48
  <base-form-section
49
49
  v-if="$dataStore.hasPersonalDataSection(whichForm)"
50
50
  :title="$appContextStore.t('form.personalData')"
51
- :class="[memberSetting && memberSetting.has === true && memberSetting.isMultiple === true ? 'rounded-t-0 !mt-[-5px]' : 'mt-[14px]']"
51
+ :class="[memberSetting && memberSetting.has === true && memberSetting.isMultiple === true ? 'rounded-t-0 !mt-[-5px]' : 'mt-[14px]', 'position-relative']"
52
52
  >
53
+ <p :class="[$styles.textSimple]" class="mb-[2px] md:absolute md:top-[18px]" v-if="!!member.id && ($dataStore.isSupport() || $dataStore.isAdmin())">
54
+ <span :class="[$styles.greyText]">ManId:</span> {{ member.id }}
55
+ </p>
53
56
  <base-panel-input
54
57
  v-if="$appContextStore.isLifetrip || $appContextStore.isPension"
55
58
  v-model="member.signOfResidency"
@@ -2298,10 +2301,15 @@ export default {
2298
2301
  if (digitalDocumentOwnerType.value === 'child' && selectedChild.value && responseData) {
2299
2302
  const { firstName, lastName, birthDate } = selectedChild.value;
2300
2303
 
2304
+ const norm = (s?: string) => s?.trim().toLowerCase() ?? '';
2305
+ const normalizeDate = (d?: string) => d?.slice(0, 10) ?? '';
2306
+
2307
+ const firstNameMatch = norm(firstName) === norm(responseData.firstName);
2308
+ const lastNameMatch = norm(lastName) === norm(responseData.lastName);
2301
2309
  const birthDateMatch =
2302
- birthDate && responseData.birthDate ? new Date(birthDate).toISOString().split('T')[0] === new Date(responseData.birthDate).toISOString().split('T')[0] : true;
2310
+ normalizeDate(birthDate) !== '' && normalizeDate(responseData.birthDate) !== '' && normalizeDate(birthDate) === normalizeDate(responseData.birthDate);
2303
2311
 
2304
- if (firstName !== responseData.firstName || lastName !== responseData.lastName || !birthDateMatch) {
2312
+ if (!firstNameMatch || !lastNameMatch || !birthDateMatch) {
2305
2313
  showToaster('error', `Выбранный ребёнок (${lastName} ${firstName}) и полученные данные (${responseData.lastName} ${responseData.firstName}) не совпадают.`);
2306
2314
  return;
2307
2315
  }
@@ -2314,6 +2322,8 @@ export default {
2314
2322
  }
2315
2323
  }
2316
2324
 
2325
+ if (responseData.iin) member.value.iin = reformatIin(responseData.iin);
2326
+
2317
2327
  await memberStore.getContragent(member.value, false, false);
2318
2328
 
2319
2329
  if (responseData.firstName && responseData.lastName) {
@@ -526,11 +526,20 @@
526
526
  >до {{ transferMaxDate }} включительно</span
527
527
  >
528
528
  </div>
529
- <base-form-input v-model="contract.transferContractNumber" :label="$appContextStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
529
+ <base-form-input
530
+ v-model="contract.transferContractNumber"
531
+ :label="$appContextStore.t('pension.globalId')"
532
+ :readonly="isDisabled"
533
+ :clearable="!isDisabled"
534
+ :rules="[$dataStore.rules.globalId(contract)]"
535
+ :hint="$appContextStore.t('pension.globalIdHint')"
536
+ :prefix="globalIdPrefix(contract)"
537
+ :maska="globalIdMaska(contract)"
538
+ />
530
539
  <base-form-input
531
540
  v-model="contract.transferContractRegNumber"
532
541
  :label="$appContextStore.t('pension.transferRegNumber')"
533
- :rules="$rules.required"
542
+ :rules="!contract.transferContractNumber ? $rules.required : []"
534
543
  :readonly="isDisabled"
535
544
  :clearable="!isDisabled"
536
545
  />
@@ -852,7 +861,7 @@
852
861
  v-model="additionalTerms[index]"
853
862
  :value="locale === 'ru' ? term.coverSumName : term.coverSumNameKz"
854
863
  :readonly="isTermsDisabled"
855
- :clearable="!isTermsDisabled"
864
+ :clearable="false"
856
865
  :label="coverTypeName(term)"
857
866
  append-inner-icon="mdi mdi-chevron-right"
858
867
  :suffix="
@@ -1068,7 +1077,7 @@
1068
1077
  </template>
1069
1078
 
1070
1079
  <script lang="ts">
1071
- import { Member, Value, CountryValue, CalculatorForm, TransferContract, DocumentItem } from '../../composables/classes';
1080
+ import { Member, Value, CountryValue, CalculatorForm, TransferContract, DocumentItem, TransferContractCompany } from '../../composables/classes';
1072
1081
  import type { Projects, AddCover, AddCoverAnswer, FileActions } from '../../types';
1073
1082
  import { useI18n } from 'vue-i18n';
1074
1083
  import { getNumber, parseAmount } from '../../composables';
@@ -1650,7 +1659,7 @@ export default defineComponent({
1650
1659
  const totalInsPremium = computed(() => getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)));
1651
1660
 
1652
1661
  const isCompulsoryProfContractAmount = computed(() => {
1653
- return Number(cleanWhiteSpace(pensionForm.value.compulsoryProfContractAmount)) > 0;
1662
+ return formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) > 0;
1654
1663
  });
1655
1664
 
1656
1665
  const transferContractsHasOppv = computed(() => {
@@ -1706,7 +1715,7 @@ export default defineComponent({
1706
1715
  }
1707
1716
  };
1708
1717
 
1709
- const pickPanelValue = async (item: Value) => {
1718
+ const pickPanelValue = async (item: Value | TransferContractCompany) => {
1710
1719
  dataStore.rightPanel.open = false;
1711
1720
  isPanelOpen.value = false;
1712
1721
  isMultiplePanelOpen.value = false;
@@ -1719,7 +1728,7 @@ export default defineComponent({
1719
1728
  calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1720
1729
  } else if (whichProduct.value === 'pensionannuitynew') {
1721
1730
  if (currentPanel.value === 'transferContractCompany') {
1722
- transferContracts.value[contractIndex.value].transferContractCompany = item;
1731
+ transferContracts.value[contractIndex.value].transferContractCompany = item as TransferContractCompany;
1723
1732
  } else {
1724
1733
  // @ts-ignore
1725
1734
  pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
@@ -1733,15 +1742,7 @@ export default defineComponent({
1733
1742
  if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
1734
1743
  }
1735
1744
  if (whichProduct.value === 'bolashak') {
1736
- const termCover = additionalTerms.value?.findIndex(i => i.coverTypeCode === 10);
1737
- if (termCover !== -1) {
1738
- const termList = await formStore.getAdditionalInsuranceTermsAnswers(additionalTerms.value[termCover].coverTypeId);
1739
- const defaultTermValue = termList?.find(i => i.isDefault === true);
1740
- if (defaultTermValue) {
1741
- additionalTerms.value[termCover].coverSumId = String(defaultTermValue.id);
1742
- additionalTerms.value[termCover].coverSumName = String(defaultTermValue.nameRu);
1743
- }
1744
- }
1745
+ await setDefaultForPolicyholderDeathTerm();
1745
1746
  }
1746
1747
  }
1747
1748
  }
@@ -1792,13 +1793,25 @@ export default defineComponent({
1792
1793
 
1793
1794
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1794
1795
  if (termValue.value && item.code === 'fixedinssum') {
1795
- if (termValue.value.coverTypeCode === 11 || termValue.value.coverTypeCode === 4) {
1796
- subPanelList.value = constants.fixInsAmount.slice(0, 5);
1797
- } else if (termValue.value.coverTypeCode !== 19) {
1798
- subPanelList.value = constants.fixInsAmount.slice(0, 10);
1796
+ const amounts = constants.fixInsAmount as Record<string, any>;
1797
+ const code = termValue.value.coverTypeCode;
1798
+ let baseList = [];
1799
+
1800
+ //11 и 20 - Госпитализация Застрахованного в результате несчастного случая
1801
+ //4 - Получение Застрахованным телесной травмы в результате несчастного случая
1802
+ //19 - CI- авансовая выплата в части основной выплаты
1803
+ if (code === 4) {
1804
+ baseList = [500000, 1000000, 1500000, 2000000, 2500000].map(k => amounts[k]);
1805
+ } else if ((code === 20 || code === 11) && whichProduct.value === 'gns') {
1806
+ baseList = [300000, 500000, 1000000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000, 4500000, 5000000].map(k => amounts[k]);
1807
+ } else if (code === 19) {
1808
+ baseList = Object.values(amounts).filter(a => a.code !== '300000');
1799
1809
  } else {
1800
- subPanelList.value = constants.fixInsAmount;
1810
+ baseList = [500000, 1000000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000, 4500000, 5000000].map(k => amounts[k]);
1801
1811
  }
1812
+
1813
+ subPanelList.value = baseList;
1814
+
1802
1815
  subTermValue.value = String(termValue.value.amount);
1803
1816
  } else {
1804
1817
  additionalTerms.value[currentIndex.value].amount = 0;
@@ -2151,12 +2164,17 @@ export default defineComponent({
2151
2164
  : formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
2152
2165
  // @ts-ignore
2153
2166
  transferContractCompany:
2154
- typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? i.transferContractCompany.nameRu : i.transferContractCompany,
2167
+ i.transferContractCompany && typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany
2168
+ ? i.transferContractCompany.nameRu
2169
+ : i.transferContractCompany,
2155
2170
  transferContractCompanyId:
2156
- // @ts-ignore
2157
- typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
2171
+ i.transferContractCompany && typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany
2172
+ ? i.transferContractCompany.ids
2173
+ // @ts-ignore
2174
+ : i.transferContractCompanyId,
2158
2175
  id: i.id ?? null,
2159
2176
  transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
2177
+ transferContractNumber: getFullGlobalId(i),
2160
2178
  });
2161
2179
  });
2162
2180
  }
@@ -2189,6 +2207,11 @@ export default defineComponent({
2189
2207
  return needFile;
2190
2208
  };
2191
2209
 
2210
+ const syncNullableNumberPair = (source: unknown, target: unknown) => {
2211
+ if (source === null || source === undefined || source === '') return null;
2212
+ return Number(target ?? 0);
2213
+ };
2214
+
2192
2215
  const submitForm = async () => {
2193
2216
  if (whichProduct.value === 'pensionannuitynew') {
2194
2217
  const needsEnpfNoteFile = doesNeedEnpfNoteFile();
@@ -2243,7 +2266,7 @@ export default defineComponent({
2243
2266
  }
2244
2267
  });
2245
2268
  }
2246
- if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = 0;
2269
+ // if (!isCompulsoryProfContractAmount.value && !transferContractsHasOppv.value) pensionForm.value.compulsoryProfMonthCount = null;
2247
2270
  const pensionData = {
2248
2271
  ...pensionForm.value,
2249
2272
  ...{
@@ -2251,6 +2274,7 @@ export default defineComponent({
2251
2274
  voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
2252
2275
  ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
2253
2276
  compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
2277
+ compulsoryProfMonthCount: syncNullableNumberPair(formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount), pensionForm.value.compulsoryProfMonthCount),
2254
2278
  transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
2255
2279
  transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2256
2280
  },
@@ -2267,6 +2291,7 @@ export default defineComponent({
2267
2291
  voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
2268
2292
  ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
2269
2293
  compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
2294
+ compulsoryProfMonthCount: syncNullableNumberPair(formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount), formStore.pensionApp?.compulsoryProfMonthCount),
2270
2295
  transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
2271
2296
  transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2272
2297
  }
@@ -2282,6 +2307,7 @@ export default defineComponent({
2282
2307
  voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
2283
2308
  ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
2284
2309
  compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
2310
+ compulsoryProfMonthCount: syncNullableNumberPair(formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount), formStore.pensionApp?.slave?.compulsoryProfMonthCount),
2285
2311
  transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
2286
2312
  transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2287
2313
  }
@@ -2409,6 +2435,9 @@ export default defineComponent({
2409
2435
  additionalTerms.value = formStore.additionalInsuranceTerms;
2410
2436
  }
2411
2437
  }
2438
+ if (whichProduct.value === 'bolashak') {
2439
+ await trySetDefaultPolicyholderDeathTerm();
2440
+ }
2412
2441
  isCalculating.value = true;
2413
2442
  if (props.isCalculator) {
2414
2443
  //@ts-ignore
@@ -2545,6 +2574,64 @@ export default defineComponent({
2545
2574
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId, formStore.applicationData.slave?.processInstanceId);
2546
2575
  }
2547
2576
  };
2577
+ const globalIdMaska = (contract: TransferContract) => {
2578
+ const asbId = String(contract.transferContractCompany?.asbId ?? '');
2579
+ const remainingDigitsCount = Math.max(constants.globalIdFirstDigitsCount - asbId.length, 0);
2580
+
2581
+ const maskaDigits = '#'.repeat(remainingDigitsCount);
2582
+
2583
+ return {
2584
+ mask: `${maskaDigits}XX######A`,
2585
+ tokens: {
2586
+ X: { pattern: /[A-Z0-9]/ },
2587
+ },
2588
+ };
2589
+ };
2590
+ const globalIdPrefix = (contract: TransferContract) => {
2591
+ const asbId = contract.transferContractCompany?.asbId;
2592
+
2593
+ if (asbId !== undefined && asbId !== null) {
2594
+ return String(asbId);
2595
+ }
2596
+ return '';
2597
+ };
2598
+ const getFullGlobalId = (contract: any) => {
2599
+ if (contract.transferContractNumber) {
2600
+ const asbId = String(contract.transferContractCompany?.asbId ?? '');
2601
+ return asbId + contract.transferContractNumber;
2602
+ }
2603
+ return null;
2604
+ };
2605
+ const findTransferContractCompany = (companyId: string | number | null) => {
2606
+ return dictionariesStore.transferContractCompanies.find(i => i.ids === companyId) ?? null;
2607
+ };
2608
+ const normalizeTransferContractNumber = (number: string | null, company: TransferContractCompany | null) => {
2609
+ if (!number) return null;
2610
+
2611
+ const asbId = String(company?.asbId ?? '');
2612
+
2613
+ return asbId && number.startsWith(asbId) ? number.slice(asbId.length) : number;
2614
+ };
2615
+ const trySetDefaultPolicyholderDeathTerm = async () => {
2616
+ const isSinglePeriod = productConditionsForm.paymentPeriod?.code === 'single';
2617
+ const policyholderIsInsured = formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin);
2618
+
2619
+ if (policyholderIsInsured && isSinglePeriod) {
2620
+ await setDefaultForPolicyholderDeathTerm();
2621
+ }
2622
+ };
2623
+ const setDefaultForPolicyholderDeathTerm = async () => {
2624
+ //coverTypeCode === 10 - Страхование на случай смерти Страхователя
2625
+ const termCover = additionalTerms.value?.findIndex(i => i.coverTypeCode === 10);
2626
+ if (termCover !== -1) {
2627
+ const termList = await formStore.getAdditionalInsuranceTermsAnswers(additionalTerms.value[termCover].coverTypeId);
2628
+ const defaultTermValue = termList?.find(i => i.isDefault === true);
2629
+ if (defaultTermValue) {
2630
+ additionalTerms.value[termCover].coverSumId = String(defaultTermValue.id);
2631
+ additionalTerms.value[termCover].coverSumName = String(defaultTermValue.nameRu);
2632
+ }
2633
+ }
2634
+ };
2548
2635
 
2549
2636
  onMounted(async () => {
2550
2637
  try {
@@ -2594,7 +2681,7 @@ export default defineComponent({
2594
2681
  if (!!productConditionsForm.insurancePremiumPerMonth) {
2595
2682
  whichSum.value = 'insurancePremiumPerMonth';
2596
2683
  }
2597
- if (whichProduct.value === 'lifebusiness') {
2684
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
2598
2685
  whichSum.value = 'requestedSumInsured';
2599
2686
  }
2600
2687
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
@@ -2645,14 +2732,17 @@ export default defineComponent({
2645
2732
  }
2646
2733
  if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
2647
2734
  pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
2735
+ const transferContractCompany =
2736
+ typeof contract.transferContractCompany === 'string' ? findTransferContractCompany(contract.transferContractCompanyId) : contract.transferContractCompany;
2737
+
2648
2738
  transferContracts.value.push({
2649
2739
  ...contract,
2650
2740
  transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
2651
2741
  transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
2652
2742
  ? reformatDate(contract.transferContractFirstPaymentDate)!
2653
2743
  : contract.transferContractFirstPaymentDate,
2654
- transferContractCompany:
2655
- typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
2744
+ transferContractCompany: transferContractCompany,
2745
+ transferContractNumber: normalizeTransferContractNumber(contract.transferContractNumber, transferContractCompany),
2656
2746
  transferContractAmount: getNumberWithSpaces(contract.transferContractAmount) ?? '',
2657
2747
  });
2658
2748
  });
@@ -3042,6 +3132,8 @@ export default defineComponent({
3042
3132
  openFileActionsPanel,
3043
3133
  removeTransferContract,
3044
3134
  checkTransferContractDate,
3135
+ globalIdMaska,
3136
+ globalIdPrefix,
3045
3137
  };
3046
3138
  },
3047
3139
  });