hl-core 0.0.8-beta.4 → 0.0.8-beta.6

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
@@ -147,21 +147,21 @@ export class ApiClass {
147
147
  async getQuestionList(surveyType: string, processInstanceId: string, insuredId: number | string): Promise<AnketaFirst> {
148
148
  return this.axiosCall({
149
149
  method: Methods.GET,
150
- url: `/Baiterek/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
150
+ url: `/${this.productUrl}/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
151
151
  });
152
152
  }
153
153
 
154
154
  async getQuestionListSecond(surveyType: string, processInstanceId: string, insuredId: number | string): Promise<AnketaSecond[]> {
155
155
  return this.axiosCall({
156
156
  method: Methods.GET,
157
- url: `/Baiterek/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
157
+ url: `/${this.productUrl}/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
158
158
  });
159
159
  }
160
160
 
161
161
  async definedAnswers(filter: string) {
162
162
  return this.axiosCall({
163
163
  method: Methods.GET,
164
- url: `/ekk/api/Contragentinsis/DictionaryItems/Questionary?filter=${filter}`,
164
+ url: `/Ekk/api/Contragentinsis/DictionaryItems/Questionary?filter=${filter}`,
165
165
  });
166
166
  }
167
167
 
@@ -227,7 +227,7 @@ export class ApiClass {
227
227
  });
228
228
  }
229
229
 
230
- async getDicFileTypeList() {
230
+ async getDicFileTypeList(): Promise<Value[]> {
231
231
  return this.axiosCall({
232
232
  method: Methods.GET,
233
233
  url: '/Arm/api/Dictionary/GetDictionaryItems/DicFileType',
@@ -498,7 +498,7 @@ export class ApiClass {
498
498
  }
499
499
 
500
500
  async getProcessTariff(code: number | string = 5) {
501
- return this.axiosCall({ url: `/arm/api/Dictionary/ProcessTariff/${code}` });
501
+ return this.axiosCall({ url: `/Arm/api/Dictionary/ProcessTariff/${code}` });
502
502
  }
503
503
 
504
504
  async setConfirmation(data: any) {
@@ -519,30 +519,37 @@ export class ApiClass {
519
519
  async sendUnderwritingCouncilTask(data: any) {
520
520
  return this.axiosCall({
521
521
  method: Methods.POST,
522
- url: '/arm/api/UnderwritingCouncil/SendTask',
522
+ url: '/Arm/api/UnderwritingCouncil/SendTask',
523
523
  data: data,
524
524
  });
525
525
  }
526
526
 
527
+ async getDictionaryItems(dictName: string): Promise<Value[]> {
528
+ return this.axiosCall({
529
+ method: Methods.GET,
530
+ url: `/Ekk/api/ContragentInsis/DictionaryItems/${dictName}`,
531
+ });
532
+ }
533
+
527
534
  async filterManagerByRegion(dictName: string, filterName: string) {
528
535
  return this.axiosCall({
529
536
  method: Methods.GET,
530
- url: `/ekk/api/ContragentInsis/DictionaryItems/${dictName}?filter=${filterName}`,
537
+ url: `/Ekk/api/ContragentInsis/DictionaryItems/${dictName}?filter=${filterName}`,
531
538
  });
532
539
  }
533
540
 
534
541
  async setINSISWorkData(data: any) {
535
542
  return this.axiosCall({
536
543
  method: Methods.POST,
537
- url: `/arm/api/Bpm/SetInsisWorkData`,
544
+ url: `/Arm/api/Bpm/SetInsisWorkData`,
538
545
  data: data,
539
546
  });
540
547
  }
541
548
 
542
- async searchAgentByName(name: string) {
549
+ async searchAgentByName(name: string): Promise<AgentData[]> {
543
550
  return this.axiosCall({
544
551
  method: Methods.GET,
545
- url: `/ekk/api/ContragentInsis/AgentByName?fullName=${name}`,
552
+ url: `/Ekk/api/ContragentInsis/AgentByName?fullName=${name}`,
546
553
  });
547
554
  }
548
555
  }
@@ -0,0 +1,196 @@
1
+ <template>
2
+ <div class="rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
3
+ <div class="mt-3 ml-5">
4
+ <p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ $t('form.attachManager') }}</p>
5
+ </div>
6
+ <v-form ref="vForm" class="flex flex-col mt-1">
7
+ <base-panel-input
8
+ class="pl-1"
9
+ v-model="formStore.SaleChanellPolicy"
10
+ :value="formStore.SaleChanellPolicy.nameRu"
11
+ :readonly="isReadonly"
12
+ :clearable="!isReadonly"
13
+ :label="$t('form.salesChanell')"
14
+ :rules="$rules.objectRequired"
15
+ append-inner-icon="mdi mdi-chevron-right"
16
+ @append="openPanel('SaleChanellPolicy', $t('form.salesChanell'))"
17
+ ></base-panel-input>
18
+ <base-panel-input
19
+ class="pl-1"
20
+ v-model="formStore.RegionPolicy"
21
+ :value="formStore.RegionPolicy.nameRu"
22
+ :readonly="isReadonly"
23
+ :clearable="!isReadonly"
24
+ :label="$t('form.Region')"
25
+ :rules="$rules.objectRequired"
26
+ append-inner-icon="mdi mdi-chevron-right"
27
+ @append="openPanel('RegionPolicy', $t('form.Region'))"
28
+ ></base-panel-input>
29
+ <base-panel-input
30
+ class="pl-1"
31
+ v-model="formStore.ManagerPolicy"
32
+ :value="formStore.ManagerPolicy.nameRu"
33
+ :readonly="isReadonly"
34
+ :clearable="!isReadonly"
35
+ :label="$t('form.manager')"
36
+ :rules="$rules.objectRequired"
37
+ append-inner-icon="mdi mdi-chevron-right"
38
+ @append="openPanel('ManagerPolicy', $t('form.manager'))"
39
+ ></base-panel-input>
40
+ <base-panel-input
41
+ class="pl-1"
42
+ v-model="formStore.AgentData"
43
+ :value="formStore.AgentData.fullName"
44
+ :readonly="isReadonly"
45
+ :clearable="!isReadonly"
46
+ :label="$t('form.agent')"
47
+ :rules="$rules.agentDataRequired"
48
+ append-inner-icon="mdi mdi-chevron-right"
49
+ @append="openPanel('AgentData', $t('form.agent'))"
50
+ ></base-panel-input>
51
+ </v-form>
52
+ <Teleport v-if="isPanelOpen" to="#panel-actions">
53
+ <div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
54
+ <base-rounded-input
55
+ v-model="searchQuery"
56
+ :label="$t('labels.search')"
57
+ class="w-full p-2"
58
+ :hide-details="true"
59
+ :append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
60
+ @append="searchAgent"
61
+ ></base-rounded-input>
62
+ <div v-if="dictList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
63
+ <div v-for="(item, index) in dictList" :key="item.id">
64
+ <base-panel-select-item
65
+ :key="index"
66
+ :text="currentDictName === 'AgentData' ? item.fullName : (item.nameRu as string)"
67
+ :selected="currentDictName === 'AgentData' ? item.fullName === panelValue.fullName : item.nameRu === panelValue.nameRu"
68
+ @click="pickPanelValue(item)"
69
+ ></base-panel-select-item>
70
+ </div>
71
+ </div>
72
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
73
+ </div>
74
+ </Teleport>
75
+ </div>
76
+ </template>
77
+
78
+ <script lang="ts">
79
+ import { Value } from '@/composables/classes';
80
+
81
+ export default defineComponent({
82
+ props: {
83
+ title: {
84
+ type: String,
85
+ default: '',
86
+ },
87
+ disabled: {
88
+ type: Boolean,
89
+ default: false,
90
+ },
91
+ },
92
+ setup(props) {
93
+ const route = useRoute();
94
+ const dataStore = useDataStore();
95
+ const formStore = useFormStore();
96
+ const isPanelOpen = ref<boolean>(false);
97
+ const isPanelLoading = ref<boolean>(false);
98
+ const panelValue = ref<Value & AgentData>(new Value());
99
+ const searchQuery = ref<string>('');
100
+ const currentDictName = ref<string>();
101
+
102
+ const dictList = computed(() => {
103
+ if (!currentDictName.value) {
104
+ return [];
105
+ }
106
+ if (currentDictName.value === 'AgentData') {
107
+ return dataStore[currentDictName.value];
108
+ } else {
109
+ // @ts-ignore
110
+ return dataStore[currentDictName.value].filter((item: Value) => {
111
+ // @ts-ignore
112
+ return item.nameRu ? item.nameRu.toLowerCase().includes(searchQuery.value.toLowerCase()) : item.fullName.toLowerCase().includes(searchQuery.value.toLowerCase());
113
+ });
114
+ }
115
+ });
116
+ const isReadonly = computed(
117
+ () =>
118
+ props.disabled ||
119
+ route.params.taskId === '0' ||
120
+ (route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
121
+ );
122
+
123
+ const openPanel = async (currentDict: string, title: string) => {
124
+ searchQuery.value = '';
125
+ if (dataStore.isTask() && !props.disabled) {
126
+ dataStore.panelAction = null;
127
+ dataStore.panel.open = true;
128
+ dataStore.panel.title = title;
129
+ currentDictName.value = currentDict;
130
+
131
+ if (currentDict === 'ManagerPolicy') {
132
+ isPanelLoading.value = true;
133
+ await dataStore.filterManagerByRegion(formStore.RegionPolicy?.ids);
134
+ }
135
+
136
+ isPanelOpen.value = true;
137
+ panelValue.value = formStore[currentDict as keyof typeof formStore];
138
+ isPanelLoading.value = false;
139
+ } else {
140
+ dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
141
+ }
142
+ };
143
+
144
+ const searchAgent = async () => {
145
+ if (searchQuery.value) {
146
+ isPanelLoading.value = true;
147
+ await dataStore.searchAgentByName(searchQuery.value);
148
+ isPanelLoading.value = false;
149
+ }
150
+ };
151
+
152
+ const pickPanelValue = (answer: any) => {
153
+ // @ts-ignore
154
+ formStore[currentDictName.value] = answer;
155
+ isPanelOpen.value = false;
156
+ dataStore.panel.open = false;
157
+ searchQuery.value = '';
158
+ };
159
+
160
+ watch(searchQuery, () => {
161
+ if (searchQuery.value === null) {
162
+ searchQuery.value = '';
163
+ }
164
+ });
165
+
166
+ watch(
167
+ () => formStore.RegionPolicy,
168
+ (val, oldVal) => {
169
+ if (val.ids !== oldVal.ids) {
170
+ formStore.ManagerPolicy = new Value();
171
+ }
172
+ },
173
+ );
174
+
175
+ return {
176
+ // State
177
+ formStore,
178
+ isPanelOpen,
179
+ isPanelLoading,
180
+ panelValue,
181
+ searchQuery,
182
+ Value,
183
+ currentDictName,
184
+
185
+ // Computed
186
+ dictList,
187
+ isReadonly,
188
+
189
+ // Functions
190
+ openPanel,
191
+ searchAgent,
192
+ pickPanelValue,
193
+ };
194
+ },
195
+ });
196
+ </script>
@@ -39,7 +39,7 @@
39
39
  class="rounded-t-lg pl-6 py-1 cursor-pointer"
40
40
  @click="openFirstPanel(question)"
41
41
  >
42
- {{ $t('questionnaireType.pleaseAnswer').replace('{text}', `${secondQuestionList.length}`) }}
42
+ {{ $t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
43
43
  </div>
44
44
  </base-fade-transition>
45
45
  <span :class="[$libStyles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
@@ -169,11 +169,11 @@ export default defineComponent({
169
169
  if (errors) {
170
170
  const errorText = errors.querySelector('.v-label.v-field-label');
171
171
  if (errorText) {
172
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
172
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
173
173
  } else {
174
174
  const errorFieldText = errors.parentElement?.parentElement?.children[0].innerHTML;
175
175
  if (errorFieldText) {
176
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText));
176
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText }));
177
177
  }
178
178
  }
179
179
  errors.scrollIntoView({
@@ -793,7 +793,7 @@ export default {
793
793
  return;
794
794
  }
795
795
  if (!member.value.iin || member.value.iin.length !== useMask().iin.length || !member.value.phoneNumber || member.value.phoneNumber.length !== useMask().phone.length) {
796
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', 'Номер телефона, ИИН'), 5000);
796
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }), 5000);
797
797
  dataStore.panel.open = false;
798
798
  isSearchOpen.value = false;
799
799
  return;
@@ -814,7 +814,7 @@ export default {
814
814
  return;
815
815
  }
816
816
  if (!member.value.iin || member.value.iin.length !== useMask().iin.length) {
817
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', 'ИИН'), 5000);
817
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: 'ИИН' }), 5000);
818
818
  dataStore.panel.open = false;
819
819
  isSearchOpen.value = false;
820
820
  return;
@@ -963,11 +963,11 @@ export default {
963
963
  if (errors) {
964
964
  const errorText = errors.querySelector('.v-label.v-field-label');
965
965
  if (errorText) {
966
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
966
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
967
967
  } else {
968
968
  const errorFieldText = errors.querySelector('.v-input__control');
969
969
  if (errorFieldText) {
970
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '')));
970
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
971
971
  }
972
972
  }
973
973
  errors.scrollIntoView({
@@ -982,7 +982,7 @@ export default {
982
982
 
983
983
  const checkOtp = async () => {
984
984
  if (!member.value.otpCode || member.value.iin?.length !== useMask().iin.length || member.value.phoneNumber?.length !== useMask().phone.length) {
985
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', dataStore.t('form.otpCode')), 3000);
985
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: dataStore.t('form.otpCode') }), 3000);
986
986
  return;
987
987
  }
988
988
  const checked = await memberStore.checkOtp(member.value);
@@ -412,11 +412,11 @@ export default defineComponent({
412
412
  if (errors) {
413
413
  const errorText = errors.querySelector('.v-label.v-field-label');
414
414
  if (errorText) {
415
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
415
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
416
416
  } else {
417
417
  const errorFieldText = errors.querySelector('.v-input__control');
418
418
  if (errorFieldText) {
419
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '')));
419
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
420
420
  }
421
421
  }
422
422
  errors.scrollIntoView({
@@ -440,8 +440,10 @@ export default defineComponent({
440
440
  formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
441
441
  productConditionsForm.requestedSumInsured = defaultData.amount;
442
442
  productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
443
- productConditionsForm.processIndexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
444
- productConditionsForm.paymentPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
443
+ const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
444
+ if (indexRate) productConditionsForm.processIndexRate = indexRate;
445
+ const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
446
+ if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
445
447
  productConditionsForm.signDate = reformatDate(defaultData.signDate);
446
448
  }
447
449
  }
@@ -781,6 +781,8 @@ export class DataStoreClass {
781
781
  hasInsis: boolean;
782
782
  // Калькулятор без ввода данных
783
783
  hasCalculator: boolean;
784
+ // Блок прикрепления к менеджеру
785
+ hasAttachment: boolean;
784
786
  };
785
787
  hasLayoutMargins: boolean;
786
788
  readonly product: string | null;
@@ -840,9 +842,9 @@ export class DataStoreClass {
840
842
  user: User;
841
843
  accessToken: string | null = null;
842
844
  refreshToken: string | null = null;
843
- processCoverTypeSum: any[];
844
- processIndexRate: any[];
845
- processPaymentPeriod: any[];
845
+ processCoverTypeSum: Value[];
846
+ processIndexRate: Value[];
847
+ processPaymentPeriod: Value[];
846
848
  taskList: TaskListItem[];
847
849
  processHistory: TaskHistory[];
848
850
  contragentList: any[];
@@ -851,11 +853,11 @@ export class DataStoreClass {
851
853
  groupCode: string;
852
854
  userGroups: Item[];
853
855
  onMainPage: boolean;
854
- SaleChanellPolicyList: any[];
855
- RegionPolicyList: any[];
856
- ManagerPolicyList: any[];
857
- AgentDataList: any[];
858
- riskGroup: any[];
856
+ SaleChanellPolicy: Value[];
857
+ RegionPolicy: Value[];
858
+ ManagerPolicy: Value[];
859
+ AgentData: AgentData[];
860
+ riskGroup: Value[];
859
861
  constructor() {
860
862
  this.controls = {
861
863
  onAuth: false,
@@ -865,15 +867,16 @@ export class DataStoreClass {
865
867
  hasGKB: false,
866
868
  hasInsis: false,
867
869
  hasCalculator: false,
870
+ hasAttachment: true,
868
871
  };
869
872
  this.hasLayoutMargins = true;
870
873
  this.processIndexRate = [];
871
874
  this.processPaymentPeriod = [];
872
875
  this.questionRefs = [];
873
- this.SaleChanellPolicyList = [];
874
- this.RegionPolicyList = [];
875
- this.ManagerPolicyList = [];
876
- this.AgentDataList = [];
876
+ this.SaleChanellPolicy = [];
877
+ this.RegionPolicy = [];
878
+ this.ManagerPolicy = [];
879
+ this.AgentData = [];
877
880
  this.product = import.meta.env.VITE_PRODUCT ? (import.meta.env.VITE_PRODUCT as string) : null;
878
881
  this.showNav = true;
879
882
  this.menuItems = [];
@@ -949,27 +952,36 @@ export class DataStoreClass {
949
952
  id: '1',
950
953
  nameKz: '',
951
954
  nameRu: '1',
952
- isDefault: true,
955
+ code: '',
956
+ ids: '',
953
957
  },
954
958
  {
955
959
  id: '2',
956
960
  nameKz: '',
957
961
  nameRu: '2',
962
+ code: '',
963
+ ids: '',
958
964
  },
959
965
  {
960
966
  id: '3',
961
967
  nameKz: '',
962
968
  nameRu: '3',
969
+ code: '',
970
+ ids: '',
963
971
  },
964
972
  {
965
973
  id: '4',
966
974
  nameKz: '',
967
975
  nameRu: '4',
976
+ code: '',
977
+ ids: '',
968
978
  },
969
979
  {
970
980
  id: '5',
971
981
  nameKz: '',
972
982
  nameRu: '5',
983
+ code: '',
984
+ ids: '',
973
985
  },
974
986
  ];
975
987
  }
@@ -997,15 +1009,7 @@ export class FormStoreClass {
997
1009
  };
998
1010
  birthInfos: BirthInfoGKB[];
999
1011
  SaleChanellPolicy: Value;
1000
- AgentData: {
1001
- agentId: null;
1002
- manId: number;
1003
- fullName: string;
1004
- officeId: null;
1005
- officeCode: null;
1006
- saleChannel: string;
1007
- managerName: string;
1008
- };
1012
+ AgentData: AgentData;
1009
1013
  RegionPolicy: Value;
1010
1014
  ManagerPolicy: Value;
1011
1015
  isDisabled: {
@@ -7,6 +7,7 @@ export const constants = Object.freeze({
7
7
  bolashak: 8,
8
8
  liferenta: 9,
9
9
  gons: 10,
10
+ halykkazyna: 11,
10
11
  },
11
12
 
12
13
  editableStatuses: ['StartForm', 'EditBeneficiaryForm', 'EditForm'],
@@ -0,0 +1,19 @@
1
+ import { createI18n } from 'vue-i18n';
2
+ import en from '@/locales/en.json';
3
+ import ru from '@/locales/ru.json';
4
+ import kz from '@/locales/kz.json';
5
+
6
+ const instance = createI18n({
7
+ legacy: false,
8
+ globalInjection: true,
9
+ locale: 'ru',
10
+ messages: {
11
+ en,
12
+ ru,
13
+ kz,
14
+ },
15
+ });
16
+
17
+ export default instance;
18
+
19
+ export const i18n = instance.global;