hl-core 0.0.8 → 0.0.9-beta.10

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.
Files changed (73) hide show
  1. package/api/index.ts +202 -161
  2. package/api/interceptors.ts +23 -17
  3. package/components/Button/Btn.vue +4 -4
  4. package/components/Button/ScrollButtons.vue +2 -2
  5. package/components/Complex/ContentBlock.vue +1 -1
  6. package/components/Complex/MessageBlock.vue +26 -0
  7. package/components/Complex/Page.vue +8 -2
  8. package/components/Complex/WhiteBlock.vue +7 -0
  9. package/components/Dialog/Dialog.vue +9 -39
  10. package/components/Dialog/FamilyDialog.vue +10 -7
  11. package/components/Form/FormBlock.vue +91 -45
  12. package/components/Form/FormSection.vue +5 -2
  13. package/components/Form/FormTextSection.vue +3 -3
  14. package/components/Form/FormToggle.vue +4 -5
  15. package/components/Form/ManagerAttachment.vue +210 -0
  16. package/components/Form/ProductConditionsBlock.vue +70 -16
  17. package/components/Input/Datepicker.vue +45 -0
  18. package/components/Input/EmptyFormField.vue +1 -1
  19. package/components/Input/FileInput.vue +2 -3
  20. package/components/Input/FormInput.vue +31 -7
  21. package/components/Input/PanelInput.vue +7 -2
  22. package/components/Input/RoundedEmptyField.vue +5 -0
  23. package/components/Input/RoundedInput.vue +2 -2
  24. package/components/Input/RoundedSelect.vue +150 -0
  25. package/components/Layout/Drawer.vue +5 -2
  26. package/components/Layout/Header.vue +41 -5
  27. package/components/Layout/Loader.vue +1 -1
  28. package/components/Layout/SettingsPanel.vue +47 -13
  29. package/components/List/ListEmpty.vue +1 -1
  30. package/components/Menu/MenuHover.vue +30 -0
  31. package/components/Menu/MenuNav.vue +30 -14
  32. package/components/Menu/MenuNavItem.vue +10 -7
  33. package/components/Pages/Anketa.vue +68 -47
  34. package/components/Pages/Auth.vue +139 -46
  35. package/components/Pages/ContragentForm.vue +505 -0
  36. package/components/Pages/Documents.vue +11 -11
  37. package/components/Pages/InvoiceInfo.vue +30 -0
  38. package/components/Pages/MemberForm.vue +574 -316
  39. package/components/Pages/ProductAgreement.vue +2 -2
  40. package/components/Pages/ProductConditions.vue +671 -78
  41. package/components/Panel/PanelHandler.vue +309 -0
  42. package/components/Panel/PanelSelectItem.vue +3 -3
  43. package/components/Transitions/SlideTransition.vue +5 -0
  44. package/components/Utilities/Chip.vue +27 -0
  45. package/components/Utilities/IconBorder.vue +17 -0
  46. package/components/Utilities/JsonViewer.vue +27 -0
  47. package/composables/axios.ts +2 -2
  48. package/composables/classes.ts +227 -107
  49. package/composables/constants.ts +31 -51
  50. package/composables/index.ts +106 -2
  51. package/composables/styles.ts +33 -11
  52. package/configs/i18n.ts +15 -0
  53. package/layouts/default.vue +11 -8
  54. package/layouts/full.vue +1 -1
  55. package/locales/ru.json +647 -0
  56. package/nuxt.config.ts +14 -2
  57. package/package.json +35 -12
  58. package/pages/500.vue +4 -4
  59. package/pages/Token.vue +52 -0
  60. package/plugins/helperFunctionsPlugins.ts +11 -6
  61. package/plugins/storePlugin.ts +0 -1
  62. package/plugins/vuetifyPlugin.ts +8 -1
  63. package/store/data.store.ts +2666 -0
  64. package/store/form.store.ts +1 -1
  65. package/store/member.store.ts +164 -52
  66. package/store/rules.ts +193 -0
  67. package/types/enum.ts +83 -0
  68. package/types/env.d.ts +10 -0
  69. package/types/index.ts +279 -8
  70. package/components/Button/BtnIcon.vue +0 -47
  71. package/store/data.store.js +0 -2482
  72. package/store/messages.ts +0 -429
  73. package/store/rules.js +0 -153
@@ -0,0 +1,505 @@
1
+ <template>
2
+ <section v-show="showForm" class="flex flex-col gap-4 px-[10px]">
3
+ <v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[75vh] overflow-y-scroll">
4
+ <base-form-section :title="$dataStore.t('form.personalData')" class="mt-[14px]">
5
+ <base-form-input
6
+ v-model="member.phoneNumber"
7
+ :label="$dataStore.t('form.phoneNumber')"
8
+ :readonly="disabled"
9
+ :clearable="!disabled"
10
+ :maska="$maska.phone"
11
+ :rules="$rules.required.concat($rules.phoneFormat)"
12
+ />
13
+ <base-form-input
14
+ v-model="member.iin"
15
+ :label="$dataStore.t('form.iin')"
16
+ :readonly="disabled"
17
+ :clearable="!disabled"
18
+ :maska="$maska.iin"
19
+ :rules="$rules.required.concat($rules.iinRight)"
20
+ />
21
+ <base-form-input
22
+ v-model.trim="member.lastName"
23
+ :label="$dataStore.t('form.lastName')"
24
+ :readonly="disabled"
25
+ :clearable="!disabled"
26
+ :rules="$rules.required.concat($rules.cyrillic)"
27
+ />
28
+ <base-form-input
29
+ v-model.trim="member.firstName"
30
+ :label="$dataStore.t('form.firstName')"
31
+ :readonly="disabled"
32
+ :clearable="!disabled"
33
+ :rules="$rules.required.concat($rules.cyrillic)"
34
+ />
35
+ <base-form-input
36
+ v-model.trim="member.middleName"
37
+ :label="$dataStore.t('form.middleName')"
38
+ :readonly="disabled"
39
+ :clearable="!disabled"
40
+ :rules="$rules.cyrillicNonRequired"
41
+ />
42
+ <base-form-input
43
+ v-model="member.birthDate"
44
+ :label="$dataStore.t('form.birthDate')"
45
+ :readonly="disabled"
46
+ :clearable="!disabled"
47
+ :rules="$rules.required.concat($rules.birthDate)"
48
+ :maska="$maska.date"
49
+ append-inner-icon="mdi mdi-calendar-blank-outline"
50
+ />
51
+ <base-form-input v-model="member.age" :label="$dataStore.t('form.age')" :readonly="disabled" :clearable="!disabled" :rules="$rules.numbers.concat($rules.age18)" />
52
+ <base-panel-input
53
+ v-model="member.gender"
54
+ :value="member.gender?.nameRu"
55
+ :readonly="disabled"
56
+ :clearable="!disabled"
57
+ :label="$dataStore.t('form.gender')"
58
+ :rules="$rules.objectRequired"
59
+ append-inner-icon="mdi mdi-chevron-right"
60
+ @append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
61
+ />
62
+ </base-form-section>
63
+ <!-- <base-form-section :title="$dataStore.t('form.jobData')">
64
+ <base-form-input v-model.trim="member.job" :label="$dataStore.t('form.job')" :readonly="disabled" :clearable="!disabled" :rules="$rules.required" />
65
+ <base-form-input v-model.trim="member.jobPosition" :label="$dataStore.t('form.jobPosition')" :readonly="disabled" :clearable="!disabled" :rules="$rules.required" />
66
+ <base-form-input v-model.trim="member.jobPlace" :label="$dataStore.t('form.jobPlace')" :readonly="disabled" :clearable="!disabled" :rules="$rules.required" />
67
+ </base-form-section> -->
68
+ <base-form-section :title="$dataStore.t('form.placeRegistration')">
69
+ <base-panel-input
70
+ v-model="member.registrationCountry"
71
+ :value="member.registrationCountry?.nameRu"
72
+ :label="$dataStore.t('form.Country')"
73
+ :readonly="disabled"
74
+ :clearable="!disabled"
75
+ :rules="$rules.objectRequired"
76
+ append-inner-icon="mdi mdi-chevron-right"
77
+ @append="openPanel($dataStore.t('form.Country'), [], 'registrationCountry', $dataStore.getCountries)"
78
+ />
79
+ <base-fade-transition>
80
+ <div class="flex flex-col gap-[1px]" v-if="member.registrationCountry.nameRu === 'Казахстан' || member.registrationCountry.nameRu === null">
81
+ <base-panel-input
82
+ v-model="member.registrationProvince"
83
+ :value="member.registrationProvince?.nameRu"
84
+ :label="$dataStore.t('form.Province')"
85
+ :readonly="disabled"
86
+ :clearable="!disabled"
87
+ :rules="$rules.objectRequired"
88
+ append-inner-icon="mdi mdi-chevron-right"
89
+ @append="openPanel($dataStore.t('form.Province'), [], 'registrationProvince', $dataStore.getStates, 'registrationCountry')"
90
+ />
91
+ <base-panel-input
92
+ v-model="member.registrationRegionType"
93
+ :value="member.registrationRegionType?.nameRu"
94
+ :label="$dataStore.t('form.RegionType')"
95
+ :readonly="disabled"
96
+ :clearable="!disabled"
97
+ :rules="$rules.objectRequired"
98
+ append-inner-icon="mdi mdi-chevron-right"
99
+ @append="openPanel($dataStore.t('form.RegionType'), [], 'registrationRegionType', $dataStore.getLocalityTypes)"
100
+ />
101
+ <base-panel-input
102
+ v-if="member.registrationRegionType.nameRu !== 'город'"
103
+ v-model="member.registrationRegion"
104
+ :value="member.registrationRegion?.nameRu"
105
+ :label="$dataStore.t('form.Region')"
106
+ :readonly="disabled"
107
+ :clearable="!disabled"
108
+ :rules="$rules.objectRequired"
109
+ append-inner-icon="mdi mdi-chevron-right"
110
+ @append="openPanel($dataStore.t('form.Region'), [], 'registrationRegion', $dataStore.getRegions, 'registrationProvince')"
111
+ />
112
+ <base-panel-input
113
+ v-model="member.registrationCity"
114
+ :value="member.registrationCity?.nameRu"
115
+ :label="$dataStore.t('form.City')"
116
+ :readonly="disabled"
117
+ :clearable="!disabled"
118
+ :rules="$rules.objectRequired"
119
+ append-inner-icon="mdi mdi-chevron-right"
120
+ @append="openPanel($dataStore.t('form.City'), [], 'registrationCity', $dataStore.getCities, 'registrationProvince')"
121
+ />
122
+ <base-form-input v-model.trim="member.registrationQuarter" :label="$dataStore.t('form.Quarter')" :readonly="disabled" :clearable="!disabled" />
123
+ <base-form-input v-model.trim="member.registrationMicroDistrict" :label="$dataStore.t('form.MicroDistrict')" :readonly="disabled" :clearable="!disabled" />
124
+ <base-form-input v-model.trim="member.registrationStreet" :rules="$rules.required" :label="$dataStore.t('form.Street')" :readonly="disabled" :clearable="!disabled" />
125
+ <base-form-input
126
+ v-model.trim="member.registrationNumberHouse"
127
+ :rules="$rules.required"
128
+ :label="$dataStore.t('form.NumberHouse')"
129
+ :readonly="disabled"
130
+ :clearable="!disabled"
131
+ />
132
+ <base-form-input v-model.trim="member.registrationNumberApartment" :label="$dataStore.t('form.NumberApartment')" :readonly="disabled" :clearable="!disabled" />
133
+ </div>
134
+ </base-fade-transition>
135
+ </base-form-section>
136
+ <base-form-section :title="$dataStore.t('form.birthData')">
137
+ <base-panel-input
138
+ v-model="member.birthPlace"
139
+ :value="member.birthPlace?.nameRu"
140
+ :label="$dataStore.t('form.Country')"
141
+ :readonly="disabled"
142
+ :clearable="!disabled"
143
+ :rules="$rules.objectRequired"
144
+ append-inner-icon="mdi mdi-chevron-right"
145
+ @append="openPanel($dataStore.t('form.Country'), [], 'birthPlace', $dataStore.getCountries)"
146
+ />
147
+ </base-form-section>
148
+ <base-form-section :title="$dataStore.t('form.documentData')">
149
+ <base-panel-input
150
+ v-model="member.documentType"
151
+ :value="member.documentType?.nameRu"
152
+ :label="$dataStore.t('form.documentType')"
153
+ :readonly="disabled"
154
+ :clearable="!disabled"
155
+ :rules="$rules.objectRequired"
156
+ append-inner-icon="mdi mdi-chevron-right"
157
+ @append="openPanel($dataStore.t('form.documentType'), [], 'documentType', $dataStore.getDocumentTypes)"
158
+ />
159
+ <base-form-input v-model.trim="member.documentNumber" :label="$dataStore.t('form.documentNumber')" :readonly="disabled" :clearable="!disabled" :rules="$rules.required" />
160
+ <!-- <base-file-input v-if="!memberDocument" :disabled="isDisabled" :clearable="!isDisabled" @input="attachFile($event)" />
161
+ <base-empty-form-field v-if="memberDocument" @click="!isDisabled && openCustomPanel('document')" class="justify-between">
162
+ {{ `${memberDocument.fileTypeName} - ${memberDocument.fileName}` }}
163
+ <i class="cursor-pointer mdi mdi-file-document mr-6 text-[#a0b3d8] text-xl"></i>
164
+ </base-empty-form-field> -->
165
+ <base-panel-input
166
+ v-model="member.documentIssuers"
167
+ :value="member.documentIssuers?.nameRu"
168
+ :label="$dataStore.t('form.documentIssuers')"
169
+ :readonly="disabled"
170
+ :clearable="!disabled"
171
+ :rules="$rules.objectRequired"
172
+ append-inner-icon="mdi mdi-chevron-right"
173
+ @append="openPanel($dataStore.t('form.documentIssuers'), [], 'documentIssuers', $dataStore.getDocumentIssuers)"
174
+ />
175
+ <base-form-input
176
+ v-model="member.documentDate"
177
+ :label="$dataStore.t('form.documentDate')"
178
+ :rules="$rules.required.concat($rules.date)"
179
+ :readonly="disabled"
180
+ :clearable="!disabled"
181
+ :maska="$maska.date"
182
+ append-inner-icon="mdi mdi-calendar-blank-outline"
183
+ />
184
+ <base-fade-transition>
185
+ <base-form-input
186
+ v-if="member.documentType.ids !== 'SBI' && member.documentType.ids !== 'VNZ'"
187
+ v-model="member.documentExpire"
188
+ :label="$dataStore.t('form.documentExpire')"
189
+ :readonly="disabled"
190
+ :clearable="!disabled"
191
+ :rules="$rules.required.concat($rules.date)"
192
+ :maska="$maska.date"
193
+ append-inner-icon="mdi mdi-calendar-blank-outline"
194
+ />
195
+ </base-fade-transition>
196
+ <base-panel-input
197
+ v-model="member.signOfResidency"
198
+ :value="member.signOfResidency?.nameRu"
199
+ :label="$dataStore.t('form.signOfResidency')"
200
+ :readonly="disabled"
201
+ :clearable="!disabled"
202
+ :rules="$rules.objectRequired"
203
+ append-inner-icon="mdi mdi-chevron-right"
204
+ @append="openPanel($dataStore.t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
205
+ />
206
+ <base-panel-input
207
+ v-model="member.countryOfTaxResidency"
208
+ :value="member.countryOfTaxResidency?.nameRu"
209
+ :label="$dataStore.t('form.countryOfTaxResidency')"
210
+ :readonly="disabled"
211
+ :clearable="!disabled"
212
+ :rules="$rules.objectRequired"
213
+ append-inner-icon="mdi mdi-chevron-right"
214
+ @append="openPanel($dataStore.t('form.countryOfTaxResidency'), [], 'countryOfTaxResidency', $dataStore.getTaxCountries)"
215
+ />
216
+ <base-fade-transition>
217
+ <base-panel-input
218
+ v-if="member.countryOfTaxResidency.ids === '500014.3'"
219
+ v-model="member.addTaxResidency"
220
+ :value="member.addTaxResidency?.nameRu"
221
+ :label="$dataStore.t('form.addTaxResidency')"
222
+ :readonly="disabled"
223
+ :clearable="!disabled"
224
+ :rules="$rules.objectRequired"
225
+ append-inner-icon="mdi mdi-chevron-right"
226
+ @append="openPanel($dataStore.t('form.addTaxResidency'), [], 'addTaxResidency', $dataStore.getAdditionalTaxCountries)"
227
+ />
228
+ </base-fade-transition>
229
+ <base-panel-input
230
+ v-model="member.countryOfCitizenship"
231
+ :value="member.countryOfCitizenship?.nameRu"
232
+ :label="$dataStore.t('form.countryOfCitizenship')"
233
+ :readonly="disabled"
234
+ :clearable="!disabled"
235
+ :rules="$rules.objectRequired"
236
+ append-inner-icon="mdi mdi-chevron-right"
237
+ @append="openPanel($dataStore.t('form.countryOfCitizenship'), [], 'countryOfCitizenship', $dataStore.getCitizenshipCountries)"
238
+ />
239
+ <base-panel-input
240
+ v-model="member.economySectorCode"
241
+ :value="member.economySectorCode?.nameRu"
242
+ :label="$dataStore.t('form.economySectorCode')"
243
+ :readonly="disabled"
244
+ :clearable="!disabled"
245
+ :rules="$rules.objectRequired"
246
+ append-inner-icon="mdi mdi-chevron-right"
247
+ @append="openPanel($dataStore.t('form.economySectorCode'), [], 'economySectorCode', $dataStore.getSectorCodeList)"
248
+ />
249
+ </base-form-section>
250
+ <base-form-section :title="$dataStore.t('form.contactsData')">
251
+ <base-form-input
252
+ v-model="member.homePhone"
253
+ :maska="$maska.phone"
254
+ placeholder="+7 7"
255
+ :label="$dataStore.t('form.homePhone')"
256
+ :readonly="disabled"
257
+ :clearable="!disabled"
258
+ :rules="$rules.phoneFormat"
259
+ />
260
+ <base-form-input v-model.trim="member.email" :label="$dataStore.t('form.email')" :readonly="disabled" :clearable="!disabled" :rules="$rules.email" />
261
+ </base-form-section>
262
+ </v-form>
263
+ <base-btn v-if="showSaveButton && !disabled" :loading="isButtonLoading" :text="$dataStore.t('buttons.save')" @click="submitForm" />
264
+ <Teleport v-if="isPanelOpen" to="#panel-actions">
265
+ <div :class="[$styles.scrollPage]" class="relative flex flex-col items-center">
266
+ <i
267
+ v-if="type === 'panel'"
268
+ 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 z-10"
269
+ @click="closeDictPanel"
270
+ ></i>
271
+ <base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2 mt-2" :hide-details="true" />
272
+ <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
273
+ <base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
274
+ <base-panel-select-item
275
+ v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery ?? '', 'i')))"
276
+ :key="index"
277
+ :text="(item.nameRu as string)"
278
+ :selected="item.nameRu === panelValue.nameRu"
279
+ @click="pickPanelValue(item)"
280
+ />
281
+ </div>
282
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
283
+ </div>
284
+ </Teleport>
285
+ </section>
286
+ <base-scroll-buttons @up="scrollForm('up')" @down="scrollForm('down')" />
287
+ </template>
288
+
289
+ <script lang="ts">
290
+ import { StoreMembers } from '../../types/enum';
291
+ import { Member, Value } from '../../composables/classes';
292
+
293
+ export default defineComponent({
294
+ props: {
295
+ member: {
296
+ type: Object as PropType<Member>,
297
+ default: {},
298
+ },
299
+ type: {
300
+ type: String as PropType<'default' | 'panel'>,
301
+ default: 'default',
302
+ },
303
+ whichForm: {
304
+ type: String as PropType<'contragent' | keyof typeof StoreMembers>,
305
+ default: 'contragent',
306
+ },
307
+ disabled: {
308
+ type: Boolean,
309
+ default: false,
310
+ },
311
+ },
312
+ emits: ['success'],
313
+ setup(props, { emit }) {
314
+ const dataStore = useDataStore();
315
+
316
+ const vForm = ref<any>();
317
+ const searchQuery = ref<string>();
318
+ const currentPanel = ref<keyof typeof props.member>();
319
+ const showForm = ref<boolean>(true);
320
+ const isPanelOpen = ref<boolean>(false);
321
+ const isPanelLoading = ref<boolean>(false);
322
+ const isButtonLoading = ref<boolean>(false);
323
+ const panelValue = ref<Value>(new Value());
324
+ const panelList = ref<Value[]>([]);
325
+
326
+ const showSaveButton = computed(() => {
327
+ const generalCondition = dataStore.isAgent();
328
+ return generalCondition;
329
+ });
330
+
331
+ const scrollForm = (direction: 'up' | 'down') => {
332
+ vForm.value.scrollTo({ top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' });
333
+ };
334
+
335
+ const closeDictPanel = () => {
336
+ isPanelOpen.value = false;
337
+ showForm.value = true;
338
+ };
339
+
340
+ const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
341
+ searchQuery.value = '';
342
+ // @ts-ignore
343
+ currentPanel.value = key as keyof typeof props.member;
344
+ isPanelOpen.value = true;
345
+ dataStore.panelAction = null;
346
+ if (props.type === 'default') {
347
+ dataStore.panel.open = true;
348
+ dataStore.panel.title = title;
349
+ }
350
+
351
+ let newList = list;
352
+ if (asyncFunction) {
353
+ isPanelLoading.value = true;
354
+ newList = await asyncFunction(filterKey, props.member);
355
+ }
356
+ if (props.type === 'panel') {
357
+ showForm.value = false;
358
+ }
359
+ panelList.value = newList;
360
+ panelValue.value = props.member[currentPanel.value!];
361
+ isPanelLoading.value = false;
362
+ };
363
+
364
+ const pickPanelValue = (item: Value) => {
365
+ if (props.type === 'default') {
366
+ dataStore.panel.open = false;
367
+ }
368
+ showForm.value = true;
369
+ isPanelOpen.value = false;
370
+ // @ts-ignore
371
+ props.member[currentPanel.value] = item.nameRu === null ? new Value() : item;
372
+ };
373
+
374
+ const validateESBD = async (docTypeNumber: number) => {
375
+ const data: ESBDValidationType = {
376
+ personType: 1,
377
+ iin: props.member.iin!.replaceAll('-', ''),
378
+ lastName: props.member.lastName ?? '',
379
+ firstName: props.member.firstName ?? '',
380
+ middleName: props.member.middleName ?? '',
381
+ birthDate: props.member.getDateByKey('birthDate') ?? '',
382
+ sex: Number(props.member.gender.id),
383
+ docType: docTypeNumber,
384
+ docNumber: props.member.documentNumber ?? '',
385
+ docIssuedDate: props.member.getDateByKey('documentDate') ?? '',
386
+ docIssuedBy: props.member.documentIssuers.nameRu ?? '',
387
+ activityKindId: 0,
388
+ economicsSectorId: Number((props.member.economySectorCode.ids! as string).at(-1)),
389
+ resident: props.member.signOfResidency.ids === '500011.2' || props.member.signOfResidency.ids === null ? 0 : 1,
390
+ countryId: Number((props.member.countryOfTaxResidency.ids! as string).at(-1)),
391
+ };
392
+ return await dataStore.getValidateClientESBD(data);
393
+ };
394
+
395
+ const saveMember = async () => {
396
+ const hasSaved = await dataStore.saveContragent(props.member, props.whichForm, null, true);
397
+ if (hasSaved === false) {
398
+ return false;
399
+ }
400
+ dataStore.showToaster('success', dataStore.t('toaster.successSaved'));
401
+ dataStore.isLoading = false;
402
+ scrollForm('up');
403
+ emit('success', hasSaved);
404
+ };
405
+
406
+ const submitForm = async () => {
407
+ await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
408
+ if (v.valid) {
409
+ isButtonLoading.value = true;
410
+ const docType = props.member.documentType.ids;
411
+ if (props.member.gotFromInsis === true && (docType === '1UDL' || docType === 'SBI')) {
412
+ dataStore.isLoading = true;
413
+ const ESBDResponse = await validateESBD(docType === '1UDL' ? 1 : 3);
414
+ if (!ESBDResponse) {
415
+ dataStore.isLoading = false;
416
+ return;
417
+ }
418
+ const initialPoint = `${props.member.iin!.replaceAll('-', '')}.`;
419
+ const RESPONSE = ESBDMessage(ESBDResponse, initialPoint);
420
+ let errorMessage = RESPONSE !== false ? RESPONSE : 'Что-то произошло не так';
421
+ if (typeof ESBDResponse === 'object' && ESBDResponse.errorCode === 0) {
422
+ props.member.verifyType = 'ESBD';
423
+ props.member.verifyDate = ESBDResponse.verifiedDate;
424
+ const hasMemberSaved = await saveMember();
425
+ } else {
426
+ dataStore.isLoading = false;
427
+ dataStore.showToaster('error', errorMessage, 5000);
428
+ }
429
+ } else {
430
+ const hasMemberSaved = await saveMember();
431
+ }
432
+ isButtonLoading.value = false;
433
+ } else {
434
+ const errors = document.querySelector('.v-input--error');
435
+ if (errors) {
436
+ const errorText = errors.querySelector('.v-label.v-field-label');
437
+ if (errorText) {
438
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
439
+ } else {
440
+ const errorFieldText = errors.querySelector('.v-input__control');
441
+ if (errorFieldText) {
442
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
443
+ }
444
+ }
445
+ errors.scrollIntoView({
446
+ behavior: 'smooth',
447
+ block: 'center',
448
+ inline: 'nearest',
449
+ });
450
+ }
451
+ }
452
+ });
453
+ };
454
+
455
+ watch(
456
+ () => props.member!.birthDate,
457
+ val => {
458
+ if (props.member && val && val.length === useMask().date.length) {
459
+ const calculatedAge = props.member.getAgeByBirthDate();
460
+ if (calculatedAge) props.member.age = calculatedAge;
461
+ }
462
+ },
463
+ );
464
+
465
+ watch(
466
+ () => dataStore.panel.open,
467
+ () => {
468
+ if (dataStore.panel.open === false) {
469
+ isPanelOpen.value = false;
470
+ dataStore.panelAction = null;
471
+ }
472
+ },
473
+ { immediate: true },
474
+ );
475
+
476
+ watch(searchQuery, () => {
477
+ if (searchQuery.value === null) {
478
+ searchQuery.value = '';
479
+ }
480
+ });
481
+
482
+ return {
483
+ // State
484
+ vForm,
485
+ showForm,
486
+ panelList,
487
+ panelValue,
488
+ searchQuery,
489
+ isPanelOpen,
490
+ isPanelLoading,
491
+ isButtonLoading,
492
+
493
+ //Computed
494
+ showSaveButton,
495
+
496
+ // Functions
497
+ openPanel,
498
+ submitForm,
499
+ scrollForm,
500
+ pickPanelValue,
501
+ closeDictPanel,
502
+ };
503
+ },
504
+ });
505
+ </script>
@@ -1,32 +1,32 @@
1
1
  <template>
2
- <section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" :class="[$libStyles.scrollPage]" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
3
- <base-content-block v-for="document of formStore.signedDocumentList as DocumentItem[]" :key="document.id" :class="[$libStyles.textSimple]">
2
+ <section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" :class="[$styles.scrollPage]" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
3
+ <base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$styles.textSimple]">
4
4
  <h5 class="text-center font-medium mb-4">
5
5
  {{ document.fileTypeName }}
6
6
  </h5>
7
- <div :class="[$libStyles.whiteBg, $libStyles.rounded]" class="p-2 h-12 flex items-center relative">
7
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
8
8
  <span class="ml-2">{{ document.fileName }}</span>
9
9
  <i
10
10
  class="transition-all cursor-pointer mdi mdi-dots-vertical pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
11
- :class="[$libStyles.greenTextHover]"
11
+ :class="[$styles.greenTextHover]"
12
12
  @click="openPanel(document)"
13
13
  ></i>
14
14
  </div>
15
15
  </base-content-block>
16
16
  </section>
17
- <base-list-empty v-else></base-list-empty>
17
+ <base-list-empty v-else />
18
18
  <Teleport v-if="$dataStore.panelAction === null" to="#panel-actions">
19
19
  <base-fade-transition>
20
- <div :class="[$libStyles.flexColNav]">
21
- <base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')"></base-btn>
22
- <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')"></base-btn>
20
+ <div :class="[$styles.flexColNav]">
21
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
22
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
23
23
  </div>
24
24
  </base-fade-transition>
25
25
  </Teleport>
26
26
  </template>
27
27
 
28
28
  <script lang="ts">
29
- import { DocumentItem } from '@/composables/classes';
29
+ import { DocumentItem } from '../../composables/classes';
30
30
 
31
31
  export default defineComponent({
32
32
  setup() {
@@ -40,9 +40,9 @@ export default defineComponent({
40
40
  text: '',
41
41
  });
42
42
  const object_list = computed(() => Object.values(formStore.signedDocumentList));
43
- const unSignedList = computed(() => document_list.value.filter(doc => doc.signed === false || doc.signed === null));
43
+ const unSignedList = computed(() => document_list.value.filter((doc: DocumentItem) => doc.signed === false || doc.signed === null));
44
44
  const document_list = computed(() =>
45
- object_list.value.filter(obj => {
45
+ object_list.value.filter((obj: DocumentItem) => {
46
46
  if (obj.fileTypeCode === '19' || obj.fileTypeCode === '5') {
47
47
  return obj;
48
48
  }
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <section class="w-full px-[10px] pt-[14px] flex flex-col gap-4" :class="[$styles.scrollPage]" v-if="!!invoiceData">
3
+ <lazy-base-form-section :title="$dataStore.t('labels.jsonObject')">
4
+ <template #icon>
5
+ <v-btn icon="mdi mdi-content-copy !text-[18px]" size="x-small" variant="plain" color="#A0B3D8" @click="$dataStore.copyToClipboard(JSON.stringify(invoiceData))" />
6
+ </template>
7
+ <lazy-base-json-viewer :data="invoiceData" class="bg-white p-4 rounded" />
8
+ </lazy-base-form-section>
9
+ <lazy-base-form-section v-if="invoiceData.paymentLink && invoiceData.status !== 1" :title="$dataStore.t('labels.epayPage')" class="flex items-center">
10
+ <div class="w-full lg:w-[70%] bg-white">
11
+ <iframe :src="invoiceData.paymentLink" frameborder="0" class="w-full h-[70vh]"></iframe>
12
+ </div>
13
+ </lazy-base-form-section>
14
+ </section>
15
+ </template>
16
+
17
+ <script lang="ts">
18
+ export default defineComponent({
19
+ setup() {
20
+ const formStore = useFormStore();
21
+ const invoiceData = formStore.invoiceData;
22
+
23
+ return {
24
+ // State
25
+ formStore,
26
+ invoiceData,
27
+ };
28
+ },
29
+ });
30
+ </script>