hl-core 0.0.10-beta.58 → 0.0.10-beta.59

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/base.api.ts CHANGED
@@ -1150,6 +1150,18 @@ export class ApiClass {
1150
1150
  params: { processInstanceId: processInstanceId },
1151
1151
  });
1152
1152
  },
1153
+ setOppvCount: async (processInstanceId: string, data: any) => {
1154
+ return await this.axiosCall<{ oppvCount: number; errocCode: number; errorMsg: string }>({
1155
+ method: Methods.POST,
1156
+ baseURL: getStrValuePerEnv('efoBaseApi'),
1157
+ url: `${this.pensionannuityNew.base}/SetOppvCount`,
1158
+ headers: {
1159
+ 'Content-Type': 'multipart/form-data',
1160
+ },
1161
+ params: { processInstanceId },
1162
+ data: data,
1163
+ });
1164
+ },
1153
1165
  };
1154
1166
 
1155
1167
  externalServices = {
@@ -128,6 +128,7 @@
128
128
  />
129
129
  <base-file-input
130
130
  v-if="
131
+ processCode === 25 &&
131
132
  !formStore.signedDocumentList.find(i => i.fileTypeCode === '8' && i.iin === String(member.iin).replaceAll('-', '')) &&
132
133
  formStore.requiredDocuments.some(i => i.code === '8' && i.iin === String(member.iin).replaceAll('-', ''))
133
134
  "
@@ -146,6 +147,7 @@
146
147
  />
147
148
  <base-file-input
148
149
  v-if="
150
+ processCode === 25 &&
149
151
  !formStore.signedDocumentList.find(i => i.fileTypeCode === '50' && i.iin === String(member.iin).replaceAll('-', '')) &&
150
152
  formStore.requiredDocuments.some(i => i.code === '50' && i.iin === String(member.iin).replaceAll('-', ''))
151
153
  "
@@ -614,6 +616,10 @@ export default defineComponent({
614
616
  if (route.params.taskId !== '0') {
615
617
  clearDigitalDocuments([formStore.policyholderForm as Base.Document.Digital]);
616
618
  setDigitalDocuments([formStore.policyholderForm as Base.Document.Digital]);
619
+ if (processCode === 25 && formStore.slaveInsuredForm.iin !== null && formStore.slaveInsuredForm.id !== 0) {
620
+ clearDigitalDocuments([formStore.slaveInsuredForm as Base.Document.Digital]);
621
+ setDigitalDocuments([formStore.slaveInsuredForm as Base.Document.Digital]);
622
+ }
617
623
  if (insuredFiltered.value.length !== 0) {
618
624
  clearDigitalDocuments(insuredFiltered.value);
619
625
  setDigitalDocuments(insuredFiltered.value);
@@ -387,6 +387,19 @@
387
387
  :label="$dataStore.t('pension.disabilityGroup')"
388
388
  />
389
389
  </base-form-section>
390
+ <base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.ENPFnote')" class="mt-[14px]">
391
+ <base-file-input :loading="$dataStore.isLoading" @input.prevent="onFileChange($event)" v-if="!enpfNoteFile" />
392
+ <base-content-block class="!p-0" v-if="!!enpfNoteFile">
393
+ <div :class="[$styles.whiteBg]" class="p-2 h-12 flex items-center relative rounded-[4px]">
394
+ <span class="ml-2">{{ enpfNoteFile.fileName }}</span>
395
+ <i
396
+ class="transition-all cursor-pointer mdi mdi-dots-vertical pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
397
+ :class="[$styles.greenTextHover]"
398
+ @click="openFileActionsPanel(enpfNoteFile)"
399
+ ></i>
400
+ </div>
401
+ </base-content-block>
402
+ </base-form-section>
390
403
  <base-form-section
391
404
  v-if="formStore.applicationData.processCode !== 24"
392
405
  :title="$dataStore.t('pension.compulsoryAmount&Prof')"
@@ -412,16 +425,13 @@
412
425
  @input="onInputPension($event, 'compulsoryProfContractAmount')"
413
426
  @onClear="onClearPension('compulsoryProfContractAmount')"
414
427
  />
415
- <base-animation>
416
- <base-form-input
417
- v-if="pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0"
418
- v-model="pensionForm.compulsoryProfMonthCount"
419
- :maska="$maska.numbers"
420
- :readonly="isDisabled"
421
- :clearable="!isDisabled"
422
- :label="$dataStore.t('pension.compulsoryProfMonthCount')"
423
- />
424
- </base-animation>
428
+ <base-form-input
429
+ v-model="pensionForm.compulsoryProfMonthCount"
430
+ :readonly="true"
431
+ :clearable="false"
432
+ :rules="$dataStore.rules.notEmpty"
433
+ :label="$dataStore.t('pension.compulsoryProfMonthCount')"
434
+ />
425
435
  <base-form-input
426
436
  v-model="pensionForm.voluntaryContractAmount"
427
437
  :readonly="isDisabled || isEnpfSum"
@@ -443,7 +453,7 @@
443
453
  @onClear="onClearPension('ownFundsRaisAmount')"
444
454
  />
445
455
  <base-animation type="fade">
446
- <base-form-toggle
456
+ <base-form-toggle
447
457
  v-if="formatSpacedNumber(pensionForm.ownFundsRaisAmount) > 0"
448
458
  v-model="pensionForm.isOwnAmountFromDividend"
449
459
  :disabled="isDisabled"
@@ -482,7 +492,7 @@
482
492
  >до {{ transferMaxDate }} включительно</span
483
493
  >
484
494
  </div>
485
- <!--
495
+ <!--
486
496
  <base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled"
487
497
  <base-form-input
488
498
  v-model="contract.transferContractRegNumber"
@@ -511,7 +521,7 @@
511
521
  @input="onInputPension($event, 'transferContractAmount', index)"
512
522
  @onClear="onClearPension('transferContractAmount', index)"
513
523
  />
514
- <base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
524
+ <!-- <base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />-->
515
525
  <base-form-input
516
526
  v-if="contract.transferContractIsOppv"
517
527
  v-model="contract.transferContractMonthCount"
@@ -936,13 +946,41 @@
936
946
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
937
947
  </div>
938
948
  </Teleport>
949
+ <Teleport v-if="isFileActionsPanelOpen" to="#right-panel-actions">
950
+ <base-fade-transition>
951
+ <div :class="[$styles.flexColNav]">
952
+ <base-animation>
953
+ <base-btn
954
+ v-if="enpfNoteFile?.fileName && enpfNoteFile?.fileName.includes('.') ? enpfNoteFile?.fileName.endsWith('.pdf') : true"
955
+ :disabled="documentLoading"
956
+ :loading="documentLoading"
957
+ text="Открыть"
958
+ @click="getDoc('view')"
959
+ />
960
+ </base-animation>
961
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download')" />
962
+ <base-animation>
963
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
964
+ </base-animation>
965
+ </div>
966
+ </base-fade-transition>
967
+ </Teleport>
968
+ <base-dialog
969
+ v-model="deletionDialog"
970
+ :title="$dataStore.t('dialog.confirmDelete')"
971
+ :subtitle="$dataStore.t('dialog.deleteFile')"
972
+ :confirm="$dataStore.t('confirm.delete')"
973
+ :icon="{ mdi: 'delete-outline', color: '#FD2D39' }"
974
+ @yes="deleteFile"
975
+ @no="deletionDialog = false"
976
+ />
939
977
  </section>
940
978
  <div v-if="isLoading" class="w-full h-[80dvh] flex items-center justify-center"><base-loader :size="50" /></div>
941
979
  </template>
942
980
 
943
981
  <script lang="ts">
944
- import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
945
- import type { Projects, AddCover, AddCoverAnswer } from '../../types';
982
+ import { Member, Value, CountryValue, CalculatorForm, TransferContract, DocumentItem } from '../../composables/classes';
983
+ import type { Projects, AddCover, AddCoverAnswer, FileActions } from '../../types';
946
984
 
947
985
  type PensionCalculation = {
948
986
  compulsoryContractAmount: number | string | null;
@@ -977,7 +1015,9 @@ export default defineComponent({
977
1015
  const isPanelLoading = ref<boolean>(false);
978
1016
  const isPanelOpen = ref<boolean>(false);
979
1017
  const isTermsPanelOpen = ref<boolean>(false);
1018
+ const isFileActionsPanelOpen = ref<boolean>(false);
980
1019
  const isLoading = ref<boolean>(false);
1020
+ const documentLoading = ref<boolean>(false);
981
1021
  const panelValue = ref<Value>(new Value());
982
1022
  const termValue = ref<AddCover>();
983
1023
  const subTermValue = ref<string>('');
@@ -992,6 +1032,7 @@ export default defineComponent({
992
1032
  const enabled = 'включено';
993
1033
  const amountRefunded = ref<string | number | null>(null);
994
1034
  const amountPaid = ref<string | number | null>(null);
1035
+ const deletionDialog = ref<boolean>(false);
995
1036
 
996
1037
  const additionalTerms = ref<AddCover[]>([]);
997
1038
 
@@ -1042,6 +1083,7 @@ export default defineComponent({
1042
1083
  return disabilityGroup;
1043
1084
  }
1044
1085
  });
1086
+ const enpfNoteFile = computed(() => formStore.signedDocumentList.find(i => i.fileTypeCode === '8'));
1045
1087
  const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
1046
1088
 
1047
1089
  const transferContracts = ref<TransferContract[]>([]);
@@ -1897,7 +1939,7 @@ export default defineComponent({
1897
1939
  pensionForm.value.amount = '0';
1898
1940
  } else {
1899
1941
  pensionForm.value[key] = null;
1900
-
1942
+
1901
1943
  // Clear isOwnAmountFromDividend when ownFundsRaisAmount is cleared
1902
1944
  if (key === 'ownFundsRaisAmount') {
1903
1945
  pensionForm.value.isOwnAmountFromDividend = null;
@@ -1994,6 +2036,12 @@ export default defineComponent({
1994
2036
  };
1995
2037
 
1996
2038
  const submitForm = async () => {
2039
+ if (whichProduct.value === 'pensionannuitynew') {
2040
+ if (!enpfNoteFile.value) {
2041
+ dataStore.showToaster('error', 'Необходимо вложить Выписка ЕНПФ');
2042
+ return;
2043
+ }
2044
+ }
1997
2045
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
1998
2046
  if (v.valid) {
1999
2047
  if (whichProduct.value === 'lifetrip') {
@@ -2248,6 +2296,53 @@ export default defineComponent({
2248
2296
  );
2249
2297
  };
2250
2298
 
2299
+ const onFileChange = async (event: InputEvent) => {
2300
+ if (event && event.target) {
2301
+ const file = (event.target as HTMLInputElement).files?.[0];
2302
+ if (file) {
2303
+ if (file.type !== constants.fileTypes.pdf) {
2304
+ return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
2305
+ }
2306
+ const result = await dataStore.setOppvCount({ file });
2307
+ if (typeof result === 'number') {
2308
+ pensionForm.value.compulsoryProfMonthCount = result;
2309
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
2310
+ dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
2311
+ }
2312
+ }
2313
+ }
2314
+ };
2315
+ const openFileActionsPanel = async (document: DocumentItem) => {
2316
+ dataStore.rightPanel.title = document.fileTypeName!;
2317
+ dataStore.rightPanel.open = true;
2318
+ isFileActionsPanelOpen.value = true;
2319
+ dataStore.panelAction = null;
2320
+ };
2321
+ const getDoc = async (type: FileActions) => {
2322
+ if (enpfNoteFile.value) {
2323
+ documentLoading.value = true;
2324
+ const fileExtension = enpfNoteFile.value.fileName!.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)![1];
2325
+ await dataStore.getDoc(enpfNoteFile.value, type, fileExtension);
2326
+ documentLoading.value = false;
2327
+ }
2328
+ };
2329
+ const deleteFile = async () => {
2330
+ if (enpfNoteFile.value) {
2331
+ const data = {
2332
+ id: enpfNoteFile.value.id,
2333
+ processInstanceId: enpfNoteFile.value.processInstanceId,
2334
+ iin: enpfNoteFile.value.iin ?? '',
2335
+ };
2336
+ await dataStore.deleteFile(data);
2337
+ deletionDialog.value = false;
2338
+ isFileActionsPanelOpen.value = false;
2339
+ dataStore.rightPanel.open = false;
2340
+ dataStore.panelAction = null;
2341
+ pensionForm.value.compulsoryProfMonthCount = '';
2342
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
2343
+ }
2344
+ };
2345
+
2251
2346
  onMounted(async () => {
2252
2347
  try {
2253
2348
  if (hasContragentData.value) await getContragent();
@@ -2502,6 +2597,16 @@ export default defineComponent({
2502
2597
  },
2503
2598
  { immediate: true },
2504
2599
  );
2600
+ watch(
2601
+ () => pensionForm.value.ownFundsRaisAmount,
2602
+ val => {
2603
+ if (val && val.replace(/\s/g, '') > 0) {
2604
+ pensionForm.value.isOwnAmountFromDividend = true;
2605
+ } else {
2606
+ pensionForm.value.isOwnAmountFromDividend = false;
2607
+ }
2608
+ },
2609
+ );
2505
2610
  }
2506
2611
 
2507
2612
  const copyRedirect = async () => {
@@ -2519,6 +2624,8 @@ export default defineComponent({
2519
2624
  additionalTerms,
2520
2625
  isCalculating,
2521
2626
  isPanelLoading,
2627
+ documentLoading,
2628
+ deletionDialog,
2522
2629
  isPanelOpen,
2523
2630
  isMultiplePanelOpen,
2524
2631
  isTermsPanelOpen,
@@ -2546,6 +2653,7 @@ export default defineComponent({
2546
2653
  amountRefunded,
2547
2654
  transferMaxDate,
2548
2655
  guaranteedPeriodList,
2656
+ isFileActionsPanelOpen,
2549
2657
  isEnpfSum,
2550
2658
  transferContracts,
2551
2659
  contractsValue,
@@ -2556,6 +2664,7 @@ export default defineComponent({
2556
2664
  // Computed
2557
2665
  isTask,
2558
2666
  isDisabled,
2667
+ enpfNoteFile,
2559
2668
  disabilityGroup,
2560
2669
  totalInsPremium,
2561
2670
  isTermsDisabled,
@@ -2628,7 +2737,10 @@ export default defineComponent({
2628
2737
  coverPeriodRule,
2629
2738
 
2630
2739
  // Functions
2740
+ getDoc,
2631
2741
  submitForm,
2742
+ deleteFile,
2743
+ onFileChange,
2632
2744
  pickPanelValue,
2633
2745
  pickTermValue,
2634
2746
  openPanel,
@@ -2658,6 +2770,7 @@ export default defineComponent({
2658
2770
  copyRedirect,
2659
2771
  getContragent,
2660
2772
  addTransferContract,
2773
+ openFileActionsPanel,
2661
2774
  removeTransferContract,
2662
2775
  checkTransferContractDate,
2663
2776
  };
@@ -526,7 +526,8 @@ export default defineComponent({
526
526
  dataStore.isPrePension ||
527
527
  dataStore.isCritical ||
528
528
  dataStore.isUU ||
529
- dataStore.isReInsurance
529
+ dataStore.isReInsurance ||
530
+ dataStore.isReporting
530
531
  ) {
531
532
  emit('task', [dataStore.panelAction, route.params.taskId as string, actionCause.value]);
532
533
  } else {
@@ -629,7 +630,16 @@ export default defineComponent({
629
630
  const price = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.calculatorForm.price));
630
631
  const insuredAmount = computed(() => formStore.productConditionsForm.calculatorForm.amount!.nameRu! + dataStore.currency);
631
632
  const hasConditionsInfo = computed(() => {
632
- if (dataStore.isLifetrip || dataStore.isDas || dataStore.isUU || dataStore.isReInsurance || dataStore.isPrePension || dataStore.isCritical || dataStore.isPension) {
633
+ if (
634
+ dataStore.isLifetrip ||
635
+ dataStore.isDas ||
636
+ dataStore.isReporting ||
637
+ dataStore.isUU ||
638
+ dataStore.isReInsurance ||
639
+ dataStore.isPrePension ||
640
+ dataStore.isCritical ||
641
+ dataStore.isPension
642
+ ) {
633
643
  return false;
634
644
  }
635
645
  if (dataStore.isFinCenter()) {
@@ -32,7 +32,7 @@ export const constants = Object.freeze({
32
32
  checkcontragent: 1,
33
33
  checkcontract: 2,
34
34
  },
35
- extractedProducts: ['dso', 'uu', 'lka', 'reinsurance'],
35
+ extractedProducts: ['dso', 'uu', 'lka', 'reinsurance', 'reporting'],
36
36
  editableStatuses: [Statuses.StartForm, Statuses.EditBeneficiaryForm, Statuses.EditForm, Statuses.InputDataForm],
37
37
  documentsLinkVisibleStatuses: [
38
38
  Statuses.Completed,
@@ -837,6 +837,7 @@ export class RoleController {
837
837
  isAgentAuletti = () => this.isRole(constants.roles.AgentAuletti);
838
838
  isManagerAuletti = () => this.isRole(constants.roles.ManagerAuletti);
839
839
  isAnalyst = () => this.isRole(constants.roles.Analyst);
840
+ isAuditor = () => this.isRole(constants.roles.Auditor);
840
841
  isUpk = () => this.isRole(constants.roles.UPK);
841
842
  isUrp = () => this.isRole(constants.roles.URP);
842
843
  isUsns = () => this.isRole(constants.roles.USNS);
@@ -868,7 +869,7 @@ export class RoleController {
868
869
  isHR = () => this.isRole(constants.roles.HR);
869
870
  isReInsurer = () => this.isRole(constants.roles.ReInsurer);
870
871
  hasAccess = () => {
871
- const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn() || this.isDsuioOrv();
872
+ const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn() || this.isDsuioOrv() || this.isAuditor();
872
873
  return {
873
874
  invoiceInfo: this.isAdmin() || this.isSupport(),
874
875
  toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
@@ -888,6 +889,7 @@ export class RoleController {
888
889
  this.isSecurity() ||
889
890
  baseAccessRoles,
890
891
  toReinsurance: this.isReInsurer() || this.isAdjuster() || this.isHeadAdjuster() || baseAccessRoles,
892
+ toReporting: this.isServiceManager() || baseAccessRoles,
891
893
  toDSO:
892
894
  this.isUsns() ||
893
895
  this.isDsuio() ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.58",
3
+ "version": "0.0.10-beta.59",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -70,6 +70,7 @@ export const useDataStore = defineStore('data', {
70
70
  isDSO: state => state.product === 'dso',
71
71
  isUU: state => state.product === 'uu',
72
72
  isReInsurance: state => state.product === 'reinsurance',
73
+ isReporting: state => state.product === 'reporting',
73
74
  hasClientAnketa: state => Array.isArray(state.formStore.additionalInsuranceTerms) && state.formStore.additionalInsuranceTerms.find(i => i.coverTypeCode === 10),
74
75
  isClientAnketaCondition: state =>
75
76
  Array.isArray(state.formStore.additionalInsuranceTerms) &&
@@ -2124,6 +2125,21 @@ export const useDataStore = defineStore('data', {
2124
2125
  this.isLoading = false;
2125
2126
  }
2126
2127
  },
2128
+ async setOppvCount(data: any) {
2129
+ this.isLoading = true;
2130
+ try {
2131
+ const response = await this.api.pensionannuityNew.setOppvCount(this.formStore.applicationData.processInstanceId as string, data);
2132
+ if (response.oppvCount === 0 && response.errocCode !== 0) {
2133
+ return ErrorHandler(response.errorMsg);
2134
+ } else {
2135
+ return response.oppvCount;
2136
+ }
2137
+ } catch (err) {
2138
+ return ErrorHandler(err);
2139
+ } finally {
2140
+ this.isLoading = false;
2141
+ }
2142
+ },
2127
2143
  async calcParentContractSums(closeContractCompanyCode: string, closeContractCompanyName: string, isContractClosed: boolean) {
2128
2144
  this.isLoading = true;
2129
2145
  try {
package/store/rules.ts CHANGED
@@ -9,6 +9,7 @@ export const rules = {
9
9
  recalculationMultiplyBetween50And200: [(v: any) => (v !== null && v !== '' && v >= 50 && v <= 200) || t('toaster.recalculationMultiplyBetween', { floor: '50', ceil: '200' })],
10
10
  recalculationAdditive: [(v: any) => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween', { floor: '0', ceil: '100' })],
11
11
  required: [(v: any) => !!v || t('rules.required')],
12
+ notEmpty: [(v: any) => (v !== null && v !== undefined && v !== '') || t('rules.required')],
12
13
  notZero: [(v: any) => Number(v) !== 0 || 'Не может быть равно нулю'],
13
14
  iik: [(v: any) => v.length === 20 || t('rules.iik')],
14
15
  agentCommission: [(v: any) => v <= 50 || t('rules.agentCommission')],
package/types/enum.ts CHANGED
@@ -80,6 +80,7 @@ export enum PostActions {
80
80
  Error500 = 'Error500',
81
81
  iframeLoaded = 'iframeLoaded',
82
82
  goToProject = 'goToProject',
83
+ openLinkBlank = 'openLinkBlank',
83
84
  }
84
85
 
85
86
  export enum Roles {
@@ -92,6 +93,7 @@ export enum Roles {
92
93
  Compliance = 'Compliance',
93
94
  AgentMycar = 'AgentMycar',
94
95
  Analyst = 'Analyst',
96
+ Auditor = 'Auditor',
95
97
  UPK = 'UPK',
96
98
  URP = 'URP',
97
99
  FinCenter = 'FinCenter',
@@ -126,7 +128,7 @@ export enum Roles {
126
128
  TravelAgent = 'TravelAgent',
127
129
  HR = 'HR',
128
130
  NotAccumulativeSanctionerUSNS = 'NotAccumulativeSanctionerUSNS',
129
- ReInsurer = 'ReInsurer'
131
+ ReInsurer = 'ReInsurer',
130
132
  }
131
133
 
132
134
  export enum Statuses {
package/types/index.ts CHANGED
@@ -29,6 +29,7 @@ export type Projects =
29
29
  | 'dso'
30
30
  | 'uu'
31
31
  | 'reinsurance'
32
+ | 'reporting'
32
33
  | 'auletti'
33
34
  | 'lka-auletti'
34
35
  | 'prepensionannuity'