hl-core 0.0.8-beta.17 → 0.0.8-beta.18
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/components/Pages/MemberForm.vue +83 -29
- package/components/Pages/ProductConditions.vue +9 -2
- package/composables/classes.ts +2 -0
- package/locales/en.json +3 -1
- package/locales/kz.json +3 -1
- package/locales/ru.json +3 -1
- package/package.json +1 -1
- package/store/data.store.js +19 -11
- package/store/member.store.ts +17 -9
|
@@ -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="
|
|
23
|
-
@keyup.enter.prevent="otpCondition ?
|
|
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
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
|
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
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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,
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
:clearable="!isDisabled"
|
|
179
179
|
:rules="insurancePremiumPerMonth"
|
|
180
180
|
:label="$t('productConditionsForm.insurancePremiumAmountInDollar')"
|
|
181
|
-
:suffix="constants.currencySymbols.usd"
|
|
181
|
+
:suffix="$constants.currencySymbols.usd"
|
|
182
182
|
@input="onInputInsurancePremiumPerMonthInDollar"
|
|
183
183
|
></base-form-input>
|
|
184
184
|
<base-form-input
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
:clearable="!isDisabled"
|
|
199
199
|
:label="term.coverTypeName"
|
|
200
200
|
append-inner-icon="mdi mdi-chevron-right"
|
|
201
|
-
:suffix="!!term.amount ? `${$dataStore.getNumberWithSpaces(term.amount)} ${
|
|
201
|
+
:suffix="!!term.amount ? `${$dataStore.getNumberWithSpaces(term.amount)} ${currencySymbolsAddTerm}` : ''"
|
|
202
202
|
@append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
|
|
203
203
|
></base-panel-input>
|
|
204
204
|
</div>
|
|
@@ -335,6 +335,12 @@ export default defineComponent({
|
|
|
335
335
|
}
|
|
336
336
|
return baseCondition;
|
|
337
337
|
});
|
|
338
|
+
const currencySymbolsAddTerm = computed(() => {
|
|
339
|
+
if (dataStore.isKazyna) {
|
|
340
|
+
return constants.currencySymbols.usd
|
|
341
|
+
}
|
|
342
|
+
return constants.currencySymbols.kzt
|
|
343
|
+
});
|
|
338
344
|
|
|
339
345
|
const toStatement = async () => {
|
|
340
346
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
@@ -666,6 +672,7 @@ export default defineComponent({
|
|
|
666
672
|
hasInsurancePremiumPerMonthInDollar,
|
|
667
673
|
hasCurrency,
|
|
668
674
|
hasCalculated,
|
|
675
|
+
currencySymbolsAddTerm,
|
|
669
676
|
|
|
670
677
|
// Rules
|
|
671
678
|
coverPeriodRule,
|
package/composables/classes.ts
CHANGED
|
@@ -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;
|
|
@@ -938,6 +939,7 @@ export class DataStoreClass {
|
|
|
938
939
|
this.controls = {
|
|
939
940
|
setDefaults: {
|
|
940
941
|
sectorCode: true,
|
|
942
|
+
percentage: true,
|
|
941
943
|
},
|
|
942
944
|
onAuth: false,
|
|
943
945
|
hasAnketa: true,
|
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",
|
|
@@ -537,7 +539,7 @@
|
|
|
537
539
|
"otpCode": "Confirmation Code",
|
|
538
540
|
"salesChanell": "Sales Channel",
|
|
539
541
|
"manager": "Manager",
|
|
540
|
-
"attachManager": "
|
|
542
|
+
"attachManager": "Manager",
|
|
541
543
|
"agent": "Agent"
|
|
542
544
|
},
|
|
543
545
|
"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": "Рассчитать премию",
|
|
@@ -537,7 +539,7 @@
|
|
|
537
539
|
"otpCode": "Код подтверждения",
|
|
538
540
|
"salesChanell": " Канал продаж",
|
|
539
541
|
"manager": "Менеджер",
|
|
540
|
-
"attachManager": "
|
|
542
|
+
"attachManager": "Менеджер",
|
|
541
543
|
"agent": "Агент"
|
|
542
544
|
},
|
|
543
545
|
"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": "Рассчитать премию",
|
|
@@ -537,7 +539,7 @@
|
|
|
537
539
|
"otpCode": "Код подтверждения",
|
|
538
540
|
"salesChanell": " Канал продаж",
|
|
539
541
|
"manager": "Менеджер",
|
|
540
|
-
"attachManager": "
|
|
542
|
+
"attachManager": "Менеджер",
|
|
541
543
|
"agent": "Агент"
|
|
542
544
|
},
|
|
543
545
|
"agreementBlock": {
|
package/package.json
CHANGED
package/store/data.store.js
CHANGED
|
@@ -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(
|
|
731
|
-
user.
|
|
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('
|
|
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('
|
|
2226
|
+
this.showToaster('error', `${gbdResponse.statusName}. Отправьте запрос еще раз`, 5000);
|
|
2227
|
+
return null;
|
|
2222
2228
|
} else {
|
|
2223
|
-
this.showToaster('
|
|
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;
|
package/store/member.store.ts
CHANGED
|
@@ -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'
|
|
39
|
-
|
|
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 =
|
|
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 {
|