@lancom/shared 0.0.424 → 0.0.426
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 +7 -33
- package/assets/js/api/index.js +3 -17
- package/components/common/coupon_select/coupon-select.vue +2 -12
- package/components/common/phone_input/phone-input.vue +3 -15
- package/components/common/postcode_select/postcode-select.vue +1 -3
- package/components/customer/customer_navigation_menu/customer-navigation-menu.vue +7 -11
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +7 -19
- package/components/product/editor_pricing/editor-pricing.vue +16 -10
- package/components/product/product.vue +12 -0
- package/components/product/product_reviews/product-reviews.vue +6 -6
- package/components/product/related_products/related-products.vue +4 -4
- package/package.json +1 -1
- package/routes/index.js +0 -10
- package/store/auth.js +0 -1
- package/store/index.js +3 -12
- package/store/product.js +21 -1
- package/assets/js/utils/share-promises/index.js +0 -76
- package/components/customer/customer_preferences_form/customer-preferences-form.scss +0 -12
- package/components/customer/customer_preferences_form/customer-preferences-form.vue +0 -87
- package/components/pages/customer/preferences/preferences.vue +0 -79
- package/components/resource/resource_view/resource-view.mixin.js +0 -74
- package/components/resource/resource_view/resource-view.scss +0 -13
- package/components/resource/resource_view/resource-view.vue +0 -97
- package/components/resource/resource_view/resource_view_prints/resource-view-prints.scss +0 -7
- package/components/resource/resource_view/resource_view_prints/resource-view-prints.vue +0 -42
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource-view-print.scss +0 -5
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource-view-print.vue +0 -54
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource-view-print-products.scss +0 -0
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource-view-print-products.vue +0 -45
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource_view_print_product/resource-view-print-product.scss +0 -0
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource_view_print_product/resource-view-print-product.vue +0 -44
- package/pages/customer/preferences.vue +0 -33
- package/pages/order/_token/resource/_resource.vue +0 -53
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form__wrapper CustomerFrom__wrapper">
|
|
3
|
-
<validation-observer ref="form">
|
|
4
|
-
<div class="mt-10">
|
|
5
|
-
<div
|
|
6
|
-
class="row"
|
|
7
|
-
style="margin-top: -20px">
|
|
8
|
-
<div class="col-12">
|
|
9
|
-
<div class="form-row">
|
|
10
|
-
<label class="form-label">
|
|
11
|
-
<checkbox v-model="customer.signUpForNewsletter" />
|
|
12
|
-
<span class="lc_regular12 lc__grey1">
|
|
13
|
-
Sign up for newsletter
|
|
14
|
-
</span>
|
|
15
|
-
</label>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="form__footer mt-5">
|
|
21
|
-
<div
|
|
22
|
-
v-if="errorMessage"
|
|
23
|
-
class="CustomerForm__error">
|
|
24
|
-
{{ errorMessage }}
|
|
25
|
-
</div>
|
|
26
|
-
<div class="form-actions full">
|
|
27
|
-
<btn
|
|
28
|
-
class="btn btn-black"
|
|
29
|
-
:btn-processing="processing"
|
|
30
|
-
:btn-disabled="processing"
|
|
31
|
-
:btn-label="customer._id ? 'Save' : 'Create Account'"
|
|
32
|
-
@onclick="submit()">
|
|
33
|
-
</btn>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</validation-observer>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import { mapGetters } from 'vuex';
|
|
42
|
-
import api from '@lancom/shared/assets/js/api';
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
name: 'CustomerPreferencesForm',
|
|
46
|
-
props: {
|
|
47
|
-
customer: {
|
|
48
|
-
type: Object,
|
|
49
|
-
required: true
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
data() {
|
|
53
|
-
return {
|
|
54
|
-
errorMessage: null,
|
|
55
|
-
processing: false
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
computed: {
|
|
59
|
-
...mapGetters(['shop'])
|
|
60
|
-
},
|
|
61
|
-
methods: {
|
|
62
|
-
async submit() {
|
|
63
|
-
this.errorMessage = null;
|
|
64
|
-
|
|
65
|
-
const isValid = await this.$refs.form.validate();
|
|
66
|
-
if (!isValid) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
this.processing = true;
|
|
72
|
-
const result = await api.saveCustomer(this.customer, this.shop._id);
|
|
73
|
-
this.$emit('save', result);
|
|
74
|
-
} catch ({ response }) {
|
|
75
|
-
const { data } = response || {};
|
|
76
|
-
this.errorMessage = data && data.error;
|
|
77
|
-
} finally {
|
|
78
|
-
this.processing = false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style lang="scss" scoped>
|
|
86
|
-
@import 'customer-preferences-form.scss';
|
|
87
|
-
</style>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="CustomerPreferences__wrapper">
|
|
3
|
-
<customer-preferences-form
|
|
4
|
-
v-if="customer"
|
|
5
|
-
ref="customerForm"
|
|
6
|
-
:customer="customer"
|
|
7
|
-
@save="onSave"
|
|
8
|
-
@customer-loaded="onCustomerLoaded" />
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import api from '@lancom/shared/assets/js/api';
|
|
14
|
-
import { mapGetters, mapActions } from 'vuex';
|
|
15
|
-
import CustomerPreferencesForm from '@lancom/shared/components/customer/customer_preferences_form/customer-preferences-form';
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
name: 'CustomerPreferences',
|
|
19
|
-
components: {
|
|
20
|
-
CustomerPreferencesForm
|
|
21
|
-
},
|
|
22
|
-
data() {
|
|
23
|
-
return {
|
|
24
|
-
customer: null,
|
|
25
|
-
loading: false,
|
|
26
|
-
error: null
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
computed: {
|
|
30
|
-
...mapGetters(['shop']),
|
|
31
|
-
...mapGetters('auth', ['user'])
|
|
32
|
-
},
|
|
33
|
-
async created() {
|
|
34
|
-
await this.loadCustomerData();
|
|
35
|
-
},
|
|
36
|
-
methods: {
|
|
37
|
-
...mapActions('auth', ['update_user']),
|
|
38
|
-
async loadCustomerData() {
|
|
39
|
-
try {
|
|
40
|
-
this.processing = true;
|
|
41
|
-
const customer = await api.fetchCustomer(this.user.accessToken, this.shop._id);
|
|
42
|
-
console.log('customer: ', customer);
|
|
43
|
-
this.customer = customer;
|
|
44
|
-
} catch (e) {
|
|
45
|
-
console.log(e);
|
|
46
|
-
const errorMessage = e?.response?.data?.error;
|
|
47
|
-
this.$toastr.e(errorMessage || 'Customer failed to load');
|
|
48
|
-
} finally {
|
|
49
|
-
this.processing = false;
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
onSave({ customer: user, token }) {
|
|
53
|
-
this.$toastr.s('Customer successfully saved');
|
|
54
|
-
this.update_user({ user, token });
|
|
55
|
-
},
|
|
56
|
-
onCustomerLoaded(customer) {
|
|
57
|
-
this.customer = customer;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style lang="scss" scoped>
|
|
64
|
-
.loading-message {
|
|
65
|
-
text-align: center;
|
|
66
|
-
padding: 2rem;
|
|
67
|
-
font-size: 1.1rem;
|
|
68
|
-
color: #666;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.error-message {
|
|
72
|
-
text-align: center;
|
|
73
|
-
padding: 2rem;
|
|
74
|
-
color: #d32f2f;
|
|
75
|
-
background-color: #ffebee;
|
|
76
|
-
border-radius: 4px;
|
|
77
|
-
margin: 1rem 0;
|
|
78
|
-
}
|
|
79
|
-
</style>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import api from '@lancom/shared/assets/js/api';
|
|
2
|
-
|
|
3
|
-
const ORDER_RESOURCE_STATUS = {
|
|
4
|
-
PENDING_APPROVAL: 'pending approval',
|
|
5
|
-
APPROVED: 'approved',
|
|
6
|
-
NOT_APPROVED: 'not approved'
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
props: {
|
|
11
|
-
order: {
|
|
12
|
-
type: Object,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
resource: {
|
|
16
|
-
type: Object,
|
|
17
|
-
required: true
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
data() {
|
|
21
|
-
return {
|
|
22
|
-
processing: false
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
file() {
|
|
27
|
-
return this.resource.file;
|
|
28
|
-
},
|
|
29
|
-
isNotApproved() {
|
|
30
|
-
return this.resource.status === ORDER_RESOURCE_STATUS.NOT_APPROVED;
|
|
31
|
-
},
|
|
32
|
-
isApproved() {
|
|
33
|
-
return this.resource.status === ORDER_RESOURCE_STATUS.APPROVED;
|
|
34
|
-
},
|
|
35
|
-
isAvailableForApprove() {
|
|
36
|
-
const statuses = [
|
|
37
|
-
ORDER_RESOURCE_STATUS.APPROVED,
|
|
38
|
-
ORDER_RESOURCE_STATUS.NOT_APPROVED,
|
|
39
|
-
ORDER_RESOURCE_STATUS.PENDING_APPROVAL
|
|
40
|
-
];
|
|
41
|
-
return statuses.includes(this.resource.status);
|
|
42
|
-
},
|
|
43
|
-
isValidStatus() {
|
|
44
|
-
const statuses = [
|
|
45
|
-
ORDER_RESOURCE_STATUS.APPROVED,
|
|
46
|
-
ORDER_RESOURCE_STATUS.NOT_APPROVED
|
|
47
|
-
];
|
|
48
|
-
return statuses.includes(this.resource.status);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
mounted() {
|
|
52
|
-
console.log('this.resource: ', this.resource);
|
|
53
|
-
console.log('this.order: ', this.order);
|
|
54
|
-
},
|
|
55
|
-
methods: {
|
|
56
|
-
approveMockup() {
|
|
57
|
-
this.resource.status = 'approved';
|
|
58
|
-
},
|
|
59
|
-
notApproveMockup() {
|
|
60
|
-
this.resource.status = 'not approved';
|
|
61
|
-
},
|
|
62
|
-
async submitApproval() {
|
|
63
|
-
this.processing = true;
|
|
64
|
-
try {
|
|
65
|
-
await api.approveOrderMockup(this.order, this.resource);
|
|
66
|
-
this.processing = false;
|
|
67
|
-
this.$toastr.s('Approval submitted successfully.');
|
|
68
|
-
} catch (error) {
|
|
69
|
-
this.processing = false;
|
|
70
|
-
this.$toastr.e('Failed to submit approval.');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ResourceView__wrapper">
|
|
3
|
-
<div class="row">
|
|
4
|
-
<div class="col-6">
|
|
5
|
-
<div class="ResourceView__code lc_h3">
|
|
6
|
-
{{ order.code }}
|
|
7
|
-
</div>
|
|
8
|
-
<div>
|
|
9
|
-
<div>
|
|
10
|
-
<div class="ResourceView__code lc_h5">
|
|
11
|
-
Approve Mockup
|
|
12
|
-
</div>
|
|
13
|
-
<div
|
|
14
|
-
v-if="file"
|
|
15
|
-
class="lc_regular16">
|
|
16
|
-
<span>
|
|
17
|
-
Mockup:
|
|
18
|
-
</span>
|
|
19
|
-
<a
|
|
20
|
-
:href="file.origin"
|
|
21
|
-
target="_blank"
|
|
22
|
-
class="lc_black">
|
|
23
|
-
{{ file.fileName }}
|
|
24
|
-
</a>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="ResourceView__approve">
|
|
28
|
-
<div>
|
|
29
|
-
<btn
|
|
30
|
-
:btn-class="isApproved ? 'purple' : 'white'"
|
|
31
|
-
:btn-disabled="!isAvailableForApprove || processing"
|
|
32
|
-
:btn-processing="processing"
|
|
33
|
-
btn-label="Approved"
|
|
34
|
-
class="ResourceView__approve-btn"
|
|
35
|
-
@onclick="approveMockup()">
|
|
36
|
-
</btn>
|
|
37
|
-
<btn
|
|
38
|
-
:btn-class="isNotApproved ? 'purple' : 'white'"
|
|
39
|
-
:btn-disabled="!isAvailableForApprove"
|
|
40
|
-
:btn-processing="processing"
|
|
41
|
-
btn-label="Not Approved"
|
|
42
|
-
class="ResourceView__approve-btn"
|
|
43
|
-
@onclick="notApproveMockup()">
|
|
44
|
-
</btn>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="mt-10">
|
|
47
|
-
<validation-provider
|
|
48
|
-
tag="div"
|
|
49
|
-
name="Comment"
|
|
50
|
-
class="mb-5 mt-5">
|
|
51
|
-
<textarea
|
|
52
|
-
id="timeline_message"
|
|
53
|
-
v-model="resource.comment"
|
|
54
|
-
name="comment"
|
|
55
|
-
style="height: 140px"
|
|
56
|
-
placeholder="Comment"
|
|
57
|
-
class="form-field no-label"></textarea>
|
|
58
|
-
</validation-provider>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="mt-10">
|
|
61
|
-
<btn
|
|
62
|
-
btn-class="green"
|
|
63
|
-
:btn-disabled="!isValidStatus || processing"
|
|
64
|
-
:btn-processing="processing"
|
|
65
|
-
btn-label="Save"
|
|
66
|
-
class="ResourceView__approve-btn"
|
|
67
|
-
@onclick="submitApproval()">
|
|
68
|
-
</btn>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
<div class="col-6">
|
|
74
|
-
<resource-view-prints
|
|
75
|
-
:order="order"
|
|
76
|
-
:resource="resource" />
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</template>
|
|
81
|
-
|
|
82
|
-
<script>
|
|
83
|
-
import ResourceViewMixin from './resource-view.mixin';
|
|
84
|
-
import ResourceViewPrints from './resource_view_prints/resource-view-prints';
|
|
85
|
-
|
|
86
|
-
export default {
|
|
87
|
-
name: 'LancomResourceView',
|
|
88
|
-
components: {
|
|
89
|
-
ResourceViewPrints
|
|
90
|
-
},
|
|
91
|
-
mixins: [ResourceViewMixin]
|
|
92
|
-
};
|
|
93
|
-
</script>
|
|
94
|
-
|
|
95
|
-
<style lang="scss" scoped>
|
|
96
|
-
@import 'resource-view.scss';
|
|
97
|
-
</style>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ResourceViewPrints__wrapper">
|
|
3
|
-
<resource-view-print
|
|
4
|
-
v-for="print in prints"
|
|
5
|
-
:key="print._id"
|
|
6
|
-
:order="order"
|
|
7
|
-
:resource="resource"
|
|
8
|
-
:print="print"
|
|
9
|
-
class="ResourceViewPrints__print" />
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import ResourceViewPrint from './resource_view_print/resource-view-print';
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
name: 'LancomResourceViewPrints',
|
|
18
|
-
components: {
|
|
19
|
-
ResourceViewPrint
|
|
20
|
-
},
|
|
21
|
-
props: {
|
|
22
|
-
order: {
|
|
23
|
-
type: Object,
|
|
24
|
-
required: true
|
|
25
|
-
},
|
|
26
|
-
resource: {
|
|
27
|
-
type: Object,
|
|
28
|
-
required: true
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
computed: {
|
|
32
|
-
prints() {
|
|
33
|
-
const productsPrints = this.order.products.reduce((prints, product) => [...prints, ...product.prints], []);
|
|
34
|
-
return [...this.order.prints, ...productsPrints];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style lang="scss" scoped>
|
|
41
|
-
@import 'resource-view-prints.scss';
|
|
42
|
-
</style>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ResourceViewPrint__wrapper">
|
|
3
|
-
<div class="lc_regular12">
|
|
4
|
-
<div v-if="print.printType">
|
|
5
|
-
<b class="lc_bold">Print Type:</b> {{ print.printType.name }}
|
|
6
|
-
</div>
|
|
7
|
-
<div v-if="print.printArea">
|
|
8
|
-
<b class="lc_bold">Print Area:</b> {{ print.printArea.name }}
|
|
9
|
-
</div>
|
|
10
|
-
<div v-if="print.printSize">
|
|
11
|
-
<b class="lc_bold">Print Size:</b> {{ print.printSize.name }}
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="ResourceViewPrint__products">
|
|
15
|
-
<resource-view-print-products
|
|
16
|
-
:order="order"
|
|
17
|
-
:resource="resource"
|
|
18
|
-
:print="print" />
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import ResourceViewPrintProducts from './resource_view_print_products/resource-view-print-products';
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
name: 'LancomResourceViewPrint',
|
|
28
|
-
components: {
|
|
29
|
-
ResourceViewPrintProducts
|
|
30
|
-
},
|
|
31
|
-
props: {
|
|
32
|
-
order: {
|
|
33
|
-
type: Object,
|
|
34
|
-
required: true
|
|
35
|
-
},
|
|
36
|
-
resource: {
|
|
37
|
-
type: Object,
|
|
38
|
-
required: true
|
|
39
|
-
},
|
|
40
|
-
print: {
|
|
41
|
-
type: Object,
|
|
42
|
-
required: true
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
mounted() {
|
|
46
|
-
console.log('');
|
|
47
|
-
console.log('this.print: ', this.print);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<style lang="scss" scoped>
|
|
53
|
-
@import 'resource-view-print.scss';
|
|
54
|
-
</style>
|
|
File without changes
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ResourceViewPrintProducts__wrapper">
|
|
3
|
-
<resource-view-print-product
|
|
4
|
-
v-for="(product, index) in products"
|
|
5
|
-
:key="product.guid || index"
|
|
6
|
-
:order="order"
|
|
7
|
-
:resource="resource"
|
|
8
|
-
:print="print"
|
|
9
|
-
:product="product" />
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import ResourceViewPrintProduct from './resource_view_print_product/resource-view-print-product';
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
name: 'LancomResourceViewPrintProducts',
|
|
18
|
-
components: {
|
|
19
|
-
ResourceViewPrintProduct
|
|
20
|
-
},
|
|
21
|
-
props: {
|
|
22
|
-
order: {
|
|
23
|
-
type: Object,
|
|
24
|
-
required: true
|
|
25
|
-
},
|
|
26
|
-
resource: {
|
|
27
|
-
type: Object,
|
|
28
|
-
required: true
|
|
29
|
-
},
|
|
30
|
-
print: {
|
|
31
|
-
type: Object,
|
|
32
|
-
required: true
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
computed: {
|
|
36
|
-
products() {
|
|
37
|
-
return this.order.products;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<style lang="scss" scoped>
|
|
44
|
-
@import 'resource-view-print-products.scss';
|
|
45
|
-
</style>
|
|
File without changes
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ResourceViewPrintProduct__wrapper">
|
|
3
|
-
<div
|
|
4
|
-
v-for="simpleProduct in simpleProducts"
|
|
5
|
-
:key="simpleProduct.guid"
|
|
6
|
-
class="lc_regular14">
|
|
7
|
-
{{ simpleProduct.SKU }} x {{ simpleProduct.amount }}
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
export default {
|
|
14
|
-
name: 'LancomResourceViewPrintProduct',
|
|
15
|
-
props: {
|
|
16
|
-
order: {
|
|
17
|
-
type: Object,
|
|
18
|
-
required: true
|
|
19
|
-
},
|
|
20
|
-
resource: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: true
|
|
23
|
-
},
|
|
24
|
-
print: {
|
|
25
|
-
type: Object,
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
product: {
|
|
29
|
-
type: Object,
|
|
30
|
-
required: true
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
computed: {
|
|
34
|
-
simpleProducts() {
|
|
35
|
-
const simpleProducts = this.product.simpleProducts || [];
|
|
36
|
-
return simpleProducts.filter(sp => sp.amount > 0);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<style lang="scss" scoped>
|
|
43
|
-
@import 'resource-view-print-product.scss';
|
|
44
|
-
</style>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:data-aos="aosFadeLeft"
|
|
4
|
-
class="CustomerPreferencesPage__wrapper">
|
|
5
|
-
<customer-preferences />
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
name: 'CustomerPreferencesPage',
|
|
14
|
-
components: {
|
|
15
|
-
CustomerPreferences: () => import('@lancom/shared/components/pages/customer/preferences/preferences')
|
|
16
|
-
},
|
|
17
|
-
mixins: [metaInfo]
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<style lang="scss" scoped>
|
|
22
|
-
@import "@/assets/scss/variables";
|
|
23
|
-
|
|
24
|
-
.CustomerPreferencesPage {
|
|
25
|
-
&__wrapper {
|
|
26
|
-
margin: 100px auto;
|
|
27
|
-
width: 500px;
|
|
28
|
-
@media (max-width: $bp-extra-small-max) {
|
|
29
|
-
width: auto;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
</style>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ResourceViewPage__wrapper">
|
|
3
|
-
<div :class="isFullScreen ? '' : 'content-inner'">
|
|
4
|
-
<resource-view
|
|
5
|
-
:order="order"
|
|
6
|
-
:resource="resource"
|
|
7
|
-
:responsive="!isFullScreen" />
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
14
|
-
import api from '@lancom/shared/assets/js/api';
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
name: 'OrderResourceViewPage',
|
|
18
|
-
components: {
|
|
19
|
-
ResourceView: () => import('@lancom/shared/components/resource/resource_view/resource-view')
|
|
20
|
-
},
|
|
21
|
-
mixins: [metaInfo],
|
|
22
|
-
async asyncData({ params, error }) {
|
|
23
|
-
try {
|
|
24
|
-
const order = await api.fetchOrderByToken(params.token, { invoiceProducts: true });
|
|
25
|
-
const resource = order.resources.find(i => [i._id, i.guid].includes(params.resource));
|
|
26
|
-
if (!resource) {
|
|
27
|
-
return error({
|
|
28
|
-
statusCode: 404,
|
|
29
|
-
error: 'Resource not found'
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return { order, resource };
|
|
33
|
-
} catch (e) {
|
|
34
|
-
const { status, data } = e?.response || {};
|
|
35
|
-
const statusCode = status || 500;
|
|
36
|
-
error({
|
|
37
|
-
statusCode,
|
|
38
|
-
error: data?.error || 'Resource not found'
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
data() {
|
|
43
|
-
return {
|
|
44
|
-
order: null,
|
|
45
|
-
invoice: null,
|
|
46
|
-
isFullScreen: this.$route.query.print
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<style lang="scss">
|
|
53
|
-
</style>
|