hl-core 0.0.8-beta.17 → 0.0.8-beta.19

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/index.ts CHANGED
@@ -334,7 +334,6 @@ export class ApiClass {
334
334
  return this.axiosCall({
335
335
  method: Methods.GET,
336
336
  url: '/Arm/api/Bpm/ProcessList',
337
- timeout: 10000,
338
337
  });
339
338
  }
340
339
 
@@ -9,6 +9,14 @@
9
9
  <v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')"></v-text-field>
10
10
  <i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"></i
11
11
  ></base-panel-item>
12
+ <base-panel-item v-if="$dataStore.isEFO" @click="changeBridge('lka')" class="cursor-pointer">
13
+ {{ $t('labels.lkaLong') }}
14
+ <i class="mdi mdi-card-account-details-outline text-2xl text-[#A0B3D8]"></i
15
+ ></base-panel-item>
16
+ <base-panel-item v-if="$dataStore.isLKA" @click="changeBridge('efo')" class="cursor-pointer">
17
+ {{ $t('labels.efoLong') }}
18
+ <i class="mdi mdi-web text-2xl text-[#A0B3D8]"></i
19
+ ></base-panel-item>
12
20
  <base-panel-item
13
21
  v-for="panelItem of dataStore.settings.items.filter(i => $dataStore.filters.show(i))"
14
22
  :key="panelItem.title!"
@@ -45,4 +53,10 @@ const logoutUser = async () => {
45
53
  dialog.value = false;
46
54
  await dataStore.logoutUser();
47
55
  };
56
+
57
+ const changeBridge = async (toBridge: 'efo' | 'lka') => {
58
+ const bridgeUrl = import.meta.env[`VITE_${toBridge.toUpperCase()}_URL`] as string;
59
+ if (!bridgeUrl) return;
60
+ window.open(`${bridgeUrl}/#/Token?token=${dataStore.accessToken}`, '_blank');
61
+ };
48
62
  </script>
@@ -6,7 +6,7 @@
6
6
  :has-back="hasBack"
7
7
  :back-icon="backIcon"
8
8
  :has-more="hasMore"
9
- :hide-more-on-lg="hideMoreOnLg"
9
+ :hide-more-on-lg="hideOnLg"
10
10
  :more-icon="moreIcon"
11
11
  @onBack="$emit('onBack')"
12
12
  @onMore="$emit('onMore')"
@@ -77,10 +77,6 @@ export default defineComponent({
77
77
  type: Boolean,
78
78
  default: false,
79
79
  },
80
- hideMoreOnLg: {
81
- type: Boolean,
82
- default: false,
83
- },
84
80
  moreIcon: {
85
81
  type: String,
86
82
  default: 'mdi-cog-outline',
@@ -110,7 +106,18 @@ export default defineComponent({
110
106
  }
111
107
  };
112
108
 
113
- return { pickItem, openTab };
109
+ const hideOnLg = computed(() => {
110
+ switch (router.currentRoute.value.name) {
111
+ case 'Insurance-Product':
112
+ case 'Menu':
113
+ case 'History':
114
+ return false;
115
+ default:
116
+ return true;
117
+ }
118
+ });
119
+
120
+ return { pickItem, openTab, hideOnLg };
114
121
  },
115
122
  });
116
123
  </script>
@@ -19,20 +19,10 @@
19
19
  :readonly="isDisabled || isIinPhoneDisabled"
20
20
  :clearable="!isDisabled"
21
21
  :append-inner-icon="otpCondition ? 'mdi mdi-phone-message' : ''"
22
- @append="sendOtp(false)"
23
- @keyup.enter.prevent="otpCondition ? sendOtp(false) : null"
22
+ @append="openCustomPanel('otp')"
23
+ @keyup.enter.prevent="otpCondition ? openCustomPanel('otp') : null"
24
24
  :rules="phoneRule"
25
25
  ></base-form-input>
26
- <base-fade-transition>
27
- <base-form-input
28
- v-if="otpCondition && member.otpTokenId"
29
- v-model="member.otpCode"
30
- :label="$t('form.otpCode')"
31
- :maska="$maska.otp"
32
- :append-inner-icon="hasOtp ? 'mdi mdi-check' : ''"
33
- @keyup.enter.prevent="hasOtp ? checkOtp() : null"
34
- ></base-form-input>
35
- </base-fade-transition>
36
26
  <base-form-input
37
27
  v-model="member.lastName"
38
28
  :readonly="isDisabled || isFromGBD"
@@ -487,6 +477,23 @@
487
477
  <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')"></base-btn>
488
478
  </div>
489
479
  </Teleport>
480
+ <Teleport v-if="isOtpPanelOpen && !member.hasAgreement" to="#panel-actions">
481
+ <div :class="[$libStyles.flexColNav]">
482
+ <base-fade-transition>
483
+ <base-rounded-input
484
+ v-if="otpCondition && member.otpTokenId"
485
+ v-model="member.otpCode"
486
+ :label="$t('form.otpCode')"
487
+ :maska="$maska.otp"
488
+ :append-inner-icon="hasOtp ? 'mdi-cellphone-message text-[17px]' : ''"
489
+ hide-details
490
+ @keyup.enter.prevent="hasOtp ? checkOtp() : null"
491
+ ></base-rounded-input>
492
+ </base-fade-transition>
493
+ <base-btn v-if="!member.otpTokenId" :disabled="otpSending" :loading="otpSending" :text="$t('buttons.sendOtp')" @click="sendOtp(false)"></base-btn>
494
+ <base-btn v-if="member.otpTokenId" :disabled="otpSending" :loading="otpSending" :text="$t('buttons.check')" @click="checkOtp()"></base-btn>
495
+ </div>
496
+ </Teleport>
490
497
  <base-dialog v-model="familyDialog" :title="$t('dialog.familyMember')" actions="familyDialog">
491
498
  <template #actions>
492
499
  <base-family-dialog :selected="selectedFamilyMember" @selectFamilyMember="selectFamilyMember" @reset="closeFamilyDialog(true)"></base-family-dialog>
@@ -518,8 +525,10 @@ export default {
518
525
  const isButtonLoading = ref<boolean>(false);
519
526
  const isSubmittingForm = ref<boolean>(false);
520
527
  const documentLoading = ref<boolean>(false);
528
+ const otpSending = ref<boolean>(false);
521
529
  const isSearchOpen = ref<boolean>(false);
522
530
  const isDocumentOpen = ref<boolean>(false);
531
+ const isOtpPanelOpen = ref<boolean>(false);
523
532
  const isPanelLoading = ref<boolean>(false);
524
533
  const familyDialog = ref<boolean>(false);
525
534
  const sameAddress = ref<boolean>(false);
@@ -659,6 +668,7 @@ export default {
659
668
  dataStore.panel.open = true;
660
669
  isSearchOpen.value = true;
661
670
  isDocumentOpen.value = false;
671
+ isOtpPanelOpen.value = false;
662
672
  isPanelOpen.value = false;
663
673
  } else {
664
674
  dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
@@ -669,13 +679,21 @@ export default {
669
679
  vForm.value.scrollTo({ top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' });
670
680
  };
671
681
 
672
- const openCustomPanel = (type: 'document' = 'document') => {
682
+ const openCustomPanel = (type: 'document' | 'otp' = 'document') => {
673
683
  dataStore.panelAction = null;
674
684
  if (type === 'document' && memberDocument.value) {
675
685
  dataStore.panel.title = memberDocument.value.fileTypeName!;
676
686
  isDocumentOpen.value = true;
677
687
  isSearchOpen.value = false;
678
688
  isPanelOpen.value = false;
689
+ isOtpPanelOpen.value = false;
690
+ }
691
+ if (type === 'otp') {
692
+ dataStore.panel.title = dataStore.t('form.otpCode');
693
+ isOtpPanelOpen.value = true;
694
+ isDocumentOpen.value = false;
695
+ isSearchOpen.value = false;
696
+ isPanelOpen.value = false;
679
697
  }
680
698
  dataStore.panel.open = true;
681
699
  };
@@ -684,6 +702,7 @@ export default {
684
702
  if (!isDisabled.value) {
685
703
  isSearchOpen.value = false;
686
704
  isDocumentOpen.value = false;
705
+ isOtpPanelOpen.value = false;
687
706
  // Feature
688
707
  // const notAllowedToChange = ['gender', 'documentType', 'documentIssuers'];
689
708
  // if (member.value.gotFromInsis === false && notAllowedToChange.includes(key)) {
@@ -870,7 +889,7 @@ export default {
870
889
  };
871
890
 
872
891
  const getContragentFromGBDFL = async () => {
873
- if (member.value.hasAgreement === false) {
892
+ if (member.value.hasAgreement !== true) {
874
893
  dataStore.showToaster('error', dataStore.t('toaster.needAgreement'), 3000);
875
894
  dataStore.panel.open = false;
876
895
  isSearchOpen.value = false;
@@ -883,15 +902,19 @@ export default {
883
902
  return;
884
903
  }
885
904
  isButtonLoading.value = true;
886
- await dataStore.getContragentFromGBDFL(member.value);
887
- member.value.gotFromInsis = true;
905
+ const response = await dataStore.getContragentFromGBDFL(member.value);
906
+ if (typeof response === 'boolean') {
907
+ if (response === true) {
908
+ member.value.gotFromInsis = true;
909
+ }
910
+ dataStore.panel.open = false;
911
+ isSearchOpen.value = false;
912
+ }
888
913
  isButtonLoading.value = false;
889
- dataStore.panel.open = false;
890
- isSearchOpen.value = false;
891
914
  };
892
915
 
893
916
  const getContragent = async () => {
894
- if (member.value.hasAgreement === false) {
917
+ if (member.value.hasAgreement !== true) {
895
918
  dataStore.showToaster('error', dataStore.t('toaster.needAgreement'), 3000);
896
919
  dataStore.panel.open = false;
897
920
  isSearchOpen.value = false;
@@ -988,7 +1011,7 @@ export default {
988
1011
  name: route.name!,
989
1012
  query: { ...route.query, id: member.value.id },
990
1013
  });
991
- await dataStore.getApplicationData(route.params.taskId, false, true, true, false);
1014
+ await dataStore.getApplicationData(route.params.taskId, false, false, true, false);
992
1015
  if (dataStore.controls.hasCalculator) {
993
1016
  if (formStore.additionalInsuranceTermsWithout && formStore.additionalInsuranceTermsWithout.length !== 0) {
994
1017
  formStore.additionalInsuranceTerms.forEach((term: any) => {
@@ -1012,7 +1035,7 @@ export default {
1012
1035
  return true;
1013
1036
  }
1014
1037
  }
1015
- if (member.value.hasAgreement === false) {
1038
+ if (member.value.hasAgreement !== true) {
1016
1039
  dataStore.showToaster('error', dataStore.t('toaster.needAgreement'));
1017
1040
  return false;
1018
1041
  }
@@ -1076,17 +1099,27 @@ export default {
1076
1099
  dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: dataStore.t('form.otpCode') }), 3000);
1077
1100
  return;
1078
1101
  }
1102
+ otpSending.value = true;
1079
1103
  const checked = await memberStore.checkOtp(member.value);
1080
1104
  if (typeof checked !== 'undefined') {
1081
1105
  member.value.hasAgreement = checked;
1082
1106
  }
1107
+ otpSending.value = false;
1108
+ if (checked === true) {
1109
+ dataStore.panel.open = false;
1110
+ }
1083
1111
  };
1084
1112
 
1085
1113
  const sendOtp = async (onInit = false) => {
1114
+ otpSending.value = true;
1086
1115
  const response = await memberStore.sendOtp(member.value, formStore.applicationData.processInstanceId, onInit);
1087
1116
  if (response) {
1088
1117
  if (member.value.hasAgreement === null) member.value.hasAgreement = response.otpStatus;
1118
+ if (response.otpStatus === true) {
1119
+ dataStore.panel.open = false;
1120
+ }
1089
1121
  }
1122
+ otpSending.value = false;
1090
1123
  };
1091
1124
 
1092
1125
  const setDefaultValues = async () => {
@@ -1094,6 +1127,9 @@ export default {
1094
1127
  if (setDefaults.sectorCode) {
1095
1128
  await setSectorCode();
1096
1129
  }
1130
+ if (setDefaults.percentage) {
1131
+ setPercentage();
1132
+ }
1097
1133
  };
1098
1134
 
1099
1135
  const setSectorCode = async () => {
@@ -1104,6 +1140,21 @@ export default {
1104
1140
  }
1105
1141
  };
1106
1142
 
1143
+ const setPercentage = () => {
1144
+ if (whichForm.value === formStore.beneficiaryFormKey && member.value.id === 0 && route.query.id === '0' && member.value.percentageOfPayoutAmount === null) {
1145
+ if (dataStore.members.beneficiaryApp.isMultiple) {
1146
+ const availablePercentage =
1147
+ 100 -
1148
+ formStore.beneficiaryForm.reduce((sum, member) => {
1149
+ return sum + Number(member.percentageOfPayoutAmount);
1150
+ }, 0);
1151
+ if (availablePercentage >= 0 && availablePercentage <= 100) member.value.percentageOfPayoutAmount = availablePercentage;
1152
+ } else {
1153
+ member.value.percentageOfPayoutAmount = 100;
1154
+ }
1155
+ }
1156
+ };
1157
+
1107
1158
  const onInit = async () => {
1108
1159
  if (route.params.taskId === '0' || (route.params.taskId !== '0' && dataStore.isProcessEditable(formStore.applicationData.statusCode))) {
1109
1160
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
@@ -1172,14 +1223,14 @@ export default {
1172
1223
  },
1173
1224
  );
1174
1225
 
1175
- watch(
1176
- () => member.value.otpCode,
1177
- async () => {
1178
- if (member.value.otpCode && member.value.otpCode.length === useMask().otp.length) {
1179
- await checkOtp();
1180
- }
1181
- },
1182
- );
1226
+ // watch(
1227
+ // () => member.value.otpCode,
1228
+ // async () => {
1229
+ // if (member.value.otpCode && member.value.otpCode.length === useMask().otp.length) {
1230
+ // await checkOtp();
1231
+ // }
1232
+ // },
1233
+ // );
1183
1234
 
1184
1235
  watch(
1185
1236
  () => dataStore.panel.open,
@@ -1188,6 +1239,7 @@ export default {
1188
1239
  isPanelOpen.value = false;
1189
1240
  isDocumentOpen.value = false;
1190
1241
  isSearchOpen.value = false;
1242
+ isOtpPanelOpen.value = false;
1191
1243
  dataStore.panelAction = null;
1192
1244
  }
1193
1245
  },
@@ -1209,10 +1261,12 @@ export default {
1209
1261
  isPanelOpen,
1210
1262
  isSearchOpen,
1211
1263
  isDocumentOpen,
1264
+ isOtpPanelOpen,
1212
1265
  isPanelLoading,
1213
1266
  isButtonLoading,
1214
1267
  isSubmittingForm,
1215
1268
  documentLoading,
1269
+ otpSending,
1216
1270
  panelValue,
1217
1271
  panelList,
1218
1272
  searchQuery,
@@ -41,6 +41,7 @@
41
41
  :rules="$dataStore.rules.recalculationAdditive"
42
42
  ></base-form-input>
43
43
  <base-form-input
44
+ v-if="hasAdbMultiply"
44
45
  v-model="productConditionsForm.adbMultiply"
45
46
  :maska="$maska.numbers"
46
47
  :clearable="isRecalculationDisabled === false"
@@ -49,6 +50,7 @@
49
50
  :rules="$dataStore.rules.recalculationMultiply"
50
51
  ></base-form-input>
51
52
  <base-form-input
53
+ v-if="hasAdbAdditive"
52
54
  v-model="productConditionsForm.adbAdditive"
53
55
  :maska="$maska.numbers"
54
56
  :clearable="isRecalculationDisabled === false"
@@ -74,6 +76,7 @@
74
76
  >
75
77
  </base-form-input>
76
78
  <base-panel-input
79
+ v-if="hasRiskGroup"
77
80
  v-model="productConditionsForm.riskGroup"
78
81
  :value="productConditionsForm.riskGroup.nameRu"
79
82
  :label="$t('productConditionsForm.riskGroup')"
@@ -178,7 +181,7 @@
178
181
  :clearable="!isDisabled"
179
182
  :rules="insurancePremiumPerMonth"
180
183
  :label="$t('productConditionsForm.insurancePremiumAmountInDollar')"
181
- :suffix="constants.currencySymbols.usd"
184
+ :suffix="$constants.currencySymbols.usd"
182
185
  @input="onInputInsurancePremiumPerMonthInDollar"
183
186
  ></base-form-input>
184
187
  <base-form-input
@@ -198,7 +201,7 @@
198
201
  :clearable="!isDisabled"
199
202
  :label="term.coverTypeName"
200
203
  append-inner-icon="mdi mdi-chevron-right"
201
- :suffix="!!term.amount ? `${$dataStore.getNumberWithSpaces(term.amount)} ${$constants.currencySymbols.kzt}` : ''"
204
+ :suffix="!!term.amount ? `${$dataStore.getNumberWithSpaces(term.amount)} ${currencySymbolsAddTerm}` : ''"
202
205
  @append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
203
206
  ></base-panel-input>
204
207
  </div>
@@ -325,6 +328,24 @@ export default defineComponent({
325
328
  }
326
329
  return false;
327
330
  });
331
+ const hasAdbMultiply = computed(() => {
332
+ if (dataStore.isGons) {
333
+ return false;
334
+ }
335
+ return true;
336
+ });
337
+ const hasAdbAdditive = computed(() => {
338
+ if (dataStore.isGons) {
339
+ return false;
340
+ }
341
+ return true;
342
+ });
343
+ const hasRiskGroup = computed(() => {
344
+ if (dataStore.isGons) {
345
+ return false;
346
+ }
347
+ return true;
348
+ });
328
349
  const coverPeriodRule = computed(() => {
329
350
  const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
330
351
  if (dataStore.isGons) {
@@ -335,6 +356,12 @@ export default defineComponent({
335
356
  }
336
357
  return baseCondition;
337
358
  });
359
+ const currencySymbolsAddTerm = computed(() => {
360
+ if (dataStore.isKazyna) {
361
+ return constants.currencySymbols.usd;
362
+ }
363
+ return constants.currencySymbols.kzt;
364
+ });
338
365
 
339
366
  const toStatement = async () => {
340
367
  const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
@@ -665,7 +692,11 @@ export default defineComponent({
665
692
  hasRequestedSumInsuredInDollar,
666
693
  hasInsurancePremiumPerMonthInDollar,
667
694
  hasCurrency,
695
+ hasAdbMultiply,
696
+ hasAdbAdditive,
697
+ hasRiskGroup,
668
698
  hasCalculated,
699
+ currencySymbolsAddTerm,
669
700
 
670
701
  // Rules
671
702
  coverPeriodRule,
@@ -800,6 +800,7 @@ export class DataStoreClass {
800
800
  // Cтавит значения по дефолту полям
801
801
  setDefaults: {
802
802
  sectorCode: boolean;
803
+ percentage: boolean;
803
804
  };
804
805
  // Проверка на роль при авторизации
805
806
  onAuth: boolean;
@@ -836,6 +837,7 @@ export class DataStoreClass {
836
837
  hasBack: boolean;
837
838
  loading: boolean;
838
839
  backIcon: string;
840
+ moreIcon: string;
839
841
  onBack: any;
840
842
  onLink: any;
841
843
  selectedItem: MenuItem;
@@ -938,6 +940,7 @@ export class DataStoreClass {
938
940
  this.controls = {
939
941
  setDefaults: {
940
942
  sectorCode: true,
943
+ percentage: true,
941
944
  },
942
945
  onAuth: false,
943
946
  hasAnketa: true,
@@ -965,6 +968,7 @@ export class DataStoreClass {
965
968
  hasBack: false,
966
969
  loading: false,
967
970
  backIcon: 'mdi-arrow-left',
971
+ moreIcon: 'mdi-dots-vertical',
968
972
  onBack: {},
969
973
  onLink: {},
970
974
  selectedItem: new MenuItem(),
@@ -8,8 +8,8 @@
8
8
  :title="$dataStore.menu.title ?? 'Страховые продукты'"
9
9
  :has-back="$dataStore.menu.hasBack ?? false"
10
10
  :back-icon="$dataStore.menu.backIcon ?? 'mdi-arrow-left'"
11
+ :more-icon="$dataStore.menu.moreIcon ?? 'mdi-cog-outline'"
11
12
  :has-more="'hasMore' in $route.meta && $route.meta.hasMore ? !!$route.meta.hasMore : false"
12
- :hide-more-on-lg="true"
13
13
  :class="{
14
14
  // @ts-ignore
15
15
  '!hidden': !$display().lgAndUp.value && !!$dataStore.menu.selectedItem.title,
package/locales/en.json CHANGED
@@ -138,6 +138,8 @@
138
138
  "fromGBDFL": "From State Database of Individuals",
139
139
  "fromGKB": "From State Credit Bureau",
140
140
  "sendSMS": "Send SMS",
141
+ "sendOtp": "Send OTP",
142
+ "check": "Check",
141
143
  "toPayment": "Go to Payment",
142
144
  "calcSum": "Calculate Sum",
143
145
  "calcPremium": "Calculate Premium",
@@ -360,6 +362,10 @@
360
362
  "new": "Подать заявление"
361
363
  },
362
364
  "labels": {
365
+ "efoLong": "EFO",
366
+ "efo": "EFO",
367
+ "lkaLong": "LKA",
368
+ "lka": "LKA",
363
369
  "photo": "Фото",
364
370
  "attachPhoto": "Вложить фото",
365
371
  "form": "Форма",
@@ -537,7 +543,7 @@
537
543
  "otpCode": "Confirmation Code",
538
544
  "salesChanell": "Sales Channel",
539
545
  "manager": "Manager",
540
- "attachManager": "Attach to Manager",
546
+ "attachManager": "Manager",
541
547
  "agent": "Agent"
542
548
  },
543
549
  "agreementBlock": {
package/locales/kz.json CHANGED
@@ -138,6 +138,8 @@
138
138
  "fromGBDFL": "Государственная база данных физических лиц",
139
139
  "fromGKB": "Государственное кредитное бюро",
140
140
  "sendSMS": "Отправить СМС",
141
+ "sendOtp": "Отправить OTP",
142
+ "check": "Проверить",
141
143
  "toPayment": "Перейти к оплате",
142
144
  "calcSum": "Рассчитать сумму",
143
145
  "calcPremium": "Рассчитать премию",
@@ -360,6 +362,10 @@
360
362
  "new": "Подать заявление"
361
363
  },
362
364
  "labels": {
365
+ "efoLong": "Единое фронтальное окно",
366
+ "efo": "ЕФО",
367
+ "lkaLong": "Личный кабинет Агента",
368
+ "lka": "ЛКА",
363
369
  "photo": "Фото",
364
370
  "attachPhoto": "Вложить фото",
365
371
  "form": "Форма",
@@ -537,7 +543,7 @@
537
543
  "otpCode": "Код подтверждения",
538
544
  "salesChanell": " Канал продаж",
539
545
  "manager": "Менеджер",
540
- "attachManager": "Прикрепление к менеджеру",
546
+ "attachManager": "Менеджер",
541
547
  "agent": "Агент"
542
548
  },
543
549
  "agreementBlock": {
package/locales/ru.json CHANGED
@@ -138,6 +138,8 @@
138
138
  "fromGBDFL": "Государственная база данных физических лиц",
139
139
  "fromGKB": "Государственное кредитное бюро",
140
140
  "sendSMS": "Отправить СМС",
141
+ "sendOtp": "Отправить OTP",
142
+ "check": "Проверить",
141
143
  "toPayment": "Перейти к оплате",
142
144
  "calcSum": "Рассчитать сумму",
143
145
  "calcPremium": "Рассчитать премию",
@@ -360,6 +362,10 @@
360
362
  "new": "Подать заявление"
361
363
  },
362
364
  "labels": {
365
+ "efoLong": "Единое фронтальное окно",
366
+ "efo": "ЕФО",
367
+ "lkaLong": "Личный кабинет Агента",
368
+ "lka": "ЛКА",
363
369
  "photo": "Фото",
364
370
  "attachPhoto": "Вложить фото",
365
371
  "form": "Форма",
@@ -537,7 +543,7 @@
537
543
  "otpCode": "Код подтверждения",
538
544
  "salesChanell": " Канал продаж",
539
545
  "manager": "Менеджер",
540
- "attachManager": "Прикрепление к менеджеру",
546
+ "attachManager": "Менеджер",
541
547
  "agent": "Агент"
542
548
  },
543
549
  "agreementBlock": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8-beta.17",
3
+ "version": "0.0.8-beta.19",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ export default defineComponent({
7
+ setup() {
8
+ definePageMeta({
9
+ layout: 'clear',
10
+ });
11
+ const route = useRoute();
12
+ const router = useRouter();
13
+ const dataStore = useDataStore();
14
+
15
+ const getMainPageRoute = () => {
16
+ if (dataStore.isEFO) {
17
+ return 'Insurance-Product';
18
+ }
19
+ if (dataStore.isLKA) {
20
+ return 'Menu';
21
+ }
22
+ };
23
+
24
+ onMounted(async () => {
25
+ if (!dataStore.isBridge) {
26
+ dataStore.sendToParent(constants.postActions.Error401, 401);
27
+ return;
28
+ }
29
+ const mainRoute = getMainPageRoute();
30
+ if (mainRoute && route.query && 'token' in route.query) {
31
+ const token = route.query.token as string;
32
+ if (isValidToken(token)) {
33
+ localStorage.setItem('accessToken', token);
34
+ dataStore.accessToken = token;
35
+ dataStore.getUserRoles();
36
+ }
37
+ const routeQuery = route.query;
38
+ delete routeQuery.token;
39
+ await router.push({ name: mainRoute, query: Object.keys(routeQuery).length === 0 ? undefined : routeQuery });
40
+ } else {
41
+ await router.push({ name: 'Auth' });
42
+ }
43
+ });
44
+
45
+ return {};
46
+ },
47
+ });
48
+ </script>
@@ -727,9 +727,9 @@ export const useDataStore = defineStore('data', {
727
727
  cityTypeName: user.registrationRegionType.nameRu,
728
728
  blockNumber: user.registrationNumberHouse,
729
729
  apartmentNumber: user.registrationNumberApartment,
730
- address: `${checkForNull(user.registrationCountry.nameRu)}, ${checkForNull(user.registrationRegionType.nameRu)} ${checkForNull(user.registrationCity.nameRu)}, ул. ${checkForNull(
731
- user.registrationStreet,
732
- )}, д. ${checkForNull(user.registrationNumberHouse)} кв. ${checkForNull(user.registrationNumberApartment)}`,
730
+ address: `${checkForNull(user.registrationCountry.nameRu)}, ${checkForNull(user.registrationRegionType.nameRu)} ${checkForNull(
731
+ user.registrationCity.nameRu,
732
+ )}, ул. ${checkForNull(user.registrationStreet)}, д. ${checkForNull(user.registrationNumberHouse)} кв. ${checkForNull(user.registrationNumberApartment)}`,
733
733
  type: 'H',
734
734
  });
735
735
 
@@ -1346,6 +1346,7 @@ export const useDataStore = defineStore('data', {
1346
1346
  if (this.isKazyna) {
1347
1347
  calculationData.premiumInCurrency = getNumber(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar);
1348
1348
  calculationData.amountInCurrency = getNumber(this.formStore.productConditionsForm.requestedSumInsuredInDollar);
1349
+ calculationData.currencyExchangeRate = this.currencies.usd;
1349
1350
  }
1350
1351
  const calculationResponse = await this.api.calculateWithoutApplication(calculationData);
1351
1352
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.amount);
@@ -1399,6 +1400,7 @@ export const useDataStore = defineStore('data', {
1399
1400
  if (this.isKazyna) {
1400
1401
  form1.policyAppDto.premiumInCurrency = getNumber(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar);
1401
1402
  form1.policyAppDto.amountInCurrency = getNumber(this.formStore.productConditionsForm.requestedSumInsuredInDollar);
1403
+ form1.policyAppDto.currencyExchangeRate = this.currencies.usd;
1402
1404
  }
1403
1405
  try {
1404
1406
  let id = this.formStore.applicationData.processInstanceId;
@@ -2199,6 +2201,9 @@ export const useDataStore = defineStore('data', {
2199
2201
  }
2200
2202
  },
2201
2203
  async getContragentFromGBDFL(member) {
2204
+ // null - ожидание
2205
+ // false - ошибка или неправильно
2206
+ // true - успешно и данные получены
2202
2207
  this.isLoading = true;
2203
2208
  try {
2204
2209
  const data = {
@@ -2209,21 +2214,22 @@ export const useDataStore = defineStore('data', {
2209
2214
  if (gbdResponse.status === 'soap:Server') {
2210
2215
  this.showToaster('error', `${gbdResponse.statusName}. Отправьте запрос через некоторое время`, 5000);
2211
2216
  this.isLoading = false;
2212
- return;
2217
+ return false;
2213
2218
  }
2214
2219
  if (gbdResponse.status === 'PENDING') {
2215
- this.showToaster('success', this.t('toaster.waitForClient'), 5000);
2220
+ this.showToaster('info', this.t('toaster.waitForClient'), 5000);
2216
2221
  this.isLoading = false;
2217
- return;
2222
+ return null;
2218
2223
  }
2219
2224
  if (constants.gbdErrors.find(i => i === gbdResponse.status)) {
2220
2225
  if (gbdResponse.status === 'TIMEOUT') {
2221
- this.showToaster('success', `${gbdResponse.statusName}. Отправьте запрос еще раз`, 5000);
2226
+ this.showToaster('error', `${gbdResponse.statusName}. Отправьте запрос еще раз`, 5000);
2227
+ return null;
2222
2228
  } else {
2223
- this.showToaster('success', gbdResponse.statusName, 5000);
2229
+ this.showToaster('error', gbdResponse.statusName, 5000);
2224
2230
  }
2225
2231
  this.isLoading = false;
2226
- return;
2232
+ return false;
2227
2233
  }
2228
2234
  const { person } = parseXML(gbdResponse.content, true, 'person');
2229
2235
  const { responseInfo } = parseXML(gbdResponse.content, true, 'responseInfo');
@@ -2235,10 +2241,12 @@ export const useDataStore = defineStore('data', {
2235
2241
  member.verifyDate = responseInfo.responseDate;
2236
2242
  member.verifyType = 'GBDFL';
2237
2243
  await this.saveInStoreUserGBDFL(person, member);
2244
+ return true;
2238
2245
  } catch (err) {
2239
- ErrorHandler(err);
2246
+ return ErrorHandler(err);
2247
+ } finally {
2248
+ this.isLoading = false;
2240
2249
  }
2241
- this.isLoading = false;
2242
2250
  },
2243
2251
  async saveInStoreUserGBDFL(person, member) {
2244
2252
  member.firstName = person.name;
@@ -35,8 +35,13 @@ export const useMemberStore = defineStore('members', {
35
35
  if (!whichForm) return false;
36
36
  if (!this.isStatementEditible(whichForm)) return false;
37
37
  if (!this.validateInitiator(false)) return false;
38
- if (typeof whichIndex === 'number' && whichIndex > 0) {
39
- return true;
38
+ if (typeof whichIndex === 'number') {
39
+ if (whichIndex > 0) {
40
+ return true;
41
+ }
42
+ if (whichIndex === 0) {
43
+ return this.hasMemberData(whichForm, whichIndex);
44
+ }
40
45
  }
41
46
  if (this.dataStore.isTask() && this.dataStore.isProcessEditable(this.formStore.applicationData.statusCode)) {
42
47
  if (whichForm !== this.formStore.policyholderFormKey) {
@@ -295,8 +300,14 @@ export const useMemberStore = defineStore('members', {
295
300
  // TODO Доработать и менять значение hasAgreement.value => true
296
301
  this.dataStore.showToaster(otpResponse.status !== 2 ? 'error' : 'success', otpResponse.statusName, 3000);
297
302
  if (otpResponse.status === 2) {
303
+ member.otpCode = null;
298
304
  return true;
299
305
  }
306
+ if (otpResponse.status === 4 || otpResponse.status === 5) {
307
+ member.otpCode = null;
308
+ member.otpTokenId = null;
309
+ return false;
310
+ }
300
311
  }
301
312
  }
302
313
  return false;
@@ -310,7 +321,7 @@ export const useMemberStore = defineStore('members', {
310
321
  async sendOtp(member: Member, processInstanceId: string | number | null = null, onInit: boolean = false) {
311
322
  if (!this.validateInitiator()) return null;
312
323
  this.dataStore.isLoading = true;
313
- let otpStatus: boolean = false;
324
+ let otpStatus: boolean | null = null;
314
325
  let otpResponse: SendOtpResponse = {};
315
326
  try {
316
327
  if (member.iin && member.phoneNumber && member.iin.length === useMask().iin.length && member.phoneNumber.length === useMask().phone.length) {
@@ -338,25 +349,22 @@ export const useMemberStore = defineStore('members', {
338
349
  if (!!otpResponse) {
339
350
  if ('errMessage' in otpResponse && otpResponse.errMessage !== null) {
340
351
  this.dataStore.showToaster('error', otpResponse.errMessage, 3000);
341
- return { otpStatus };
352
+ return { otpStatus: false };
342
353
  }
343
354
  if ('result' in otpResponse && otpResponse.result === null) {
344
355
  if ('statusName' in otpResponse && !!otpResponse.statusName) {
345
356
  this.dataStore.showToaster('error', otpResponse.statusName, 3000);
346
- return { otpStatus };
357
+ return { otpStatus: false };
347
358
  }
348
359
  if ('status' in otpResponse && !!otpResponse.status) {
349
360
  this.dataStore.showToaster('error', otpResponse.status, 3000);
350
- return { otpStatus };
361
+ return { otpStatus: false };
351
362
  }
352
363
  }
353
364
  if ('tokenId' in otpResponse && otpResponse.tokenId) {
354
365
  member.otpTokenId = otpResponse.tokenId;
355
366
  this.dataStore.showToaster('success', this.dataStore.t('toaster.successOtp'), 3000);
356
367
  }
357
- } else {
358
- this.dataStore.showToaster('error', this.dataStore.t('error.noOtpResponse'), 3000);
359
- return { otpStatus };
360
368
  }
361
369
  }
362
370
  } else {