@ozdao/prometheus-framework 0.2.54 → 0.2.56
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/gallery.server.js +4 -0
- package/dist/gallery.server.mjs +4 -0
- package/dist/main-37ee0513.mjs +13715 -0
- package/dist/main-B7GT1EB5.js +91 -0
- package/dist/main-N_5Jg8Gx.mjs +13693 -0
- package/dist/main-b11c45d0.js +91 -0
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +55 -32
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +2 -70
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +70 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +2 -95
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +95 -2
- package/dist/prometheus-framework/src/modules/backoffice/components/layouts/Backoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/layouts/Backoffice.vue.js +2 -33
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +6 -4
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +3 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +2 -65
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +65 -2
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +16 -18
- package/dist/prometheus-framework/src/modules/globals/store/globals.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/store/globals.js +48 -33
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +2 -11
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +11 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrderItem.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrderItem.vue.js +52 -43
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +110 -78
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +7 -5
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +15 -15
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +27 -27
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-021a4053.js +1 -0
- package/dist/web-0a68cf2a.mjs +55 -0
- package/dist/web-ktBiiov5.js +1 -0
- package/dist/web-xvjLzsHu.mjs +55 -0
- package/package.json +1 -1
- package/src/components/Feed/Feed.vue +26 -0
- package/src/modules/backoffice/router/backoffice.js +5 -2
- package/src/modules/gallery/models/photo.model.js +5 -1
- package/src/modules/globals/components/blocks/BlockSearch.vue +4 -3
- package/src/modules/globals/store/globals.js +33 -2
- package/src/modules/orders/components/blocks/CardOrderItem.vue +24 -3
- package/src/modules/orders/components/pages/EditOrder.vue +114 -108
- package/src/modules/organizations/components/pages/Organization.vue +1 -0
- package/src/modules/organizations/router/organizations.js +1 -1
- package/src/modules/organizations/router/organizations.router.js +2 -2
- package/src/modules/products/components/blocks/CardPosition.vue +7 -7
- package/src/modules/products/store/products.js +2 -0
@@ -26,17 +26,18 @@ const updateSearch = (search) => {
|
|
26
26
|
<template>
|
27
27
|
<div class="flex-v-center flex-nowrap flex pd-small bg-grey w-100 radius-big">
|
28
28
|
<IconSearch class="i-medium t-transp mn-r-thin" />
|
29
|
+
|
29
30
|
<Field
|
30
31
|
:placeholder="placeholder"
|
31
|
-
@update:field="search =>
|
32
|
+
@update:field="search => updateSearch(search)"
|
32
33
|
class="w-100"
|
33
34
|
/>
|
34
35
|
|
35
|
-
<button
|
36
|
+
<!-- <button
|
36
37
|
class="pd-r-small pd-l-small pd-t-thin pd-b-thin p-medium uppercase p-small t-medium cursor-pointer radius-extra bg-main"
|
37
38
|
@click="updateSearch(stateSearch)"
|
38
39
|
>
|
39
40
|
{{ button }}
|
40
|
-
</button>
|
41
|
+
</button> -->
|
41
42
|
</div>
|
42
43
|
</template>
|
@@ -67,7 +67,7 @@ const actions = {
|
|
67
67
|
}
|
68
68
|
},
|
69
69
|
|
70
|
-
update(array, item
|
70
|
+
update(array, item) {
|
71
71
|
const existingItemIndex = array.findIndex(i => i._id === item._id);
|
72
72
|
|
73
73
|
if (existingItemIndex === -1) {
|
@@ -77,13 +77,44 @@ const actions = {
|
|
77
77
|
}
|
78
78
|
},
|
79
79
|
|
80
|
-
delete(array, item
|
80
|
+
delete(array, item) {
|
81
81
|
const existingItemIndex = array.findIndex(c => c._id === item._id);
|
82
82
|
|
83
83
|
if (existingItemIndex !== -1) {
|
84
84
|
array.splice(existingItemIndex, 1);
|
85
85
|
}
|
86
86
|
},
|
87
|
+
|
88
|
+
|
89
|
+
increment(array, item) {
|
90
|
+
console.log(array)
|
91
|
+
console.log(item)
|
92
|
+
const arrayItem = array.find(
|
93
|
+
(i) => i._id === item._id
|
94
|
+
);
|
95
|
+
|
96
|
+
if (arrayItem) {
|
97
|
+
arrayItem.quantity++;
|
98
|
+
}
|
99
|
+
},
|
100
|
+
|
101
|
+
decrement(array, item) {
|
102
|
+
const arrayItem = array.find(
|
103
|
+
(i) => i._id === item._id
|
104
|
+
);
|
105
|
+
|
106
|
+
const arrayItemIndex = array.indexOf(arrayItem);
|
107
|
+
|
108
|
+
if (arrayItemIndex > -1) {
|
109
|
+
arrayItem.quantity--;
|
110
|
+
|
111
|
+
if (arrayItem.quantity < 1) array.splice(arrayItemIndex, 1);
|
112
|
+
}
|
113
|
+
},
|
114
|
+
|
115
|
+
reset(array) {
|
116
|
+
array = [];
|
117
|
+
},
|
87
118
|
}
|
88
119
|
|
89
120
|
const errorMessages = {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div
|
3
3
|
class="gap-small pos-relative cols-1"
|
4
|
-
style="box-sizing: content-box;"
|
5
4
|
>
|
6
5
|
|
7
6
|
<div class="pos-relative w-100 gap-thin flex-stretch flex-nowrap flex">
|
@@ -39,7 +38,7 @@
|
|
39
38
|
<!-- Quantity -->
|
40
39
|
<div v-if="editable" class="mn-t-thin gap-thin flex-nojustify flex">
|
41
40
|
<IconAdd
|
42
|
-
@click="
|
41
|
+
@click="increase_(product)"
|
43
42
|
class="hover-scale-1 cursor-pointer bg-grey i-big pd-thin radius-small"
|
44
43
|
/>
|
45
44
|
<IconMinus
|
@@ -72,15 +71,37 @@
|
|
72
71
|
|
73
72
|
const router = useRouter()
|
74
73
|
|
74
|
+
const emits = defineEmits(['increase', 'decrease', 'remove'])
|
75
|
+
|
75
76
|
const props = defineProps({
|
76
77
|
product: Object,
|
77
78
|
editable: String,
|
78
79
|
increase: Function,
|
79
80
|
decrease: Function,
|
80
81
|
remove: Function
|
81
|
-
|
82
82
|
})
|
83
83
|
|
84
|
+
function increase_ (product) {
|
85
|
+
if (props.increase) {
|
86
|
+
props.increase(product)
|
87
|
+
}
|
88
|
+
emits('increase', product)
|
89
|
+
}
|
90
|
+
|
91
|
+
function decrease (product) {
|
92
|
+
if (props.decrease) {
|
93
|
+
props.decrease(product)
|
94
|
+
}
|
95
|
+
emits('decrease', product)
|
96
|
+
}
|
97
|
+
|
98
|
+
function remove (product) {
|
99
|
+
if (props.remove) {
|
100
|
+
props.remove(product)
|
101
|
+
}
|
102
|
+
emits('remove', product)
|
103
|
+
}
|
104
|
+
|
84
105
|
</script>
|
85
106
|
|
86
107
|
<style lang="scss">
|
@@ -1,62 +1,104 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
:products="Products"
|
13
|
-
/>
|
14
|
-
</Block>
|
15
|
-
|
16
|
-
<Block
|
17
|
-
title="Invetory Sheet"
|
18
|
-
class="mn-b-semi"
|
19
|
-
>
|
20
|
-
<span
|
21
|
-
v-if="orders.state.current.positions.length === 0"
|
22
|
-
class="w-100"
|
2
|
+
<div>
|
3
|
+
<header class="mn-b-medium flex-v-center flex-nowrap flex">
|
4
|
+
<h2 class="mn-r-medium">Create Order</h2>
|
5
|
+
</header>
|
6
|
+
|
7
|
+
<Popup
|
8
|
+
title="Добавить участника"
|
9
|
+
@close-popup="closeProductsPopup"
|
10
|
+
:isPopupOpen="isOpenProductsPopup"
|
11
|
+
class="bg-white w-min-30r w-max-30r radius-big pd-medium"
|
23
12
|
>
|
24
|
-
No positions added yet
|
25
|
-
</span>
|
26
|
-
|
27
|
-
<CardPosition
|
28
|
-
v-for="(product, index) in orders.state.current.positions"
|
29
|
-
:key="product._id"
|
30
|
-
:product="product"
|
31
|
-
:products="Products"
|
32
|
-
@add="addProduct"
|
33
|
-
@delete="deleteProduct"
|
34
|
-
@update="updateProduct"
|
35
|
-
/>
|
36
|
-
</Block>
|
37
|
-
<!--
|
38
|
-
<FormOrderDetails
|
39
|
-
:order="orders.state.current"
|
40
|
-
@create="handleCreate"
|
41
|
-
class="bg-grey pd-medium radius-big mn-b-semi"
|
42
|
-
/> -->
|
43
|
-
|
44
|
-
|
45
|
-
<div class="mn-thinw-100 flex-v-center flex block">
|
46
|
-
<p class="p-big">Сумма к оплате:
|
47
|
-
<span v-if="order.info?.delivery === 'Самовывоз'" class="p-big t-semi">{{ orderTotalPrice / 100 }} ₽</span>
|
48
|
-
<span v-if="order.info?.delivery === 'Курьером'" class="p-big t-semi">{{ orderTotalPrice / 100 + 350 }} ₽</span>
|
49
|
-
<span v-if="order.info?.delivery === 'Почтой'" class="p-big t-semi">{{ orderTotalPrice / 100 + 550 }} ₽</span>
|
50
|
-
(Заказ {{orderTotalPrice / 100}} ₽ + доставка
|
51
|
-
<span v-if="order.info?.delivery === 'Самовывоз'" >0</span>
|
52
|
-
<span v-if="order.info?.delivery === 'Курьером'" >350</span>
|
53
|
-
<span v-if="order.info?.delivery === 'Почтой'">550</span>
|
54
|
-
₽)
|
55
|
-
</p>
|
56
|
-
|
57
|
-
<button class="mn-l-auto button">Запросить онлайн</button>
|
58
|
-
</div>
|
59
13
|
|
14
|
+
<h3 class="mn-b-small">Add to order</h3>
|
15
|
+
|
16
|
+
<div class="bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big">
|
17
|
+
<Feed
|
18
|
+
:search="true"
|
19
|
+
:states="{
|
20
|
+
empty: {
|
21
|
+
title: 'No Products Found',
|
22
|
+
description: 'Currently, there are no such products available.'
|
23
|
+
}
|
24
|
+
}"
|
25
|
+
:store="{
|
26
|
+
read: (options) => products.actions.read(options),
|
27
|
+
state: null
|
28
|
+
}"
|
29
|
+
:options="{
|
30
|
+
organization: route.params._id
|
31
|
+
}"
|
32
|
+
v-slot="{
|
33
|
+
items
|
34
|
+
}"
|
35
|
+
class=""
|
36
|
+
>
|
37
|
+
<CardOrderItem
|
38
|
+
v-for="(product, index) in items" :key="product._id"
|
39
|
+
:editable="false"
|
40
|
+
:product="product"
|
41
|
+
@click="() => {
|
42
|
+
let p = { ...product };
|
43
|
+
p.quantity = 1;
|
44
|
+
globals.actions.add(orders.state.current.positions, p)
|
45
|
+
closeProductsPopup();
|
46
|
+
}"
|
47
|
+
class="bg-white pd-thin radius-medium w-100 mn-b-thin"
|
48
|
+
/>
|
49
|
+
</Feed>
|
50
|
+
</div>
|
51
|
+
</Popup>
|
52
|
+
|
53
|
+
<Block
|
54
|
+
title="Invetory Sheet"
|
55
|
+
:actions="[{
|
56
|
+
label: '+',
|
57
|
+
function: () => openProductsPopup()
|
58
|
+
}]"
|
59
|
+
class="mn-b-semi"
|
60
|
+
>
|
61
|
+
<span
|
62
|
+
v-if="orders.state.current.positions.length === 0"
|
63
|
+
class="w-100"
|
64
|
+
>
|
65
|
+
No positions added yet
|
66
|
+
</span>
|
67
|
+
|
68
|
+
<CardOrderItem
|
69
|
+
v-for="(product, index) in orders.state.current.positions"
|
70
|
+
:key="product._id"
|
71
|
+
:editable="true"
|
72
|
+
:product="product"
|
73
|
+
@increase="() => { globals.actions.increment(orders.state.current.positions, product) }"
|
74
|
+
@decrease="() => { globals.actions.decrement(orders.state.current.positions, product) }"
|
75
|
+
@remove="() => { globals.actions.delete(orders.state.current.positions, product) }"
|
76
|
+
class="mn-b-thin pd-thin radius-medium bg-white"
|
77
|
+
/>
|
78
|
+
</Block>
|
79
|
+
<!--
|
80
|
+
<FormOrderDetails
|
81
|
+
:order="orders.state.current"
|
82
|
+
@create="handleCreate"
|
83
|
+
class="bg-grey pd-medium radius-big mn-b-semi"
|
84
|
+
/> -->
|
85
|
+
|
86
|
+
|
87
|
+
<div class="mn-thinw-100 flex-v-center flex block">
|
88
|
+
<p class="p-big">Сумма к оплате:
|
89
|
+
<span v-if="order?.info?.delivery === 'Самовывоз'" class="p-big t-semi">{{ orderTotalPrice / 100 }} ₽</span>
|
90
|
+
<span v-if="order?.info?.delivery === 'Курьером'" class="p-big t-semi">{{ orderTotalPrice / 100 + 350 }} ₽</span>
|
91
|
+
<span v-if="order?.info?.delivery === 'Почтой'" class="p-big t-semi">{{ orderTotalPrice / 100 + 550 }} ₽</span>
|
92
|
+
(Заказ {{orderTotalPrice / 100}} ₽ + доставка
|
93
|
+
<span v-if="order?.info?.delivery === 'Самовывоз'" >0</span>
|
94
|
+
<span v-if="order?.info?.delivery === 'Курьером'" >350</span>
|
95
|
+
<span v-if="order?.info?.delivery === 'Почтой'">550</span>
|
96
|
+
₽)
|
97
|
+
</p>
|
98
|
+
|
99
|
+
<button class="mn-l-auto button">Запросить онлайн</button>
|
100
|
+
</div>
|
101
|
+
</div>
|
60
102
|
|
61
103
|
|
62
104
|
</template>
|
@@ -66,79 +108,43 @@
|
|
66
108
|
import { computed, ref, defineProps, onMounted, reactive, toRefs, watch } from 'vue'
|
67
109
|
import { useRoute } from 'vue-router'
|
68
110
|
|
111
|
+
import Feed from '@pf/src/components/Feed/Feed.vue'
|
112
|
+
import Popup from '@pf/src/components/Popup/Popup.vue';
|
69
113
|
import Block from '@pf/src/components/Block/Block.vue';
|
70
114
|
|
71
|
-
import
|
115
|
+
import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
|
116
|
+
|
72
117
|
import CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';
|
73
118
|
|
74
|
-
// import FormOrderDetails from '@pf/src/modules/orders/components/sections/FormOrderDetails.vue'
|
75
119
|
|
76
120
|
// Import your store
|
121
|
+
import * as globals from '@pf/src/modules/globals/store/globals';
|
77
122
|
import * as orders from '@pf/src/modules/orders/store/orders';
|
78
123
|
import * as products from '@pf/src/modules/products/store/products';
|
79
124
|
|
80
125
|
// Accessing router
|
81
126
|
const route = useRoute()
|
82
127
|
|
83
|
-
//
|
84
|
-
const
|
85
|
-
props.showProduct = [];
|
128
|
+
// Popup
|
129
|
+
const isOpenProductsPopup = ref(false);
|
86
130
|
|
87
|
-
function
|
88
|
-
|
131
|
+
function openProductsPopup() {
|
132
|
+
isOpenProductsPopup.value = true;
|
89
133
|
}
|
90
134
|
|
91
|
-
function
|
92
|
-
|
135
|
+
function closeProductsPopup() {
|
136
|
+
isOpenProductsPopup.value = false;
|
93
137
|
}
|
94
138
|
|
95
|
-
//
|
96
|
-
let
|
97
|
-
let reactiveData = toRefs(data)
|
98
|
-
var showAddNew = ref(false)
|
99
|
-
const Products = ref([])
|
139
|
+
// Data
|
140
|
+
let order = ref(null)
|
100
141
|
|
101
|
-
// Initialize order and products
|
102
|
-
let order = ref({})
|
103
|
-
// Replace store orders.actions with your orders.actions
|
104
142
|
onMounted(async () => {
|
105
|
-
//
|
106
|
-
try {
|
107
|
-
const productsResponse = await products.actions.read({
|
108
|
-
organization: '65141c476cf9860013b49f6d'
|
109
|
-
});
|
110
|
-
console.log(productsResponse)
|
111
|
-
Products.value = productsResponse;
|
112
|
-
} catch (error) {
|
113
|
-
console.error('error');
|
114
|
-
}
|
115
|
-
|
116
|
-
await orders.actions.fetchOrder(route.params.id) // Implement this action in your store
|
117
|
-
|
118
|
-
order.value = orders.state.current
|
119
|
-
})
|
143
|
+
// await orders.actions.fetchOrder(route.params.id) // Implement this action in your store
|
120
144
|
|
145
|
+
// order.value = orders.state.current
|
146
|
+
})
|
121
147
|
|
122
|
-
function saveItemList() {
|
123
|
-
orders.actions.updateOrderpositions(route.params.id) // Replace Vuex action with your action
|
124
|
-
}
|
125
|
-
|
126
|
-
function changeEdit(index) {
|
127
|
-
data[index] = !data[index]
|
128
|
-
}
|
129
|
-
|
130
|
-
function resetOrderList() {
|
131
|
-
orders.actions.fetchOrder(route.params.id) // Replace Vuex action with your action
|
132
|
-
}
|
133
|
-
|
134
|
-
function changeAdd() {
|
135
|
-
showAddNew.value = !showAddNew.value
|
136
|
-
}
|
137
|
-
|
138
|
-
// Replace computed properties with reactive orders.state
|
139
|
-
// Update this line to match your orders.state structure
|
140
|
-
const orderTotalPrice = computed(() => 100) // Implement this getter in your orders.actions
|
141
|
-
const orderProducts = computed(() => []) // Implement this getter in your orders.actions
|
142
148
|
</script>
|
143
149
|
|
144
150
|
|
@@ -12,7 +12,7 @@ const organizationRoutes = [{
|
|
12
12
|
ru: 'Организация'
|
13
13
|
}
|
14
14
|
},
|
15
|
-
component:
|
15
|
+
component: layoutEmpty,
|
16
16
|
children: [
|
17
17
|
{
|
18
18
|
path: '',
|
@@ -25,7 +25,7 @@ const organizationRoutes = [{
|
|
25
25
|
},
|
26
26
|
component: () => import('@pf/src/modules/organizations/components/pages/Organization.vue'),
|
27
27
|
},
|
28
|
-
...backofficeRoutes
|
28
|
+
...backofficeRoutes
|
29
29
|
],
|
30
30
|
}, {
|
31
31
|
path: 'create',
|
@@ -75,9 +75,9 @@
|
|
75
75
|
])
|
76
76
|
|
77
77
|
const productSelected = ref(null);
|
78
|
-
const productQuantity = ref(
|
78
|
+
const productQuantity = ref(1);
|
79
79
|
const productQuantityType = ref('pcs');
|
80
|
-
const productPrice = ref(
|
80
|
+
const productPrice = ref(0);
|
81
81
|
|
82
82
|
const isProductValid = computed(() =>
|
83
83
|
productSelected.value
|
@@ -87,14 +87,14 @@
|
|
87
87
|
|
88
88
|
watch(props.array, () => {
|
89
89
|
productSelected.value = props.product
|
90
|
-
productQuantity.value = props.product.quantity
|
90
|
+
productQuantity.value = props.product.quantity || 1
|
91
91
|
productPrice.value = props.product.price
|
92
92
|
productQuantityType.value = props.product.type
|
93
93
|
});
|
94
94
|
|
95
95
|
if (props.product) {
|
96
96
|
productSelected.value = props.product
|
97
|
-
productQuantity.value = props.product.quantity
|
97
|
+
productQuantity.value = props.product.quantity || 1
|
98
98
|
productPrice.value = props.product.price
|
99
99
|
productQuantityType.value = props.product.type
|
100
100
|
}
|
@@ -105,7 +105,7 @@
|
|
105
105
|
emits('update', {
|
106
106
|
...productSelected.value,
|
107
107
|
price: productPrice.value,
|
108
|
-
quantity: productQuantity.value,
|
108
|
+
quantity: productQuantity.value || 1,
|
109
109
|
type: productQuantityType.value
|
110
110
|
});
|
111
111
|
});
|
@@ -115,7 +115,7 @@
|
|
115
115
|
emits('add', {
|
116
116
|
...productSelected.value,
|
117
117
|
price: productPrice.value,
|
118
|
-
quantity: productQuantity.value,
|
118
|
+
quantity: productQuantity.value || 1,
|
119
119
|
type: productQuantityType.value
|
120
120
|
});
|
121
121
|
}
|
@@ -124,7 +124,7 @@
|
|
124
124
|
emits('delete', {
|
125
125
|
...productSelected.value,
|
126
126
|
price: productPrice.value,
|
127
|
-
quantity: productQuantity.value,
|
127
|
+
quantity: productQuantity.value || 1,
|
128
128
|
type: productQuantityType.value
|
129
129
|
});
|
130
130
|
}
|