@ozdao/martyrs 0.2.428 → 0.2.430
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/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/gallery.server.mjs +1 -1
- package/dist/{globals.logger-Deb_8o7C.mjs → globals.cache-BT6q3vOf.mjs} +0 -33
- package/dist/{globals.logger-BuG0pN80.js → globals.cache-CwWvNGFQ.js} +0 -33
- package/dist/globals.logger-BdjooLaD.js +34 -0
- package/dist/globals.logger-DusiFsxN.mjs +35 -0
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.cjs +13 -3
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.js +14 -4
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs +24 -6
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js +25 -7
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js.map +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.cjs +7 -8
- package/dist/martyrs/src/modules/chats/store/chat.store.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.js +7 -8
- package/dist/martyrs/src/modules/chats/store/chat.store.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.cjs +6 -8
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.js +6 -8
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +11 -8
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +11 -8
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +5 -5
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +5 -5
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +17 -9
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +17 -9
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.cjs +16 -4
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.js +16 -4
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs +7 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +7 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.cjs +112 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js +112 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs +18 -12
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +18 -12
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +200 -92
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +213 -105
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +9 -12
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +10 -13
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +14 -6
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +23 -15
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs +16 -99
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +16 -99
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +99 -99
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +102 -102
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.cjs +14 -8
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +15 -9
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/store/orders.cjs +51 -0
- package/dist/martyrs/src/modules/orders/store/orders.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/orders.js +51 -0
- package/dist/martyrs/src/modules/orders/store/orders.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +59 -56
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +63 -60
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/store/organizations.cjs +0 -2
- package/dist/martyrs/src/modules/organizations/store/organizations.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/store/organizations.js +1 -3
- package/dist/martyrs/src/modules/organizations/store/organizations.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +4 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +5 -4
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs +15 -12
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +15 -12
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.cjs +2 -2
- package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.js +2 -2
- package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/orders.server.js +11 -4
- package/dist/orders.server.mjs +10 -3
- package/dist/organizations.server.js +33 -30
- package/dist/organizations.server.mjs +33 -30
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/{queryProcessor-CCmHM0yi.mjs → queryProcessor-CWnMIe2U.mjs} +4 -1
- package/dist/{queryProcessor-CwQakZkT.js → queryProcessor-D6GuKfTV.js} +4 -1
- package/dist/rents.server.js +4 -3
- package/dist/rents.server.mjs +3 -2
- package/dist/spots.server.js +41 -12
- package/dist/spots.server.mjs +41 -12
- package/dist/style.css +57 -65
- package/dist/wallet.server.js +1 -1
- package/dist/wallet.server.mjs +1 -1
- package/package.json +1 -1
- package/src/modules/chats/components/pages/ChatPage.vue +18 -23
- package/src/modules/chats/components/sections/ChatWindow.vue +55 -38
- package/src/modules/chats/store/chat.store.js +20 -21
- package/src/modules/globals/controllers/utils/queryProcessor.js +2 -1
- package/src/modules/globals/views/classes/globals.websocket.js +10 -11
- package/src/modules/globals/views/components/layouts/Client.vue +21 -15
- package/src/modules/globals/views/components/partials/Header.vue +3 -4
- package/src/modules/globals/views/components/partials/Navigation.vue +17 -19
- package/src/modules/globals/views/components/partials/Sidebar.vue +20 -9
- package/src/modules/marketplace/views/components/sections/SectionMenu.vue +1 -1
- package/src/modules/notifications/components/elements/NotificationBadge.vue +7 -0
- package/src/modules/orders/components/blocks/CardOrderBackoffice.vue +106 -0
- package/src/modules/orders/components/blocks/CardOrderItem.vue +2 -2
- package/src/modules/orders/components/blocks/CardOrderUser.vue +16 -9
- package/src/modules/orders/components/pages/OrderBackoffice.vue +146 -77
- package/src/modules/orders/components/pages/OrderCreate.vue +7 -12
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +15 -3
- package/src/modules/orders/components/pages/Orders.vue +10 -93
- package/src/modules/orders/components/partials/ShopCart.vue +2 -2
- package/src/modules/orders/components/sections/FormDelivery.vue +35 -43
- package/src/modules/orders/components/sections/FormPayment.vue +17 -7
- package/src/modules/orders/controllers/orders.controller.js +12 -1
- package/src/modules/orders/store/orders.js +65 -0
- package/src/modules/organizations/components/pages/Organization.vue +48 -47
- package/src/modules/organizations/controllers/organizations.controller.js +57 -47
- package/src/modules/organizations/store/organizations.js +6 -6
- package/src/modules/products/components/pages/Products.vue +4 -3
- package/src/modules/spots/components/blocks/CardSpot.vue +8 -7
- package/src/modules/spots/controllers/spots.controller.js +47 -14
- package/src/modules/spots/routes/spots.routes.js +2 -3
- package/src/modules/spots/store/spots.js +4 -4
- package/src/styles/base/shadow_transitions_hover_refactor.scss +1 -0
- package/src/modules/landing/components/sections/HowToBuyWDR.vue +0 -130
- package/src/modules/landing/components/sections/WhatIsWDRSection.vue +0 -116
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { ref, onMounted, computed, createElementBlock, createCommentVNode, openBlock, createVNode, createElementVNode, createTextVNode, toDisplayString, Fragment, renderList, normalizeClass,
|
|
1
|
+
import { ref, onMounted, computed, createElementBlock, createCommentVNode, openBlock, createVNode, createElementVNode, createTextVNode, toDisplayString, Fragment, renderList, normalizeClass, withCtx, createBlock, unref } from "vue";
|
|
2
2
|
import { useRouter, useRoute } from "vue-router";
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
/* empty css */
|
|
3
|
+
import _sfc_main$2 from "../../../../components/Button/Button.vue.js";
|
|
4
|
+
import Select from "../../../../components/Select/Select.vue.js";
|
|
6
5
|
import _sfc_main$1 from "../../../../components/Popup/Popup.vue2.js";
|
|
7
6
|
import IconTime from "../../../icons/entities/IconTime.vue.js";
|
|
8
|
-
import _sfc_main$
|
|
9
|
-
import _sfc_main$
|
|
10
|
-
import _sfc_main$
|
|
11
|
-
import _sfc_main$
|
|
12
|
-
|
|
13
|
-
import { state } from "../../../
|
|
14
|
-
import {
|
|
7
|
+
import _sfc_main$3 from "../blocks/CardOrderItem.vue.js";
|
|
8
|
+
import _sfc_main$5 from "../../../organizations/components/blocks/CardOrganization.vue.js";
|
|
9
|
+
import _sfc_main$6 from "../../../chats/components/pages/ChatPage.vue.js";
|
|
10
|
+
import _sfc_main$4 from "../elements/PriceTotal.vue.js";
|
|
11
|
+
/* empty css */
|
|
12
|
+
import { state } from "../../../globals/views/store/globals.js";
|
|
13
|
+
import { state as state$1 } from "../../../auth/views/store/auth.js";
|
|
14
|
+
import { actions, mutations, state as state$2 } from "../../store/orders.js";
|
|
15
15
|
import "../../../products/store/products.js";
|
|
16
16
|
import { actions as actions$1 } from "../../../organizations/store/organizations.js";
|
|
17
17
|
import { useI18n } from "vue-i18n";
|
|
18
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
18
19
|
const _hoisted_1 = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "pd-thin bg-white"
|
|
@@ -27,38 +28,41 @@ const _hoisted_3 = { class: "mn-b-small flex-nowrap flex" };
|
|
|
27
28
|
const _hoisted_4 = { class: "t-medium p-medium" };
|
|
28
29
|
const _hoisted_5 = { class: "p-small t-transp" };
|
|
29
30
|
const _hoisted_6 = { class: "flex-nowrap flex gap-thin pos-relative" };
|
|
30
|
-
const _hoisted_7 = {
|
|
31
|
+
const _hoisted_7 = { class: "flex gap-thin flex-column mn-b-thin" };
|
|
32
|
+
const _hoisted_8 = {
|
|
31
33
|
key: 1,
|
|
32
|
-
class: "bg-light pd-thin mn-b-thin pd-thin radius-extra flex-nowrap flex"
|
|
33
|
-
};
|
|
34
|
-
const _hoisted_8 = { class: "w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-light-transp-20" };
|
|
35
|
-
const _hoisted_9 = { class: "t-medium mn-r-auto" };
|
|
36
|
-
const _hoisted_10 = {
|
|
37
|
-
key: 2,
|
|
38
34
|
class: "gap-thin cols-2"
|
|
39
35
|
};
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
36
|
+
const _hoisted_9 = { class: "w-100" };
|
|
37
|
+
const _hoisted_10 = { class: "mn-b-thin bg-light w-100 o-hidden radius-medium" };
|
|
38
|
+
const _hoisted_11 = { class: "pd-small flex-nowrap flex" };
|
|
39
|
+
const _hoisted_12 = { class: "mn-r-auto" };
|
|
40
|
+
const _hoisted_13 = { class: "t-lh-075 h2 d-block mn-b-small" };
|
|
41
|
+
const _hoisted_14 = { class: "pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max" };
|
|
42
|
+
const _hoisted_15 = {
|
|
47
43
|
key: 0,
|
|
48
44
|
class: "pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid"
|
|
49
45
|
};
|
|
46
|
+
const _hoisted_16 = { class: "w-100 t-right" };
|
|
47
|
+
const _hoisted_17 = { class: "pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid" };
|
|
50
48
|
const _hoisted_18 = { class: "w-100 t-right" };
|
|
51
49
|
const _hoisted_19 = { class: "pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid" };
|
|
52
50
|
const _hoisted_20 = { class: "w-100 t-right" };
|
|
53
51
|
const _hoisted_21 = { class: "pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid" };
|
|
54
|
-
const _hoisted_22 = { class: "w-
|
|
55
|
-
const _hoisted_23 = {
|
|
56
|
-
const _hoisted_24 = {
|
|
52
|
+
const _hoisted_22 = { class: "w-max t-right" };
|
|
53
|
+
const _hoisted_23 = {
|
|
57
54
|
key: 1,
|
|
55
|
+
class: "o-y-scroll bg-light pd-thin mn-b-thin pd-thin radius-medium flex-nowrap flex"
|
|
56
|
+
};
|
|
57
|
+
const _hoisted_24 = { class: "flex-child-default mn-r-small w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-light-transp-20" };
|
|
58
|
+
const _hoisted_25 = { class: "t-medium mn-r-auto" };
|
|
59
|
+
const _hoisted_26 = { class: "bg-light radius-medium pd-medium mn-r-bold w-100" };
|
|
60
|
+
const _hoisted_27 = {
|
|
61
|
+
key: 2,
|
|
58
62
|
class: "t-transp"
|
|
59
63
|
};
|
|
60
|
-
const
|
|
61
|
-
const
|
|
64
|
+
const _hoisted_28 = { class: "bg-light radius-medium pd-medium w-100" };
|
|
65
|
+
const _hoisted_29 = { class: "flex gap-thin flex-column mn-b-thin" };
|
|
62
66
|
const _sfc_main = {
|
|
63
67
|
__name: "OrderBackoffice",
|
|
64
68
|
setup(__props) {
|
|
@@ -69,12 +73,8 @@ const _sfc_main = {
|
|
|
69
73
|
const order = ref(null);
|
|
70
74
|
ref(null);
|
|
71
75
|
const orderOrganization = ref(null);
|
|
72
|
-
const statuses =
|
|
73
|
-
|
|
74
|
-
const isActiveStatus = (index) => {
|
|
75
|
-
return statuses.slice(index).includes(order.value.status);
|
|
76
|
-
};
|
|
77
|
-
if (route.meta.context === "user" && state.user && route.params._id !== ((_a = state.user) == null ? void 0 : _a._id) && !((_c = (_b = state.access) == null ? void 0 : _b.roles) == null ? void 0 : _c.includes("ROLE_MODERATOR")) && !((_e = (_d = state.access) == null ? void 0 : _d.roles) == null ? void 0 : _e.includes("ROLE_ADMIN"))) {
|
|
76
|
+
const statuses = state.options.orders.statuses;
|
|
77
|
+
if (route.meta.context === "user" && state$1.user && route.params._id !== ((_a = state$1.user) == null ? void 0 : _a._id) && !((_c = (_b = state$1.access) == null ? void 0 : _b.roles) == null ? void 0 : _c.includes("ROLE_MODERATOR")) && !((_e = (_d = state$1.access) == null ? void 0 : _d.roles) == null ? void 0 : _e.includes("ROLE_ADMIN"))) {
|
|
78
78
|
router.push("/401");
|
|
79
79
|
}
|
|
80
80
|
const isOpeStatusPopup = ref(false);
|
|
@@ -87,13 +87,27 @@ const _sfc_main = {
|
|
|
87
87
|
isOpeStatusPopup.value = false;
|
|
88
88
|
selectedMember.value = null;
|
|
89
89
|
}
|
|
90
|
+
const isOpenPaymentPopup = ref(false);
|
|
91
|
+
const selectedPayments = ref({
|
|
92
|
+
type: null,
|
|
93
|
+
status: null
|
|
94
|
+
});
|
|
95
|
+
function openPaymentPopup() {
|
|
96
|
+
selectedPayments.value.type = order.value.payment.type;
|
|
97
|
+
selectedPayments.value.status = order.value.payment.status;
|
|
98
|
+
isOpenPaymentPopup.value = true;
|
|
99
|
+
}
|
|
100
|
+
function closePaymentPopup() {
|
|
101
|
+
isOpenPaymentPopup.value = false;
|
|
102
|
+
}
|
|
90
103
|
onMounted(async () => {
|
|
91
104
|
var _a2, _b2;
|
|
92
105
|
order.value = await actions.read({ _id: route.params.order });
|
|
93
106
|
order.value = order.value[0];
|
|
94
107
|
orderOrganization.value = await actions$1.read({
|
|
95
108
|
_id: (_a2 = order.value) == null ? void 0 : _a2.owner.target._id,
|
|
96
|
-
location: (_b2 = state
|
|
109
|
+
location: (_b2 = state.position) == null ? void 0 : _b2.location,
|
|
110
|
+
lookup: ["spots"]
|
|
97
111
|
});
|
|
98
112
|
});
|
|
99
113
|
let cartTotalPrice = computed(() => {
|
|
@@ -116,20 +130,28 @@ const _sfc_main = {
|
|
|
116
130
|
}, 0));
|
|
117
131
|
});
|
|
118
132
|
function getNextStatus(currentStatus) {
|
|
119
|
-
const currentIndex = statuses.
|
|
133
|
+
const currentIndex = state.options.orders.statuses.findIndex((status) => status.value === currentStatus);
|
|
120
134
|
if (currentIndex !== -1 && currentIndex + 1 < statuses.length) {
|
|
121
|
-
return statuses[currentIndex + 1];
|
|
135
|
+
return state.options.orders.statuses[currentIndex + 1];
|
|
122
136
|
}
|
|
123
137
|
return null;
|
|
124
138
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
const isActiveStatus = (index) => {
|
|
140
|
+
return state.options.orders.statuses.slice(index).some((status) => status.value === order.value.status);
|
|
141
|
+
};
|
|
142
|
+
async function changePaymentStatus() {
|
|
143
|
+
if (selectedPayments.value.status && selectedPayments.value.type) {
|
|
144
|
+
state$2.current.payment = selectedPayments.value;
|
|
145
|
+
await actions.update(state$2.current);
|
|
146
|
+
} else {
|
|
147
|
+
console.error("Payment status is void. Must handle somehow.");
|
|
148
|
+
}
|
|
149
|
+
closePaymentPopup();
|
|
128
150
|
}
|
|
129
151
|
async function setNextStatus() {
|
|
130
152
|
const nextStatus = getNextStatus(state$2.current.status);
|
|
131
153
|
if (nextStatus) {
|
|
132
|
-
state$2.current.status = nextStatus;
|
|
154
|
+
state$2.current.status = nextStatus.value;
|
|
133
155
|
await actions.update(state$2.current);
|
|
134
156
|
} else {
|
|
135
157
|
console.error("Next status is void. Must handle somehow.");
|
|
@@ -137,18 +159,18 @@ const _sfc_main = {
|
|
|
137
159
|
closeStatusPopup();
|
|
138
160
|
}
|
|
139
161
|
return (_ctx, _cache) => {
|
|
140
|
-
var _a2, _b2, _c2, _d2, _e2, _f, _g;
|
|
162
|
+
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k;
|
|
141
163
|
return order.value && orderOrganization.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
142
164
|
order.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
143
165
|
createElementVNode("div", _hoisted_3, [
|
|
144
166
|
createElementVNode("p", _hoisted_4, [
|
|
145
|
-
_cache[
|
|
167
|
+
_cache[2] || (_cache[2] = createTextVNode(" Order No: ")),
|
|
146
168
|
createElementVNode("span", _hoisted_5, "#" + toDisplayString(order.value._id), 1)
|
|
147
169
|
])
|
|
148
170
|
]),
|
|
149
171
|
createElementVNode("div", _hoisted_6, [
|
|
150
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(statuses, (status, index) => {
|
|
151
|
-
return
|
|
172
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(state.options.orders.statuses, (status, index) => {
|
|
173
|
+
return openBlock(), createElementBlock("div", {
|
|
152
174
|
key: index,
|
|
153
175
|
class: "w-20"
|
|
154
176
|
}, [
|
|
@@ -157,51 +179,110 @@ const _sfc_main = {
|
|
|
157
179
|
"bg-white br-anim br-glow radius-extra h-1r w-100",
|
|
158
180
|
{ "br-glow-anim": isActiveStatus(index) },
|
|
159
181
|
{ "t-transp": !isActiveStatus(index) },
|
|
160
|
-
{ "blink": order.value.status ===
|
|
182
|
+
{ "blink": order.value.status === status.value && getNextStatus(order.value.status) }
|
|
161
183
|
])
|
|
162
184
|
}, null, 2),
|
|
163
185
|
createElementVNode("div", {
|
|
164
186
|
class: normalizeClass([{ "t-transp": !isActiveStatus(index) }, "mn-t-thin p-small t-medium uppercase"])
|
|
165
|
-
}, toDisplayString(
|
|
187
|
+
}, toDisplayString(status.value), 3)
|
|
166
188
|
]);
|
|
167
|
-
}),
|
|
189
|
+
}), 128))
|
|
168
190
|
])
|
|
169
191
|
])) : createCommentVNode("", true),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
192
|
+
createVNode(_sfc_main$1, {
|
|
193
|
+
title: "Change payment",
|
|
194
|
+
onClosePopup: closePaymentPopup,
|
|
195
|
+
isPopupOpen: isOpenPaymentPopup.value,
|
|
196
|
+
class: "bg-light w-min-25r w-max-25r radius-medium pd-big"
|
|
197
|
+
}, {
|
|
198
|
+
default: withCtx(() => [
|
|
199
|
+
createVNode(Select, {
|
|
200
|
+
select: selectedPayments.value.type,
|
|
201
|
+
"onUpdate:select": _cache[0] || (_cache[0] = ($event) => selectedPayments.value.type = $event),
|
|
202
|
+
property: "value",
|
|
203
|
+
label: "Type",
|
|
204
|
+
options: [
|
|
205
|
+
{ name: "Cash", value: "cash" },
|
|
206
|
+
{ name: "Card", value: "card" },
|
|
207
|
+
{ name: "Bank Transfer", value: "bank" }
|
|
208
|
+
],
|
|
209
|
+
placeholder: "Select type of payment",
|
|
210
|
+
size: "small",
|
|
211
|
+
class: "bg-white mn-b-thin pd-regular radius-small w-100"
|
|
212
|
+
}, null, 8, ["select"]),
|
|
213
|
+
createVNode(Select, {
|
|
214
|
+
select: selectedPayments.value.status,
|
|
215
|
+
"onUpdate:select": _cache[1] || (_cache[1] = ($event) => selectedPayments.value.status = $event),
|
|
216
|
+
property: "value",
|
|
217
|
+
label: "Status",
|
|
218
|
+
options: [
|
|
219
|
+
{ name: "Unpaid", value: "unpaid" },
|
|
220
|
+
{ name: "Paid", value: "paid" },
|
|
221
|
+
{ name: "Refunded", value: "refunded" }
|
|
222
|
+
],
|
|
223
|
+
placeholder: "Select status of payment",
|
|
224
|
+
size: "small",
|
|
225
|
+
class: "bg-white mn-b-small pd-regular radius-small w-100"
|
|
226
|
+
}, null, 8, ["select"]),
|
|
227
|
+
createVNode(_sfc_main$2, {
|
|
228
|
+
submit: changePaymentStatus,
|
|
229
|
+
class: "t-white w-100 bg-second"
|
|
230
|
+
}, {
|
|
231
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
232
|
+
createElementVNode("span", null, "Change Status", -1)
|
|
233
|
+
])),
|
|
234
|
+
_: 1
|
|
235
|
+
})
|
|
181
236
|
]),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
onClick: openStatusPopup,
|
|
185
|
-
class: "mn-l-auto bg-black t-white button"
|
|
186
|
-
}, " Mark as " + toDisplayString(getStatusLabel(getNextStatus(order.value.status))), 1)) : createCommentVNode("", true)
|
|
187
|
-
])) : createCommentVNode("", true),
|
|
237
|
+
_: 1
|
|
238
|
+
}, 8, ["isPopupOpen"]),
|
|
188
239
|
createVNode(_sfc_main$1, {
|
|
189
|
-
title: "Change status",
|
|
240
|
+
title: "Change order status",
|
|
190
241
|
onClosePopup: closeStatusPopup,
|
|
191
242
|
isPopupOpen: isOpeStatusPopup.value,
|
|
192
243
|
class: "bg-light w-min-30r w-max-30r radius-medium pd-big"
|
|
193
244
|
}, {
|
|
194
|
-
default: withCtx(() =>
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
245
|
+
default: withCtx(() => {
|
|
246
|
+
var _a3, _b3, _c3, _d3, _e3, _f2, _g2, _h2;
|
|
247
|
+
return [
|
|
248
|
+
createElementVNode("ul", _hoisted_7, [
|
|
249
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(order.value.positions, (product, index) => {
|
|
250
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
251
|
+
key: product._id,
|
|
252
|
+
editable: true,
|
|
253
|
+
product,
|
|
254
|
+
increase: (product2) => mutations.incrementItemQuantity(order.value, product2._id),
|
|
255
|
+
decrease: (product2) => mutations.decrementItemQuantity(order.value, product2._id),
|
|
256
|
+
remove: (product2) => mutations.removeProduct(order.value, product2._id),
|
|
257
|
+
onUpdateRentDates: (product2, dates) => _ctx.shopcart.actions.updateRentDates({ positions: order.value.positions, productId: product2._id, dates }),
|
|
258
|
+
class: "bg-white radius-small pd-small"
|
|
259
|
+
}, null, 8, ["product", "increase", "decrease", "remove", "onUpdateRentDates"]);
|
|
260
|
+
}), 128))
|
|
261
|
+
]),
|
|
262
|
+
createVNode(_sfc_main$4, {
|
|
263
|
+
totalPrice: unref(cartTotalPrice),
|
|
264
|
+
currency: _ctx.returnCurrency(),
|
|
265
|
+
showFees: (_b3 = (_a3 = state.options) == null ? void 0 : _a3.orders) == null ? void 0 : _b3.showFees,
|
|
266
|
+
feesRate: ((_d3 = (_c3 = state.options) == null ? void 0 : _c3.orders) == null ? void 0 : _d3.feesRate) || 0,
|
|
267
|
+
showVat: (_f2 = (_e3 = state.options) == null ? void 0 : _e3.orders) == null ? void 0 : _f2.showVat,
|
|
268
|
+
vatRate: ((_h2 = (_g2 = state.options) == null ? void 0 : _g2.orders) == null ? void 0 : _h2.vatRate) || 0
|
|
269
|
+
}, null, 8, ["totalPrice", "currency", "showFees", "feesRate", "showVat", "vatRate"]),
|
|
270
|
+
createVNode(_sfc_main$2, {
|
|
271
|
+
submit: setNextStatus,
|
|
272
|
+
class: "t-white w-100 bg-second"
|
|
273
|
+
}, {
|
|
274
|
+
default: withCtx(() => [
|
|
275
|
+
createElementVNode("span", null, toDisplayString("Confirm Changing to " + getNextStatus(order.value.status).label), 1)
|
|
276
|
+
]),
|
|
277
|
+
_: 1
|
|
278
|
+
})
|
|
279
|
+
];
|
|
280
|
+
}),
|
|
200
281
|
_: 1
|
|
201
282
|
}, 8, ["isPopupOpen"]),
|
|
202
|
-
order.value ? (openBlock(), createElementBlock("div",
|
|
203
|
-
createElementVNode("div",
|
|
204
|
-
orderOrganization.value[0] ? (openBlock(), createBlock(_sfc_main$
|
|
283
|
+
order.value ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
284
|
+
createElementVNode("div", _hoisted_9, [
|
|
285
|
+
orderOrganization.value[0] ? (openBlock(), createBlock(_sfc_main$5, {
|
|
205
286
|
key: 0,
|
|
206
287
|
organization: orderOrganization.value[0],
|
|
207
288
|
showRating: true,
|
|
@@ -209,42 +290,69 @@ const _sfc_main = {
|
|
|
209
290
|
showProducts: false,
|
|
210
291
|
class: "bg-light mn-b-thin w-100 o-hidden radius-medium pd-small"
|
|
211
292
|
}, null, 8, ["organization"])) : createCommentVNode("", true),
|
|
212
|
-
createElementVNode("div",
|
|
213
|
-
createElementVNode("div",
|
|
214
|
-
createElementVNode("div",
|
|
215
|
-
_cache[
|
|
216
|
-
createElementVNode("span",
|
|
217
|
-
createElementVNode("p",
|
|
293
|
+
createElementVNode("div", _hoisted_10, [
|
|
294
|
+
createElementVNode("div", _hoisted_11, [
|
|
295
|
+
createElementVNode("div", _hoisted_12, [
|
|
296
|
+
_cache[4] || (_cache[4] = createElementVNode("span", { class: "d-block t-medium p-medium" }, "Order is", -1)),
|
|
297
|
+
createElementVNode("span", _hoisted_13, toDisplayString(order.value.status), 1),
|
|
298
|
+
createElementVNode("p", _hoisted_14, toDisplayString(_ctx.formatDate(order.value.updatedAt, { language: unref(locale) })), 1)
|
|
218
299
|
])
|
|
219
300
|
]),
|
|
220
|
-
((_a2 = order.value.customer.target) == null ? void 0 : _a2.number) ? (openBlock(), createElementBlock("div",
|
|
221
|
-
_cache[
|
|
222
|
-
createElementVNode("p",
|
|
301
|
+
((_a2 = order.value.customer.target) == null ? void 0 : _a2.number) ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
302
|
+
_cache[5] || (_cache[5] = createElementVNode("p", { class: "w-100 t-medium p-medium" }, " Phone ", -1)),
|
|
303
|
+
createElementVNode("p", _hoisted_16, toDisplayString(((_b2 = order.value.customer.target) == null ? void 0 : _b2.number) || "Not specified"), 1)
|
|
223
304
|
])) : createCommentVNode("", true),
|
|
305
|
+
createElementVNode("div", _hoisted_17, [
|
|
306
|
+
_cache[6] || (_cache[6] = createElementVNode("p", { class: "t-medium p-medium" }, " Address ", -1)),
|
|
307
|
+
createElementVNode("p", _hoisted_18, toDisplayString(order.value.delivery.address || order.value.delivery.spot[0].profile.name + ", " + order.value.delivery.spot[0].address || "Not specified"), 1)
|
|
308
|
+
]),
|
|
224
309
|
createElementVNode("div", _hoisted_19, [
|
|
225
|
-
_cache[
|
|
226
|
-
createElementVNode("p", _hoisted_20, toDisplayString(order.value.delivery.
|
|
310
|
+
_cache[7] || (_cache[7] = createElementVNode("p", { class: "t-medium p-medium" }, " Delivery ", -1)),
|
|
311
|
+
createElementVNode("p", _hoisted_20, toDisplayString(order.value.delivery.type ? order.value.delivery.type : "Not specified"), 1)
|
|
227
312
|
]),
|
|
228
313
|
createElementVNode("div", _hoisted_21, [
|
|
229
|
-
_cache[
|
|
230
|
-
createElementVNode("p", _hoisted_22, toDisplayString(order.value.
|
|
314
|
+
_cache[8] || (_cache[8] = createElementVNode("p", { class: "mn-r-auto t-medium p-medium" }, " Payment ", -1)),
|
|
315
|
+
createElementVNode("p", _hoisted_22, toDisplayString(order.value.payment.type ? order.value.payment.type : "Not specified"), 1),
|
|
316
|
+
createElementVNode("p", {
|
|
317
|
+
onClick: openPaymentPopup,
|
|
318
|
+
class: "w-max pd-thin radius-small bg-second t-white mn-l-thin cursor-pointer hover-bg-black t-right"
|
|
319
|
+
}, toDisplayString(order.value.payment.status ? order.value.payment.status : "Unpaid"), 1)
|
|
231
320
|
])
|
|
232
321
|
]),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
322
|
+
unref(route).meta.context !== "user" ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
323
|
+
createElementVNode("div", _hoisted_24, [
|
|
324
|
+
createVNode(IconTime, {
|
|
325
|
+
class: "i-semi t-transp",
|
|
326
|
+
fill: "rgb(var(--black)"
|
|
327
|
+
}),
|
|
328
|
+
createElementVNode("p", _hoisted_25, [
|
|
329
|
+
_cache[9] || (_cache[9] = createElementVNode("span", { class: "p-small t-transp" }, "Estimated Reaction", -1)),
|
|
330
|
+
_cache[10] || (_cache[10] = createElementVNode("br", null, null, -1)),
|
|
331
|
+
createTextVNode(toDisplayString(_ctx.formatDate(order.value.deadline, { language: unref(locale) })), 1)
|
|
332
|
+
])
|
|
333
|
+
]),
|
|
334
|
+
getNextStatus(order.value.status) ? (openBlock(), createElementBlock("button", {
|
|
335
|
+
key: 0,
|
|
336
|
+
onClick: openStatusPopup,
|
|
337
|
+
class: "flex-child-default mn-l-auto bg-black t-white button"
|
|
338
|
+
}, " Mark as " + toDisplayString(getNextStatus(order.value.status).label), 1)) : createCommentVNode("", true)
|
|
339
|
+
])) : createCommentVNode("", true),
|
|
340
|
+
createElementVNode("div", _hoisted_26, [
|
|
341
|
+
_cache[11] || (_cache[11] = createElementVNode("h3", { class: "mn-b-small" }, "Chat With Us", -1)),
|
|
342
|
+
createVNode(_sfc_main$6, {
|
|
236
343
|
username: ["Order", "UserOrder"].includes(unref(route).name) ? ((_c2 = order.value.user) == null ? void 0 : _c2.name) || "User" : "Support",
|
|
344
|
+
user: state$1.user._id,
|
|
237
345
|
chatID: unref(route).params.order,
|
|
238
346
|
class: "radius-semi bs-black bg-light o-hidden"
|
|
239
|
-
}, null, 8, ["username", "chatID"])
|
|
347
|
+
}, null, 8, ["username", "user", "chatID"])
|
|
240
348
|
]),
|
|
241
|
-
_ctx.payment && _ctx.payment.Status === "CONFIRMED" ? (openBlock(), createElementBlock("span",
|
|
349
|
+
_ctx.payment && _ctx.payment.Status === "CONFIRMED" ? (openBlock(), createElementBlock("span", _hoisted_27, "Paid")) : createCommentVNode("", true)
|
|
242
350
|
]),
|
|
243
|
-
createElementVNode("div",
|
|
244
|
-
_cache[
|
|
245
|
-
createElementVNode("ul",
|
|
351
|
+
createElementVNode("div", _hoisted_28, [
|
|
352
|
+
_cache[12] || (_cache[12] = createElementVNode("h3", { class: "mn-b-small" }, "Order Summary", -1)),
|
|
353
|
+
createElementVNode("ul", _hoisted_29, [
|
|
246
354
|
(openBlock(true), createElementBlock(Fragment, null, renderList(order.value.positions, (product, index) => {
|
|
247
|
-
return openBlock(), createBlock(_sfc_main$
|
|
355
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
248
356
|
key: product._id,
|
|
249
357
|
editable: false,
|
|
250
358
|
product,
|
|
@@ -252,13 +360,13 @@ const _sfc_main = {
|
|
|
252
360
|
}, null, 8, ["product"]);
|
|
253
361
|
}), 128))
|
|
254
362
|
]),
|
|
255
|
-
createVNode(_sfc_main$
|
|
363
|
+
createVNode(_sfc_main$4, {
|
|
256
364
|
totalPrice: unref(cartTotalPrice),
|
|
257
365
|
currency: _ctx.returnCurrency(),
|
|
258
|
-
showFees: (_d2 = state
|
|
259
|
-
feesRate: ((
|
|
260
|
-
showVat: (
|
|
261
|
-
vatRate: ((
|
|
366
|
+
showFees: (_e2 = (_d2 = state.options) == null ? void 0 : _d2.orders) == null ? void 0 : _e2.showFees,
|
|
367
|
+
feesRate: ((_g = (_f = state.options) == null ? void 0 : _f.orders) == null ? void 0 : _g.feesRate) || 0,
|
|
368
|
+
showVat: (_i = (_h = state.options) == null ? void 0 : _h.orders) == null ? void 0 : _i.showVat,
|
|
369
|
+
vatRate: ((_k = (_j = state.options) == null ? void 0 : _j.orders) == null ? void 0 : _k.vatRate) || 0
|
|
262
370
|
}, null, 8, ["totalPrice", "currency", "showFees", "feesRate", "showVat", "vatRate"])
|
|
263
371
|
])
|
|
264
372
|
])) : createCommentVNode("", true)
|
|
@@ -266,7 +374,7 @@ const _sfc_main = {
|
|
|
266
374
|
};
|
|
267
375
|
}
|
|
268
376
|
};
|
|
269
|
-
const OrderBackoffice = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
377
|
+
const OrderBackoffice = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c30b339c"]]);
|
|
270
378
|
export {
|
|
271
379
|
OrderBackoffice as default
|
|
272
380
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderBackoffice.vue.js","sources":["../../../../../../../src/modules/orders/components/pages/OrderBackoffice.vue"],"sourcesContent":["<template>\n\t<div v-if=\"order && orderOrganization\" class=\"pd-thin bg-white\"> \n\n\t <div v-if=\"order\" class=\"mn-b-thin pos-relative w-100 bg-main radius-medium pd-medium\">\n\t \t<div class=\"mn-b-small flex-nowrap flex\">\n\t\t \t<p class=\"t-medium p-medium\">\n\t\t \tOrder No: <span class=\"p-small t-transp\">#{{order._id}}</span>\n\t\t </p>\n\t\t\t</div>\n\n \t<div class=\"flex-nowrap flex gap-thin pos-relative \">\n\t <div v-for=\"(status, index) in statuses\" :key=\"index\" class=\"w-20\">\n\t <div\n\t \tclass=\"bg-white br-anim br-glow radius-extra h-1r w-100\"\n\t :class=\"\n\t\t\t\t { 'br-glow-anim': isActiveStatus(index) },\n\t\t\t\t { 't-transp': !isActiveStatus(index) },\n\t\t\t\t { 'blink': order.status === statuses[index] && getNextStatus(order.status) }\n\t\t\t\t \"\n\t />\n\t <div \n\t \t:class=\"{ 't-transp': !isActiveStatus(index) }\"\n\t\t\t\t class=\"mn-t-thin p-small t-medium uppercase\">{{ statusLabels[index] }}</div>\n\t \t</div>\n\t\t </div>\n\t </div>\n\n\t <div v-if=\"route.meta.context !== 'user'\" class=\"bg-light pd-thin mn-b-thin pd-thin radius-extra flex-nowrap flex\">\n \t\t<div class=\"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-light-transp-20\">\n \t\t\t<IconTime class=\"i-semi t-transp\" fill=\"rgb(var(--black)\" />\n <p class=\"t-medium mn-r-auto\"><span class=\"p-small t-transp\">Estimated Reaction</span><br>{{formatDate(order.deadline, { language: locale })}}</p>\n\t \t</div>\n\t \t<button v-if=\"getNextStatus(order.status)\" @click=\"openStatusPopup\" class=\"mn-l-auto bg-black t-white button\"> \n\t\t Mark as {{ getStatusLabel(getNextStatus(order.status)) }} \n\t\t </button>\n\n\t\t<!-- <Button v-if=\"order.status !== 'canceled'\" :submit=\"cancelOrder\" class=\"w-max t-white mn-l-thin bg-red\">\n\t\t\t\t<span>Cancel Order</span>\n\t\t\t</Button>\n\n\t\t\t <Button v-if=\"order.status !== 'confirmed'\" :submit=\"confirmOrder\" class=\"w-max t-white mn-l-thin bg-red\">\n\t\t\t\t<span>Confirm Order</span>\n\t\t\t</Button>\n -->\n\n \t</div>\n\n\t <Popup \n title=\"Change status\" \n @close-popup=\"closeStatusPopup\" \n :isPopupOpen=\"isOpeStatusPopup\"\n class=\"bg-light w-min-30r w-max-30r radius-medium pd-big\"\n >\n\n\t\t\t<!-- <VueDatePicker v-model=\"order.deadline\" :hide-navigation=\"['calendar']\" :flow=\"['time']\" class=\"z-index-3 bg-white radius-small pd-small mn-b-thin mn-b-semi\" /> -->\n\n\t\t\t<!-- {{order.deadline}} -->\n<!-- \n\t\t\t<p class=\"t-medium p-medium mn-b-thin\">\n\t\t Positions\n\t\t </p>\n\n \t<ul class=\"bg-white pd-small radius-small flex gap-thin flex-column mn-b-semi\">\n \t\t\t<CardOrderItem\n \t\t\t\tv-for=\"(product, index) in orderProducts\" :key=\"product._id\"\n \t\t\t\t:editable=\"false\" \n \t\t\t\t:product=\"product\" \n \t\t\t/>\n </ul> -->\n \t<button @click=\"setNextStatus\" class=\"w-100 bg-black-small t-white button\">\n \t\t{{'Confirm Changing to ' + getStatusLabel(getNextStatus(order.status))}}\n \t</button>\n\t \t</Popup>\n\n\n\t \n\t <div v-if=\"order\" class=\"gap-thin cols-2\">\n\n\t <div class=\"w-100\">\n\n\n\t\t <CardOrganization \n\t\t \tv-if=\"orderOrganization[0]\"\n\t\t :organization=\"orderOrganization[0]\"\n\t\t :showRating=\"true\"\n\t\t :showFollowers=\"false\"\n\t\t :showProducts=\"false\"\n\t\t class=\"bg-light mn-b-thin w-100 o-hidden radius-medium pd-small \"\n\t\t />\n\n\n\t\t <div \n\t\t \tclass=\"mn-b-thin bg-light w-100 o-hidden radius-medium \"\n\t\t >\n\t\t \t<div class=\"pd-small flex-nowrap flex\">\n\t\t\t \t<div class=\"mn-r-auto\">\n\t\t\t\t \t<span class=\"d-block t-medium p-medium\">Order is</span>\n\t\t\t\t\t <span class=\" t-lh-075 h2 d-block mn-b-small\">{{order.status}}</span>\n\t\t\t\t\t <p class=\"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max\">{{formatDate(order.updatedAt, {language: locale })}}</p>\n\t\t\t\t\t </div>\n\t\t\t\t\t <!-- <div class=\"t-right\">\n\t\t\t\t\t \tCancel order<br>\n\t\t\t\t\t \tExchange item\n\t\t\t\t\t \t<hr class=\"mn-b-thin mn-t-thin\">\n\t\t\t\t\t \tFor Delivery Queries Contact Us\n\t\t\t\t\t \t\n\t\t\t\t\t </div> -->\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"order.customer.target?.number\" class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"w-100 t-medium p-medium\">\n\t\t\t \tPhone\n\t\t\t </p>\n\n\t\t\t <p class=\"w-100 t-right \">\n\t\t\t \t{{order.customer.target?.number || 'Not specified'}}\n\t\t\t </p>\n\t\t\t </div>\n\n\t\t\t <div class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"t-medium p-medium\">\n\t\t\t \tAddress\n\t\t\t </p>\n\n\t\t\t <p class=\"w-100 t-right\">\n\t\t\t {{order.delivery.address || (order.delivery.spot[0].profile.name + ', ' + order.delivery.spot[0].address) || 'Not specified'}} \n\t\t\t </p>\n\t\t\t </div>\n\n\t\t\t <div class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"mn-b-small t-medium p-medium\">\n\t\t\t \tDelivery\n\t\t\t </p>\n\n\t\t\t <p class=\"w-100 t-right mn-b-small\">\n\t\t\t {{order.delivery.type ? order.delivery.type : 'Not specified'}} \n\t\t\t </p>\n\t\t\t </div>\n\n\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t<div class=\"bg-light radius-medium pd-medium mn-r-bold w-100\">\n\t\t <h3 class=\"mn-b-small\">Chat With Us</h3>\n\n\t\t <ChatWindow\n\t\t \t:username=\"['Order', 'UserOrder'].includes(route.name) ? (order.user?.name || 'User') : 'Support'\"\n\t\t \t:chatID=\"route.params.order\"\n\t\t \tclass=\"radius-semi bs-black bg-light o-hidden\"\n\t\t />\n\n\t </div>\n\t \t<!-- <StatusHistory \n\t \t\tv-if=\"orders.state.current.status_history\"\n\t \t\t:statuses=\"statuses\"\n\t \t\t:statusHistory=\"orders.state.current.status_history\"\n\t \t\t:statusCurrent=\"orders.state.current.status\"\n\t \t\t:edit=\"route.name === 'Order Edit'\"\n\t \t/> -->\n\n\t <!-- \t<button \n\t \t@click=\"requestPayment(order)\"\n\t \tv-if=\"\n\t \t\torder.status === 'Подтвержден' \n\t \t\t&& order.payment.type === 'Online'\n\t \t\t&& payment.Status !== 'CONFIRMED'\n\t \t\t&& payment.Status !== 'REFUNDED'\n\t \t\" \n\t \tclass='w-100 button'>Оплатить заказ</button> -->\n\t \t<span class=\"t-transp\" v-if=\"payment && payment.Status === 'CONFIRMED'\">Paid</span> \n\t </div> \n\n\t <div class=\"bg-light radius-medium pd-medium w-100\">\n\t \t\t<h3 class=\"mn-b-small\">Order Summary</h3>\n\n\t \t\t<ul class=\"flex gap-thin flex-column mn-b-thin\">\n\t \t\t\t<CardOrderItem\n\t \t\t\t\tv-for=\"(product, index) in order.positions\" :key=\"product._id\"\n\t \t\t\t\t:editable=\"false\" \n\t \t\t\t\t:product=\"product\" \n\t \t\t\t\tclass=\"bg-white radius-small pd-small\"\n\t \t\t\t/>\n\t </ul>\n\t \n\t <PriceTotal \n :totalPrice=\"cartTotalPrice\"\n :currency=\"returnCurrency()\"\n :showFees=\"globals.state.options?.showFees\"\n :feesRate=\"globals.state.options?.feesRate || 0\"\n :showVat=\"globals.state.options?.showVat\"\n :vatRate=\"globals.state.options?.vatRate || 0\"\n />\n </div>\n\n\t \n\t </div>\n\t</div>\t\t\n\n</template>\n\n\n<script setup=\"props\">\n\timport { computed, ref, onMounted } from 'vue'\n\timport { useRouter, useRoute } from 'vue-router'\n\n\timport Button from '@martyrs/src/components/Button/Button.vue'\n\timport Popup from \"@martyrs/src/components/Popup/Popup.vue\";\n\n\timport IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue'\n\n\t// Block\n\timport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue'\n\timport CardOrganization from '@martyrs/src/modules/organizations/components/blocks/CardOrganization.vue'\n\n\timport ChatWindow from '@martyrs/src/modules/chats/components/pages/ChatPage.vue';\n\n\timport StatusHistory from '@martyrs/src/modules/orders/components/blocks/StatusHistory.vue'\n\timport PriceTotal from '@martyrs/src/modules/orders/components/elements/PriceTotal.vue';\n\n\n\timport * as globals \tfrom '@martyrs/src/modules/globals/views/store/globals'\n\timport * as auth from '@martyrs/src/modules/auth/views/store/auth'\n\timport * as orders \tfrom '@martyrs/src/modules/orders/store/orders'\n\timport * as products \tfrom '@martyrs/src/modules/products/store/products'\n\timport * as organizations \tfrom '@martyrs/src/modules/organizations/store/organizations'\n\n\timport { useI18n } from 'vue-i18n';\n\t\n\tconst { locale } = useI18n();\n\n\tconst router = useRouter()\n\tconst route = useRoute()\n\n\tconst order = ref(null)\n\tconst productsOrganization = ref(null)\n\tconst orderOrganization = ref(null)\n\n\tconst statuses = ['created', 'confirmed', 'preparing', 'inuse', 'finished'];\n\tconst statusLabels = ['Created', 'Confirmed', 'Preparing', 'In use', 'Finished'];\n\n\tconst isActiveStatus = (index) => {\n\t return statuses.slice(index).includes(order.value.status);\n\t};\n\n if (route.meta.context === 'user' && \n auth.state.user && \n route.params._id !== auth.state.user?._id && \n !auth.state.access?.roles?.includes('ROLE_MODERATOR') && \n !auth.state.access?.roles?.includes('ROLE_ADMIN')) {\n router.push('/401');\n }\n\t// description: 'Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.'\n\t// description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'\n\t// description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'\n\t// description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'\n\t// description: 'Your order is currently in transit. Our delivery team is working hard to get your items to you as soon as possible.'\n\t// description: 'Congratulations! Your order has been successfully delivered. If you have any concerns or feedback, feel free to contact us.'\n\n\n\tconst isOpeStatusPopup = ref(false);\n\tconst selectedMember = ref(null);\n\n\tfunction openStatusPopup(member) {\n\t isOpeStatusPopup.value = true;\n\t if (typeof member === \"number\") selectedMember.value = member;\n\t}\n\n\tfunction closeStatusPopup() {\n\t isOpeStatusPopup.value = false;\n\t selectedMember.value = null;\n\t}\n\n\tonMounted(async()=>{\n\t\torder.value = await orders.actions.read({_id: route.params.order})\n\t\torder.value = order.value[0]\n\n\t orderOrganization.value = await organizations.actions.read({\n\t _id: order.value?.owner.target._id,\n\t location: globals.state.position?.location,\n\t });\n\n\t})\n\n\tlet cartTotalPrice = computed(() => {\n return Number(order.value?.positions.reduce((total, product) => {\n // Проверяем тип листинга\n if (product.listing === 'rent') {\n const start = new Date(product.date.start)\n const end = new Date(product.date.end)\n const diffTime = Math.abs(end - start)\n return total + product.price * (Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1);\n } else {\n // Для обычных товаров умножаем на количество\n return total + product.price * (product.quantity || 1);\n }\n }, 0));\n })\n\n\n let cartTotalAmount = computed(() => {\n return Number(order.value?.positions.reduce((total, product) => {\n return total + product.quantity;\n }, 0));\n })\n\n // Функция установки нового статуса\n\tasync function setStatus (newStatus) {\n\t orders.state.current.status = newStatus\n\n\t await orders.actions.update(orders.state.current)\n\t} \n\n\tfunction getNextStatus(currentStatus) {\n const currentIndex = statuses.indexOf(currentStatus);\n\n if (currentIndex !== -1 && currentIndex + 1 < statuses.length) {\n return statuses[currentIndex + 1];\n }\n return null; // Если следующий статус не существует\n }\n\n function getStatusLabel(status) {\n const index = statuses.indexOf(status);\n\n return status ? statusLabels[index] : \"\";\n }\n async function setNextStatus() {\n const nextStatus = getNextStatus(orders.state.current.status);\n\n if (nextStatus) {\n orders.state.current.status = nextStatus;\n\n await orders.actions.update(orders.state.current)\n } else {\n console.error('Next status is void. Must handle somehow.');\n }\n\n\t\tcloseStatusPopup()\n }\n\n async function cancelOrder() {\n \talert()\n\n orders.state.current.status = 'canceled';\n\n await orders.actions.update(orders.state.current)\n}\n\n\n async function confirmOrder() {\n \talert()\n\n orders.state.current.status = 'confirmed';\n\n await orders.actions.update(orders.state.current)\n}\n\n\n\tfunction requestPayment(order) {\n\t\t // store.dispatch(\"payments/newPayment\", order);\n\t}\n\n\tfunction calculateDeliveryTime(distance, date) {\n\t if (!distance) {\n\t return null;\n\t }\n\n\t const basePreparationTime = 10 * 60 * 1000; // Convert to milliseconds\n\t const travelTime = Math.ceil((15 + 5 + 3 * distance) / 5) * 5 * 60 * 1000;\n\n\t // Преобразование даты начала в миллисекунды и добавление времени подготовки и доставки\n\t const startTime = new Date(date).getTime();\n\t const estimatedDeliveryTime = new Date(startTime + basePreparationTime + travelTime);\n\n\t console.log(date)\n\t console.log(estimatedDeliveryTime)\n\n\t return estimatedDeliveryTime;\n\t}\n\n\n</script>\n\n<style lang=\"scss\" scoped>\n\t.blink {\n\t animation: blink-animation 1s ease infinite;\n\t}\n\n\t@keyframes blink-animation {\n\t 0%, 100% {\n\t opacity: 1;\n\t }\n\t 50% {\n\t opacity: 0.8;\n\t }\n\t}\n</style>"],"names":["auth.state","orders.actions","organizations.actions","_a","globals.state","orders.state"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"OrderBackoffice.vue.js","sources":["../../../../../../../src/modules/orders/components/pages/OrderBackoffice.vue"],"sourcesContent":["<template>\n\t<div v-if=\"order && orderOrganization\" class=\"pd-thin bg-white\"> \n\n\t <div v-if=\"order\" class=\"mn-b-thin pos-relative w-100 bg-main radius-medium pd-medium\">\n\t \t<div class=\"mn-b-small flex-nowrap flex\">\n\t\t \t<p class=\"t-medium p-medium\">\n\t\t \tOrder No: <span class=\"p-small t-transp\">#{{order._id}}</span>\n\t\t </p>\n\t\t\t</div>\n\n \t<div class=\"flex-nowrap flex gap-thin pos-relative \">\n\t <div v-for=\"(status, index) in globals.state.options.orders.statuses\" :key=\"index\" class=\"w-20\">\n\t <div\n\t \tclass=\"bg-white br-anim br-glow radius-extra h-1r w-100\"\n\t :class=\"\n\t\t\t\t { 'br-glow-anim': isActiveStatus(index) },\n\t\t\t\t { 't-transp': !isActiveStatus(index) },\n\t\t\t\t { 'blink': order.status === status.value && getNextStatus(order.status) }\n\t\t\t\t \"\n\t />\n\t <div \n\t \t:class=\"{ 't-transp': !isActiveStatus(index) }\"\n\t\t\t\t class=\"mn-t-thin p-small t-medium uppercase\">{{ status.value }}</div>\n\t \t</div>\n\t\t </div>\n\t </div>\n\n \t <Popup \n title=\"Change payment\" \n @close-popup=\"closePaymentPopup\" \n :isPopupOpen=\"isOpenPaymentPopup\"\n class=\"bg-light w-min-25r w-max-25r radius-medium pd-big\"\n >\n \t<Select \n v-model:select=\"selectedPayments.type\"\n :property=\"'value'\"\n label=\"Type\"\n :options=\"[\n {name: 'Cash', value: 'cash'}, \n {name: 'Card', value: 'card'}, \n {name: 'Bank Transfer', value: 'bank'},\n ]\"\n placeholder=\"Select type of payment\" \n size=\"small\"\n class=\"bg-white mn-b-thin pd-regular radius-small w-100\"\n />\n\n <Select \n v-model:select=\"selectedPayments.status\"\n :property=\"'value'\"\n label=\"Status\"\n :options=\"[\n {name: 'Unpaid', value: 'unpaid'}, \n {name: 'Paid', value: 'paid'}, \n {name: 'Refunded', value: 'refunded'},\n ]\"\n placeholder=\"Select status of payment\" \n size=\"small\"\n class=\"bg-white mn-b-small pd-regular radius-small w-100\"\n />\n\n\n <Button :submit=\"changePaymentStatus\" class=\"t-white w-100 bg-second\">\n\t\t\t\t<span>Change Status</span>\n\t\t\t</Button>\n\t \t</Popup>\n\n\t <Popup \n title=\"Change order status\" \n @close-popup=\"closeStatusPopup\" \n :isPopupOpen=\"isOpeStatusPopup\"\n class=\"bg-light w-min-30r w-max-30r radius-medium pd-big\"\n >\n\n\t\t\t<!-- Добавить выбор примерного времени -->\n\n \t<ul class=\"flex gap-thin flex-column mn-b-thin\">\n \t\t\t<CardOrderItem\n \t\t\t\tv-for=\"(product, index) in order.positions\" :key=\"product._id\"\n \t\t\t\t:editable=\"true\" \n \t\t\t\t:product=\"product\" \n \t\t\t\t:increase=\"product => orders.mutations.incrementItemQuantity(order, product._id)\"\n\t :decrease=\"product => orders.mutations.decrementItemQuantity(order, product._id)\"\n\t :remove=\"product => orders.mutations.removeProduct(order, product._id)\"\n\t @updateRentDates=\"(product, dates) => shopcart.actions.updateRentDates({ positions: order.positions, productId: product._id, dates })\"\n \t\t\t\tclass=\"bg-white radius-small pd-small\"\n \t\t\t/>\n </ul>\n \n <PriceTotal \n :totalPrice=\"cartTotalPrice\"\n :currency=\"returnCurrency()\"\n :showFees=\"globals.state.options?.orders?.showFees\"\n :feesRate=\"globals.state.options?.orders?.feesRate || 0\"\n :showVat=\"globals.state.options?.orders?.showVat\"\n :vatRate=\"globals.state.options?.orders?.vatRate || 0\"\n />\n\n \t<Button :submit=\"setNextStatus\" class=\"t-white w-100 bg-second\">\n\t\t\t\t<span>{{'Confirm Changing to ' + (getNextStatus(order.status)).label}}</span>\n\t\t\t</Button>\n\t \t</Popup>\n\n\n\t \n\t <div v-if=\"order\" class=\"gap-thin cols-2\">\n\n\t <div class=\"w-100\">\n\n\n\t\t <CardOrganization \n\t\t \tv-if=\"orderOrganization[0]\"\n\t\t :organization=\"orderOrganization[0]\"\n\t\t :showRating=\"true\"\n\t\t :showFollowers=\"false\"\n\t\t :showProducts=\"false\"\n\t\t class=\"bg-light mn-b-thin w-100 o-hidden radius-medium pd-small \"\n\t\t />\n\n\n\t\t <div \n\t\t \tclass=\"mn-b-thin bg-light w-100 o-hidden radius-medium \"\n\t\t >\n\t\t \t<div class=\"pd-small flex-nowrap flex\">\n\t\t\t \t<div class=\"mn-r-auto\">\n\t\t\t\t \t<span class=\"d-block t-medium p-medium\">Order is</span>\n\t\t\t\t\t <span class=\" t-lh-075 h2 d-block mn-b-small\">{{order.status}}</span>\n\t\t\t\t\t <p class=\"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max\">{{formatDate(order.updatedAt, {language: locale })}}</p>\n\t\t\t\t\t </div>\n\t\t\t\t\t <!-- <div class=\"t-right\">\n\t\t\t\t\t \tCancel order<br>\n\t\t\t\t\t \tExchange item\n\t\t\t\t\t \t<hr class=\"mn-b-thin mn-t-thin\">\n\t\t\t\t\t \tFor Delivery Queries Contact Us\n\t\t\t\t\t \t\n\t\t\t\t\t </div> -->\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"order.customer.target?.number\" class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"w-100 t-medium p-medium\">\n\t\t\t \tPhone\n\t\t\t </p>\n\n\t\t\t <p class=\"w-100 t-right \">\n\t\t\t \t{{order.customer.target?.number || 'Not specified'}}\n\t\t\t </p>\n\t\t\t </div>\n\n\t\t\t <div class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"t-medium p-medium\">\n\t\t\t \tAddress\n\t\t\t </p>\n\n\t\t\t <p class=\"w-100 t-right\">\n\t\t\t {{order.delivery.address || (order.delivery.spot[0].profile.name + ', ' + order.delivery.spot[0].address) || 'Not specified'}} \n\t\t\t </p>\n\t\t\t </div>\n\n\t\t\t <div class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"t-medium p-medium\">\n\t\t\t \tDelivery\n\t\t\t </p>\n\n\t\t\t <p class=\"w-100 t-right \">\n\t\t\t {{order.delivery.type ? order.delivery.type : 'Not specified'}} \n\t\t\t </p>\n\t\t\t </div>\n\n\t\t\t <div class=\"pd-small flex flex-nowrap flex-v-center br-t br-black-transp-10 br-solid\">\n\t\t\t \t<p class=\"mn-r-auto t-medium p-medium\">\n\t\t\t \tPayment\n\t\t\t </p>\n\n\n\t\t\t <p class=\"w-max t-right\">\n\t\t\t {{order.payment.type ? order.payment.type : 'Not specified'}} \n\t\t\t </p>\n\n\t\t\t <p @click=\"openPaymentPopup\" class=\"w-max pd-thin radius-small bg-second t-white mn-l-thin cursor-pointer hover-bg-black t-right\">\n\t\t\t {{order.payment.status ? order.payment.status : 'Unpaid'}} \n\t\t\t </p>\n\t\t\t </div>\n\n\n\t\t\t\t</div>\n\n\t\t\t\t<div v-if=\"route.meta.context !== 'user'\" class=\"o-y-scroll bg-light pd-thin mn-b-thin pd-thin radius-medium flex-nowrap flex\">\n\t\t \t\t<div class=\"flex-child-default mn-r-small w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-light-transp-20\">\n\t\t \t\t\t<IconTime class=\"i-semi t-transp\" fill=\"rgb(var(--black)\" />\n\t\t <p class=\"t-medium mn-r-auto\"><span class=\"p-small t-transp\">Estimated Reaction</span><br>{{formatDate(order.deadline, { language: locale })}}</p>\n\t\t\t \t</div>\n\t\t\t \t<button v-if=\"getNextStatus(order.status)\" @click=\"openStatusPopup\" class=\"flex-child-default mn-l-auto bg-black t-white button\"> \n\t\t\t\t Mark as {{ (getNextStatus(order.status)).label }} \n\t\t\t\t </button>\n\t\t \t</div>\n\n\t\t\t<div class=\"bg-light radius-medium pd-medium mn-r-bold w-100\">\n\t\t <h3 class=\"mn-b-small\">Chat With Us</h3>\n\n\t\t <ChatPage\n\t\t \t:username=\"['Order', 'UserOrder'].includes(route.name) ? (order.user?.name || 'User') : 'Support'\"\n\t\t \t:user=\"auth.state.user._id\"\n\t\t \t:chatID=\"route.params.order\"\n\t\t \tclass=\"radius-semi bs-black bg-light o-hidden\"\n\t\t />\n\n\t </div>\n\t \t<!-- <StatusHistory \n\t \t\tv-if=\"orders.state.current.status_history\"\n\t \t\t:statuses=\"statuses\"\n\t \t\t:statusHistory=\"orders.state.current.status_history\"\n\t \t\t:statusCurrent=\"orders.state.current.status\"\n\t \t\t:edit=\"route.name === 'Order Edit'\"\n\t \t/> -->\n\n\t <!-- \t<button \n\t \t@click=\"requestPayment(order)\"\n\t \tv-if=\"\n\t \t\torder.status === 'Подтвержден' \n\t \t\t&& order.payment.type === 'Online'\n\t \t\t&& payment.Status !== 'CONFIRMED'\n\t \t\t&& payment.Status !== 'REFUNDED'\n\t \t\" \n\t \tclass='w-100 button'>Оплатить заказ</button> -->\n\t \t<span class=\"t-transp\" v-if=\"payment && payment.Status === 'CONFIRMED'\">Paid</span> \n\t </div> \n\n\t <div class=\"bg-light radius-medium pd-medium w-100\">\n\t \t\t<h3 class=\"mn-b-small\">Order Summary</h3>\n\n\t \t\t<ul class=\"flex gap-thin flex-column mn-b-thin\">\n\t \t\t\t<CardOrderItem\n\t \t\t\t\tv-for=\"(product, index) in order.positions\" :key=\"product._id\"\n\t \t\t\t\t:editable=\"false\" \n\t \t\t\t\t:product=\"product\" \n\t \t\t\t\tclass=\"bg-white radius-small pd-small\"\n\t \t\t\t/>\n\t </ul>\n\t \n\t <PriceTotal \n :totalPrice=\"cartTotalPrice\"\n :currency=\"returnCurrency()\"\n :showFees=\"globals.state.options?.orders?.showFees\"\n :feesRate=\"globals.state.options?.orders?.feesRate || 0\"\n :showVat=\"globals.state.options?.orders?.showVat\"\n :vatRate=\"globals.state.options?.orders?.vatRate || 0\"\n />\n \t</div>\n\n\t \n\t </div>\n\t</div>\t\t\n\n</template>\n\n\n<script setup=\"props\">\n\timport { computed, ref, onMounted } from 'vue'\n\timport { useRouter, useRoute } from 'vue-router'\n\n\timport Button from '@martyrs/src/components/Button/Button.vue'\n\timport Select from '@martyrs/src/components/Select/Select.vue'\n\timport Popup from \"@martyrs/src/components/Popup/Popup.vue\";\n\n\timport IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue'\n\n\t// Block\n\timport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue'\n\timport CardOrganization from '@martyrs/src/modules/organizations/components/blocks/CardOrganization.vue'\n\n\timport ChatPage from '@martyrs/src/modules/chats/components/pages/ChatPage.vue';\n\n\timport StatusHistory from '@martyrs/src/modules/orders/components/blocks/StatusHistory.vue'\n\timport PriceTotal from '@martyrs/src/modules/orders/components/elements/PriceTotal.vue';\n\timport FormPayment from '@martyrs/src/modules/orders/components/sections/FormPayment.vue'\n\n\timport * as globals \tfrom '@martyrs/src/modules/globals/views/store/globals'\n\timport * as auth from '@martyrs/src/modules/auth/views/store/auth'\n\timport * as orders \tfrom '@martyrs/src/modules/orders/store/orders'\n\timport * as products \tfrom '@martyrs/src/modules/products/store/products'\n\timport * as organizations \tfrom '@martyrs/src/modules/organizations/store/organizations'\n\n\timport { useI18n } from 'vue-i18n';\n\t\n\tconst { locale } = useI18n();\n\n\tconst router = useRouter()\n\tconst route = useRoute()\n\n\tconst order = ref(null)\n\tconst productsOrganization = ref(null)\n\tconst orderOrganization = ref(null)\n\n\tconst statuses = globals.state.options.orders.statuses\n\tconst statusLabels = ['Created', 'Confirmed', 'Preparing', 'In use', 'Finished'];\n\n if (route.meta.context === 'user' && \n auth.state.user && \n route.params._id !== auth.state.user?._id && \n !auth.state.access?.roles?.includes('ROLE_MODERATOR') && \n !auth.state.access?.roles?.includes('ROLE_ADMIN')) {\n router.push('/401');\n }\n\n\tconst isOpeStatusPopup = ref(false);\n\tconst selectedMember = ref(null);\n\n\tfunction openStatusPopup(member) {\n\t isOpeStatusPopup.value = true;\n\t if (typeof member === \"number\") selectedMember.value = member;\n\t}\n\n\tfunction closeStatusPopup() {\n\t isOpeStatusPopup.value = false;\n\t selectedMember.value = null;\n\t}\n\n\tconst isOpenPaymentPopup = ref(false);\n\n\tconst selectedPayments = ref({\n\t\ttype: null,\n\t\tstatus: null\n\t});\n\n\tfunction openPaymentPopup() {\n\t selectedPayments.value.type = order.value.payment.type\n\t selectedPayments.value.status = order.value.payment.status\n\n\t isOpenPaymentPopup.value = true;\n\t}\n\n\tfunction closePaymentPopup() {\n\t isOpenPaymentPopup.value = false;\n\t}\n\n\tonMounted(async()=>{\n\t\torder.value = await orders.actions.read({_id: route.params.order})\n\t\torder.value = order.value[0]\n\n\t orderOrganization.value = await organizations.actions.read({\n\t _id: order.value?.owner.target._id,\n\t location: globals.state.position?.location,\n\t lookup: ['spots']\n\t });\n\n\t})\n\n\tlet cartTotalPrice = computed(() => {\n return Number(order.value?.positions.reduce((total, product) => {\n // Проверяем тип листинга\n if (product.listing === 'rent') {\n const start = new Date(product.date.start)\n const end = new Date(product.date.end)\n const diffTime = Math.abs(end - start)\n return total + product.price * (Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1);\n } else {\n // Для обычных товаров умножаем на количество\n return total + product.price * (product.quantity || 1);\n }\n }, 0));\n })\n\n\n let cartTotalAmount = computed(() => {\n return Number(order.value?.positions.reduce((total, product) => {\n return total + product.quantity;\n }, 0));\n })\n\n // Функция установки нового статуса\n\tasync function setStatus (newStatus) {\n\t orders.state.current.status = newStatus\n\n\t await orders.actions.update(orders.state.current)\n\t} \n\n\n\tfunction getNextStatus(currentStatus) {\n\t const currentIndex = globals.state.options.orders.statuses.findIndex(status => status.value === currentStatus);\n\n\t if (currentIndex !== -1 && currentIndex + 1 < statuses.length) {\n\t return globals.state.options.orders.statuses[currentIndex + 1];\n\t }\n\t return null; // If next status doesn't exist\n\t}\n\n\tconst isActiveStatus = (index) => {\n\t return globals.state.options.orders.statuses.slice(index).some(status => status.value === order.value.status);\n\t};\n\n async function changePaymentStatus() {\n if (selectedPayments.value.status && selectedPayments.value.type) {\n orders.state.current.payment = selectedPayments.value;\n\n await orders.actions.update(orders.state.current)\n } else {\n console.error('Payment status is void. Must handle somehow.');\n }\n\n\t\tclosePaymentPopup()\n }\n\n async function setNextStatus() {\n const nextStatus = getNextStatus(orders.state.current.status);\n\n if (nextStatus) {\n orders.state.current.status = nextStatus.value;\n\n await orders.actions.update(orders.state.current)\n } else {\n console.error('Next status is void. Must handle somehow.');\n }\n\n\t\tcloseStatusPopup()\n }\n\n async function cancelOrder() {\n \talert()\n\n orders.state.current.status = 'canceled';\n\n await orders.actions.update(orders.state.current)\n}\n\n\n async function confirmOrder() {\n \talert()\n\n orders.state.current.status = 'confirmed';\n\n await orders.actions.update(orders.state.current)\n\t}\n\n\tfunction calculateDeliveryTime(distance, date) {\n\t if (!distance) {\n\t return null;\n\t }\n\n\t const basePreparationTime = 10 * 60 * 1000; // Convert to milliseconds\n\t const travelTime = Math.ceil((15 + 5 + 3 * distance) / 5) * 5 * 60 * 1000;\n\n\t // Преобразование даты начала в миллисекунды и добавление времени подготовки и доставки\n\t const startTime = new Date(date).getTime();\n\t const estimatedDeliveryTime = new Date(startTime + basePreparationTime + travelTime);\n\n\t return estimatedDeliveryTime;\n\t}\n\n\n</script>\n\n<style lang=\"scss\" scoped>\n\t.blink {\n\t animation: blink-animation 1s ease infinite;\n\t}\n\n\t@keyframes blink-animation {\n\t 0%, 100% {\n\t opacity: 1;\n\t }\n\t 50% {\n\t opacity: 0.8;\n\t }\n\t}\n</style>"],"names":["globals.state","auth.state","orders.actions","organizations.actions","_a","orders.state"],"mappings":"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"}
|
|
@@ -66,15 +66,10 @@ const _sfc_main = {
|
|
|
66
66
|
orders.state.current.organization = shopcart.state.organization;
|
|
67
67
|
orderOrganization.value = await organizations.actions.read({
|
|
68
68
|
_id: shopcart.state.organization,
|
|
69
|
-
location: (_a = globals.state.position) == null ? void 0 : _a.location
|
|
69
|
+
location: (_a = globals.state.position) == null ? void 0 : _a.location,
|
|
70
|
+
lookup: ["spots"]
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
|
-
vue.watch(() => orders.state.current.delivery.address, async (newFilterValue, oldFilterValue) => {
|
|
73
|
-
orderOrganization.value = await organizations.actions.read({
|
|
74
|
-
_id: shopcart.state.organization,
|
|
75
|
-
location: orders.state.current.delivery.location
|
|
76
|
-
});
|
|
77
|
-
}, { deep: true });
|
|
78
73
|
const errorName = vue.computed(() => {
|
|
79
74
|
var _a;
|
|
80
75
|
if (((_a = orders.state.current.customer.name) == null ? void 0 : _a.length) < 2) {
|
|
@@ -142,13 +137,13 @@ const _sfc_main = {
|
|
|
142
137
|
}
|
|
143
138
|
let order2 = await orders.actions.create(orders.state.current);
|
|
144
139
|
if (order2) {
|
|
145
|
-
shopcart.actions.resetShopcart();
|
|
146
140
|
router.push({
|
|
147
141
|
name: "Order",
|
|
148
142
|
params: {
|
|
149
143
|
order: order2._id
|
|
150
144
|
}
|
|
151
145
|
});
|
|
146
|
+
shopcart.actions.resetShopcart();
|
|
152
147
|
} else {
|
|
153
148
|
alert("something wrong");
|
|
154
149
|
}
|
|
@@ -172,12 +167,14 @@ const _sfc_main = {
|
|
|
172
167
|
}, null, 8, ["customer"]),
|
|
173
168
|
orders.state.current.status !== true && shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createBlock(FormPayment.default, {
|
|
174
169
|
key: 0,
|
|
175
|
-
order: orders.state.current
|
|
176
|
-
|
|
170
|
+
order: orders.state.current,
|
|
171
|
+
organization: orderOrganization.value[0]
|
|
172
|
+
}, null, 8, ["order", "organization"])) : vue.createCommentVNode("", true),
|
|
177
173
|
orders.state.current.status !== true && shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createBlock(FormDelivery.default, {
|
|
178
174
|
key: 1,
|
|
179
|
-
order: orders.state.current
|
|
180
|
-
|
|
175
|
+
order: orders.state.current,
|
|
176
|
+
organization: orderOrganization.value[0]
|
|
177
|
+
}, null, 8, ["order", "organization"])) : vue.createCommentVNode("", true)
|
|
181
178
|
])) : vue.createCommentVNode("", true),
|
|
182
179
|
shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
183
180
|
_cache[1] || (_cache[1] = vue.createElementVNode("h4", { class: "font-second mn-b-thin" }, "Your Order", -1)),
|