@lancom/shared 0.0.456 → 0.0.458
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 +12 -0
- package/components/products/products_aside/products-aside.vue +5 -0
- package/components/products/products_color_groups/products-color-groups.scss +69 -0
- package/components/products/products_color_groups/products-color-groups.vue +101 -0
- package/components/products/products_link/products-link.vue +4 -0
- package/components/quotes/quote_view/quote-view.scss +76 -22
- package/components/quotes/quote_view/quote-view.vue +79 -91
- package/components/quotes/quote_view/quote_option_view/quote-option-view.scss +103 -4
- package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +202 -26
- package/components/quotes/quote_view/quote_view_accept/quote-view-accept.scss +33 -0
- package/components/quotes/quote_view/quote_view_accept/quote-view-accept.vue +85 -0
- package/components/quotes/quote_view/quote_view_address_form/quote-view-address-form.scss +17 -0
- package/components/quotes/quote_view/quote_view_address_form/quote-view-address-form.vue +259 -0
- package/components/quotes/quote_view/quote_view_banner/quote-view-banner.scss +67 -0
- package/components/quotes/quote_view/quote_view_banner/quote-view-banner.vue +69 -0
- package/components/quotes/quote_view/quote_view_billing_information/quote-view-billing-information.scss +5 -0
- package/components/quotes/quote_view/quote_view_billing_information/quote-view-billing-information.vue +108 -0
- package/components/quotes/quote_view/quote_view_header/quote-view-header.scss +65 -0
- package/components/quotes/quote_view/quote_view_header/quote-view-header.vue +69 -0
- package/components/quotes/quote_view/quote_view_info/quote-view-info.scss +36 -0
- package/components/quotes/quote_view/quote_view_info/quote-view-info.vue +42 -0
- package/components/quotes/quote_view/quote_view_invalid_stock_modal/quote-view-invalid-stock-modal.scss +17 -0
- package/components/quotes/quote_view/quote_view_invalid_stock_modal/quote-view-invalid-stock-modal.vue +29 -0
- package/components/quotes/quote_view/quote_view_menu/quote-view-menu.scss +74 -0
- package/components/quotes/quote_view/quote_view_menu/quote-view-menu.vue +102 -0
- package/components/quotes/quote_view/quote_view_message/quote-view-message.scss +53 -0
- package/components/quotes/quote_view/quote_view_message/quote-view-message.vue +40 -0
- package/components/quotes/quote_view/quote_view_mobile_menu/quote-view-mobile-menu.scss +1 -0
- package/components/quotes/quote_view/quote_view_mobile_menu/quote-view-mobile-menu.vue +23 -0
- package/components/quotes/quote_view/quote_view_payment/quote-view-payment.scss +58 -0
- package/components/quotes/quote_view/quote_view_payment/quote-view-payment.vue +191 -0
- package/components/quotes/quote_view/quote_view_payment/quote_payment_success/quote-payment-success.scss +40 -0
- package/components/quotes/quote_view/quote_view_payment/quote_payment_success/quote-payment-success.vue +50 -0
- package/components/quotes/quote_view/quote_view_payment_modal/quote-view-payment-modal.scss +10 -0
- package/components/quotes/quote_view/quote_view_payment_modal/quote-view-payment-modal.vue +49 -0
- package/components/quotes/quote_view/quote_view_print/quote-view-print.scss +54 -0
- package/components/quotes/quote_view/quote_view_print/quote-view-print.vue +74 -0
- package/components/quotes/quote_view/quote_view_question/quote-view-question.scss +84 -0
- package/components/quotes/quote_view/quote_view_question/quote-view-question.vue +203 -0
- package/components/quotes/quote_view/quote_view_questions/quote-view-questions.scss +39 -0
- package/components/quotes/quote_view/quote_view_questions/quote-view-questions.vue +50 -0
- package/components/quotes/quote_view_preview/quote-view.scss +29 -0
- package/components/quotes/quote_view_preview/quote-view.vue +121 -0
- package/components/quotes/quote_view_preview/quote_option_view/quote-option-view.scss +10 -0
- package/components/quotes/quote_view_preview/quote_option_view/quote-option-view.vue +73 -0
- package/package.json +1 -1
- package/pages/quotes/view/_id/option/_option.vue +1 -1
- package/plugins/crisp.js +13 -0
- package/store/products.js +11 -2
- /package/components/quotes/{quote_view → quote_view_preview}/quote-view.mixin.js +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_color_simple_products/quote-product-color-simple-products.mixin.js +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_color_simple_products/quote-product-color-simple-products.scss +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_color_simple_products/quote-product-color-simple-products.vue +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.scss +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.vue +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_prints/quote-product-prints.scss +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_prints/quote-product-prints.vue +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_prints/quote_product_print/quote-product-print.scss +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_product_prints/quote_product_print/quote-product-print.vue +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_view_product/quote-view-product.scss +0 -0
- /package/components/quotes/{quote_view → quote_view_preview}/quote_view_product/quote-view-product.vue +0 -0
|
@@ -1,48 +1,118 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
:id="`option-${option._id}`"
|
|
4
|
+
class="QuoteOptionView__wrapper"
|
|
5
|
+
:class="{ light: (!isSelected && proceedOption) }">
|
|
6
|
+
<div
|
|
7
|
+
class="QuoteOptionView__header"
|
|
8
|
+
:class="{ disabled: !isValidTotalQty }"
|
|
9
|
+
@click="toggleOption()">
|
|
10
|
+
<div class="QuoteOptionView__title">
|
|
11
|
+
<b>Option {{ option.index }}</b> - {{ option.name }}
|
|
12
|
+
<span v-if="viewedOptionsMap && !viewedOptionsMap[option._id]">NEW</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="QuoteOptionView__proceed">
|
|
15
|
+
<CheckedIcon
|
|
16
|
+
:checked="isSelected"
|
|
17
|
+
:circle="false" />
|
|
18
|
+
<span class="QuoteOptionView__proceed-message">
|
|
19
|
+
proceed with Option {{ option.index }}
|
|
20
|
+
</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
v-if="pricingError"
|
|
25
|
+
class="text-danger mb-3">
|
|
26
|
+
{{ pricingError }}
|
|
27
|
+
</div>
|
|
28
|
+
<div class="QuoteOptionView__table lc_table">
|
|
4
29
|
<quote-view-product
|
|
5
30
|
v-for="product of option.products"
|
|
6
31
|
:key="product._id"
|
|
7
32
|
:product="product"
|
|
33
|
+
:pricing="pricing"
|
|
34
|
+
:option="option"
|
|
35
|
+
:with-divider="false"
|
|
36
|
+
@change="updateQuotePricing()"
|
|
8
37
|
class="QuoteOptionView__product" />
|
|
9
38
|
</div>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
39
|
+
<div
|
|
40
|
+
class="QuoteOptionView__subtotal"
|
|
41
|
+
:class="{ selected: isSelected }">
|
|
42
|
+
<div class="QuoteOptionView__subtotal-item">
|
|
43
|
+
<div class="QuoteOptionView__subtotal-label">
|
|
44
|
+
Product cost:
|
|
45
|
+
</div>
|
|
46
|
+
<div class="QuoteOptionView__subtotal-value">
|
|
47
|
+
{{ productsTotal | price }}
|
|
48
|
+
</div>
|
|
13
49
|
</div>
|
|
14
|
-
<div class="
|
|
15
|
-
|
|
50
|
+
<div class="QuoteOptionView__subtotal-item">
|
|
51
|
+
<div class="QuoteOptionView__subtotal-label">
|
|
52
|
+
Print cost:
|
|
53
|
+
</div>
|
|
54
|
+
<div class="QuoteOptionView__subtotal-value">
|
|
55
|
+
{{ option.printsTotal | price }}
|
|
56
|
+
</div>
|
|
16
57
|
</div>
|
|
17
|
-
<div class="
|
|
18
|
-
|
|
58
|
+
<div class="QuoteOptionView__subtotal-item">
|
|
59
|
+
<div class="QuoteOptionView__subtotal-label">
|
|
60
|
+
Other cost:
|
|
61
|
+
</div>
|
|
62
|
+
<div class="QuoteOptionView__subtotal-value">
|
|
63
|
+
{{ customProductsTotal | price }}
|
|
64
|
+
</div>
|
|
19
65
|
</div>
|
|
20
|
-
<div class="
|
|
21
|
-
|
|
66
|
+
<div class="QuoteOptionView__subtotal-item">
|
|
67
|
+
<div class="QuoteOptionView__subtotal-label">
|
|
68
|
+
SUBTOTAL:
|
|
69
|
+
</div>
|
|
70
|
+
<div class="QuoteOptionView__subtotal-value">
|
|
71
|
+
{{ (option.productsTotal + option.printsTotal) | price }} + GST
|
|
72
|
+
</div>
|
|
22
73
|
</div>
|
|
23
|
-
<div class="
|
|
24
|
-
|
|
74
|
+
<div class="QuoteOptionView__subtotal-item">
|
|
75
|
+
<div class="QuoteOptionView__subtotal-label">
|
|
76
|
+
Shipping:
|
|
77
|
+
</div>
|
|
78
|
+
<div class="QuoteOptionView__subtotal-value">
|
|
79
|
+
{{ option.shippingTotal | price }} + GST
|
|
80
|
+
</div>
|
|
25
81
|
</div>
|
|
26
|
-
<div class="
|
|
27
|
-
|
|
82
|
+
<div class="QuoteOptionView__subtotal-item">
|
|
83
|
+
<div class="QuoteOptionView__subtotal-label">
|
|
84
|
+
TOTAL INC. GST:
|
|
85
|
+
</div>
|
|
86
|
+
<div class="QuoteOptionView__subtotal-value">
|
|
87
|
+
{{ option.totalGST | price }}
|
|
88
|
+
</div>
|
|
28
89
|
</div>
|
|
29
90
|
</div>
|
|
91
|
+
<div
|
|
92
|
+
v-if="option.message"
|
|
93
|
+
class="QuoteOptionView__message">
|
|
94
|
+
<rich-text :text="option.message" />
|
|
95
|
+
</div>
|
|
30
96
|
</div>
|
|
31
97
|
</template>
|
|
32
98
|
|
|
33
99
|
<script>
|
|
34
|
-
import { mapGetters } from 'vuex';
|
|
35
|
-
import
|
|
36
|
-
import
|
|
100
|
+
import { mapGetters, mapActions } from 'vuex';
|
|
101
|
+
import api from '@lancom/shared/assets/js/api';
|
|
102
|
+
import RichText from '@lancom/shared/components/common/rich-text';
|
|
103
|
+
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
104
|
+
import QuoteViewProduct from '@lancom/shared/components/quotes/quote_view_preview/quote_view_product/quote-view-product';
|
|
105
|
+
import CheckedIcon from '@lancom/shared/components/common/checked-icon';
|
|
37
106
|
|
|
38
107
|
export default {
|
|
39
108
|
name: 'LancomQuoteOptionView',
|
|
40
109
|
filters: {
|
|
41
|
-
tax,
|
|
42
110
|
price
|
|
43
111
|
},
|
|
44
112
|
components: {
|
|
45
|
-
QuoteViewProduct
|
|
113
|
+
QuoteViewProduct,
|
|
114
|
+
CheckedIcon,
|
|
115
|
+
RichText
|
|
46
116
|
},
|
|
47
117
|
props: {
|
|
48
118
|
quote: {
|
|
@@ -54,15 +124,121 @@ export default {
|
|
|
54
124
|
require: true
|
|
55
125
|
}
|
|
56
126
|
},
|
|
127
|
+
data() {
|
|
128
|
+
return {
|
|
129
|
+
pricing: null,
|
|
130
|
+
pricingError: null
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
watch: {
|
|
134
|
+
pricing() {
|
|
135
|
+
this.option.total = this.pricing?.totalPriceWithoutTax || 0;
|
|
136
|
+
this.option.totalGST = this.pricing?.totalPrice || 0;
|
|
137
|
+
this.option.productsTotal = this.pricing?.products?.products?.totalPriceWithoutTax || 0;
|
|
138
|
+
this.option.printsTotal = this.pricing?.products?.prints?.totalPriceWithoutTax || 0;
|
|
139
|
+
this.updateShippingTotal();
|
|
140
|
+
}
|
|
141
|
+
},
|
|
57
142
|
computed: {
|
|
58
|
-
...mapGetters([
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
143
|
+
...mapGetters(['gstTax']),
|
|
144
|
+
...mapGetters('quote', ['proceedOption', 'viewedOptionsMap']),
|
|
145
|
+
isValidTotalQty() {
|
|
146
|
+
return !this.option.products?.some(product => {
|
|
147
|
+
const amount = product.simpleProducts?.reduce((sum, { amount }) => sum + (+amount || 0), 0);
|
|
148
|
+
return product.totalAmount > 0 && product.totalAmount !== amount;
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
defaultShippingTotal() {
|
|
152
|
+
return this.pricing?.shipping?.totalPriceWithoutTax || 0;
|
|
153
|
+
},
|
|
154
|
+
suppliersWithRates() {
|
|
155
|
+
return this.option.suppliersWithRates || [];
|
|
156
|
+
},
|
|
157
|
+
isSelected() {
|
|
158
|
+
return this.proceedOption === this.option;
|
|
159
|
+
},
|
|
160
|
+
customProductsTotal() {
|
|
161
|
+
return (this.option.products || []).reduce((total, { isCustom, simpleProducts }) => {
|
|
162
|
+
if (isCustom) {
|
|
163
|
+
const { amount, productCost } = simpleProducts[0] || {};
|
|
164
|
+
const price = simpleProducts[0] ? (+amount || 0) * (+productCost || 0) : 0;
|
|
165
|
+
return total + price;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return total;
|
|
169
|
+
}, 0);
|
|
170
|
+
},
|
|
171
|
+
productsTotal() {
|
|
172
|
+
return +this.option.productsTotal - this.customProductsTotal;
|
|
173
|
+
}
|
|
62
174
|
},
|
|
63
175
|
methods: {
|
|
64
|
-
|
|
65
|
-
|
|
176
|
+
...mapActions('quote', ['selectOption']),
|
|
177
|
+
toggleOption() {
|
|
178
|
+
const option = this.isSelected ? null : this.option;
|
|
179
|
+
this.selectOption({ option });
|
|
180
|
+
},
|
|
181
|
+
updateShippingTotal() {
|
|
182
|
+
this.option.shippingTotal = typeof this.option.adminShippingTotal === 'number' ? this.option.adminShippingTotal : this.defaultShippingTotal;
|
|
183
|
+
},
|
|
184
|
+
async updateQuotePricing() {
|
|
185
|
+
try {
|
|
186
|
+
await this.calculateQuotePricing();
|
|
187
|
+
} catch (e) {
|
|
188
|
+
console.log(e);
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
async calculateQuotePricing(includeSuppliersWithRates) {
|
|
192
|
+
console.log('calculateQuotePricing...', includeSuppliersWithRates);
|
|
193
|
+
const { address, shop, country, currency } = this.quote;
|
|
194
|
+
const { products, adminShippingTotal } = this.option;
|
|
195
|
+
const payload = {
|
|
196
|
+
entities: (products || []).map(p => ({
|
|
197
|
+
_id: p._id,
|
|
198
|
+
brand: p.product?.brand,
|
|
199
|
+
prints: [
|
|
200
|
+
...p.prints
|
|
201
|
+
].map(print => ({
|
|
202
|
+
...print,
|
|
203
|
+
printCost: [{ min: 0, price: +(print.printCost || 0) }],
|
|
204
|
+
setupCost: +(print.setupCost || 0)
|
|
205
|
+
})),
|
|
206
|
+
printSurcharge: p.printSurcharge || 0,
|
|
207
|
+
simpleProducts: (p.simpleProducts || []).reduce((list, sp) => {
|
|
208
|
+
if (sp.amount > 0) {
|
|
209
|
+
list.push({
|
|
210
|
+
guid: sp.guid,
|
|
211
|
+
amount: sp.amount,
|
|
212
|
+
weight: p.product?.weight,
|
|
213
|
+
volume: p.product?.volume,
|
|
214
|
+
pricing: sp.productCost ? [{ min: 0, price: +(sp.productCost || 0) }] : sp.pricing,
|
|
215
|
+
unprintedPricing: sp.productCost ? [{ min: 0, price: +(sp.productCost || 0) }] : sp.unprintedPricing
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
return list;
|
|
219
|
+
}, [])
|
|
220
|
+
})),
|
|
221
|
+
postcode: address?.postcode,
|
|
222
|
+
adminShippingTotal,
|
|
223
|
+
suppliersWithRates: includeSuppliersWithRates ? this.suppliersWithRates : null,
|
|
224
|
+
selectedSuppliersWithRates: this.suppliersWithRates,
|
|
225
|
+
country: country?._id || country,
|
|
226
|
+
currency: currency?._id || currency
|
|
227
|
+
};
|
|
228
|
+
if (shop) {
|
|
229
|
+
try {
|
|
230
|
+
const pricing = await api.calculateProductPrice(payload, shop._id || shop);
|
|
231
|
+
this.pricing = pricing;
|
|
232
|
+
this.$set(this.option, 'suppliersWithRates', pricing.shipping?.suppliersWithRates || []);
|
|
233
|
+
this.pricingError = null;
|
|
234
|
+
} catch (e) {
|
|
235
|
+
this.pricing = null;
|
|
236
|
+
this.pricingError = e.response?.data?.error;
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
this.pricing = null;
|
|
240
|
+
this.pricingError = null;
|
|
241
|
+
}
|
|
66
242
|
}
|
|
67
243
|
}
|
|
68
244
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.QuoteViewAccept {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
padding: 20px !important;
|
|
6
|
+
background-color: $black;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
align-items: center;
|
|
10
|
+
@media (max-width: $bp-extra-small-max) {
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
::v-deep {
|
|
14
|
+
.Checkbox__label:before {
|
|
15
|
+
background-color: $white;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&__message {
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
line-height: 19px;
|
|
23
|
+
color: $gray;
|
|
24
|
+
text-transform: none;
|
|
25
|
+
position: relative;
|
|
26
|
+
top: 3px;
|
|
27
|
+
left: -5px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
a {
|
|
30
|
+
color: $gray;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="QuoteViewAccept__wrapper">
|
|
3
|
+
<div>
|
|
4
|
+
<label class="form-label">
|
|
5
|
+
<checkbox v-model="accept" />
|
|
6
|
+
<span class="QuoteViewAccept__message">
|
|
7
|
+
I accept the <a href="/info/terms-of-service" target="_blank">terms and conditions</a>.
|
|
8
|
+
</span>
|
|
9
|
+
</label>
|
|
10
|
+
</div>
|
|
11
|
+
<div>
|
|
12
|
+
<btn
|
|
13
|
+
:btn-disabled="!accept || !proceedOption || !isValidProceedOptionQty"
|
|
14
|
+
btn-class="green"
|
|
15
|
+
btn-label="ACCEPT"
|
|
16
|
+
@onclick="showQuotePaymentModal" />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import { mapGetters } from 'vuex';
|
|
23
|
+
import QuoteViewPaymentModal from './../quote_view_payment_modal/quote-view-payment-modal';
|
|
24
|
+
import QuoteViewInvalidStockModal from './../quote_view_invalid_stock_modal/quote-view-invalid-stock-modal';
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'QuoteViewAccept',
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
accept: false
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
computed: {
|
|
34
|
+
...mapGetters('quote', ['quote', 'proceedOption', 'proceedOptionNotValidStock']),
|
|
35
|
+
isValidProceedOptionQty() {
|
|
36
|
+
return !this.proceedOption?.products?.some(product => {
|
|
37
|
+
const amount = product.simpleProducts?.reduce((sum, { amount }) => sum + (+amount || 0), 0);
|
|
38
|
+
return product.totalAmount > 0 && product.totalAmount !== amount;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
mounted() {
|
|
43
|
+
if (this.$route.query.checkPayment) {
|
|
44
|
+
this.showQuotePaymentModal(true);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
showQuotePaymentModal(skipCheckStock) {
|
|
49
|
+
if (!skipCheckStock && this.proceedOptionNotValidStock && !this.quote.ignoreStockAvailability) {
|
|
50
|
+
return this.showQuoteNotValidStockModal();
|
|
51
|
+
}
|
|
52
|
+
const params = {
|
|
53
|
+
name: 'quote-payment',
|
|
54
|
+
root: this.$root,
|
|
55
|
+
width: 700,
|
|
56
|
+
height: 'auto',
|
|
57
|
+
adaptive: true,
|
|
58
|
+
// clickToClose: true,
|
|
59
|
+
transition: 'from-right-to-left'
|
|
60
|
+
};
|
|
61
|
+
this.$modal.show(QuoteViewPaymentModal, null, params, {
|
|
62
|
+
ok() {
|
|
63
|
+
this.$router.push('/');
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
showQuoteNotValidStockModal() {
|
|
68
|
+
const params = {
|
|
69
|
+
name: 'quote-invalid-stock',
|
|
70
|
+
root: this.$root,
|
|
71
|
+
width: 700,
|
|
72
|
+
height: 'auto',
|
|
73
|
+
adaptive: true,
|
|
74
|
+
clickToClose: true,
|
|
75
|
+
transition: 'from-right-to-left'
|
|
76
|
+
};
|
|
77
|
+
this.$modal.show(QuoteViewInvalidStockModal, null, params);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style lang="scss" scoped>
|
|
84
|
+
@import 'quote-view-accept.scss';
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.form-row--cols {
|
|
4
|
+
@media (max-width: $bp-extra-small-max) {
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
}
|
|
7
|
+
.col-half {
|
|
8
|
+
@media (max-width: $bp-extra-small-max) {
|
|
9
|
+
flex-basis: 100%;
|
|
10
|
+
width: 100%;
|
|
11
|
+
margin-left: 0 !important;
|
|
12
|
+
&:nth-child(2) {
|
|
13
|
+
margin-top: 20px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="QuoteAddressForm__wrapper">
|
|
3
|
+
<div class="QuoteAddressForm__form">
|
|
4
|
+
<validation-observer
|
|
5
|
+
ref="form"
|
|
6
|
+
class="Subscribe__form-observer">
|
|
7
|
+
<div class="form-row--cols">
|
|
8
|
+
<validation-provider
|
|
9
|
+
v-slot="{ errors }"
|
|
10
|
+
tag="div"
|
|
11
|
+
name="Full Name"
|
|
12
|
+
rules="required"
|
|
13
|
+
class="form-col col-half">
|
|
14
|
+
<label
|
|
15
|
+
for="fullName"
|
|
16
|
+
class="form-label">
|
|
17
|
+
Full Name
|
|
18
|
+
</label>
|
|
19
|
+
<input
|
|
20
|
+
id="fullName"
|
|
21
|
+
ref="fullName"
|
|
22
|
+
v-model="address.fullName"
|
|
23
|
+
placeholder="Full Name"
|
|
24
|
+
name="fullName"
|
|
25
|
+
type="text"
|
|
26
|
+
class="form-field labelless"
|
|
27
|
+
:class="{
|
|
28
|
+
'is-danger': errors.length,
|
|
29
|
+
filled: address.fullName
|
|
30
|
+
}"
|
|
31
|
+
@keyup.enter="$refs.phone.focus()" />
|
|
32
|
+
<span
|
|
33
|
+
v-if="errors.length"
|
|
34
|
+
class="form-help is-danger">
|
|
35
|
+
{{ errors[0] }}
|
|
36
|
+
</span>
|
|
37
|
+
</validation-provider>
|
|
38
|
+
<validation-provider
|
|
39
|
+
v-slot="{ errors }"
|
|
40
|
+
tag="div"
|
|
41
|
+
name="company"
|
|
42
|
+
class="form-col col-half">
|
|
43
|
+
<label
|
|
44
|
+
for="company"
|
|
45
|
+
class="form-label">
|
|
46
|
+
Company Name
|
|
47
|
+
</label>
|
|
48
|
+
<input
|
|
49
|
+
id="company"
|
|
50
|
+
ref="company"
|
|
51
|
+
v-model="address.company"
|
|
52
|
+
placeholder="Company Name"
|
|
53
|
+
name="company"
|
|
54
|
+
type="text"
|
|
55
|
+
class="form-field labelless"
|
|
56
|
+
:class="{
|
|
57
|
+
'is-danger': errors.length,
|
|
58
|
+
filled: address.company
|
|
59
|
+
}"
|
|
60
|
+
@keyup.enter="$refs.company.focus()" />
|
|
61
|
+
<span
|
|
62
|
+
v-if="errors.length"
|
|
63
|
+
class="form-help is-danger">
|
|
64
|
+
{{ errors[0] }}
|
|
65
|
+
</span>
|
|
66
|
+
</validation-provider>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="form-row--cols">
|
|
69
|
+
<validation-provider
|
|
70
|
+
v-slot="{ errors }"
|
|
71
|
+
tag="div"
|
|
72
|
+
name="email"
|
|
73
|
+
rules="required|email"
|
|
74
|
+
class="form-col col-half">
|
|
75
|
+
<label
|
|
76
|
+
for="email"
|
|
77
|
+
class="form-label">
|
|
78
|
+
Email
|
|
79
|
+
</label>
|
|
80
|
+
<input
|
|
81
|
+
id="email"
|
|
82
|
+
ref="email"
|
|
83
|
+
v-model="address.email"
|
|
84
|
+
placeholder="Email"
|
|
85
|
+
name="email"
|
|
86
|
+
type="email"
|
|
87
|
+
class="form-field labelless"
|
|
88
|
+
:class="{
|
|
89
|
+
'is-danger': errors.length,
|
|
90
|
+
filled: address.email
|
|
91
|
+
}"
|
|
92
|
+
@keyup.enter="$refs.email.focus()" />
|
|
93
|
+
<span
|
|
94
|
+
v-if="errors.length"
|
|
95
|
+
class="form-help is-danger">
|
|
96
|
+
{{ errors[0] }}
|
|
97
|
+
</span>
|
|
98
|
+
</validation-provider>
|
|
99
|
+
<phone-input :item="address" class="form-col col-half" />
|
|
100
|
+
</div>
|
|
101
|
+
<validation-provider
|
|
102
|
+
v-slot="{ errors }"
|
|
103
|
+
tag="div"
|
|
104
|
+
name="Address line 1"
|
|
105
|
+
rules="required"
|
|
106
|
+
class="form-row">
|
|
107
|
+
<label
|
|
108
|
+
for="addressLine1"
|
|
109
|
+
class="form-label">
|
|
110
|
+
Address line 1
|
|
111
|
+
</label>
|
|
112
|
+
<input
|
|
113
|
+
id="addressLine1"
|
|
114
|
+
ref="addressLine1"
|
|
115
|
+
v-model="address.addressLine1"
|
|
116
|
+
name="addressLine1"
|
|
117
|
+
type="text"
|
|
118
|
+
class="form-field labelless"
|
|
119
|
+
placeholder="Address line 1"
|
|
120
|
+
:class="{
|
|
121
|
+
'is-danger': errors.length,
|
|
122
|
+
filled: address.addressLine1
|
|
123
|
+
}"
|
|
124
|
+
@keyup.enter="$refs.addressLine1.focus()" />
|
|
125
|
+
<span
|
|
126
|
+
v-if="errors.length"
|
|
127
|
+
class="form-help is-danger">
|
|
128
|
+
{{ errors[0] }}
|
|
129
|
+
</span>
|
|
130
|
+
</validation-provider>
|
|
131
|
+
<validation-provider
|
|
132
|
+
v-slot="{ errors }"
|
|
133
|
+
tag="div"
|
|
134
|
+
name="Address line 2"
|
|
135
|
+
class="form-row">
|
|
136
|
+
<label
|
|
137
|
+
for="addressLine2"
|
|
138
|
+
class="form-label">
|
|
139
|
+
Address line 2
|
|
140
|
+
</label>
|
|
141
|
+
<input
|
|
142
|
+
id="addressLine2"
|
|
143
|
+
ref="addressLine2"
|
|
144
|
+
v-model="address.addressLine2"
|
|
145
|
+
name="addressLine2"
|
|
146
|
+
type="text"
|
|
147
|
+
class="form-field labelless"
|
|
148
|
+
placeholder="Address line 2"
|
|
149
|
+
:class="{
|
|
150
|
+
'is-danger': errors.length,
|
|
151
|
+
filled: address.addressLine2
|
|
152
|
+
}"
|
|
153
|
+
@keyup.enter="$refs.addressLine2.focus()" />
|
|
154
|
+
<span
|
|
155
|
+
v-if="errors.length"
|
|
156
|
+
class="form-help is-danger">
|
|
157
|
+
{{ errors[0] }}
|
|
158
|
+
</span>
|
|
159
|
+
</validation-provider>
|
|
160
|
+
<div class="form-row--cols mb-1">
|
|
161
|
+
<postcode-select
|
|
162
|
+
class="form-col col-half mb-1"
|
|
163
|
+
:suburb="address"
|
|
164
|
+
:disabled="true"
|
|
165
|
+
:labelless="true"
|
|
166
|
+
placeholder="Suburb">
|
|
167
|
+
</postcode-select>
|
|
168
|
+
<div class="form-col mb-1 col-half">
|
|
169
|
+
<label
|
|
170
|
+
for="country"
|
|
171
|
+
class="form-label">
|
|
172
|
+
Country
|
|
173
|
+
</label>
|
|
174
|
+
<input
|
|
175
|
+
id="country"
|
|
176
|
+
ref="country"
|
|
177
|
+
value="Only Australia"
|
|
178
|
+
name="country"
|
|
179
|
+
type="country"
|
|
180
|
+
class="form-field filled labelless"
|
|
181
|
+
disabled />
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
<validation-provider
|
|
185
|
+
v-slot="{ errors }"
|
|
186
|
+
tag="div"
|
|
187
|
+
name="additionalInfo"
|
|
188
|
+
class="form-row">
|
|
189
|
+
<label
|
|
190
|
+
for="additionalInfo"
|
|
191
|
+
class="form-label">
|
|
192
|
+
Additional Info
|
|
193
|
+
</label>
|
|
194
|
+
<input
|
|
195
|
+
id="additionalInfo"
|
|
196
|
+
ref="additionalInfo"
|
|
197
|
+
v-model="address.additionalInfo"
|
|
198
|
+
name="additionalInfo"
|
|
199
|
+
placeholder="Additional Info"
|
|
200
|
+
type="text"
|
|
201
|
+
class="form-field labelless"
|
|
202
|
+
:class="{
|
|
203
|
+
'is-danger': errors.length,
|
|
204
|
+
filled: address.additionalInfo
|
|
205
|
+
}"
|
|
206
|
+
@keyup.enter="$refs.additionalInfo.focus()" />
|
|
207
|
+
<span
|
|
208
|
+
v-if="errors.length"
|
|
209
|
+
class="form-help is-danger">
|
|
210
|
+
{{ errors[0] }}
|
|
211
|
+
</span>
|
|
212
|
+
</validation-provider>
|
|
213
|
+
<div style="margin-top: 30px;">
|
|
214
|
+
<btn
|
|
215
|
+
:btn-block="true"
|
|
216
|
+
btn-class="green"
|
|
217
|
+
btn-label="NEXT"
|
|
218
|
+
@onclick="goToPayment">
|
|
219
|
+
<i
|
|
220
|
+
slot="icon-after"
|
|
221
|
+
class="icon-arrow-right"></i>
|
|
222
|
+
</btn>
|
|
223
|
+
</div>
|
|
224
|
+
</validation-observer>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</template>
|
|
228
|
+
|
|
229
|
+
<script>
|
|
230
|
+
import PostcodeSelect from '@lancom/shared/components/common/postcode_select/postcode-select';
|
|
231
|
+
import PhoneInput from '@lancom/shared/components/common/phone_input/phone-input';
|
|
232
|
+
|
|
233
|
+
export default {
|
|
234
|
+
name: 'QuoteViewAddressForm',
|
|
235
|
+
components: {
|
|
236
|
+
PostcodeSelect,
|
|
237
|
+
PhoneInput
|
|
238
|
+
},
|
|
239
|
+
props: {
|
|
240
|
+
address: {
|
|
241
|
+
type: Object,
|
|
242
|
+
required: true
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
methods: {
|
|
246
|
+
async goToPayment() {
|
|
247
|
+
const isValid = await this.$refs.form.validate();
|
|
248
|
+
if (!isValid) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this.$emit('submit');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
</script>
|
|
256
|
+
|
|
257
|
+
<style lang="scss" scoped>
|
|
258
|
+
@import 'quote-view-address-form.scss';
|
|
259
|
+
</style>
|