hl-core 0.0.10-beta.43 → 0.0.10-beta.45
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 +10 -3
- package/components/Pages/Anketa.vue +49 -16
- package/components/Pages/Documents.vue +5 -5
- package/components/Pages/MemberForm.vue +6 -6
- package/components/Pages/ProductConditions.vue +20 -4
- package/components/Panel/PanelHandler.vue +6 -6
- package/composables/classes.ts +5 -5
- package/composables/index.ts +3 -5
- package/locales/ru.json +1 -0
- package/package.json +1 -1
- package/store/data.store.ts +42 -14
- package/types/index.ts +2 -2
package/api/base.api.ts
CHANGED
|
@@ -488,6 +488,13 @@ export class ApiClass {
|
|
|
488
488
|
url: `/${this.productUrl}/api/Application/IsRecalculate?processInstanceId=${id}`,
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
+
async checkCurrencyDate(id: string | number) {
|
|
492
|
+
return await this.axiosCall<boolean>({
|
|
493
|
+
method: Methods.GET,
|
|
494
|
+
url: '/Arm/api/Bpm/CheckCurrencyDate',
|
|
495
|
+
params: { processInstanceId: id },
|
|
496
|
+
});
|
|
497
|
+
}
|
|
491
498
|
async setMember(whichMember: keyof typeof MemberCodes, data: any) {
|
|
492
499
|
return await this.axiosCall({
|
|
493
500
|
method: Methods.POST,
|
|
@@ -1151,7 +1158,7 @@ export class ApiClass {
|
|
|
1151
1158
|
data: data,
|
|
1152
1159
|
});
|
|
1153
1160
|
},
|
|
1154
|
-
|
|
1161
|
+
generalGetDoc: async (groupId: string, documentSignType: number) => {
|
|
1155
1162
|
return await this.axiosCall<any>({
|
|
1156
1163
|
method: Methods.GET,
|
|
1157
1164
|
url: `${this.file.base}/api/GeneralSign/Group/${groupId}/${documentSignType} `,
|
|
@@ -1203,7 +1210,7 @@ export class ApiClass {
|
|
|
1203
1210
|
data: data,
|
|
1204
1211
|
});
|
|
1205
1212
|
},
|
|
1206
|
-
|
|
1213
|
+
getDoc: async (id: string) => {
|
|
1207
1214
|
return await this.axiosCall({
|
|
1208
1215
|
method: Methods.GET,
|
|
1209
1216
|
url: `${this.file.base}/api/Data/DownloadFile/${id}`,
|
|
@@ -1213,7 +1220,7 @@ export class ApiClass {
|
|
|
1213
1220
|
},
|
|
1214
1221
|
});
|
|
1215
1222
|
},
|
|
1216
|
-
|
|
1223
|
+
getDocNew: async (id: string) => {
|
|
1217
1224
|
return await this.axiosCall({
|
|
1218
1225
|
method: Methods.GET,
|
|
1219
1226
|
url: `${this.file.base}/api/GeneralSign/DownloadFile/${id}`,
|
|
@@ -28,6 +28,17 @@
|
|
|
28
28
|
:rules="$rules.required"
|
|
29
29
|
/>
|
|
30
30
|
</section>
|
|
31
|
+
<section
|
|
32
|
+
v-if="surveyType === 'critical' && ($dataStore.isBaiterek || $dataStore.isBolashak || $dataStore.isLiferenta)"
|
|
33
|
+
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
34
|
+
class="mx-[10px] p-4 flex flex-col gap-4"
|
|
35
|
+
>
|
|
36
|
+
<base-form-text-section>
|
|
37
|
+
<span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
|
|
38
|
+
1. Келесі аурулармен бұрын ауырдыңыз ба немесе қазіргі кезде ауырып жүрсіз бе?/Болели ли Вы когда-нибудь или болеете в настоящий момент следующими заболеваниями?
|
|
39
|
+
</span>
|
|
40
|
+
</base-form-text-section>
|
|
41
|
+
</section>
|
|
31
42
|
<section
|
|
32
43
|
v-if="firstQuestions.filter(i => i.first.definedAnswers === 'Y').length"
|
|
33
44
|
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
@@ -40,7 +51,7 @@
|
|
|
40
51
|
>
|
|
41
52
|
<base-animation>
|
|
42
53
|
<div
|
|
43
|
-
v-if="question.first.answerName
|
|
54
|
+
v-if="question.first.answerName?.includes('Да') && question.second"
|
|
44
55
|
:class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
|
|
45
56
|
class="rounded-t-lg pl-6 py-1 cursor-pointer"
|
|
46
57
|
@click="openFirstPanel(question)"
|
|
@@ -52,7 +63,7 @@
|
|
|
52
63
|
{{ question.first.name }}
|
|
53
64
|
<base-animation>
|
|
54
65
|
<i
|
|
55
|
-
v-if="question.first.answerName
|
|
66
|
+
v-if="question.first.answerName?.includes('Да') && question.second && question.second.length"
|
|
56
67
|
class="mdi mdi-chevron-right text-2xl cursor-pointer"
|
|
57
68
|
@click="openFirstPanel(question)"
|
|
58
69
|
></i>
|
|
@@ -68,8 +79,8 @@
|
|
|
68
79
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
69
80
|
inline
|
|
70
81
|
>
|
|
71
|
-
<v-radio label="
|
|
72
|
-
<v-radio label="
|
|
82
|
+
<v-radio label="Иә/Да" value="Иә/Да" :value-comparator="(a: any, b: any) => String(a).includes('Да')" />
|
|
83
|
+
<v-radio label="Жоқ/Нет" value="Жоқ/Нет" :value-comparator="(a: any, b: any) => String(a).includes('Нет')" />
|
|
73
84
|
</v-radio-group>
|
|
74
85
|
</div>
|
|
75
86
|
</base-form-text-section>
|
|
@@ -84,7 +95,26 @@
|
|
|
84
95
|
:key="index"
|
|
85
96
|
:class="[currentQuestion?.first.id === question.first.id && $dataStore.rightPanel.open ? $styles.greenBorder : '']"
|
|
86
97
|
>
|
|
87
|
-
<
|
|
98
|
+
<base-animation>
|
|
99
|
+
<div
|
|
100
|
+
v-if="question.first.answerName?.includes('Да') && question.second"
|
|
101
|
+
:class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
|
|
102
|
+
class="rounded-t-lg pl-6 py-1 cursor-pointer"
|
|
103
|
+
@click="openFirstPanel(question)"
|
|
104
|
+
>
|
|
105
|
+
{{ $dataStore.t('questionnaireType.pleaseAnswer', { text: question.second.length }) }}
|
|
106
|
+
</div>
|
|
107
|
+
</base-animation>
|
|
108
|
+
<span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
|
|
109
|
+
{{ question.first.name }}
|
|
110
|
+
<base-animation>
|
|
111
|
+
<i
|
|
112
|
+
v-if="question.first.answerName?.includes('Да') && question.second && question.second.length"
|
|
113
|
+
class="mdi mdi-chevron-right text-2xl cursor-pointer"
|
|
114
|
+
@click="openFirstPanel(question)"
|
|
115
|
+
></i>
|
|
116
|
+
</base-animation>
|
|
117
|
+
</span>
|
|
88
118
|
<div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
|
|
89
119
|
<v-radio-group
|
|
90
120
|
v-model="question.first.answerName"
|
|
@@ -95,12 +125,12 @@
|
|
|
95
125
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
96
126
|
inline
|
|
97
127
|
>
|
|
98
|
-
<v-radio label="
|
|
99
|
-
<v-radio label="
|
|
128
|
+
<v-radio label="Иә/Да" value="Иә/Да" :value-comparator="(a: any, b: any) => String(a).includes('Да')" />
|
|
129
|
+
<v-radio label="Жоқ/Нет" value="Жоқ/Нет" :value-comparator="(a: any, b: any) => String(a).includes('Нет')" />
|
|
100
130
|
</v-radio-group>
|
|
101
131
|
</div>
|
|
102
132
|
<base-animation>
|
|
103
|
-
<div v-if="question.first.answerName
|
|
133
|
+
<div v-if="question.first.answerName?.includes('Да')" :class="[$styles.whiteText, $styles.textSimple]">
|
|
104
134
|
<base-form-input
|
|
105
135
|
v-model="question.first.answerText"
|
|
106
136
|
:label="$dataStore.t('labels.inDetails')"
|
|
@@ -252,11 +282,11 @@ export default defineComponent({
|
|
|
252
282
|
const answerToAll = ref<boolean>(false);
|
|
253
283
|
const firstPanel = ref<boolean>(false);
|
|
254
284
|
const secondPanel = ref<boolean>(false);
|
|
255
|
-
const filterType = ref<'
|
|
285
|
+
const filterType = ref<'Иә/Да' | 'Жоқ/Нет' | null>(null);
|
|
256
286
|
const filterItems = [
|
|
257
287
|
{ title: 'Все', value: null },
|
|
258
|
-
{ title: 'Только «Да»', value: '
|
|
259
|
-
{ title: 'Только «Нет»', value: '
|
|
288
|
+
{ title: 'Только «Да»', value: 'Иә/Да' },
|
|
289
|
+
{ title: 'Только «Нет»', value: 'Жоқ/Нет' },
|
|
260
290
|
];
|
|
261
291
|
const surveyType = ref<'health' | 'critical'>('tab' in route.query && route.query.tab === 'criticalBase' ? 'critical' : 'health');
|
|
262
292
|
const whichSurvey = computed(() =>
|
|
@@ -277,7 +307,9 @@ export default defineComponent({
|
|
|
277
307
|
|
|
278
308
|
const whichMember = computed(() => ('member' in route.query && !!route.query.member ? (route.query.member as 'insured' | 'policyholder') : 'insured'));
|
|
279
309
|
const isSecondRequired = computed(() => dataStore.controls.isSecondAnketaRequired);
|
|
280
|
-
const firstQuestions = computed(() =>
|
|
310
|
+
const firstQuestions = computed(() =>
|
|
311
|
+
filterType.value !== null ? firstQuestionList.value.filter(i => i.first.answerName?.includes(filterType.value === 'Иә/Да' ? 'Да' : 'Нет')) : firstQuestionList.value,
|
|
312
|
+
);
|
|
281
313
|
const scrollForm = (direction: 'up' | 'down') => {
|
|
282
314
|
const scrollObject = { top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' };
|
|
283
315
|
if (firstPanel.value) {
|
|
@@ -423,12 +455,12 @@ export default defineComponent({
|
|
|
423
455
|
if (answerToAll.value) {
|
|
424
456
|
firstQuestionList.value.forEach((question: AnketaBody, index: number) => {
|
|
425
457
|
if (question.first.answerType === 'T' || question.first.answerType === 'D') {
|
|
426
|
-
firstQuestionList.value![index].first.answerName = '
|
|
458
|
+
firstQuestionList.value![index].first.answerName = 'Жоқ/Нет' as AnswerName;
|
|
427
459
|
}
|
|
428
460
|
});
|
|
429
461
|
for (const question of firstQuestionList.value) {
|
|
430
462
|
const index = firstQuestionList.value.indexOf(question);
|
|
431
|
-
await getDefinedAnswerId(question.first.id, '
|
|
463
|
+
await getDefinedAnswerId(question.first.id, 'Жоқ/Нет', index);
|
|
432
464
|
}
|
|
433
465
|
} else {
|
|
434
466
|
firstQuestionList.value.forEach((question: AnketaBody, index: number) => {
|
|
@@ -454,7 +486,7 @@ export default defineComponent({
|
|
|
454
486
|
);
|
|
455
487
|
firstQuestionList.value = formStore[whichSurvey.value]!.body;
|
|
456
488
|
formStore[whichSurvey.value]!.type = surveyType.value;
|
|
457
|
-
const negativeAnswer = firstQuestionList.value.every(i => i.first.answerName
|
|
489
|
+
const negativeAnswer = firstQuestionList.value.every(i => i.first.answerName?.includes('Нет'));
|
|
458
490
|
if (negativeAnswer) {
|
|
459
491
|
answerToAll.value = true;
|
|
460
492
|
}
|
|
@@ -488,7 +520,7 @@ export default defineComponent({
|
|
|
488
520
|
() => firstQuestionList.value,
|
|
489
521
|
value => {
|
|
490
522
|
if (value) {
|
|
491
|
-
const hasPositiveAnswer = value.some(i => (i.first.definedAnswers === 'Y' || i.first.definedAnswers === 'D') && i.first.answerName
|
|
523
|
+
const hasPositiveAnswer = value.some(i => (i.first.definedAnswers === 'Y' || i.first.definedAnswers === 'D') && !i.first.answerName?.includes('Нет'));
|
|
492
524
|
answerToAll.value = !hasPositiveAnswer;
|
|
493
525
|
}
|
|
494
526
|
},
|
|
@@ -510,6 +542,7 @@ export default defineComponent({
|
|
|
510
542
|
firstPanel,
|
|
511
543
|
filterType,
|
|
512
544
|
filterItems,
|
|
545
|
+
surveyType,
|
|
513
546
|
secondPanel,
|
|
514
547
|
currentQuestion,
|
|
515
548
|
currentSecond,
|
|
@@ -199,10 +199,10 @@
|
|
|
199
199
|
:disabled="documentLoading"
|
|
200
200
|
:loading="documentLoading"
|
|
201
201
|
text="Открыть"
|
|
202
|
-
@click="
|
|
202
|
+
@click="getDoc('view')"
|
|
203
203
|
/>
|
|
204
204
|
</base-animation>
|
|
205
|
-
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="
|
|
205
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download')" />
|
|
206
206
|
<base-animation>
|
|
207
207
|
<base-btn v-if="canDeleteFiles" :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
|
|
208
208
|
</base-animation>
|
|
@@ -478,11 +478,11 @@ export default defineComponent({
|
|
|
478
478
|
},
|
|
479
479
|
);
|
|
480
480
|
|
|
481
|
-
const
|
|
481
|
+
const getDoc = async (type: FileActions) => {
|
|
482
482
|
if (currentDocument.value) {
|
|
483
483
|
documentLoading.value = true;
|
|
484
484
|
const fileExtension = currentDocument.value.fileName!.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)![1];
|
|
485
|
-
await dataStore.
|
|
485
|
+
await dataStore.getDoc(currentDocument.value, type, fileExtension);
|
|
486
486
|
documentLoading.value = false;
|
|
487
487
|
}
|
|
488
488
|
};
|
|
@@ -672,7 +672,7 @@ export default defineComponent({
|
|
|
672
672
|
|
|
673
673
|
// Functions
|
|
674
674
|
getCode,
|
|
675
|
-
|
|
675
|
+
getDoc,
|
|
676
676
|
openPanel,
|
|
677
677
|
deleteFile,
|
|
678
678
|
getDigitalDocument,
|
|
@@ -702,8 +702,8 @@
|
|
|
702
702
|
</Teleport>
|
|
703
703
|
<Teleport v-if="isDocumentOpen" to="#right-panel-actions">
|
|
704
704
|
<div :class="[$styles.flexColNav]">
|
|
705
|
-
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="
|
|
706
|
-
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="
|
|
705
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getDoc('view')" />
|
|
706
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download')" />
|
|
707
707
|
</div>
|
|
708
708
|
</Teleport>
|
|
709
709
|
<Teleport v-if="isOtpPanelOpen && !member.hasAgreement" to="#right-panel-actions">
|
|
@@ -1414,11 +1414,11 @@ export default {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
};
|
|
1416
1416
|
|
|
1417
|
-
const
|
|
1417
|
+
const getDoc = async (type: FileActions) => {
|
|
1418
1418
|
if (memberDocument.value) {
|
|
1419
1419
|
documentLoading.value = true;
|
|
1420
1420
|
const fileExtension = memberDocument.value.fileName!.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)![1];
|
|
1421
|
-
await dataStore.
|
|
1421
|
+
await dataStore.getDoc(memberDocument.value, type, fileExtension);
|
|
1422
1422
|
documentLoading.value = false;
|
|
1423
1423
|
}
|
|
1424
1424
|
};
|
|
@@ -1977,7 +1977,7 @@ export default {
|
|
|
1977
1977
|
member.value.documentDate = reformatDate(userDocument.issueDate);
|
|
1978
1978
|
member.value.documentExpire = reformatDate(userDocument.expireDate);
|
|
1979
1979
|
}
|
|
1980
|
-
// const filteredDocuments: DocumentItem[] = dataStore.
|
|
1980
|
+
// const filteredDocuments: DocumentItem[] = dataStore.getDocsByIIN(member.value.iin!.replace(/-/g, '')) as DocumentItem[];
|
|
1981
1981
|
// if (filteredDocuments && filteredDocuments.length) memberDocument.value = filteredDocuments[0];
|
|
1982
1982
|
}
|
|
1983
1983
|
await setDefaultValues();
|
|
@@ -2223,7 +2223,7 @@ export default {
|
|
|
2223
2223
|
attachFile,
|
|
2224
2224
|
attachDocumentReader,
|
|
2225
2225
|
getDocumentReader,
|
|
2226
|
-
|
|
2226
|
+
getDoc,
|
|
2227
2227
|
selectFamilyMember,
|
|
2228
2228
|
closeFamilyDialog,
|
|
2229
2229
|
openDeletionDialog,
|
|
@@ -55,7 +55,10 @@
|
|
|
55
55
|
<base-form-input v-model="insured.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
56
56
|
</div>
|
|
57
57
|
</base-form-section>
|
|
58
|
-
<base-form-section
|
|
58
|
+
<base-form-section
|
|
59
|
+
v-if="isUnderwriterRole && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam' && whichProduct !== 'tumar'"
|
|
60
|
+
:title="$dataStore.t('recalculationInfo')"
|
|
61
|
+
>
|
|
59
62
|
<base-form-input
|
|
60
63
|
v-model="productConditionsForm.lifeMultiply"
|
|
61
64
|
:maska="$maska.numbers"
|
|
@@ -323,7 +326,7 @@
|
|
|
323
326
|
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
324
327
|
:readonly="isDisabledAgentCommission"
|
|
325
328
|
:clearable="!isDisabledAgentCommission"
|
|
326
|
-
:rules="formStore.lfb.add ? $rules.required
|
|
329
|
+
:rules="!formStore.lfb.add ? $rules.required.concat($rules.numbers, $rules.agentCommission) : productConditionsForm.agentCommission === 0 ? [] : $rules.required"
|
|
327
330
|
/>
|
|
328
331
|
</base-form-section>
|
|
329
332
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
@@ -504,7 +507,7 @@
|
|
|
504
507
|
<base-form-input
|
|
505
508
|
v-model="contractDate"
|
|
506
509
|
:maska="$maska.date"
|
|
507
|
-
:rules="!isDisabled ? $rules.required.concat($rules.date) : []"
|
|
510
|
+
:rules="!isDisabled ? $rules.required.concat($rules.date, [validateContractDate]) : []"
|
|
508
511
|
:readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
|
|
509
512
|
:clearable="!isDisabled"
|
|
510
513
|
:min-date="new Date()"
|
|
@@ -1838,6 +1841,14 @@ export default defineComponent({
|
|
|
1838
1841
|
return formatedContracts;
|
|
1839
1842
|
};
|
|
1840
1843
|
|
|
1844
|
+
const validateContractDate = (v: any) => {
|
|
1845
|
+
if (v && maxDate.value && formatDate(v) && formatDate(maxDate.value)) {
|
|
1846
|
+
const invalidDate = (formatDate(v) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
1847
|
+
if (invalidDate) return 'Дата заключения договора некорректна';
|
|
1848
|
+
}
|
|
1849
|
+
return true;
|
|
1850
|
+
};
|
|
1851
|
+
|
|
1841
1852
|
const submitForm = async () => {
|
|
1842
1853
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
1843
1854
|
if (v.valid) {
|
|
@@ -2147,7 +2158,11 @@ export default defineComponent({
|
|
|
2147
2158
|
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
2148
2159
|
await dataStore.getProcessPaymentPeriod();
|
|
2149
2160
|
}
|
|
2150
|
-
if (
|
|
2161
|
+
if (
|
|
2162
|
+
formStore.productConditionsForm.requestedSumInsured === null &&
|
|
2163
|
+
formStore.productConditionsForm.insurancePremiumPerMonth === null &&
|
|
2164
|
+
(whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons')
|
|
2165
|
+
) {
|
|
2151
2166
|
await dataStore.getCurrencies();
|
|
2152
2167
|
}
|
|
2153
2168
|
if (whichProduct.value === 'halykkazyna') {
|
|
@@ -2474,6 +2489,7 @@ export default defineComponent({
|
|
|
2474
2489
|
underwriterCalculate,
|
|
2475
2490
|
onInputInsurancePremiumPerMonth,
|
|
2476
2491
|
onInputInsurancePremiumPerMonthInDollar,
|
|
2492
|
+
validateContractDate,
|
|
2477
2493
|
onInputSum,
|
|
2478
2494
|
onInputPension,
|
|
2479
2495
|
onInputSumDollar,
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
>
|
|
24
24
|
</base-content-block>
|
|
25
25
|
<div class="flex flex-col gap-3" v-if="hasConditionsAction">
|
|
26
|
-
<base-btn :text="$dataStore.t('confirm.yes')" :loading="
|
|
27
|
-
<base-btn :btn="$styles.blueLightBtn" :loading="
|
|
26
|
+
<base-btn :text="$dataStore.t('confirm.yes')" :loading="$dataStore.isButtonsLoading" @click="handleTask" />
|
|
27
|
+
<base-btn :btn="$styles.blueLightBtn" :loading="$dataStore.isButtonsLoading" :text="$dataStore.t('confirm.no')" @click="closePanel" />
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
</section>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<div v-if="isScansDocuments" :class="[$styles.flexColNav]">
|
|
42
42
|
<div v-if="isNewSign">
|
|
43
43
|
<div class="flex flex-col gap-2">
|
|
44
|
-
<base-btn v-for="file in signingFiles" :text="`Скачать ${file.fileName}`" :loading="$dataStore.isButtonsLoading" @click="
|
|
44
|
+
<base-btn v-for="file in signingFiles" :text="`Скачать ${file.fileName}`" :loading="$dataStore.isButtonsLoading" @click="getDocNew(file)" />
|
|
45
45
|
<base-form-section class="mt-4 flex flex-col !gap-2" :title="$dataStore.t('clients.attachScansSignDocs')">
|
|
46
46
|
<base-file-input v-for="file in signingFiles" :label="`Вложить ${file.fileName}`" @input.prevent="onFileChangeScansNew($event, file)" @onClear="onClearFileNew(file)" />
|
|
47
47
|
</base-form-section>
|
|
@@ -346,9 +346,9 @@ export default defineComponent({
|
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
-
const
|
|
349
|
+
const getDocNew = async (file: any) => {
|
|
350
350
|
const newFile = signOptions.value?.signIds.find((i: any) => i.fileType == file.fileType);
|
|
351
|
-
if (newFile) await dataStore.
|
|
351
|
+
if (newFile) await dataStore.getDocNew(newFile.id, 2, false, file.fileName);
|
|
352
352
|
};
|
|
353
353
|
|
|
354
354
|
const onFileChangeScansNew = async (event: InputEvent, file: any) => {
|
|
@@ -1013,7 +1013,7 @@ export default defineComponent({
|
|
|
1013
1013
|
newSign,
|
|
1014
1014
|
onFileChangeScansNew,
|
|
1015
1015
|
onClearFileNew,
|
|
1016
|
-
|
|
1016
|
+
getDocNew,
|
|
1017
1017
|
inSigningOrder,
|
|
1018
1018
|
isNewSign,
|
|
1019
1019
|
hasEpayPay,
|
package/composables/classes.ts
CHANGED
|
@@ -327,10 +327,9 @@ class Person {
|
|
|
327
327
|
getAgeByBirthDate() {
|
|
328
328
|
const date = this.formatDate(this.birthDate);
|
|
329
329
|
if (date) {
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
330
|
+
const birthDate = new Date(date);
|
|
331
|
+
const today = new Date();
|
|
332
|
+
return String(today.getFullYear() - birthDate.getFullYear() - (today < new Date(today.getFullYear(), birthDate.getMonth(), birthDate.getDate()) ? 1 : 0));
|
|
334
333
|
} else {
|
|
335
334
|
return null;
|
|
336
335
|
}
|
|
@@ -1715,7 +1714,7 @@ export class PhysGroupClass extends BaseGroupClass {
|
|
|
1715
1714
|
|
|
1716
1715
|
export class GroupMember extends PhysGroupClass {
|
|
1717
1716
|
isLeader: boolean;
|
|
1718
|
-
|
|
1717
|
+
organizationStartDate: string;
|
|
1719
1718
|
typeOfEconomicActivity: Value;
|
|
1720
1719
|
activityTypes: { activityTypeName: string; empoloyeeCount: number }[];
|
|
1721
1720
|
beneficalOwnerQuest: { order: number; text: string; answer: boolean | null }[];
|
|
@@ -1726,6 +1725,7 @@ export class GroupMember extends PhysGroupClass {
|
|
|
1726
1725
|
super();
|
|
1727
1726
|
// Client
|
|
1728
1727
|
this.isLeader = false;
|
|
1728
|
+
this.organizationStartDate = '';
|
|
1729
1729
|
this.typeOfEconomicActivity = new Value();
|
|
1730
1730
|
this.activityTypes = [];
|
|
1731
1731
|
this.beneficalOwnerQuest = [
|
package/composables/index.ts
CHANGED
|
@@ -892,14 +892,10 @@ export class RoleController {
|
|
|
892
892
|
this.isUSNSsanctioner() ||
|
|
893
893
|
this.isUnderwriter() ||
|
|
894
894
|
this.isActuary() ||
|
|
895
|
-
this.isAdmin() ||
|
|
896
895
|
this.isCompliance() ||
|
|
897
|
-
this.isAnalyst() ||
|
|
898
896
|
this.isUpk() ||
|
|
899
897
|
this.isFinCenter() ||
|
|
900
898
|
this.isSupervisor() ||
|
|
901
|
-
this.isSupport() ||
|
|
902
|
-
this.isDrn() ||
|
|
903
899
|
this.isUrp() ||
|
|
904
900
|
this.isUsns() ||
|
|
905
901
|
this.isJurist() ||
|
|
@@ -916,7 +912,9 @@ export class RoleController {
|
|
|
916
912
|
this.isExecutor() ||
|
|
917
913
|
this.isArchivist() ||
|
|
918
914
|
this.isUKP() ||
|
|
919
|
-
this.isDpDirector()
|
|
915
|
+
this.isDpDirector() ||
|
|
916
|
+
this.isSecurity() ||
|
|
917
|
+
baseAccessRoles,
|
|
920
918
|
};
|
|
921
919
|
};
|
|
922
920
|
}
|
package/locales/ru.json
CHANGED
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
"successfullyDocSent": "Отправка документа прошла успешно",
|
|
135
135
|
"templateDownloaded": "Шаблон скачан",
|
|
136
136
|
"templateSentToEmail": "Шаблона отправлен на почту",
|
|
137
|
+
"fileOnlyBelow3mb": "Максимальный размер документа для загрузки - 3 МБ.",
|
|
137
138
|
"fileOnlyBelow5mb": "Максимальный размер документа для загрузки - 5 МБ.",
|
|
138
139
|
"fileOnlyBelow10mb": "Максимальный размер документа для загрузки - 10 МБ.",
|
|
139
140
|
"fileOnlyBelow20mb": "Максимальный размер документа для загрузки - 20 МБ.",
|
package/package.json
CHANGED
package/store/data.store.ts
CHANGED
|
@@ -145,7 +145,7 @@ export const useDataStore = defineStore('data', {
|
|
|
145
145
|
if (showError) this.showToaster('error', this.t('toaster.noUrl'));
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
|
-
|
|
148
|
+
getDocsByIIN(iin: string) {
|
|
149
149
|
return iin ? this.formStore.signedDocumentList.filter(file => file.iin === iin && file.fileTypeName === 'Удостоверение личности') : null;
|
|
150
150
|
},
|
|
151
151
|
async getNewAccessToken() {
|
|
@@ -279,12 +279,12 @@ export const useDataStore = defineStore('data', {
|
|
|
279
279
|
await this.router.replace({ name: route.name });
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
|
-
async
|
|
282
|
+
async getDoc(file: DocumentItem, mode: string = 'view', fileType: string = 'pdf') {
|
|
283
283
|
if (!file.id) return;
|
|
284
284
|
try {
|
|
285
285
|
this.isLoading = true;
|
|
286
286
|
if (this.isPension) {
|
|
287
|
-
await this.api.file.
|
|
287
|
+
await this.api.file.getDocNew(file.id).then((response: any) => {
|
|
288
288
|
if (!['pdf', 'docx'].includes(fileType)) {
|
|
289
289
|
const blob = new Blob([response], { type: `image/${fileType}` });
|
|
290
290
|
const url = window.URL.createObjectURL(blob);
|
|
@@ -318,7 +318,7 @@ export const useDataStore = defineStore('data', {
|
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
320
|
} else {
|
|
321
|
-
await this.api.file.
|
|
321
|
+
await this.api.file.getDoc(file.id).then((response: any) => {
|
|
322
322
|
if (!['pdf', 'docx'].includes(fileType)) {
|
|
323
323
|
const blob = new Blob([response], { type: `image/${fileType}` });
|
|
324
324
|
const url = window.URL.createObjectURL(blob);
|
|
@@ -358,10 +358,12 @@ export const useDataStore = defineStore('data', {
|
|
|
358
358
|
this.isLoading = false;
|
|
359
359
|
}
|
|
360
360
|
},
|
|
361
|
-
async deleteFile(data: DocumentItem) {
|
|
361
|
+
async deleteFile(data: DocumentItem, showToaster: boolean = true) {
|
|
362
362
|
try {
|
|
363
363
|
await this.api.file.deleteFile(data);
|
|
364
|
-
|
|
364
|
+
if (showToaster) {
|
|
365
|
+
this.showToaster('success', this.t('toaster.fileWasDeleted'), 3000);
|
|
366
|
+
}
|
|
365
367
|
} catch (err) {
|
|
366
368
|
ErrorHandler(err);
|
|
367
369
|
}
|
|
@@ -1616,16 +1618,19 @@ export const useDataStore = defineStore('data', {
|
|
|
1616
1618
|
if (secondaryQuestions.status === 'fulfilled') {
|
|
1617
1619
|
const baseAnketa = this.formStore[baseField];
|
|
1618
1620
|
if (baseAnketa && baseAnketa.body && baseAnketa.body.length) {
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1621
|
+
const isSpecialSurvey = this.isBaiterek || this.isBolashak || this.isLiferenta;
|
|
1622
|
+
for (const i of baseAnketa.body) {
|
|
1623
|
+
if (i.second === null && secondaryQuestions.value) {
|
|
1624
|
+
i.second = isSpecialSurvey
|
|
1625
|
+
? await this.api.getQuestionListSecondById(`${surveyType}second`, processInstanceId, insuredId, i.first.id)
|
|
1626
|
+
: structuredClone(secondaryQuestions.value);
|
|
1622
1627
|
}
|
|
1623
1628
|
if (i.first.definedAnswers === 'Y' && i.second && i.second.length) {
|
|
1624
1629
|
i.second.forEach(second => {
|
|
1625
1630
|
if (second.answerType === 'D') second.answerText = reformatDate(String(second.answerText));
|
|
1626
1631
|
});
|
|
1627
1632
|
}
|
|
1628
|
-
}
|
|
1633
|
+
}
|
|
1629
1634
|
}
|
|
1630
1635
|
}
|
|
1631
1636
|
} catch (err) {
|
|
@@ -2468,6 +2473,9 @@ export const useDataStore = defineStore('data', {
|
|
|
2468
2473
|
this.formStore.applicationData.processCode === constants.products.halykkazynaap
|
|
2469
2474
|
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.premiumInCurrency)
|
|
2470
2475
|
: this.getNumberWithSpaces(applicationData.policyAppDto.premiumInCurrency);
|
|
2476
|
+
if (applicationData.policyAppDto.currency === 'USD' && applicationData.policyAppDto.amount !== null && applicationData.policyAppDto.premium !== null) {
|
|
2477
|
+
this.currencies.usd = applicationData.policyAppDto.currencyExchangeRate;
|
|
2478
|
+
}
|
|
2471
2479
|
}
|
|
2472
2480
|
const riskGroup = this.riskGroup.find(item => {
|
|
2473
2481
|
if (applicationData.policyAppDto.riskGroup == 0) {
|
|
@@ -2800,7 +2808,7 @@ export const useDataStore = defineStore('data', {
|
|
|
2800
2808
|
await ncaLayerClient.connect();
|
|
2801
2809
|
const activeTokens = await ncaLayerClient.getActiveTokens();
|
|
2802
2810
|
const storageType = activeTokens[0] || NCALayerClient.fileStorageType;
|
|
2803
|
-
const document = await this.
|
|
2811
|
+
const document = await this.getDocNew(groupId, signType, isXml);
|
|
2804
2812
|
if (isXml) {
|
|
2805
2813
|
const signedAgreement = await ncaLayerClient.signXml(storageType, document, 'SIGNATURE', '');
|
|
2806
2814
|
const data = new FormData();
|
|
@@ -2819,9 +2827,9 @@ export const useDataStore = defineStore('data', {
|
|
|
2819
2827
|
return err.name === 'NCALayerError' ? null : ErrorHandler(err);
|
|
2820
2828
|
}
|
|
2821
2829
|
},
|
|
2822
|
-
async
|
|
2830
|
+
async getDocNew(groupId: string, documentSignType: number, xml: boolean, fileName?: string) {
|
|
2823
2831
|
try {
|
|
2824
|
-
let response: any = await this.api.file.
|
|
2832
|
+
let response: any = await this.api.file.generalGetDoc(groupId, xml ? 5 : documentSignType);
|
|
2825
2833
|
let blob;
|
|
2826
2834
|
if (response.hasOwnProperty('data')) {
|
|
2827
2835
|
const document = JSON.parse(response.data).Document;
|
|
@@ -3680,6 +3688,24 @@ export const useDataStore = defineStore('data', {
|
|
|
3680
3688
|
});
|
|
3681
3689
|
}
|
|
3682
3690
|
},
|
|
3691
|
+
uniqPreparePersonData(local: GroupMember) {
|
|
3692
|
+
const checkForNull = (value: any) => (value ? value : '');
|
|
3693
|
+
try {
|
|
3694
|
+
(Object.keys(local) as Array<keyof GroupMember>).forEach(key => {
|
|
3695
|
+
if (key === 'actualAddress' || key === 'legalAddress') {
|
|
3696
|
+
const address = `${checkForNull(local[key].country.nameRu)}, ${checkForNull(local[key].state.nameRu)},${
|
|
3697
|
+
local[key].region.nameRu ? ` ${local[key].region.nameRu},` : ''
|
|
3698
|
+
} ${checkForNull(local[key].regionType.nameRu)} ${checkForNull(local[key].city.nameRu)},${local[key].square ? ` квартал ${local[key].square},` : ''}${
|
|
3699
|
+
local[key].microdistrict ? ` мкр ${local[key].microdistrict},` : ''
|
|
3700
|
+
} ул. ${checkForNull(local[key].street)}, д. ${checkForNull(local[key].houseNumber)}`;
|
|
3701
|
+
local[key].longName = address;
|
|
3702
|
+
local[key].longNameKz = address;
|
|
3703
|
+
}
|
|
3704
|
+
});
|
|
3705
|
+
} catch (e) {
|
|
3706
|
+
ErrorHandler(e);
|
|
3707
|
+
}
|
|
3708
|
+
},
|
|
3683
3709
|
async startApplicationV2(data: PolicyholderClass) {
|
|
3684
3710
|
const policyholder = JSON.parse(JSON.stringify(data)) as any;
|
|
3685
3711
|
this.preparePersonData(policyholder);
|
|
@@ -3699,6 +3725,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3699
3725
|
'clientData.authoritedPerson.addTaxResidency',
|
|
3700
3726
|
]);
|
|
3701
3727
|
policyholder.clientData.authoritedPerson.gender = policyholder.clientData.authoritedPerson.gender.nameRu === 'Мужской' ? 1 : 2;
|
|
3728
|
+
this.uniqPreparePersonData(policyholder.clientData);
|
|
3702
3729
|
if (this.formStore.lfb.add) {
|
|
3703
3730
|
policyholder.parentContractNumber = localStorage.getItem('policyNo');
|
|
3704
3731
|
policyholder.parentContractId = localStorage.getItem('policyId');
|
|
@@ -3715,6 +3742,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3715
3742
|
const policyholder = JSON.parse(JSON.stringify(data)) as any;
|
|
3716
3743
|
policyholder.clientData.authoritedPerson.gender = policyholder.clientData.authoritedPerson.gender.nameRu === 'Мужской' ? 1 : 2;
|
|
3717
3744
|
this.preparePersonData(policyholder);
|
|
3745
|
+
this.uniqPreparePersonData(policyholder.clientData);
|
|
3718
3746
|
try {
|
|
3719
3747
|
await this.api.saveClient(this.formStore.applicationData.processInstanceId, this.formStore.lfb.clientId, policyholder);
|
|
3720
3748
|
} catch (err) {
|
|
@@ -3799,7 +3827,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3799
3827
|
|
|
3800
3828
|
this.formStore.productConditionsForm.calcDate = reformatDate(applicationData.policyAppDto.calcDate);
|
|
3801
3829
|
this.formStore.productConditionsForm.contractEndDate = reformatDate(applicationData.policyAppDto.contractEndDate);
|
|
3802
|
-
this.formStore.productConditionsForm.agentCommission = applicationData.policyAppDto.agentCommission
|
|
3830
|
+
this.formStore.productConditionsForm.agentCommission = applicationData.policyAppDto.agentCommission;
|
|
3803
3831
|
this.formStore.productConditionsForm.fixInsSum = this.getNumberWithSpaces(applicationData.policyAppDto.fixInsSum === 0 ? null : applicationData.policyAppDto.fixInsSum);
|
|
3804
3832
|
this.formStore.productConditionsForm.coverPeriod = 12;
|
|
3805
3833
|
this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(applicationData.policyAppDto.amount === 0 ? null : applicationData.policyAppDto.amount);
|