hl-core 0.0.8-beta.9 → 0.0.9-beta.1

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.
Files changed (59) hide show
  1. package/api/index.ts +100 -34
  2. package/api/interceptors.ts +17 -13
  3. package/components/Button/Btn.vue +1 -1
  4. package/components/Button/ScrollButtons.vue +2 -2
  5. package/components/Complex/Page.vue +1 -1
  6. package/components/Dialog/Dialog.vue +9 -39
  7. package/components/Dialog/FamilyDialog.vue +7 -4
  8. package/components/Form/FormBlock.vue +51 -28
  9. package/components/Form/FormSection.vue +4 -1
  10. package/components/Form/FormToggle.vue +2 -3
  11. package/components/Form/ManagerAttachment.vue +21 -20
  12. package/components/Form/ProductConditionsBlock.vue +60 -10
  13. package/components/Input/Datepicker.vue +6 -2
  14. package/components/Input/FileInput.vue +2 -2
  15. package/components/Input/FormInput.vue +29 -7
  16. package/components/Input/PanelInput.vue +7 -2
  17. package/components/Input/RoundedInput.vue +2 -2
  18. package/components/Input/RoundedSelect.vue +137 -0
  19. package/components/Layout/Drawer.vue +3 -2
  20. package/components/Layout/Header.vue +40 -4
  21. package/components/Layout/Loader.vue +1 -1
  22. package/components/Layout/SettingsPanel.vue +51 -13
  23. package/components/Menu/MenuHover.vue +30 -0
  24. package/components/Menu/MenuNav.vue +29 -13
  25. package/components/Menu/MenuNavItem.vue +6 -3
  26. package/components/Pages/Anketa.vue +49 -31
  27. package/components/Pages/Auth.vue +139 -46
  28. package/components/Pages/Documents.vue +6 -6
  29. package/components/Pages/InvoiceInfo.vue +30 -0
  30. package/components/Pages/MemberForm.vue +503 -343
  31. package/components/Pages/ProductAgreement.vue +4 -2
  32. package/components/Pages/ProductConditions.vue +494 -95
  33. package/components/Panel/PanelHandler.vue +91 -20
  34. package/components/Panel/PanelSelectItem.vue +1 -1
  35. package/components/Utilities/Chip.vue +27 -0
  36. package/components/Utilities/JsonViewer.vue +27 -0
  37. package/composables/axios.ts +1 -1
  38. package/composables/classes.ts +165 -81
  39. package/composables/constants.ts +25 -52
  40. package/composables/index.ts +80 -2
  41. package/composables/styles.ts +8 -3
  42. package/configs/i18n.ts +2 -4
  43. package/layouts/default.vue +6 -6
  44. package/locales/kz.json +532 -346
  45. package/locales/ru.json +210 -22
  46. package/nuxt.config.ts +1 -1
  47. package/package.json +38 -12
  48. package/pages/500.vue +2 -2
  49. package/pages/Token.vue +51 -0
  50. package/plugins/helperFunctionsPlugins.ts +2 -1
  51. package/plugins/vuetifyPlugin.ts +3 -1
  52. package/store/{data.store.js → data.store.ts} +1116 -752
  53. package/store/form.store.ts +1 -1
  54. package/store/member.store.ts +94 -72
  55. package/store/{rules.js → rules.ts} +54 -26
  56. package/types/enum.ts +83 -0
  57. package/types/env.d.ts +10 -0
  58. package/types/index.ts +197 -7
  59. package/locales/en.json +0 -399
@@ -2,14 +2,14 @@
2
2
  <section v-if="sendingActions">
3
3
  <div :class="[$libStyles.flexColNav]">
4
4
  <v-form ref="vForm">
5
- <base-rounded-input v-model="actionCause" placeholder="Причина" :rules="$rules.required"></base-rounded-input>
5
+ <base-rounded-input v-model.trim="actionCause" placeholder="Причина" :rules="$rules.required" />
6
6
  </v-form>
7
- <base-btn :text="buttonText" :loading="loading" @click="submitForm"></base-btn>
7
+ <base-btn :text="buttonText" :loading="loading" @click="submitForm" />
8
8
  </div>
9
9
  </section>
10
10
  <section v-if="acceptAction">
11
11
  <div :class="[$libStyles.flexColNav]">
12
- <base-content-block class="flex flex-col gap-3">
12
+ <base-content-block v-if="hasConditionsInfo" class="flex flex-col gap-3">
13
13
  <span
14
14
  >{{ `Сумма страховой премии ${paymentPeriod}:` }} <b>{{ `${insurancePremiumPerMonth}₸` }}</b></span
15
15
  >
@@ -17,8 +17,8 @@
17
17
  >{{ `Запрашиваемая страховая сумма: ` }} <b>{{ `${requestedSumInsured}₸` }}</b>
18
18
  </span>
19
19
  </base-content-block>
20
- <base-btn :text="$t('confirm.yes')" @click="handleTask"></base-btn>
21
- <base-btn :btn="$libStyles.blueLightBtn" :text="$t('confirm.no')" @click="closePanel"></base-btn>
20
+ <base-btn :text="$dataStore.t('confirm.yes')" @click="handleTask" />
21
+ <base-btn :btn="$libStyles.blueLightBtn" :text="$dataStore.t('confirm.no')" @click="closePanel" />
22
22
  </div>
23
23
  </section>
24
24
  <section v-if="signingActions" class="relative">
@@ -31,13 +31,13 @@
31
31
  <v-expansion-panel-title class="h-[80px]" :class="$libStyles.textTitle">{{ `${signUrl.longName} - ${signUrl.iin}` }}</v-expansion-panel-title>
32
32
  <v-expansion-panel-text class="border-t-[1px]">
33
33
  <section class="flex flex-col gap-4 py-3" :class="$libStyles.textSimple">
34
- <base-btn :loading="loading" :text="$t('sign.copyCloud')" @click="$dataStore.copyToClipboard(signUrl.uri)"></base-btn>
35
- <base-btn :loading="loading" :btn="$libStyles.blueLightBtn" :text="$t('sign.recipientNumber')" @click="openSmsPanel(signUrl)"></base-btn>
34
+ <base-btn :loading="loading" :text="$dataStore.t('sign.copyCloud')" @click="$dataStore.copyToClipboard(signUrl.uri)" />
35
+ <base-btn :loading="loading" :btn="$libStyles.blueLightBtn" :text="$dataStore.t('sign.recipientNumber')" @click="openSmsPanel(signUrl)" />
36
36
  </section>
37
37
  </v-expansion-panel-text>
38
38
  </v-expansion-panel>
39
39
  </v-expansion-panels>
40
- <base-list-empty v-else></base-list-empty>
40
+ <base-list-empty v-else />
41
41
  </div>
42
42
  </div>
43
43
  <div v-if="isSendNumberOpen" :class="[$libStyles.flexColNav]">
@@ -51,12 +51,12 @@
51
51
  v-model="phoneNumber"
52
52
  :maska="$maska.phone"
53
53
  :rules="$rules.required.concat($rules.phoneFormat)"
54
- :label="$t('form.phoneNumber')"
54
+ :label="$dataStore.t('form.phoneNumber')"
55
55
  placeholder="+7 7"
56
- ></base-rounded-input>
56
+ />
57
57
  </v-form>
58
- <base-btn :text="$t('buttons.sendSMS')" :loading="loading" @click="submitForm"></base-btn
59
- ></base-form-section>
58
+ <base-btn :text="$dataStore.t('buttons.sendSMS')" :loading="loading" @click="submitForm"
59
+ /></base-form-section>
60
60
  </div>
61
61
  </base-fade-transition>
62
62
  </div>
@@ -65,8 +65,8 @@
65
65
  <div>
66
66
  <base-fade-transition>
67
67
  <div v-if="!isSendNumberOpen" :class="[$libStyles.flexColNav]">
68
- <base-btn :loading="loading" :text="$t('payment.copyUrl')" @click="$dataStore.copyToClipboard(formStore.epayLink)"></base-btn>
69
- <base-btn :loading="loading" :btn="$libStyles.blueLightBtn" :text="$t('payment.recipientNumber')" @click="openEpayPanel"></base-btn>
68
+ <base-btn :loading="loading" :text="$dataStore.t('payment.copyUrl')" @click="$dataStore.copyToClipboard(formStore.epayLink)" />
69
+ <base-btn :loading="loading" :btn="$libStyles.blueLightBtn" :text="$dataStore.t('payment.recipientNumber')" @click="openEpayPanel" />
70
70
  </div>
71
71
  <div v-if="isSendNumberOpen" :class="[$libStyles.flexColNav]">
72
72
  <i
@@ -79,19 +79,40 @@
79
79
  v-model="phoneNumber"
80
80
  :maska="$maska.phone"
81
81
  :rules="$rules.required.concat($rules.phoneFormat)"
82
- :label="$t('form.phoneNumber')"
82
+ :label="$dataStore.t('form.phoneNumber')"
83
83
  placeholder="+7 7"
84
- ></base-rounded-input>
84
+ />
85
85
  </v-form>
86
- <base-btn :text="$t('buttons.sendSMS')" :loading="loading" @click="submitForm"></base-btn>
86
+ <base-btn :text="$dataStore.t('buttons.sendSMS')" :loading="loading" @click="submitForm" />
87
87
  </base-form-section>
88
88
  </div>
89
89
  </base-fade-transition>
90
90
  </div>
91
91
  </section>
92
+ <section v-if="affiliateActions">
93
+ <div :class="[$libStyles.flexColNav]">
94
+ <v-form ref="vForm">
95
+ <base-content-block class="flex flex-col gap-3">
96
+ <base-form-input v-model.trim="formStore.affilationResolution.number" :rules="$rules.required" :label="$dataStore.t('form.documentNumber')" />
97
+ <base-form-input
98
+ v-model="formStore.affilationResolution.date"
99
+ :maska="$maska.date"
100
+ :rules="$rules.required"
101
+ :label="$dataStore.t('form.date')"
102
+ append-inner-icon="mdi mdi-calendar-blank-outline" />
103
+ <base-file-input v-if="!affiliationDocument" @input.prevent="onFileChange($event)" />
104
+ <base-empty-form-field v-if="affiliationDocument" class="justify-between">
105
+ {{ `${affiliationDocument.fileTypeName} - ${affiliationDocument.fileName}` }}
106
+ <i class="cursor-pointer mdi mdi-file-document mr-6 text-[#a0b3d8] text-xl"></i></base-empty-form-field
107
+ ></base-content-block>
108
+ </v-form>
109
+ <base-btn :text="buttonText" :loading="loading" @click="submitForm" />
110
+ </div>
111
+ </section>
92
112
  </template>
93
113
 
94
114
  <script lang="ts">
115
+ import { DocumentItem } from '../../composables/classes';
95
116
  export default defineComponent({
96
117
  setup() {
97
118
  const route = useRoute();
@@ -103,6 +124,19 @@ export default defineComponent({
103
124
  const isSendNumberOpen = ref<boolean>(false);
104
125
  const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
105
126
  const selectedClient = ref<SignUrlType>();
127
+ const documentDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Решение АС'));
128
+ const affiliationDocument = computed(() => formStore.signedDocumentList.find((file: DocumentItem) => file.fileTypeName === 'Решение АС'));
129
+ const affiliationData = ref<{
130
+ processInstanceId: string | number;
131
+ fileTypeId: string | number | null;
132
+ fileTypeCode: string | number | null;
133
+ fileName?: string | number | null;
134
+ }>({
135
+ processInstanceId: formStore.applicationData.processInstanceId,
136
+ fileTypeId: documentDict.value ? documentDict.value.id : '',
137
+ fileTypeCode: documentDict.value ? documentDict.value.code : '',
138
+ });
139
+ const affiliationFormData = ref(new FormData());
106
140
 
107
141
  const openSmsPanel = (signInfo: SignUrlType) => {
108
142
  if (signInfo) {
@@ -121,16 +155,38 @@ export default defineComponent({
121
155
  dataStore.panelAction = null;
122
156
  };
123
157
 
158
+ const onFileChange = (event: InputEvent) => {
159
+ if (event.target) {
160
+ const files = (event.target as HTMLInputElement).files;
161
+ if (files && files.length && files[0].name !== affiliationData.value.fileName) {
162
+ affiliationData.value.fileName = files[0].name;
163
+ affiliationFormData.value.append('file', files[0]);
164
+ affiliationFormData.value.append('fileData', JSON.stringify([affiliationData.value]));
165
+ }
166
+ }
167
+ };
168
+
124
169
  const submitForm = async () => {
125
170
  await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
126
171
  if (v.valid) {
127
172
  loading.value = true;
128
173
  switch (dataStore.panelAction) {
129
174
  case constants.actions.pay:
130
- await dataStore.sendSMS('PayUrl', phoneNumber.value, formStore.epayLink);
175
+ await dataStore.sendSMS('PayUrl', phoneNumber.value!, formStore.epayLink!);
131
176
  break;
132
177
  case constants.actions.sign:
133
- await dataStore.sendSMS('SignUrl', phoneNumber.value, selectedClient.value?.uri);
178
+ await dataStore.sendSMS('SignUrl', phoneNumber.value!, selectedClient.value?.uri!);
179
+ break;
180
+ case constants.actions.affiliate:
181
+ formStore.affilationResolution.processInstanceId = formStore.applicationData.processInstanceId;
182
+ let uploaded, confirmed;
183
+ confirmed = await dataStore.setConfirmation();
184
+ if (affiliationData.value.fileName) {
185
+ uploaded = await dataStore.uploadFiles(affiliationFormData.value);
186
+ }
187
+ if ((affiliationData.value.fileName && confirmed && uploaded) || (!affiliationData.value.fileName && confirmed)) {
188
+ await handleTask();
189
+ }
134
190
  break;
135
191
  default:
136
192
  await handleTask();
@@ -142,7 +198,7 @@ export default defineComponent({
142
198
 
143
199
  const handleTask = async () => {
144
200
  loading.value = true;
145
- await dataStore.handleTask(dataStore.panelAction, route.params.taskId, actionCause.value);
201
+ await dataStore.handleTask(dataStore.panelAction, route.params.taskId as string, actionCause.value);
146
202
  loading.value = false;
147
203
  };
148
204
 
@@ -159,6 +215,10 @@ export default defineComponent({
159
215
  return dataStore.t('buttons.sign');
160
216
  case constants.actions.pay:
161
217
  return dataStore.t('buttons.pay');
218
+ case constants.actions.register:
219
+ return dataStore.t('buttons.register');
220
+ case constants.actions.affiliate:
221
+ return dataStore.t('buttons.send');
162
222
  }
163
223
  });
164
224
 
@@ -178,9 +238,16 @@ export default defineComponent({
178
238
  const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
179
239
  const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
180
240
  const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
241
+ const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
181
242
  const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
182
243
  const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
183
244
  const requestedSumInsured = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.requestedSumInsured));
245
+ const hasConditionsInfo = computed(() => {
246
+ if (dataStore.isFinCenter()) {
247
+ return false;
248
+ }
249
+ return true;
250
+ });
184
251
 
185
252
  return {
186
253
  // State
@@ -198,6 +265,7 @@ export default defineComponent({
198
265
  handleTask,
199
266
  openSmsPanel,
200
267
  openEpayPanel,
268
+ onFileChange,
201
269
 
202
270
  // Computed
203
271
  buttonText,
@@ -205,9 +273,12 @@ export default defineComponent({
205
273
  signingActions,
206
274
  payingActions,
207
275
  acceptAction,
276
+ affiliateActions,
208
277
  paymentPeriod,
209
278
  insurancePremiumPerMonth,
210
279
  requestedSumInsured,
280
+ affiliationDocument,
281
+ hasConditionsInfo,
211
282
  };
212
283
  },
213
284
  });
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex justify-between px-4 items-center cursor-pointer h-[60px]" :class="[$libStyles.rounded, $libStyles.blueBgLight, $libStyles.blueBgLightHover]">
2
+ <div class="flex justify-between p-4 items-center cursor-pointer" :class="[$libStyles.rounded, $libStyles.blueBgLight, $libStyles.blueBgLightHover]">
3
3
  <span :class="[$libStyles.textSimple]">{{ text }}</span>
4
4
  <i class="mdi text-xl" :class="[selected ? `mdi-radiobox-marked ${$libStyles.greenText}` : 'mdi-radiobox-blank text-[#636363]']"></i>
5
5
  </div>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <label v-if="chip && chip.title" class="transition-all leading-6 px-3 py-1 rounded-pill border-[1px] border-white mr-4 whitespace-nowrap" :class="[textSize, color]"
3
+ >{{ chip.title }}<v-tooltip v-if="chip.description" activator="parent" location="bottom" :max-width="maxWidth">{{ chip.description }}</v-tooltip></label
4
+ >
5
+ </template>
6
+
7
+ <script lang="ts">
8
+ export default defineComponent({
9
+ props: {
10
+ chip: {
11
+ type: Object as PropType<ChipComponent>,
12
+ },
13
+ color: {
14
+ type: String,
15
+ default: 'bg-[#A0B3D8] text-white group-hover:bg-white group-hover:!text-black',
16
+ },
17
+ textSize: {
18
+ type: String,
19
+ default: '!text-[10px]',
20
+ },
21
+ maxWidth: {
22
+ type: [String, Number],
23
+ default: 230,
24
+ },
25
+ },
26
+ });
27
+ </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <vue-json-pretty
3
+ :data="(data as JSONDataType)"
4
+ :show-icon="true"
5
+ :show-line="true"
6
+ :show-line-number="true"
7
+ :show-double-quotes="true"
8
+ :show-key-value-space="true"
9
+ :collapsed-on-click-brackets="true"
10
+ :deep="4"
11
+ />
12
+ </template>
13
+
14
+ <script lang="ts">
15
+ import VueJsonPretty from 'vue-json-pretty';
16
+ import 'vue-json-pretty/lib/styles.css';
17
+ import { JSONDataType } from 'vue-json-pretty/types/utils';
18
+
19
+ export default defineComponent({
20
+ components: { VueJsonPretty },
21
+ props: {
22
+ data: {
23
+ required: false,
24
+ },
25
+ },
26
+ });
27
+ </script>
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import interceptors from '@/api/interceptors';
2
+ import interceptors from '../api/interceptors';
3
3
 
4
4
  export const useAxios = (baseURL: string) => {
5
5
  const axiosInstance = axios.create({