hl-core 0.0.9-beta.3 → 0.0.9-beta.31

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 (72) hide show
  1. package/api/base.api.ts +862 -0
  2. package/api/index.ts +2 -620
  3. package/api/interceptors.ts +58 -14
  4. package/components/Button/Btn.vue +3 -3
  5. package/components/Complex/ContentBlock.vue +1 -1
  6. package/components/Complex/MessageBlock.vue +2 -2
  7. package/components/Complex/Page.vue +8 -2
  8. package/components/Complex/WhiteBlock.vue +7 -0
  9. package/components/Dialog/Dialog.vue +60 -15
  10. package/components/Dialog/FamilyDialog.vue +5 -5
  11. package/components/Form/DynamicForm.vue +99 -0
  12. package/components/Form/FormBlock.vue +36 -29
  13. package/components/Form/FormData.vue +48 -0
  14. package/components/Form/FormSection.vue +2 -2
  15. package/components/Form/FormTextSection.vue +3 -3
  16. package/components/Form/FormToggle.vue +3 -3
  17. package/components/Form/ManagerAttachment.vue +104 -52
  18. package/components/Form/ProductConditionsBlock.vue +73 -20
  19. package/components/Input/DynamicInput.vue +23 -0
  20. package/components/Input/EmptyFormField.vue +1 -1
  21. package/components/Input/FileInput.vue +15 -4
  22. package/components/Input/Monthpicker.vue +33 -0
  23. package/components/Input/PanelInput.vue +5 -1
  24. package/components/Input/RoundedEmptyField.vue +5 -0
  25. package/components/Input/RoundedSelect.vue +13 -0
  26. package/components/Input/SwitchInput.vue +64 -0
  27. package/components/Input/TextInput.vue +161 -0
  28. package/components/Layout/Drawer.vue +17 -4
  29. package/components/Layout/Header.vue +2 -2
  30. package/components/Layout/SettingsPanel.vue +10 -15
  31. package/components/List/ListEmpty.vue +1 -1
  32. package/components/Menu/MenuHover.vue +1 -1
  33. package/components/Menu/MenuNav.vue +3 -3
  34. package/components/Menu/MenuNavItem.vue +4 -4
  35. package/components/Pages/Anketa.vue +144 -65
  36. package/components/Pages/Auth.vue +21 -10
  37. package/components/Pages/ContragentForm.vue +505 -0
  38. package/components/Pages/Documents.vue +57 -11
  39. package/components/Pages/InvoiceInfo.vue +2 -2
  40. package/components/Pages/MemberForm.vue +253 -89
  41. package/components/Pages/ProductAgreement.vue +2 -11
  42. package/components/Pages/ProductConditions.vue +777 -164
  43. package/components/Panel/PanelHandler.vue +297 -54
  44. package/components/Panel/PanelSelectItem.vue +18 -3
  45. package/components/Panel/RightPanelCloser.vue +7 -0
  46. package/components/Utilities/IconBorder.vue +17 -0
  47. package/composables/axios.ts +1 -1
  48. package/composables/classes.ts +405 -9
  49. package/composables/constants.ts +40 -0
  50. package/composables/fields.ts +203 -0
  51. package/composables/index.ts +48 -0
  52. package/composables/styles.ts +22 -10
  53. package/configs/i18n.ts +0 -2
  54. package/layouts/default.vue +46 -4
  55. package/layouts/full.vue +1 -1
  56. package/locales/ru.json +428 -11
  57. package/nuxt.config.ts +1 -1
  58. package/package.json +30 -39
  59. package/pages/500.vue +2 -2
  60. package/pages/Token.vue +1 -0
  61. package/plugins/helperFunctionsPlugins.ts +6 -7
  62. package/plugins/vuetifyPlugin.ts +2 -0
  63. package/store/data.store.ts +936 -217
  64. package/store/extractStore.ts +17 -0
  65. package/store/form.store.ts +13 -1
  66. package/store/member.store.ts +1 -1
  67. package/store/rules.ts +38 -2
  68. package/types/enum.ts +8 -0
  69. package/types/form.ts +94 -0
  70. package/types/index.ts +162 -10
  71. package/components/Button/BtnIcon.vue +0 -47
  72. package/locales/kz.json +0 -590
@@ -1,15 +1,15 @@
1
1
  <template>
2
- <div class="rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
2
+ <div class="rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
3
3
  <div class="mt-3 ml-5">
4
- <p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ $dataStore.t('form.attachManager') }}</p>
4
+ <p :class="[$styles.textTitle, $styles.greenText]">{{ $dataStore.t('form.attachManager') }}</p>
5
5
  </div>
6
6
  <v-form ref="vForm" class="flex flex-col mt-1">
7
7
  <base-panel-input
8
8
  class="pl-1"
9
9
  v-model="formStore.SaleChanellPolicy"
10
- :value="formStore.SaleChanellPolicy.nameRu"
11
- :readonly="isReadonly"
12
- :clearable="!isReadonly"
10
+ :value="formStore.SaleChanellPolicy?.nameRu"
11
+ :readonly="isSaleChanellReadonly"
12
+ :clearable="!isSaleChanellReadonly"
13
13
  :label="$dataStore.t('form.salesChanell')"
14
14
  :rules="$rules.objectRequired"
15
15
  append-inner-icon="mdi mdi-chevron-right"
@@ -18,9 +18,9 @@
18
18
  <base-panel-input
19
19
  class="pl-1"
20
20
  v-model="formStore.RegionPolicy"
21
- :value="formStore.RegionPolicy.nameRu"
22
- :readonly="isReadonly"
23
- :clearable="!isReadonly"
21
+ :value="formStore.RegionPolicy?.nameRu"
22
+ :readonly="isRegionReadonly"
23
+ :clearable="!isRegionReadonly"
24
24
  :label="$dataStore.t('form.Region')"
25
25
  :rules="$rules.objectRequired"
26
26
  append-inner-icon="mdi mdi-chevron-right"
@@ -29,9 +29,9 @@
29
29
  <base-panel-input
30
30
  class="pl-1"
31
31
  v-model="formStore.ManagerPolicy"
32
- :value="formStore.ManagerPolicy.nameRu"
33
- :readonly="isReadonly"
34
- :clearable="!isReadonly"
32
+ :value="formStore.ManagerPolicy?.nameRu"
33
+ :readonly="isManagerReadonly"
34
+ :clearable="!isManagerReadonly"
35
35
  :label="$dataStore.t('form.manager')"
36
36
  :rules="$rules.objectRequired"
37
37
  append-inner-icon="mdi mdi-chevron-right"
@@ -40,17 +40,17 @@
40
40
  <base-panel-input
41
41
  class="pl-1"
42
42
  v-model="formStore.AgentData"
43
- :value="formStore.AgentData.fullName"
44
- :readonly="isReadonly"
45
- :clearable="!isReadonly"
43
+ :value="formStore.AgentData?.fullName"
44
+ :readonly="isAgentReadonly"
45
+ :clearable="!isAgentReadonly"
46
46
  :label="$dataStore.t('form.agent')"
47
47
  :rules="$rules.agentDataRequired"
48
48
  append-inner-icon="mdi mdi-chevron-right"
49
49
  @append="openPanel('AgentData', $dataStore.t('form.agent'))"
50
50
  />
51
51
  </v-form>
52
- <Teleport v-if="isPanelOpen" to="#panel-actions">
53
- <div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
52
+ <Teleport v-if="isPanelOpen" to="#right-panel-actions">
53
+ <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
54
54
  <base-rounded-input
55
55
  v-model.trim="searchQuery"
56
56
  :label="$dataStore.t('labels.search')"
@@ -59,16 +59,34 @@
59
59
  :append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
60
60
  @append="searchAgent"
61
61
  />
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
- />
62
+ <div v-if="isPanelLoading === false" class="w-full">
63
+ <div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
64
+ <div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
65
+ <div
66
+ class="flex justify-between p-4 items-center cursor-pointer"
67
+ :class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
68
+ @click="pickPanelValue(agent)"
69
+ >
70
+ <div class="flex flex-col">
71
+ <span :class="[$styles.textSimple]">{{ $getFullNameShorted(agent.fullName ?? '', 2) }}</span>
72
+ <span :class="[$styles.mutedText]">
73
+ {{ agent.saleChannel ? `${agent.saleChannel} / ${$getFullNameShorted(agent.managerName ?? '', 2)}` : `${agent.managerName}` }}
74
+ </span>
75
+ </div>
76
+ <i
77
+ class="mdi text-xl"
78
+ :class="[agent.agentId === (panelValue as AgentData).agentId ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]']"
79
+ ></i>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ <div v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy'" class="w-full flex flex-col gap-2 p-2">
84
+ <div v-for="(item, index) in $dataStore[currentDictName].filter(i => (i.nameRu as string).toLowerCase().includes(searchQuery.toLowerCase()))" :key="index">
85
+ <base-panel-select-item :key="index" :text="item.nameRu ?? ''" :selected="item.ids === (panelValue as Value).ids" @click="pickPanelValue(item)" />
86
+ </div>
70
87
  </div>
71
88
  </div>
89
+
72
90
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
73
91
  </div>
74
92
  </Teleport>
@@ -77,6 +95,7 @@
77
95
 
78
96
  <script lang="ts">
79
97
  import { Value } from '../../composables/classes';
98
+ import { watchDebounced } from '@vueuse/core';
80
99
 
81
100
  export default defineComponent({
82
101
  props: {
@@ -90,29 +109,17 @@ export default defineComponent({
90
109
  },
91
110
  },
92
111
  setup(props) {
112
+ type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
113
+ type FieldTypes = Value | AgentData;
93
114
  const route = useRoute();
94
115
  const dataStore = useDataStore();
95
116
  const formStore = useFormStore();
96
117
  const isPanelOpen = ref<boolean>(false);
97
118
  const isPanelLoading = ref<boolean>(false);
98
- const panelValue = ref<Value & AgentData>(new Value());
119
+ const panelValue = ref<FieldTypes>(new Value());
99
120
  const searchQuery = ref<string>('');
100
- const currentDictName = ref<string>();
121
+ const currentDictName = ref<ManagerAttachmentFiels>();
101
122
 
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
123
  const isReadonly = computed(
117
124
  () =>
118
125
  props.disabled ||
@@ -120,13 +127,29 @@ export default defineComponent({
120
127
  !dataStore.isInitiator() ||
121
128
  (route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
122
129
  );
130
+ const isSaleChanellReadonly = computed(() => {
131
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
132
+ return isReadonly.value;
133
+ });
134
+ const isRegionReadonly = computed(() => {
135
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
136
+ return isReadonly.value;
137
+ });
138
+ const isManagerReadonly = computed(() => {
139
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
140
+ return isReadonly.value;
141
+ });
142
+ const isAgentReadonly = computed(() => {
143
+ if (dataStore.isGons) return isReadonly.value || !dataStore.isAgent();
144
+ return isReadonly.value;
145
+ });
123
146
 
124
- const openPanel = async (currentDict: string, title: string) => {
147
+ const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
125
148
  searchQuery.value = '';
126
149
  if (dataStore.isTask() && !props.disabled) {
127
150
  dataStore.panelAction = null;
128
- dataStore.panel.open = true;
129
- dataStore.panel.title = title;
151
+ dataStore.rightPanel.open = true;
152
+ dataStore.rightPanel.title = title;
130
153
  currentDictName.value = currentDict;
131
154
 
132
155
  if (currentDict === 'ManagerPolicy' && formStore.RegionPolicy.ids) {
@@ -135,7 +158,7 @@ export default defineComponent({
135
158
  }
136
159
 
137
160
  isPanelOpen.value = true;
138
- panelValue.value = formStore[currentDict as keyof typeof formStore];
161
+ panelValue.value = formStore[currentDict];
139
162
  isPanelLoading.value = false;
140
163
  } else {
141
164
  dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
@@ -150,19 +173,26 @@ export default defineComponent({
150
173
  }
151
174
  };
152
175
 
153
- const pickPanelValue = (answer: any) => {
176
+ const pickPanelValue = (answer: FieldTypes) => {
154
177
  // @ts-ignore
155
178
  formStore[currentDictName.value] = answer;
156
179
  isPanelOpen.value = false;
157
- dataStore.panel.open = false;
180
+ dataStore.rightPanel.open = false;
158
181
  searchQuery.value = '';
159
182
  };
160
183
 
161
- watch(searchQuery, () => {
162
- if (searchQuery.value === null) {
163
- searchQuery.value = '';
164
- }
165
- });
184
+ watchDebounced(
185
+ searchQuery,
186
+ async searchQuery => {
187
+ if (searchQuery === null) {
188
+ searchQuery = '';
189
+ }
190
+ if (!!searchQuery && currentDictName.value === 'AgentData') {
191
+ await searchAgent();
192
+ }
193
+ },
194
+ { debounce: 1000 },
195
+ );
166
196
 
167
197
  watch(
168
198
  () => formStore.RegionPolicy,
@@ -173,6 +203,25 @@ export default defineComponent({
173
203
  },
174
204
  );
175
205
 
206
+ watch(
207
+ () => dataStore.rightPanel.open,
208
+ () => {
209
+ if (dataStore.rightPanel.open === false) {
210
+ isPanelOpen.value = false;
211
+ }
212
+ },
213
+ { immediate: true },
214
+ );
215
+
216
+ onBeforeUnmount(() => {
217
+ if (!isReadonly.value) {
218
+ const areValid = !!formStore.SaleChanellPolicy.nameRu && !!formStore.RegionPolicy.nameRu && !!formStore.ManagerPolicy.nameRu && !!formStore.AgentData.fullName;
219
+ if (areValid) {
220
+ dataStore.setINSISWorkData(false);
221
+ }
222
+ }
223
+ });
224
+
176
225
  return {
177
226
  // State
178
227
  formStore,
@@ -184,8 +233,11 @@ export default defineComponent({
184
233
  currentDictName,
185
234
 
186
235
  // Computed
187
- dictList,
188
236
  isReadonly,
237
+ isSaleChanellReadonly,
238
+ isRegionReadonly,
239
+ isManagerReadonly,
240
+ isAgentReadonly,
189
241
 
190
242
  // Functions
191
243
  openPanel,
@@ -1,31 +1,56 @@
1
1
  <template>
2
- <div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
2
+ <div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
3
3
  <div>
4
- <p :class="[$libStyles.textTitle, $libStyles.greenText]">
4
+ <p :class="[$styles.textTitle, $styles.greenText]">
5
5
  {{ $dataStore.t('productConditions') }}
6
6
  </p>
7
- <p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
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">
10
- <span v-if="hasSum" :class="[$libStyles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
11
- <span v-if="hasPremium" :class="[$libStyles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
12
- <span v-if="hasPolicyNumber" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
13
- <span v-if="hasContractDate" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
14
- <span v-if="hasCoverPeriod" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
15
- <span v-if="hasPayPeriod" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
9
+ <div v-if="hasDefault" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
10
+ <span v-if="hasSum" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
11
+ <span v-if="hasPremium" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
12
+
13
+ <span v-if="hasContractDate" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
14
+ <span v-if="hasCoverPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
15
+ <span v-if="hasPayPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
16
+ </div>
17
+ <div v-if="hasDefault" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
18
+ <span v-if="hasSum" :class="[amount === null && $styles.emptyBlockCol]">{{ amount }} </span>
19
+ <span v-if="hasPremium" :class="[premium === null && $styles.emptyBlockCol]"> {{ premium }}</span>
20
+ <span v-if="hasPolicyNumber" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
21
+ <span v-if="hasContractDate" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
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"> {{ 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>
16
38
  </div>
17
- <div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
18
- <span v-if="hasSum" :class="[amount === null && $libStyles.emptyBlockCol]">{{ amount }} </span>
19
- <span v-if="hasPremium" :class="[premium === null && $libStyles.emptyBlockCol]"> {{ premium }}</span>
20
- <span v-if="hasPolicyNumber" :class="[policyNumber === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
21
- <span v-if="hasContractDate" :class="[policyNumber === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
22
- <span v-if="hasCoverPeriod" :class="[coverPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
23
- <span v-if="hasPayPeriod" :class="[paymentPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
24
- {{ paymentPeriod }}
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 }}
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 }}
25
49
  </span>
50
+
26
51
  <div
27
52
  class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
28
- :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
53
+ :class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
29
54
  @click="!disabled && $emit('onMore', { whichForm: 'productConditions' })"
30
55
  >
31
56
  <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
@@ -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
  });
@@ -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>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="h-[60px] bg-white rounded border-b-[1px] border-b-[#f3f6fc] flex items-center pl-4" :class="[$libStyles.textTitle]">
2
+ <div class="h-[60px] bg-white rounded border-b-[1px] border-b-[#f3f6fc] flex items-center pl-4" :class="[$styles.textTitle]">
3
3
  <slot></slot>
4
4
  </div>
5
5
  </template>
@@ -3,16 +3,16 @@
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,.jpeg,.jpg,.jpg,.xlsx,.xls"
13
12
  truncate-length="15"
14
13
  clear-icon="mdi mdi-close"
15
- :label="$dataStore.t('labels.chooseDoc')"
14
+ :label="label"
15
+ @click:append-inner="$emit('append-inner', $event)"
16
16
  />
17
17
  </template>
18
18
 
@@ -23,7 +23,18 @@ export default defineComponent({
23
23
  type: Boolean,
24
24
  default: false,
25
25
  },
26
+ icon: {
27
+ type: String,
28
+ default: 'mdi-file-document',
29
+ },
30
+ label: {
31
+ type: String,
32
+ default() {
33
+ return useDataStore().t('labels.chooseDoc');
34
+ },
35
+ },
26
36
  },
37
+ emits: ['input', 'append-inner'],
27
38
  });
28
39
  </script>
29
40
 
@@ -0,0 +1,33 @@
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
+ :close-on-scroll="true"
11
+ cancel-text="Отменить"
12
+ select-text="Выбрать"
13
+ @update:modelValue="$emit('update:modelValue', $event)"
14
+ />
15
+ </template>
16
+
17
+ <script lang="ts">
18
+ export default defineComponent({
19
+ props: {
20
+ modelValue: {
21
+ required: false,
22
+ },
23
+ disabled: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
27
+ readonly: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ },
32
+ });
33
+ </script>
@@ -24,7 +24,7 @@
24
24
  :suffix="suffix"
25
25
  @keyup.enter.prevent="submitted"
26
26
  @click:control="!props.readonly && $emit('append')"
27
- @click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', new Value())"
27
+ @click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', clearValue)"
28
28
  @click:append="!props.readonly && $emit('append-out')"
29
29
  @click:prepend="!props.readonly && $emit('prepend-out')"
30
30
  @click:append-inner="!props.readonly && $emit('append')"
@@ -50,6 +50,10 @@ export default defineComponent({
50
50
  type: Boolean,
51
51
  default: false,
52
52
  },
53
+ clearValue: {
54
+ type: Object,
55
+ default: new Value(),
56
+ },
53
57
  clearable: {
54
58
  type: Boolean,
55
59
  default: true,
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="min-w-[250px] h-[50px] border-[1px] border-[#dadada] bg-[#FFF] pl-4 flex cursor-pointer opacity-[87%]" :class="[$styles.textSimple, $styles.rounded]">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
@@ -7,6 +7,8 @@
7
7
  :placeholder="placeholder"
8
8
  :label="label"
9
9
  :variant="variant"
10
+ :density="(density as any)"
11
+ :menu-icon="menuIcon"
10
12
  :clear-icon="clearIcon"
11
13
  :color="color"
12
14
  :hint="hint"
@@ -78,10 +80,18 @@ export default defineComponent({
78
80
  type: String as PropType<InputVariants>,
79
81
  default: 'solo',
80
82
  },
83
+ density: {
84
+ type: String,
85
+ default: 'compact',
86
+ },
81
87
  color: {
82
88
  type: String,
83
89
  default: '#009c73',
84
90
  },
91
+ menuIcon: {
92
+ type: String,
93
+ default: 'mdi-chevron-down',
94
+ },
85
95
  clearIcon: {
86
96
  type: String,
87
97
  default: 'mdi-close',
@@ -122,6 +132,9 @@ export default defineComponent({
122
132
  border: none !important;
123
133
  outline: none !important;
124
134
  }
135
+ .rounded-select.v-input {
136
+ flex: unset !important;
137
+ }
125
138
  .rounded-select .v-label.v-field-label {
126
139
  top: 20px;
127
140
  }
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div class="base-switch-input p-4 bg-white rounded-lg mb-3">
3
+ <v-switch v-model="field.modelValue" v-bind="switchProps" />
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts">
8
+ export default defineComponent({
9
+ name: 'asSwitchInput',
10
+ props: {
11
+ field: {
12
+ type: Object as PropType<SwitchInput>,
13
+ required: true,
14
+ },
15
+ },
16
+ setup(props) {
17
+ const switchProps = computed(() => {
18
+ return {
19
+ label: props.field.label,
20
+ direction: props.field.direction,
21
+ disabled: props.field.disabled,
22
+ hideDetails: true,
23
+ color: '#009C73',
24
+ };
25
+ });
26
+ return { switchProps };
27
+ },
28
+ });
29
+ </script>
30
+
31
+ <style>
32
+ .base-switch-input .v-switch label {
33
+ font-size: 14px !important;
34
+ font-weight: 400 !important;
35
+ line-height: 20px !important;
36
+ opacity: 1 !important;
37
+ }
38
+ .base-switch-input .v-switch__track {
39
+ background: white !important;
40
+ border: 1.1px solid #e5e5ea;
41
+ height: 19px !important;
42
+ width: 100px !important;
43
+ border-radius: 16px;
44
+ overflow: hidden;
45
+ }
46
+
47
+ .base-switch-input .switch-block .v-input--horizontal {
48
+ grid-template-areas: unset !important;
49
+ }
50
+
51
+ .base-switch-input .v-switch__thumb {
52
+ color: white;
53
+ width: 20px;
54
+ height: 20px;
55
+ }
56
+
57
+ .base-switch-input .v-selection-control--dirty .v-switch__track {
58
+ background: #2aa65c !important;
59
+ }
60
+
61
+ .base-switch-input .v-switch .v-selection-control {
62
+ min-height: unset !important;
63
+ }
64
+ </style>