hl-core 0.0.9-beta.2 → 0.0.9-beta.4
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/Button/Btn.vue +1 -1
- package/components/Complex/ContentBlock.vue +1 -1
- package/components/Complex/MessageBlock.vue +1 -1
- package/components/Complex/Page.vue +7 -1
- package/components/Complex/WhiteBlock.vue +7 -0
- package/components/Dialog/Dialog.vue +2 -2
- package/components/Dialog/FamilyDialog.vue +5 -5
- package/components/Form/FormBlock.vue +25 -27
- 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 +5 -5
- package/components/Form/ProductConditionsBlock.vue +16 -16
- package/components/Input/EmptyFormField.vue +1 -1
- package/components/Layout/Header.vue +1 -1
- package/components/Layout/SettingsPanel.vue +5 -9
- package/components/List/ListEmpty.vue +1 -1
- package/components/Menu/MenuHover.vue +1 -1
- package/components/Menu/MenuNav.vue +1 -1
- package/components/Menu/MenuNavItem.vue +4 -4
- package/components/Pages/Anketa.vue +11 -16
- package/components/Pages/Auth.vue +9 -9
- package/components/Pages/ContragentForm.vue +426 -0
- package/components/Pages/Documents.vue +5 -5
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +14 -7
- package/components/Pages/ProductAgreement.vue +1 -3
- package/components/Pages/ProductConditions.vue +7 -12
- package/components/Panel/PanelHandler.vue +13 -13
- package/components/Panel/PanelSelectItem.vue +3 -3
- package/components/Utilities/IconBorder.vue +17 -0
- package/composables/classes.ts +5 -7
- package/composables/constants.ts +5 -0
- package/composables/index.ts +20 -4
- package/configs/i18n.ts +0 -2
- package/layouts/default.vue +2 -2
- package/layouts/full.vue +1 -1
- package/locales/ru.json +10 -1
- package/package.json +9 -20
- package/pages/500.vue +2 -2
- package/pages/Token.vue +1 -0
- package/plugins/helperFunctionsPlugins.ts +6 -4
- package/store/data.store.ts +46 -34
- package/types/index.ts +40 -26
- package/components/Button/BtnIcon.vue +0 -47
- package/locales/kz.json +0 -585
|
@@ -0,0 +1,426 @@
|
|
|
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 v-model="member.phoneNumber" :label="$dataStore.t('form.phoneNumber')" :maska="$maska.phone" :rules="$rules.required.concat($rules.phoneFormat)" />
|
|
6
|
+
<base-form-input v-model="member.iin" :label="$dataStore.t('form.iin')" :maska="$maska.iin" :rules="$rules.required.concat($rules.iinRight)" />
|
|
7
|
+
<base-form-input v-model.trim="member.lastName" :label="$dataStore.t('form.lastName')" :rules="$rules.required.concat($rules.cyrillic)" />
|
|
8
|
+
<base-form-input v-model.trim="member.firstName" :label="$dataStore.t('form.firstName')" :rules="$rules.required.concat($rules.cyrillic)" />
|
|
9
|
+
<base-form-input v-model.trim="member.middleName" :label="$dataStore.t('form.middleName')" :rules="$rules.cyrillicNonRequired" />
|
|
10
|
+
<base-form-input
|
|
11
|
+
v-model="member.birthDate"
|
|
12
|
+
:label="$dataStore.t('form.birthDate')"
|
|
13
|
+
:rules="$rules.required.concat($rules.birthDate)"
|
|
14
|
+
:maska="$maska.date"
|
|
15
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
16
|
+
/>
|
|
17
|
+
<base-form-input v-model="member.age" :label="$dataStore.t('form.age')" :rules="$rules.numbers.concat($rules.age18)" />
|
|
18
|
+
<base-panel-input
|
|
19
|
+
v-model="member.gender"
|
|
20
|
+
:value="member.gender.nameRu"
|
|
21
|
+
:label="$dataStore.t('form.gender')"
|
|
22
|
+
:rules="$rules.objectRequired"
|
|
23
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
24
|
+
@append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
|
|
25
|
+
/>
|
|
26
|
+
</base-form-section>
|
|
27
|
+
<!-- <base-form-section :title="$dataStore.t('form.jobData')">
|
|
28
|
+
<base-form-input v-model.trim="member.job" :label="$dataStore.t('form.job')" :rules="$rules.required" />
|
|
29
|
+
<base-form-input v-model.trim="member.jobPosition" :label="$dataStore.t('form.jobPosition')" :rules="$rules.required" />
|
|
30
|
+
<base-form-input v-model.trim="member.jobPlace" :label="$dataStore.t('form.jobPlace')" :rules="$rules.required" />
|
|
31
|
+
</base-form-section> -->
|
|
32
|
+
<base-form-section :title="$dataStore.t('form.placeRegistration')">
|
|
33
|
+
<base-panel-input
|
|
34
|
+
v-model="member.registrationCountry"
|
|
35
|
+
:value="member.registrationCountry.nameRu"
|
|
36
|
+
:label="$dataStore.t('form.Country')"
|
|
37
|
+
:rules="$rules.objectRequired"
|
|
38
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
39
|
+
@append="openPanel($dataStore.t('form.Country'), [], 'registrationCountry', $dataStore.getCountries)"
|
|
40
|
+
/>
|
|
41
|
+
<base-fade-transition>
|
|
42
|
+
<div class="flex flex-col gap-[1px]" v-if="member.registrationCountry.nameRu === 'Казахстан' || member.registrationCountry.nameRu === null">
|
|
43
|
+
<base-panel-input
|
|
44
|
+
v-model="member.registrationProvince"
|
|
45
|
+
:value="member.registrationProvince.nameRu"
|
|
46
|
+
:label="$dataStore.t('form.Province')"
|
|
47
|
+
:rules="$rules.objectRequired"
|
|
48
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
49
|
+
@append="openPanel($dataStore.t('form.Province'), [], 'registrationProvince', $dataStore.getStates, 'registrationCountry')"
|
|
50
|
+
/>
|
|
51
|
+
<base-panel-input
|
|
52
|
+
v-model="member.registrationRegionType"
|
|
53
|
+
:value="member.registrationRegionType.nameRu"
|
|
54
|
+
:label="$dataStore.t('form.RegionType')"
|
|
55
|
+
:rules="$rules.objectRequired"
|
|
56
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
57
|
+
@append="openPanel($dataStore.t('form.RegionType'), [], 'registrationRegionType', $dataStore.getLocalityTypes)"
|
|
58
|
+
/>
|
|
59
|
+
<base-panel-input
|
|
60
|
+
v-if="member.registrationRegionType.nameRu !== 'город'"
|
|
61
|
+
v-model="member.registrationRegion"
|
|
62
|
+
:value="member.registrationRegion.nameRu"
|
|
63
|
+
:label="$dataStore.t('form.Region')"
|
|
64
|
+
:rules="$rules.objectRequired"
|
|
65
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
66
|
+
@append="openPanel($dataStore.t('form.Region'), [], 'registrationRegion', $dataStore.getRegions, 'registrationProvince')"
|
|
67
|
+
/>
|
|
68
|
+
<base-panel-input
|
|
69
|
+
v-model="member.registrationCity"
|
|
70
|
+
:value="member.registrationCity.nameRu"
|
|
71
|
+
:label="$dataStore.t('form.City')"
|
|
72
|
+
:rules="$rules.objectRequired"
|
|
73
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
74
|
+
@append="openPanel($dataStore.t('form.City'), [], 'registrationCity', $dataStore.getCities, 'registrationProvince')"
|
|
75
|
+
/>
|
|
76
|
+
<base-form-input v-model.trim="member.registrationQuarter" :label="$dataStore.t('form.Quarter')" />
|
|
77
|
+
<base-form-input v-model.trim="member.registrationMicroDistrict" :label="$dataStore.t('form.MicroDistrict')" />
|
|
78
|
+
<base-form-input v-model.trim="member.registrationStreet" :rules="$rules.required" :label="$dataStore.t('form.Street')" />
|
|
79
|
+
<base-form-input v-model.trim="member.registrationNumberHouse" :rules="$rules.required" :label="$dataStore.t('form.NumberHouse')" />
|
|
80
|
+
<base-form-input v-model.trim="member.registrationNumberApartment" :label="$dataStore.t('form.NumberApartment')" />
|
|
81
|
+
</div>
|
|
82
|
+
</base-fade-transition>
|
|
83
|
+
</base-form-section>
|
|
84
|
+
<base-form-section :title="$dataStore.t('form.birthData')">
|
|
85
|
+
<base-panel-input
|
|
86
|
+
v-model="member.birthPlace"
|
|
87
|
+
:value="member.birthPlace.nameRu"
|
|
88
|
+
:label="$dataStore.t('form.Country')"
|
|
89
|
+
:rules="$rules.objectRequired"
|
|
90
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
91
|
+
@append="openPanel($dataStore.t('form.Country'), [], 'birthPlace', $dataStore.getCountries)"
|
|
92
|
+
/>
|
|
93
|
+
<!-- TODO -->
|
|
94
|
+
<!-- <base-panel-input
|
|
95
|
+
v-model="member.birthRegion"
|
|
96
|
+
:value="member.birthRegion.nameRu"
|
|
97
|
+
:label="$dataStore.t('form.Region')"
|
|
98
|
+
|
|
99
|
+
:rules="$rules.objectRequired"
|
|
100
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
101
|
+
@append="openPanel($dataStore.t('form.Region'), [], 'birthRegion', $dataStore.getRegions)"
|
|
102
|
+
/> -->
|
|
103
|
+
</base-form-section>
|
|
104
|
+
<base-form-section :title="$dataStore.t('form.documentData')">
|
|
105
|
+
<base-panel-input
|
|
106
|
+
v-model="member.documentType"
|
|
107
|
+
:value="member.documentType.nameRu"
|
|
108
|
+
:label="$dataStore.t('form.documentType')"
|
|
109
|
+
:rules="$rules.objectRequired"
|
|
110
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
111
|
+
@append="openPanel($dataStore.t('form.documentType'), [], 'documentType', $dataStore.getDocumentTypes)"
|
|
112
|
+
/>
|
|
113
|
+
<base-form-input v-model.trim="member.documentNumber" :label="$dataStore.t('form.documentNumber')" :rules="$rules.required" />
|
|
114
|
+
<!-- <base-file-input v-if="!memberDocument" :disabled="isDisabled" :clearable="!isDisabled" @input="attachFile($event)" />
|
|
115
|
+
<base-empty-form-field v-if="memberDocument" @click="!isDisabled && openCustomPanel('document')" class="justify-between">
|
|
116
|
+
{{ `${memberDocument.fileTypeName} - ${memberDocument.fileName}` }}
|
|
117
|
+
<i class="cursor-pointer mdi mdi-file-document mr-6 text-[#a0b3d8] text-xl"></i>
|
|
118
|
+
</base-empty-form-field> -->
|
|
119
|
+
<base-panel-input
|
|
120
|
+
v-model="member.documentIssuers"
|
|
121
|
+
:value="member.documentIssuers.nameRu"
|
|
122
|
+
:label="$dataStore.t('form.documentIssuers')"
|
|
123
|
+
:rules="$rules.objectRequired"
|
|
124
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
125
|
+
@append="openPanel($dataStore.t('form.documentIssuers'), [], 'documentIssuers', $dataStore.getDocumentIssuers)"
|
|
126
|
+
/>
|
|
127
|
+
<base-form-input
|
|
128
|
+
v-model="member.documentDate"
|
|
129
|
+
:label="$dataStore.t('form.documentDate')"
|
|
130
|
+
:rules="$rules.required.concat($rules.date)"
|
|
131
|
+
:maska="$maska.date"
|
|
132
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
133
|
+
/>
|
|
134
|
+
<base-fade-transition>
|
|
135
|
+
<base-form-input
|
|
136
|
+
v-if="member.documentType.ids !== 'SBI' && member.documentType.ids !== 'VNZ'"
|
|
137
|
+
v-model="member.documentExpire"
|
|
138
|
+
:label="$dataStore.t('form.documentExpire')"
|
|
139
|
+
:rules="$rules.required.concat($rules.date)"
|
|
140
|
+
:maska="$maska.date"
|
|
141
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
142
|
+
/>
|
|
143
|
+
</base-fade-transition>
|
|
144
|
+
<base-panel-input
|
|
145
|
+
v-model="member.signOfResidency"
|
|
146
|
+
:value="member.signOfResidency.nameRu"
|
|
147
|
+
:label="$dataStore.t('form.signOfResidency')"
|
|
148
|
+
:rules="$rules.objectRequired"
|
|
149
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
150
|
+
@append="openPanel($dataStore.t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
|
|
151
|
+
/>
|
|
152
|
+
<base-panel-input
|
|
153
|
+
v-model="member.countryOfTaxResidency"
|
|
154
|
+
:value="member.countryOfTaxResidency.nameRu"
|
|
155
|
+
:label="$dataStore.t('form.countryOfTaxResidency')"
|
|
156
|
+
:rules="$rules.objectRequired"
|
|
157
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
158
|
+
@append="openPanel($dataStore.t('form.countryOfTaxResidency'), [], 'countryOfTaxResidency', $dataStore.getTaxCountries)"
|
|
159
|
+
/>
|
|
160
|
+
<base-fade-transition>
|
|
161
|
+
<base-panel-input
|
|
162
|
+
v-if="member.countryOfTaxResidency.ids === '500014.3'"
|
|
163
|
+
v-model="member.addTaxResidency"
|
|
164
|
+
:value="member.addTaxResidency.nameRu"
|
|
165
|
+
:label="$dataStore.t('form.addTaxResidency')"
|
|
166
|
+
:rules="$rules.objectRequired"
|
|
167
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
168
|
+
@append="openPanel($dataStore.t('form.addTaxResidency'), [], 'addTaxResidency', $dataStore.getAdditionalTaxCountries)"
|
|
169
|
+
/>
|
|
170
|
+
</base-fade-transition>
|
|
171
|
+
<base-panel-input
|
|
172
|
+
v-model="member.countryOfCitizenship"
|
|
173
|
+
:value="member.countryOfCitizenship.nameRu"
|
|
174
|
+
:label="$dataStore.t('form.countryOfCitizenship')"
|
|
175
|
+
:rules="$rules.objectRequired"
|
|
176
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
177
|
+
@append="openPanel($dataStore.t('form.countryOfCitizenship'), [], 'countryOfCitizenship', $dataStore.getCitizenshipCountries)"
|
|
178
|
+
/>
|
|
179
|
+
<base-panel-input
|
|
180
|
+
v-model="member.economySectorCode"
|
|
181
|
+
:value="member.economySectorCode.nameRu"
|
|
182
|
+
:label="$dataStore.t('form.economySectorCode')"
|
|
183
|
+
:rules="$rules.objectRequired"
|
|
184
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
185
|
+
@append="openPanel($dataStore.t('form.economySectorCode'), [], 'economySectorCode', $dataStore.getSectorCodeList)"
|
|
186
|
+
/>
|
|
187
|
+
</base-form-section>
|
|
188
|
+
<base-form-section :title="$dataStore.t('form.contactsData')">
|
|
189
|
+
<base-form-input v-model="member.homePhone" :maska="$maska.phone" placeholder="+7 7" :label="$dataStore.t('form.homePhone')" :rules="$rules.phoneFormat" />
|
|
190
|
+
<base-form-input v-model.trim="member.email" :label="$dataStore.t('form.email')" :rules="$rules.email" />
|
|
191
|
+
</base-form-section>
|
|
192
|
+
</v-form>
|
|
193
|
+
<base-btn v-if="showSaveButton" :loading="isButtonLoading" :text="$dataStore.t('buttons.save')" @click="submitForm" />
|
|
194
|
+
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
195
|
+
<div :class="[$styles.scrollPage]" class="relative flex flex-col items-center">
|
|
196
|
+
<i
|
|
197
|
+
v-if="type === 'panel'"
|
|
198
|
+
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"
|
|
199
|
+
@click="closeDictPanel"
|
|
200
|
+
></i>
|
|
201
|
+
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2 mt-2" :hide-details="true" />
|
|
202
|
+
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
203
|
+
<base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
|
|
204
|
+
<base-panel-select-item
|
|
205
|
+
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery ?? '', 'i')))"
|
|
206
|
+
:key="index"
|
|
207
|
+
:text="(item.nameRu as string)"
|
|
208
|
+
:selected="item.nameRu === panelValue.nameRu"
|
|
209
|
+
@click="pickPanelValue(item)"
|
|
210
|
+
/>
|
|
211
|
+
</div>
|
|
212
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
213
|
+
</div>
|
|
214
|
+
</Teleport>
|
|
215
|
+
</section>
|
|
216
|
+
<base-scroll-buttons @up="scrollForm('up')" @down="scrollForm('down')" />
|
|
217
|
+
</template>
|
|
218
|
+
|
|
219
|
+
<script lang="ts">
|
|
220
|
+
import { Member, Value } from '../../composables/classes';
|
|
221
|
+
|
|
222
|
+
export default defineComponent({
|
|
223
|
+
props: {
|
|
224
|
+
member: {
|
|
225
|
+
type: Object as PropType<Member>,
|
|
226
|
+
default: {},
|
|
227
|
+
},
|
|
228
|
+
type: {
|
|
229
|
+
type: String as PropType<'default' | 'panel'>,
|
|
230
|
+
default: 'default',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
emits: ['success'],
|
|
234
|
+
setup(props, { emit }) {
|
|
235
|
+
const dataStore = useDataStore();
|
|
236
|
+
|
|
237
|
+
const vForm = ref<any>();
|
|
238
|
+
const searchQuery = ref<string>();
|
|
239
|
+
const currentPanel = ref<keyof typeof props.member>();
|
|
240
|
+
const showForm = ref<boolean>(true);
|
|
241
|
+
const isPanelOpen = ref<boolean>(false);
|
|
242
|
+
const isPanelLoading = ref<boolean>(false);
|
|
243
|
+
const isButtonLoading = ref<boolean>(false);
|
|
244
|
+
const panelValue = ref<Value>(new Value());
|
|
245
|
+
const panelList = ref<Value[]>([]);
|
|
246
|
+
|
|
247
|
+
const showSaveButton = computed(() => {
|
|
248
|
+
const generalCondition = dataStore.isAgent();
|
|
249
|
+
return generalCondition;
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
const scrollForm = (direction: 'up' | 'down') => {
|
|
253
|
+
vForm.value.scrollTo({ top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' });
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const closeDictPanel = () => {
|
|
257
|
+
isPanelOpen.value = false;
|
|
258
|
+
showForm.value = true;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
262
|
+
searchQuery.value = '';
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
currentPanel.value = key as keyof typeof props.member;
|
|
265
|
+
isPanelOpen.value = true;
|
|
266
|
+
dataStore.panelAction = null;
|
|
267
|
+
if (props.type === 'default') {
|
|
268
|
+
dataStore.panel.open = true;
|
|
269
|
+
dataStore.panel.title = title;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
let newList = list;
|
|
273
|
+
if (asyncFunction) {
|
|
274
|
+
isPanelLoading.value = true;
|
|
275
|
+
newList = await asyncFunction(filterKey, props.member);
|
|
276
|
+
}
|
|
277
|
+
if (props.type === 'panel') {
|
|
278
|
+
showForm.value = false;
|
|
279
|
+
}
|
|
280
|
+
panelList.value = newList;
|
|
281
|
+
panelValue.value = props.member[currentPanel.value!];
|
|
282
|
+
isPanelLoading.value = false;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const pickPanelValue = (item: Value) => {
|
|
286
|
+
if (props.type === 'default') {
|
|
287
|
+
dataStore.panel.open = false;
|
|
288
|
+
}
|
|
289
|
+
showForm.value = true;
|
|
290
|
+
isPanelOpen.value = false;
|
|
291
|
+
// @ts-ignore
|
|
292
|
+
props.member[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const validateESBD = async (docTypeNumber: number) => {
|
|
296
|
+
const data: ESBDValidationType = {
|
|
297
|
+
personType: 1,
|
|
298
|
+
iin: props.member.iin!.replaceAll('-', ''),
|
|
299
|
+
lastName: props.member.lastName ?? '',
|
|
300
|
+
firstName: props.member.firstName ?? '',
|
|
301
|
+
middleName: props.member.middleName ?? '',
|
|
302
|
+
birthDate: props.member.getDateByKey('birthDate') ?? '',
|
|
303
|
+
sex: Number(props.member.gender.id),
|
|
304
|
+
docType: docTypeNumber,
|
|
305
|
+
docNumber: props.member.documentNumber ?? '',
|
|
306
|
+
docIssuedDate: props.member.getDateByKey('documentDate') ?? '',
|
|
307
|
+
docIssuedBy: props.member.documentIssuers.nameRu ?? '',
|
|
308
|
+
activityKindId: 0,
|
|
309
|
+
economicsSectorId: Number((props.member.economySectorCode.ids! as string).at(-1)),
|
|
310
|
+
resident: props.member.signOfResidency.ids === '500011.2' || props.member.signOfResidency.ids === null ? 0 : 1,
|
|
311
|
+
countryId: Number((props.member.countryOfTaxResidency.ids! as string).at(-1)),
|
|
312
|
+
};
|
|
313
|
+
return await dataStore.getValidateClientESBD(data);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const saveMember = async () => {
|
|
317
|
+
const hasSaved = await dataStore.saveContragent(props.member, 'contragent', null, true);
|
|
318
|
+
if (hasSaved === false) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
dataStore.showToaster('success', dataStore.t('toaster.successSaved'));
|
|
322
|
+
dataStore.isLoading = false;
|
|
323
|
+
scrollForm('up');
|
|
324
|
+
emit('success', hasSaved);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
const submitForm = async () => {
|
|
328
|
+
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
329
|
+
if (v.valid) {
|
|
330
|
+
isButtonLoading.value = true;
|
|
331
|
+
const docType = props.member.documentType.ids;
|
|
332
|
+
if (props.member.gotFromInsis === true && (docType === '1UDL' || docType === 'SBI')) {
|
|
333
|
+
dataStore.isLoading = true;
|
|
334
|
+
const ESBDResponse = await validateESBD(docType === '1UDL' ? 1 : 3);
|
|
335
|
+
if (!ESBDResponse) {
|
|
336
|
+
dataStore.isLoading = false;
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const initialPoint = `${props.member.iin!.replaceAll('-', '')}.`;
|
|
340
|
+
const RESPONSE = ESBDMessage(ESBDResponse, initialPoint);
|
|
341
|
+
let errorMessage = RESPONSE !== false ? RESPONSE : 'Что-то произошло не так';
|
|
342
|
+
if (typeof ESBDResponse === 'object' && ESBDResponse.errorCode === 0) {
|
|
343
|
+
props.member.verifyType = 'ESBD';
|
|
344
|
+
props.member.verifyDate = ESBDResponse.verifiedDate;
|
|
345
|
+
const hasMemberSaved = await saveMember();
|
|
346
|
+
} else {
|
|
347
|
+
dataStore.isLoading = false;
|
|
348
|
+
dataStore.showToaster('error', errorMessage, 5000);
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
const hasMemberSaved = await saveMember();
|
|
352
|
+
}
|
|
353
|
+
isButtonLoading.value = false;
|
|
354
|
+
} else {
|
|
355
|
+
const errors = document.querySelector('.v-input--error');
|
|
356
|
+
if (errors) {
|
|
357
|
+
const errorText = errors.querySelector('.v-label.v-field-label');
|
|
358
|
+
if (errorText) {
|
|
359
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
360
|
+
} else {
|
|
361
|
+
const errorFieldText = errors.querySelector('.v-input__control');
|
|
362
|
+
if (errorFieldText) {
|
|
363
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
errors.scrollIntoView({
|
|
367
|
+
behavior: 'smooth',
|
|
368
|
+
block: 'center',
|
|
369
|
+
inline: 'nearest',
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
watch(
|
|
377
|
+
() => props.member!.birthDate,
|
|
378
|
+
val => {
|
|
379
|
+
if (props.member && val && val.length === useMask().date.length) {
|
|
380
|
+
const calculatedAge = props.member.getAgeByBirthDate();
|
|
381
|
+
if (calculatedAge) props.member.age = calculatedAge;
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
watch(
|
|
387
|
+
() => dataStore.panel.open,
|
|
388
|
+
() => {
|
|
389
|
+
if (dataStore.panel.open === false) {
|
|
390
|
+
isPanelOpen.value = false;
|
|
391
|
+
dataStore.panelAction = null;
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
{ immediate: true },
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
watch(searchQuery, () => {
|
|
398
|
+
if (searchQuery.value === null) {
|
|
399
|
+
searchQuery.value = '';
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
return {
|
|
404
|
+
// State
|
|
405
|
+
vForm,
|
|
406
|
+
showForm,
|
|
407
|
+
panelList,
|
|
408
|
+
panelValue,
|
|
409
|
+
searchQuery,
|
|
410
|
+
isPanelOpen,
|
|
411
|
+
isPanelLoading,
|
|
412
|
+
isButtonLoading,
|
|
413
|
+
|
|
414
|
+
//Computed
|
|
415
|
+
showSaveButton,
|
|
416
|
+
|
|
417
|
+
// Functions
|
|
418
|
+
openPanel,
|
|
419
|
+
submitForm,
|
|
420
|
+
scrollForm,
|
|
421
|
+
pickPanelValue,
|
|
422
|
+
closeDictPanel,
|
|
423
|
+
};
|
|
424
|
+
},
|
|
425
|
+
});
|
|
426
|
+
</script>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" :class="[$
|
|
3
|
-
<base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$
|
|
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="[$
|
|
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="[$
|
|
11
|
+
:class="[$styles.greenTextHover]"
|
|
12
12
|
@click="openPanel(document)"
|
|
13
13
|
></i>
|
|
14
14
|
</div>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
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="[$
|
|
20
|
+
<div :class="[$styles.flexColNav]">
|
|
21
21
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
|
|
22
22
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
|
|
23
23
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="w-full px-[10px] pt-[14px] flex flex-col gap-4" :class="[$
|
|
2
|
+
<section class="w-full px-[10px] pt-[14px] flex flex-col gap-4" :class="[$styles.scrollPage]" v-if="!!invoiceData">
|
|
3
3
|
<lazy-base-form-section :title="$dataStore.t('labels.jsonObject')">
|
|
4
4
|
<template #icon>
|
|
5
5
|
<v-btn icon="mdi mdi-content-copy !text-[18px]" size="x-small" variant="plain" color="#A0B3D8" @click="$dataStore.copyToClipboard(JSON.stringify(invoiceData))" />
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
3
|
<v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
|
|
4
4
|
<div v-if="memberSetting && memberSetting.has === true && memberSetting.isMultiple === true" class="flex items-center mt-[14px] min-h-[54px]">
|
|
5
|
-
<div :class="[$
|
|
5
|
+
<div :class="[$styles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
|
|
6
6
|
<div
|
|
7
7
|
v-for="(each, index) of formStore[whichForm]"
|
|
8
8
|
:key="index"
|
|
9
9
|
class="pl-3 pr-1 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
10
|
-
:class="[Number(whichIndex) === index ? `${$
|
|
10
|
+
:class="[Number(whichIndex) === index ? `${$styles.blueBg} ${$styles.whiteText}` : '', $styles.textSimple]"
|
|
11
11
|
@click.self="index !== Number(whichIndex) ? selectMember(index) : null"
|
|
12
12
|
>
|
|
13
13
|
{{ `${$dataStore.menu.selectedItem.title} ${index + 1}` }}
|
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
</v-form>
|
|
482
482
|
<base-btn v-if="showSaveButton" :loading="isButtonLoading || isSubmittingForm" :text="$dataStore.t('buttons.save')" @click="submitForm" />
|
|
483
483
|
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
484
|
-
<div :class="[$
|
|
484
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
485
485
|
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
486
486
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
487
487
|
<base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
|
|
@@ -497,20 +497,20 @@
|
|
|
497
497
|
</div>
|
|
498
498
|
</Teleport>
|
|
499
499
|
<Teleport v-if="isSearchOpen" to="#panel-actions">
|
|
500
|
-
<div :class="[$
|
|
500
|
+
<div :class="[$styles.flexColNav]">
|
|
501
501
|
<base-btn v-if="hasGBDFL" :loading="isButtonLoading" :text="$dataStore.t('buttons.fromGBDFL')" @click="getContragentFromGBDFL" />
|
|
502
502
|
<base-btn v-if="hasInsis" :loading="isButtonLoading" :text="$dataStore.t('buttons.fromInsis')" @click="getContragent" />
|
|
503
503
|
<base-btn v-if="hasGKB" :loading="isButtonLoading" :text="$dataStore.t('buttons.fromGKB')" @click="getFamilyInfo" />
|
|
504
504
|
</div>
|
|
505
505
|
</Teleport>
|
|
506
506
|
<Teleport v-if="isDocumentOpen" to="#panel-actions">
|
|
507
|
-
<div :class="[$
|
|
507
|
+
<div :class="[$styles.flexColNav]">
|
|
508
508
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
|
|
509
509
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
|
|
510
510
|
</div>
|
|
511
511
|
</Teleport>
|
|
512
512
|
<Teleport v-if="isOtpPanelOpen && !member.hasAgreement" to="#panel-actions">
|
|
513
|
-
<div :class="[$
|
|
513
|
+
<div :class="[$styles.flexColNav]">
|
|
514
514
|
<base-fade-transition>
|
|
515
515
|
<base-rounded-input
|
|
516
516
|
v-if="otpCondition && member.otpTokenId"
|
|
@@ -610,7 +610,6 @@ export default {
|
|
|
610
610
|
return true;
|
|
611
611
|
}
|
|
612
612
|
case formStore.insuredFormKey:
|
|
613
|
-
case formStore.beneficiaryFormKey:
|
|
614
613
|
case formStore.beneficialOwnerFormKey:
|
|
615
614
|
case formStore.policyholdersRepresentativeFormKey:
|
|
616
615
|
return true;
|
|
@@ -712,6 +711,9 @@ export default {
|
|
|
712
711
|
if (dataStore.isGons || dataStore.isBolashak) {
|
|
713
712
|
return [];
|
|
714
713
|
}
|
|
714
|
+
if ((dataStore.isKazyna || dataStore.isLiferenta) && member.value.age < 18) {
|
|
715
|
+
return [];
|
|
716
|
+
}
|
|
715
717
|
}
|
|
716
718
|
return basePhoneRule;
|
|
717
719
|
});
|
|
@@ -1075,6 +1077,11 @@ export default {
|
|
|
1075
1077
|
return true;
|
|
1076
1078
|
}
|
|
1077
1079
|
}
|
|
1080
|
+
if (dataStore.isKazyna || dataStore.isLiferenta) {
|
|
1081
|
+
if (whichForm.value === formStore.beneficiaryFormKey && member.value.age < 18) {
|
|
1082
|
+
return true;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1078
1085
|
if (member.value.hasAgreement !== true) {
|
|
1079
1086
|
dataStore.showToaster('error', dataStore.t('toaster.needAgreement'));
|
|
1080
1087
|
return false;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<base-content :title="$dataStore.t('agreementBlock.title')" class="!w-full">
|
|
3
|
-
<p class="h-full p-4 lg:p-8 leading-8 font-medium" :class="[$
|
|
4
|
-
{{ $dataStore.t('agreementBlock.text') }}
|
|
5
|
-
</p>
|
|
3
|
+
<p class="h-full p-4 lg:p-8 leading-8 font-medium" :class="[$styles.scrollPage, $styles.textSimple]"> {{ $dataStore.t('agreementBlock.text') }}</p>
|
|
6
4
|
</base-content>
|
|
7
5
|
</template>
|
|
8
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
3
|
<v-form ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
|
|
4
|
-
<base-form-section v-if="whichProduct === 'gons'" :title="$dataStore.t('productConditionsForm.requestedProductConditions')" :class="[$
|
|
4
|
+
<base-form-section v-if="whichProduct === 'gons'" :title="$dataStore.t('productConditionsForm.requestedProductConditions')" :class="[$styles.textSimple]">
|
|
5
5
|
<base-form-text-section
|
|
6
6
|
class="mb-4"
|
|
7
7
|
title="Инвалидность I или II группы по причине несчастного случая, начиная с третьего года по любой причине, с освобождением от уплаты страховых взносов"
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
v-model="additionalTerms[index]"
|
|
289
289
|
:value="term.coverSumName"
|
|
290
290
|
:readonly="isTermsDisabled"
|
|
291
|
-
:clearable="
|
|
291
|
+
:clearable="false"
|
|
292
292
|
:label="term.coverTypeName"
|
|
293
293
|
append-inner-icon="mdi mdi-chevron-right"
|
|
294
294
|
:suffix="!!term.amount ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}` : ''"
|
|
@@ -297,12 +297,7 @@
|
|
|
297
297
|
</div>
|
|
298
298
|
</base-form-section>
|
|
299
299
|
</v-form>
|
|
300
|
-
<base-btn
|
|
301
|
-
v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated"
|
|
302
|
-
:btn="$libStyles.greenLightBtn"
|
|
303
|
-
:text="$dataStore.t('buttons.toStatement')"
|
|
304
|
-
@click="toStatement"
|
|
305
|
-
/>
|
|
300
|
+
<base-btn v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
|
|
306
301
|
<base-btn
|
|
307
302
|
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
|
|
308
303
|
:loading="isCalculating"
|
|
@@ -314,7 +309,7 @@
|
|
|
314
309
|
<base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
315
310
|
</div>
|
|
316
311
|
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
317
|
-
<div :class="[$
|
|
312
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
318
313
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
319
314
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
320
315
|
<base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
|
|
@@ -330,7 +325,7 @@
|
|
|
330
325
|
</div>
|
|
331
326
|
</Teleport>
|
|
332
327
|
<Teleport v-if="isTermsPanelOpen" to="#panel-actions">
|
|
333
|
-
<div :class="[$
|
|
328
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
334
329
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
335
330
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
336
331
|
<base-panel-select-item
|
|
@@ -357,7 +352,7 @@ export default defineComponent({
|
|
|
357
352
|
default: false,
|
|
358
353
|
},
|
|
359
354
|
product: {
|
|
360
|
-
type: String
|
|
355
|
+
type: String as PropType<Projects>,
|
|
361
356
|
default: false,
|
|
362
357
|
},
|
|
363
358
|
},
|
|
@@ -369,7 +364,7 @@ export default defineComponent({
|
|
|
369
364
|
const dataStore = useDataStore();
|
|
370
365
|
const memberStore = useMemberStore();
|
|
371
366
|
|
|
372
|
-
const whichProduct = ref<
|
|
367
|
+
const whichProduct = ref<Projects | null>(dataStore.isCalculator ? props.product : dataStore.product!);
|
|
373
368
|
const isCalculating = ref<boolean>(false);
|
|
374
369
|
const isPanelLoading = ref<boolean>(false);
|
|
375
370
|
const isPanelOpen = ref<boolean>(false);
|