hl-core 0.0.9-beta.5 → 0.0.9-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 (63) hide show
  1. package/api/base.api.ts +1042 -0
  2. package/api/index.ts +2 -620
  3. package/api/interceptors.ts +53 -14
  4. package/components/Button/Btn.vue +2 -2
  5. package/components/Complex/MessageBlock.vue +2 -2
  6. package/components/Complex/Page.vue +1 -1
  7. package/components/Dialog/Dialog.vue +60 -15
  8. package/components/Form/DynamicForm.vue +100 -0
  9. package/components/Form/FormBlock.vue +12 -3
  10. package/components/Form/FormData.vue +110 -0
  11. package/components/Form/FormSection.vue +3 -3
  12. package/components/Form/FormToggle.vue +25 -5
  13. package/components/Form/ManagerAttachment.vue +150 -86
  14. package/components/Form/ProductConditionsBlock.vue +59 -6
  15. package/components/Input/Datepicker.vue +43 -7
  16. package/components/Input/DynamicInput.vue +23 -0
  17. package/components/Input/FileInput.vue +25 -5
  18. package/components/Input/FormInput.vue +7 -4
  19. package/components/Input/Monthpicker.vue +34 -0
  20. package/components/Input/PanelInput.vue +5 -1
  21. package/components/Input/RoundedEmptyField.vue +5 -0
  22. package/components/Input/RoundedSelect.vue +18 -0
  23. package/components/Input/SwitchInput.vue +64 -0
  24. package/components/Input/TextInput.vue +160 -0
  25. package/components/Layout/Drawer.vue +17 -4
  26. package/components/Layout/Header.vue +23 -2
  27. package/components/Layout/Loader.vue +1 -1
  28. package/components/Layout/SettingsPanel.vue +13 -7
  29. package/components/Menu/InfoMenu.vue +35 -0
  30. package/components/Menu/MenuNav.vue +17 -2
  31. package/components/Pages/Anketa.vue +140 -52
  32. package/components/Pages/Auth.vue +50 -9
  33. package/components/Pages/ContragentForm.vue +124 -50
  34. package/components/Pages/Documents.vue +179 -29
  35. package/components/Pages/InvoiceInfo.vue +1 -1
  36. package/components/Pages/MemberForm.vue +605 -116
  37. package/components/Pages/ProductAgreement.vue +1 -8
  38. package/components/Pages/ProductConditions.vue +1055 -183
  39. package/components/Panel/PanelHandler.vue +583 -46
  40. package/components/Panel/PanelSelectItem.vue +17 -2
  41. package/components/Panel/RightPanelCloser.vue +7 -0
  42. package/components/Transitions/Animation.vue +28 -0
  43. package/components/Utilities/Qr.vue +44 -0
  44. package/composables/axios.ts +1 -0
  45. package/composables/classes.ts +456 -8
  46. package/composables/constants.ts +114 -2
  47. package/composables/fields.ts +328 -0
  48. package/composables/index.ts +270 -19
  49. package/composables/styles.ts +29 -16
  50. package/layouts/default.vue +48 -3
  51. package/locales/ru.json +547 -14
  52. package/package.json +28 -24
  53. package/pages/Token.vue +1 -12
  54. package/plugins/vuetifyPlugin.ts +2 -0
  55. package/store/data.store.ts +1463 -275
  56. package/store/extractStore.ts +17 -0
  57. package/store/form.store.ts +13 -1
  58. package/store/member.store.ts +1 -1
  59. package/store/rules.ts +83 -5
  60. package/types/enum.ts +61 -0
  61. package/types/env.d.ts +1 -0
  62. package/types/form.ts +94 -0
  63. package/types/index.ts +259 -23
@@ -1,55 +1,61 @@
1
1
  <template>
2
2
  <div class="rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
3
- <div class="mt-3 ml-5">
4
- <p :class="[$styles.textTitle, $styles.greenText]">{{ $dataStore.t('form.attachManager') }}</p>
5
- </div>
6
- <v-form ref="vForm" class="flex flex-col mt-1">
7
- <base-panel-input
8
- class="pl-1"
9
- v-model="formStore.SaleChanellPolicy"
10
- :value="formStore.SaleChanellPolicy.nameRu"
11
- :readonly="isReadonly"
12
- :clearable="!isReadonly"
13
- :label="$dataStore.t('form.salesChanell')"
14
- :rules="$rules.objectRequired"
15
- append-inner-icon="mdi mdi-chevron-right"
16
- @append="openPanel('SaleChanellPolicy', $dataStore.t('form.salesChanell'))"
17
- />
18
- <base-panel-input
19
- class="pl-1"
20
- v-model="formStore.RegionPolicy"
21
- :value="formStore.RegionPolicy.nameRu"
22
- :readonly="isReadonly"
23
- :clearable="!isReadonly"
24
- :label="$dataStore.t('form.Region')"
25
- :rules="$rules.objectRequired"
26
- append-inner-icon="mdi mdi-chevron-right"
27
- @append="openPanel('RegionPolicy', $dataStore.t('form.Region'))"
28
- />
29
- <base-panel-input
30
- class="pl-1"
31
- v-model="formStore.ManagerPolicy"
32
- :value="formStore.ManagerPolicy.nameRu"
33
- :readonly="isReadonly"
34
- :clearable="!isReadonly"
35
- :label="$dataStore.t('form.manager')"
36
- :rules="$rules.objectRequired"
37
- append-inner-icon="mdi mdi-chevron-right"
38
- @append="openPanel('ManagerPolicy', $dataStore.t('form.manager'))"
39
- />
40
- <base-panel-input
41
- class="pl-1"
42
- v-model="formStore.AgentData"
43
- :value="formStore.AgentData.fullName"
44
- :readonly="isReadonly"
45
- :clearable="!isReadonly"
46
- :label="$dataStore.t('form.agent')"
47
- :rules="$rules.agentDataRequired"
48
- append-inner-icon="mdi mdi-chevron-right"
49
- @append="openPanel('AgentData', $dataStore.t('form.agent'))"
50
- />
51
- </v-form>
52
- <Teleport v-if="isPanelOpen" to="#panel-actions">
3
+ <v-expansion-panels>
4
+ <v-expansion-panel class="rounded-lg" elevation="0">
5
+ <v-expansion-panel-title :class="[$styles.textTitle, $styles.greenText]">
6
+ {{ $dataStore.t('form.attachManager') }}
7
+ </v-expansion-panel-title>
8
+ <v-expansion-panel-text class="border-t-[1px] no-padding">
9
+ <v-form ref="vForm" class="flex flex-col divide-y">
10
+ <base-panel-input
11
+ class="pl-1 pt-1"
12
+ v-model="formStore.SaleChanellPolicy"
13
+ :value="formStore.SaleChanellPolicy?.nameRu"
14
+ :readonly="isSaleChanellReadonly"
15
+ :clearable="!isSaleChanellReadonly"
16
+ :label="$dataStore.t('form.salesChanell')"
17
+ :rules="$rules.objectRequired"
18
+ append-inner-icon="mdi mdi-chevron-right"
19
+ @append="openPanel('SaleChanellPolicy', $dataStore.t('form.salesChanell'))"
20
+ />
21
+ <base-panel-input
22
+ class="pl-1 pt-1"
23
+ v-model="formStore.RegionPolicy"
24
+ :value="formStore.RegionPolicy?.nameRu"
25
+ :readonly="isRegionReadonly"
26
+ :clearable="!isRegionReadonly"
27
+ :label="$dataStore.t('form.Region')"
28
+ :rules="$rules.objectRequired"
29
+ append-inner-icon="mdi mdi-chevron-right"
30
+ @append="openPanel('RegionPolicy', $dataStore.t('form.Region'))"
31
+ />
32
+ <base-panel-input
33
+ class="pl-1 pt-1"
34
+ v-model="formStore.ManagerPolicy"
35
+ :value="formStore.ManagerPolicy?.nameRu"
36
+ :readonly="isManagerReadonly"
37
+ :clearable="!isManagerReadonly"
38
+ :label="$dataStore.t('form.manager')"
39
+ :rules="$rules.objectRequired"
40
+ append-inner-icon="mdi mdi-chevron-right"
41
+ @append="openPanel('ManagerPolicy', $dataStore.t('form.manager'))"
42
+ />
43
+ <base-panel-input
44
+ class="pl-1 pt-1"
45
+ v-model="formStore.AgentData"
46
+ :value="formStore.AgentData?.fullName"
47
+ :readonly="isAgentReadonly"
48
+ :clearable="!isAgentReadonly"
49
+ :label="$dataStore.t('form.agent')"
50
+ :rules="$rules.agentDataRequired"
51
+ append-inner-icon="mdi mdi-chevron-right"
52
+ @append="openPanel('AgentData', $dataStore.t('form.agent'))"
53
+ />
54
+ </v-form>
55
+ </v-expansion-panel-text>
56
+ </v-expansion-panel>
57
+ </v-expansion-panels>
58
+ <Teleport v-if="isPanelOpen" to="#right-panel-actions">
53
59
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
54
60
  <base-rounded-input
55
61
  v-model.trim="searchQuery"
@@ -59,16 +65,34 @@
59
65
  :append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
60
66
  @append="searchAgent"
61
67
  />
62
- <div v-if="dictList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
63
- <div v-for="(item, index) in dictList" :key="item.id">
64
- <base-panel-select-item
65
- :key="index"
66
- :text="currentDictName === 'AgentData' ? item.fullName : (item.nameRu as string)"
67
- :selected="currentDictName === 'AgentData' ? item.fullName === panelValue.fullName : item.nameRu === panelValue.nameRu"
68
- @click="pickPanelValue(item)"
69
- />
68
+ <div v-if="isPanelLoading === false" class="w-full">
69
+ <div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
70
+ <div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
71
+ <div
72
+ class="flex justify-between p-4 items-center cursor-pointer"
73
+ :class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
74
+ @click="pickPanelValue(agent)"
75
+ >
76
+ <div class="flex flex-col">
77
+ <span :class="[$styles.textSimple]">{{ $getFullNameShorted(agent.fullName ?? '', 2) }}</span>
78
+ <span :class="[$styles.mutedText]">
79
+ {{ agent.saleChannel ? `${agent.saleChannel} / ${$getFullNameShorted(agent.managerName ?? '', 2)}` : `${agent.managerName}` }}
80
+ </span>
81
+ </div>
82
+ <i
83
+ class="mdi text-xl"
84
+ :class="[agent.agentId === (panelValue as AgentData).agentId ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]']"
85
+ ></i>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ <div v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy'" class="w-full flex flex-col gap-2 p-2">
90
+ <div v-for="(item, index) in $dataStore[currentDictName].filter(i => (i.nameRu as string).toLowerCase().includes(searchQuery.toLowerCase()))" :key="index">
91
+ <base-panel-select-item :key="index" :text="item.nameRu ?? ''" :selected="item.ids === (panelValue as Value).ids" @click="pickPanelValue(item)" />
92
+ </div>
70
93
  </div>
71
94
  </div>
95
+
72
96
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
73
97
  </div>
74
98
  </Teleport>
@@ -77,6 +101,7 @@
77
101
 
78
102
  <script lang="ts">
79
103
  import { Value } from '../../composables/classes';
104
+ import { watchDebounced } from '@vueuse/core';
80
105
 
81
106
  export default defineComponent({
82
107
  props: {
@@ -90,29 +115,17 @@ export default defineComponent({
90
115
  },
91
116
  },
92
117
  setup(props) {
118
+ type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
119
+ type FieldTypes = Value | AgentData;
93
120
  const route = useRoute();
94
121
  const dataStore = useDataStore();
95
122
  const formStore = useFormStore();
96
123
  const isPanelOpen = ref<boolean>(false);
97
124
  const isPanelLoading = ref<boolean>(false);
98
- const panelValue = ref<Value & AgentData>(new Value());
125
+ const panelValue = ref<FieldTypes>(new Value());
99
126
  const searchQuery = ref<string>('');
100
- const currentDictName = ref<string>();
127
+ const currentDictName = ref<ManagerAttachmentFiels>();
101
128
 
102
- const dictList = computed(() => {
103
- if (!currentDictName.value) {
104
- return [];
105
- }
106
- if (currentDictName.value === 'AgentData') {
107
- return dataStore[currentDictName.value];
108
- } else {
109
- // @ts-ignore
110
- return dataStore[currentDictName.value].filter((item: Value) => {
111
- // @ts-ignore
112
- return item.nameRu ? item.nameRu.toLowerCase().includes(searchQuery.value.toLowerCase()) : item.fullName.toLowerCase().includes(searchQuery.value.toLowerCase());
113
- });
114
- }
115
- });
116
129
  const isReadonly = computed(
117
130
  () =>
118
131
  props.disabled ||
@@ -120,13 +133,29 @@ export default defineComponent({
120
133
  !dataStore.isInitiator() ||
121
134
  (route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
122
135
  );
136
+ const isSaleChanellReadonly = computed(() => {
137
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
138
+ return isReadonly.value;
139
+ });
140
+ const isRegionReadonly = computed(() => {
141
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
142
+ return isReadonly.value;
143
+ });
144
+ const isManagerReadonly = computed(() => {
145
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
146
+ return isReadonly.value;
147
+ });
148
+ const isAgentReadonly = computed(() => {
149
+ if (dataStore.isGons || dataStore.isPension) return isReadonly.value || !dataStore.isAgent();
150
+ return isReadonly.value;
151
+ });
123
152
 
124
- const openPanel = async (currentDict: string, title: string) => {
153
+ const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
125
154
  searchQuery.value = '';
126
155
  if (dataStore.isTask() && !props.disabled) {
127
156
  dataStore.panelAction = null;
128
- dataStore.panel.open = true;
129
- dataStore.panel.title = title;
157
+ dataStore.rightPanel.open = true;
158
+ dataStore.rightPanel.title = title;
130
159
  currentDictName.value = currentDict;
131
160
 
132
161
  if (currentDict === 'ManagerPolicy' && formStore.RegionPolicy.ids) {
@@ -135,7 +164,7 @@ export default defineComponent({
135
164
  }
136
165
 
137
166
  isPanelOpen.value = true;
138
- panelValue.value = formStore[currentDict as keyof typeof formStore];
167
+ panelValue.value = formStore[currentDict];
139
168
  isPanelLoading.value = false;
140
169
  } else {
141
170
  dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
@@ -150,19 +179,26 @@ export default defineComponent({
150
179
  }
151
180
  };
152
181
 
153
- const pickPanelValue = (answer: any) => {
182
+ const pickPanelValue = (answer: FieldTypes) => {
154
183
  // @ts-ignore
155
184
  formStore[currentDictName.value] = answer;
156
185
  isPanelOpen.value = false;
157
- dataStore.panel.open = false;
186
+ dataStore.rightPanel.open = false;
158
187
  searchQuery.value = '';
159
188
  };
160
189
 
161
- watch(searchQuery, () => {
162
- if (searchQuery.value === null) {
163
- searchQuery.value = '';
164
- }
165
- });
190
+ watchDebounced(
191
+ searchQuery,
192
+ async searchQuery => {
193
+ if (searchQuery === null) {
194
+ searchQuery = '';
195
+ }
196
+ if (!!searchQuery && currentDictName.value === 'AgentData') {
197
+ await searchAgent();
198
+ }
199
+ },
200
+ { debounce: 1000 },
201
+ );
166
202
 
167
203
  watch(
168
204
  () => formStore.RegionPolicy,
@@ -173,6 +209,25 @@ export default defineComponent({
173
209
  },
174
210
  );
175
211
 
212
+ watch(
213
+ () => dataStore.rightPanel.open,
214
+ () => {
215
+ if (dataStore.rightPanel.open === false) {
216
+ isPanelOpen.value = false;
217
+ }
218
+ },
219
+ { immediate: true },
220
+ );
221
+
222
+ onBeforeUnmount(() => {
223
+ if (!isReadonly.value) {
224
+ const areValid = !!formStore.SaleChanellPolicy.nameRu && !!formStore.RegionPolicy.nameRu && !!formStore.ManagerPolicy.nameRu && !!formStore.AgentData.fullName;
225
+ if (areValid) {
226
+ dataStore.setINSISWorkData(false);
227
+ }
228
+ }
229
+ });
230
+
176
231
  return {
177
232
  // State
178
233
  formStore,
@@ -184,8 +239,11 @@ export default defineComponent({
184
239
  currentDictName,
185
240
 
186
241
  // Computed
187
- dictList,
188
242
  isReadonly,
243
+ isSaleChanellReadonly,
244
+ isRegionReadonly,
245
+ isManagerReadonly,
246
+ isAgentReadonly,
189
247
 
190
248
  // Functions
191
249
  openPanel,
@@ -195,3 +253,9 @@ export default defineComponent({
195
253
  },
196
254
  });
197
255
  </script>
256
+
257
+ <style scoped>
258
+ .no-padding :deep(.v-expansion-panel-text__wrapper) {
259
+ padding: 0 !important;
260
+ }
261
+ </style>
@@ -6,23 +6,48 @@
6
6
  </p>
7
7
  <p v-if="!!subtitle" :class="[$styles.greyText, $styles.textSimple]">{{ subtitle }}</p>
8
8
  </div>
9
- <div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
9
+ <div v-if="hasDefault" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
10
10
  <span v-if="hasSum" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
11
11
  <span v-if="hasPremium" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
12
- <span v-if="hasPolicyNumber" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
12
+
13
13
  <span v-if="hasContractDate" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
14
14
  <span v-if="hasCoverPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
15
15
  <span v-if="hasPayPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
16
16
  </div>
17
- <div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
17
+ <div v-if="hasDefault" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
18
18
  <span v-if="hasSum" :class="[amount === null && $styles.emptyBlockCol]">{{ amount }} </span>
19
19
  <span v-if="hasPremium" :class="[premium === null && $styles.emptyBlockCol]"> {{ premium }}</span>
20
20
  <span v-if="hasPolicyNumber" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
21
21
  <span v-if="hasContractDate" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
22
22
  <span v-if="hasCoverPeriod" :class="[coverPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
23
- <span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">
24
- {{ paymentPeriod }}
23
+ <span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ paymentPeriod }}</span>
24
+ <div
25
+ class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
26
+ :class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
27
+ @click="!disabled && $emit('onMore', { whichForm: 'productConditions' })"
28
+ >
29
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
30
+ </div>
31
+ </div>
32
+ <div v-if="$dataStore.isLifetrip" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
33
+ <span :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('calculatorForm.type') }}</span>
34
+ <span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('calculatorForm.country') }}</span>
35
+ <span :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('calculatorForm.purpose') }}</span>
36
+ <span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('calculatorForm.amount') }}</span>
37
+ <span v-if="hasPolicyNumber" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
38
+ </div>
39
+ <div v-if="$dataStore.isLifetrip" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
40
+ <span :class="[calculatorForm.type.nameRu === null && $styles.emptyBlockCol]" class="hidden lg:block">
41
+ {{ calculatorForm.type.nameRu }}
25
42
  </span>
43
+ <span :class="[calculatorForm.price === null && $styles.emptyBlockCol]"> {{ calculatorForm.countries?.length ? countriesComputed : '' }}</span>
44
+ <span :class="[calculatorForm.purpose.nameRu === null && $styles.emptyBlockCol]" class="hidden lg:block">
45
+ {{ calculatorForm.purpose && calculatorForm.purpose.nameRu ? calculatorForm.purpose.nameRu : $dataStore.t('calculatorForm.purpose') }}</span
46
+ >
47
+ <span :class="[calculatorForm.amount && calculatorForm.amount.nameRu ? calculatorForm.amount.nameRu : $dataStore.t('calculatorForm.amount') && $styles.emptyBlockCol]"
48
+ >{{ calculatorForm.amount?.nameRu }}
49
+ </span>
50
+
26
51
  <div
27
52
  class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
28
53
  :class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
@@ -68,11 +93,17 @@ export default defineComponent({
68
93
  ? formStore.productConditionsForm.paymentPeriod.nameRu
69
94
  : null,
70
95
  );
71
-
96
+ const calculatorForm = formStore.productConditionsForm.calculatorForm;
72
97
  const hasSum = computed(() => {
98
+ if (dataStore.isLifetrip) {
99
+ return false;
100
+ }
73
101
  return true;
74
102
  });
75
103
  const hasPremium = computed(() => {
104
+ if (dataStore.isLifetrip) {
105
+ return false;
106
+ }
76
107
  return true;
77
108
  });
78
109
  const hasPolicyNumber = computed(() => {
@@ -88,20 +119,40 @@ export default defineComponent({
88
119
  return false;
89
120
  });
90
121
  const hasCoverPeriod = computed(() => {
122
+ if (dataStore.isLifetrip) {
123
+ return false;
124
+ }
91
125
  if (dataStore.isFinCenter()) {
92
126
  return false;
93
127
  }
94
128
  return true;
95
129
  });
96
130
  const hasPayPeriod = computed(() => {
131
+ if (dataStore.isLifetrip) {
132
+ return false;
133
+ }
97
134
  if (dataStore.isFinCenter()) {
98
135
  return false;
99
136
  }
100
137
  return true;
101
138
  });
139
+ const countriesComputed = computed(() => {
140
+ let message = '';
141
+ for (let country in calculatorForm.countries) {
142
+ message += calculatorForm.countries[country as any].nameRu + ', ';
143
+ }
144
+ return message.slice(0, -2);
145
+ });
146
+ const hasDefault = computed(() => {
147
+ if (dataStore.isLifetrip) {
148
+ return false;
149
+ }
150
+ return true;
151
+ });
102
152
  return {
103
153
  // State
104
154
  formStore,
155
+ calculatorForm,
105
156
 
106
157
  // Computed
107
158
  amount,
@@ -116,6 +167,8 @@ export default defineComponent({
116
167
  hasContractDate,
117
168
  hasPayPeriod,
118
169
  hasCoverPeriod,
170
+ countriesComputed,
171
+ hasDefault,
119
172
  };
120
173
  },
121
174
  });
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <vue-date-picker
3
+ class="base-datepicker"
3
4
  :model-value="modelValue"
4
5
  :clearable="false"
5
6
  :disabled="disabled"
@@ -7,18 +8,20 @@
7
8
  @update:modelValue="$emit('update:modelValue', $event)"
8
9
  locale="ru"
9
10
  model-type="dd.MM.yyyy"
10
- position="left"
11
- menu-class-name="!left-[30vw] md:!left-[70vw] lg:!left-[75vw]"
12
- :teleport="teleport"
13
- :offset="-50"
11
+ :teleport="true"
14
12
  :close-on-scroll="true"
15
13
  :enable-time-picker="false"
14
+ :six-weeks="true"
15
+ :min-date="minDate"
16
16
  cancel-text="Отменить"
17
17
  select-text="Выбрать"
18
18
  >
19
19
  <template #trigger>
20
20
  <v-icon icon="mdi mdi-calendar-blank-outline cursor-pointer" />
21
21
  </template>
22
+ <template #action-preview="{ value }">
23
+ {{ reformatDate(value) }}
24
+ </template>
22
25
  </vue-date-picker>
23
26
  </template>
24
27
 
@@ -36,10 +39,43 @@ export default defineComponent({
36
39
  type: Boolean,
37
40
  default: false,
38
41
  },
39
- teleport: {
40
- type: String,
41
- default: '.v-form',
42
+ minDate: {
43
+ type: Date,
44
+ required: false,
42
45
  },
43
46
  },
44
47
  });
45
48
  </script>
49
+
50
+ <style>
51
+ :root {
52
+ --dp-menu-min-width: 300px;
53
+ --dp-border-radius: 10px;
54
+ --dp-cell-border-radius: 9999px;
55
+ }
56
+
57
+ .dp__calendar_item .dp__active_date {
58
+ @apply bg-[#A0B3D8];
59
+ }
60
+ .dp__calendar_item .dp__today {
61
+ @apply border-[#A0B3D8];
62
+ }
63
+ .dp__calendar_item .dp__today:not(.dp__active_date) {
64
+ @apply border-[#009C73];
65
+ }
66
+ .dp__overlay_cell_active {
67
+ @apply !bg-[#A0B3D8];
68
+ }
69
+ .dp__action_button {
70
+ @apply h-auto px-3 py-1 text-[14px] rounded-lg;
71
+ }
72
+ .dp__action_cancel {
73
+ @apply hover:border-[#A0B3D8];
74
+ }
75
+ .dp__action_select {
76
+ @apply bg-[#009C73] hover:bg-[#00a277] text-white px-4;
77
+ }
78
+ .dp__selection_preview[title*='/'] {
79
+ @apply rounded-lg border-[1px] px-3 py-1 text-[14px] text-[#009C73];
80
+ }
81
+ </style>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <div v-for="(field, fieldIndex) in fields" :key="fieldIndex">
3
+ <base-text-input
4
+ v-if="field.type === 'text' || field.type === 'number'"
5
+ :control="field"
6
+ class="bg-[#fff]"
7
+ :class="{ 'rounded-t-lg': fieldIndex === 0 || fields[fieldIndex - 1].type !== 'text', 'rounded-b-lg': fieldIndex === fields.length - 1 }"
8
+ @onClickField="$emit('onClickField', field)"
9
+ />
10
+ <base-switch-input v-if="field.type === 'switch'" :field="field" />
11
+ </div>
12
+ </template>
13
+
14
+ <script lang="ts">
15
+ export default defineComponent({
16
+ props: {
17
+ fields: {
18
+ type: Object as PropType<InputType[]>,
19
+ required: true,
20
+ },
21
+ },
22
+ });
23
+ </script>
@@ -3,17 +3,22 @@
3
3
  class="file-input"
4
4
  :disabled="disabled"
5
5
  prepend-icon=""
6
- append-inner-icon="mdi mdi-file-document"
7
- @click:append-inner="$emit('input', $event)"
6
+ :append-inner-icon="`mdi ${icon}`"
8
7
  @input="$emit('input', $event)"
9
8
  variant="solo"
10
9
  show-size
11
10
  multiple
12
- accept=".pdf,.doc,.jpeg,.jpg,.jpg"
11
+ accept=".pdf,.doc,.docx,.jpeg,.jpg,.jpg,.xlsx,.xls"
13
12
  truncate-length="15"
14
13
  clear-icon="mdi mdi-close"
15
- :label="$dataStore.t('labels.chooseDoc')"
16
- />
14
+ :label="label"
15
+ @click:append-inner="$emit('append-inner', $event)"
16
+ @click:clear="$emit('on-clear')"
17
+ >
18
+ <template v-slot:loader>
19
+ <v-progress-linear v-if="loading" color="#A0B3D8" height="3" indeterminate />
20
+ </template>
21
+ </v-file-input>
17
22
  </template>
18
23
 
19
24
  <script lang="ts">
@@ -23,7 +28,22 @@ export default defineComponent({
23
28
  type: Boolean,
24
29
  default: false,
25
30
  },
31
+ icon: {
32
+ type: String,
33
+ default: 'mdi-file-document',
34
+ },
35
+ label: {
36
+ type: String,
37
+ default() {
38
+ return useDataStore().t('labels.chooseDoc');
39
+ },
40
+ },
41
+ loading: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
26
45
  },
46
+ emits: ['input', 'append-inner', 'on-clear'],
27
47
  });
28
48
  </script>
29
49
 
@@ -33,13 +33,13 @@
33
33
  <v-icon
34
34
  v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') === false"
35
35
  :icon="appendInnerIcon"
36
- @click="appendInnerIcon.includes('mdi-magnify') ? $emit('append') : !props.readonly && $emit('append')"
36
+ @click="appendInnerIcon.includes('mdi-magnify') || appendInnerIcon.includes('mdi-credit-card-scan') ? $emit('append') : !props.readonly && $emit('append')"
37
37
  />
38
38
  <base-datepicker
39
39
  v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') && !props.readonly"
40
40
  :model-value="modelValue"
41
+ :min-date="minDate"
41
42
  @update:modelValue="$emit('update:modelValue', $event)"
42
- :teleport="teleport"
43
43
  />
44
44
  </template>
45
45
  <template v-if="loading" #loader>
@@ -114,6 +114,10 @@ export default defineComponent({
114
114
  type: String,
115
115
  default: 'mdi-close',
116
116
  },
117
+ minDate: {
118
+ type: Date,
119
+ default: undefined,
120
+ },
117
121
  prependIcon: {
118
122
  type: String,
119
123
  },
@@ -139,10 +143,9 @@ export default defineComponent({
139
143
  const submitted = (event: any) => {
140
144
  emit('submitted', event);
141
145
  };
142
-
143
146
  return {
144
- submitted,
145
147
  props,
148
+ submitted,
146
149
  };
147
150
  },
148
151
  });
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <vue-date-picker
3
+ :model-value="modelValue"
4
+ :clearable="false"
5
+ :disabled="disabled"
6
+ :reaonly="readonly"
7
+ month-picker
8
+ locale="ru"
9
+ format="MM.yyyy"
10
+ :teleport="true"
11
+ :close-on-scroll="true"
12
+ cancel-text="Отменить"
13
+ select-text="Выбрать"
14
+ @update:modelValue="$emit('update:modelValue', $event)"
15
+ />
16
+ </template>
17
+
18
+ <script lang="ts">
19
+ export default defineComponent({
20
+ props: {
21
+ modelValue: {
22
+ required: false,
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ readonly: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ },
33
+ });
34
+ </script>