hl-core 0.0.8-beta.16 → 0.0.8-beta.17

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.
@@ -61,7 +61,7 @@
61
61
  <div
62
62
  v-if="isMultiple && more && !isShort"
63
63
  :class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
64
- class="rounded-b-lg h-[36px] flex items-center font-medium justify-center"
64
+ class="transition-all rounded-b-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90"
65
65
  @click="!disabled && memberStore.addMember(whichForm)"
66
66
  >
67
67
  {{ $t('buttons.add') }}
@@ -21,6 +21,7 @@
21
21
  :prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
22
22
  :append-inner-icon="appendInnerIcon ? appendInnerIcon : ''"
23
23
  :bg-color="bgColor ? bgColor : ''"
24
+ :suffix="suffix"
24
25
  @keyup.enter.prevent="submitted"
25
26
  @click:control="!props.readonly && $emit('append')"
26
27
  @click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', new Value())"
@@ -115,6 +116,10 @@ export default defineComponent({
115
116
  bgColor: {
116
117
  type: String,
117
118
  },
119
+ suffix: {
120
+ type: String,
121
+ default: '',
122
+ },
118
123
  },
119
124
  emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out', 'clear'],
120
125
 
@@ -1,8 +1,14 @@
1
1
  <template>
2
2
  <header class="relative w-full h-[70px] text-center font-medium align-middle flex items-center border-b-[1px]" :class="[$libStyles.blueBgLight, $libStyles.textSimple]">
3
- <i v-if="hasBack" @click="$emit('onBack')" class="absolute left-5 mdi text-xl cursor-pointer" :class="[backIcon]"></i>
3
+ <i v-if="hasBack" @click="$emit('onBack')" class="absolute left-5 mdi text-xl cursor-pointer transition-all" :class="[backIcon, backIconAnim]"></i>
4
4
  <span class="mx-10">{{ title }}</span>
5
- <i v-if="hasMore" @click="$emit('onMore')" class="mdi absolute right-5 text-xl cursor-pointer" :class="[moreIcon, hideMoreOnLg ? 'lg:!hidden' : '']"> </i>
5
+ <i
6
+ v-if="hasMore"
7
+ @click="$emit('onMore')"
8
+ class="mdi absolute right-5 text-xl cursor-pointer transition-all"
9
+ :class="[moreIcon, hideMoreOnLg ? 'lg:!hidden' : '', moreIconAnim]"
10
+ >
11
+ </i>
6
12
  </header>
7
13
  </template>
8
14
 
@@ -35,14 +41,44 @@ export default defineComponent({
35
41
  },
36
42
  },
37
43
  emits: ['onBack', 'onMore'],
38
- setup() {
44
+ setup(props) {
39
45
  const dataStore = useDataStore();
40
46
 
41
47
  const onClickOutside = () => {
42
48
  dataStore.settings.open = false;
43
49
  };
44
50
 
45
- return { onClickOutside };
51
+ const backIconAnim = computed(() => {
52
+ const icon = props.backIcon;
53
+ switch (icon) {
54
+ case 'mdi-arrow-left':
55
+ case 'mdi-account-arrow-left':
56
+ return 'hover:-translate-x-[2px]';
57
+ case 'mdi-close':
58
+ return 'hover:scale-110';
59
+ default:
60
+ return '';
61
+ }
62
+ });
63
+
64
+ const moreIconAnim = computed(() => {
65
+ const icon = props.moreIcon;
66
+ switch (icon) {
67
+ case 'mdi-cog-outline':
68
+ return 'hover:rotate-[30deg]';
69
+ default:
70
+ return '';
71
+ }
72
+ });
73
+
74
+ return {
75
+ // Computed
76
+ backIconAnim,
77
+ moreIconAnim,
78
+
79
+ // Functions
80
+ onClickOutside,
81
+ };
46
82
  },
47
83
  });
48
84
  </script>
@@ -45,7 +45,11 @@
45
45
  <span :class="[$libStyles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
46
46
  {{ question.first.name }}
47
47
  <base-fade-transition>
48
- <i v-if="question.first.answerName === 'Да' && secondQuestionList" class="mdi mdi-chevron-right text-2xl cursor-pointer" @click="openFirstPanel(question)"></i>
48
+ <i
49
+ v-if="question.first.answerName === 'Да' && secondQuestionList && secondQuestionList.length"
50
+ class="mdi mdi-chevron-right text-2xl cursor-pointer"
51
+ @click="openFirstPanel(question)"
52
+ ></i>
49
53
  </base-fade-transition>
50
54
  </span>
51
55
  <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$libStyles.textSimple]">
@@ -17,7 +17,7 @@
17
17
  </aside>
18
18
  <section v-if="isLogin" class="w-full lg:w-3/4 flex flex-col justify-center">
19
19
  <img :class="{ '!block': !$display().lgAndUp.value }" draggable="false" class="hidden w-2/4 sm:w-1/3 mb-10 self-center" src="~/assets/auth-logo.svg" />
20
- <div class="flex flex-col items-center mb-8">
20
+ <div class="flex flex-col items-center mb-8 text-center">
21
21
  <h1 class="text-[28px] font-medium mb-1">{{ $t('labels.welcomeHL') }}</h1>
22
22
  <span :class="[$libStyles.greyTextDark]" class="text-[16px]">{{ $t('labels.needAuth') }}</span>
23
23
  </div>
@@ -53,8 +53,8 @@
53
53
  <h1 class="text-[28px] font-medium mb-1">{{ $t('labels.resetPassword') }}</h1>
54
54
  <span :class="[$libStyles.greyTextDark]" class="text-[16px]">{{ $t('labels.resetType') }}</span>
55
55
  </div>
56
- <div class="p-[2px] mb-8 rounded-[12px] border-[1px]" :class="[$libStyles.whiteBg]">
57
- <v-tabs v-model="resetPasswordType" density="compact" slider-color="#009c73" class="base-reset-password rounded-[12px] w-2/3 lg:w-[25vw]" :class="[$libStyles.whiteBg]">
56
+ <div class="p-[2px] mb-8 rounded-[12px] border-[1px] w-2/3 lg:w-[25vw]" :class="[$libStyles.whiteBg]">
57
+ <v-tabs v-model="resetPasswordType" density="compact" slider-color="#009c73" class="w-full base-reset-password rounded-[12px]" :class="[$libStyles.whiteBg]">
58
58
  <v-tab :ripple="false" value="phone"> {{ $t('form.phoneNumber') }} </v-tab>
59
59
  <v-tab :ripple="false" value="email"> {{ $t('form.email') }} </v-tab>
60
60
  </v-tabs>
@@ -968,6 +968,9 @@ export default {
968
968
  }
969
969
  }
970
970
  const memberFromApplicaiton = memberStore.getMemberFromApplication(whichForm.value as MemberKeys, whichIndex.value ? Number(whichIndex.value) : undefined);
971
+ if (typeof member.value.id !== 'number' || (typeof member.value.id === 'number' && member.value.id > 0 === false)) {
972
+ return false;
973
+ }
971
974
  const isSaved = await dataStore.saveMember(member.value, memberStore.getMemberCode(whichForm.value as MemberKeys), memberFromApplicaiton);
972
975
  if (!isSaved) return false;
973
976
  if (whichForm.value === formStore.policyholderFormKey) {
@@ -1086,6 +1089,21 @@ export default {
1086
1089
  }
1087
1090
  };
1088
1091
 
1092
+ const setDefaultValues = async () => {
1093
+ const setDefaults = dataStore.controls.setDefaults;
1094
+ if (setDefaults.sectorCode) {
1095
+ await setSectorCode();
1096
+ }
1097
+ };
1098
+
1099
+ const setSectorCode = async () => {
1100
+ if (member.value.id === 0 && route.query.id === '0') {
1101
+ const sectorList = await dataStore.getSectorCodeList();
1102
+ const defaultValue = sectorList.find(item => item.ids === '500003.9') as Value;
1103
+ member.value.economySectorCode = defaultValue ? defaultValue : new Value();
1104
+ }
1105
+ };
1106
+
1089
1107
  const onInit = async () => {
1090
1108
  if (route.params.taskId === '0' || (route.params.taskId !== '0' && dataStore.isProcessEditable(formStore.applicationData.statusCode))) {
1091
1109
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
@@ -1108,6 +1126,7 @@ export default {
1108
1126
  const filteredDocuments: DocumentItem[] = dataStore.getFilesByIIN(member.value.iin!.replace(/-/g, '')) as DocumentItem[];
1109
1127
  if (filteredDocuments && filteredDocuments.length) memberDocument.value = filteredDocuments[0];
1110
1128
  }
1129
+ await setDefaultValues();
1111
1130
  };
1112
1131
 
1113
1132
  onMounted(async () => {
@@ -198,6 +198,7 @@
198
198
  :clearable="!isDisabled"
199
199
  :label="term.coverTypeName"
200
200
  append-inner-icon="mdi mdi-chevron-right"
201
+ :suffix="!!term.amount ? `${$dataStore.getNumberWithSpaces(term.amount)} ${$constants.currencySymbols.kzt}` : ''"
201
202
  @append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
202
203
  ></base-panel-input>
203
204
  </div>
@@ -780,10 +780,16 @@ export class ProductConditions {
780
780
  export class MemberSettings {
781
781
  has?: boolean;
782
782
  isMultiple?: boolean;
783
- constructor(options?: { has?: boolean; isMultiple?: boolean }) {
783
+ required?: boolean;
784
+ constructor(options?: { has?: boolean; isMultiple?: boolean; required?: boolean }) {
784
785
  if (options) {
785
786
  this.has = options.has;
786
787
  this.isMultiple = options.isMultiple;
788
+ if (this.has === true) {
789
+ this.required = options.required;
790
+ } else {
791
+ this.required = false;
792
+ }
787
793
  }
788
794
  }
789
795
  }
@@ -791,6 +797,10 @@ export class MemberSettings {
791
797
  export class DataStoreClass {
792
798
  // IMP Контроллер фич
793
799
  controls: {
800
+ // Cтавит значения по дефолту полям
801
+ setDefaults: {
802
+ sectorCode: boolean;
803
+ };
794
804
  // Проверка на роль при авторизации
795
805
  onAuth: boolean;
796
806
  // Согласие на главной странице
@@ -926,6 +936,9 @@ export class DataStoreClass {
926
936
  spokesmanApp: new MemberSettings(),
927
937
  };
928
938
  this.controls = {
939
+ setDefaults: {
940
+ sectorCode: true,
941
+ },
929
942
  onAuth: false,
930
943
  hasAnketa: true,
931
944
  hasAgreement: true,
package/locales/en.json CHANGED
@@ -89,7 +89,13 @@
89
89
  "needToRecalculate": "You need to recalculate the product conditions",
90
90
  "noUrl": "No link available",
91
91
  "pickFamilyMember": "Pick a family member",
92
- "numberRegistered": "Регистрационный номер успешно записан в реестр"
92
+ "numberRegistered": "Регистрационный номер успешно записан в реестр",
93
+ "requiredMember": "В заявке должен присутствовать {text}",
94
+ "client": "страхователь",
95
+ "insured": "застрахованный",
96
+ "beneficiary": "выгодоприобретатель",
97
+ "beneficialOwner": "бенефициарный собственник",
98
+ "spokesman": "представитель страхователя"
93
99
  },
94
100
  "buttons": {
95
101
  "createStatement": "Create Statement",
package/locales/kz.json CHANGED
@@ -89,7 +89,13 @@
89
89
  "needToRecalculate": "Необходимо пересчитать условия продукта",
90
90
  "noUrl": "Отсутствует ссылка",
91
91
  "pickFamilyMember": "Выберите члена семьи",
92
- "numberRegistered": "Регистрационный номер успешно записан в реестр"
92
+ "numberRegistered": "Регистрационный номер успешно записан в реестр",
93
+ "requiredMember": "В заявке должен присутствовать {text}",
94
+ "client": "страхователь",
95
+ "insured": "застрахованный",
96
+ "beneficiary": "выгодоприобретатель",
97
+ "beneficialOwner": "бенефициарный собственник",
98
+ "spokesman": "представитель страхователя"
93
99
  },
94
100
  "buttons": {
95
101
  "createStatement": "Создать заявку",
package/locales/ru.json CHANGED
@@ -89,7 +89,13 @@
89
89
  "needToRecalculate": "Необходимо пересчитать условия продукта",
90
90
  "noUrl": "Отсутствует ссылка",
91
91
  "pickFamilyMember": "Выберите члена семьи",
92
- "numberRegistered": "Регистрационный номер успешно записан в реестр"
92
+ "numberRegistered": "Регистрационный номер успешно записан в реестр",
93
+ "requiredMember": "В заявке должен присутствовать {text}",
94
+ "client": "страхователь",
95
+ "insured": "застрахованный",
96
+ "beneficiary": "выгодоприобретатель",
97
+ "beneficialOwner": "бенефициарный собственник",
98
+ "spokesman": "представитель страхователя"
93
99
  },
94
100
  "buttons": {
95
101
  "createStatement": "Создать заявку",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.8-beta.16",
3
+ "version": "0.0.8-beta.17",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -712,8 +712,8 @@ export const useDataStore = defineStore('data', {
712
712
  addressData.push({
713
713
  id: 'response' in user && user.response && 'addresses' in user.response ? user.response.addresses[0].id : 0,
714
714
  contragentId: user.id,
715
- countryCode: user.birthPlace.ids,
716
- countryName: user.birthPlace.nameRu,
715
+ countryCode: user.registrationCountry.ids,
716
+ countryName: user.registrationCountry.nameRu,
717
717
  stateCode: user.registrationProvince.ids,
718
718
  stateName: user.registrationProvince.nameRu,
719
719
  cityCode: user.registrationCity.code,
@@ -727,7 +727,7 @@ export const useDataStore = defineStore('data', {
727
727
  cityTypeName: user.registrationRegionType.nameRu,
728
728
  blockNumber: user.registrationNumberHouse,
729
729
  apartmentNumber: user.registrationNumberApartment,
730
- address: `${checkForNull(user.birthPlace.nameRu)}, ${checkForNull(user.registrationRegionType.nameRu)} ${checkForNull(user.registrationCity.nameRu)}, ул. ${checkForNull(
730
+ address: `${checkForNull(user.registrationCountry.nameRu)}, ${checkForNull(user.registrationRegionType.nameRu)} ${checkForNull(user.registrationCity.nameRu)}, ул. ${checkForNull(
731
731
  user.registrationStreet,
732
732
  )}, д. ${checkForNull(user.registrationNumberHouse)} кв. ${checkForNull(user.registrationNumberApartment)}`,
733
733
  type: 'H',
@@ -742,9 +742,11 @@ export const useDataStore = defineStore('data', {
742
742
  };
743
743
 
744
744
  const personId = await this.api.saveContragent(data);
745
- if (personId) {
745
+ if (personId > 0) {
746
746
  await this.getContragentById(personId, whichForm, false, whichIndex);
747
747
  user.otpTokenId = null;
748
+ } else {
749
+ return false;
748
750
  }
749
751
  } catch (err) {
750
752
  this.isLoading = false;
@@ -1972,22 +1974,45 @@ export const useDataStore = defineStore('data', {
1972
1974
  this.showToaster('error', this.t('toaster.notSavedMember', { text: 'страхователя' }), 3000);
1973
1975
  return false;
1974
1976
  }
1975
- if (!this.isGons) {
1977
+ if (this.members.insuredApp.has) {
1976
1978
  if (this.validateMultipleMembers(this.formStore.insuredFormKey, 'insuredApp', 'застрахованных') === false) {
1977
1979
  return false;
1978
1980
  }
1981
+ if (this.members.insuredApp.required) {
1982
+ const inStatement = this.formStore.insuredForm.every(i => i.id > 0);
1983
+ if (inStatement === false) {
1984
+ this.showToaster('error', this.t('toaster.requiredMember', { text: this.t('toaster.insured') }));
1985
+ return false;
1986
+ }
1987
+ }
1979
1988
  }
1980
- if (this.validateMultipleMembers(this.formStore.beneficiaryFormKey, 'beneficiaryApp', 'выгодоприобретателей') === false) {
1981
- return false;
1989
+ if (this.members.beneficiaryApp.has) {
1990
+ if (this.validateMultipleMembers(this.formStore.beneficiaryFormKey, 'beneficiaryApp', 'выгодоприобретателей') === false) {
1991
+ return false;
1992
+ }
1993
+ if (this.members.beneficiaryApp.required) {
1994
+ const inStatement = this.formStore.beneficiaryForm.every(i => i.id > 0);
1995
+ if (inStatement === false) {
1996
+ this.showToaster('error', this.t('toaster.requiredMember', { text: this.t('toaster.beneficiary') }));
1997
+ return false;
1998
+ }
1999
+ }
1982
2000
  }
1983
- if (!this.isGons) {
2001
+ if (this.members.beneficialOwnerApp.has) {
1984
2002
  if (this.formStore.isActOwnBehalf === false) {
1985
2003
  if (this.validateMultipleMembers(this.formStore.beneficialOwnerFormKey, 'beneficialOwnerApp', 'бенефициарных собственников') === false) {
1986
2004
  return false;
1987
2005
  }
1988
2006
  }
2007
+ if (this.members.beneficialOwnerApp.required) {
2008
+ const inStatement = this.formStore.beneficialOwnerForm.every(i => i.id > 0);
2009
+ if (inStatement === false) {
2010
+ this.showToaster('error', this.t('toaster.requiredMember', { text: this.t('toaster.beneficialOwner') }));
2011
+ return false;
2012
+ }
2013
+ }
1989
2014
  }
1990
- if (!this.isGons) {
2015
+ if (this.members.spokesmanApp.has) {
1991
2016
  if (this.formStore.hasRepresentative) {
1992
2017
  if (this.formStore.applicationData.spokesmanApp && this.formStore.policyholdersRepresentativeForm.id !== this.formStore.applicationData.spokesmanApp.insisId) {
1993
2018
  this.showToaster(
@@ -2000,6 +2025,13 @@ export const useDataStore = defineStore('data', {
2000
2025
  return false;
2001
2026
  }
2002
2027
  }
2028
+ if (this.members.spokesmanApp.required) {
2029
+ const inStatement = this.formStore.policyholdersRepresentativeForm.id > 0;
2030
+ if (inStatement === false) {
2031
+ this.showToaster('error', this.t('toaster.requiredMember', { text: this.t('toaster.spokesman') }));
2032
+ return false;
2033
+ }
2034
+ }
2003
2035
  }
2004
2036
  if (this.controls.hasAttachment) {
2005
2037
  const areValid = this.formStore.SaleChanellPolicy.nameRu && this.formStore.RegionPolicy.nameRu && this.formStore.ManagerPolicy.nameRu && this.formStore.AgentData.fullName;
@@ -159,8 +159,9 @@ export const useMemberStore = defineStore('members', {
159
159
  } else {
160
160
  if (memberData) await this.dataStore.api.deleteMember(memberCode, memberData.id as number);
161
161
  }
162
+ const cleared = this.clearMember(whichForm, whichIndex);
162
163
  if (memberData && refetch) await this.dataStore.getApplicationData(taskId, true, true, true, false);
163
- return this.clearMember(whichForm, whichIndex);
164
+ return cleared;
164
165
  } catch (err) {
165
166
  console.log(err);
166
167
  return ErrorHandler(err);
@@ -202,6 +203,12 @@ export const useMemberStore = defineStore('members', {
202
203
 
203
204
  if (successTranser.value === true) {
204
205
  if (toIndex.value !== null && taskId !== '0' && this.formStore.applicationData.processInstanceId !== 0) {
206
+ if (
207
+ typeof this.formStore[to][toIndex.value].id !== 'number' ||
208
+ (typeof this.formStore[to][toIndex.value].id === 'number' && this.formStore[to][toIndex.value].id > 0 === false)
209
+ ) {
210
+ return false;
211
+ }
205
212
  const hasSaved = await this.dataStore.saveMember(this.formStore[to][toIndex.value], this.getMemberCode(to), this.getMemberFromApplication(to, toIndex.value));
206
213
  if (hasSaved) {
207
214
  await this.dataStore.getApplicationData(taskId, false, true, true, false);