hl-core 0.0.7-beta.12 → 0.0.7-beta.14

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();
@@ -26,7 +21,7 @@ export class ApiClass {
26
21
  }
27
22
  }
28
23
 
29
- async loginUser(data: { login: string; password: string; numAttempt: number }) {
24
+ async loginUser(data: { login: string; password: string; numAttempt: number }): Promise<{ refreshToken: string; accessToken: string }> {
30
25
  return this.axiosCall({
31
26
  method: Methods.POST,
32
27
  url: '/identity/api/Account/login',
@@ -34,7 +29,7 @@ export class ApiClass {
34
29
  });
35
30
  }
36
31
 
37
- async getNewAccessToken({ refreshToken, accessToken }: { refreshToken: string; accessToken: string }) {
32
+ async getNewAccessToken({ refreshToken, accessToken }: { refreshToken: string; accessToken: string }): Promise<{ refreshToken: string; accessToken: string }> {
38
33
  return this.axiosCall({
39
34
  method: Methods.POST,
40
35
  url: '/identity/api/Account/refresh',
@@ -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,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>
@@ -159,7 +159,7 @@ export const InitialColumns = () => {
159
159
  export class User {
160
160
  login: string | null;
161
161
  password: string | null;
162
- roles: string[] | null;
162
+ roles: string[];
163
163
  id: string | null;
164
164
  fullName: string | null;
165
165
 
@@ -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,17 @@ export class FormStoreClass {
1003
1010
  isPolicyholderBeneficiary: boolean = false;
1004
1011
  isActOwnBehalf: boolean = true;
1005
1012
  hasRepresentative: boolean = false;
1006
- applicationData: { processInstanceId: number | string };
1013
+ isPolicyholderIPDL: boolean = false;
1014
+ applicationData: {
1015
+ processInstanceId: number | string;
1016
+ statusCode?: string | null;
1017
+ clientApp?: any;
1018
+ insuredApp?: any;
1019
+ beneficiaryApp?: any;
1020
+ beneficialOwnerApp?: any;
1021
+ spokesmanApp?: any;
1022
+ isTask?: boolean | null;
1023
+ };
1007
1024
  policyholderForm: PolicyholderForm;
1008
1025
  policyholderFormKey: string;
1009
1026
  policyholdersRepresentativeForm: PolicyholdersRepresentativeForm;
@@ -1024,7 +1041,7 @@ export class FormStoreClass {
1024
1041
  canBeClaimed: boolean | null;
1025
1042
  applicationTaskId: string | null;
1026
1043
  otpTokenId: string | null;
1027
- constructor(procuctConditionsTitle: string) {
1044
+ constructor(procuctConditionsTitle?: string) {
1028
1045
  this.birthInfos = [];
1029
1046
  this.SaleChanellPolicy = new Value();
1030
1047
  this.AgentData = {
@@ -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
  }
@@ -37,22 +37,29 @@ const openSettings = async () => {
37
37
  </script>
38
38
  <style>
39
39
  .mainpage,
40
- label .v-label .v-field-label,
41
- .v-field__input,
42
- .v-label.v-field-label,
43
- .v-field,
44
- .v-input,
45
40
  span,
46
41
  header,
47
- p {
42
+ *[class='text-[14px]'],
43
+ .text-\[14px\] {
48
44
  font-size: v-bind('dataStore.fontSize + "px"') !important;
49
- line-height: v-bind('dataStore.fontSize*1.5 + "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; */
50
57
  }
51
58
 
52
59
  .v-input__details,
53
60
  .v-messages__message {
54
61
  font-size: v-bind('dataStore.fontSize*0.8 + "px"') !important;
55
- line-height: v-bind('dataStore.fontSize*1 + "px"') !important;
62
+ /* line-height: v-bind('dataStore.fontSize*1 + "px"') !important; */
56
63
  padding-bottom: 3px;
57
64
  }
58
65
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.7-beta.12",
3
+ "version": "0.0.7-beta.14",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -1400,7 +1400,7 @@ export const useDataStore = defineStore('data', {
1400
1400
  this.isLoading = true;
1401
1401
  this.AgentDataList = await this.api.searchAgentByName(name);
1402
1402
  if (!this.AgentDataList.length) {
1403
- showToaster('error', this.t('toaster.notFound'), 1500);
1403
+ this.showToaster('error', this.t('toaster.notFound'), 1500);
1404
1404
  }
1405
1405
  } catch (err) {
1406
1406
  console.log(err);
@@ -1476,7 +1476,7 @@ export const useDataStore = defineStore('data', {
1476
1476
  try {
1477
1477
  this.isLoading = true;
1478
1478
  await this.api.setConfirmation(data);
1479
- showToaster('success', this.t('toaster.successSaved'));
1479
+ this.showToaster('success', this.t('toaster.successSaved'));
1480
1480
  return true;
1481
1481
  } catch (err) {
1482
1482
  this.showToaster('error', this.t('toaster.error'));
@@ -1489,7 +1489,7 @@ export const useDataStore = defineStore('data', {
1489
1489
  try {
1490
1490
  this.isLoading = true;
1491
1491
  await this.api.sendUnderwritingCouncilTask(data);
1492
- showToaster('success', this.t('toaster.successOperation'), 5000);
1492
+ this.showToaster('success', this.t('toaster.successOperation'), 5000);
1493
1493
  return true;
1494
1494
  } catch (err) {
1495
1495
  console.log(err);
@@ -2532,7 +2532,7 @@ export const useDataStore = defineStore('data', {
2532
2532
  );
2533
2533
  } catch (err) {
2534
2534
  console.log(err);
2535
- showToaster('error', err.response.data, 3000);
2535
+ this.showToaster('error', err.response.data, 3000);
2536
2536
  }
2537
2537
  },
2538
2538
  async sendOtp(iin, phone, processInstanceId = null, onInit = false) {
@@ -2543,7 +2543,7 @@ export const useDataStore = defineStore('data', {
2543
2543
  if (iin && iin.length === 15 && phone && phone.length === 18) {
2544
2544
  const status = await this.getOtpStatus(iin, phone, processInstanceId);
2545
2545
  if (status === true) {
2546
- showToaster('success', this.t('toaster.hasSuccessOtp'), 3000);
2546
+ this.showToaster('success', this.t('toaster.hasSuccessOtp'), 3000);
2547
2547
  otpStatus = true;
2548
2548
  this.isLoading = false;
2549
2549
  return { otpStatus, otpResponse };
@@ -2564,31 +2564,31 @@ export const useDataStore = defineStore('data', {
2564
2564
  this.isLoading = false;
2565
2565
  if (!!otpResponse) {
2566
2566
  if ('errMessage' in otpResponse && otpResponse.errMessage !== null) {
2567
- showToaster('error', otpResponse.errMessage, 3000);
2567
+ this.showToaster('error', otpResponse.errMessage, 3000);
2568
2568
  return { otpStatus };
2569
2569
  }
2570
2570
  if ('result' in otpResponse && otpResponse.result === null) {
2571
2571
  if ('statusName' in otpResponse && !!otpResponse.statusName) {
2572
- showToaster('error', otpResponse.statusName, 3000);
2572
+ this.showToaster('error', otpResponse.statusName, 3000);
2573
2573
  return { otpStatus };
2574
2574
  }
2575
2575
  if ('status' in otpResponse && !!otpResponse.status) {
2576
- showToaster('error', otpResponse.status, 3000);
2576
+ this.showToaster('error', otpResponse.status, 3000);
2577
2577
  return { otpStatus };
2578
2578
  }
2579
2579
  }
2580
2580
  if ('tokenId' in otpResponse && otpResponse.tokenId) {
2581
2581
  this.formStore.otpTokenId = otpResponse.tokenId;
2582
- showToaster('success', this.t('toaster.successOtp'), 3000);
2582
+ this.showToaster('success', this.t('toaster.successOtp'), 3000);
2583
2583
  }
2584
2584
  } else {
2585
- showToaster('error', this.t('toaster.undefinedError'), 3000);
2585
+ this.showToaster('error', this.t('toaster.undefinedError'), 3000);
2586
2586
  return { otpStatus };
2587
2587
  }
2588
2588
  }
2589
2589
  } else {
2590
2590
  if (onInit === false) {
2591
- showToaster('error', this.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }));
2591
+ this.showToaster('error', this.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }));
2592
2592
  this.isLoading = false;
2593
2593
  }
2594
2594
  }
@@ -2597,11 +2597,11 @@ export const useDataStore = defineStore('data', {
2597
2597
  this.isLoading = false;
2598
2598
  if ('response' in err) {
2599
2599
  if ('statusName' in err.response.data && !!err.response.data.statusName) {
2600
- showToaster('error', this.t('toaster.phoneNotFoundInBMG'), 3000);
2600
+ this.showToaster('error', this.t('toaster.phoneNotFoundInBMG'), 3000);
2601
2601
  return { otpStatus };
2602
2602
  }
2603
2603
  if ('status' in err.response.data && !!err.response.data.status) {
2604
- showToaster('error', err.response.data.status, 3000);
2604
+ this.showToaster('error', err.response.data.status, 3000);
2605
2605
  return { otpStatus };
2606
2606
  }
2607
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,16 +181,19 @@ 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
+ policyholderAndInsured: 'Застрахованный / Страхователь',
186
+ policyholderAndInsuredSame: 'Застрахованный / Страхователь является одним лицом',
187
+ insuredForm: 'Застрахованный',
188
+ beneficiaryForm: 'Выгодоприобретатель',
189
+ beneficialOwnerForm: 'Бенефициарный собственник',
190
+ policyholdersRepresentativeForm: 'Представитель страхователя',
188
191
  productConditions: 'Условия продукта и расчеты',
189
192
  underwriterDecision: 'Решение андеррайтингового совета',
190
193
  recalculationInfo: 'Данные для перерасчета',
191
194
  generalConditions: 'Основные условия страхования',
192
195
  isPolicyholderInsured: 'Является ли страхователь застрахованным?',
196
+ isPolicyholderIPDL: 'Принадлежит ли и/или причастен ли Застрахованный / Страхователь или его члены семьи и близкие родственники к иностранному публичному должностному лицу?',
193
197
  isPolicyholderBeneficiary: 'Является ли страхователь выгодоприобретателем?',
194
198
  hasRepresentative: 'Подписантом договора выступает представитель? ',
195
199
  isActOwnBehalf: ' Клиент действует от своего имени и в своих интересах?',
@@ -215,12 +219,12 @@ export const messages = {
215
219
  recalculation: 'Перерасчет',
216
220
  survey: 'Анкета',
217
221
  productConditionsForm: {
218
- coverPeriod: 'Срок страхования (в годах)',
222
+ coverPeriod: 'Срок страхования',
219
223
  payPeriod: 'Период оплаты страховой премии',
220
224
  processIndexRate: 'Запрашиваемый размер коэффициента индексации (от 3% до 7%)',
221
225
  processPaymentPeriod: 'Периодичность оплаты страховой премии:',
222
- requestedSumInsured: 'Запрашиваемая Страховая сумма',
223
- insurancePremiumPerMonth: 'Размер страховой премии (тенге)',
226
+ requestedSumInsured: 'Страховая сумма',
227
+ insurancePremiumPerMonth: 'Страховая премия',
224
228
  hint: 'Сумма рассчитывается автоматически',
225
229
  additional: 'Дополнительные условия страхования',
226
230
  possibilityToChange: 'Возможность изменения страховой суммы и страховых взносов (индексация)',
@@ -287,7 +291,7 @@ export const messages = {
287
291
  ageMycar: 'Пороговое значение по возрасту с 21 по 65',
288
292
  noResident: 'Нерезидентам отказано',
289
293
  },
290
- code: 'Код',
294
+ code: 'КЭС',
291
295
  fontSize: 'Размер шрифта',
292
296
  policyholdersRepresentative: {
293
297
  name: 'ФИО',
File without changes