hl-core 0.0.8-beta.4 → 0.0.8-beta.40

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 (61) hide show
  1. package/api/index.ts +117 -44
  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 +77 -33
  9. package/components/Form/FormSection.vue +4 -1
  10. package/components/Form/FormToggle.vue +2 -3
  11. package/components/Form/ManagerAttachment.vue +197 -0
  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 +51 -33
  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 +533 -292
  31. package/components/Pages/ProductAgreement.vue +4 -2
  32. package/components/Pages/ProductConditions.vue +509 -99
  33. package/components/Panel/PanelHandler.vue +93 -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 +217 -97
  39. package/composables/constants.ts +26 -52
  40. package/composables/index.ts +80 -2
  41. package/composables/styles.ts +8 -3
  42. package/configs/i18n.ts +17 -0
  43. package/layouts/default.vue +6 -6
  44. package/locales/kz.json +585 -0
  45. package/locales/ru.json +587 -0
  46. package/nuxt.config.ts +9 -1
  47. package/package.json +41 -11
  48. package/pages/500.vue +2 -2
  49. package/pages/Token.vue +51 -0
  50. package/plugins/helperFunctionsPlugins.ts +3 -0
  51. package/plugins/storePlugin.ts +0 -1
  52. package/plugins/vuetifyPlugin.ts +8 -1
  53. package/store/data.store.ts +2649 -0
  54. package/store/form.store.ts +1 -1
  55. package/store/member.store.ts +164 -52
  56. package/store/{rules.js → rules.ts} +63 -25
  57. package/types/enum.ts +83 -0
  58. package/types/env.d.ts +10 -0
  59. package/types/index.ts +211 -7
  60. package/store/data.store.js +0 -2508
  61. package/store/messages.ts +0 -434
@@ -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,15 +155,39 @@ 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!);
176
+ break;
131
177
  case constants.actions.sign:
132
- 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
+ }
190
+ break;
133
191
  default:
134
192
  await handleTask();
135
193
  }
@@ -140,7 +198,7 @@ export default defineComponent({
140
198
 
141
199
  const handleTask = async () => {
142
200
  loading.value = true;
143
- await dataStore.handleTask(dataStore.panelAction, route.params.taskId, actionCause.value);
201
+ await dataStore.handleTask(dataStore.panelAction, route.params.taskId as string, actionCause.value);
144
202
  loading.value = false;
145
203
  };
146
204
 
@@ -157,6 +215,10 @@ export default defineComponent({
157
215
  return dataStore.t('buttons.sign');
158
216
  case constants.actions.pay:
159
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');
160
222
  }
161
223
  });
162
224
 
@@ -176,9 +238,16 @@ export default defineComponent({
176
238
  const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
177
239
  const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
178
240
  const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
241
+ const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
179
242
  const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
180
243
  const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
181
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
+ });
182
251
 
183
252
  return {
184
253
  // State
@@ -196,6 +265,7 @@ export default defineComponent({
196
265
  handleTask,
197
266
  openSmsPanel,
198
267
  openEpayPanel,
268
+ onFileChange,
199
269
 
200
270
  // Computed
201
271
  buttonText,
@@ -203,9 +273,12 @@ export default defineComponent({
203
273
  signingActions,
204
274
  payingActions,
205
275
  acceptAction,
276
+ affiliateActions,
206
277
  paymentPeriod,
207
278
  insurancePremiumPerMonth,
208
279
  requestedSumInsured,
280
+ affiliationDocument,
281
+ hasConditionsInfo,
209
282
  };
210
283
  },
211
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({