hl-core 0.0.9-beta.3 → 0.0.9-beta.30
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 +862 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +58 -14
- package/components/Button/Btn.vue +3 -3
- package/components/Complex/ContentBlock.vue +1 -1
- package/components/Complex/MessageBlock.vue +2 -2
- package/components/Complex/Page.vue +8 -2
- package/components/Complex/WhiteBlock.vue +7 -0
- package/components/Dialog/Dialog.vue +60 -15
- package/components/Dialog/FamilyDialog.vue +5 -5
- package/components/Form/DynamicForm.vue +99 -0
- package/components/Form/FormBlock.vue +36 -29
- package/components/Form/FormData.vue +48 -0
- package/components/Form/FormSection.vue +2 -2
- package/components/Form/FormTextSection.vue +3 -3
- package/components/Form/FormToggle.vue +3 -3
- package/components/Form/ManagerAttachment.vue +104 -52
- package/components/Form/ProductConditionsBlock.vue +73 -20
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/EmptyFormField.vue +1 -1
- package/components/Input/FileInput.vue +15 -4
- package/components/Input/Monthpicker.vue +33 -0
- package/components/Input/PanelInput.vue +5 -1
- package/components/Input/RoundedEmptyField.vue +5 -0
- package/components/Input/RoundedSelect.vue +13 -0
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +161 -0
- package/components/Layout/Drawer.vue +17 -4
- package/components/Layout/Header.vue +2 -2
- package/components/Layout/SettingsPanel.vue +10 -15
- package/components/List/ListEmpty.vue +1 -1
- package/components/Menu/MenuHover.vue +1 -1
- package/components/Menu/MenuNav.vue +3 -3
- package/components/Menu/MenuNavItem.vue +4 -4
- package/components/Pages/Anketa.vue +144 -65
- package/components/Pages/Auth.vue +21 -10
- package/components/Pages/ContragentForm.vue +505 -0
- package/components/Pages/Documents.vue +57 -11
- package/components/Pages/InvoiceInfo.vue +2 -2
- package/components/Pages/MemberForm.vue +253 -89
- package/components/Pages/ProductAgreement.vue +2 -11
- package/components/Pages/ProductConditions.vue +777 -164
- package/components/Panel/PanelHandler.vue +297 -54
- package/components/Panel/PanelSelectItem.vue +18 -3
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Utilities/IconBorder.vue +17 -0
- package/composables/axios.ts +1 -1
- package/composables/classes.ts +405 -9
- package/composables/constants.ts +40 -0
- package/composables/fields.ts +203 -0
- package/composables/index.ts +48 -0
- package/composables/styles.ts +22 -10
- package/configs/i18n.ts +0 -2
- package/layouts/default.vue +46 -4
- package/layouts/full.vue +1 -1
- package/locales/ru.json +423 -11
- package/nuxt.config.ts +1 -1
- package/package.json +30 -39
- package/pages/500.vue +2 -2
- package/pages/Token.vue +1 -0
- package/plugins/helperFunctionsPlugins.ts +6 -7
- package/plugins/vuetifyPlugin.ts +2 -0
- package/store/data.store.ts +936 -217
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +38 -2
- package/types/enum.ts +8 -0
- package/types/form.ts +94 -0
- package/types/index.ts +162 -10
- package/components/Button/BtnIcon.vue +0 -47
- package/locales/kz.json +0 -590
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section v-if="sendingActions">
|
|
3
|
-
<div :class="[$
|
|
3
|
+
<div :class="[$styles.flexColNav]">
|
|
4
4
|
<v-form ref="vForm">
|
|
5
5
|
<base-rounded-input v-model.trim="actionCause" placeholder="Причина" :rules="$rules.required" />
|
|
6
6
|
</v-form>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
</section>
|
|
10
10
|
<section v-if="acceptAction">
|
|
11
|
-
<div :class="[$
|
|
11
|
+
<div :class="[$styles.flexColNav]">
|
|
12
12
|
<base-content-block v-if="hasConditionsInfo" class="flex flex-col gap-3">
|
|
13
13
|
<span
|
|
14
14
|
>{{ `Сумма страховой премии ${paymentPeriod}:` }} <b>{{ `${insurancePremiumPerMonth}₸` }}</b></span
|
|
@@ -17,58 +17,94 @@
|
|
|
17
17
|
>{{ `Запрашиваемая страховая сумма: ` }} <b>{{ `${requestedSumInsured}₸` }}</b>
|
|
18
18
|
</span>
|
|
19
19
|
</base-content-block>
|
|
20
|
+
<base-content-block v-if="$dataStore.isLifetrip" class="flex flex-col gap-3">
|
|
21
|
+
<span
|
|
22
|
+
>{{ `Стоимость на страховую сумму ${insuredAmount}:` }} <b>{{ `${price}₸` }}</b></span
|
|
23
|
+
>
|
|
24
|
+
</base-content-block>
|
|
20
25
|
<base-btn :text="$dataStore.t('confirm.yes')" @click="handleTask" />
|
|
21
|
-
<base-btn :btn="$
|
|
26
|
+
<base-btn :btn="$styles.blueLightBtn" :text="$dataStore.t('confirm.no')" @click="closePanel" />
|
|
27
|
+
</div>
|
|
28
|
+
</section>
|
|
29
|
+
<section v-if="chooseSignActions">
|
|
30
|
+
<div v-if="!isElectronicContract && !isPaperContract && !isScansDocuments && !isQr" :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')" />
|
|
34
|
+
<base-btn :text="$dataStore.t('buttons.sendEgovMob')" :disabled="isQrDisabled" @click="handleSignAction('qr')" />
|
|
35
|
+
</div>
|
|
36
|
+
<div v-if="isPaperContract" :class="[$styles.flexColNav]">
|
|
37
|
+
<base-btn :text="$dataStore.t('buttons.downloadContract')" :loading="$dataStore.isButtonsLoading" @click="generateDocument" />
|
|
38
|
+
</div>
|
|
39
|
+
<div v-if="isScansDocuments" :class="[$styles.flexColNav]">
|
|
40
|
+
<base-btn :text="$dataStore.t('buttons.downloadStatement')" />
|
|
41
|
+
<base-btn :text="$dataStore.t('buttons.downloadContract')" />
|
|
42
|
+
<base-btn :text="$dataStore.t('buttons.downloadApplication')" />
|
|
43
|
+
<base-btn :text="$dataStore.t('buttons.downloadPowerOfAttorney')" />
|
|
44
|
+
|
|
45
|
+
<base-form-section class="mt-4 flex flex-col !gap-2" :title="$dataStore.t('clients.attachScansSignDocs')">
|
|
46
|
+
<base-file-input :label="$dataStore.t('labels.attachStatement')" @input.prevent="onFileChangeScans($event)" />
|
|
47
|
+
<base-file-input :label="$dataStore.t('labels.attachContract')" @input.prevent="onFileChangeScans($event)" />
|
|
48
|
+
<base-file-input :label="$dataStore.t('labels.attachApplication')" @input.prevent="onFileChangeScans($event)" />
|
|
49
|
+
<base-file-input :label="$dataStore.t('labels.attachPowerOfAttorney')" @input.prevent="onFileChangeScans($event)" />
|
|
50
|
+
</base-form-section>
|
|
51
|
+
<base-btn :text="$dataStore.t('buttons.sign')" :loading="$dataStore.isButtonsLoading" @click="sendFiles" />
|
|
52
|
+
<base-btn :text="$dataStore.t('buttons.cancel')" :btn="$styles.whiteBtn" @click="isScansDocuments = false" />
|
|
53
|
+
</div>
|
|
54
|
+
<div v-if="isQr" :class="[$styles.flexColNav]">
|
|
55
|
+
<base-form-section :title="''">
|
|
56
|
+
<img width="135" height="135" class="ma-auto" v-if="qrUrl" :src="qrUrl" alt="" />
|
|
57
|
+
<span :class="[$styles.textSimple]" class="mt-3 text-center">{{ $dataStore.t('sign.scanQrCode') }}</span>
|
|
58
|
+
<base-btn class="mt-10" :loading="loading" :text="$dataStore.t('sign.copyEgov')" @click="$dataStore.copyToClipboard(qrUrl)" />
|
|
59
|
+
<base-btn :text="$dataStore.t('buttons.cancel')" :btn="$styles.whiteBtn" @click="isQr = false" />
|
|
60
|
+
</base-form-section>
|
|
22
61
|
</div>
|
|
23
62
|
</section>
|
|
24
63
|
<section v-if="signingActions" class="relative">
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<div
|
|
28
|
-
<
|
|
29
|
-
<v-expansion-
|
|
30
|
-
<v-expansion-panel
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</
|
|
38
|
-
</v-expansion-panel>
|
|
39
|
-
</v-expansion-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</div>
|
|
43
|
-
<div v-if="isSendNumberOpen" :class="[$libStyles.flexColNav]">
|
|
44
|
-
<i
|
|
45
|
-
class="mdi mdi-arrow-left cursor-pointer absolute text-xl left-0 top-0 rounded-br-full bg-white border-[1px] pb-3 pt-1 pl-1 pr-3"
|
|
46
|
-
@click="isSendNumberOpen = false"
|
|
47
|
-
></i>
|
|
48
|
-
<base-form-section :title="selectedClient && selectedClient.longName ? selectedClient.longName : ''">
|
|
49
|
-
<v-form ref="vForm">
|
|
50
|
-
<base-rounded-input
|
|
51
|
-
v-model="phoneNumber"
|
|
52
|
-
:maska="$maska.phone"
|
|
53
|
-
:rules="$rules.required.concat($rules.phoneFormat)"
|
|
54
|
-
:label="$dataStore.t('form.phoneNumber')"
|
|
55
|
-
placeholder="+7 7"
|
|
56
|
-
/>
|
|
57
|
-
</v-form>
|
|
58
|
-
<base-btn :text="$dataStore.t('buttons.sendSMS')" :loading="loading" @click="submitForm"
|
|
59
|
-
/></base-form-section>
|
|
64
|
+
<base-fade-transition>
|
|
65
|
+
<div v-if="!isSendNumberOpen" :class="[$styles.flexColNav]">
|
|
66
|
+
<div :class="[$styles.blueBgLight]" class="rounded-lg p-4">
|
|
67
|
+
<v-expansion-panels v-if="formStore.signUrls && formStore.signUrls.length" variant="accordion" multiple>
|
|
68
|
+
<v-expansion-panel v-for="signUrl of formStore.signUrls" :key="signUrl.iin!" class="border-[1px]" elevation="0" bg-color="#FFF">
|
|
69
|
+
<v-expansion-panel-title class="h-[80px]" :class="$styles.textTitle">
|
|
70
|
+
{{ `${signUrl.longName} - ${signUrl.iin}` }}
|
|
71
|
+
</v-expansion-panel-title>
|
|
72
|
+
<v-expansion-panel-text class="border-t-[1px]">
|
|
73
|
+
<section class="flex flex-col gap-4 py-3" :class="$styles.textSimple">
|
|
74
|
+
<base-btn :loading="loading" :text="$dataStore.t('sign.copyCloud')" @click="$dataStore.copyToClipboard(signUrl.uri)" />
|
|
75
|
+
<base-btn :loading="loading" :btn="$styles.blueLightBtn" :text="$dataStore.t('sign.recipientNumber')" @click="openSmsPanel(signUrl)" />
|
|
76
|
+
</section>
|
|
77
|
+
</v-expansion-panel-text>
|
|
78
|
+
</v-expansion-panel>
|
|
79
|
+
</v-expansion-panels>
|
|
80
|
+
<base-list-empty v-else />
|
|
60
81
|
</div>
|
|
61
|
-
</
|
|
62
|
-
|
|
82
|
+
</div>
|
|
83
|
+
<div v-if="isSendNumberOpen" :class="[$styles.flexColNav]">
|
|
84
|
+
<i class="mdi mdi-arrow-left cursor-pointer absolute text-xl left-0 top-0 rounded-br-full bg-white border-[1px] pb-3 pt-1 pl-1 pr-3" @click="isSendNumberOpen = false"></i>
|
|
85
|
+
<base-form-section :title="selectedClient && selectedClient.longName ? selectedClient.longName : ''">
|
|
86
|
+
<v-form ref="vForm">
|
|
87
|
+
<base-rounded-input
|
|
88
|
+
v-model="phoneNumber"
|
|
89
|
+
:maska="$maska.phone"
|
|
90
|
+
:rules="$rules.required.concat($rules.phoneFormat)"
|
|
91
|
+
:label="$dataStore.t('form.phoneNumber')"
|
|
92
|
+
placeholder="+7 7"
|
|
93
|
+
/>
|
|
94
|
+
</v-form>
|
|
95
|
+
<base-btn :text="$dataStore.t('buttons.sendSMS')" :loading="loading" @click="submitForm" />
|
|
96
|
+
</base-form-section>
|
|
97
|
+
</div>
|
|
98
|
+
</base-fade-transition>
|
|
63
99
|
</section>
|
|
64
100
|
<section v-if="payingActions" class="relative">
|
|
65
101
|
<div>
|
|
66
102
|
<base-fade-transition>
|
|
67
|
-
<div v-if="!isSendNumberOpen" :class="[$
|
|
103
|
+
<div v-if="!isSendNumberOpen" :class="[$styles.flexColNav]">
|
|
68
104
|
<base-btn :loading="loading" :text="$dataStore.t('payment.copyUrl')" @click="$dataStore.copyToClipboard(formStore.epayLink)" />
|
|
69
|
-
<base-btn :loading="loading" :btn="$
|
|
105
|
+
<base-btn :loading="loading" :btn="$styles.blueLightBtn" :text="$dataStore.t('payment.recipientNumber')" @click="openEpayPanel" />
|
|
70
106
|
</div>
|
|
71
|
-
<div v-if="isSendNumberOpen" :class="[$
|
|
107
|
+
<div v-if="isSendNumberOpen" :class="[$styles.flexColNav]">
|
|
72
108
|
<i
|
|
73
109
|
class="mdi mdi-arrow-left cursor-pointer absolute text-xl left-0 top-0 rounded-br-full bg-white border-[1px] pb-3 pt-1 pl-1 pr-3"
|
|
74
110
|
@click="isSendNumberOpen = false"
|
|
@@ -90,7 +126,7 @@
|
|
|
90
126
|
</div>
|
|
91
127
|
</section>
|
|
92
128
|
<section v-if="affiliateActions">
|
|
93
|
-
<div :class="[$
|
|
129
|
+
<div :class="[$styles.flexColNav]">
|
|
94
130
|
<v-form ref="vForm">
|
|
95
131
|
<base-content-block class="flex flex-col gap-3">
|
|
96
132
|
<base-form-input v-model.trim="formStore.affilationResolution.number" :rules="$rules.required" :label="$dataStore.t('form.documentNumber')" />
|
|
@@ -99,27 +135,54 @@
|
|
|
99
135
|
:maska="$maska.date"
|
|
100
136
|
:rules="$rules.required"
|
|
101
137
|
:label="$dataStore.t('form.date')"
|
|
102
|
-
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
138
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
139
|
+
/>
|
|
103
140
|
<base-file-input v-if="!affiliationDocument" @input.prevent="onFileChange($event)" />
|
|
104
141
|
<base-empty-form-field v-if="affiliationDocument" class="justify-between">
|
|
105
142
|
{{ `${affiliationDocument.fileTypeName} - ${affiliationDocument.fileName}` }}
|
|
106
|
-
<i class="cursor-pointer mdi mdi-file-document mr-6 text-[#a0b3d8] text-xl"></i
|
|
107
|
-
|
|
143
|
+
<i class="cursor-pointer mdi mdi-file-document mr-6 text-[#a0b3d8] text-xl"></i
|
|
144
|
+
></base-empty-form-field>
|
|
145
|
+
</base-content-block>
|
|
108
146
|
</v-form>
|
|
109
147
|
<base-btn :text="buttonText" :loading="loading" @click="submitForm" />
|
|
110
148
|
</div>
|
|
111
149
|
</section>
|
|
150
|
+
<section v-if="templateAction">
|
|
151
|
+
<div :class="[$styles.flexColNav]">
|
|
152
|
+
<base-content-block>
|
|
153
|
+
<base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded" @click.prevent="downloadTemplate">
|
|
154
|
+
{{ $dataStore.t('downloadTemplate') }}
|
|
155
|
+
<i class="mdi mdi-download text-2xl text-[#A0B3D8]"></i
|
|
156
|
+
></base-panel-item>
|
|
157
|
+
</base-content-block>
|
|
158
|
+
<base-content-block>
|
|
159
|
+
<v-form ref="vForm" class="mb-3">
|
|
160
|
+
<base-form-input v-model.trim="email" :label="$dataStore.t('form.email')" :rules="$rules.required" />
|
|
161
|
+
</v-form>
|
|
162
|
+
<base-btn :text="$dataStore.t('form.sendToEmail')" :loading="loading" @click="sendTemplateToEmail" />
|
|
163
|
+
</base-content-block>
|
|
164
|
+
</div>
|
|
165
|
+
</section>
|
|
112
166
|
</template>
|
|
113
167
|
|
|
114
168
|
<script lang="ts">
|
|
115
|
-
import { DocumentItem } from '../../composables/classes';
|
|
169
|
+
import { DocumentItem, Value } from '../../composables/classes';
|
|
170
|
+
|
|
116
171
|
export default defineComponent({
|
|
117
|
-
|
|
172
|
+
emits: ['task'],
|
|
173
|
+
setup(props, { emit }) {
|
|
118
174
|
const route = useRoute();
|
|
119
175
|
const dataStore = useDataStore();
|
|
120
176
|
const formStore = useFormStore();
|
|
121
177
|
const actionCause = ref<string>('');
|
|
122
178
|
const loading = ref<boolean>(false);
|
|
179
|
+
const isPaperContract = ref<boolean>(false);
|
|
180
|
+
const isScansDocuments = ref<boolean>(false);
|
|
181
|
+
const isQr = ref<boolean>(false);
|
|
182
|
+
const isElectronicContract = ref<boolean>(true);
|
|
183
|
+
const email = ref<string>('');
|
|
184
|
+
const qrUrl = ref<string>('');
|
|
185
|
+
|
|
123
186
|
const vForm = ref<any>();
|
|
124
187
|
const isSendNumberOpen = ref<boolean>(false);
|
|
125
188
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
@@ -137,6 +200,8 @@ export default defineComponent({
|
|
|
137
200
|
fileTypeCode: documentDict.value ? documentDict.value.code : '',
|
|
138
201
|
});
|
|
139
202
|
const affiliationFormData = ref(new FormData());
|
|
203
|
+
const scansFormData = ref(new FormData());
|
|
204
|
+
const scansFiles = ref<any[]>([]);
|
|
140
205
|
|
|
141
206
|
const openSmsPanel = (signInfo: SignUrlType) => {
|
|
142
207
|
if (signInfo) {
|
|
@@ -166,6 +231,41 @@ export default defineComponent({
|
|
|
166
231
|
}
|
|
167
232
|
};
|
|
168
233
|
|
|
234
|
+
const onFileChangeScans = async (event: InputEvent) => {
|
|
235
|
+
if (event.target) {
|
|
236
|
+
const files = (event.target as HTMLInputElement).files;
|
|
237
|
+
if (files && files.length) {
|
|
238
|
+
const name = files[0].name.substring(0, files[0].name.indexOf('.'));
|
|
239
|
+
const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.nameRu === String(name));
|
|
240
|
+
const data = {
|
|
241
|
+
processInstanceId: formStore.applicationData.processInstanceId,
|
|
242
|
+
fileTypeCode: selectedDocument ? selectedDocument.code : null,
|
|
243
|
+
fileTypeId: selectedDocument ? selectedDocument.id : null,
|
|
244
|
+
fileName: files[0].name,
|
|
245
|
+
};
|
|
246
|
+
scansFiles.value.push({
|
|
247
|
+
file: files[0],
|
|
248
|
+
fileData: JSON.stringify([data]),
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
const sendFiles = async () => {
|
|
255
|
+
if (scansFiles.value.length !== 4) {
|
|
256
|
+
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
for (const item of scansFiles.value) {
|
|
260
|
+
scansFormData.value.append('file', item.file);
|
|
261
|
+
scansFormData.value.append('fileData', item.fileData);
|
|
262
|
+
await dataStore.uploadFiles(scansFormData.value);
|
|
263
|
+
scansFormData.value = new FormData();
|
|
264
|
+
}
|
|
265
|
+
closePanel();
|
|
266
|
+
dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
|
|
267
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string, actionCause.value);
|
|
268
|
+
};
|
|
169
269
|
const submitForm = async () => {
|
|
170
270
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
171
271
|
if (v.valid) {
|
|
@@ -198,10 +298,32 @@ export default defineComponent({
|
|
|
198
298
|
|
|
199
299
|
const handleTask = async () => {
|
|
200
300
|
loading.value = true;
|
|
201
|
-
|
|
301
|
+
// Пока не нужно, на всякий оставить
|
|
302
|
+
// if (needRecalculation.value) {
|
|
303
|
+
// dataStore.showToaster('info', dataStore.t('toaster.needToRecalculate'));
|
|
304
|
+
// loading.value = false;
|
|
305
|
+
// return;
|
|
306
|
+
// }
|
|
307
|
+
if (dataStore.isAML || dataStore.isCheckContract || dataStore.isCheckContragent) {
|
|
308
|
+
emit('task', [dataStore.panelAction, route.params.taskId as string, actionCause.value]);
|
|
309
|
+
} else {
|
|
310
|
+
await dataStore.handleTask(dataStore.panelAction, route.params.taskId as string, actionCause.value);
|
|
311
|
+
}
|
|
202
312
|
loading.value = false;
|
|
203
313
|
};
|
|
204
314
|
|
|
315
|
+
const onInit = async () => {
|
|
316
|
+
if (dataStore.controls.hasChooseSign) {
|
|
317
|
+
if (dataStore.isGons || dataStore.isLifeBusiness) {
|
|
318
|
+
isElectronicContract.value = false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
onMounted(async () => {
|
|
324
|
+
await onInit();
|
|
325
|
+
});
|
|
326
|
+
|
|
205
327
|
const buttonText = computed(() => {
|
|
206
328
|
switch (dataStore.panelAction) {
|
|
207
329
|
case constants.actions.reject:
|
|
@@ -218,36 +340,136 @@ export default defineComponent({
|
|
|
218
340
|
case constants.actions.register:
|
|
219
341
|
return dataStore.t('buttons.register');
|
|
220
342
|
case constants.actions.affiliate:
|
|
343
|
+
case constants.actions.template:
|
|
221
344
|
return dataStore.t('buttons.send');
|
|
345
|
+
default:
|
|
346
|
+
return dataStore.t('buttons.send');
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
const panelTitle = computed(() => {
|
|
351
|
+
if (dataStore.isLifeBusiness && dataStore.panelAction === constants.actions.template) {
|
|
352
|
+
return dataStore.t('template');
|
|
222
353
|
}
|
|
354
|
+
return buttonText.value;
|
|
223
355
|
});
|
|
224
356
|
|
|
225
357
|
watch(
|
|
226
358
|
() => dataStore.panelAction,
|
|
227
359
|
val => {
|
|
228
360
|
if (!!val) {
|
|
229
|
-
dataStore.panel.title =
|
|
361
|
+
dataStore.panel.title = panelTitle.value;
|
|
230
362
|
dataStore.panel.open = true;
|
|
231
363
|
}
|
|
232
364
|
},
|
|
233
365
|
{ immediate: true },
|
|
234
366
|
);
|
|
367
|
+
|
|
368
|
+
const needRecalculation = computed(
|
|
369
|
+
() =>
|
|
370
|
+
dataStore.isGons &&
|
|
371
|
+
formStore.applicationData.statusCode === 'UnderwriterForm' &&
|
|
372
|
+
dataStore.panelAction === constants.actions.accept &&
|
|
373
|
+
formStore.productConditionsForm.isRecalculated === false,
|
|
374
|
+
);
|
|
235
375
|
const sendingActions = computed(
|
|
236
376
|
() => dataStore.panelAction === constants.actions.reject || dataStore.panelAction === constants.actions.return || dataStore.panelAction === constants.actions.rejectclient,
|
|
237
377
|
);
|
|
238
378
|
const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
|
|
379
|
+
const templateAction = computed(() => dataStore.panelAction === constants.actions.template);
|
|
239
380
|
const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
|
|
240
381
|
const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
|
|
241
382
|
const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
|
|
383
|
+
const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
|
|
384
|
+
|
|
242
385
|
const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
|
|
243
386
|
const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
|
|
244
|
-
const requestedSumInsured = computed(() =>
|
|
387
|
+
const requestedSumInsured = computed(() => {
|
|
388
|
+
if (dataStore.isLifeBusiness && formStore.productConditionsForm.requestedSumInsured === null) {
|
|
389
|
+
dataStore.getNumberWithSpaces(formStore.applicationData.policyAppDto!.mainInsSum);
|
|
390
|
+
}
|
|
391
|
+
return dataStore.getNumberWithSpaces(formStore.productConditionsForm.requestedSumInsured);
|
|
392
|
+
});
|
|
393
|
+
const price = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.calculatorForm.price));
|
|
394
|
+
const insuredAmount = computed(() => formStore.productConditionsForm.calculatorForm.amount!.nameRu! + dataStore.currency);
|
|
245
395
|
const hasConditionsInfo = computed(() => {
|
|
396
|
+
if (dataStore.isLifetrip) {
|
|
397
|
+
return false;
|
|
398
|
+
}
|
|
246
399
|
if (dataStore.isFinCenter()) {
|
|
247
400
|
return false;
|
|
248
401
|
}
|
|
249
402
|
return true;
|
|
250
403
|
});
|
|
404
|
+
const isPaperDisabled = computed(() => {
|
|
405
|
+
if (dataStore.isGons) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
return true;
|
|
409
|
+
});
|
|
410
|
+
const isElectronicDisabled = computed(() => {
|
|
411
|
+
if (dataStore.isGons) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
return false;
|
|
415
|
+
});
|
|
416
|
+
const isScansDisabled = computed(() => {
|
|
417
|
+
if (dataStore.isGons) {
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
return false;
|
|
421
|
+
});
|
|
422
|
+
const isQrDisabled = computed(() => {
|
|
423
|
+
if (dataStore.isLifeBusiness) {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
return true;
|
|
427
|
+
});
|
|
428
|
+
const downloadTemplate = async () => {
|
|
429
|
+
dataStore.panel.open = false;
|
|
430
|
+
dataStore.panelAction = null;
|
|
431
|
+
await dataStore.downloadTemplate();
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
const sendTemplateToEmail = async () => {
|
|
435
|
+
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
436
|
+
if (v.valid) {
|
|
437
|
+
dataStore.panel.open = false;
|
|
438
|
+
dataStore.panelAction = null;
|
|
439
|
+
await dataStore.sendTemplateToEmail(email.value);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr') => {
|
|
445
|
+
if (type === 'electronic') {
|
|
446
|
+
await dataStore.signDocument();
|
|
447
|
+
isElectronicContract.value = true;
|
|
448
|
+
}
|
|
449
|
+
if (type === 'paper') {
|
|
450
|
+
isPaperContract.value = true;
|
|
451
|
+
}
|
|
452
|
+
if (type === 'scans') {
|
|
453
|
+
isScansDocuments.value = true;
|
|
454
|
+
}
|
|
455
|
+
if (type === 'qr') {
|
|
456
|
+
await generateQR();
|
|
457
|
+
isQr.value = true;
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// TODO Рефактор QR c npm
|
|
462
|
+
const generateQR = async () => {
|
|
463
|
+
const uuid = crypto.randomUUID();
|
|
464
|
+
const qrValue = `${getValuePerEnv('qrGenUrl')}/${uuid}`;
|
|
465
|
+
qrUrl.value = `https://api.qrserver.com/v1/create-qr-code/?size=135x135&data=${qrValue}`;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
const generateDocument = async () => {
|
|
469
|
+
dataStore.panel.open = false;
|
|
470
|
+
dataStore.panelAction = null;
|
|
471
|
+
await dataStore.generateDocument();
|
|
472
|
+
};
|
|
251
473
|
|
|
252
474
|
return {
|
|
253
475
|
// State
|
|
@@ -258,7 +480,11 @@ export default defineComponent({
|
|
|
258
480
|
isSendNumberOpen,
|
|
259
481
|
phoneNumber,
|
|
260
482
|
selectedClient,
|
|
261
|
-
|
|
483
|
+
isPaperContract,
|
|
484
|
+
isScansDocuments,
|
|
485
|
+
email,
|
|
486
|
+
isQr,
|
|
487
|
+
qrUrl,
|
|
262
488
|
// Functions
|
|
263
489
|
closePanel,
|
|
264
490
|
submitForm,
|
|
@@ -266,7 +492,10 @@ export default defineComponent({
|
|
|
266
492
|
openSmsPanel,
|
|
267
493
|
openEpayPanel,
|
|
268
494
|
onFileChange,
|
|
269
|
-
|
|
495
|
+
downloadTemplate,
|
|
496
|
+
sendTemplateToEmail,
|
|
497
|
+
onFileChangeScans,
|
|
498
|
+
sendFiles,
|
|
270
499
|
// Computed
|
|
271
500
|
buttonText,
|
|
272
501
|
sendingActions,
|
|
@@ -274,11 +503,22 @@ export default defineComponent({
|
|
|
274
503
|
payingActions,
|
|
275
504
|
acceptAction,
|
|
276
505
|
affiliateActions,
|
|
506
|
+
chooseSignActions,
|
|
277
507
|
paymentPeriod,
|
|
278
508
|
insurancePremiumPerMonth,
|
|
279
509
|
requestedSumInsured,
|
|
280
510
|
affiliationDocument,
|
|
281
511
|
hasConditionsInfo,
|
|
512
|
+
price,
|
|
513
|
+
insuredAmount,
|
|
514
|
+
templateAction,
|
|
515
|
+
isElectronicContract,
|
|
516
|
+
handleSignAction,
|
|
517
|
+
generateDocument,
|
|
518
|
+
isPaperDisabled,
|
|
519
|
+
isElectronicDisabled,
|
|
520
|
+
isScansDisabled,
|
|
521
|
+
isQrDisabled,
|
|
282
522
|
};
|
|
283
523
|
},
|
|
284
524
|
});
|
|
@@ -288,16 +528,19 @@ export default defineComponent({
|
|
|
288
528
|
.v-expansion-panel-title__overlay {
|
|
289
529
|
background: #ffffff;
|
|
290
530
|
}
|
|
531
|
+
|
|
291
532
|
.v-expansion-panel-title {
|
|
292
533
|
height: 70px !important;
|
|
293
534
|
padding: 10px 20px !important;
|
|
294
535
|
}
|
|
536
|
+
|
|
295
537
|
.v-expansion-panels--variant-accordion > :last-child {
|
|
296
538
|
border-top-left-radius: 0.5rem !important;
|
|
297
539
|
border-top-right-radius: 0.5rem !important;
|
|
298
540
|
border-top-left-radius: 0.5rem !important;
|
|
299
541
|
border-radius: 0.5rem !important;
|
|
300
542
|
}
|
|
543
|
+
|
|
301
544
|
.v-expansion-panel-text__wrapper {
|
|
302
545
|
padding: 10px 20px !important;
|
|
303
546
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="transition-all flex justify-between p-4 items-center cursor-pointer"
|
|
4
|
+
:class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : '']"
|
|
5
|
+
>
|
|
6
|
+
<span :class="[$styles.textSimple]">{{ text }}</span>
|
|
7
|
+
<i class="mdi text-xl" :class="[selected ? `${trueIcon} ${$styles.greenText}` : `${falseIcon} text-[#636363]`]"></i>
|
|
5
8
|
</div>
|
|
6
9
|
</template>
|
|
7
10
|
|
|
@@ -15,6 +18,18 @@ export default defineComponent({
|
|
|
15
18
|
type: Boolean,
|
|
16
19
|
default: false,
|
|
17
20
|
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false,
|
|
24
|
+
},
|
|
25
|
+
trueIcon: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'mdi-radiobox-marked',
|
|
28
|
+
},
|
|
29
|
+
falseIcon: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'mdi-radiobox-blank ',
|
|
32
|
+
},
|
|
18
33
|
},
|
|
19
34
|
});
|
|
20
35
|
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="border-[1px] border-[#F1F2F6] rounded-[12px] p-[10px]">
|
|
3
|
+
<slot v-if="!icon"></slot>
|
|
4
|
+
<i v-else :class="icon"></i>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
props: {
|
|
11
|
+
icon: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
</script>
|
package/composables/axios.ts
CHANGED