hl-core 0.0.8-beta.7 → 0.0.8-beta.8

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
@@ -13,7 +13,7 @@ export class ApiClass {
13
13
 
14
14
  private async axiosCall<T>(config: AxiosRequestConfig): Promise<T> {
15
15
  const dataStore = useDataStore();
16
- if ((dataStore.isEFO && !this.baseURL) || (!dataStore.isEFO && (!this.baseURL || !this.productUrl))) {
16
+ if (((dataStore.isEFO || dataStore.isAML) && !this.baseURL) || (!dataStore.isEFO && !dataStore.isAML && (!this.baseURL || !this.productUrl))) {
17
17
  console.error('No Axios baseURL or productURL');
18
18
  }
19
19
  const { data } = await useAxios(this.baseURL).request<T>(config);
@@ -21,7 +21,7 @@ export default function (axios: AxiosInstance) {
21
21
  if (error.response.status === 401) {
22
22
  dataStore.$reset();
23
23
  localStorage.clear();
24
- if (dataStore.isEFO) {
24
+ if (dataStore.isEFO || dataStore.isAML) {
25
25
  router.push({ name: 'Auth', query: { error: 401 } });
26
26
  } else {
27
27
  dataStore.sendToParent(constants.postActions.Error401, 401);
@@ -4,23 +4,32 @@
4
4
  <p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
5
5
  <p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
6
6
  </div>
7
- <div class="ml-5 mt-6 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center">
7
+ <div
8
+ class="ml-5 mt-6 grid auto-rows-fr items-center"
9
+ :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2 mb-6' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 ']"
10
+ >
8
11
  <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.fullName') }}</span>
9
12
  <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>
13
+ <span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
14
+ <span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium"> {{ $t('form.birthDate') }} </span>
15
+ <span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
16
+ <span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
14
17
  </div>
15
- <div v-if="isMultiple" class="ml-5 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">
18
+ <div v-if="isMultiple" class="ml-5 flex flex-col" :class="[isShort ? 'mb-6' : '']">
19
+ <div
20
+ v-for="(each, index) of member"
21
+ :key="index"
22
+ class="grid auto-rows-fr items-center relative"
23
+ :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
24
+ >
17
25
  <span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
18
26
  <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>
27
+ <span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
28
+ <span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
29
+ <span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
30
+ <span v-if="!isShort" :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
23
31
  <div
32
+ v-if="!isShort"
24
33
  class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
25
34
  :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
26
35
  @click="!disabled && $emit('onMore', { whichForm, index })"
@@ -29,14 +38,19 @@
29
38
  </div>
30
39
  </div>
31
40
  </div>
32
- <div v-else class="ml-5 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
41
+ <div
42
+ v-else
43
+ class="ml-5 grid auto-rows-fr items-center relative"
44
+ :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
45
+ >
33
46
  <span :class="[getMemberInfo(member).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).fullName }}</span>
34
47
  <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>
48
+ <span v-if="!isShort" :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
49
+ <span v-if="!isShort" :class="[getMemberInfo(member).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(member).birthDate }} </span>
50
+ <span v-if="!isShort" :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
51
+ <span v-if="!isShort" :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
39
52
  <div
53
+ v-if="!isShort"
40
54
  class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
41
55
  :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
42
56
  @click="!disabled && $emit('onMore', { whichForm })"
@@ -45,7 +59,7 @@
45
59
  </div>
46
60
  </div>
47
61
  <div
48
- v-if="isMultiple && more"
62
+ v-if="isMultiple && more && !isShort"
49
63
  :class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
50
64
  class="rounded-b-lg h-[36px] flex items-center font-medium justify-center"
51
65
  @click="!disabled && memberStore.addMember(whichForm)"
@@ -80,6 +94,10 @@ export default defineComponent({
80
94
  type: Boolean,
81
95
  default: false,
82
96
  },
97
+ type: {
98
+ type: String as PropType<'short' | 'default'>,
99
+ default: 'default',
100
+ },
83
101
  },
84
102
  emits: ['onMore', 'addMember'],
85
103
  setup(props) {
@@ -90,6 +108,8 @@ export default defineComponent({
90
108
  const isMultiple = ref(multipleMembers.includes(props.whichForm));
91
109
  const member: Member = formStore[props.whichForm as MemberKeys];
92
110
 
111
+ const isShort = computed(() => props.type === 'short');
112
+
93
113
  const getMemberInfo = (memberData: Member) => {
94
114
  return {
95
115
  fullName: computed(() => (memberData && memberData.getFullNameShorted() ? memberData.getFullNameShorted() : null)).value,
@@ -109,6 +129,7 @@ export default defineComponent({
109
129
  isMultiple,
110
130
 
111
131
  // Computed
132
+ isShort,
112
133
 
113
134
  // Functions
114
135
  getMemberInfo,
@@ -34,7 +34,7 @@ const dataStore = useDataStore();
34
34
  const handleFontSize = (action: 'increase' | 'decrease') => {
35
35
  if (action === 'increase' && dataStore.fontSize < 24) dataStore.fontSize += 2;
36
36
  if (action === 'decrease' && dataStore.fontSize > 14) dataStore.fontSize -= 2;
37
- if (dataStore.isEFO) {
37
+ if (dataStore.isEFO || dataStore.isAML) {
38
38
  dataStore.sendToChild(constants.postActions.font, dataStore.fontSize);
39
39
  } else {
40
40
  dataStore.sendToParent(constants.postActions.font, dataStore.fontSize);
@@ -221,6 +221,13 @@
221
221
  <base-form-input v-model="member.jobPlace" :label="$t('form.jobPlace')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required"></base-form-input>
222
222
  </base-form-section>
223
223
  <base-form-section :title="$t('form.placeRegistration')" v-if="$dataStore.hasPlaceSection(whichForm)">
224
+ <base-form-toggle
225
+ v-if="whichForm === formStore.beneficiaryFormKey"
226
+ v-model="sameAddress"
227
+ :disabled="isDisabled"
228
+ :has-border="false"
229
+ :title="$t('form.sameAddress')"
230
+ ></base-form-toggle>
224
231
  <base-panel-input
225
232
  v-model="member.registrationCountry"
226
233
  :value="member.registrationCountry.nameRu"
@@ -515,6 +522,7 @@ export default {
515
522
  const isDocumentOpen = ref<boolean>(false);
516
523
  const isPanelLoading = ref<boolean>(false);
517
524
  const familyDialog = ref<boolean>(false);
525
+ const sameAddress = ref<boolean>(false);
518
526
  const panelValue = ref<Value>(new Value());
519
527
  const panelList = ref<Value[]>([]);
520
528
  const currentPanel = ref<keyof typeof member.value>();
@@ -683,7 +691,7 @@ export default {
683
691
  isPanelLoading.value = true;
684
692
  newList = await asyncFunction(filterKey, member.value);
685
693
  }
686
- panelList.value = newList;
694
+ panelList.value = filterList(newList, key);
687
695
  panelValue.value = member.value[currentPanel.value];
688
696
  isPanelLoading.value = false;
689
697
  } else {
@@ -691,6 +699,22 @@ export default {
691
699
  }
692
700
  };
693
701
 
702
+ const filterList = (list: Value[], key: string) => {
703
+ if (dataStore.isBolashak) {
704
+ if (key === 'relationDegree') {
705
+ if (whichForm.value === formStore.beneficiaryFormKey) {
706
+ const beneficiaryRelations = [12, 13, 14, 15, 20, 21, 22, 23];
707
+ return list.filter(i => beneficiaryRelations.includes(Number(i.ids)));
708
+ }
709
+ if (whichForm.value === formStore.insuredFormKey) {
710
+ const insuredRelations = [6, 7, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23];
711
+ return list.filter(i => insuredRelations.includes(Number(i.ids)));
712
+ }
713
+ }
714
+ }
715
+ return list;
716
+ };
717
+
694
718
  const pickPanelValue = (item: Value) => {
695
719
  if (formStore.isDisabled[whichForm.value as keyof typeof formStore.isDisabled] === false) {
696
720
  dataStore.panel.open = false;
@@ -702,6 +726,55 @@ export default {
702
726
  }
703
727
  };
704
728
 
729
+ const setAddress = () => {
730
+ const beneficiary = formStore.beneficiaryForm[Number(whichIndex.value)];
731
+ const policyholder = formStore.policyholderForm;
732
+ if (sameAddress.value === true) {
733
+ beneficiary.registrationCity = policyholder.registrationCity;
734
+ beneficiary.registrationCountry = policyholder.registrationCountry;
735
+ beneficiary.birthPlace = policyholder.birthPlace;
736
+ beneficiary.registrationMicroDistrict = policyholder.registrationMicroDistrict;
737
+ beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
738
+ beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
739
+ beneficiary.registrationNumberHouse = policyholder.registrationNumberHouse;
740
+ beneficiary.registrationProvince = policyholder.registrationProvince;
741
+ beneficiary.registrationQuarter = policyholder.registrationQuarter;
742
+ beneficiary.registrationRegion = policyholder.registrationRegion;
743
+ beneficiary.registrationRegionType = policyholder.registrationRegionType;
744
+ beneficiary.registrationStreet = policyholder.registrationStreet;
745
+ } else {
746
+ if (beneficiary.id === 0) {
747
+ beneficiary.registrationCity = new Value();
748
+ beneficiary.registrationCountry = new Value();
749
+ beneficiary.registrationMicroDistrict = '';
750
+ beneficiary.registrationNumberApartment = '';
751
+ beneficiary.registrationNumberApartment = '';
752
+ beneficiary.registrationNumberHouse = '';
753
+ beneficiary.registrationProvince = new Value();
754
+ beneficiary.registrationQuarter = '';
755
+ beneficiary.registrationRegion = new Value();
756
+ beneficiary.registrationRegionType = new Value();
757
+ beneficiary.registrationStreet = '';
758
+ } else {
759
+ const country = dataStore.countries.find(i => (i.nameRu as string).match(new RegExp(beneficiary.response?.addresses[0].countryName, 'i')));
760
+ const city = dataStore.cities.find(i => i.nameRu === beneficiary.response?.addresses[0].cityName.replace('г.', ''));
761
+ const province = dataStore.states.find(i => i.ids === beneficiary.response?.addresses[0].stateCode);
762
+ const localityType = dataStore.localityTypes.find(i => i.nameRu === beneficiary.response?.addresses[0].cityTypeName);
763
+ const region = dataStore.regions.find(i => i.ids == beneficiary.response?.addresses[0].regionCode);
764
+ beneficiary.registrationCountry = country ?? new Value();
765
+ beneficiary.registrationCity = city ?? new Value();
766
+ beneficiary.registrationMicroDistrict = beneficiary.response?.addresses[0].microRaion ?? '';
767
+ beneficiary.registrationNumberApartment = beneficiary.response?.addresses[0].apartmentNumber ?? '';
768
+ beneficiary.registrationNumberHouse = beneficiary.response?.addresses[0].blockNumber ?? '';
769
+ beneficiary.registrationProvince = province ?? new Value();
770
+ beneficiary.registrationQuarter = beneficiary.response?.addresses[0].kvartal ?? '';
771
+ beneficiary.registrationRegion = region ?? new Value();
772
+ beneficiary.registrationRegionType = localityType ?? new Value();
773
+ beneficiary.registrationStreet = beneficiary.response?.addresses[0].streetName ?? '';
774
+ }
775
+ }
776
+ };
777
+
705
778
  const uploadFile = async (processInstanceId: string | number) => {
706
779
  const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.nameRu === member.value.documentType.nameRu);
707
780
  const formData = new FormData();
@@ -1032,6 +1105,13 @@ export default {
1032
1105
  }
1033
1106
  });
1034
1107
 
1108
+ watch(
1109
+ () => sameAddress.value,
1110
+ () => {
1111
+ if (whichForm.value === formStore.beneficiaryFormKey) setAddress();
1112
+ },
1113
+ );
1114
+
1035
1115
  watch(
1036
1116
  () => member.value.percentageOfPayoutAmount,
1037
1117
  val => {
@@ -1106,6 +1186,7 @@ export default {
1106
1186
  memberDocument,
1107
1187
  familyDialog,
1108
1188
  selectedFamilyMember,
1189
+ sameAddress,
1109
1190
 
1110
1191
  // Computed
1111
1192
  whichForm,
@@ -295,7 +295,7 @@ export default defineComponent({
295
295
  isPanelLoading.value = true;
296
296
  newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
297
297
  }
298
- panelList.value = newList;
298
+ panelList.value = filterList(newList, key);
299
299
  // @ts-ignore
300
300
  panelValue.value = productConditionsForm[currentPanel.value];
301
301
  isPanelLoading.value = false;
@@ -304,6 +304,15 @@ export default defineComponent({
304
304
  }
305
305
  };
306
306
 
307
+ const filterList = (list: Value[], key: string) => {
308
+ if (dataStore.isBaiterek) {
309
+ if (dataStore.isManagerHalykBank()) {
310
+ if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
311
+ }
312
+ }
313
+ return list;
314
+ };
315
+
307
316
  const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
308
317
  if (!isDisabled.value) {
309
318
  searchQuery.value = '';
@@ -128,8 +128,10 @@ export default defineComponent({
128
128
  switch (dataStore.panelAction) {
129
129
  case constants.actions.pay:
130
130
  await dataStore.sendSMS('PayUrl', phoneNumber.value, formStore.epayLink);
131
+ break;
131
132
  case constants.actions.sign:
132
133
  await dataStore.sendSMS('SignUrl', phoneNumber.value, selectedClient.value?.uri);
134
+ break;
133
135
  default:
134
136
  await handleTask();
135
137
  }
@@ -356,6 +356,13 @@ export class Contragent extends Person {
356
356
  }
357
357
 
358
358
  export class Member extends Person {
359
+ response?: {
360
+ contragent?: any;
361
+ questionnaires?: any;
362
+ contacts?: any;
363
+ documents?: any;
364
+ addresses?: any;
365
+ };
359
366
  verifyType: any;
360
367
  verifyDate: any;
361
368
  postIndex: string | null;
@@ -27,7 +27,7 @@ export const constants = Object.freeze({
27
27
  agentMycar: 'AgentMycar',
28
28
  analyst: 'Analyst',
29
29
  upk: 'UPK',
30
- financeCenter: 'FinanceCenter',
30
+ finCenter: 'FinCenter',
31
31
  supervisor: 'Supervisor',
32
32
  support: 'Support',
33
33
  managerHalykBank: 'ManagerHalykBank',
package/locales/en.json CHANGED
@@ -180,6 +180,7 @@
180
180
  "questionnaireHealth": "Health questionnaire for the Insured",
181
181
  "chooseAll": "Select all",
182
182
  "statement": "Statement",
183
+ "childInfo": "Child info",
183
184
  "policyholderForm": "Policyholder",
184
185
  "policyholderAndInsured": "Insured / Policyholder",
185
186
  "policyholderAndInsuredSame": "Insured / Policyholder are the same person",
package/locales/kz.json CHANGED
@@ -180,6 +180,7 @@
180
180
  "questionnaireHealth": "Анкета по здоровью Застрахованного",
181
181
  "chooseAll": "Выбрать все",
182
182
  "statement": "Заявление",
183
+ "childInfo": "Бала туралы ақпарат",
183
184
  "policyholderForm": "Страхователь",
184
185
  "policyholderAndInsured": "Застрахованный / Страхователь",
185
186
  "policyholderAndInsuredSame": "Застрахованный / Страхователь является одним лицом",
package/locales/ru.json CHANGED
@@ -180,6 +180,7 @@
180
180
  "questionnaireHealth": "Анкета по здоровью Застрахованного",
181
181
  "chooseAll": "Выбрать все",
182
182
  "statement": "Заявление",
183
+ "childInfo": "Данные о ребенке",
183
184
  "policyholderForm": "Страхователь",
184
185
  "policyholderAndInsured": "Застрахованный / Страхователь",
185
186
  "policyholderAndInsuredSame": "Застрахованный / Страхователь является одним лицом",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8-beta.7",
3
+ "version": "0.0.8-beta.8",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -49,6 +49,6 @@
49
49
  "vue-i18n": "^9.2.2",
50
50
  "vue-toastification": "^2.0.0-rc.5",
51
51
  "vue-uuid": "^3.0.0",
52
- "vuetify": "^3.2.2"
52
+ "vuetify": "^3.3.1"
53
53
  }
54
54
  }
package/pages/500.vue CHANGED
@@ -69,7 +69,7 @@ export default defineComponent({
69
69
  });
70
70
 
71
71
  const goBack = () => {
72
- if (dataStore.isEFO) {
72
+ if (dataStore.isEFO || dataStore.isAML) {
73
73
  router.push({ name: 'Auth' });
74
74
  } else {
75
75
  dataStore.sendToParent(constants.postActions.Error500, 500);
@@ -10,6 +10,11 @@ export default defineNuxtPlugin(nuxtApp => {
10
10
  ssr: false,
11
11
  components,
12
12
  directives,
13
+ defaults: {
14
+ VForm: {
15
+ validateOn: 'lazy',
16
+ },
17
+ },
13
18
  theme: {
14
19
  themes: {
15
20
  light: {
@@ -31,6 +31,7 @@ export const useDataStore = defineStore('data', {
31
31
  }),
32
32
  getters: {
33
33
  isEFO: state => state.product === 'efo',
34
+ isAML: state => state.product === 'aml',
34
35
  isBaiterek: state => state.product === 'baiterek',
35
36
  isBolashak: state => state.product === 'bolashak',
36
37
  isMycar: state => state.product === 'mycar',
@@ -39,6 +40,7 @@ export const useDataStore = defineStore('data', {
39
40
  isPension: state => state.product === 'pension',
40
41
  isGons: state => state.product === 'gons',
41
42
  isKazyna: state => state.product === 'halykkazyna',
43
+ isComplianceWindow: state => state.product === 'compliance',
42
44
  isEveryFormDisabled: state => Object.values(state.formStore.isDisabled).every(i => i === true),
43
45
  },
44
46
  actions: {
@@ -63,7 +65,7 @@ export const useDataStore = defineStore('data', {
63
65
  },
64
66
  copyToClipboard(text) {
65
67
  if (typeof text === 'string' || typeof text === 'number') {
66
- if (this.isEFO) {
68
+ if (this.isEFO || this.isAML) {
67
69
  navigator.clipboard.writeText(text);
68
70
  } else {
69
71
  this.sendToParent(constants.postActions.clipboard, text);
@@ -116,7 +118,7 @@ export const useDataStore = defineStore('data', {
116
118
  this.isCompliance() ||
117
119
  this.isAnalyst() ||
118
120
  this.isUpk() ||
119
- this.isFinanceCenter() ||
121
+ this.isFinCenter() ||
120
122
  this.isSupervisor() ||
121
123
  this.isSupport();
122
124
  if (hasPermission) {
@@ -197,8 +199,8 @@ export const useDataStore = defineStore('data', {
197
199
  isSupport() {
198
200
  return this.isRole(constants.roles.support);
199
201
  },
200
- isFinanceCenter() {
201
- return this.isRole(constants.roles.financeCenter);
202
+ isFinCenter() {
203
+ return this.isRole(constants.roles.finCenter);
202
204
  },
203
205
  isSupervisor() {
204
206
  return this.isRole(constants.roles.supervisor);
@@ -762,6 +764,8 @@ export const useDataStore = defineStore('data', {
762
764
  verifyDate: user.verifyDate,
763
765
  });
764
766
 
767
+ const checkForNull = value => (value ? value : '');
768
+
765
769
  // ! SaveContragent -> Addresses
766
770
  let addressData = [];
767
771
  addressData.push({
@@ -778,11 +782,14 @@ export const useDataStore = defineStore('data', {
778
782
  streetName: user.registrationStreet,
779
783
  kvartal: user.registrationQuarter,
780
784
  microRaion: user.registrationMicroDistrict,
781
- cityTypeId: Number(user.registrationRegionType.ids),
785
+ cityTypeId: Number(user.registrationRegionType.ids) > 0 ? Number(user.registrationRegionType.ids) : null,
782
786
  cityTypeName: user.registrationRegionType.nameRu,
783
787
  blockNumber: user.registrationNumberHouse,
784
788
  apartmentNumber: user.registrationNumberApartment,
785
- address: `${user.birthPlace.nameRu}, ${user.registrationRegionType.nameRu} ${user.registrationCity.nameRu}, ул. ${user.registrationStreet}, д. ${user.registrationNumberHouse} кв. ${user.registrationNumberApartment}`,
789
+ address: `${checkForNull(user.birthPlace.nameRu)}, ${checkForNull(user.registrationRegionType.nameRu)} ${checkForNull(user.registrationCity.nameRu)}, ул. ${checkForNull(
790
+ user.registrationStreet,
791
+ )}, д. ${checkForNull(user.registrationNumberHouse)} кв. ${checkForNull(user.registrationNumberApartment)}`,
792
+
786
793
  type: 'H',
787
794
  });
788
795
 
@@ -1726,6 +1733,7 @@ export const useDataStore = defineStore('data', {
1726
1733
  } catch (err) {
1727
1734
  ErrorHandler(err);
1728
1735
  }
1736
+ break;
1729
1737
  }
1730
1738
  case constants.actions.reject:
1731
1739
  case constants.actions.return:
@@ -1735,7 +1743,7 @@ export const useDataStore = defineStore('data', {
1735
1743
  const sended = await this.sendTask(taskId, action, comment);
1736
1744
  if (!sended) return;
1737
1745
  this.formStore.$reset();
1738
- if (this.isEFO) {
1746
+ if (this.isEFO || this.isAML) {
1739
1747
  await this.router.push({ name: 'Insurance-Product' });
1740
1748
  } else {
1741
1749
  this.sendToParent(constants.postActions.toHomePage, this.t('toaster.successOperation') + 'SUCCESS');
@@ -1743,6 +1751,7 @@ export const useDataStore = defineStore('data', {
1743
1751
  } catch (err) {
1744
1752
  ErrorHandler(err);
1745
1753
  }
1754
+ break;
1746
1755
  }
1747
1756
  }
1748
1757
  this.isButtonsLoading = false;