hl-core 0.0.8-beta.1 → 0.0.8-beta.11
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/index.ts +27 -13
- package/api/interceptors.ts +1 -1
- package/components/Dialog/Dialog.vue +1 -1
- package/components/Form/FormBlock.vue +52 -27
- package/components/Form/ManagerAttachment.vue +196 -0
- package/components/Form/ProductConditionsBlock.vue +8 -4
- package/components/Input/Datepicker.vue +41 -0
- package/components/Input/FormInput.vue +15 -3
- package/components/Layout/SettingsPanel.vue +2 -2
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +12 -4
- package/components/Pages/Anketa.vue +13 -5
- package/components/Pages/Documents.vue +1 -1
- package/components/Pages/MemberForm.vue +107 -12
- package/components/Pages/ProductConditions.vue +334 -17
- package/components/Panel/PanelHandler.vue +25 -11
- package/composables/classes.ts +94 -23
- package/composables/constants.ts +9 -1
- package/composables/index.ts +3 -2
- package/composables/styles.ts +10 -2
- package/configs/i18n.ts +19 -0
- package/layouts/default.vue +1 -1
- package/locales/en.json +408 -0
- package/locales/kz.json +408 -0
- package/locales/ru.json +408 -0
- package/nuxt.config.ts +12 -0
- package/package.json +9 -3
- package/pages/500.vue +1 -1
- package/plugins/helperFunctionsPlugins.ts +5 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +5 -0
- package/store/data.store.js +344 -508
- package/store/member.store.ts +95 -5
- package/store/rules.js +27 -12
- package/types/index.ts +32 -0
- package/store/messages.ts +0 -433
package/store/member.store.ts
CHANGED
|
@@ -113,23 +113,38 @@ export const useMemberStore = defineStore('members', {
|
|
|
113
113
|
return 'Spokesman';
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
+
getMemberApplicationCode(whichForm: MemberKeys) {
|
|
117
|
+
switch (whichForm) {
|
|
118
|
+
case this.formStore.policyholderFormKey:
|
|
119
|
+
return 'clientApp';
|
|
120
|
+
case this.formStore.insuredFormKey:
|
|
121
|
+
return 'insuredApp';
|
|
122
|
+
case this.formStore.beneficiaryFormKey:
|
|
123
|
+
return 'beneficiaryApp';
|
|
124
|
+
case this.formStore.beneficialOwnerFormKey:
|
|
125
|
+
return 'beneficialOwnerApp';
|
|
126
|
+
case this.formStore.policyholdersRepresentativeFormKey:
|
|
127
|
+
return 'spokesmanApp';
|
|
128
|
+
}
|
|
129
|
+
},
|
|
116
130
|
clearMember(whichForm: MemberKeys, whichIndex?: number) {
|
|
117
131
|
if (!whichForm) return false;
|
|
118
132
|
if (!this.isStatementEditible(whichForm)) return false;
|
|
119
133
|
if (!this.validateInitiator()) return false;
|
|
120
134
|
if (whichForm === this.formStore.policyholderFormKey || whichForm === this.formStore.policyholdersRepresentativeFormKey) {
|
|
121
|
-
|
|
135
|
+
//@ts-ignore
|
|
136
|
+
this.formStore[whichForm] = this.getMemberClass(whichForm);
|
|
122
137
|
}
|
|
123
138
|
if (typeof whichIndex === 'number') {
|
|
124
139
|
if (this.formStore[whichForm].length === 1) {
|
|
125
|
-
this.formStore[whichForm][whichIndex].
|
|
140
|
+
this.formStore[whichForm][whichIndex] = this.getMemberClass(whichForm);
|
|
126
141
|
} else {
|
|
127
142
|
this.formStore[whichForm].splice(whichIndex, 1);
|
|
128
143
|
}
|
|
129
144
|
}
|
|
130
145
|
return true;
|
|
131
146
|
},
|
|
132
|
-
async deleteMember(taskId: string, whichForm: MemberKeys, whichIndex?: number) {
|
|
147
|
+
async deleteMember(taskId: string, whichForm: MemberKeys, whichIndex?: number, refetch: boolean = true) {
|
|
133
148
|
if (!whichForm) return false;
|
|
134
149
|
if (!this.isStatementEditible(whichForm)) return false;
|
|
135
150
|
if (!this.validateInitiator()) return false;
|
|
@@ -144,13 +159,88 @@ export const useMemberStore = defineStore('members', {
|
|
|
144
159
|
} else {
|
|
145
160
|
if (memberData) await this.dataStore.api.deleteMember(memberCode, memberData.id as number);
|
|
146
161
|
}
|
|
147
|
-
if (memberData) await this.dataStore.getApplicationData(taskId, true, true, true, false);
|
|
162
|
+
if (memberData && refetch) await this.dataStore.getApplicationData(taskId, true, true, true, false);
|
|
148
163
|
return this.clearMember(whichForm, whichIndex);
|
|
149
164
|
} catch (err) {
|
|
150
165
|
console.log(err);
|
|
151
166
|
return ErrorHandler(err);
|
|
152
167
|
}
|
|
153
168
|
},
|
|
169
|
+
async transferPolicyholder(to: MemberKeys) {
|
|
170
|
+
if (!to) return false;
|
|
171
|
+
if (!this.validateInitiator()) return false;
|
|
172
|
+
const fromMember = this.formStore.policyholderForm;
|
|
173
|
+
const successTranser = ref<boolean>(false);
|
|
174
|
+
const toIndex = ref<number | null>(null);
|
|
175
|
+
const taskId = useRoute().params.taskId as string;
|
|
176
|
+
|
|
177
|
+
if (this.dataStore.members[this.getMemberApplicationCode(to)!].isMultiple === false) {
|
|
178
|
+
if (this.formStore[to][0].id !== 0 && this.formStore[to][0].iin !== fromMember.iin) {
|
|
179
|
+
await this.deleteMember(taskId, to, 0, false);
|
|
180
|
+
}
|
|
181
|
+
this.formStore[to][0] = fromMember;
|
|
182
|
+
toIndex.value = 0;
|
|
183
|
+
successTranser.value = true;
|
|
184
|
+
} else {
|
|
185
|
+
if (this.formStore[to].every((member: Member) => member.id !== 0)) {
|
|
186
|
+
this.formStore[to].push(fromMember);
|
|
187
|
+
toIndex.value = this.formStore[to].length - 1;
|
|
188
|
+
successTranser.value = true;
|
|
189
|
+
} else {
|
|
190
|
+
const index = this.formStore[to].findIndex((member: Member) => member.id === 0);
|
|
191
|
+
if (index !== -1) {
|
|
192
|
+
this.formStore[to][index] = fromMember;
|
|
193
|
+
toIndex.value = index;
|
|
194
|
+
successTranser.value = true;
|
|
195
|
+
} else {
|
|
196
|
+
this.formStore[to].push(fromMember);
|
|
197
|
+
toIndex.value = this.formStore[to].length - 1;
|
|
198
|
+
successTranser.value = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (successTranser.value === true) {
|
|
204
|
+
if (toIndex.value !== null && taskId !== '0' && this.formStore.applicationData.processInstanceId !== 0) {
|
|
205
|
+
const hasSaved = await this.dataStore.saveMember(this.formStore[to][toIndex.value], this.getMemberCode(to), this.getMemberFromApplication(to, toIndex.value));
|
|
206
|
+
if (hasSaved) {
|
|
207
|
+
await this.dataStore.getApplicationData(taskId, false, true, true, false);
|
|
208
|
+
this.dataStore.showToaster('success', this.dataStore.t('toaster.successSaved'));
|
|
209
|
+
this.dataStore.showToaster('warning', this.dataStore.t('toaster.formFieldEmptyWarning'), 3000);
|
|
210
|
+
return true;
|
|
211
|
+
} else {
|
|
212
|
+
this.dataStore.showToaster('error', this.dataStore.t('error.memberSave'));
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
this.dataStore.showToaster('error', this.dataStore.t('error.memberCopy'));
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
async retransferPolicyholder(from: MemberKeys) {
|
|
224
|
+
if (!from) return false;
|
|
225
|
+
if (!this.validateInitiator()) return false;
|
|
226
|
+
const client = this.formStore.policyholderForm;
|
|
227
|
+
const index = this.formStore[from].findIndex((member: Member) => member.id === client.id);
|
|
228
|
+
const taskId = useRoute().params.taskId as string;
|
|
229
|
+
if (index !== -1) {
|
|
230
|
+
const fromCode = this.getMemberApplicationCode(from);
|
|
231
|
+
const fromMember = this.formStore[from][index];
|
|
232
|
+
const applicationList = this.formStore.applicationData[fromCode!];
|
|
233
|
+
const fromIndex = applicationList && applicationList.length ? applicationList.findIndex((member: any) => member.insisId === fromMember.id) : null;
|
|
234
|
+
if (fromMember.id !== 0 && fromIndex !== -1) {
|
|
235
|
+
await this.deleteMember(taskId, from, index);
|
|
236
|
+
} else {
|
|
237
|
+
this.clearMember(from, index);
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
// @ts-ignore
|
|
241
|
+
this.formStore[from] = [this.getMemberClass(from)];
|
|
242
|
+
}
|
|
243
|
+
},
|
|
154
244
|
addMember(whichForm: MemberKeys) {
|
|
155
245
|
if (!whichForm) return false;
|
|
156
246
|
if (!this.isStatementEditible(whichForm)) return false;
|
|
@@ -264,7 +354,7 @@ export const useMemberStore = defineStore('members', {
|
|
|
264
354
|
}
|
|
265
355
|
} else {
|
|
266
356
|
if (onInit === false) {
|
|
267
|
-
this.dataStore.showToaster('error', this.dataStore.t('toaster.errorFormField'
|
|
357
|
+
this.dataStore.showToaster('error', this.dataStore.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }));
|
|
268
358
|
this.dataStore.isLoading = false;
|
|
269
359
|
}
|
|
270
360
|
}
|
package/store/rules.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i18n } from '@/configs/i18n';
|
|
2
2
|
import { formatDate } from '../composables';
|
|
3
3
|
|
|
4
|
+
const t = i18n.t;
|
|
5
|
+
|
|
4
6
|
export const rules = {
|
|
5
|
-
recalculationMultiply: [v => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher'
|
|
6
|
-
recalculationAdditive: [
|
|
7
|
-
v =>
|
|
8
|
-
(v !== null && v !== '' && v <= 100 && v >= 0) ||
|
|
9
|
-
t('toaster.valueShouldBeBetween', {
|
|
10
|
-
floor: 0,
|
|
11
|
-
ceil: 100,
|
|
12
|
-
}),
|
|
13
|
-
],
|
|
7
|
+
recalculationMultiply: [v => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher', { text: '100' })],
|
|
8
|
+
recalculationAdditive: [v => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween', { floor: '0', ceil: '100' })],
|
|
14
9
|
required: [v => !!v || t('rules.required')],
|
|
15
10
|
objectRequired: [
|
|
16
11
|
v => {
|
|
@@ -20,12 +15,20 @@ export const rules = {
|
|
|
20
15
|
return t('rules.required');
|
|
21
16
|
},
|
|
22
17
|
],
|
|
18
|
+
agentDataRequired: [
|
|
19
|
+
v => {
|
|
20
|
+
if (!!v && 'fullName' in v && v.fullName != null) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return t('rules.required');
|
|
24
|
+
},
|
|
25
|
+
],
|
|
23
26
|
noResident: [
|
|
24
27
|
v => {
|
|
25
|
-
if (!!v && 'nameRu' in v && v.nameRu
|
|
28
|
+
if (!!v && 'nameRu' in v && v.nameRu === 'Нерезидент') {
|
|
26
29
|
return t('rules.noResident');
|
|
27
30
|
}
|
|
28
|
-
if (!!v && 'nameRu' in v && v.nameRu
|
|
31
|
+
if (!!v && 'nameRu' in v && !!v.nameRu) {
|
|
29
32
|
return true;
|
|
30
33
|
}
|
|
31
34
|
return t('rules.required');
|
|
@@ -115,6 +118,18 @@ export const rules = {
|
|
|
115
118
|
}
|
|
116
119
|
},
|
|
117
120
|
],
|
|
121
|
+
coverPeriodFrom2to20: [
|
|
122
|
+
v => {
|
|
123
|
+
if (v !== null) {
|
|
124
|
+
if (v < 2 || v > 20) {
|
|
125
|
+
return t('productConditionsForm.coverPeriodFrom2to20');
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
} else {
|
|
129
|
+
return t('productConditionsForm.coverPeriodFrom2to20');
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
],
|
|
118
133
|
coverPeriodFrom3to20: [
|
|
119
134
|
v => {
|
|
120
135
|
if (v !== null) {
|
package/types/index.ts
CHANGED
|
@@ -300,4 +300,36 @@ declare global {
|
|
|
300
300
|
taskId: string;
|
|
301
301
|
comment?: string;
|
|
302
302
|
};
|
|
303
|
+
|
|
304
|
+
type AgentData = {
|
|
305
|
+
agentId?: number | null;
|
|
306
|
+
manId?: number;
|
|
307
|
+
fullName?: string;
|
|
308
|
+
officeId?: number | null;
|
|
309
|
+
officeCode?: string | null;
|
|
310
|
+
saleChannel?: string;
|
|
311
|
+
staffId?: number;
|
|
312
|
+
managerName?: string;
|
|
313
|
+
mainAgentId?: string | null;
|
|
314
|
+
agentNo?: string;
|
|
315
|
+
iin?: string | null;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type UserDocument = {
|
|
319
|
+
id: number | null;
|
|
320
|
+
contragentId: number | null;
|
|
321
|
+
type: string;
|
|
322
|
+
typeName: string;
|
|
323
|
+
serial: string | number | null;
|
|
324
|
+
number: string;
|
|
325
|
+
issueDate: string;
|
|
326
|
+
expireDate: string;
|
|
327
|
+
issuerId: number;
|
|
328
|
+
issuerName: string;
|
|
329
|
+
issuerNameRu: string;
|
|
330
|
+
description: string | null;
|
|
331
|
+
note: string | null;
|
|
332
|
+
verifyType: string;
|
|
333
|
+
verifyDate: string;
|
|
334
|
+
};
|
|
303
335
|
}
|