hl-core 0.0.9-beta.27 → 0.0.9-beta.29
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/Complex/MessageBlock.vue +1 -1
- package/components/Complex/Page.vue +1 -1
- package/components/Form/DynamicForm.vue +18 -0
- package/components/Form/ManagerAttachment.vue +51 -12
- package/components/Input/DynamicInput.vue +22 -0
- package/components/Input/FileInput.vue +8 -2
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +156 -0
- package/components/Layout/Drawer.vue +15 -3
- package/components/Layout/Header.vue +1 -1
- package/components/Layout/SettingsPanel.vue +1 -3
- package/components/Menu/MenuNav.vue +2 -2
- package/components/Pages/Anketa.vue +7 -7
- package/components/Pages/ContragentForm.vue +6 -6
- package/components/Pages/Documents.vue +4 -6
- package/components/Pages/MemberForm.vue +30 -30
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +22 -22
- package/components/Panel/PanelHandler.vue +88 -6
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/composables/classes.ts +101 -108
- package/composables/constants.ts +1 -1
- package/composables/index.ts +66 -0
- package/layouts/default.vue +42 -3
- package/locales/ru.json +56 -5
- package/package.json +1 -1
- package/store/data.store.ts +21 -15
- package/store/extractStore.ts +17 -0
- package/types/form.ts +73 -0
- package/types/index.ts +4 -3
|
@@ -517,7 +517,7 @@
|
|
|
517
517
|
</base-form-section>
|
|
518
518
|
</v-form>
|
|
519
519
|
<base-btn v-if="showSaveButton" :loading="isButtonLoading || isSubmittingForm" :text="$dataStore.t('buttons.save')" @click="submitForm" />
|
|
520
|
-
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
520
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
521
521
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
522
522
|
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
523
523
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
@@ -533,20 +533,20 @@
|
|
|
533
533
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
534
534
|
</div>
|
|
535
535
|
</Teleport>
|
|
536
|
-
<Teleport v-if="isSearchOpen" to="#panel-actions">
|
|
536
|
+
<Teleport v-if="isSearchOpen" to="#right-panel-actions">
|
|
537
537
|
<div :class="[$styles.flexColNav]">
|
|
538
538
|
<base-btn v-if="hasGBDFL" :loading="isButtonLoading" :text="$dataStore.t('buttons.fromGBDFL')" @click="getContragentFromGBDFL" />
|
|
539
539
|
<base-btn v-if="hasInsis" :loading="isButtonLoading" :text="$dataStore.t('buttons.fromInsis')" @click="getContragent" />
|
|
540
540
|
<base-btn v-if="hasGKB" :loading="isButtonLoading" :text="$dataStore.t('buttons.fromGKB')" @click="getFamilyInfo" />
|
|
541
541
|
</div>
|
|
542
542
|
</Teleport>
|
|
543
|
-
<Teleport v-if="isDocumentOpen" to="#panel-actions">
|
|
543
|
+
<Teleport v-if="isDocumentOpen" to="#right-panel-actions">
|
|
544
544
|
<div :class="[$styles.flexColNav]">
|
|
545
545
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
|
|
546
546
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
|
|
547
547
|
</div>
|
|
548
548
|
</Teleport>
|
|
549
|
-
<Teleport v-if="isOtpPanelOpen && !member.hasAgreement" to="#panel-actions">
|
|
549
|
+
<Teleport v-if="isOtpPanelOpen && !member.hasAgreement" to="#right-panel-actions">
|
|
550
550
|
<div :class="[$styles.flexColNav]">
|
|
551
551
|
<base-fade-transition>
|
|
552
552
|
<base-rounded-input
|
|
@@ -629,7 +629,7 @@ export default {
|
|
|
629
629
|
const isFromGBD = computed(() => !!member.value.gosPersonData);
|
|
630
630
|
const showSaveButton = computed(() => {
|
|
631
631
|
const generalCondition = !isDisabled.value && !!isTask.value && !!dataStore.isInitiator();
|
|
632
|
-
const
|
|
632
|
+
const perMemberCondition = () => {
|
|
633
633
|
switch (whichForm.value) {
|
|
634
634
|
case formStore.policyholderFormKey:
|
|
635
635
|
return true;
|
|
@@ -642,7 +642,7 @@ export default {
|
|
|
642
642
|
return false;
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
|
-
return generalCondition &&
|
|
645
|
+
return generalCondition && perMemberCondition();
|
|
646
646
|
});
|
|
647
647
|
|
|
648
648
|
const hasGBDFL = computed(() => {
|
|
@@ -741,7 +741,7 @@ export default {
|
|
|
741
741
|
|
|
742
742
|
const birthDateRule = computed(() => {
|
|
743
743
|
const baseDateRule = dataStore.rules.required.concat(dataStore.rules.birthDate);
|
|
744
|
-
const
|
|
744
|
+
const byMemberAndProductRule = () => {
|
|
745
745
|
if (whichForm.value === formStore.policyholderFormKey) {
|
|
746
746
|
if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek) {
|
|
747
747
|
return dataStore.rules.age18ByDate;
|
|
@@ -757,7 +757,7 @@ export default {
|
|
|
757
757
|
}
|
|
758
758
|
return [];
|
|
759
759
|
};
|
|
760
|
-
return baseDateRule.concat(
|
|
760
|
+
return baseDateRule.concat(byMemberAndProductRule());
|
|
761
761
|
});
|
|
762
762
|
const ageRule = computed(() => {
|
|
763
763
|
const baseAgeRule = dataStore.rules.numbers;
|
|
@@ -834,8 +834,8 @@ export default {
|
|
|
834
834
|
const searchMember = async () => {
|
|
835
835
|
if (!isDisabled.value) {
|
|
836
836
|
dataStore.panelAction = null;
|
|
837
|
-
dataStore.
|
|
838
|
-
dataStore.
|
|
837
|
+
dataStore.rightPanel.title = 'Поиск контрагента';
|
|
838
|
+
dataStore.rightPanel.open = true;
|
|
839
839
|
isSearchOpen.value = true;
|
|
840
840
|
isDocumentOpen.value = false;
|
|
841
841
|
isOtpPanelOpen.value = false;
|
|
@@ -852,20 +852,20 @@ export default {
|
|
|
852
852
|
const openCustomPanel = (type: 'document' | 'otp' = 'document') => {
|
|
853
853
|
dataStore.panelAction = null;
|
|
854
854
|
if (type === 'document' && memberDocument.value) {
|
|
855
|
-
dataStore.
|
|
855
|
+
dataStore.rightPanel.title = memberDocument.value.fileTypeName!;
|
|
856
856
|
isDocumentOpen.value = true;
|
|
857
857
|
isSearchOpen.value = false;
|
|
858
858
|
isPanelOpen.value = false;
|
|
859
859
|
isOtpPanelOpen.value = false;
|
|
860
860
|
}
|
|
861
861
|
if (type === 'otp') {
|
|
862
|
-
dataStore.
|
|
862
|
+
dataStore.rightPanel.title = dataStore.t('form.otpCode');
|
|
863
863
|
isOtpPanelOpen.value = true;
|
|
864
864
|
isDocumentOpen.value = false;
|
|
865
865
|
isSearchOpen.value = false;
|
|
866
866
|
isPanelOpen.value = false;
|
|
867
867
|
}
|
|
868
|
-
dataStore.
|
|
868
|
+
dataStore.rightPanel.open = true;
|
|
869
869
|
};
|
|
870
870
|
|
|
871
871
|
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
@@ -883,15 +883,15 @@ export default {
|
|
|
883
883
|
currentPanel.value = key as keyof typeof member.value;
|
|
884
884
|
isPanelOpen.value = true;
|
|
885
885
|
dataStore.panelAction = null;
|
|
886
|
-
dataStore.
|
|
887
|
-
dataStore.
|
|
886
|
+
dataStore.rightPanel.open = true;
|
|
887
|
+
dataStore.rightPanel.title = title;
|
|
888
888
|
|
|
889
889
|
let newList = list;
|
|
890
890
|
if (asyncFunction) {
|
|
891
891
|
isPanelLoading.value = true;
|
|
892
892
|
newList = await asyncFunction(filterKey, member.value);
|
|
893
893
|
}
|
|
894
|
-
panelList.value = filterList(newList, key);
|
|
894
|
+
panelList.value = filterList(newList, key);
|
|
895
895
|
panelValue.value = member.value[currentPanel.value];
|
|
896
896
|
isPanelLoading.value = false;
|
|
897
897
|
} else {
|
|
@@ -917,7 +917,7 @@ export default {
|
|
|
917
917
|
|
|
918
918
|
const pickPanelValue = (item: Value) => {
|
|
919
919
|
if (formStore.isDisabled[whichForm.value as keyof typeof formStore.isDisabled] === false) {
|
|
920
|
-
dataStore.
|
|
920
|
+
dataStore.rightPanel.open = false;
|
|
921
921
|
isPanelOpen.value = false;
|
|
922
922
|
// @ts-ignore
|
|
923
923
|
member.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
@@ -989,7 +989,7 @@ export default {
|
|
|
989
989
|
familyDialog.value = false;
|
|
990
990
|
selectedFamilyMember.value = {};
|
|
991
991
|
isButtonLoading.value = false;
|
|
992
|
-
dataStore.
|
|
992
|
+
dataStore.rightPanel.open = false;
|
|
993
993
|
isSearchOpen.value = false;
|
|
994
994
|
};
|
|
995
995
|
|
|
@@ -1006,20 +1006,20 @@ export default {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
familyDialog.value = false;
|
|
1008
1008
|
isButtonLoading.value = false;
|
|
1009
|
-
dataStore.
|
|
1009
|
+
dataStore.rightPanel.open = false;
|
|
1010
1010
|
isSearchOpen.value = false;
|
|
1011
1011
|
};
|
|
1012
1012
|
|
|
1013
1013
|
const getContragentFromGBDFL = async () => {
|
|
1014
1014
|
if (member.value.hasAgreement !== true) {
|
|
1015
1015
|
dataStore.showToaster('error', dataStore.t('toaster.needAgreement'), 3000);
|
|
1016
|
-
dataStore.
|
|
1016
|
+
dataStore.rightPanel.open = false;
|
|
1017
1017
|
isSearchOpen.value = false;
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
1020
|
if (!member.value.iin || member.value.iin.length !== useMask().iin.length || !member.value.phoneNumber || member.value.phoneNumber.length !== useMask().phone.length) {
|
|
1021
1021
|
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }), 5000);
|
|
1022
|
-
dataStore.
|
|
1022
|
+
dataStore.rightPanel.open = false;
|
|
1023
1023
|
isSearchOpen.value = false;
|
|
1024
1024
|
return;
|
|
1025
1025
|
}
|
|
@@ -1029,7 +1029,7 @@ export default {
|
|
|
1029
1029
|
if (response === true) {
|
|
1030
1030
|
member.value.gotFromInsis = true;
|
|
1031
1031
|
}
|
|
1032
|
-
dataStore.
|
|
1032
|
+
dataStore.rightPanel.open = false;
|
|
1033
1033
|
isSearchOpen.value = false;
|
|
1034
1034
|
}
|
|
1035
1035
|
isButtonLoading.value = false;
|
|
@@ -1038,20 +1038,20 @@ export default {
|
|
|
1038
1038
|
const getContragent = async () => {
|
|
1039
1039
|
if (member.value.hasAgreement !== true) {
|
|
1040
1040
|
dataStore.showToaster('error', dataStore.t('toaster.needAgreement'), 3000);
|
|
1041
|
-
dataStore.
|
|
1041
|
+
dataStore.rightPanel.open = false;
|
|
1042
1042
|
isSearchOpen.value = false;
|
|
1043
1043
|
return;
|
|
1044
1044
|
}
|
|
1045
1045
|
if (!member.value.iin || member.value.iin.length !== useMask().iin.length) {
|
|
1046
1046
|
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: 'ИИН' }), 5000);
|
|
1047
|
-
dataStore.
|
|
1047
|
+
dataStore.rightPanel.open = false;
|
|
1048
1048
|
isSearchOpen.value = false;
|
|
1049
1049
|
return;
|
|
1050
1050
|
}
|
|
1051
1051
|
isButtonLoading.value = true;
|
|
1052
1052
|
await dataStore.getContragent(member.value, false);
|
|
1053
1053
|
isButtonLoading.value = false;
|
|
1054
|
-
dataStore.
|
|
1054
|
+
dataStore.rightPanel.open = false;
|
|
1055
1055
|
isSearchOpen.value = false;
|
|
1056
1056
|
};
|
|
1057
1057
|
|
|
@@ -1245,7 +1245,7 @@ export default {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
otpSending.value = false;
|
|
1247
1247
|
if (checked === true) {
|
|
1248
|
-
dataStore.
|
|
1248
|
+
dataStore.rightPanel.open = false;
|
|
1249
1249
|
}
|
|
1250
1250
|
};
|
|
1251
1251
|
|
|
@@ -1255,7 +1255,7 @@ export default {
|
|
|
1255
1255
|
if (response) {
|
|
1256
1256
|
if (member.value.hasAgreement === null) member.value.hasAgreement = response.otpStatus;
|
|
1257
1257
|
if (response.otpStatus === true) {
|
|
1258
|
-
dataStore.
|
|
1258
|
+
dataStore.rightPanel.open = false;
|
|
1259
1259
|
}
|
|
1260
1260
|
}
|
|
1261
1261
|
otpSending.value = false;
|
|
@@ -1324,7 +1324,7 @@ export default {
|
|
|
1324
1324
|
};
|
|
1325
1325
|
|
|
1326
1326
|
const selectMember = async (index: number, update?: boolean) => {
|
|
1327
|
-
dataStore.
|
|
1327
|
+
dataStore.rightPanel.open = false;
|
|
1328
1328
|
isButtonLoading.value = true;
|
|
1329
1329
|
isChangingMember.value = true;
|
|
1330
1330
|
//@ts-ignore
|
|
@@ -1429,9 +1429,9 @@ export default {
|
|
|
1429
1429
|
};
|
|
1430
1430
|
|
|
1431
1431
|
watch(
|
|
1432
|
-
() => dataStore.
|
|
1432
|
+
() => dataStore.rightPanel.open,
|
|
1433
1433
|
() => {
|
|
1434
|
-
if (dataStore.
|
|
1434
|
+
if (dataStore.rightPanel.open === false) {
|
|
1435
1435
|
isPanelOpen.value = false;
|
|
1436
1436
|
isDocumentOpen.value = false;
|
|
1437
1437
|
isSearchOpen.value = false;
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
<base-btn :text="$dataStore.t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
489
489
|
<base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
490
490
|
</div>
|
|
491
|
-
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
491
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
492
492
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
493
493
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
494
494
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
505
505
|
</div>
|
|
506
506
|
</Teleport>
|
|
507
|
-
<Teleport v-if="isMultiplePanelOpen && calculatorForm.countries !== null" to="#panel-actions">
|
|
507
|
+
<Teleport v-if="isMultiplePanelOpen && calculatorForm.countries !== null" to="#right-panel-actions">
|
|
508
508
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
509
509
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
510
510
|
<v-fade-transition>
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
528
528
|
</div>
|
|
529
529
|
</Teleport>
|
|
530
|
-
<Teleport v-if="isTermsPanelOpen" to="#panel-actions">
|
|
530
|
+
<Teleport v-if="isTermsPanelOpen" to="#right-panel-actions">
|
|
531
531
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
532
532
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
533
533
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
@@ -542,7 +542,7 @@
|
|
|
542
542
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
543
543
|
</div>
|
|
544
544
|
</Teleport>
|
|
545
|
-
<Teleport v-if="isFixInsAmountPanelOpen" to="#panel-actions">
|
|
545
|
+
<Teleport v-if="isFixInsAmountPanelOpen" to="#right-panel-actions">
|
|
546
546
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
547
547
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
548
548
|
<div class="w-full flex flex-col gap-2 p-2">
|
|
@@ -556,7 +556,7 @@
|
|
|
556
556
|
</div>
|
|
557
557
|
</div>
|
|
558
558
|
</Teleport>
|
|
559
|
-
<Teleport v-if="isCoverPeriodPanelOpen" to="#panel-actions">
|
|
559
|
+
<Teleport v-if="isCoverPeriodPanelOpen" to="#right-panel-actions">
|
|
560
560
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
561
561
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
562
562
|
<div class="w-full flex flex-col gap-2 p-2">
|
|
@@ -864,7 +864,7 @@ export default defineComponent({
|
|
|
864
864
|
};
|
|
865
865
|
|
|
866
866
|
const pickPanelValue = (item: Value) => {
|
|
867
|
-
dataStore.
|
|
867
|
+
dataStore.rightPanel.open = false;
|
|
868
868
|
isPanelOpen.value = false;
|
|
869
869
|
isMultiplePanelOpen.value = false;
|
|
870
870
|
if (item.id === null) {
|
|
@@ -905,7 +905,7 @@ export default defineComponent({
|
|
|
905
905
|
}
|
|
906
906
|
};
|
|
907
907
|
const pickTermValue = async (item: Value) => {
|
|
908
|
-
dataStore.
|
|
908
|
+
dataStore.rightPanel.open = false;
|
|
909
909
|
isTermsPanelOpen.value = false;
|
|
910
910
|
if (typeof currentIndex.value !== 'number') return;
|
|
911
911
|
additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
|
|
@@ -926,9 +926,9 @@ export default defineComponent({
|
|
|
926
926
|
isFixInsAmountPanelOpen.value = false;
|
|
927
927
|
isCoverPeriodPanelOpen.value = true;
|
|
928
928
|
dataStore.panelAction = null;
|
|
929
|
-
dataStore.
|
|
929
|
+
dataStore.rightPanel.open = true;
|
|
930
930
|
isMultiplePanelOpen.value = false;
|
|
931
|
-
dataStore.
|
|
931
|
+
dataStore.rightPanel.title = dataStore.t('clients.coveragePeriod');
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
934
|
};
|
|
@@ -952,8 +952,8 @@ export default defineComponent({
|
|
|
952
952
|
isFixInsAmountPanelOpen.value = false;
|
|
953
953
|
isCoverPeriodPanelOpen.value = false;
|
|
954
954
|
dataStore.panelAction = null;
|
|
955
|
-
dataStore.
|
|
956
|
-
dataStore.
|
|
955
|
+
dataStore.rightPanel.open = true;
|
|
956
|
+
dataStore.rightPanel.title = title;
|
|
957
957
|
isMultiplePanelOpen.value = false;
|
|
958
958
|
|
|
959
959
|
let newList = list;
|
|
@@ -992,8 +992,8 @@ export default defineComponent({
|
|
|
992
992
|
}
|
|
993
993
|
|
|
994
994
|
dataStore.panelAction = null;
|
|
995
|
-
dataStore.
|
|
996
|
-
dataStore.
|
|
995
|
+
dataStore.rightPanel.open = true;
|
|
996
|
+
dataStore.rightPanel.title = title;
|
|
997
997
|
|
|
998
998
|
// @ts-ignore
|
|
999
999
|
multiplePanelList.value = filterList(newList, key);
|
|
@@ -1005,7 +1005,7 @@ export default defineComponent({
|
|
|
1005
1005
|
}
|
|
1006
1006
|
};
|
|
1007
1007
|
const closeMultiplePanel = (item?: CountryValue) => {
|
|
1008
|
-
dataStore.
|
|
1008
|
+
dataStore.rightPanel.open = false;
|
|
1009
1009
|
isMultiplePanelOpen.value = false;
|
|
1010
1010
|
if (!currentPanel.value) return;
|
|
1011
1011
|
// @ts-ignore
|
|
@@ -1031,8 +1031,8 @@ export default defineComponent({
|
|
|
1031
1031
|
isCoverPeriodPanelOpen.value = false;
|
|
1032
1032
|
isTermsPanelOpen.value = true;
|
|
1033
1033
|
dataStore.panelAction = null;
|
|
1034
|
-
dataStore.
|
|
1035
|
-
dataStore.
|
|
1034
|
+
dataStore.rightPanel.open = true;
|
|
1035
|
+
dataStore.rightPanel.title = title;
|
|
1036
1036
|
|
|
1037
1037
|
let newList;
|
|
1038
1038
|
if (asyncFunction) {
|
|
@@ -1057,8 +1057,8 @@ export default defineComponent({
|
|
|
1057
1057
|
isCoverPeriodPanelOpen.value = false;
|
|
1058
1058
|
isFixInsAmountPanelOpen.value = true;
|
|
1059
1059
|
dataStore.panelAction = null;
|
|
1060
|
-
dataStore.
|
|
1061
|
-
dataStore.
|
|
1060
|
+
dataStore.rightPanel.open = true;
|
|
1061
|
+
dataStore.rightPanel.title = title;
|
|
1062
1062
|
panelList.value = constants.fixInsAmount;
|
|
1063
1063
|
fixInsValue.value = String(amount);
|
|
1064
1064
|
} else {
|
|
@@ -1067,7 +1067,7 @@ export default defineComponent({
|
|
|
1067
1067
|
};
|
|
1068
1068
|
|
|
1069
1069
|
const pickfixInsValue = (item: Value) => {
|
|
1070
|
-
dataStore.
|
|
1070
|
+
dataStore.rightPanel.open = false;
|
|
1071
1071
|
isFixInsAmountPanelOpen.value = false;
|
|
1072
1072
|
if (typeof currentIndex.value !== 'number') return;
|
|
1073
1073
|
additionalTerms.value[currentIndex.value].amount = Number(item.code);
|
|
@@ -1075,7 +1075,7 @@ export default defineComponent({
|
|
|
1075
1075
|
|
|
1076
1076
|
const pickCoverPeriodValue = (item: Value) => {
|
|
1077
1077
|
coverPeriodValue.value = item.code as string;
|
|
1078
|
-
dataStore.
|
|
1078
|
+
dataStore.rightPanel.open = false;
|
|
1079
1079
|
isCoverPeriodPanelOpen.value = false;
|
|
1080
1080
|
if (typeof currentIndex.value !== 'number') return;
|
|
1081
1081
|
additionalTerms.value[currentIndex.value].coverPeriodCode = item.code as string;
|
|
@@ -1397,9 +1397,9 @@ export default defineComponent({
|
|
|
1397
1397
|
},
|
|
1398
1398
|
);
|
|
1399
1399
|
watch(
|
|
1400
|
-
() => dataStore.
|
|
1400
|
+
() => dataStore.rightPanel.open,
|
|
1401
1401
|
() => {
|
|
1402
|
-
if (dataStore.
|
|
1402
|
+
if (dataStore.rightPanel.open === false) {
|
|
1403
1403
|
isPanelOpen.value = false;
|
|
1404
1404
|
isTermsPanelOpen.value = false;
|
|
1405
1405
|
dataStore.panelAction = null;
|
|
@@ -27,13 +27,29 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</section>
|
|
29
29
|
<section v-if="chooseSignActions">
|
|
30
|
-
<div v-if="!isElectronicContract && !isPaperContract" :class="[$styles.flexColNav]">
|
|
31
|
-
<base-btn :text="$dataStore.t('buttons.sendOnPaper')" @click="handleSignAction('paper')" />
|
|
32
|
-
<base-btn :text="$dataStore.t('buttons.sendElectronically')" :disabled="
|
|
30
|
+
<div v-if="!isElectronicContract && !isPaperContract && !isScansDocuments" :class="[$styles.flexColNav]">
|
|
31
|
+
<base-btn :text="$dataStore.t('buttons.sendOnPaper')" :disabled="isPaperDisabled" @click="handleSignAction('paper')" />
|
|
32
|
+
<base-btn :text="$dataStore.t('buttons.sendElectronically')" :disabled="isElectronicDisabled" @click="handleSignAction('electronic')" />
|
|
33
|
+
<base-btn :text="$dataStore.t('buttons.generatePrintedForms')" :disabled="isScansDisabled" @click="handleSignAction('scans')" />
|
|
33
34
|
</div>
|
|
34
35
|
<div v-if="isPaperContract" :class="[$styles.flexColNav]">
|
|
35
36
|
<base-btn :text="$dataStore.t('buttons.downloadContract')" :loading="$dataStore.isButtonsLoading" @click="generateDocument" />
|
|
36
37
|
</div>
|
|
38
|
+
<div v-if="isScansDocuments" :class="[$styles.flexColNav]">
|
|
39
|
+
<base-btn :text="$dataStore.t('buttons.downloadStatement')" />
|
|
40
|
+
<base-btn :text="$dataStore.t('buttons.downloadContract')" />
|
|
41
|
+
<base-btn :text="$dataStore.t('buttons.downloadApplication')" />
|
|
42
|
+
<base-btn :text="$dataStore.t('buttons.downloadPowerOfAttorney')" />
|
|
43
|
+
|
|
44
|
+
<base-form-section class="mt-4 flex flex-col !gap-2" :title="$dataStore.t('clients.attachScansSignDocs')">
|
|
45
|
+
<base-file-input :label="$dataStore.t('labels.attachStatement')" @input.prevent="onFileChangeScans($event)" />
|
|
46
|
+
<base-file-input :label="$dataStore.t('labels.attachContract')" @input.prevent="onFileChangeScans($event)" />
|
|
47
|
+
<base-file-input :label="$dataStore.t('labels.attachApplication')" @input.prevent="onFileChangeScans($event)" />
|
|
48
|
+
<base-file-input :label="$dataStore.t('labels.attachPowerOfAttorney')" @input.prevent="onFileChangeScans($event)" />
|
|
49
|
+
</base-form-section>
|
|
50
|
+
<base-btn :text="$dataStore.t('buttons.sign')" :loading="$dataStore.isButtonsLoading" @click="sendFiles" />
|
|
51
|
+
<base-btn :text="$dataStore.t('buttons.cancel')" :btn="$styles.whiteBtn" @click="isScansDocuments = false" />
|
|
52
|
+
</div>
|
|
37
53
|
</section>
|
|
38
54
|
<section v-if="signingActions" class="relative">
|
|
39
55
|
<base-fade-transition>
|
|
@@ -141,7 +157,7 @@
|
|
|
141
157
|
</template>
|
|
142
158
|
|
|
143
159
|
<script lang="ts">
|
|
144
|
-
import { DocumentItem } from '../../composables/classes';
|
|
160
|
+
import { DocumentItem, Value } from '../../composables/classes';
|
|
145
161
|
|
|
146
162
|
export default defineComponent({
|
|
147
163
|
emits: ['task'],
|
|
@@ -152,6 +168,7 @@ export default defineComponent({
|
|
|
152
168
|
const actionCause = ref<string>('');
|
|
153
169
|
const loading = ref<boolean>(false);
|
|
154
170
|
const isPaperContract = ref<boolean>(false);
|
|
171
|
+
const isScansDocuments = ref<boolean>(false);
|
|
155
172
|
const isElectronicContract = ref<boolean>(true);
|
|
156
173
|
const email = ref<string>('');
|
|
157
174
|
|
|
@@ -172,6 +189,8 @@ export default defineComponent({
|
|
|
172
189
|
fileTypeCode: documentDict.value ? documentDict.value.code : '',
|
|
173
190
|
});
|
|
174
191
|
const affiliationFormData = ref(new FormData());
|
|
192
|
+
const scansFormData = ref(new FormData());
|
|
193
|
+
const scansFiles = ref<any[]>([]);
|
|
175
194
|
|
|
176
195
|
const openSmsPanel = (signInfo: SignUrlType) => {
|
|
177
196
|
if (signInfo) {
|
|
@@ -200,6 +219,42 @@ export default defineComponent({
|
|
|
200
219
|
}
|
|
201
220
|
}
|
|
202
221
|
};
|
|
222
|
+
|
|
223
|
+
const onFileChangeScans = async (event: InputEvent) => {
|
|
224
|
+
if (event.target) {
|
|
225
|
+
const files = (event.target as HTMLInputElement).files;
|
|
226
|
+
if (files && files.length) {
|
|
227
|
+
const name = files[0].name.substring(0, files[0].name.indexOf('.'));
|
|
228
|
+
const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.nameRu === String(name));
|
|
229
|
+
const data = {
|
|
230
|
+
processInstanceId: formStore.applicationData.processInstanceId,
|
|
231
|
+
fileTypeCode: selectedDocument ? selectedDocument.code : null,
|
|
232
|
+
fileTypeId: selectedDocument ? selectedDocument.id : null,
|
|
233
|
+
fileName: files[0].name,
|
|
234
|
+
};
|
|
235
|
+
scansFiles.value.push({
|
|
236
|
+
file: files[0],
|
|
237
|
+
fileData: JSON.stringify([data]),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const sendFiles = async () => {
|
|
244
|
+
if (scansFiles.value.length !== 4) {
|
|
245
|
+
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
for (const item of scansFiles.value) {
|
|
249
|
+
scansFormData.value.append('file', item.file);
|
|
250
|
+
scansFormData.value.append('fileData', item.fileData);
|
|
251
|
+
await dataStore.uploadFiles(scansFormData.value);
|
|
252
|
+
scansFormData.value = new FormData();
|
|
253
|
+
}
|
|
254
|
+
closePanel();
|
|
255
|
+
dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
|
|
256
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string, actionCause.value);
|
|
257
|
+
};
|
|
203
258
|
const submitForm = async () => {
|
|
204
259
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
205
260
|
if (v.valid) {
|
|
@@ -248,7 +303,7 @@ export default defineComponent({
|
|
|
248
303
|
|
|
249
304
|
const onInit = async () => {
|
|
250
305
|
if (dataStore.controls.hasChooseSign) {
|
|
251
|
-
if (dataStore.isGons) {
|
|
306
|
+
if (dataStore.isGons || dataStore.isLifeBusiness) {
|
|
252
307
|
isElectronicContract.value = false;
|
|
253
308
|
}
|
|
254
309
|
}
|
|
@@ -335,6 +390,24 @@ export default defineComponent({
|
|
|
335
390
|
}
|
|
336
391
|
return true;
|
|
337
392
|
});
|
|
393
|
+
const isPaperDisabled = computed(() => {
|
|
394
|
+
if (dataStore.isGons) {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
return true;
|
|
398
|
+
});
|
|
399
|
+
const isElectronicDisabled = computed(() => {
|
|
400
|
+
if (dataStore.isGons) {
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
return false;
|
|
404
|
+
});
|
|
405
|
+
const isScansDisabled = computed(() => {
|
|
406
|
+
if (dataStore.isGons) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
return false;
|
|
410
|
+
});
|
|
338
411
|
const downloadTemplate = async () => {
|
|
339
412
|
dataStore.panel.open = false;
|
|
340
413
|
dataStore.panelAction = null;
|
|
@@ -351,7 +424,7 @@ export default defineComponent({
|
|
|
351
424
|
});
|
|
352
425
|
};
|
|
353
426
|
|
|
354
|
-
const handleSignAction = async (type: 'paper' | 'electronic') => {
|
|
427
|
+
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans') => {
|
|
355
428
|
if (type === 'electronic') {
|
|
356
429
|
await dataStore.signDocument();
|
|
357
430
|
isElectronicContract.value = true;
|
|
@@ -359,6 +432,9 @@ export default defineComponent({
|
|
|
359
432
|
if (type === 'paper') {
|
|
360
433
|
isPaperContract.value = true;
|
|
361
434
|
}
|
|
435
|
+
if (type === 'scans') {
|
|
436
|
+
isScansDocuments.value = true;
|
|
437
|
+
}
|
|
362
438
|
};
|
|
363
439
|
|
|
364
440
|
const generateDocument = async () => {
|
|
@@ -377,6 +453,7 @@ export default defineComponent({
|
|
|
377
453
|
phoneNumber,
|
|
378
454
|
selectedClient,
|
|
379
455
|
isPaperContract,
|
|
456
|
+
isScansDocuments,
|
|
380
457
|
email,
|
|
381
458
|
// Functions
|
|
382
459
|
closePanel,
|
|
@@ -387,6 +464,8 @@ export default defineComponent({
|
|
|
387
464
|
onFileChange,
|
|
388
465
|
downloadTemplate,
|
|
389
466
|
sendTemplateToEmail,
|
|
467
|
+
onFileChangeScans,
|
|
468
|
+
sendFiles,
|
|
390
469
|
// Computed
|
|
391
470
|
buttonText,
|
|
392
471
|
sendingActions,
|
|
@@ -406,6 +485,9 @@ export default defineComponent({
|
|
|
406
485
|
isElectronicContract,
|
|
407
486
|
handleSignAction,
|
|
408
487
|
generateDocument,
|
|
488
|
+
isPaperDisabled,
|
|
489
|
+
isElectronicDisabled,
|
|
490
|
+
isScansDisabled,
|
|
409
491
|
};
|
|
410
492
|
},
|
|
411
493
|
});
|