hl-core 0.0.10-beta.4 → 0.0.10-beta.41

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 (53) hide show
  1. package/README.md +0 -2
  2. package/api/base.api.ts +338 -191
  3. package/api/interceptors.ts +3 -5
  4. package/components/Complex/TextBlock.vue +2 -0
  5. package/components/Dialog/Dialog.vue +7 -1
  6. package/components/Dialog/FamilyDialog.vue +2 -0
  7. package/components/Form/DigitalDocument.vue +52 -0
  8. package/components/Form/DynamicForm.vue +1 -0
  9. package/components/Form/FormData.vue +1 -0
  10. package/components/Form/ManagerAttachment.vue +48 -10
  11. package/components/Form/ProductConditionsBlock.vue +12 -6
  12. package/components/Input/Datepicker.vue +5 -0
  13. package/components/Input/DynamicInput.vue +2 -0
  14. package/components/Input/FormInput.vue +7 -0
  15. package/components/Input/OtpInput.vue +25 -0
  16. package/components/Input/PanelInput.vue +1 -0
  17. package/components/Input/RoundedInput.vue +4 -0
  18. package/components/Input/RoundedSelect.vue +4 -0
  19. package/components/Input/SwitchInput.vue +2 -0
  20. package/components/Input/TextAreaField.vue +71 -0
  21. package/components/Input/TextInput.vue +2 -0
  22. package/components/Layout/Drawer.vue +2 -0
  23. package/components/Menu/MenuNav.vue +1 -1
  24. package/components/Pages/Anketa.vue +168 -169
  25. package/components/Pages/Auth.vue +2 -0
  26. package/components/Pages/ContragentForm.vue +2 -1
  27. package/components/Pages/Documents.vue +432 -59
  28. package/components/Pages/MemberForm.vue +334 -160
  29. package/components/Pages/ProductConditions.vue +838 -226
  30. package/components/Panel/PanelHandler.vue +280 -121
  31. package/components/Transitions/Animation.vue +2 -0
  32. package/components/Utilities/Chip.vue +3 -1
  33. package/components/Utilities/JsonViewer.vue +1 -2
  34. package/composables/classes.ts +143 -49
  35. package/composables/constants.ts +44 -0
  36. package/composables/fields.ts +6 -4
  37. package/composables/index.ts +298 -7
  38. package/composables/styles.ts +8 -24
  39. package/configs/pwa.ts +1 -7
  40. package/layouts/clear.vue +1 -1
  41. package/layouts/default.vue +1 -1
  42. package/layouts/full.vue +1 -1
  43. package/locales/ru.json +80 -19
  44. package/nuxt.config.ts +10 -13
  45. package/package.json +12 -12
  46. package/plugins/head.ts +2 -1
  47. package/store/data.store.ts +802 -531
  48. package/store/member.store.ts +18 -6
  49. package/store/rules.ts +22 -2
  50. package/types/enum.ts +33 -2
  51. package/types/env.d.ts +2 -2
  52. package/types/form.ts +71 -74
  53. package/types/index.ts +924 -873
@@ -65,14 +65,12 @@ export default function (axios: AxiosInstance) {
65
65
  dataStore.sendToParent(constants.postActions.Error401, 401);
66
66
  }
67
67
  }
68
- if (error.response.status >= 500) {
69
- if (router.currentRoute.value.name !== 'Auth') {
70
- dataStore.showToaster('error', error.stack ?? dataStore.t('toaster.error'), 5000);
71
- }
72
- }
73
68
  if (error.response.status === 403 && error.response.config.url) {
74
69
  dataStore.showToaster('error', `Нет доступа на запрос: ${error.response.config.url.substring(error.response.config.url.lastIndexOf('/') + 1)}`, 5000);
75
70
  }
71
+ if (error.response.status === 413) {
72
+ dataStore.showToaster('error', dataStore.t('error.exceedUploadLimitFile'), 5000);
73
+ }
76
74
  }
77
75
  }
78
76
  return Promise.reject(error);
@@ -6,6 +6,8 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
+ import type { Utils } from '../../types';
10
+
9
11
  defineProps({
10
12
  text: {
11
13
  type: String,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-dialog class="base-dialog" :model-value="Boolean(modelValue)" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
2
+ <v-dialog class="base-dialog" :model-value="Boolean(modelValue)" @update:modelValue="$emit('update:modelValue', $event)" :persistent="persistent">
3
3
  <v-card class="self-center w-full sm:w-4/4 md:w-2/3 lg:w-[35%] xl:w-[500px] rounded-lg !p-[36px]">
4
4
  <div class="flex sm:flex-row flex-col place-items-center sm:place-items-start">
5
5
  <div class="h-20 w-20 place-items-start pt-1">
@@ -35,6 +35,8 @@
35
35
  </v-dialog>
36
36
  </template>
37
37
  <script lang="ts">
38
+ import type { Utils } from '../../types';
39
+
38
40
  export default defineComponent({
39
41
  name: 'BaseDialog',
40
42
  props: {
@@ -42,6 +44,10 @@ export default defineComponent({
42
44
  type: Boolean as PropType<boolean | null>,
43
45
  default: false,
44
46
  },
47
+ persistent: {
48
+ type: Boolean as PropType<boolean>,
49
+ default: true,
50
+ },
45
51
  title: {
46
52
  type: String,
47
53
  default() {
@@ -25,6 +25,8 @@
25
25
  </template>
26
26
 
27
27
  <script lang="ts">
28
+ import type { Api } from '../../types';
29
+
28
30
  export default defineComponent({
29
31
  props: {
30
32
  selected: {
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <section v-if="member && member.iin" class="mb-2">
3
+ <base-form-section :title="`${title} ${number === 0 ? '' : number}`" class="mx-[10px] mt-[14px] d-flex">
4
+ <base-form-input v-model="member.iin" :label="$dataStore.t('form.iin')" :readonly="true" />
5
+ <base-form-input v-model.trim="member.longName" :label="$dataStore.t('labels.userFullName')" :readonly="true" />
6
+ <base-panel-input
7
+ v-if="!!member.digitalDocument"
8
+ v-model="member.digitalDocument.fileName"
9
+ label="Цифровой документ"
10
+ :readonly="disabled"
11
+ :clearable="!disabled"
12
+ append-inner-icon="mdi mdi-chevron-right"
13
+ @click="$emit('openPanel', member.digitalDocument)"
14
+ />
15
+ <base-content-block
16
+ v-if="!disabled && !member.digitalDocument"
17
+ class="d-flex align-center justify-between !py-3.5 !pr-5"
18
+ :class="[$styles.whiteBg]"
19
+ @click="$emit('openDigitalDocPanel', member.iin)"
20
+ >
21
+ <p :class="[$styles.greyText]">Получить цифровой документ</p>
22
+ <div class="cursor-pointer">
23
+ <i class="mdi mdi-file-document text-xl" :class="[$styles.blueText]"></i>
24
+ </div>
25
+ </base-content-block>
26
+ </base-form-section>
27
+ </section>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import type { Base } from '../../types';
32
+
33
+ defineEmits(['openDigitalDocPanel', 'openPanel']);
34
+ defineProps({
35
+ title: {
36
+ type: String,
37
+ default: '',
38
+ },
39
+ member: {
40
+ type: Object as PropType<Base.Document.Digital>,
41
+ default: null,
42
+ },
43
+ number: {
44
+ type: Number,
45
+ default: 0,
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
51
+ });
52
+ </script>
@@ -24,6 +24,7 @@
24
24
 
25
25
  <script lang="ts">
26
26
  import { Value } from '#imports';
27
+ import type { DynamicForm, FetchFunctions, InputType } from '../../types/form';
27
28
 
28
29
  export default defineComponent({
29
30
  props: {
@@ -61,6 +61,7 @@
61
61
  <script lang="ts">
62
62
  import { type ComputedRefWithControl } from '@vueuse/core';
63
63
  import { FormBlock } from '../../composables/fields';
64
+ import type { Utils } from '../../types';
64
65
 
65
66
  export default defineComponent({
66
67
  props: {
@@ -55,6 +55,18 @@
55
55
  append-inner-icon="mdi mdi-chevron-right"
56
56
  @append="openPanel('AgentData', $dataStore.t('form.agent'))"
57
57
  />
58
+ <base-panel-input
59
+ v-if="isExecutorShown"
60
+ class="pl-1 pt-1"
61
+ v-model="formStore.ExecutorGPH"
62
+ :value="formStore.ExecutorGPH?.nameRu"
63
+ :readonly="isExecutorReadonly"
64
+ :clearable="!isExecutorReadonly"
65
+ :label="$dataStore.t('form.executor')"
66
+ :rules="$rules.objectRequired"
67
+ append-inner-icon="mdi mdi-chevron-right"
68
+ @append="openPanel('ExecutorGPH', $dataStore.t('form.executor'))"
69
+ />
58
70
  </v-form>
59
71
  </v-expansion-panel-text>
60
72
  </v-expansion-panel>
@@ -90,7 +102,10 @@
90
102
  </div>
91
103
  </div>
92
104
  </div>
93
- <div v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy'" class="w-full flex flex-col gap-2 p-2">
105
+ <div
106
+ v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy' || currentDictName === 'ExecutorGPH'"
107
+ class="w-full flex flex-col gap-2 p-2"
108
+ >
94
109
  <div v-for="(item, index) in $dataStore[currentDictName].filter(i => (i.nameRu as string).toLowerCase().includes(searchQuery.toLowerCase()))" :key="index">
95
110
  <base-panel-select-item :key="index" :text="item.nameRu ?? ''" :selected="item.ids === (panelValue as Value).ids" @click="pickPanelValue(item)" />
96
111
  </div>
@@ -106,6 +121,7 @@
106
121
  <script lang="ts">
107
122
  import { Value } from '../../composables/classes';
108
123
  import { watchDebounced } from '@vueuse/core';
124
+ import type { AgentData } from '../../types';
109
125
 
110
126
  export default defineComponent({
111
127
  props: {
@@ -119,7 +135,7 @@ export default defineComponent({
119
135
  },
120
136
  },
121
137
  setup(props) {
122
- type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
138
+ type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData' | 'ExecutorGPH';
123
139
  type FieldTypes = Value | AgentData;
124
140
  const route = useRoute();
125
141
  const dataStore = useDataStore();
@@ -138,37 +154,52 @@ export default defineComponent({
138
154
  (route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
139
155
  );
140
156
  const isSaleChanellReadonly = computed(() => {
141
- if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
157
+ if (!isReadonly.value) {
158
+ if (dataStore.isGons) return !dataStore.isServiceManager();
159
+ }
142
160
  return isReadonly.value;
143
161
  });
144
162
  const isRegionReadonly = computed(() => {
145
- if (dataStore.isGons) return isReadonly.value && (dataStore.isServiceManager() || dataStore.isAgent());
163
+ if (!isReadonly.value) {
164
+ if (dataStore.isGons) return !dataStore.isServiceManager() && !dataStore.isAgent();
165
+ }
146
166
  return isReadonly.value;
147
167
  });
148
168
  const isManagerReadonly = computed(() => {
149
- if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
169
+ if (!isReadonly.value) {
170
+ if (dataStore.isGons) return !dataStore.isServiceManager();
171
+ }
150
172
  return isReadonly.value;
151
173
  });
152
174
  const isAgentReadonly = computed(() => {
153
- if (dataStore.isGons || dataStore.isPension) return isReadonly.value && dataStore.isServiceManager();
175
+ if (!isReadonly.value) {
176
+ if (dataStore.isGons) return !dataStore.isServiceManager();
177
+ if (dataStore.isPension) return true;
178
+ }
179
+ return isReadonly.value;
180
+ });
181
+ const isExecutorReadonly = computed(() => {
182
+ if (!isReadonly.value) {
183
+ if (dataStore.isPension) return dataStore.isExecutor() || !dataStore.isInitiator();
184
+ }
154
185
  return isReadonly.value;
155
186
  });
156
187
  const isSaleChanellShown = computed(() => {
157
- if (dataStore.isGons) return dataStore.isServiceManager();
188
+ if (dataStore.isGons) return !dataStore.isAgent();
158
189
  return true;
159
190
  });
160
191
  const isRegionShown = computed(() => {
161
- if (dataStore.isGons) return dataStore.isServiceManager() || dataStore.isAgent();
162
192
  return true;
163
193
  });
164
194
  const isManagerShown = computed(() => {
165
- if (dataStore.isGons) return dataStore.isServiceManager();
195
+ if (dataStore.isGons) return !dataStore.isAgent();
166
196
  return true;
167
197
  });
168
198
  const isAgentShown = computed(() => {
169
- if (dataStore.isGons || dataStore.isPension) return dataStore.isServiceManager();
199
+ if (dataStore.isGons) return !dataStore.isAgent();
170
200
  return true;
171
201
  });
202
+ const isExecutorShown = dataStore.isPension;
172
203
  const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
173
204
  searchQuery.value = '';
174
205
  if (dataStore.isTask() && !props.disabled) {
@@ -181,6 +212,10 @@ export default defineComponent({
181
212
  isPanelLoading.value = true;
182
213
  await dataStore.filterManagerByRegion(formStore.RegionPolicy.ids as string);
183
214
  }
215
+ if (currentDict === 'ExecutorGPH' && formStore.RegionPolicy.ids) {
216
+ isPanelLoading.value = true;
217
+ await dataStore.filterExecutorByRegion(formStore.RegionPolicy.ids as string);
218
+ }
184
219
 
185
220
  isPanelOpen.value = true;
186
221
  panelValue.value = formStore[currentDict];
@@ -265,10 +300,13 @@ export default defineComponent({
265
300
  isRegionReadonly,
266
301
  isManagerReadonly,
267
302
  isAgentReadonly,
303
+ isExecutorReadonly,
268
304
  isSaleChanellShown,
269
305
  isRegionShown,
270
306
  isManagerShown,
271
307
  isAgentShown,
308
+ isExecutorShown,
309
+
272
310
  // Functions
273
311
  openPanel,
274
312
  searchAgent,
@@ -75,12 +75,18 @@ export default defineComponent({
75
75
  const dataStore = useDataStore();
76
76
  const formStore = useFormStore();
77
77
 
78
- const amount = computed(() =>
79
- formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null,
80
- );
81
- const premium = computed(() =>
82
- formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null,
83
- );
78
+ const amount = computed(() => {
79
+ if (dataStore.isGons && formStore.productConditionsForm && formStore.productConditionsForm.currency.code === 'USD') {
80
+ return formStore.productConditionsForm.requestedSumInsuredInDollar;
81
+ }
82
+ return formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null;
83
+ });
84
+ const premium = computed(() => {
85
+ if (dataStore.isGons && formStore.productConditionsForm && formStore.productConditionsForm.currency.code === 'USD') {
86
+ return formStore.productConditionsForm.insurancePremiumPerMonthInDollar;
87
+ }
88
+ return formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null;
89
+ });
84
90
  const policyNumber = computed(() => (formStore.applicationData && formStore.applicationData.policyAppDto ? formStore.applicationData.policyAppDto.policyNumber : null));
85
91
  const contractDate = computed(() =>
86
92
  formStore.applicationData && formStore.applicationData.policyAppDto && formStore.applicationData.policyAppDto.contractDate
@@ -13,6 +13,7 @@
13
13
  :enable-time-picker="false"
14
14
  :six-weeks="true"
15
15
  :min-date="minDate"
16
+ :max-date="maxDate"
16
17
  cancel-text="Отменить"
17
18
  select-text="Выбрать"
18
19
  >
@@ -43,6 +44,10 @@ export default defineComponent({
43
44
  type: Date,
44
45
  required: false,
45
46
  },
47
+ maxDate: {
48
+ type: Date,
49
+ required: false,
50
+ },
46
51
  },
47
52
  });
48
53
  </script>
@@ -12,6 +12,8 @@
12
12
  </template>
13
13
 
14
14
  <script lang="ts">
15
+ import type { InputType } from '../../types/form';
16
+
15
17
  export default defineComponent({
16
18
  props: {
17
19
  fields: {
@@ -39,6 +39,7 @@
39
39
  v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') && !props.readonly"
40
40
  :model-value="modelValue"
41
41
  :min-date="minDate"
42
+ :max-date="maxDate"
42
43
  @update:modelValue="$emit('update:modelValue', $event)"
43
44
  />
44
45
  </template>
@@ -49,6 +50,8 @@
49
50
  </template>
50
51
 
51
52
  <script lang="ts">
53
+ import type { InputTypes, InputVariants } from '../../types';
54
+
52
55
  export default defineComponent({
53
56
  name: 'BaseFormInput',
54
57
  props: {
@@ -118,6 +121,10 @@ export default defineComponent({
118
121
  type: Date,
119
122
  default: undefined,
120
123
  },
124
+ maxDate: {
125
+ type: Date,
126
+ default: undefined,
127
+ },
121
128
  prependIcon: {
122
129
  type: String,
123
130
  },
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <v-otp-input v-model="modelValue" class="base-otp-input" base-color="#A0B3D8" color="#FFF" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ const modelValue = defineModel<string>();
7
+ </script>
8
+
9
+ <style>
10
+ .base-otp-input .v-otp-input__field {
11
+ font-size: 16px;
12
+ }
13
+ .base-otp-input .v-field {
14
+ width: 50px;
15
+ height: 60px;
16
+ border-radius: 8px;
17
+ }
18
+ .base-otp-input .v-otp-input__content {
19
+ gap: 24px;
20
+ }
21
+ .base-otp-input .v-otp-input__divider {
22
+ margin: 0 4px;
23
+ color: #b8b8b8;
24
+ }
25
+ </style>
@@ -39,6 +39,7 @@
39
39
 
40
40
  <script lang="ts">
41
41
  import { Value } from '../../composables/classes';
42
+ import type { InputTypes, InputVariants } from '../../types';
42
43
 
43
44
  export default defineComponent({
44
45
  name: 'BasePanelInput',
@@ -34,6 +34,8 @@
34
34
  </template>
35
35
 
36
36
  <script lang="ts">
37
+ import type { InputTypes, InputVariants } from '../../types';
38
+
37
39
  export default defineComponent({
38
40
  name: 'BaseRoundedInput',
39
41
  props: {
@@ -136,6 +138,8 @@ export default defineComponent({
136
138
  border: 1px solid #dadada;
137
139
  box-shadow: none;
138
140
  font-size: 14px;
141
+ padding-top: 6px;
142
+ padding-bottom: 4px;
139
143
  }
140
144
  .rounded-input .v-field--error {
141
145
  border-color: #ff5449;
@@ -35,6 +35,8 @@
35
35
  </template>
36
36
 
37
37
  <script lang="ts">
38
+ import type { InputVariants } from '../../types';
39
+
38
40
  export default defineComponent({
39
41
  name: 'BaseRoundedSelect',
40
42
  props: {
@@ -148,6 +150,8 @@ export default defineComponent({
148
150
  border: 1px solid #dadada;
149
151
  box-shadow: none;
150
152
  font-size: 14px;
153
+ padding-top: 6px;
154
+ padding-bottom: 4px;
151
155
  }
152
156
  .rounded-select .v-field--error {
153
157
  border-color: #ff5449;
@@ -5,6 +5,8 @@
5
5
  </template>
6
6
 
7
7
  <script lang="ts">
8
+ import type { SwitchInput } from '../../types/form';
9
+
8
10
  export default defineComponent({
9
11
  name: 'asSwitchInput',
10
12
  props: {
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <v-textarea
3
+ class="form-input"
4
+ :label="label"
5
+ :model-value="modelValue"
6
+ :disabled="disabled"
7
+ :variant="variant"
8
+ :readonly="props.readonly"
9
+ :color="color"
10
+ :rows="rows"
11
+ @update:modelValue="$emit('update:modelValue', $event)"
12
+ auto-grow
13
+ ></v-textarea>
14
+ </template>
15
+
16
+ <script lang="ts">
17
+ import type { InputVariants } from '../../types';
18
+
19
+ export default defineComponent({
20
+ props: {
21
+ modelValue: {
22
+ required: false,
23
+ },
24
+ label: {
25
+ type: String,
26
+ default: '',
27
+ },
28
+ disabled: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ variant: {
33
+ type: String as PropType<InputVariants>,
34
+ default: 'solo',
35
+ },
36
+ readonly: {
37
+ type: Boolean,
38
+ default: false,
39
+ },
40
+ color: {
41
+ type: String,
42
+ default: '#009c73',
43
+ },
44
+ rows: {
45
+ type: Number,
46
+ default: 5,
47
+ },
48
+ },
49
+ emits: ['update:modelValue'],
50
+
51
+ setup(props, { emit }) {
52
+ return {
53
+ props,
54
+ };
55
+ },
56
+ });
57
+ </script>
58
+
59
+ <style>
60
+ .form-input input:focus {
61
+ border: none !important;
62
+ outline: none !important;
63
+ }
64
+ .form-input .v-field {
65
+ box-shadow: none;
66
+ font-size: 14px;
67
+ }
68
+ .form-input .v-label.v-field-label {
69
+ top: 20px;
70
+ }
71
+ </style>
@@ -16,6 +16,8 @@
16
16
  </template>
17
17
 
18
18
  <script lang="ts">
19
+ import type { InputType } from '../../types/form';
20
+
19
21
  const iconsList: { [key: string]: string } = {
20
22
  arrowRight: 'mdi-chevron-right',
21
23
  search: 'mdi-magnify',
@@ -26,6 +26,8 @@
26
26
  </template>
27
27
 
28
28
  <script lang="ts">
29
+ import type { PanelTypes } from '../../types';
30
+
29
31
  export default defineComponent({
30
32
  name: 'BasePanel',
31
33
  props: {
@@ -15,7 +15,7 @@
15
15
  @onMore="$emit('onMore')"
16
16
  />
17
17
  <slot key="slot-content" name="content"></slot>
18
- <section key="main" :class="[$styles.flexColNav]">
18
+ <section key="main" class="max-h-[90dvh] overflow-y-scroll" :class="[$styles.flexColNav]">
19
19
  <slot name="start"></slot>
20
20
  <base-fade-transition>
21
21
  <div v-if="$dataStore.menuItems && $dataStore.menuItems.length" class="flex flex-col gap-[10px]">