@lancom/shared 0.0.102 → 0.0.106
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.
- package/assets/js/api/admin.js +6 -0
- package/assets/js/models/print-area.js +8 -6
- package/assets/js/models/product-layers.js +3 -3
- package/assets/js/utils/fabric-helper.js +2 -4
- package/assets/js/utils/filters.js +7 -1
- package/assets/js/utils/prints.js +15 -4
- package/assets/js/utils/product.js +4 -4
- package/assets/scss/ui_kit/_table.scss +3 -0
- package/assets/scss/ui_kit/_typography.scss +6 -0
- package/components/checkout/order/address-form/address-form.vue +1 -0
- package/components/checkout/order/order-billing-information/order-billing-information.vue +7 -5
- package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
- package/components/common/color-picker.vue +6 -1
- package/components/common/file_uploader.vue +1 -1
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
- package/components/common/pricing_table/pricing-table.scss +1 -3
- package/components/common/pricing_table/pricing-table.vue +13 -4
- package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
- package/components/common/range/range.scss +23 -0
- package/components/common/range/range.vue +19 -0
- package/components/editor/editor.vue +3 -2
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
- package/components/editor/editor_pricing/editor-pricing.vue +3 -123
- package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
- package/components/editor/editor_product_details/editor-product-details.scss +1 -1
- package/components/editor/editor_product_details/editor-product-details.vue +22 -10
- package/components/editor/editor_workspace/editor-workspace.vue +10 -5
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
- package/components/modals/cart_modal/cart-modal.vue +1 -1
- package/components/modals/order_modal/order-modal.vue +5 -7
- package/components/modals/payment_modal/payment-modal.vue +1 -1
- package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
- package/components/pricing/pricing_example/pricing-example.scss +4 -1
- package/components/pricing/pricing_example/pricing-example.vue +106 -26
- package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
- package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
- package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
- package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
- package/components/pricing/pricing_print/pricing-print.scss +1 -1
- package/components/pricing/pricing_print/pricing-print.vue +19 -7
- package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
- package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
- package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
- package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
- package/components/product/gallery/gallery.scss +168 -0
- package/components/product/gallery/gallery.vue +252 -0
- package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
- package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
- package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
- package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
- package/components/product/product.vue +16 -5
- package/components/product/product_price_range/product-price-range.vue +20 -4
- package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
- package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
- package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
- package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
- package/components/product/related_products/related-products.scss +34 -0
- package/components/product/related_products/related-products.vue +52 -0
- package/components/products/product_list/product-list.scss +2 -1
- package/components/products/product_list_product/product-list-product.scss +44 -20
- package/components/products/product_list_product/product-list-product.vue +6 -4
- package/components/products/products_aside/products-aside.vue +29 -4
- package/components/products/products_brands/products-brands.vue +9 -2
- package/components/products/products_filters/products-filters.vue +10 -0
- package/components/products/products_tags/products-tags.vue +7 -0
- package/components/products/products_types/products-types.vue +6 -1
- package/mixins/product-preview.js +1 -1
- package/nuxt.config.js +13 -1
- package/package.json +1 -1
- package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
- package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
- package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
- package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
- package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
- package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
- package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
- package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
- package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
- package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
- package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
- package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
- package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
- package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
- package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
- package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
- package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
- package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
- package/store/index.js +3 -1
- package/store/product.js +25 -14
- package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
- package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
- package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
- package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
|
@@ -89,106 +89,7 @@
|
|
|
89
89
|
<div
|
|
90
90
|
v-if="showDetails"
|
|
91
91
|
class="EditorPricing__details">
|
|
92
|
-
<
|
|
93
|
-
<thead class="centered">
|
|
94
|
-
<tr class="highlighted">
|
|
95
|
-
<th colspan="6">
|
|
96
|
-
Tees
|
|
97
|
-
</th>
|
|
98
|
-
<th colspan="6">
|
|
99
|
-
Sizes
|
|
100
|
-
</th>
|
|
101
|
-
<th>Cost</th>
|
|
102
|
-
<th>Total Cost</th>
|
|
103
|
-
</tr>
|
|
104
|
-
</thead>
|
|
105
|
-
<tbody class="centered">
|
|
106
|
-
<tr
|
|
107
|
-
v-for="([groupPrice, group], index) in groupedProductsByPrice"
|
|
108
|
-
:key="index">
|
|
109
|
-
<td colspan="6">
|
|
110
|
-
{{ group.amount }}
|
|
111
|
-
</td>
|
|
112
|
-
<td colspan="6">
|
|
113
|
-
({{ group.sizes | sizesRange }})
|
|
114
|
-
</td>
|
|
115
|
-
<td>
|
|
116
|
-
<v-popover
|
|
117
|
-
trigger="hover"
|
|
118
|
-
popover-class="tooltip popover white no-paddings"
|
|
119
|
-
:delay="{ show: 200, hide: 400 }">
|
|
120
|
-
<span class="EditorPricing__hoverable">
|
|
121
|
-
{{ groupPrice | price }}
|
|
122
|
-
</span>
|
|
123
|
-
<template slot="popover">
|
|
124
|
-
<pricing-discounts-table
|
|
125
|
-
:prices="group.pricing"
|
|
126
|
-
:amount="productPricing.amount" />
|
|
127
|
-
</template>
|
|
128
|
-
</v-popover>
|
|
129
|
-
</td>
|
|
130
|
-
<td>{{ group.totalPrice | price }}</td>
|
|
131
|
-
</tr>
|
|
132
|
-
<tr class="highlighted">
|
|
133
|
-
<td colspan="13">
|
|
134
|
-
Tee Subtotal:
|
|
135
|
-
</td>
|
|
136
|
-
<td>{{ productPricing.products.products.totalPrice | price }}</td>
|
|
137
|
-
</tr>
|
|
138
|
-
</tbody>
|
|
139
|
-
<thead class="centered">
|
|
140
|
-
<tr class="highlighted">
|
|
141
|
-
<th colspan="4">
|
|
142
|
-
Prints
|
|
143
|
-
</th>
|
|
144
|
-
<th colspan="4">
|
|
145
|
-
Quantity
|
|
146
|
-
</th>
|
|
147
|
-
<th colspan="4">
|
|
148
|
-
Sizes
|
|
149
|
-
</th>
|
|
150
|
-
<th>Cost</th>
|
|
151
|
-
<th>Total Cost</th>
|
|
152
|
-
</tr>
|
|
153
|
-
</thead>
|
|
154
|
-
<tbody class="centered">
|
|
155
|
-
<tr
|
|
156
|
-
v-for="([printSide, group], index) in groupedProductsByPrintsPrice"
|
|
157
|
-
:key="index">
|
|
158
|
-
<td colspan="4">
|
|
159
|
-
{{ printSide }}
|
|
160
|
-
</td>
|
|
161
|
-
<td colspan="4">
|
|
162
|
-
{{ group.amount }}
|
|
163
|
-
</td>
|
|
164
|
-
<td colspan="4">
|
|
165
|
-
{{ group.sizes | printsRange }}
|
|
166
|
-
</td>
|
|
167
|
-
<td>
|
|
168
|
-
<v-popover
|
|
169
|
-
trigger="hover"
|
|
170
|
-
popover-class="tooltip popover white no-paddings"
|
|
171
|
-
:delay="{ show: 200, hide: 400 }">
|
|
172
|
-
<span class="EditorPricing__hoverable">
|
|
173
|
-
{{ group.price | price }}
|
|
174
|
-
</span>
|
|
175
|
-
<template slot="popover">
|
|
176
|
-
<pricing-discounts-table
|
|
177
|
-
:prices="printsPricing[group.sizes[0]]"
|
|
178
|
-
:amount="productPricing.amount" />
|
|
179
|
-
</template>
|
|
180
|
-
</v-popover>
|
|
181
|
-
</td>
|
|
182
|
-
<td>{{ group.totalPrice | price }}</td>
|
|
183
|
-
</tr>
|
|
184
|
-
<tr class="highlighted">
|
|
185
|
-
<td colspan="13">
|
|
186
|
-
Prints Subtotal:
|
|
187
|
-
</td>
|
|
188
|
-
<td>{{ productPricing.products.prints.totalPrice | price }}</td>
|
|
189
|
-
</tr>
|
|
190
|
-
</tbody>
|
|
191
|
-
</table>
|
|
92
|
+
<editor-pricing-details />
|
|
192
93
|
</div>
|
|
193
94
|
</div>
|
|
194
95
|
</template>
|
|
@@ -196,11 +97,9 @@
|
|
|
196
97
|
<script>
|
|
197
98
|
import { mapGetters, mapActions, mapMutations } from 'vuex';
|
|
198
99
|
import debounce from 'lodash.debounce';
|
|
199
|
-
import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
|
|
200
|
-
|
|
201
100
|
import { EventBus } from '@lancom/shared/assets/js/utils/event-bus';
|
|
202
101
|
import { price, sizesRange, printsRange, tax } from '@lancom/shared/assets/js/utils/filters';
|
|
203
|
-
import
|
|
102
|
+
import EditorPricingDetails from '@lancom/shared/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details';
|
|
204
103
|
|
|
205
104
|
export default {
|
|
206
105
|
name: 'EditorPricing',
|
|
@@ -211,7 +110,7 @@ export default {
|
|
|
211
110
|
printsRange
|
|
212
111
|
},
|
|
213
112
|
components: {
|
|
214
|
-
|
|
113
|
+
EditorPricingDetails
|
|
215
114
|
},
|
|
216
115
|
data() {
|
|
217
116
|
return {
|
|
@@ -237,25 +136,6 @@ export default {
|
|
|
237
136
|
return this.hasUsedSimpleProducts
|
|
238
137
|
? this.usedSimpleProducts
|
|
239
138
|
: [this.defaultSimpleProduct];
|
|
240
|
-
},
|
|
241
|
-
groupedProductsByPrice() {
|
|
242
|
-
return this.productPricing
|
|
243
|
-
? groupProductsSizesByPrice(
|
|
244
|
-
this.products,
|
|
245
|
-
this.productPricing.products
|
|
246
|
-
)
|
|
247
|
-
: [];
|
|
248
|
-
},
|
|
249
|
-
hasGroupedProductsByPrintsPrice() {
|
|
250
|
-
return this.groupedProductsByPrintsPrice.length > 0;
|
|
251
|
-
},
|
|
252
|
-
groupedProductsByPrintsPrice() {
|
|
253
|
-
return this.productPricing
|
|
254
|
-
? groupProductsPrintsByPrintArea(
|
|
255
|
-
this.products,
|
|
256
|
-
this.productPricing.products
|
|
257
|
-
)
|
|
258
|
-
: [];
|
|
259
139
|
}
|
|
260
140
|
},
|
|
261
141
|
watch: {
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricingDetails__wrapper">
|
|
3
|
+
<editor-pricing-details-products />
|
|
4
|
+
<editor-pricing-details-prints v-if="isPrintPricing" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { mapGetters } from 'vuex';
|
|
10
|
+
import EditorPricingDetailsProducts from './editor_pricing_details_products/editor-pricing-details-products';
|
|
11
|
+
import EditorPricingDetailsPrints from './editor_pricing_details_prints/editor-pricing-details-prints';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'EditorPricingDetails',
|
|
15
|
+
components: {
|
|
16
|
+
EditorPricingDetailsProducts,
|
|
17
|
+
EditorPricingDetailsPrints
|
|
18
|
+
},
|
|
19
|
+
computed: {
|
|
20
|
+
...mapGetters('product', [
|
|
21
|
+
'isPrintPricing'
|
|
22
|
+
])
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
@import 'editor-pricing-details';
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.EditorPricingDetailsPrints {
|
|
4
|
+
&__wrapper td {
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
border: 1px solid $gray;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
line-height: 25px;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
color: $black;
|
|
11
|
+
@media (max-width: $bp-extra-small-max) {
|
|
12
|
+
padding: 2px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
}
|
|
15
|
+
strong {
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
}
|
|
18
|
+
&.disabled {
|
|
19
|
+
color: $gray_main;
|
|
20
|
+
pointer-events: none !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&__th {
|
|
24
|
+
font-weight: bold !important;
|
|
25
|
+
background: $gray;
|
|
26
|
+
@media (max-width: $bp-extra-small-max) {
|
|
27
|
+
padding: 2px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
&__name {
|
|
32
|
+
width: 70px;
|
|
33
|
+
@media (max-width: $bp-extra-small-max) {
|
|
34
|
+
width: 30px;
|
|
35
|
+
}
|
|
36
|
+
span {
|
|
37
|
+
writing-mode: vertical-lr;
|
|
38
|
+
transform: rotate(180deg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricingDetailsPrints__wrapper">
|
|
3
|
+
<table class="lc_table EditorPricingDetailsPrints__table">
|
|
4
|
+
<tbody class="centered">
|
|
5
|
+
<tr>
|
|
6
|
+
<td
|
|
7
|
+
class="EditorPricingDetailsPrints__name"
|
|
8
|
+
:rowspan="groupedProductsByPrintArea.length + (hasPrintSurcharge ? 3 : 2)">
|
|
9
|
+
<span>printing</span>
|
|
10
|
+
</td>
|
|
11
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
12
|
+
type of print
|
|
13
|
+
</td>
|
|
14
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
15
|
+
location
|
|
16
|
+
</td>
|
|
17
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
18
|
+
Setup cost
|
|
19
|
+
</td>
|
|
20
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
21
|
+
Price
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr
|
|
25
|
+
v-for="([, group], index) in groupedProductsByPrintArea"
|
|
26
|
+
:key="index">
|
|
27
|
+
<td>
|
|
28
|
+
{{ group.printType.name }}
|
|
29
|
+
</td>
|
|
30
|
+
<td>
|
|
31
|
+
{{ group.printArea.name }}
|
|
32
|
+
</td>
|
|
33
|
+
<td>
|
|
34
|
+
<strong>
|
|
35
|
+
{{ group.setupPriceWithoutTax | priceWithTax(pricingSettings) }}
|
|
36
|
+
</strong>
|
|
37
|
+
</td>
|
|
38
|
+
<td>
|
|
39
|
+
<span v-if="group.costType !== 'setup only'">
|
|
40
|
+
<strong>
|
|
41
|
+
{{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price }}
|
|
42
|
+
</strong>
|
|
43
|
+
= {{ group.amount }} x {{ (displayPricingWithTax ? group.price : group.priceWithoutTax) | price }}
|
|
44
|
+
</span>
|
|
45
|
+
<strong v-else>
|
|
46
|
+
{{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price }}
|
|
47
|
+
</strong>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr v-if="hasPrintSurcharge">
|
|
51
|
+
<td colspan="4">
|
|
52
|
+
{{ printSurchargeNote }}
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="highlighted">
|
|
56
|
+
<td colspan="3">
|
|
57
|
+
Prints Subtotal:
|
|
58
|
+
</td>
|
|
59
|
+
<td>
|
|
60
|
+
<strong>
|
|
61
|
+
{{ (displayPricingWithTax ? productPricing.products.prints.totalPrice : productPricing.products.prints.totalPriceWithoutTax) | price }}
|
|
62
|
+
</strong>
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
65
|
+
</tbody>
|
|
66
|
+
</table>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
import { mapGetters } from 'vuex';
|
|
72
|
+
import { price, sizesRange, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
|
|
73
|
+
import { groupProductsPrintsByPrintArea } from '@lancom/shared/assets/js/utils/products-grouping';
|
|
74
|
+
|
|
75
|
+
export default {
|
|
76
|
+
name: 'EditorPricingDetailsPrints',
|
|
77
|
+
filters: {
|
|
78
|
+
price,
|
|
79
|
+
priceWithTax,
|
|
80
|
+
sizesRange
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
...mapGetters(['displayPricingWithTax', 'pricingSettings']),
|
|
84
|
+
...mapGetters('product', [
|
|
85
|
+
'product',
|
|
86
|
+
'usedSimpleProducts',
|
|
87
|
+
'productPricing',
|
|
88
|
+
'mainProductPricing'
|
|
89
|
+
]),
|
|
90
|
+
hasPrintSurcharge() {
|
|
91
|
+
return this.product.printSurcharge > 0;
|
|
92
|
+
},
|
|
93
|
+
printSurchargeNote() {
|
|
94
|
+
const message = this.product.printSurchargeNote || 'surcharge of $x per print';
|
|
95
|
+
return message.replace(/\$x/, price(this.product.printSurcharge));
|
|
96
|
+
},
|
|
97
|
+
hasUsedSimpleProducts() {
|
|
98
|
+
return this.usedSimpleProducts.length > 0;
|
|
99
|
+
},
|
|
100
|
+
products() {
|
|
101
|
+
return this.hasUsedSimpleProducts
|
|
102
|
+
? this.usedSimpleProducts
|
|
103
|
+
: [];
|
|
104
|
+
},
|
|
105
|
+
groupedProductsByPrintArea() {
|
|
106
|
+
const groups = this.mainProductPricing
|
|
107
|
+
? groupProductsPrintsByPrintArea(
|
|
108
|
+
this.mainProductPricing
|
|
109
|
+
)
|
|
110
|
+
: [];
|
|
111
|
+
return groups;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<style lang="scss" scoped>
|
|
118
|
+
@import 'editor-pricing-details-prints';
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.EditorPricingDetailsProducts {
|
|
4
|
+
&__wrapper td {
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
border: 1px solid $gray;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
line-height: 25px;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
color: $black;
|
|
11
|
+
@media (max-width: $bp-extra-small-max) {
|
|
12
|
+
padding: 2px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
}
|
|
15
|
+
strong {
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
}
|
|
18
|
+
&.disabled {
|
|
19
|
+
color: $gray_main;
|
|
20
|
+
pointer-events: none !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&__th {
|
|
24
|
+
font-weight: bold !important;
|
|
25
|
+
background: $gray;
|
|
26
|
+
@media (max-width: $bp-extra-small-max) {
|
|
27
|
+
padding: 2px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
&__name {
|
|
32
|
+
width: 70px;
|
|
33
|
+
@media (max-width: $bp-extra-small-max) {
|
|
34
|
+
width: 30px;
|
|
35
|
+
}
|
|
36
|
+
span {
|
|
37
|
+
writing-mode: vertical-lr;
|
|
38
|
+
transform: rotate(180deg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricingDetailsProducts__wrapper">
|
|
3
|
+
<table class="lc_table EditorPricingDetailsProducts__table">
|
|
4
|
+
<tbody class="centered">
|
|
5
|
+
<tr>
|
|
6
|
+
<td
|
|
7
|
+
class="EditorPricingDetailsProducts__name"
|
|
8
|
+
:rowspan="groupedProductsByPrice.length + 2">
|
|
9
|
+
<span>product</span>
|
|
10
|
+
</td>
|
|
11
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
12
|
+
Products
|
|
13
|
+
</td>
|
|
14
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
15
|
+
Sizes
|
|
16
|
+
</td>
|
|
17
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
18
|
+
Cost
|
|
19
|
+
</td>
|
|
20
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
21
|
+
Total Cost
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr
|
|
25
|
+
v-for="([groupPrice, group], index) in groupedProductsByPrice"
|
|
26
|
+
:key="index">
|
|
27
|
+
<td>
|
|
28
|
+
{{ group.amount }}
|
|
29
|
+
</td>
|
|
30
|
+
<td>
|
|
31
|
+
{{ group.sizes | sizesRange }}
|
|
32
|
+
</td>
|
|
33
|
+
<td>
|
|
34
|
+
<span class="EditorPricingDetailsProducts__hoverable">
|
|
35
|
+
{{ groupPrice | priceWithTax(pricingSettings) }}
|
|
36
|
+
</span>
|
|
37
|
+
</td>
|
|
38
|
+
<td>
|
|
39
|
+
<strong>
|
|
40
|
+
{{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price }}
|
|
41
|
+
</strong>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr class="highlighted">
|
|
45
|
+
<td colspan="3">
|
|
46
|
+
Products Subtotal:
|
|
47
|
+
</td>
|
|
48
|
+
<td>
|
|
49
|
+
<strong>
|
|
50
|
+
{{ (displayPricingWithTax ? productPricing.products.products.totalPrice : productPricing.products.products.totalPriceWithoutTax) | price }}
|
|
51
|
+
</strong>
|
|
52
|
+
</td>
|
|
53
|
+
</tr>
|
|
54
|
+
</tbody>
|
|
55
|
+
</table>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
import { mapGetters } from 'vuex';
|
|
61
|
+
import { price, sizesRange, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
|
|
62
|
+
import { groupProductsSizesByPrice } from '@lancom/shared/assets/js/utils/products-grouping';
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'EditorPricingDetailsProducts',
|
|
66
|
+
filters: {
|
|
67
|
+
price,
|
|
68
|
+
priceWithTax,
|
|
69
|
+
sizesRange
|
|
70
|
+
},
|
|
71
|
+
computed: {
|
|
72
|
+
...mapGetters(['displayPricingWithTax', 'pricingSettings']),
|
|
73
|
+
...mapGetters('product', [
|
|
74
|
+
'product',
|
|
75
|
+
'usedSimpleProducts',
|
|
76
|
+
'mainProductPricing',
|
|
77
|
+
'productPricing'
|
|
78
|
+
]),
|
|
79
|
+
hasUsedSimpleProducts() {
|
|
80
|
+
return this.usedSimpleProducts.length > 0;
|
|
81
|
+
},
|
|
82
|
+
products() {
|
|
83
|
+
return this.hasUsedSimpleProducts
|
|
84
|
+
? this.usedSimpleProducts
|
|
85
|
+
: [];
|
|
86
|
+
},
|
|
87
|
+
groupedProductsByPrice() {
|
|
88
|
+
return this.mainProductPricing
|
|
89
|
+
? groupProductsSizesByPrice(
|
|
90
|
+
this.products,
|
|
91
|
+
this.mainProductPricing
|
|
92
|
+
)
|
|
93
|
+
: [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="scss" scoped>
|
|
100
|
+
@import 'editor-pricing-details-products';
|
|
101
|
+
</style>
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
:key="index"
|
|
8
8
|
class="EditorPrintAreaOptions__option"
|
|
9
9
|
:class="{
|
|
10
|
-
'EditorPrintAreaOptions__option--no-print': !option.
|
|
10
|
+
'EditorPrintAreaOptions__option--no-print': !option.printArea
|
|
11
11
|
}">
|
|
12
12
|
<editor-print-area-option
|
|
13
13
|
:option="option"
|
|
14
14
|
:product="product"
|
|
15
15
|
:selected="
|
|
16
|
-
(option.
|
|
17
|
-
(option.suboptions && option.
|
|
16
|
+
(option.printArea && option.printArea._id === selected) ||
|
|
17
|
+
(option.suboptions && option.printArea && option.printArea._id === selected)
|
|
18
18
|
"
|
|
19
19
|
@select="select"
|
|
20
20
|
@option-mouseover="$emit('option-mouseover', $event)"
|
|
@@ -59,27 +59,28 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
watch: {
|
|
61
61
|
side() {
|
|
62
|
-
this.
|
|
62
|
+
this.updateOptions();
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
mounted() {
|
|
66
|
-
this.
|
|
66
|
+
this.updateOptions();
|
|
67
67
|
},
|
|
68
68
|
methods: {
|
|
69
|
-
|
|
70
|
-
const
|
|
69
|
+
updateOptions() {
|
|
70
|
+
const productsOptions = this.getProductOptions();
|
|
71
|
+
const options = productsOptions.filter(({ sides }) => sides.includes(this.side));
|
|
71
72
|
this.options = this.allowNoPrint ? [...options, { label: 'No Print' }] : options;
|
|
72
73
|
},
|
|
73
|
-
select(
|
|
74
|
-
this.$emit('select',
|
|
74
|
+
select(option) {
|
|
75
|
+
this.$emit('select', option);
|
|
75
76
|
},
|
|
76
77
|
getProductOptions() {
|
|
77
|
-
const groupItemToOption =
|
|
78
|
-
return (this.product.
|
|
79
|
-
.map(
|
|
80
|
-
...groupItemToOption(
|
|
81
|
-
sides:
|
|
82
|
-
suboptions: (
|
|
78
|
+
const groupItemToOption = printArea => ({ printArea, label: printArea.name, size: printArea.printSize.alias });
|
|
79
|
+
return (this.product.printAreas || [])
|
|
80
|
+
.map(printArea => ({
|
|
81
|
+
...groupItemToOption(printArea),
|
|
82
|
+
sides: [printArea.side],
|
|
83
|
+
suboptions: (printArea.sizes || []).map(i => ({ ...groupItemToOption(i), sides: [printArea.side] }))
|
|
83
84
|
}));
|
|
84
85
|
}
|
|
85
86
|
}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
{{ option.label }}
|
|
11
11
|
</div>
|
|
12
12
|
<div class="lc_regular10">
|
|
13
|
-
<span v-if="option.
|
|
14
|
-
{{ calcPrintPrice(option) |
|
|
13
|
+
<span v-if="option.printArea && calcPrintPrice(option) > 0">
|
|
14
|
+
{{ calcPrintPrice(option) | priceWithTax(pricingSettings) }}
|
|
15
15
|
</span>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
@@ -36,14 +36,13 @@
|
|
|
36
36
|
|
|
37
37
|
<script>
|
|
38
38
|
import { mapGetters } from 'vuex';
|
|
39
|
-
import {
|
|
39
|
+
import { priceWithTax, priceInRange } from '@lancom/shared/assets/js/utils/filters';
|
|
40
40
|
import { getProductPrintsAreasPrices } from '@lancom/shared/assets/js/models/print-area';
|
|
41
41
|
|
|
42
42
|
export default {
|
|
43
43
|
name: 'EditorPrintAreaOption',
|
|
44
44
|
filters: {
|
|
45
|
-
|
|
46
|
-
tax
|
|
45
|
+
priceWithTax
|
|
47
46
|
},
|
|
48
47
|
props: {
|
|
49
48
|
product: {
|
|
@@ -66,13 +65,14 @@ export default {
|
|
|
66
65
|
},
|
|
67
66
|
computed: {
|
|
68
67
|
...mapGetters([
|
|
69
|
-
'
|
|
68
|
+
'pricingSettings'
|
|
70
69
|
]),
|
|
71
70
|
...mapGetters('product', [
|
|
72
|
-
'usedSimpleProducts'
|
|
71
|
+
'usedSimpleProducts',
|
|
72
|
+
'selectedPrintType'
|
|
73
73
|
]),
|
|
74
74
|
printsPricing() {
|
|
75
|
-
return getProductPrintsAreasPrices(this.product);
|
|
75
|
+
return getProductPrintsAreasPrices(this.product, this.selectedPrintType);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
methods: {
|
|
@@ -80,16 +80,16 @@ export default {
|
|
|
80
80
|
if (this.option.suboptions && this.option.suboptions.length) {
|
|
81
81
|
this.showOptions = !this.showOptions;
|
|
82
82
|
} else {
|
|
83
|
-
this.$emit('select', this.option
|
|
83
|
+
this.$emit('select', this.option);
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
selectSuboption(
|
|
86
|
+
selectSuboption(option) {
|
|
87
87
|
this.closeSuboptions();
|
|
88
|
-
this.$emit('select',
|
|
88
|
+
this.$emit('select', option);
|
|
89
89
|
},
|
|
90
90
|
calcPrintPrice(option) {
|
|
91
91
|
const amount = this.usedSimpleProducts.reduce((amount, product) => product.amount + amount, 0);
|
|
92
|
-
return priceInRange(this.printsPricing[option.
|
|
92
|
+
return option.printArea ? priceInRange(this.printsPricing[option.printArea._id], amount || 1) : null;
|
|
93
93
|
},
|
|
94
94
|
closeSuboptions() {
|
|
95
95
|
this.showOptions = false;
|