hl-core 0.0.10-beta.69 → 0.0.10-beta.70

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
@@ -541,6 +541,7 @@ export class ApiClass {
541
541
  return await this.axiosCall<Types.EpayResponse>({
542
542
  method: Methods.GET,
543
543
  url: `/Arm/api/Invoice/InvoiceData?processInstanceId=${processInstanceId}`,
544
+ params: { silent: true },
544
545
  });
545
546
  }
546
547
 
@@ -1236,8 +1237,8 @@ export class ApiClass {
1236
1237
  data: data,
1237
1238
  });
1238
1239
  },
1239
- getOnlineChildAccess: async (data: { iinBin: string; documentType?: string, methodName?: string, childId?: string }) => {
1240
- return await this.axiosCall<{ code: string; message: string, children: any[] }>({
1240
+ getOnlineChildAccess: async (data: { iinBin: string; documentType?: string; methodName?: string; childId?: string }) => {
1241
+ return await this.axiosCall<{ code: string; message: string; children: any[] }>({
1241
1242
  method: Methods.POST,
1242
1243
  url: `${this.externalServices.base}/api/ExternalServices/GetOnlineChildAccess`,
1243
1244
  data: data,
@@ -134,6 +134,7 @@ export default function setupInterceptors(axios: AxiosInstance): void {
134
134
 
135
135
  const status = response.status;
136
136
  const data = response.data;
137
+ const isSilent = !!response.config.params?.silent;
137
138
 
138
139
  // 3) 401 — простая обработка, показываем ошибку
139
140
  if (status === 401) {
@@ -156,7 +157,7 @@ export default function setupInterceptors(axios: AxiosInstance): void {
156
157
  }
157
158
 
158
159
  // 5) 404
159
- if (status === 404) {
160
+ if (status === 404 && !isSilent) {
160
161
  dataStore.showToaster('error', dataStore.t('error.404'), 5000);
161
162
  return Promise.reject(err);
162
163
  }
@@ -174,10 +175,6 @@ export default function setupInterceptors(axios: AxiosInstance): void {
174
175
  return Promise.reject(err);
175
176
  }
176
177
 
177
- // 8) Прочие коды — показываем полезное сообщение
178
- const errorMessage = extractErrorMessage(data, status, dataStore);
179
- dataStore.showToaster('error', String(errorMessage), 5000);
180
-
181
178
  return Promise.reject(err);
182
179
  },
183
180
  );
@@ -29,7 +29,7 @@
29
29
  />
30
30
  </section>
31
31
  <section
32
- v-if="surveyType === 'critical' && ($dataStore.isBaiterek || $dataStore.isBolashak || $dataStore.isLiferenta)"
32
+ v-if="surveyType === 'critical' && ($dataStore.isBaiterek || $dataStore.isMycar || $dataStore.isBolashak || $dataStore.isLiferenta)"
33
33
  :class="[$styles.blueBgLight, $styles.rounded]"
34
34
  class="mx-[10px] p-4 flex flex-col gap-4"
35
35
  >
@@ -126,7 +126,6 @@
126
126
 
127
127
  <script lang="ts">
128
128
  import type { InputTypes } from '../../types';
129
- import { handleSuccessfulLogin } from '../../utils/auth-helpers';
130
129
 
131
130
  export default defineComponent({
132
131
  setup() {
@@ -183,7 +182,18 @@ export default defineComponent({
183
182
  await dataStore.loginUser(login.value, password.value, numAttempts.value);
184
183
  numAttempts.value++;
185
184
  authLoading.value = false;
186
- await handleSuccessfulLogin(router);
185
+ try {
186
+ const redirectUrl = redirectUtils.getAndClearRedirectUrl();
187
+
188
+ if (redirectUrl) {
189
+ await router.push(redirectUrl);
190
+ } else {
191
+ await router.push({ name: 'index' });
192
+ }
193
+ } catch (error) {
194
+ console.error('Redirect error:', error);
195
+ await router.push({ name: 'index' });
196
+ }
187
197
  }
188
198
  }
189
199
  });
@@ -390,14 +390,14 @@ export default defineComponent({
390
390
  });
391
391
  const isUnderwriterDocuments = computed(
392
392
  () =>
393
- (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) &&
393
+ (dataStore.isBaiterek || dataStore.isMycar || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) &&
394
394
  dataStore.isInitiator() &&
395
395
  formStore.applicationData &&
396
396
  (formStore.applicationData.statusCode === 'StartForm' || formStore.applicationData.statusCode === 'EditForm'),
397
397
  );
398
398
  const canDeleteFiles = computed(() => {
399
399
  const baseCondition = dataStore.isTask() && dataStore.isInitiator() && dataStore.isProcessEditable(formStore.applicationData.statusCode);
400
- if (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) {
400
+ if (dataStore.isBaiterek || dataStore.isMycar || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) {
401
401
  return baseCondition && (currentDocument.value ? deleteFilesId.includes(String(currentDocument.value.fileTypeCode)) : false);
402
402
  }
403
403
  if (dataStore.isPension) {
@@ -44,6 +44,7 @@
44
44
  </base-fade-transition>
45
45
  </base-form-section>
46
46
  <base-form-section
47
+ v-if="$dataStore.hasPersonalDataSection(whichForm)"
47
48
  :title="$dataStore.t('form.personalData')"
48
49
  :class="[memberSetting && memberSetting.has === true && memberSetting.isMultiple === true ? 'rounded-t-0 !mt-[-5px]' : 'mt-[14px]']"
49
50
  >
@@ -105,7 +106,7 @@
105
106
  :maska="$maska.iin"
106
107
  :readonly="!!isDisabled || !!isIinPhoneDisabled || !!member.parsedDocument?.iin"
107
108
  :clearable="!isDisabled && !isIinPhoneDisabled && !member.parsedDocument?.iin"
108
- :append-inner-icon="hasMemberSearch || !isNonResident ? (hasDocumentReader ? 'mdi mdi-credit-card-scan-outline' : 'mdi mdi-magnify') : ''"
109
+ :append-inner-icon="hasMemberSearch || !isNonResident ? 'mdi mdi-magnify' : ''"
109
110
  @append="searchMember"
110
111
  @input="onIinInput"
111
112
  :rules="isNonResident ? [] : $rules.required.concat($rules.iinRight)"
@@ -379,7 +380,7 @@
379
380
  />
380
381
  <base-form-input v-model.trim="member.jobPlace" :label="$dataStore.t('form.jobPlace')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required" />
381
382
  </base-form-section>
382
- <base-form-section :title="$dataStore.t('form.placeRegistration')">
383
+ <base-form-section v-if="$dataStore.hasPlaceRegistrationSection(whichForm)" :title="$dataStore.t('form.placeRegistration')">
383
384
  <base-form-toggle v-if="hasSameAddressToggle" v-model="sameAddress" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('form.sameAddress')" />
384
385
  <base-panel-input
385
386
  v-model="member.registrationCountry"
@@ -397,9 +398,9 @@
397
398
  v-model="member.registrationProvince"
398
399
  :value="member.registrationProvince?.nameRu"
399
400
  :label="$dataStore.t('form.Province')"
400
- :readonly="isDisabled"
401
- :clearable="!isDisabled"
402
- :rules="$rules.objectRequired"
401
+ :readonly="isDisabled || isRegionDisabled"
402
+ :clearable="!isDisabled && !isRegionDisabled"
403
+ :rules="isRegionDisabled ? [] : $rules.objectRequired"
403
404
  append-inner-icon="mdi mdi-chevron-right"
404
405
  @append="openPanel($dataStore.t('form.Province'), [], 'registrationProvince', $dataStore.getStates, 'registrationCountry')"
405
406
  />
@@ -479,7 +480,7 @@
479
480
  @append="openPanel($dataStore.t('form.Region'), [], 'birthRegion', $dataStore.getRegions)"
480
481
  /> -->
481
482
  </base-form-section>
482
- <base-form-section :title="$dataStore.t('form.documentData')">
483
+ <base-form-section v-if="$dataStore.hasDocumentDataSection(whichForm)" :title="$dataStore.t('form.documentData')">
483
484
  <base-panel-input
484
485
  v-if="gbdDocuments && gbdDocuments.length"
485
486
  value="Список документов из ГБДФЛ"
@@ -684,6 +685,24 @@
684
685
  />
685
686
  <base-form-input v-model.trim="member.email" :label="$dataStore.t('form.email')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.email" />
686
687
  </base-form-section>
688
+ <base-form-section
689
+ v-if="$dataStore.isMycar && whichForm === formStore.beneficiaryFormKey"
690
+ :title="$dataStore.t('form.personalData')"
691
+ >
692
+ <base-form-input
693
+ v-model="member.iin"
694
+ :label="$dataStore.t('form.bin')"
695
+ :maska="$maska.iin"
696
+ :readonly="true"
697
+ :clearable="false"
698
+ />
699
+ <base-form-input
700
+ v-model.trim="member.lastName"
701
+ :readonly="true"
702
+ :clearable="false"
703
+ :label="$dataStore.t('aml.legalName')"
704
+ />
705
+ </base-form-section>
687
706
  </v-form>
688
707
  <base-btn v-if="showSaveButton" :loading="isButtonLoading || isSubmittingForm" :text="$dataStore.t('buttons.save')" @click="submitForm" />
689
708
  <Teleport v-if="isPanelOpen" to="#right-panel-actions">
@@ -715,20 +734,6 @@
715
734
  </div>
716
735
  <base-btn v-if="hasGKB" :loading="isButtonLoading" class="before-divider" :text="$dataStore.t('buttons.childData')" @click="getFamilyInfo" />
717
736
  <base-btn v-if="isNonResident" :loading="isButtonLoading" class="before-divider" :text="$dataStore.t('buttons.searchByFio')" @click="getContragent" />
718
- <base-form-section v-if="hasDocumentReader" class="!mt-0 before-divider">
719
- <base-file-input
720
- :disabled="isDisabled"
721
- :clearable="!isDisabled"
722
- accept="image/*,.pdf"
723
- append="mdi-credit-card-scan-outline"
724
- :multiple="true"
725
- @onClear="imageDataList = []"
726
- @input="attachDocumentReader($event)"
727
- />
728
- </base-form-section>
729
- <base-animation>
730
- <base-btn v-if="hasDocumentReader && imageDataList && !!imageDataList.length" :loading="isButtonLoading" text="Получить данные" @click="getDocumentReader" />
731
- </base-animation>
732
737
  </div>
733
738
  </div>
734
739
  </Teleport>
@@ -822,9 +827,11 @@
822
827
  v-for="familyMember of formStore.children"
823
828
  :key="familyMember.id"
824
829
  @click="selectedFamilyMember = familyMember"
825
- :append-icon="familyMember && selectedFamilyMember && typeof selectedFamilyMember === 'object' && selectedFamilyMember.id === familyMember.id
826
- ? `mdi-radiobox-marked ${$styles.greenText}`
827
- : 'mdi-radiobox-blank text-[#636363]'"
830
+ :append-icon="
831
+ familyMember && selectedFamilyMember && typeof selectedFamilyMember === 'object' && selectedFamilyMember.id === familyMember.id
832
+ ? `mdi-radiobox-marked ${$styles.greenText}`
833
+ : 'mdi-radiobox-blank text-[#636363]'
834
+ "
828
835
  >
829
836
  <v-list-item-title :class="[$styles.greenText, $styles.textTitle]">
830
837
  {{ `${familyMember.lastName} ${familyMember.firstName} ${familyMember.middleName ? familyMember.middleName : ''}` }}
@@ -837,14 +844,7 @@
837
844
  </v-list>
838
845
  <base-list-empty v-if="isEmpty" />
839
846
  <div class="flex gap-4">
840
- <base-btn
841
- class="px-6"
842
- size="sm"
843
- :text="$dataStore.t('confirm.cancel')"
844
- :btn="$styles.whiteBorderBtn"
845
- :classes="$styles.blueText"
846
- @click="closeFamilyDialog"
847
- />
847
+ <base-btn class="px-6" size="sm" :text="$dataStore.t('confirm.cancel')" :btn="$styles.whiteBorderBtn" :classes="$styles.blueText" @click="closeFamilyDialog" />
848
848
  <base-btn
849
849
  v-if="isOwnChild || (!isOwnChild && childrenLoaded)"
850
850
  class="px-6"
@@ -1024,19 +1024,15 @@ export default {
1024
1024
  const selectedChild = ref<Api.Child | null>(null);
1025
1025
  const documentItems = computed(() => {
1026
1026
  if (dataStore.isLifetrip) {
1027
- return [
1028
- { title: 'Паспорт', value: 'Passport' },
1029
- ]
1027
+ return [{ title: 'Паспорт', value: 'Passport' }];
1030
1028
  }
1031
1029
  return digitalDocumentOwnerType.value === 'adult'
1032
1030
  ? [
1033
- { title: 'Удостоверение личности', value: 'IdentityCard' },
1034
- { title: 'Паспорт', value: 'Passport' },
1035
- { title: 'Вид на жительство иностранного гражданина', value: 'Vnzh' },
1036
- ]
1037
- : [
1038
- { title: 'Свидетельство о рождении', value: 'BirthCertificate' },
1039
- ]
1031
+ { title: 'Удостоверение личности', value: 'IdentityCard' },
1032
+ { title: 'Паспорт', value: 'Passport' },
1033
+ { title: 'Вид на жительство иностранного гражданина', value: 'Vnzh' },
1034
+ ]
1035
+ : [{ title: 'Свидетельство о рождении', value: 'BirthCertificate' }];
1040
1036
  });
1041
1037
  const digitalDocumentDialog = ref<boolean>(false);
1042
1038
  const parentIin = ref<string>('');
@@ -1049,6 +1045,7 @@ export default {
1049
1045
  if (dataStore.isGons) return member.value.chooseChild === dataStore.t('form.addBeneficiary');
1050
1046
  return true;
1051
1047
  });
1048
+ const isRegionDisabled = computed(() => ['Алматы', 'Астана', 'Шымкент'].includes(member.value.registrationCity?.nameRu as string));
1052
1049
  const getToday = (): Date => {
1053
1050
  return new Date(new Date().setHours(0, 0, 0, 0));
1054
1051
  };
@@ -1143,9 +1140,6 @@ export default {
1143
1140
  };
1144
1141
  return dataStore.controls.hasGKB && !!dataStore.isTask() && perMemberCondition();
1145
1142
  });
1146
- const hasDocumentReader = computed(() => {
1147
- return !!member.value.hasAgreement && !!isTask.value && (dataStore.isAULETTI || dataStore.isAulettiParent);
1148
- });
1149
1143
  const hasDigitalDocument = computed(() => {
1150
1144
  if (whichForm.value === formStore.beneficiaryFormKey && (dataStore.isBolashak || dataStore.isGons)) {
1151
1145
  return false;
@@ -1153,8 +1147,8 @@ export default {
1153
1147
  return false;
1154
1148
  }
1155
1149
  return true;
1156
- })
1157
- const hasMemberSearch = computed(() => showSaveButton.value && (hasGBDFL.value || hasGKB.value || hasInsis.value || hasDocumentReader.value));
1150
+ });
1151
+ const hasMemberSearch = computed(() => showSaveButton.value && (hasGBDFL.value || hasGKB.value || hasInsis.value));
1158
1152
  const hasMiddleName = computed(() => {
1159
1153
  if (dataStore.isLifetrip) {
1160
1154
  return false;
@@ -1165,7 +1159,11 @@ export default {
1165
1159
  if (dataStore.isLifetrip || dataStore.isPension) {
1166
1160
  return false;
1167
1161
  }
1168
- if ((whichForm.value === formStore.beneficiaryFormKey || whichForm.value === formStore.insuredFormKey) && member.value.iin !== formStore.policyholderForm.iin && !hasGKB.value) {
1162
+ if (
1163
+ (whichForm.value === formStore.beneficiaryFormKey || whichForm.value === formStore.insuredFormKey) &&
1164
+ member.value.iin !== formStore.policyholderForm.iin &&
1165
+ !hasGKB.value
1166
+ ) {
1169
1167
  return true;
1170
1168
  }
1171
1169
  return false;
@@ -1175,13 +1173,10 @@ export default {
1175
1173
  return false;
1176
1174
  }
1177
1175
  if (whichForm.value === formStore.beneficiaryFormKey) {
1178
- if (dataStore.isBolashak || dataStore.isGons) {
1176
+ if (dataStore.isBolashak) {
1179
1177
  return false;
1180
1178
  }
1181
1179
  }
1182
- if (member.value.age !== null && Number(member.value.age) < 18) {
1183
- return false;
1184
- }
1185
1180
  return true;
1186
1181
  });
1187
1182
  const hasInsurancePay = computed(() => {
@@ -1215,12 +1210,12 @@ export default {
1215
1210
  const baseDateRule = dataStore.rules.required.concat(dataStore.rules.birthDate);
1216
1211
  const byMemberAndProductRule = () => {
1217
1212
  if (whichForm.value === formStore.policyholderFormKey) {
1218
- if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek) {
1213
+ if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek || dataStore.isMycar) {
1219
1214
  return dataStore.rules.age18ByDate;
1220
1215
  }
1221
1216
  }
1222
1217
  if (whichForm.value === formStore.insuredFormKey) {
1223
- if (dataStore.isBolashak || dataStore.isBaiterek) {
1218
+ if (dataStore.isBolashak || dataStore.isBaiterek || dataStore.isMycar) {
1224
1219
  return dataStore.rules.age18ByDate;
1225
1220
  }
1226
1221
  if (dataStore.isLifetrip) {
@@ -1235,7 +1230,7 @@ export default {
1235
1230
  const baseAgeRule = dataStore.rules.numbers;
1236
1231
  const byMemberAndProductRule = () => {
1237
1232
  if (whichForm.value === formStore.policyholderFormKey) {
1238
- if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek) {
1233
+ if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek || dataStore.isMycar) {
1239
1234
  return dataStore.rules.age18;
1240
1235
  }
1241
1236
  }
@@ -1245,7 +1240,7 @@ export default {
1245
1240
  }
1246
1241
  }
1247
1242
  if (whichForm.value === formStore.insuredFormKey) {
1248
- if (dataStore.isBaiterek || dataStore.isBolashak) {
1243
+ if (dataStore.isBaiterek || dataStore.isMycar || dataStore.isBolashak) {
1249
1244
  return dataStore.rules.age18;
1250
1245
  }
1251
1246
  }
@@ -1276,7 +1271,7 @@ export default {
1276
1271
  const residencyRule = computed(() => {
1277
1272
  const baseResidencyRule = dataStore.rules.objectRequired;
1278
1273
  if (whichForm.value === formStore.policyholderFormKey) {
1279
- if (dataStore.isBolashak || dataStore.isBaiterek) {
1274
+ if (dataStore.isBolashak || dataStore.isBaiterek || dataStore.isMycar) {
1280
1275
  return baseResidencyRule.concat(dataStore.rules.noResident);
1281
1276
  }
1282
1277
  }
@@ -1312,14 +1307,14 @@ export default {
1312
1307
  });
1313
1308
  const isOwnChild = computed(() => {
1314
1309
  //в справочнике relations 9-ребенок, 12-сын, 13-дочь
1315
- const childIds = [9, 12, 13]
1316
- return !!childIds.includes(Number(member.value.relationDegree.ids))
1317
- })
1310
+ const childIds = [9, 12, 13];
1311
+ return !!childIds.includes(Number(member.value.relationDegree.ids));
1312
+ });
1318
1313
  const isEmpty = computed(() => {
1319
- return isOwnChild.value ? formStore.children?.length === 0 : (childrenLoaded.value && formStore.children?.length === 0);
1320
- })
1314
+ return isOwnChild.value ? formStore.children?.length === 0 : childrenLoaded.value && formStore.children?.length === 0;
1315
+ });
1321
1316
 
1322
- const searchMember = async (title: string = hasDocumentReader.value ? 'Получение данных со скана документа' : 'Поиск контрагента') => {
1317
+ const searchMember = async (title: string = 'Поиск контрагента') => {
1323
1318
  if (!isDisabled.value) {
1324
1319
  dataStore.panelAction = null;
1325
1320
  dataStore.rightPanel.title = title;
@@ -1484,7 +1479,7 @@ export default {
1484
1479
  } else {
1485
1480
  // @ts-ignore
1486
1481
  member.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
1487
- if(currentPanel.value === 'documentIssuers' && documentIssuerIsEditable.value) {
1482
+ if (currentPanel.value === 'documentIssuers' && documentIssuerIsEditable.value) {
1488
1483
  const id = Number(item.ids);
1489
1484
  dataStore.saveDocumentIssuer(documentIssuerNotFoundName.value, id);
1490
1485
  }
@@ -1651,13 +1646,13 @@ export default {
1651
1646
  };
1652
1647
 
1653
1648
  const getFamilyInfo = async () => {
1654
- if(isButtonLoading.value) return
1655
- if(!member.value.relationDegree?.nameRu) {
1656
- dataStore.showToaster('error', dataStore.t('toaster.needSelectRelationDegree'))
1657
- return
1649
+ if (isButtonLoading.value) return;
1650
+ if (!member.value.relationDegree?.nameRu) {
1651
+ dataStore.showToaster('error', dataStore.t('toaster.needSelectRelationDegree'));
1652
+ return;
1658
1653
  }
1659
1654
 
1660
- if(isOwnChild.value) {
1655
+ if (isOwnChild.value) {
1661
1656
  if (!formStore.policyholderForm.iin) return;
1662
1657
  if (formStore.children.length === 0) {
1663
1658
  isButtonLoading.value = true;
@@ -1671,7 +1666,7 @@ export default {
1671
1666
  };
1672
1667
 
1673
1668
  const getChildren = async () => {
1674
- dataStore.isButtonsLoading = true
1669
+ dataStore.isButtonsLoading = true;
1675
1670
  try {
1676
1671
  const iinChecked = await dataStore.checkIIN(parentIin.value.replace(/-/g, ''));
1677
1672
  if (!iinChecked) {
@@ -1681,15 +1676,15 @@ export default {
1681
1676
  await dataStore.getChildren(parentIin.value);
1682
1677
  childrenLoaded.value = true;
1683
1678
  } finally {
1684
- dataStore.isButtonsLoading = false
1679
+ dataStore.isButtonsLoading = false;
1685
1680
  }
1686
- }
1681
+ };
1687
1682
 
1688
1683
  const closeFamilyDialog = (resetMember = false) => {
1689
1684
  if (resetMember === true) {
1690
1685
  member.value.resetMember();
1691
1686
  }
1692
- formStore.children = []
1687
+ formStore.children = [];
1693
1688
  childrenLoaded.value = false;
1694
1689
  familyDialog.value = false;
1695
1690
  isButtonLoading.value = false;
@@ -1701,9 +1696,9 @@ export default {
1701
1696
  };
1702
1697
 
1703
1698
  const selectFamilyMember = () => {
1704
- if(Object.keys(selectedFamilyMember.value).length === 0) {
1705
- dataStore.showToaster('error', 'Нужно выбрать ребенка')
1706
- return
1699
+ if (Object.keys(selectedFamilyMember.value).length === 0) {
1700
+ dataStore.showToaster('error', 'Нужно выбрать ребенка');
1701
+ return;
1707
1702
  }
1708
1703
  member.value.chooseChildId = selectedFamilyMember.value.id!;
1709
1704
  selectedChild.value = selectedFamilyMember.value;
@@ -2244,7 +2239,7 @@ export default {
2244
2239
 
2245
2240
  const getCodeForChild = async (documentType: string) => {
2246
2241
  const iin = isOwnChild.value ? formStore.policyholderForm.iin : parentIin.value;
2247
- if(!iin) return
2242
+ if (!iin) return;
2248
2243
 
2249
2244
  documentLoading.value = true;
2250
2245
  try {
@@ -2255,7 +2250,7 @@ export default {
2255
2250
  } finally {
2256
2251
  documentLoading.value = false;
2257
2252
  }
2258
- }
2253
+ };
2259
2254
 
2260
2255
  const getCodeForAdult = async (documentType: string) => {
2261
2256
  documentLoading.value = true;
@@ -2275,9 +2270,9 @@ export default {
2275
2270
  if (digitalDocumentOwnerType.value === 'child') {
2276
2271
  iin = isOwnChild.value ? formStore.policyholderForm.iin! : parentIin.value!;
2277
2272
  } else {
2278
- iin = member.value.iin!
2273
+ iin = member.value.iin!;
2279
2274
  }
2280
- if(!iin) return
2275
+ if (!iin) return;
2281
2276
 
2282
2277
  documentLoading.value = true;
2283
2278
  try {
@@ -2303,12 +2298,11 @@ export default {
2303
2298
  if (digitalDocumentOwnerType.value === 'child' && selectedChild.value && responseData) {
2304
2299
  const { firstName, lastName, birthDate } = selectedChild.value;
2305
2300
 
2306
- const birthDateMatch = birthDate && responseData.birthDate
2307
- ? new Date(birthDate).toISOString().split('T')[0] === new Date(responseData.birthDate).toISOString().split('T')[0]
2308
- : true;
2301
+ const birthDateMatch =
2302
+ birthDate && responseData.birthDate ? new Date(birthDate).toISOString().split('T')[0] === new Date(responseData.birthDate).toISOString().split('T')[0] : true;
2309
2303
 
2310
2304
  if (firstName !== responseData.firstName || lastName !== responseData.lastName || !birthDateMatch) {
2311
- dataStore.showToaster('error', 'Данные выбранного ребёнка не совпадают с полученными данными.');
2305
+ dataStore.showToaster('error', `Выбранный ребёнок (${lastName} ${firstName}) и полученные данные (${responseData.lastName} ${responseData.firstName}) не совпадают.`);
2312
2306
  return;
2313
2307
  }
2314
2308
  }
@@ -2320,6 +2314,8 @@ export default {
2320
2314
  }
2321
2315
  }
2322
2316
 
2317
+ await dataStore.getContragent(member.value, false, false);
2318
+
2323
2319
  if (responseData.firstName && responseData.lastName) {
2324
2320
  member.value.chooseChild = `${responseData.lastName} ${responseData.firstName} ${responseData.middleName ? responseData.middleName : ''}`;
2325
2321
  }
@@ -2348,24 +2344,24 @@ export default {
2348
2344
  }
2349
2345
  }
2350
2346
 
2351
- if(response?.digitalDocuments?.responseCode === 'SUCCESS') {
2347
+ if (response?.digitalDocuments?.responseCode === 'SUCCESS') {
2352
2348
  let fileTypeCode = '';
2353
2349
  switch (response.digitalDocuments.documentType.code) {
2354
- case "IdentityCard":
2355
- fileTypeCode = "1UDL";
2350
+ case 'IdentityCard':
2351
+ fileTypeCode = '1UDL';
2356
2352
  break;
2357
- case "Passport":
2358
- fileTypeCode = "PS";
2353
+ case 'Passport':
2354
+ fileTypeCode = 'PS';
2359
2355
  middleNameIsEditable.value = true;
2360
2356
  break;
2361
- case "BirthCertificate":
2362
- fileTypeCode = "SBI";
2357
+ case 'BirthCertificate':
2358
+ fileTypeCode = 'SBI';
2363
2359
  break;
2364
- case "Vnzh":
2365
- fileTypeCode = "VNZ";
2360
+ case 'Vnzh':
2361
+ fileTypeCode = 'VNZ';
2366
2362
  break;
2367
2363
  default:
2368
- fileTypeCode = "";
2364
+ fileTypeCode = '';
2369
2365
  break;
2370
2366
  }
2371
2367
  member.value.documentType = dataStore.documentTypes.find(item => item.ids === fileTypeCode) || new Value();
@@ -2379,7 +2375,7 @@ export default {
2379
2375
  };
2380
2376
 
2381
2377
  const updateDigitalDocuments = () => {
2382
- dataStore.updateDigitalDocumentsProfile(member.value.iin!)
2378
+ dataStore.updateDigitalDocumentsProfile(member.value.iin!);
2383
2379
  };
2384
2380
 
2385
2381
  const onInit = async () => {
@@ -2495,6 +2491,15 @@ export default {
2495
2491
  },
2496
2492
  );
2497
2493
 
2494
+ watch(
2495
+ () => isRegionDisabled.value,
2496
+ val => {
2497
+ if (val) {
2498
+ member.value.registrationProvince = new Value();
2499
+ }
2500
+ },
2501
+ );
2502
+
2498
2503
  const onIinInput = () => {
2499
2504
  if (!!member.value.iin && member.value.iin.length === useMask().iin.length && memberSetting.value?.isMultiple === true) {
2500
2505
  const alreadyInStatement = formStore[whichForm.value as MultipleMember].findIndex((i: Member) => i.iin === member.value.iin);
@@ -2534,15 +2539,15 @@ export default {
2534
2539
  }
2535
2540
  });
2536
2541
 
2537
- watch(familyDialog, (val) => {
2538
- if(!val) {
2539
- closeFamilyDialog()
2542
+ watch(familyDialog, val => {
2543
+ if (!val) {
2544
+ closeFamilyDialog();
2540
2545
  }
2541
2546
  });
2542
2547
 
2543
- watch(digitalDocumentDialog, (val) => {
2544
- if(!val) {
2545
- digitalDocumentOwnerType.value = ''
2548
+ watch(digitalDocumentDialog, val => {
2549
+ if (!val) {
2550
+ digitalDocumentOwnerType.value = '';
2546
2551
  }
2547
2552
  });
2548
2553
 
@@ -2623,10 +2628,10 @@ export default {
2623
2628
  watch(
2624
2629
  () => member.value.documentType,
2625
2630
  val => {
2626
- if (val && val.ids !== "PS") {
2631
+ if (val && val.ids !== 'PS') {
2627
2632
  middleNameIsEditable.value = false;
2628
2633
  }
2629
- }
2634
+ },
2630
2635
  );
2631
2636
  onBeforeRouteLeave((to, from, next) => {
2632
2637
  if (dataStore.isDirty) {
@@ -2717,12 +2722,12 @@ export default {
2717
2722
  hasOtp,
2718
2723
  isDisabled,
2719
2724
  isTask,
2725
+ isRegionDisabled,
2720
2726
  isIinPhoneDisabled,
2721
2727
  showSaveButton,
2722
2728
  hasGBDFL,
2723
2729
  hasInsis,
2724
2730
  hasGKB,
2725
- hasDocumentReader,
2726
2731
  hasMiddleName,
2727
2732
  hasRelationDegree,
2728
2733
  hasFamilyStatus,
@@ -42,7 +42,8 @@
42
42
  whichProduct !== 'lifebusiness' &&
43
43
  whichProduct !== 'gns' &&
44
44
  whichProduct !== 'pensionannuitynew' &&
45
- whichProduct !== 'lifetrip'
45
+ whichProduct !== 'lifetrip' &&
46
+ whichProduct !== 'halykmycar'
46
47
  "
47
48
  :title="$dataStore.t('insuredForm')"
48
49
  >
@@ -56,7 +57,14 @@
56
57
  </div>
57
58
  </base-form-section>
58
59
  <base-form-section
59
- v-if="isUnderwriterRole && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam' && whichProduct !== 'borrower' && whichProduct !== 'tumar'"
60
+ v-if="
61
+ isUnderwriterRole &&
62
+ whichProduct !== 'pensionannuitynew' &&
63
+ whichProduct !== 'balam' &&
64
+ whichProduct !== 'borrower' &&
65
+ whichProduct !== 'tumar' &&
66
+ whichProduct !== 'halykmycar'
67
+ "
60
68
  :title="$dataStore.t('recalculationInfo')"
61
69
  >
62
70
  <base-form-input
@@ -339,6 +347,13 @@
339
347
  :clearable="!isDisabledAgentCommission"
340
348
  :rules="agencyPartRule"
341
349
  />
350
+ <base-form-input
351
+ v-if="hasTariffName"
352
+ v-model="productConditionsForm.tariffName"
353
+ :readonly="true"
354
+ :clearable="false"
355
+ label="Тариф"
356
+ />
342
357
  </base-form-section>
343
358
  <section v-if="whichProduct === 'pensionannuitynew'">
344
359
  <base-animation>
@@ -1271,7 +1286,7 @@ export default defineComponent({
1271
1286
  return false;
1272
1287
  });
1273
1288
  const hasPaymentPeriod = computed(() => {
1274
- if (whichProduct.value === 'halykkazyna') {
1289
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'halykmycar') {
1275
1290
  return false;
1276
1291
  }
1277
1292
  if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
@@ -1316,6 +1331,12 @@ export default defineComponent({
1316
1331
  }
1317
1332
  return false;
1318
1333
  });
1334
+ const hasTariffName = computed(() => {
1335
+ if (whichProduct.value === 'halykmycar') {
1336
+ return true;
1337
+ }
1338
+ return false;
1339
+ });
1319
1340
  const hasCurrencySymbols = computed(() => {
1320
1341
  if (whichProduct.value === 'halykkazyna') {
1321
1342
  return true;
@@ -1571,13 +1592,13 @@ export default defineComponent({
1571
1592
  return dataStore.t('generalConditions');
1572
1593
  });
1573
1594
  const hasInsStartDate = computed(() => {
1574
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1595
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || whichProduct.value === 'halykmycar') {
1575
1596
  return true;
1576
1597
  }
1577
1598
  return false;
1578
1599
  });
1579
1600
  const hasInsEndDate = computed(() => {
1580
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1601
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || whichProduct.value === 'halykmycar') {
1581
1602
  return true;
1582
1603
  }
1583
1604
  return false;
@@ -2900,6 +2921,7 @@ export default defineComponent({
2900
2921
  hasPaymentPeriod,
2901
2922
  hasRequestedSumInsured,
2902
2923
  hasInsurancePremiumPerMonth,
2924
+ hasTariffName,
2903
2925
  hasRequestedSumInsuredInDollar,
2904
2926
  hasInsurancePremiumPerMonthInDollar,
2905
2927
  hasCurrency,
@@ -76,6 +76,7 @@
76
76
  <span :class="[$styles.textSimple]" class="mt-3 text-center d-block">{{ $dataStore.t('sign.scanQrCode') }}</span>
77
77
  </div>
78
78
  <base-btn class="mt-10" :loading="loading" :text="$dataStore.t('sign.copyEgov')" @click="$dataStore.copyToClipboard(urlCopy)" />
79
+ <base-btn class="mt-1" :loading="loading" :text="$dataStore.t('sign.sendLink')" @click="sendLink" />
79
80
  <base-btn :text="$dataStore.t('buttons.cancel')" :btn="$styles.whiteBtn" @click="closeQrPanel" />
80
81
  </base-form-section>
81
82
  </div>
@@ -110,7 +111,7 @@
110
111
  v-for="signtype in file[0].signTypes"
111
112
  :text="signtype.documentSignTypeName"
112
113
  :btn="$styles.greenBtn"
113
- @click="newSign(signtype.documentSignTypeValue, file, index)"
114
+ @click="newSign(signtype.documentSignTypeValue, file, index, person.iin)"
114
115
  :loading="loading"
115
116
  />
116
117
  </section>
@@ -287,6 +288,7 @@ export default defineComponent({
287
288
  const signingFiles = ref<Types.Api.Sign.New.FileDatas[]>([]);
288
289
  const isOnlineEnpf = ref<boolean>(true);
289
290
  const currentFilePanel = ref<string[]>([]);
291
+ const selectedContragent = ref<string>('');
290
292
 
291
293
  const vForm = ref<any>();
292
294
  const isSendNumberOpen = ref<boolean>(false);
@@ -538,7 +540,7 @@ export default defineComponent({
538
540
 
539
541
  const onInit = async () => {
540
542
  if (dataStore.controls.hasChooseSign) {
541
- if (dataStore.isBaiterek || dataStore.isGons || dataStore.isLifeBusiness || dataStore.isPension || dataStore.isGns) {
543
+ if (dataStore.isBaiterek || dataStore.isMycar || dataStore.isGons || dataStore.isLifeBusiness || dataStore.isPension || dataStore.isGns) {
542
544
  isElectronicContract.value = false;
543
545
  }
544
546
  }
@@ -609,7 +611,7 @@ export default defineComponent({
609
611
  const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
610
612
  const choosePayActions = computed(() => dataStore.controls.hasChoosePay && dataStore.panelAction === constants.actions.choosePay);
611
613
  // TODO на все продукты новое подписание
612
- const isNewSign = computed(() => dataStore.isPension || dataStore.isGons || dataStore.isBaiterek);
614
+ const isNewSign = computed(() => dataStore.isPension || dataStore.isGons || dataStore.isBaiterek || dataStore.isMycar);
613
615
  const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
614
616
  const insurancePremiumPerMonth = computed(() => {
615
617
  if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
@@ -901,8 +903,9 @@ export default defineComponent({
901
903
  });
902
904
  };
903
905
 
904
- const newSign = async (signType: number, file: any, index: number) => {
906
+ const newSign = async (signType: number, file: any, index: number, iin: string) => {
905
907
  loading.value = true;
908
+ selectedContragent.value = iin;
906
909
  const data = {
907
910
  ...formStore.signatories[index],
908
911
  signType: signType,
@@ -970,6 +973,12 @@ export default defineComponent({
970
973
  currentFilePanel.value = [];
971
974
  }, 1000);
972
975
 
976
+ const sendLink = async () => {
977
+ const contragents = [formStore.policyholderForm, ...formStore.beneficiaryForm, ...formStore.insuredForm];
978
+ const person = contragents.find(item => item.iin!.replace(/-/g, '') === selectedContragent.value);
979
+ await dataStore.sendSMS('SignUrl', person!.phoneNumber!, urlCopy.value, person!.iin!.replace(/-/g, ''));
980
+ };
981
+
973
982
  return {
974
983
  // State
975
984
  formStore,
@@ -997,6 +1006,7 @@ export default defineComponent({
997
1006
  currentFilePanel,
998
1007
 
999
1008
  // Functions
1009
+ sendLink,
1000
1010
  closePanel,
1001
1011
  submitForm,
1002
1012
  handleTask,
@@ -840,6 +840,7 @@ export class ProductConditions {
840
840
  hasEnhancedGift: boolean | null;
841
841
  isCalculated: boolean | null;
842
842
  managerHelped: boolean;
843
+ tariffName: string | null;
843
844
 
844
845
  constructor(
845
846
  insuranceCase = null,
@@ -894,6 +895,7 @@ export class ProductConditions {
894
895
  hasEnhancedGift = false,
895
896
  isCalculated = false,
896
897
  managerHelped = true,
898
+ tariffName = null,
897
899
  ) {
898
900
  this.requestedSumInsuredInDollar = null;
899
901
  this.insurancePremiumPerMonthInDollar = null;
@@ -952,6 +954,7 @@ export class ProductConditions {
952
954
  this.hasEnhancedGift = hasEnhancedGift;
953
955
  this.isCalculated = isCalculated;
954
956
  this.managerHelped = managerHelped;
957
+ this.tariffName = tariffName;
955
958
  }
956
959
 
957
960
  getSingleTripDays() {
@@ -907,6 +907,7 @@ export class RoleController {
907
907
  toAULETTI: this.isAgentAuletti() || this.isManagerAuletti() || baseAccessRoles,
908
908
  toLKA_A: this.isAgentAuletti() || baseAccessRoles,
909
909
  toUU:
910
+ this.isJurist() ||
910
911
  this.isDsuio() ||
911
912
  this.isActuary() ||
912
913
  this.isUSNSACCINS() ||
@@ -986,3 +987,84 @@ export class RoleController {
986
987
  };
987
988
  };
988
989
  }
990
+
991
+ /**
992
+ * Обрабатывает выход пользователя с очисткой данных
993
+ */
994
+ export function handleLogout() {
995
+ redirectUtils.clearRedirectUrl();
996
+ localStorage.removeItem('accessToken');
997
+ localStorage.removeItem('refreshToken');
998
+ }
999
+
1000
+ /**
1001
+ * Проверяет есть ли ожидающий redirect URL
1002
+ */
1003
+ export function checkPendingRedirect(): boolean {
1004
+ return !!localStorage.getItem('redirect_url');
1005
+ }
1006
+
1007
+ /**
1008
+ * Сохраняет текущую страницу перед переходом на авторизацию
1009
+ */
1010
+ export function saveCurrentPageBeforeAuth() {
1011
+ redirectUtils.saveCurrentUrl();
1012
+ }
1013
+
1014
+ /**
1015
+ * Утилиты для работы с redirect URL при авторизации
1016
+ */
1017
+ export const redirectUtils = {
1018
+ /**
1019
+ * Сохраняет текущий URL для возврата после авторизации
1020
+ */
1021
+ saveCurrentUrl(route?: any): void {
1022
+ let currentPath: string;
1023
+
1024
+ if (route && route.fullPath) {
1025
+ currentPath = route.fullPath;
1026
+ } else {
1027
+ currentPath = window.location.pathname + window.location.search;
1028
+ }
1029
+
1030
+ const excludedPaths = ['/auth', '/login', '/logout'];
1031
+
1032
+ console.log('Saving redirect URL:', currentPath);
1033
+
1034
+ if (!excludedPaths.some(path => currentPath.startsWith(path))) {
1035
+ localStorage.setItem('redirect_url', currentPath);
1036
+ console.log('Redirect URL saved:', currentPath);
1037
+ } else {
1038
+ console.log('URL excluded from redirect:', currentPath);
1039
+ }
1040
+ },
1041
+
1042
+ /**
1043
+ * Получает сохраненный URL и удаляет его из хранилища
1044
+ */
1045
+ getAndClearRedirectUrl(): string | null {
1046
+ const redirectUrl = localStorage.getItem('redirect_url');
1047
+ console.log('Getting redirect URL:', redirectUrl);
1048
+ if (redirectUrl) {
1049
+ localStorage.removeItem('redirect_url');
1050
+ console.log('Redirect URL cleared and returned:', redirectUrl);
1051
+ return redirectUrl;
1052
+ }
1053
+ console.log('No redirect URL found');
1054
+ return null;
1055
+ },
1056
+
1057
+ /**
1058
+ * Очищает сохраненный redirect URL
1059
+ */
1060
+ clearRedirectUrl(): void {
1061
+ localStorage.removeItem('redirect_url');
1062
+ },
1063
+
1064
+ /**
1065
+ * Получает сохраненный URL без удаления (для отладки)
1066
+ */
1067
+ getCurrentRedirectUrl(): string | null {
1068
+ return localStorage.getItem('redirect_url');
1069
+ },
1070
+ };
package/locales/ru.json CHANGED
@@ -329,6 +329,7 @@
329
329
  "showQR": "Показать QR-код",
330
330
  "timer": "Вы создали счет на оплату, через 00:59 сек счет станет не активным",
331
331
  "copyEgov": "Скопировать ссылку на подпись через Egov",
332
+ "sendLink": "Отправить ссылку на номер телефона",
332
333
  "scanQrCode": "Отсканируйте этот QR-код в приложении, чтобы осуществить подписание",
333
334
  "successQrSigned": "Заявление и Договор подписаны Страхователем",
334
335
  "convertQr": "Преобразовать в QR код"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.69",
3
+ "version": "0.0.10-beta.70",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -16,7 +16,6 @@
16
16
  "plugins/",
17
17
  "pages/",
18
18
  "types/",
19
- "utils/",
20
19
  "nuxt.config.ts",
21
20
  "tailwind.config.js",
22
21
  "tsconfig.json",
@@ -44,6 +43,7 @@
44
43
  "nuxt": "3.10.3",
45
44
  "prettier": "3.2.5",
46
45
  "vue": "3.4.19",
46
+ "vue-tsc": "3.0.5",
47
47
  "vue-router": "4.3.0"
48
48
  },
49
49
  "dependencies": {
@@ -49,7 +49,7 @@ export const useDataStore = defineStore('data', {
49
49
  isBridge: state => state.product === 'efo' || state.product === 'aml' || state.product === 'lka' || state.product === 'auletti',
50
50
  isBaiterek: state => state.product === 'baiterek',
51
51
  isBolashak: state => state.product === 'bolashak',
52
- isMycar: state => state.product === 'mycar',
52
+ isMycar: state => state.product === 'halykmycar',
53
53
  isLifeBusiness: state => state.product === 'lifebusiness',
54
54
  isLifetrip: state => state.product === 'lifetrip',
55
55
  isLiferenta: state => state.product === 'liferenta',
@@ -1510,7 +1510,7 @@ export const useDataStore = defineStore('data', {
1510
1510
  if (this.isPension) return await this.getFromApi('transferContractCompanies', 'getInsuranceCompanies');
1511
1511
  },
1512
1512
  async getProcessIndexRate() {
1513
- const makeCall = (this.isBaiterek || this.isBolashak || this.isGons || this.isCalculator) && this.processCode;
1513
+ const makeCall = (this.isBaiterek || this.isBolashak || this.isGons || this.isCalculator || this.isMycar) && this.processCode;
1514
1514
  if (makeCall) return await this.getFromApi('processIndexRate', 'getProcessIndexRate', this.processCode);
1515
1515
  },
1516
1516
  async getProcessPaymentPeriod() {
@@ -1623,12 +1623,20 @@ export const useDataStore = defineStore('data', {
1623
1623
  whichMember: 'insured' | 'policyholder' = 'insured',
1624
1624
  ) {
1625
1625
  try {
1626
- const [baseQuestions, secondaryQuestions] = await Promise.allSettled([
1627
- whichMember === 'insured' ? this.api.getQuestionList(surveyType, processInstanceId, insuredId) : this.api.getClientQuestionList(surveyType, processInstanceId, insuredId),
1626
+ const basePromise: Promise<Types.AnketaFirst> =
1628
1627
  whichMember === 'insured'
1628
+ ? this.api.getQuestionList(surveyType, processInstanceId, insuredId)
1629
+ : this.api.getClientQuestionList(surveyType, processInstanceId, insuredId);
1630
+
1631
+ const secondPromise: Promise<Types.AnketaSecond[] | null> = !this.isMycar
1632
+ ? (whichMember === 'insured'
1629
1633
  ? this.api.getQuestionListSecond(`${surveyType}second`, processInstanceId, insuredId)
1630
- : this.api.getClientQuestionListSecond(`${surveyType}second`, processInstanceId, insuredId),
1631
- ,
1634
+ : this.api.getClientQuestionListSecond(`${surveyType}second`, processInstanceId, insuredId))
1635
+ : Promise.resolve(null);
1636
+
1637
+ const [baseQuestions, secondaryQuestions] = await Promise.allSettled([
1638
+ basePromise,
1639
+ secondPromise,
1632
1640
  ]);
1633
1641
  if (baseQuestions.status === 'fulfilled') {
1634
1642
  this.formStore[baseField] = baseQuestions.value;
@@ -1636,7 +1644,7 @@ export const useDataStore = defineStore('data', {
1636
1644
  if (secondaryQuestions.status === 'fulfilled') {
1637
1645
  const baseAnketa = this.formStore[baseField];
1638
1646
  if (baseAnketa && baseAnketa.body && baseAnketa.body.length) {
1639
- const isSpecialSurvey = this.isBaiterek || this.isBolashak || this.isLiferenta;
1647
+ const isSpecialSurvey = this.isBaiterek || this.isBolashak || this.isLiferenta || this.isMycar;
1640
1648
  for (const i of baseAnketa.body) {
1641
1649
  if (i.second === null && secondaryQuestions.value) {
1642
1650
  i.second = isSpecialSurvey
@@ -2557,6 +2565,13 @@ export const useDataStore = defineStore('data', {
2557
2565
  this.formStore.productConditionsForm.isCalculated = applicationData.policyAppDto.isCalculated;
2558
2566
  this.formStore.productConditionsForm.managerHelped = applicationData.policyAppDto.managerHelped ?? false;
2559
2567
  }
2568
+
2569
+ if (this.isMycar) {
2570
+ this.formStore.productConditionsForm.calcDate = reformatDate(applicationData.policyAppDto.contractDate);
2571
+ this.formStore.productConditionsForm.contractEndDate = reformatDate(applicationData.policyAppDto.contractEndDate);
2572
+ this.formStore.productConditionsForm.tariffName = applicationData.policyAppDto.tariffName;
2573
+ }
2574
+
2560
2575
  const riskGroup = this.riskGroup.find(item => {
2561
2576
  if (applicationData.policyAppDto.riskGroup == 0) {
2562
2577
  return true;
@@ -3091,10 +3106,10 @@ export const useDataStore = defineStore('data', {
3091
3106
  this.isLoading = false;
3092
3107
  }
3093
3108
  },
3094
- async sendSMS(type: 'SignUrl' | 'PayUrl', phoneNumber: string, text: string) {
3109
+ async sendSMS(type: 'SignUrl' | 'PayUrl', phoneNumber: string, text: string, iin: string = '') {
3095
3110
  if (!type || !phoneNumber || !text) return;
3096
3111
  const smsData: Types.SmsDataType = {
3097
- iin: this.formStore.applicationData.clientApp.iin,
3112
+ iin: iin === '' ? this.formStore.applicationData.clientApp.iin : iin,
3098
3113
  phoneNumber: formatPhone(phoneNumber),
3099
3114
  processInstanceId: String(this.formStore.applicationData.processInstanceId),
3100
3115
  text: text,
@@ -4398,6 +4413,18 @@ export const useDataStore = defineStore('data', {
4398
4413
  return null;
4399
4414
  }
4400
4415
  },
4416
+ hasPersonalDataSection(whichForm: keyof typeof StoreMembers) {
4417
+ if (!this.isMycar) return true;
4418
+ return whichForm !== this.formStore.beneficiaryFormKey;
4419
+ },
4420
+ hasPlaceRegistrationSection(whichForm: keyof typeof StoreMembers) {
4421
+ if (!this.isMycar) return true;
4422
+ return whichForm !== this.formStore.beneficiaryFormKey;
4423
+ },
4424
+ hasDocumentDataSection(whichForm: keyof typeof StoreMembers) {
4425
+ if (!this.isMycar) return true;
4426
+ return whichForm !== this.formStore.beneficiaryFormKey;
4427
+ },
4401
4428
  hasJobSection(whichForm: keyof typeof StoreMembers) {
4402
4429
  if (this.isLifetrip || this.isPension || this.isBalam || this.isBorrower || this.isTumar) return false;
4403
4430
  switch (whichForm) {
@@ -4420,10 +4447,8 @@ export const useDataStore = defineStore('data', {
4420
4447
  },
4421
4448
  hasContactSection(whichForm: keyof typeof StoreMembers) {
4422
4449
  if (this.isGons || this.isPension) return false;
4423
- switch (whichForm) {
4424
- default:
4425
- return true;
4426
- }
4450
+ if (this.isMycar && whichForm === this.formStore.beneficiaryFormKey) return false;
4451
+ return true;
4427
4452
  },
4428
4453
  hasBankSection(whichForm: keyof typeof StoreMembers) {
4429
4454
  if (!this.isPension || Number(this.formStore.applicationData.processCode) === 24) return false;
package/store/rules.ts CHANGED
@@ -53,7 +53,7 @@ export const rules = {
53
53
  },
54
54
  ],
55
55
  cyrillic: [(v: any) => v === null || /^[\u0400-\u04FF -]+$/.test(v) || t('rules.cyrillic')],
56
- latin: [(v: any) => v === null || /^[a-zA-Z]+$/.test(v) || t('rules.latin')],
56
+ latin: [(v: any) => v === null || /^[a-zA-Z -]+$/.test(v) || t('rules.latin')],
57
57
  latinAndNumber: [(v: any) => v === null || /^[0-9a-zA-Z]+$/.test(v) || t('rules.latinAndNumber')],
58
58
  latinNumberSymbol: [(v: any) => v === null || /^[0-9a-zA-Z-/]+$/.test(v) || t('rules.latinNumberSymbol')],
59
59
  cyrillicNonRequired: [
package/types/index.ts CHANGED
@@ -19,7 +19,7 @@ export type Projects =
19
19
  | 'liferenta'
20
20
  | 'lifetrip'
21
21
  | 'lka'
22
- | 'mycar'
22
+ | 'halykmycar'
23
23
  | 'checkcontract'
24
24
  | 'checkcontragent'
25
25
  | 'daskamkorlyk'
@@ -1,42 +0,0 @@
1
- import { redirectUtils } from './redirect-utils';
2
-
3
- /**
4
- * Обрабатывает успешную авторизацию с переходом на сохраненную страницу
5
- */
6
- export async function handleSuccessfulLogin(router: any) {
7
- try {
8
- const redirectUrl = redirectUtils.getAndClearRedirectUrl();
9
-
10
- if (redirectUrl) {
11
- await router.push(redirectUrl);
12
- } else {
13
- await router.push({ name: 'index' });
14
- }
15
- } catch (error) {
16
- console.error('Redirect error:', error);
17
- await router.push({ name: 'index' });
18
- }
19
- }
20
-
21
- /**
22
- * Обрабатывает выход пользователя с очисткой данных
23
- */
24
- export function handleLogout() {
25
- redirectUtils.clearRedirectUrl();
26
- localStorage.removeItem('accessToken');
27
- localStorage.removeItem('refreshToken');
28
- }
29
-
30
- /**
31
- * Проверяет есть ли ожидающий redirect URL
32
- */
33
- export function checkPendingRedirect(): boolean {
34
- return !!localStorage.getItem('redirect_url');
35
- }
36
-
37
- /**
38
- * Сохраняет текущую страницу перед переходом на авторизацию
39
- */
40
- export function saveCurrentPageBeforeAuth() {
41
- redirectUtils.saveCurrentUrl();
42
- }
@@ -1,57 +0,0 @@
1
- /**
2
- * Утилиты для работы с redirect URL при авторизации
3
- */
4
- export const redirectUtils = {
5
- /**
6
- * Сохраняет текущий URL для возврата после авторизации
7
- */
8
- saveCurrentUrl(route?: any): void {
9
- let currentPath: string;
10
-
11
- if (route && route.fullPath) {
12
- currentPath = route.fullPath;
13
- } else {
14
- currentPath = window.location.pathname + window.location.search;
15
- }
16
-
17
- const excludedPaths = ['/auth', '/login', '/logout'];
18
-
19
- console.log('Saving redirect URL:', currentPath);
20
-
21
- if (!excludedPaths.some(path => currentPath.startsWith(path))) {
22
- localStorage.setItem('redirect_url', currentPath);
23
- console.log('Redirect URL saved:', currentPath);
24
- } else {
25
- console.log('URL excluded from redirect:', currentPath);
26
- }
27
- },
28
-
29
- /**
30
- * Получает сохраненный URL и удаляет его из хранилища
31
- */
32
- getAndClearRedirectUrl(): string | null {
33
- const redirectUrl = localStorage.getItem('redirect_url');
34
- console.log('Getting redirect URL:', redirectUrl);
35
- if (redirectUrl) {
36
- localStorage.removeItem('redirect_url');
37
- console.log('Redirect URL cleared and returned:', redirectUrl);
38
- return redirectUrl;
39
- }
40
- console.log('No redirect URL found');
41
- return null;
42
- },
43
-
44
- /**
45
- * Очищает сохраненный redirect URL
46
- */
47
- clearRedirectUrl(): void {
48
- localStorage.removeItem('redirect_url');
49
- },
50
-
51
- /**
52
- * Получает сохраненный URL без удаления (для отладки)
53
- */
54
- getCurrentRedirectUrl(): string | null {
55
- return localStorage.getItem('redirect_url');
56
- },
57
- };