hl-core 0.0.7-beta.11 → 0.0.7-beta.13

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 CHANGED
@@ -7,13 +7,8 @@ enum Methods {
7
7
  }
8
8
 
9
9
  export class ApiClass {
10
- baseURL: string | undefined;
11
- productUrl: string | undefined;
12
-
13
- constructor(baseURL?: string | undefined, productUrl?: string | undefined) {
14
- this.baseURL = baseURL;
15
- this.productUrl = productUrl;
16
- }
10
+ private readonly baseURL: string = import.meta.env.VITE_BASE_URL as string;
11
+ private readonly productUrl: string = import.meta.env.VITE_PRODUCT_URL as string;
17
12
 
18
13
  private async axiosCall(config: AxiosRequestConfig) {
19
14
  const dataStore = useDataStore();
@@ -19,6 +19,8 @@ export default function (axios: AxiosInstance) {
19
19
  const dataStore = useDataStore();
20
20
  const router = useRouter();
21
21
  if (error.response.status === 401) {
22
+ dataStore.$reset();
23
+ localStorage.clear();
22
24
  if (dataStore.isEFO) {
23
25
  router.push({ name: 'Auth', query: { error: 401 } });
24
26
  } else {
@@ -30,8 +32,6 @@ export default function (axios: AxiosInstance) {
30
32
  router.push({ name: '500', query: { stack: error.stack } });
31
33
  }
32
34
  }
33
- dataStore.$reset();
34
- localStorage.clear();
35
35
  return Promise.reject(error);
36
36
  },
37
37
  );
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div class="pt-3 pl-5 rounded border-[1px]" :class="[$libStyles.whiteBg]">
3
+ <div>
4
+ <p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
5
+ <p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
6
+ </div>
7
+ <div class="mt-6 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center">
8
+ <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.fullName') }}</span>
9
+ <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.iin') }}</span>
10
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
11
+ <span :class="[$libStyles.textSimple]" class="font-medium"> {{ $t('form.birthDate') }} </span>
12
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
13
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
14
+ </div>
15
+ <div v-if="isMultiple" class="flex flex-col">
16
+ <div v-for="(each, index) of member" :key="index" class="grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
17
+ <span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
18
+ <span :class="[getMemberInfo(each).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
19
+ <span :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
20
+ <span :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
21
+ <span :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
22
+ <span :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
23
+ <div
24
+ class="transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
25
+ :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
26
+ @click="$emit('onMore', { whichForm, index })"
27
+ >
28
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <div v-else class="grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
33
+ <span :class="[getMemberInfo(member).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).fullName }}</span>
34
+ <span :class="[getMemberInfo(member).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).iin }}</span>
35
+ <span :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
36
+ <span :class="[getMemberInfo(member).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(member).birthDate }} </span>
37
+ <span :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
38
+ <span :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
39
+ <div
40
+ class="transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
41
+ :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
42
+ @click="$emit('onMore', { whichForm })"
43
+ >
44
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </template>
49
+
50
+ <script lang="ts">
51
+ export default defineComponent({
52
+ props: {
53
+ title: {
54
+ type: String,
55
+ default: '',
56
+ },
57
+ subtitle: {
58
+ type: String,
59
+ default: '',
60
+ },
61
+ whichForm: {
62
+ type: String as PropType<'policyholderForm' | 'insuredForm' | 'beneficiaryForm' | 'beneficialOwnerForm' | 'policyholdersRepresentativeForm' | 'productConditionsForm'>,
63
+ default: '',
64
+ },
65
+ },
66
+ emits: ['onMore'],
67
+ setup(props) {
68
+ const dataStore = useDataStore();
69
+ const formStore = useFormStore();
70
+ const multipleMembers = ['insuredForm', 'beneficiaryForm', 'beneficialOwnerForm'];
71
+ const isMultiple = ref(multipleMembers.includes(props.whichForm));
72
+ const member = formStore[props.whichForm as keyof typeof formStore];
73
+
74
+ const getMemberInfo = (memberData: any) => {
75
+ return {
76
+ fullName: computed(() => (memberData && memberData.getFullNameShorted() ? memberData.getFullNameShorted() : null)).value,
77
+ iin: computed(() => (memberData && memberData.iin ? memberData.iin : null)).value,
78
+ gender: computed(() => (memberData && memberData.gender.nameRu ? memberData.gender.nameRu.charAt(0) : null)).value,
79
+ birthDate: computed(() => (memberData && memberData.birthDate ? memberData.birthDate : null)).value,
80
+ birthPlace: computed(() => (memberData && memberData.birthPlace.nameRu ? memberData.birthPlace.nameRu.substr(0, 3) : null)).value,
81
+ sectorCode: computed(() => (memberData && memberData.economySectorCode.ids ? memberData.economySectorCode.ids.slice(-1) : null)).value,
82
+ };
83
+ };
84
+
85
+ return {
86
+ // State
87
+ formStore,
88
+ member,
89
+ isMultiple,
90
+
91
+ // Computed
92
+
93
+ // Functions
94
+ getMemberInfo,
95
+ };
96
+ },
97
+ });
98
+ </script>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div class="h-[74px] !pl-2 md:!pl-5 rounded border-[1px] flex items-center justify-start gap-4" :class="[$libStyles.whiteBg]">
3
+ <v-switch class="base-toggle" :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" color="#009C73" hide-details :disabled="disabled"> </v-switch>
4
+ <p :class="[$libStyles.textSimple]">{{ `${title}` }}</p>
5
+ <p class="mr-3" :class="[modelValue ? $libStyles.greenText : '', $libStyles.textSimple]">{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}</p>
6
+ </div>
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ export default defineComponent({
11
+ props: {
12
+ modelValue: {
13
+ type: Boolean,
14
+ default: '',
15
+ },
16
+ title: {
17
+ type: String,
18
+ default: '',
19
+ },
20
+ disabled: {
21
+ type: Boolean,
22
+ default: false,
23
+ },
24
+ },
25
+ emits: ['update:modelValue'],
26
+ });
27
+ </script>
28
+
29
+ <style>
30
+ .v-input.base-toggle {
31
+ width: fit-content;
32
+ flex: unset !important;
33
+ }
34
+ </style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div class="pt-3 pl-5 rounded border-[1px]" :class="[$libStyles.whiteBg]">
3
+ <div>
4
+ <p :class="[$libStyles.textTitle, $libStyles.greenText]">
5
+ {{ $t('productConditions') }}
6
+ </p>
7
+ <p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
8
+ </div>
9
+ <div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
10
+ <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.requestedSumInsured') }}</span>
11
+ <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.insurancePremiumPerMonth') }}</span>
12
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.coverPeriod') }}</span>
13
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.payPeriod') }}</span>
14
+ </div>
15
+ <div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
16
+ <span :class="[amount === null && $libStyles.emptyBlockCol]">{{ amount }} </span>
17
+ <span :class="[premium === null && $libStyles.emptyBlockCol]"> {{ premium }}</span>
18
+ <span :class="[coverPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
19
+ <span :class="[paymentPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
20
+ {{ paymentPeriod }}
21
+ </span>
22
+ <div
23
+ class="transition-all h-[70px] w-[60px] relative place-self-end cursor-pointer"
24
+ :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
25
+ @click="$emit('onMore', { whichForm: 'productConditions' })"
26
+ >
27
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <script lang="ts">
34
+ export default defineComponent({
35
+ props: {
36
+ subtitle: {
37
+ type: String,
38
+ default: '',
39
+ },
40
+ },
41
+ setup() {
42
+ const formStore = useFormStore();
43
+
44
+ const amount = computed(() =>
45
+ formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null,
46
+ );
47
+ const premium = computed(() =>
48
+ formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null,
49
+ );
50
+ const coverPeriod = computed(() => (formStore.productConditionsForm && formStore.productConditionsForm.coverPeriod ? formStore.productConditionsForm.coverPeriod : null));
51
+ const paymentPeriod = computed(() =>
52
+ formStore.productConditionsForm && formStore.productConditionsForm.paymentPeriod && !!formStore.productConditionsForm.paymentPeriod.nameRu
53
+ ? formStore.productConditionsForm.paymentPeriod.nameRu
54
+ : null,
55
+ );
56
+ return {
57
+ // State
58
+ formStore,
59
+
60
+ // Computed
61
+ amount,
62
+ premium,
63
+ coverPeriod,
64
+ paymentPeriod,
65
+ };
66
+ },
67
+ });
68
+ </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-text-field
3
3
  class="rounded-input"
4
- v-model="fieldModel"
4
+ :model-value="modelValue"
5
5
  v-maska="maska"
6
6
  :rules="rules"
7
7
  :loading="loading"
@@ -17,6 +17,7 @@
17
17
  :append-icon="appendIcon ? appendIcon : ''"
18
18
  :bg-color="bgColor ? bgColor : ''"
19
19
  @keyup.enter.prevent="submitted"
20
+ @update:modelValue="$emit('update:modelValue', $event)"
20
21
  >
21
22
  <template v-if="loading" #loader>
22
23
  <v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
@@ -91,26 +92,11 @@ export default defineComponent({
91
92
  emits: ['update:modelValue', 'submitted'],
92
93
 
93
94
  setup(props, { emit }) {
94
- const fieldModel = ref(props.modelValue || '');
95
-
96
- const updateValue = (event: any) => {
97
- emit('update:modelValue', fieldModel.value);
98
- };
99
-
100
95
  const submitted = (event: any) => {
101
96
  emit('submitted', event);
102
97
  };
103
98
 
104
- watch(
105
- fieldModel,
106
- () => {
107
- updateValue(fieldModel.value);
108
- },
109
- { immediate: true },
110
- );
111
-
112
99
  return {
113
- fieldModel,
114
100
  submitted,
115
101
  };
116
102
  },
@@ -124,11 +110,11 @@ export default defineComponent({
124
110
  }
125
111
 
126
112
  /* .rounded-input .v-field {
127
- border-radius: 8px;
128
- border: 1px solid #dadada;
129
- box-shadow: none;
130
- font-size: 14px;
131
- } */
113
+ border-radius: 8px;
114
+ border: 1px solid #dadada;
115
+ box-shadow: none;
116
+ font-size: 14px;
117
+ } */
132
118
 
133
119
  .rounded-input .v-field--error {
134
120
  border-color: #ff5449;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-text-field
3
3
  class="rounded-input"
4
- v-model="fieldModel"
4
+ :model-value="modelValue"
5
5
  v-maska="maska"
6
6
  :rules="rules"
7
7
  :loading="loading"
@@ -17,6 +17,7 @@
17
17
  :append-icon="appendIcon ? appendIcon : ''"
18
18
  :bg-color="bgColor ? bgColor : ''"
19
19
  @keyup.enter.prevent="submitted"
20
+ @update:modelValue="$emit('update:modelValue', $event)"
20
21
  >
21
22
  <template v-if="loading" #loader>
22
23
  <v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
@@ -91,26 +92,11 @@ export default defineComponent({
91
92
  emits: ['update:modelValue', 'submitted'],
92
93
 
93
94
  setup(props, { emit }) {
94
- const fieldModel = ref(props.modelValue || '');
95
-
96
- const updateValue = (event: any) => {
97
- emit('update:modelValue', fieldModel.value);
98
- };
99
-
100
95
  const submitted = (event: any) => {
101
96
  emit('submitted', event);
102
97
  };
103
98
 
104
- watch(
105
- fieldModel,
106
- () => {
107
- updateValue(fieldModel.value);
108
- },
109
- { immediate: true },
110
- );
111
-
112
99
  return {
113
- fieldModel,
114
100
  submitted,
115
101
  };
116
102
  },
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <base-drawer :panel-title="$dataStore.menu.title" which-panel="settings">
3
3
  <base-panel-item>
4
- <v-btn size="x-small" icon="mdi-minus" color="#A0B3D8" class="text-white" variant="flat"></v-btn>
4
+ <v-btn size="x-small" icon="mdi-minus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('decrease')"></v-btn>
5
5
  Шрифт
6
- <v-btn size="x-small" icon="mdi-plus" color="#A0B3D8" class="text-white" variant="flat"></v-btn>
6
+ <v-btn size="x-small" icon="mdi-plus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('increase')"></v-btn>
7
7
  </base-panel-item>
8
8
  <base-panel-item>
9
9
  <v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')"></v-text-field>
@@ -26,6 +26,16 @@
26
26
  const dialog = ref(false);
27
27
  const dataStore = useDataStore();
28
28
 
29
+ const handleFontSize = (action: 'increase' | 'decrease') => {
30
+ if (action === 'increase' && dataStore.fontSize < 24) dataStore.fontSize += 2;
31
+ if (action === 'decrease' && dataStore.fontSize > 14) dataStore.fontSize -= 2;
32
+ if (dataStore.isEFO) {
33
+ dataStore.sendToChild(constants.postActions.font, dataStore.fontSize);
34
+ } else {
35
+ dataStore.sendToParent(constants.postActions.font, dataStore.fontSize);
36
+ }
37
+ };
38
+
29
39
  const logoutUser = async () => {
30
40
  dialog.value = false;
31
41
  await dataStore.logoutUser();
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <span class="transition-all h-[64px] px-4 flex justify-between items-center border-b-[1px] hover:border-b-[#A0B3D8]">
2
+ <p class="transition-all h-[64px] px-4 flex justify-between items-center border-b-[1px] hover:border-b-[#A0B3D8] text-[16px]">
3
3
  <slot></slot>
4
- </span>
4
+ </p>
5
5
  </template>
@@ -10,7 +10,7 @@ class MenuItemConfig {
10
10
  hasLine?: boolean;
11
11
  description?: string | null;
12
12
  url?: string | null;
13
- initial?: object | null;
13
+ initial?: any | null;
14
14
  icon?: string | null;
15
15
  action?: Function | void;
16
16
  disabled?: typeof computed;
@@ -24,7 +24,7 @@ class MenuItemConfig {
24
24
  hasLine?: boolean,
25
25
  description?: string | null,
26
26
  url?: string | null,
27
- initial?: object | null,
27
+ initial?: any | null,
28
28
  icon?: string | null,
29
29
  action?: Function | void,
30
30
  disabled?: typeof computed,
@@ -761,7 +761,7 @@ export class ProductConditions {
761
761
 
762
762
  export class DataStoreClass {
763
763
  hasLayoutMargins: boolean;
764
- product: string | null;
764
+ readonly product: string | null;
765
765
  showNav: boolean;
766
766
  menuItems: MenuItem[];
767
767
  menu: {
@@ -784,6 +784,7 @@ export class DataStoreClass {
784
784
  open: boolean;
785
785
  overlay: boolean;
786
786
  title: string;
787
+ clear: Function | void;
787
788
  };
788
789
  historyPageIndex: number;
789
790
  historyPageSize: number;
@@ -871,7 +872,7 @@ export class DataStoreClass {
871
872
  this.ManagerPolicyList = [];
872
873
  this.AgentDataList = [];
873
874
  this.signUrl = null;
874
- this.product = null;
875
+ this.product = import.meta.env.VITE_PRODUCT ? (import.meta.env.VITE_PRODUCT as string) : null;
875
876
  this.showNav = true;
876
877
  this.menuItems = [];
877
878
  this.menu = {
@@ -893,6 +894,12 @@ export class DataStoreClass {
893
894
  open: false,
894
895
  overlay: false,
895
896
  title: '',
897
+ clear: function () {
898
+ const panelActions = document.getElementById('panel-actions');
899
+ if (panelActions) {
900
+ panelActions.innerHTML = '';
901
+ }
902
+ },
896
903
  };
897
904
  this.panelAction = null;
898
905
  this.historyPageIndex = 1;
@@ -1003,7 +1010,15 @@ export class FormStoreClass {
1003
1010
  isPolicyholderBeneficiary: boolean = false;
1004
1011
  isActOwnBehalf: boolean = true;
1005
1012
  hasRepresentative: boolean = false;
1006
- applicationData: { processInstanceId: number | string };
1013
+ applicationData: {
1014
+ processInstanceId: number | string;
1015
+ statusCode?: string | null;
1016
+ clientApp?: any;
1017
+ insuredApp?: any;
1018
+ beneficiaryApp?: any;
1019
+ beneficialOwnerApp?: any;
1020
+ spokesmanApp?: any;
1021
+ };
1007
1022
  policyholderForm: PolicyholderForm;
1008
1023
  policyholderFormKey: string;
1009
1024
  policyholdersRepresentativeForm: PolicyholdersRepresentativeForm;
@@ -1024,7 +1039,7 @@ export class FormStoreClass {
1024
1039
  canBeClaimed: boolean | null;
1025
1040
  applicationTaskId: string | null;
1026
1041
  otpTokenId: string | null;
1027
- constructor(procuctConditionsTitle: string) {
1042
+ constructor(procuctConditionsTitle?: string) {
1028
1043
  this.birthInfos = [];
1029
1044
  this.SaleChanellPolicy = new Value();
1030
1045
  this.AgentData = {
@@ -48,6 +48,7 @@ export const constants = Object.freeze({
48
48
  rejectclient: 'rejectclient',
49
49
  },
50
50
  postActions: {
51
+ font: 'font',
51
52
  route: 'route',
52
53
  applicationCreated: 'applicationCreated',
53
54
  clipboard: 'clipboard',
@@ -1,6 +1,7 @@
1
1
  import { useDisplay } from 'vuetify';
2
2
  import jwt_decode from 'jwt-decode';
3
3
  import { XMLParser } from 'fast-xml-parser';
4
+ import { AxiosError } from 'axios';
4
5
 
5
6
  export const useDisplayInfo = useDisplay;
6
7
 
@@ -135,3 +136,13 @@ export const ESBDMessage = (ESBDObject: any, initialPoint: any) => {
135
136
  }
136
137
  return result;
137
138
  };
139
+
140
+ export const ErrorHandler = (err: unknown) => {
141
+ console.log(err);
142
+ if (err instanceof AxiosError) {
143
+ if ('response' in err && err.response && err.response.data) {
144
+ useDataStore().showToaster('error', err.response.data);
145
+ }
146
+ }
147
+ return false;
148
+ };
@@ -10,7 +10,7 @@ export class Styles {
10
10
  blueBg: string = 'bg-[#A0B3D8]';
11
11
  blueBgHover: string = 'hover:bg-[#96abd6]';
12
12
  blueBgLight: string = 'bg-[#F3F6FC]';
13
- blueBgLightHover: string = 'hover:bg-[#F3F6FC]';
13
+ blueBgLightHover: string = 'hover:bg-[#f5f8fd]';
14
14
  blueText: string = 'text-[#A0B3D8]';
15
15
  blueTextLight: string = 'text-[#F3F6FC]';
16
16
 
@@ -58,6 +58,8 @@ export class Styles {
58
58
 
59
59
  // Complex
60
60
  flexColNav: string;
61
+ emptyBlockCol: string;
62
+ scrollPage: string;
61
63
 
62
64
  // Muted or disabled
63
65
  mutedText: string = 'text-[#99A3B3]';
@@ -72,5 +74,7 @@ export class Styles {
72
74
 
73
75
  // Complex
74
76
  this.flexColNav = 'flex flex-col gap-[10px] px-2 pt-[14px]';
77
+ this.emptyBlockCol = 'w-[110px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
78
+ this.scrollPage = 'max-h-[90vh] overflow-y-scroll';
75
79
  }
76
80
  }
package/layouts/clear.vue CHANGED
@@ -1,3 +1,32 @@
1
1
  <template>
2
2
  <div class="h-full w-full"><slot></slot></div>
3
3
  </template>
4
+
5
+ <style>
6
+ .mainpage,
7
+ span,
8
+ header,
9
+ *[class='text-[14px]'],
10
+ .text-\[14px\] {
11
+ font-size: v-bind('$dataStore.fontSize + "px"') !important;
12
+ /* line-height: v-bind('dataStore.fontSize*1.5 + "px"') !important; */
13
+ }
14
+
15
+ *[class='text-[16px]'],
16
+ .text-\[16px\],
17
+ label .v-label .v-field-label,
18
+ .v-field__input,
19
+ .v-label,
20
+ .v-field,
21
+ .v-input {
22
+ font-size: v-bind('$dataStore.fontSize+2 + "px"') !important;
23
+ /* line-height: v-bind('dataStore.fontSize*2 + "px"') !important; */
24
+ }
25
+
26
+ .v-input__details,
27
+ .v-messages__message {
28
+ font-size: v-bind('$dataStore.fontSize*0.8 + "px"') !important;
29
+ /* line-height: v-bind('dataStore.fontSize*1 + "px"') !important; */
30
+ padding-bottom: 3px;
31
+ }
32
+ </style>
@@ -35,3 +35,31 @@ const openSettings = async () => {
35
35
  dataStore.settings.open = true;
36
36
  };
37
37
  </script>
38
+ <style>
39
+ .mainpage,
40
+ span,
41
+ header,
42
+ *[class='text-[14px]'],
43
+ .text-\[14px\] {
44
+ font-size: v-bind('dataStore.fontSize + "px"') !important;
45
+ /* line-height: v-bind('dataStore.fontSize*1.5 + "px"') !important; */
46
+ }
47
+
48
+ *[class='text-[16px]'],
49
+ .text-\[16px\],
50
+ label .v-label .v-field-label,
51
+ .v-field__input,
52
+ .v-label,
53
+ .v-field,
54
+ .v-input {
55
+ font-size: v-bind('dataStore.fontSize+2 + "px"') !important;
56
+ /* line-height: v-bind('dataStore.fontSize*2 + "px"') !important; */
57
+ }
58
+
59
+ .v-input__details,
60
+ .v-messages__message {
61
+ font-size: v-bind('dataStore.fontSize*0.8 + "px"') !important;
62
+ /* line-height: v-bind('dataStore.fontSize*1 + "px"') !important; */
63
+ padding-bottom: 3px;
64
+ }
65
+ </style>
package/layouts/full.vue CHANGED
@@ -4,3 +4,32 @@
4
4
  <slot></slot>
5
5
  </div>
6
6
  </template>
7
+
8
+ <style>
9
+ .mainpage,
10
+ span,
11
+ header,
12
+ *[class='text-[14px]'],
13
+ .text-\[14px\] {
14
+ font-size: v-bind('$dataStore.fontSize + "px"') !important;
15
+ /* line-height: v-bind('dataStore.fontSize*1.5 + "px"') !important; */
16
+ }
17
+
18
+ *[class='text-[16px]'],
19
+ .text-\[16px\],
20
+ label .v-label .v-field-label,
21
+ .v-field__input,
22
+ .v-label,
23
+ .v-field,
24
+ .v-input {
25
+ font-size: v-bind('$dataStore.fontSize+2 + "px"') !important;
26
+ /* line-height: v-bind('dataStore.fontSize*2 + "px"') !important; */
27
+ }
28
+
29
+ .v-input__details,
30
+ .v-messages__message {
31
+ font-size: v-bind('$dataStore.fontSize*0.8 + "px"') !important;
32
+ /* line-height: v-bind('dataStore.fontSize*1 + "px"') !important; */
33
+ padding-bottom: 3px;
34
+ }
35
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.7-beta.11",
3
+ "version": "0.0.7-beta.13",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -18,28 +18,28 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "build": "nuxt build",
21
- "dev": "nuxt dev",
21
+ "dev": "nuxt clean && nuxt dev",
22
22
  "generate": "nuxt generate",
23
23
  "preview": "nuxt preview"
24
24
  },
25
25
  "devDependencies": {
26
- "@nuxt/devtools": "^0.2.5",
27
- "nuxt": "^3.3.1",
26
+ "@nuxt/devtools": "^0.3.2",
27
+ "nuxt": "^3.3.3",
28
28
  "prettier": "^2.8.4",
29
29
  "typescript": "^4.9.5"
30
30
  },
31
31
  "dependencies": {
32
32
  "@mdi/font": "^7.1.96",
33
- "@nuxtjs/tailwindcss": "^6.6.0",
34
- "@pinia/nuxt": "^0.4.7",
33
+ "@nuxtjs/tailwindcss": "^6.6.5",
34
+ "@pinia/nuxt": "^0.4.8",
35
35
  "animate.css": "^4.1.1",
36
- "axios": "^1.3.4",
36
+ "axios": "^1.3.5",
37
37
  "fast-xml-parser": "4.0.12",
38
38
  "jwt-decode": "^3.1.2",
39
39
  "maska": "1.5.0",
40
- "pinia": "^2.0.33",
40
+ "pinia": "^2.0.34",
41
41
  "v-idle-3": "^0.3.14",
42
42
  "vue-toastification": "^2.0.0-rc.5",
43
- "vuetify": "^3.1.10"
43
+ "vuetify": "^3.1.13"
44
44
  }
45
45
  }
@@ -43,6 +43,12 @@ export const useDataStore = defineStore('data', {
43
43
  sendToParent(action, value) {
44
44
  window.parent.postMessage({ action: action, value: value }, '*');
45
45
  },
46
+ sendToChild(action, value) {
47
+ const childFrame = document.getElementById('product-iframe');
48
+ if (childFrame && childFrame.contentWindow && childFrame.contentWindow.postMessage) {
49
+ childFrame.contentWindow.postMessage({ action: action, value: value }, '*');
50
+ }
51
+ },
46
52
  getFilesByIIN(iin) {
47
53
  return this.signedDocumentList.filter(file => file.iin === iin && file.fileTypeName === 'Удостоверение личности');
48
54
  },
@@ -1394,7 +1400,7 @@ export const useDataStore = defineStore('data', {
1394
1400
  this.isLoading = true;
1395
1401
  this.AgentDataList = await this.api.searchAgentByName(name);
1396
1402
  if (!this.AgentDataList.length) {
1397
- showToaster('error', this.t('toaster.notFound'), 1500);
1403
+ this.showToaster('error', this.t('toaster.notFound'), 1500);
1398
1404
  }
1399
1405
  } catch (err) {
1400
1406
  console.log(err);
@@ -1470,7 +1476,7 @@ export const useDataStore = defineStore('data', {
1470
1476
  try {
1471
1477
  this.isLoading = true;
1472
1478
  await this.api.setConfirmation(data);
1473
- showToaster('success', this.t('toaster.successSaved'));
1479
+ this.showToaster('success', this.t('toaster.successSaved'));
1474
1480
  return true;
1475
1481
  } catch (err) {
1476
1482
  this.showToaster('error', this.t('toaster.error'));
@@ -1483,7 +1489,7 @@ export const useDataStore = defineStore('data', {
1483
1489
  try {
1484
1490
  this.isLoading = true;
1485
1491
  await this.api.sendUnderwritingCouncilTask(data);
1486
- showToaster('success', this.t('toaster.successOperation'), 5000);
1492
+ this.showToaster('success', this.t('toaster.successOperation'), 5000);
1487
1493
  return true;
1488
1494
  } catch (err) {
1489
1495
  console.log(err);
@@ -2526,7 +2532,7 @@ export const useDataStore = defineStore('data', {
2526
2532
  );
2527
2533
  } catch (err) {
2528
2534
  console.log(err);
2529
- showToaster('error', err.response.data, 3000);
2535
+ this.showToaster('error', err.response.data, 3000);
2530
2536
  }
2531
2537
  },
2532
2538
  async sendOtp(iin, phone, processInstanceId = null, onInit = false) {
@@ -2537,7 +2543,7 @@ export const useDataStore = defineStore('data', {
2537
2543
  if (iin && iin.length === 15 && phone && phone.length === 18) {
2538
2544
  const status = await this.getOtpStatus(iin, phone, processInstanceId);
2539
2545
  if (status === true) {
2540
- showToaster('success', this.t('toaster.hasSuccessOtp'), 3000);
2546
+ this.showToaster('success', this.t('toaster.hasSuccessOtp'), 3000);
2541
2547
  otpStatus = true;
2542
2548
  this.isLoading = false;
2543
2549
  return { otpStatus, otpResponse };
@@ -2558,31 +2564,31 @@ export const useDataStore = defineStore('data', {
2558
2564
  this.isLoading = false;
2559
2565
  if (!!otpResponse) {
2560
2566
  if ('errMessage' in otpResponse && otpResponse.errMessage !== null) {
2561
- showToaster('error', otpResponse.errMessage, 3000);
2567
+ this.showToaster('error', otpResponse.errMessage, 3000);
2562
2568
  return { otpStatus };
2563
2569
  }
2564
2570
  if ('result' in otpResponse && otpResponse.result === null) {
2565
2571
  if ('statusName' in otpResponse && !!otpResponse.statusName) {
2566
- showToaster('error', otpResponse.statusName, 3000);
2572
+ this.showToaster('error', otpResponse.statusName, 3000);
2567
2573
  return { otpStatus };
2568
2574
  }
2569
2575
  if ('status' in otpResponse && !!otpResponse.status) {
2570
- showToaster('error', otpResponse.status, 3000);
2576
+ this.showToaster('error', otpResponse.status, 3000);
2571
2577
  return { otpStatus };
2572
2578
  }
2573
2579
  }
2574
2580
  if ('tokenId' in otpResponse && otpResponse.tokenId) {
2575
2581
  this.formStore.otpTokenId = otpResponse.tokenId;
2576
- showToaster('success', this.t('toaster.successOtp'), 3000);
2582
+ this.showToaster('success', this.t('toaster.successOtp'), 3000);
2577
2583
  }
2578
2584
  } else {
2579
- showToaster('error', this.t('toaster.undefinedError'), 3000);
2585
+ this.showToaster('error', this.t('toaster.undefinedError'), 3000);
2580
2586
  return { otpStatus };
2581
2587
  }
2582
2588
  }
2583
2589
  } else {
2584
2590
  if (onInit === false) {
2585
- showToaster('error', this.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }));
2591
+ this.showToaster('error', this.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }));
2586
2592
  this.isLoading = false;
2587
2593
  }
2588
2594
  }
@@ -2591,11 +2597,11 @@ export const useDataStore = defineStore('data', {
2591
2597
  this.isLoading = false;
2592
2598
  if ('response' in err) {
2593
2599
  if ('statusName' in err.response.data && !!err.response.data.statusName) {
2594
- showToaster('error', this.t('toaster.phoneNotFoundInBMG'), 3000);
2600
+ this.showToaster('error', this.t('toaster.phoneNotFoundInBMG'), 3000);
2595
2601
  return { otpStatus };
2596
2602
  }
2597
2603
  if ('status' in err.response.data && !!err.response.data.status) {
2598
- showToaster('error', err.response.data.status, 3000);
2604
+ this.showToaster('error', err.response.data.status, 3000);
2599
2605
  return { otpStatus };
2600
2606
  }
2601
2607
  }
@@ -0,0 +1,143 @@
1
+ import { defineStore } from 'pinia';
2
+ import { useDataStore } from './data.store';
3
+ import { useFormStore } from './form.store';
4
+ import { ErrorHandler } from '../composables';
5
+
6
+ export const useMemberStore = defineStore('members', {
7
+ state: () => ({
8
+ route: useRoute(),
9
+ router: useRouter(),
10
+ dataStore: useDataStore(),
11
+ formStore: useFormStore(),
12
+ }),
13
+ getters: {},
14
+ actions: {
15
+ hasMemberData(whichForm: keyof typeof this.formStore, whichIndex?: number, key: string = 'id', emptyValue: any = 0) {
16
+ if (!this.validateInitiator(false)) return false;
17
+ return typeof whichIndex === 'number' ? this.formStore[whichForm][whichIndex][key] != emptyValue : this.formStore[whichForm][key] != emptyValue;
18
+ },
19
+ canMemberDeleted(whichForm: keyof typeof this.formStore, whichIndex?: number) {
20
+ if (!whichForm) return false;
21
+ if (!this.validateInitiator(false)) return false;
22
+ if (this.dataStore.isTask() && this.dataStore.isProcessEditable(this.formStore.applicationData.statusCode)) {
23
+ if (whichForm !== this.formStore.policyholderFormKey) {
24
+ return this.hasMemberData(whichForm, whichIndex);
25
+ }
26
+ }
27
+ return false;
28
+ },
29
+ getMemberFromStore(whichForm: keyof typeof this.formStore, whichIndex?: number) {
30
+ if (!whichForm) return false;
31
+ switch (whichForm) {
32
+ case this.formStore.policyholderFormKey:
33
+ return this.formStore.policyholderForm;
34
+ case this.formStore.policyholdersRepresentativeFormKey:
35
+ return this.formStore.policyholdersRepresentativeForm;
36
+ case this.formStore.insuredFormKey:
37
+ return this.formStore.insuredForm[whichIndex!];
38
+ case this.formStore.beneficiaryFormKey:
39
+ return this.formStore.beneficiaryForm[whichIndex!];
40
+ case this.formStore.beneficialOwnerFormKey:
41
+ return this.formStore.beneficialOwnerForm[whichIndex!];
42
+ }
43
+ },
44
+ getMemberFromApplication(whichForm: keyof typeof this.formStore, whichIndex?: number) {
45
+ const id = typeof whichIndex === 'number' ? this.formStore[whichForm][whichIndex].id : this.formStore[whichForm].id;
46
+ switch (whichForm) {
47
+ case this.formStore.policyholderFormKey:
48
+ return this.formStore.applicationData.clientApp;
49
+ case this.formStore.policyholdersRepresentativeFormKey:
50
+ return this.formStore.applicationData.spokesmanApp;
51
+ case this.formStore.insuredFormKey: {
52
+ const inStore = this.formStore.applicationData.insuredApp.find((member: any) => member.insisId === id);
53
+ return !!inStore ? inStore : false;
54
+ }
55
+ case this.formStore.beneficiaryFormKey: {
56
+ const inStore = this.formStore.applicationData.beneficiaryApp.find((member: any) => member.insisId === id);
57
+ return !!inStore ? inStore : false;
58
+ }
59
+ case this.formStore.beneficialOwnerFormKey: {
60
+ const inStore = this.formStore.applicationData.beneficialOwnerApp.find((member: any) => member.insisId === id);
61
+ return !!inStore ? inStore : false;
62
+ }
63
+ }
64
+ },
65
+ getMemberClass(whichForm: keyof typeof this.formStore) {
66
+ if (!whichForm) return false;
67
+ switch (whichForm) {
68
+ case this.formStore.policyholderFormKey:
69
+ return new PolicyholderForm();
70
+ case this.formStore.insuredFormKey:
71
+ return new InsuredForm();
72
+ case this.formStore.beneficiaryFormKey:
73
+ return new BeneficiaryForm();
74
+ case this.formStore.beneficialOwnerFormKey:
75
+ return new BeneficialOwnerForm();
76
+ case this.formStore.policyholdersRepresentativeFormKey:
77
+ return new PolicyholdersRepresentativeForm();
78
+ default:
79
+ return false;
80
+ }
81
+ },
82
+ getMemberCode(whichForm: keyof typeof this.formStore) {
83
+ switch (whichForm) {
84
+ case this.formStore.insuredFormKey:
85
+ return 'Insured';
86
+ case this.formStore.beneficiaryFormKey:
87
+ return 'Beneficiary';
88
+ case this.formStore.beneficialOwnerFormKey:
89
+ return 'BeneficialOwner';
90
+ case this.formStore.policyholdersRepresentativeFormKey:
91
+ return 'Spokesman';
92
+ }
93
+ },
94
+ validateInitiator(showToaster: boolean = true) {
95
+ if (!this.dataStore.isInitiator()) {
96
+ if (showToaster) this.dataStore.showToaster('error', this.dataStore.t('toaster.viewErrorText'));
97
+ return false;
98
+ }
99
+ return true;
100
+ },
101
+ clearMember(whichForm: keyof typeof this.formStore, whichIndex?: number) {
102
+ if (!whichForm) return false;
103
+ if (!this.validateInitiator()) return false;
104
+ const memberClass = this.getMemberClass(whichForm);
105
+ if (!memberClass) return false;
106
+ if (whichForm === this.formStore.policyholderFormKey) {
107
+ this.formStore[whichForm].resetForm();
108
+ }
109
+ if (whichForm === this.formStore.policyholdersRepresentativeFormKey) {
110
+ this.formStore[whichForm].resetMember();
111
+ }
112
+ if (typeof whichIndex === 'number') {
113
+ if (this.formStore[whichForm].length === 1) {
114
+ this.formStore[whichForm][whichIndex] = memberClass;
115
+ } else {
116
+ this.formStore[whichForm].splice(whichIndex, 1);
117
+ }
118
+ }
119
+ return true;
120
+ },
121
+ async deleteMember(whichForm: keyof typeof this.formStore, whichIndex?: number) {
122
+ if (!whichForm) return false;
123
+ if (!this.validateInitiator()) return false;
124
+ try {
125
+ const memberCode = this.getMemberCode(whichForm);
126
+ if (!memberCode) return false;
127
+ if (typeof whichIndex !== 'number') {
128
+ if (whichForm === this.formStore.policyholdersRepresentativeFormKey) {
129
+ await this.dataStore.api.deleteMember(memberCode, this.formStore.applicationData.processInstanceId);
130
+ }
131
+ } else {
132
+ const memberData = this.getMemberFromApplication(whichForm, whichIndex);
133
+ if (!memberData) return false;
134
+ await this.dataStore.api.deleteMember(memberCode, memberData.id as number);
135
+ }
136
+ await this.dataStore.getApplicationData(this.route.params.taskId, true, true, true, false);
137
+ return this.clearMember(whichForm, whichIndex);
138
+ } catch (err) {
139
+ return ErrorHandler(err);
140
+ }
141
+ },
142
+ },
143
+ });
package/store/messages.ts CHANGED
@@ -104,6 +104,7 @@ export const messages = {
104
104
  create: 'Создать',
105
105
  becomeAgent: 'Стать агентом',
106
106
  close: 'Закрыть',
107
+ reload: 'Обновить',
107
108
  makeIssueInvoice: 'Создать Счет на оплату',
108
109
  open: 'Открыть',
109
110
  edit: 'Редактировать',
@@ -180,11 +181,11 @@ export const messages = {
180
181
  questionnaireHealth: 'Анкета по здоровью Застрахованного',
181
182
  chooseAll: 'Выбрать все',
182
183
  statement: 'Заявление',
183
- policyholder: 'Страхователь',
184
- insured: 'Застрахованный',
185
- beneficiary: 'Выгодоприобретатель',
186
- beneficialOwner: 'Бенефициарный собственник',
187
- policyholdersRepresentativeTitle: 'Представитель страхователя',
184
+ policyholderForm: 'Страхователь',
185
+ insuredForm: 'Застрахованный',
186
+ beneficiaryForm: 'Выгодоприобретатель',
187
+ beneficialOwnerForm: 'Бенефициарный собственник',
188
+ policyholdersRepresentativeForm: 'Представитель страхователя',
188
189
  productConditions: 'Условия продукта и расчеты',
189
190
  underwriterDecision: 'Решение андеррайтингового совета',
190
191
  recalculationInfo: 'Данные для перерасчета',
@@ -215,12 +216,12 @@ export const messages = {
215
216
  recalculation: 'Перерасчет',
216
217
  survey: 'Анкета',
217
218
  productConditionsForm: {
218
- coverPeriod: 'Срок страхования (в годах)',
219
+ coverPeriod: 'Срок страхования',
219
220
  payPeriod: 'Период оплаты страховой премии',
220
221
  processIndexRate: 'Запрашиваемый размер коэффициента индексации (от 3% до 7%)',
221
222
  processPaymentPeriod: 'Периодичность оплаты страховой премии:',
222
- requestedSumInsured: 'Запрашиваемая Страховая сумма',
223
- insurancePremiumPerMonth: 'Размер страховой премии (тенге)',
223
+ requestedSumInsured: 'Страховая сумма',
224
+ insurancePremiumPerMonth: 'Страховая премия',
224
225
  hint: 'Сумма рассчитывается автоматически',
225
226
  additional: 'Дополнительные условия страхования',
226
227
  possibilityToChange: 'Возможность изменения страховой суммы и страховых взносов (индексация)',
@@ -287,7 +288,7 @@ export const messages = {
287
288
  ageMycar: 'Пороговое значение по возрасту с 21 по 65',
288
289
  noResident: 'Нерезидентам отказано',
289
290
  },
290
- code: 'Код',
291
+ code: 'КЭС',
291
292
  fontSize: 'Размер шрифта',
292
293
  policyholdersRepresentative: {
293
294
  name: 'ФИО',
File without changes