hl-core 0.0.10-beta.5 → 0.0.10-beta.51

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 (42) hide show
  1. package/README.md +0 -2
  2. package/api/base.api.ts +345 -137
  3. package/api/interceptors.ts +3 -5
  4. package/components/Dialog/Dialog.vue +5 -1
  5. package/components/Dialog/FamilyDialog.vue +15 -4
  6. package/components/Form/DigitalDocument.vue +52 -0
  7. package/components/Form/FormSource.vue +30 -0
  8. package/components/Form/ManagerAttachment.vue +60 -11
  9. package/components/Form/ProductConditionsBlock.vue +12 -6
  10. package/components/Input/Datepicker.vue +5 -0
  11. package/components/Input/FileInput.vue +1 -1
  12. package/components/Input/FormInput.vue +5 -0
  13. package/components/Input/OtpInput.vue +25 -0
  14. package/components/Input/RoundedInput.vue +2 -0
  15. package/components/Input/RoundedSelect.vue +2 -0
  16. package/components/Input/TextAreaField.vue +71 -0
  17. package/components/Menu/MenuNav.vue +1 -1
  18. package/components/Pages/Anketa.vue +207 -176
  19. package/components/Pages/ContragentForm.vue +1 -1
  20. package/components/Pages/Documents.vue +452 -64
  21. package/components/Pages/MemberForm.vue +416 -180
  22. package/components/Pages/ProductConditions.vue +1021 -243
  23. package/components/Panel/PanelHandler.vue +297 -124
  24. package/components/Utilities/Chip.vue +1 -1
  25. package/components/Utilities/JsonViewer.vue +1 -2
  26. package/composables/classes.ts +124 -20
  27. package/composables/constants.ts +46 -1
  28. package/composables/index.ts +336 -8
  29. package/composables/styles.ts +8 -24
  30. package/configs/pwa.ts +1 -7
  31. package/layouts/clear.vue +1 -1
  32. package/layouts/default.vue +1 -1
  33. package/layouts/full.vue +1 -1
  34. package/locales/ru.json +90 -19
  35. package/nuxt.config.ts +10 -12
  36. package/package.json +12 -12
  37. package/plugins/head.ts +7 -1
  38. package/store/data.store.ts +966 -575
  39. package/store/member.store.ts +17 -6
  40. package/store/rules.ts +23 -3
  41. package/types/enum.ts +42 -2
  42. package/types/index.ts +111 -56
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-list lines="two" v-if="formStore.birthInfos && formStore.birthInfos.length" class="w-full !py-0">
2
+ <v-list lines="two" v-if="(formStore.birthInfos && formStore.birthInfos.length) || $dataStore.isGons" class="w-full !py-0">
3
3
  <v-list-item
4
4
  @click="$emit('reset')"
5
5
  :append-icon="selected && Object.keys(selected).length === 0 ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
@@ -10,7 +10,11 @@
10
10
  v-for="familyMember of formStore.birthInfos"
11
11
  :key="familyMember.childIIN"
12
12
  @click="$emit('selectFamilyMember', familyMember)"
13
- :append-icon="familyMember && selected && selected.childIIN === familyMember.childIIN ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
13
+ :append-icon="
14
+ familyMember && selected && typeof selected === 'object' && selected.childIIN === familyMember.childIIN
15
+ ? `mdi-radiobox-marked ${$styles.greenText}`
16
+ : 'mdi-radiobox-blank text-[#636363]'
17
+ "
14
18
  >
15
19
  <v-list-item-title :class="[$styles.greenText, $styles.textTitle]">{{
16
20
  `${familyMember.childSurName} ${familyMember.childName} ${familyMember.childPatronymic ? familyMember.childPatronymic : ''}`
@@ -20,6 +24,13 @@
20
24
  >{{ ` ${$reformatIin(familyMember.childIIN!)}` }}</v-list-item-subtitle
21
25
  >
22
26
  </v-list-item>
27
+ <v-list-item
28
+ v-if="$dataStore.isGons"
29
+ @click="$emit('addChild')"
30
+ :append-icon="selected && selected === $dataStore.t('form.addBeneficiary') ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
31
+ >
32
+ <v-list-item-title :class="[$styles.greenText, $styles.textTitle]">{{ $dataStore.t('form.addBeneficiary') }}</v-list-item-title>
33
+ </v-list-item>
23
34
  </v-list>
24
35
  <base-list-empty class="w-full" v-else />
25
36
  </template>
@@ -30,10 +41,10 @@ import type { Api } from '../../types';
30
41
  export default defineComponent({
31
42
  props: {
32
43
  selected: {
33
- type: Object as PropType<Api.GKB.BirthInfo>,
44
+ type: [Object, String] as PropType<Api.GKB.BirthInfo | string>,
34
45
  },
35
46
  },
36
- emits: ['selectFamilyMember', 'reset'],
47
+ emits: ['selectFamilyMember', 'reset', 'addChild'],
37
48
  setup() {
38
49
  const formStore = useFormStore();
39
50
  return {
@@ -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>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <base-panel-input
3
+ class="source-form-input"
4
+ v-model="formStore.Source"
5
+ :value="formStore.Source?.nameRu"
6
+ :readonly="true"
7
+ :clearable="false"
8
+ :label="$dataStore.t('form.source')"
9
+ />
10
+ </template>
11
+
12
+ <script lang="ts">
13
+ export default defineComponent({
14
+ setup(props) {
15
+ const formStore = useFormStore();
16
+
17
+ return {
18
+ // State
19
+ formStore,
20
+ };
21
+ },
22
+ });
23
+ </script>
24
+
25
+ <style scoped>
26
+ .source-form-input {
27
+ border-radius: 4px;
28
+ border: 1px solid #e5e7eb;
29
+ }
30
+ </style>
@@ -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>
@@ -71,7 +83,7 @@
71
83
  />
72
84
  <div v-if="isPanelLoading === false" class="w-full">
73
85
  <div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
74
- <div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
86
+ <div v-for="(agent, index) of agentDataFiltered" :key="index">
75
87
  <div
76
88
  class="flex justify-between p-4 items-center cursor-pointer"
77
89
  :class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
@@ -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>
@@ -120,7 +135,7 @@ export default defineComponent({
120
135
  },
121
136
  },
122
137
  setup(props) {
123
- type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
138
+ type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData' | 'ExecutorGPH';
124
139
  type FieldTypes = Value | AgentData;
125
140
  const route = useRoute();
126
141
  const dataStore = useDataStore();
@@ -139,37 +154,63 @@ export default defineComponent({
139
154
  (route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
140
155
  );
141
156
  const isSaleChanellReadonly = computed(() => {
142
- if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
157
+ if (!isReadonly.value) {
158
+ if (dataStore.isTravelAgent()) return true;
159
+ if (dataStore.isGons) return !dataStore.isServiceManager();
160
+ }
143
161
  return isReadonly.value;
144
162
  });
145
163
  const isRegionReadonly = computed(() => {
146
- if (dataStore.isGons) return isReadonly.value && (dataStore.isServiceManager() || dataStore.isAgent());
164
+ if (!isReadonly.value) {
165
+ if (dataStore.isTravelAgent()) return true;
166
+ if (dataStore.isGons) return !dataStore.isServiceManager() && !dataStore.isAgent();
167
+ }
147
168
  return isReadonly.value;
148
169
  });
149
170
  const isManagerReadonly = computed(() => {
150
- if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
171
+ if (!isReadonly.value) {
172
+ if (dataStore.isTravelAgent()) return true;
173
+ if (dataStore.isGons) return !dataStore.isServiceManager();
174
+ }
151
175
  return isReadonly.value;
152
176
  });
153
177
  const isAgentReadonly = computed(() => {
154
- if (dataStore.isGons || dataStore.isPension) return isReadonly.value && dataStore.isServiceManager();
178
+ if (!isReadonly.value) {
179
+ if (dataStore.isTravelAgent()) return true;
180
+ if (dataStore.isGons) return !dataStore.isServiceManager();
181
+ if (dataStore.isPension) return true;
182
+ }
183
+ return isReadonly.value;
184
+ });
185
+ const isExecutorReadonly = computed(() => {
186
+ if (!isReadonly.value) {
187
+ if (dataStore.isPension) return dataStore.isExecutor() || !dataStore.isInitiator();
188
+ }
155
189
  return isReadonly.value;
156
190
  });
157
191
  const isSaleChanellShown = computed(() => {
158
- if (dataStore.isGons) return dataStore.isServiceManager();
192
+ if (dataStore.isGons) return !dataStore.isAgent();
159
193
  return true;
160
194
  });
161
195
  const isRegionShown = computed(() => {
162
- if (dataStore.isGons) return dataStore.isServiceManager() || dataStore.isAgent();
163
196
  return true;
164
197
  });
165
198
  const isManagerShown = computed(() => {
166
- if (dataStore.isGons) return dataStore.isServiceManager();
199
+ if (dataStore.isGons) return !dataStore.isAgent();
167
200
  return true;
168
201
  });
169
202
  const isAgentShown = computed(() => {
170
- if (dataStore.isGons || dataStore.isPension) return dataStore.isServiceManager();
203
+ if (dataStore.isGons) return !dataStore.isAgent();
171
204
  return true;
172
205
  });
206
+ const agentDataFiltered = computed(() => {
207
+ if (formStore.RegionPolicy?.nameRu && searchQuery.value === 'Без агента') {
208
+ return dataStore.AgentData.filter(i => String(i.officeId) === String(formStore.RegionPolicy.ids));
209
+ } else {
210
+ return dataStore.AgentData;
211
+ }
212
+ });
213
+ const isExecutorShown = dataStore.isPension;
173
214
  const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
174
215
  searchQuery.value = '';
175
216
  if (dataStore.isTask() && !props.disabled) {
@@ -182,6 +223,10 @@ export default defineComponent({
182
223
  isPanelLoading.value = true;
183
224
  await dataStore.filterManagerByRegion(formStore.RegionPolicy.ids as string);
184
225
  }
226
+ if (currentDict === 'ExecutorGPH' && formStore.RegionPolicy.ids) {
227
+ isPanelLoading.value = true;
228
+ await dataStore.filterExecutorByRegion(formStore.RegionPolicy.ids as string);
229
+ }
185
230
 
186
231
  isPanelOpen.value = true;
187
232
  panelValue.value = formStore[currentDict];
@@ -266,10 +311,14 @@ export default defineComponent({
266
311
  isRegionReadonly,
267
312
  isManagerReadonly,
268
313
  isAgentReadonly,
314
+ isExecutorReadonly,
269
315
  isSaleChanellShown,
270
316
  isRegionShown,
271
317
  isManagerShown,
272
318
  isAgentShown,
319
+ isExecutorShown,
320
+ agentDataFiltered,
321
+
273
322
  // Functions
274
323
  openPanel,
275
324
  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>
@@ -8,7 +8,7 @@
8
8
  variant="solo"
9
9
  show-size
10
10
  multiple
11
- accept=".pdf,.doc,.docx,.jpeg,.jpg,.jpg,.xlsx,.xls"
11
+ accept=".pdf,.doc,.docx,.jpeg,.jpg,.jpg,.xlsx,.xls,.xlsm"
12
12
  truncate-length="15"
13
13
  clear-icon="mdi mdi-close"
14
14
  :label="label"
@@ -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>
@@ -120,6 +121,10 @@ export default defineComponent({
120
121
  type: Date,
121
122
  default: undefined,
122
123
  },
124
+ maxDate: {
125
+ type: Date,
126
+ default: undefined,
127
+ },
123
128
  prependIcon: {
124
129
  type: String,
125
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>
@@ -138,6 +138,8 @@ export default defineComponent({
138
138
  border: 1px solid #dadada;
139
139
  box-shadow: none;
140
140
  font-size: 14px;
141
+ padding-top: 6px;
142
+ padding-bottom: 4px;
141
143
  }
142
144
  .rounded-input .v-field--error {
143
145
  border-color: #ff5449;
@@ -150,6 +150,8 @@ export default defineComponent({
150
150
  border: 1px solid #dadada;
151
151
  box-shadow: none;
152
152
  font-size: 14px;
153
+ padding-top: 6px;
154
+ padding-bottom: 4px;
153
155
  }
154
156
  .rounded-select .v-field--error {
155
157
  border-color: #ff5449;
@@ -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>
@@ -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]">