hl-core 0.0.8-beta.24 → 0.0.8-beta.26

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.
@@ -26,6 +26,7 @@
26
26
  @click:append="!props.readonly && $emit('append-out')"
27
27
  @click:prepend="!props.readonly && $emit('prepend-out')"
28
28
  @click:prepend-inner="!props.readonly && $emit('prepend')"
29
+ @click:clear="!props.readonly && $emit('on-clear')"
29
30
  @update:modelValue="$emit('update:modelValue', $event)"
30
31
  >
31
32
  <template v-if="appendInnerIcon && appendInnerIcon.length" v-slot:append-inner>
@@ -127,7 +128,7 @@ export default defineComponent({
127
128
  type: String,
128
129
  },
129
130
  },
130
- emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out', 'input'],
131
+ emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out', 'input', 'on-clear'],
131
132
 
132
133
  setup(props, { emit }) {
133
134
  const submitted = (event: any) => {
@@ -0,0 +1,137 @@
1
+ <template>
2
+ <v-select
3
+ class="rounded-select"
4
+ :model-value="modelValue"
5
+ :rules="rules"
6
+ :loading="loading"
7
+ :placeholder="placeholder"
8
+ :label="label"
9
+ :variant="variant"
10
+ :clear-icon="clearIcon"
11
+ :color="color"
12
+ :hint="hint"
13
+ :clearable="props.readonly ? false : clearable"
14
+ :disabled="disabled"
15
+ :readonly="props.readonly"
16
+ :prepend-icon="prependIcon ? prependIcon : ''"
17
+ :append-icon="appendIcon ? appendIcon : ''"
18
+ :prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
19
+ :append-inner-icon="appendInnerIcon ? appendInnerIcon : ''"
20
+ :bg-color="bgColor ? bgColor : ''"
21
+ :items="items"
22
+ @click:append="!props.readonly && $emit('append-out')"
23
+ @click:prepend="!props.readonly && $emit('prepend-out')"
24
+ @click:append-inner="!props.readonly && $emit('append')"
25
+ @click:prepend-inner="!props.readonly && $emit('prepend')"
26
+ @update:modelValue="$emit('update:modelValue', $event)"
27
+ >
28
+ <template v-if="loading" #loader>
29
+ <v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
30
+ </template>
31
+ </v-select>
32
+ </template>
33
+
34
+ <script lang="ts">
35
+ export default defineComponent({
36
+ name: 'BaseRoundedSelect',
37
+ props: {
38
+ modelValue: {
39
+ required: false,
40
+ },
41
+ loading: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ items: {
46
+ type: Array<any>,
47
+ default: [],
48
+ },
49
+ clearable: {
50
+ type: Boolean,
51
+ default: true,
52
+ },
53
+ disabled: {
54
+ type: Boolean,
55
+ default: false,
56
+ },
57
+ readonly: {
58
+ type: Boolean,
59
+ default: false,
60
+ },
61
+ placeholder: {
62
+ type: String,
63
+ default: '',
64
+ },
65
+ label: {
66
+ type: String,
67
+ default: '',
68
+ },
69
+ hint: {
70
+ type: String,
71
+ default: '',
72
+ },
73
+ rules: {
74
+ type: Array<any>,
75
+ default: [],
76
+ },
77
+ variant: {
78
+ type: String as PropType<InputVariants>,
79
+ default: 'solo',
80
+ },
81
+ color: {
82
+ type: String,
83
+ default: '#009c73',
84
+ },
85
+ clearIcon: {
86
+ type: String,
87
+ default: 'mdi-close',
88
+ },
89
+ prependIcon: {
90
+ type: String,
91
+ },
92
+ appendIcon: {
93
+ type: String,
94
+ },
95
+ prependInnerIcon: {
96
+ type: String,
97
+ },
98
+ appendInnerIcon: {
99
+ type: String,
100
+ },
101
+ bgColor: {
102
+ type: String,
103
+ },
104
+ },
105
+ emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out'],
106
+
107
+ setup(props, { emit }) {
108
+ const submitted = (event: any) => {
109
+ emit('submitted', event);
110
+ };
111
+
112
+ return {
113
+ submitted,
114
+ props,
115
+ };
116
+ },
117
+ });
118
+ </script>
119
+
120
+ <style>
121
+ .rounded-select input:focus {
122
+ border: none !important;
123
+ outline: none !important;
124
+ }
125
+ .rounded-select .v-label.v-field-label {
126
+ top: 20px;
127
+ }
128
+ .rounded-select .v-field {
129
+ border-radius: 8px;
130
+ border: 1px solid #dadada;
131
+ box-shadow: none;
132
+ font-size: 14px;
133
+ }
134
+ .rounded-select .v-field--error {
135
+ border-color: #ff5449;
136
+ }
137
+ </style>
@@ -34,7 +34,7 @@
34
34
  {{ $t('buttons.logout') }}
35
35
  <i class="mdi mdi-logout text-xl"></i>
36
36
  </base-panel-item>
37
- <div class="absolute bottom-2 w-full flex items-center justify-center opacity-30 text-sm">
37
+ <div v-if="$dataStore.settings.open" class="absolute bottom-2 w-full flex items-center justify-center opacity-30 text-sm">
38
38
  <p>{{ pkg.version }}</p>
39
39
  </div>
40
40
  <base-dialog v-model="dialogSignOut" :title="$t('dialog.exit')" :subtitle="$t('dialog.dataWillClear')" actions="default" @yes="logoutUser" @no="dialogSignOut = false">
@@ -151,9 +151,10 @@
151
151
  :readonly="isDisabled"
152
152
  :clearable="!isDisabled"
153
153
  :rules="requestedSumInsured"
154
- :label="$t('productConditionsForm.requestedSumInsured')"
154
+ :label="requestedSumInsuredLabel"
155
155
  :suffix="$constants.currencySymbols.kzt"
156
156
  @input="onInputSum"
157
+ @onClear="onClearSum"
157
158
  ></base-form-input>
158
159
  <base-form-input
159
160
  v-if="hasRequestedSumInsuredInDollar"
@@ -164,6 +165,7 @@
164
165
  :label="$t('productConditionsForm.requestedSumInsuredInDollar')"
165
166
  :suffix="$constants.currencySymbols.usd"
166
167
  @input="onInputSumDollar"
168
+ @onClear="onClearSumDollar"
167
169
  ></base-form-input>
168
170
  <base-form-input
169
171
  v-model="productConditionsForm.insurancePremiumPerMonth"
@@ -173,6 +175,7 @@
173
175
  :label="$t('productConditionsForm.insurancePremiumAmount')"
174
176
  :suffix="$constants.currencySymbols.kzt"
175
177
  @input="onInputInsurancePremiumPerMonth"
178
+ @onClear="onClearPremium"
176
179
  ></base-form-input>
177
180
  <base-form-input
178
181
  v-if="hasInsurancePremiumPerMonthInDollar"
@@ -183,6 +186,7 @@
183
186
  :label="$t('productConditionsForm.insurancePremiumAmountInDollar')"
184
187
  :suffix="$constants.currencySymbols.usd"
185
188
  @input="onInputInsurancePremiumPerMonthInDollar"
189
+ @onClear="onClearPremiumDollar"
186
190
  ></base-form-input>
187
191
  <base-form-input
188
192
  v-if="hasCurrency && $dataStore.currencies.usd"
@@ -198,7 +202,6 @@
198
202
  :title="$t('productConditionsForm.guaranteedTermAnnuityPayments')"
199
203
  :disabled="isDisabled"
200
204
  :has-border="false"
201
- @clicked="handleToggler"
202
205
  ></base-form-toggle>
203
206
  <base-form-input
204
207
  v-if="productConditionsForm.additionalConditionAnnuityPayments"
@@ -253,7 +256,7 @@
253
256
  :clearable="!isDisabled"
254
257
  :label="term.coverTypeName"
255
258
  append-inner-icon="mdi mdi-chevron-right"
256
- :suffix="!!term.amount ? `${$dataStore.getNumberWithSpaces(term.amount)} ${currencySymbolsAddTerm}` : ''"
259
+ :suffix="!!term.amount ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}` : ''"
257
260
  @append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
258
261
  ></base-panel-input>
259
262
  </div>
@@ -426,6 +429,19 @@ export default defineComponent({
426
429
  }
427
430
  return constants.currencySymbols.kzt;
428
431
  });
432
+ const requestedSumInsuredLabel = computed(() => {
433
+ if (whichProduct.value === 'halykkazyna') {
434
+ return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
435
+ }
436
+ return dataStore.t('productConditionsForm.requestedSumInsured');
437
+ });
438
+
439
+ const formatTermValue = (term: number) => {
440
+ if (term !== null) {
441
+ return Number.isInteger(term) ? dataStore.getNumberWithSpaces(term) : dataStore.getNumberWithDot(term);
442
+ }
443
+ return null;
444
+ };
429
445
 
430
446
  const toStatement = async () => {
431
447
  const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
@@ -571,6 +587,34 @@ export default defineComponent({
571
587
  }
572
588
  };
573
589
 
590
+ const onClearSum = () => {
591
+ productConditionsForm.requestedSumInsuredInDollar = null;
592
+ };
593
+
594
+ const onClearSumDollar = () => {
595
+ productConditionsForm.requestedSumInsured = null;
596
+ };
597
+
598
+ const onClearPremium = () => {
599
+ productConditionsForm.insurancePremiumPerMonthInDollar = null;
600
+ };
601
+
602
+ const onClearPremiumDollar = () => {
603
+ productConditionsForm.insurancePremiumPerMonth = null;
604
+ };
605
+
606
+ const clearFields = () => {
607
+ productConditionsForm.coverPeriod = null;
608
+ productConditionsForm.birthDate = null;
609
+ productConditionsForm.gender = new Value();
610
+ productConditionsForm.paymentPeriod = new Value();
611
+ productConditionsForm.processIndexRate = new Value();
612
+ productConditionsForm.requestedSumInsured = null;
613
+ productConditionsForm.requestedSumInsuredInDollar = null;
614
+ productConditionsForm.insurancePremiumPerMonth = null;
615
+ productConditionsForm.insurancePremiumPerMonthInDollar = null;
616
+ };
617
+
574
618
  const submitForm = async () => {
575
619
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
576
620
  if (v.valid) {
@@ -627,9 +671,11 @@ export default defineComponent({
627
671
  isCalculating.value = true;
628
672
  if (props.isRecalculation) {
629
673
  await dataStore.calculateWithoutApplication(true, whichProduct.value);
674
+ additionalTerms.value = formStore.additionalInsuranceTermsWithout;
630
675
  } else {
631
676
  if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
632
677
  await dataStore.calculate(route.params.taskId);
678
+ additionalTerms.value = formStore.additionalInsuranceTerms;
633
679
  }
634
680
  }
635
681
  isCalculating.value = false;
@@ -657,6 +703,9 @@ export default defineComponent({
657
703
 
658
704
  onMounted(async () => {
659
705
  if (props.isRecalculation === true) {
706
+ if (dataStore.isCalculator) {
707
+ clearFields();
708
+ }
660
709
  if (
661
710
  (dataStore.isCalculator || route.params.taskId === '0') &&
662
711
  productConditionsForm.requestedSumInsured === null &&
@@ -685,7 +734,7 @@ export default defineComponent({
685
734
  if (!!productConditionsForm.requestedSumInsured) {
686
735
  whichSum.value = 'requestedSumInsured';
687
736
  }
688
- if(dataStore.isCalculator) {
737
+ if (dataStore.isCalculator) {
689
738
  dataStore.processCode = constants.products[whichProduct.value];
690
739
  await dataStore.getProcessPaymentPeriod();
691
740
  }
@@ -734,7 +783,6 @@ export default defineComponent({
734
783
  if (val.code === 'Lifelong') formStore.productConditionsForm.termAnnuityPayments = null;
735
784
  },
736
785
  );
737
-
738
786
  watch(
739
787
  () => dataStore.panel.open,
740
788
  () => {
@@ -785,6 +833,7 @@ export default defineComponent({
785
833
  hasAnnuityPayments,
786
834
  currencySymbolsAddTerm,
787
835
  amountAnnuityPayments,
836
+ requestedSumInsuredLabel,
788
837
 
789
838
  // Rules
790
839
  coverPeriodRule,
@@ -802,6 +851,12 @@ export default defineComponent({
802
851
  onInputSum,
803
852
  onInputSumDollar,
804
853
  toStatement,
854
+ onClearSum,
855
+ onClearSumDollar,
856
+ onClearPremium,
857
+ onClearPremiumDollar,
858
+ clearFields,
859
+ formatTermValue,
805
860
  };
806
861
  },
807
862
  });
package/locales/en.json CHANGED
@@ -209,7 +209,7 @@
209
209
  "policyholderAndInsured": "Insured / Policyholder",
210
210
  "policyholderAndInsuredSame": "Insured / Policyholder are the same person",
211
211
  "insuredForm": "Insured",
212
- "beneficiaryForm": "Beneficiary",
212
+ "beneficiaryForm": "Beneficiary",
213
213
  "beneficialOwnerForm": "Beneficial Owner",
214
214
  "policyholdersRepresentativeForm": "Policyholder's Representative",
215
215
  "productConditions": "Product Conditions and Calculations",
@@ -253,6 +253,7 @@
253
253
  "processIndexRate": "Requested indexation rate (from 3% to 7%)",
254
254
  "processPaymentPeriod": "Frequency of insurance premium payment:",
255
255
  "requestedSumInsured": "Insurance Amount",
256
+ "requestedSumInsuredInTenge": "Insurance Amount in tenge",
256
257
  "requestedSumInsuredInDollar": "Insurance Amount in dollars",
257
258
  "sumInsured": "Insurance Amount",
258
259
  "insurancePremiumPerMonth": "Insurance Premium",
@@ -374,6 +375,15 @@
374
375
  "new": "Подать заявление"
375
376
  },
376
377
  "labels": {
378
+ "code": "Code",
379
+ "codes": "Codes",
380
+ "listType": "List type",
381
+ "editDate": "Edit date",
382
+ "addDate": "Created date",
383
+ "type": "Type",
384
+ "naming": "Name",
385
+ "countryName": "Country name",
386
+ "dicts": "Dictionaries",
377
387
  "aml": "AML",
378
388
  "amlLong": "Anti Money Laundering",
379
389
  "efoLong": "EFO",
package/locales/kz.json CHANGED
@@ -253,6 +253,7 @@
253
253
  "processIndexRate": "Индексацияның қалпынан тапсырыс берілген өлшемі (3% - 7%)",
254
254
  "processPaymentPeriod": "Cақтандыру сыйлықақысы төлемінің кестелігі:",
255
255
  "requestedSumInsured": "Сақтандыру сомасы",
256
+ "requestedSumInsuredInTenge": "Сақтандыру сомасы тенгемен",
256
257
  "requestedSumInsuredInDollar": "Сақтандыру сома доллармен",
257
258
  "sumInsured": "Страховая сумма",
258
259
  "insurancePremiumPerMonth": "Сақтандыру сыйлықақысы айына",
@@ -374,6 +375,15 @@
374
375
  "new": "Өтінім жасау"
375
376
  },
376
377
  "labels": {
378
+ "code": "Код",
379
+ "codes": "Коды",
380
+ "listType": "Тип списка",
381
+ "editDate": "Дата редактирования",
382
+ "addDate": "Дата добавления",
383
+ "type": "Тип",
384
+ "naming": "Наименование",
385
+ "countryName": "Наименование страны",
386
+ "dicts": "Справочники",
377
387
  "aml": "AML",
378
388
  "amlLong": "Ақшаны жылыстатумен күрес",
379
389
  "efoLong": "Единое фронтальное окно",
package/locales/ru.json CHANGED
@@ -253,6 +253,7 @@
253
253
  "processIndexRate": "Запрашиваемый размер коэффициента индексации (от 3% до 7%)",
254
254
  "processPaymentPeriod": "Периодичность оплаты страховой премии:",
255
255
  "requestedSumInsured": "Страховая сумма",
256
+ "requestedSumInsuredInTenge": "Страховая сумма в тенге",
256
257
  "requestedSumInsuredInDollar": "Страховая сумма в долларах",
257
258
  "sumInsured": "Страховая сумма",
258
259
  "insurancePremiumPerMonth": "Страховая премия",
@@ -374,6 +375,15 @@
374
375
  "new": "Подать заявление"
375
376
  },
376
377
  "labels": {
378
+ "code": "Код",
379
+ "codes": "Коды",
380
+ "listType": "Тип списка",
381
+ "editDate": "Дата редактирования",
382
+ "addDate": "Дата добавления",
383
+ "type": "Тип",
384
+ "naming": "Наименование",
385
+ "countryName": "Наименование страны",
386
+ "dicts": "Справочники",
377
387
  "aml": "AML",
378
388
  "amlLong": "Противодействие отмыву денег",
379
389
  "efoLong": "Единое фронтальное окно",
@@ -468,7 +478,7 @@
468
478
  "noResident": "Нерезидентам отказано",
469
479
  "policyholderAgeLimit": "Возраст Застрахованного должен быть не менее 18-ти лет",
470
480
  "beneficiaryAgeLimit": "На дату подписания полиса возраст Выгодоприобретателя должен быть не более 15 лет",
471
- "guaranteedPeriodLimit": "Период гарантированного срока не может быть больше срока аннуитетных выплат",
481
+ "guaranteedPeriodLimit": "Период гарантированного срока не может быть больше срока аннуитетных выплат"
472
482
  },
473
483
  "code": "КЭС",
474
484
  "fontSize": "Размер шрифта",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8-beta.24",
3
+ "version": "0.0.8-beta.26",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -1098,6 +1098,9 @@ export const useDataStore = defineStore('data', {
1098
1098
  getNumberWithSpaces(n) {
1099
1099
  return n === null ? null : Number((typeof n === 'string' ? n : n.toFixed().toString()).replace(/[^0-9]+/g, '')).toLocaleString('ru');
1100
1100
  },
1101
+ getNumberWithDot(n) {
1102
+ return n === null ? null : n.toLocaleString('ru', { maximumFractionDigits: 2, minimumFractionDigits: 2 }).replace(/,/g, '.');
1103
+ },
1101
1104
  async getTaskList(search = '', groupCode = 'Work', onlyGet = false, needToReturn = false, key = 'dateCreated', processInstanceId = null, byOneProcess = null) {
1102
1105
  if (onlyGet === false) {
1103
1106
  this.isLoading = true;
@@ -1384,8 +1387,11 @@ export const useDataStore = defineStore('data', {
1384
1387
  this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.premium);
1385
1388
  this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
1386
1389
  if (this.isKazyna || product === 'halykkazyna') {
1387
- this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(calculationResponse.amountInCurrency);
1388
- this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(calculationResponse.premiumInCurrency);
1390
+ if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
1391
+ this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(calculationResponse.amountInCurrency);
1392
+ } else {
1393
+ this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(calculationResponse.premiumInCurrency);
1394
+ }
1389
1395
  }
1390
1396
  if (this.isLiferenta) {
1391
1397
  this.formStore.productConditionsForm.amountAnnuityPayments = this.getNumberWithSpaces(calculationResponse.annuityMonthPay);
@@ -1457,7 +1463,11 @@ export const useDataStore = defineStore('data', {
1457
1463
  this.formStore.applicationData = applicationData;
1458
1464
  this.formStore.additionalInsuranceTerms = this.formStore.applicationData.addCoverDto;
1459
1465
  if (this.isKazyna) {
1460
- this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(result / this.currencies.usd);
1466
+ if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
1467
+ this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(result / this.currencies.usd);
1468
+ } else {
1469
+ this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(result / this.currencies.usd);
1470
+ }
1461
1471
  }
1462
1472
  if (this.formStore.productConditionsForm.insurancePremiumPerMonth != null) {
1463
1473
  this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(result);