@ozdao/prometheus-framework 0.2.63 → 0.2.65
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main-BoybHtmb.mjs +13753 -0
- package/dist/main-CJ7URLjm.js +91 -0
- package/dist/products.server.js +8 -1
- package/dist/products.server.mjs +8 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +3 -3
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +20 -20
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +46 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +1 -46
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +1 -1
- 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/icons/icons.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/icons.client.js +59 -58
- 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 +1 -13
- 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 +13 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.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 +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 +78 -74
- 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 +132 -85
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +19 -19
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +28 -33
- 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/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +59 -45
- package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js +8 -8
- 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/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- 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-B9Vtg5cN.mjs +54 -0
- package/dist/web-ZM1AOTc1.js +1 -0
- package/package.json +1 -1
- package/src/components/Block/Block.vue +1 -1
- package/src/modules/icons/icons.client.js +1 -0
- package/src/modules/products/components/blocks/CardPosition.vue +57 -51
- package/src/modules/products/components/pages/EditLeftover.vue +64 -16
- package/src/modules/products/components/pages/Products.vue +1 -1
package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { ref as i, computed as
|
1
|
+
import { ref as i, computed as V, watch as m, openBlock as n, createElementBlock as c, createElementVNode as v, createVNode as s, unref as b, createCommentVNode as f, withCtx as C } from "vue";
|
2
2
|
import y from "../../../../components/Field/Field.vue.js";
|
3
|
-
import
|
3
|
+
import P from "../../../../components/Select/Select.vue2.js";
|
4
4
|
import q from "../../../../components/SelectMulti/SelectMulti.vue.js";
|
5
|
-
import
|
6
|
-
import
|
7
|
-
const
|
5
|
+
import S from "../../../icons/navigation/IconAdd.vue.js";
|
6
|
+
import U from "../../../icons/navigation/IconDelete.vue.js";
|
7
|
+
const _ = { class: "gap-thin" }, N = { class: "gap-thin mn-b-thin flex-nowrap flex" }, Q = ["disabled"], A = { class: "gap-thin flex-nowrap flex" }, O = {
|
8
8
|
__name: "CardPosition",
|
9
9
|
props: {
|
10
10
|
product: Object,
|
@@ -16,94 +16,98 @@ const U = { class: "gap-thin flex-nowrap flex" }, Q = ["disabled"], F = {
|
|
16
16
|
"delete",
|
17
17
|
"update"
|
18
18
|
],
|
19
|
-
setup(
|
20
|
-
const e =
|
21
|
-
() =>
|
19
|
+
setup(d, { emit: g }) {
|
20
|
+
const e = d, p = g, t = i(null), l = i(1), u = i("pcs"), a = i(0), x = V(
|
21
|
+
() => t.value && l.value > 0 && a.value > 0
|
22
22
|
);
|
23
23
|
m(e.array, () => {
|
24
|
-
|
25
|
-
}), e.product && (
|
24
|
+
t.value = e.product, l.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type;
|
25
|
+
}), e.product && (t.value = e.product, l.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type), m([t, l, a, u], () => {
|
26
26
|
p("update", {
|
27
|
-
...
|
27
|
+
...t.value,
|
28
28
|
price: a.value,
|
29
|
-
quantity:
|
29
|
+
quantity: l.value || 1,
|
30
30
|
type: u.value
|
31
31
|
});
|
32
32
|
});
|
33
|
-
function
|
33
|
+
function h() {
|
34
34
|
p("add", {
|
35
|
-
...
|
35
|
+
...t.value,
|
36
36
|
price: a.value,
|
37
|
-
quantity:
|
37
|
+
quantity: l.value || 1,
|
38
38
|
type: u.value
|
39
39
|
});
|
40
40
|
}
|
41
|
-
function
|
41
|
+
function k() {
|
42
42
|
p("delete", {
|
43
|
-
...
|
43
|
+
...t.value,
|
44
44
|
price: a.value,
|
45
|
-
quantity:
|
45
|
+
quantity: l.value || 1,
|
46
46
|
type: u.value
|
47
47
|
});
|
48
48
|
}
|
49
|
-
return (
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
49
|
+
return (w, r) => (n(), c("div", _, [
|
50
|
+
v("div", N, [
|
51
|
+
s(q, {
|
52
|
+
modelValue: t.value,
|
53
|
+
"onUpdate:modelValue": r[0] || (r[0] = (o) => t.value = o),
|
54
|
+
options: d.products,
|
55
|
+
label: "name",
|
56
|
+
multiple: !1,
|
57
|
+
taggable: !1,
|
58
|
+
placeholder: "Select a product",
|
59
|
+
class: "bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"
|
60
|
+
}, null, 8, ["modelValue", "options"]),
|
61
|
+
d.product ? f("", !0) : (n(), c("button", {
|
62
|
+
key: 0,
|
63
|
+
disabled: !x.value,
|
64
|
+
onClick: h,
|
65
|
+
class: "bg-main aspect-1x1 radius-small pd-small"
|
66
|
+
}, [
|
67
|
+
s(b(S), { class: "i-semi" })
|
68
|
+
], 8, Q)),
|
69
|
+
d.product ? (n(), c("button", {
|
70
|
+
key: 1,
|
71
|
+
onClick: k,
|
72
|
+
class: "bg-red aspect-1x1 radius-small pd-small"
|
73
|
+
}, [
|
74
|
+
s(b(U), { class: "i-semi" })
|
75
|
+
])) : f("", !0)
|
76
|
+
]),
|
77
|
+
v("div", A, [
|
78
|
+
s(y, {
|
79
|
+
field: a.value,
|
80
|
+
"onUpdate:field": r[1] || (r[1] = (o) => a.value = o),
|
81
|
+
type: "number",
|
82
|
+
label: "Price",
|
83
|
+
symbol: w.returnCurrency(),
|
84
|
+
class: "bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
|
85
|
+
}, null, 8, ["field", "symbol"]),
|
86
|
+
s(y, {
|
87
|
+
field: l.value,
|
88
|
+
"onUpdate:field": r[3] || (r[3] = (o) => l.value = o),
|
89
|
+
type: "number",
|
90
|
+
label: "Qty",
|
91
|
+
class: "bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
|
92
|
+
}, {
|
93
|
+
default: C(() => [
|
94
|
+
s(P, {
|
95
|
+
select: u.value,
|
96
|
+
"onUpdate:select": r[2] || (r[2] = (o) => u.value = o),
|
97
|
+
options: [
|
98
|
+
"pcs",
|
99
|
+
"g",
|
100
|
+
"ml"
|
101
|
+
],
|
102
|
+
class: "bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"
|
103
|
+
}, null, 8, ["select"])
|
104
|
+
]),
|
105
|
+
_: 1
|
106
|
+
}, 8, ["field"])
|
107
|
+
])
|
104
108
|
]));
|
105
109
|
}
|
106
110
|
};
|
107
111
|
export {
|
108
|
-
|
112
|
+
O as default
|
109
113
|
};
|
package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue2.cjs");const N=require("../../../../components/Feed/Feed.vue.cjs"),w=require("../../../../components/Select/Select.vue2.cjs"),q=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const P=require("../blocks/CardPosition.vue.cjs"),C=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),d=require("../../../globals/store/globals.cjs"),E=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),p=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const V={class:"pd-thin"},x={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},B={class:""},S=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),D={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},L={class:"gap-thin flex-v-center flex-nojustify flex"},R={class:"mn-r-auto"},O={__name:"EditLeftover",setup(z){const r=v.useRoute(),l=v.useRouter(),m=e.ref(p.state.all);e.ref(null);const _=e.computed(()=>Number(t.state.current.positions.reduce((s,a)=>Number(s)+Number(a.price),0))),c=e.ref(!1);function b(){c.value=!0}function f(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const s=await p.actions.read({organization:r.params._id,limit:100});m.value=s}catch{console.error("error")}});function g(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>l.push({name:"Leftovers",params:{_id:r.params._id}}),s=>console.error("error")):(t.state.current.creator={type:"user",target:E.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>l.push({name:"Leftovers",params:{_id:r.params._id}}),s=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>l.push({name:"Leftovers",params:{_id:r.params._id}}),s=>console.error("error"))}return(s,a)=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("header",x,[e.createElementVNode("h2",B,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(w.default,{select:t.state.current.type,"onUpdate:select":a[0]||(a[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:f,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[S,e.createElementVNode("div",D,[e.createVNode(N.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>p.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,i)=>(e.openBlock(),e.createBlock(C.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",d.actions.add(t.state.current.positions,u),f()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(h.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>b()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:m.value,onUpdate:i=>d.actions.update(t.state.current.positions,i,n),onDelete:i=>d.actions.delete(t.state.current.positions,i,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(h.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",L,[e.createElementVNode("h3",R," In total: "+e.toDisplayString(s.formatPrice(_.value)),1),e.createElementVNode("a",{onClick:a[1]||(a[1]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:a[2]||(a[2]=o=>g())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[3]||(a[3]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=O;
|
@@ -1,140 +1,187 @@
|
|
1
|
-
import { ref as
|
2
|
-
import
|
1
|
+
import { ref as h, computed as z, onMounted as E, openBlock as i, createElementBlock as u, createElementVNode as a, toDisplayString as k, unref as v, createVNode as l, withCtx as m, Fragment as w, renderList as P, createBlock as $, createCommentVNode as A } from "vue";
|
2
|
+
import x from "../../../../components/Block/Block.vue.js";
|
3
3
|
import "../../../../components/Field/Field.vue2.js";
|
4
|
-
import
|
4
|
+
import B from "../../../../components/Feed/Feed.vue.js";
|
5
|
+
import I from "../../../../components/Select/Select.vue2.js";
|
6
|
+
import O from "../../../../components/Popup/Popup.vue.js";
|
5
7
|
import "../../../../components/SelectMulti/SelectMulti.vue2.js";
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import { state as
|
8
|
+
import U from "../blocks/CardPosition.vue.js";
|
9
|
+
import V from "../../../orders/components/blocks/CardOrderItem.vue.js";
|
10
|
+
import { useRoute as F, useRouter as j } from "vue-router";
|
11
|
+
import { actions as b } from "../../../globals/store/globals.js";
|
12
|
+
import { state as q } from "../../../auth/store/auth.js";
|
13
|
+
import { state as e, actions as c } from "../../store/leftovers.js";
|
14
|
+
import { state as M, actions as C } from "../../store/products.js";
|
11
15
|
import "./EditLeftover.vue2.js";
|
12
|
-
const
|
16
|
+
const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, J = { class: "" }, K = /* @__PURE__ */ a("h3", { class: "mn-b-small" }, "Add to order", -1), Q = { class: "bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" }, T = { class: "gap-thin flex-v-center flex-nojustify flex" }, W = { class: "mn-r-auto" }, de = {
|
13
17
|
__name: "EditLeftover",
|
14
|
-
setup(
|
15
|
-
const
|
16
|
-
|
17
|
-
const
|
18
|
-
|
19
|
-
|
18
|
+
setup(X) {
|
19
|
+
const t = F(), d = j(), y = h(M.all);
|
20
|
+
h(null);
|
21
|
+
const N = z(() => Number(e.current.positions.reduce((o, s) => Number(o) + Number(s.price), 0))), f = h(!1);
|
22
|
+
function S() {
|
23
|
+
f.value = !0;
|
24
|
+
}
|
25
|
+
function g() {
|
26
|
+
f.value = !1;
|
27
|
+
}
|
28
|
+
E(async () => {
|
29
|
+
if (t.params.leftover)
|
20
30
|
try {
|
21
|
-
await
|
31
|
+
await c.fetch(t.params.leftover);
|
22
32
|
} catch {
|
23
33
|
console.error("error");
|
24
34
|
}
|
25
35
|
else
|
26
|
-
|
36
|
+
e.current = { type: "", order: "", positions: [] };
|
27
37
|
try {
|
28
|
-
const o = await
|
29
|
-
organization:
|
38
|
+
const o = await C.read({
|
39
|
+
organization: t.params._id,
|
30
40
|
limit: 100
|
31
41
|
});
|
32
|
-
|
42
|
+
y.value = o;
|
33
43
|
} catch {
|
34
44
|
console.error("error");
|
35
45
|
}
|
36
46
|
});
|
37
|
-
function
|
38
|
-
|
47
|
+
function D() {
|
48
|
+
t.params.leftover ? c.fetch(t.params.leftover) : e.current = { type: "", order: "", positions: [] };
|
39
49
|
}
|
40
|
-
function
|
41
|
-
|
42
|
-
() =>
|
50
|
+
function L() {
|
51
|
+
e.current.organization = t.params._id, t.params.leftover ? c.update(e.current).then(
|
52
|
+
() => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
|
43
53
|
(o) => console.error("error")
|
44
|
-
) :
|
45
|
-
|
54
|
+
) : (e.current.creator = {
|
55
|
+
type: "user",
|
56
|
+
target: q.user._id
|
57
|
+
}, e.current.owner = {
|
58
|
+
type: "organization",
|
59
|
+
target: t.params._id
|
60
|
+
}, console.log("leftover state is", e.current), c.create(e.current).then(
|
61
|
+
() => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
|
46
62
|
(o) => console.error("error")
|
47
|
-
);
|
63
|
+
));
|
48
64
|
}
|
49
|
-
function
|
50
|
-
|
51
|
-
() =>
|
65
|
+
function R() {
|
66
|
+
c.delete(t.params.leftover).then(
|
67
|
+
() => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
|
52
68
|
(o) => console.error("error")
|
53
69
|
);
|
54
70
|
}
|
55
|
-
return (o,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
select:
|
60
|
-
"onUpdate:select":
|
71
|
+
return (o, s) => (i(), u("div", G, [
|
72
|
+
a("header", H, [
|
73
|
+
a("h2", J, k(v(t).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
|
74
|
+
l(I, {
|
75
|
+
select: e.current.type,
|
76
|
+
"onUpdate:select": s[0] || (s[0] = (r) => e.current.type = r),
|
61
77
|
options: [
|
62
78
|
"stock-in",
|
63
|
-
"stock-out"
|
64
|
-
"write-off"
|
79
|
+
"stock-out"
|
65
80
|
],
|
66
81
|
placeholder: "Select type",
|
67
82
|
class: "bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
|
68
83
|
}, null, 8, ["select"])
|
69
84
|
]),
|
70
|
-
|
71
|
-
title: "Add
|
72
|
-
|
85
|
+
l(O, {
|
86
|
+
title: "Add position",
|
87
|
+
onClosePopup: g,
|
88
|
+
isPopupOpen: f.value,
|
89
|
+
class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
|
73
90
|
}, {
|
74
|
-
default:
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
91
|
+
default: m(() => [
|
92
|
+
K,
|
93
|
+
a("div", Q, [
|
94
|
+
l(B, {
|
95
|
+
search: !0,
|
96
|
+
states: {
|
97
|
+
empty: {
|
98
|
+
title: "No Products Found",
|
99
|
+
description: "Currently, there are no such products available."
|
100
|
+
}
|
101
|
+
},
|
102
|
+
store: {
|
103
|
+
read: (r) => C.read(r),
|
104
|
+
state: null
|
105
|
+
},
|
106
|
+
options: {
|
107
|
+
organization: v(t).params._id
|
108
|
+
},
|
109
|
+
class: ""
|
110
|
+
}, {
|
111
|
+
default: m(({
|
112
|
+
items: r
|
113
|
+
}) => [
|
114
|
+
(i(!0), u(w, null, P(r, (n, p) => (i(), $(V, {
|
115
|
+
key: n._id,
|
116
|
+
editable: !1,
|
117
|
+
product: n,
|
118
|
+
onClick: () => {
|
119
|
+
let _ = { ...n };
|
120
|
+
_.quantity = 1, _.type = "pcs", b.add(e.current.positions, _), g();
|
121
|
+
},
|
122
|
+
class: "bg-white pd-thin radius-medium w-100 mn-b-thin"
|
123
|
+
}, null, 8, ["product", "onClick"]))), 128))
|
124
|
+
]),
|
125
|
+
_: 1
|
126
|
+
}, 8, ["states", "store", "options"])
|
127
|
+
])
|
82
128
|
]),
|
83
129
|
_: 1
|
84
|
-
}),
|
85
|
-
|
130
|
+
}, 8, ["isPopupOpen"]),
|
131
|
+
l(x, {
|
86
132
|
title: "Invetory Sheet",
|
133
|
+
actions: [{
|
134
|
+
label: "+",
|
135
|
+
function: () => S()
|
136
|
+
}],
|
87
137
|
placeholder: "No positions added yet",
|
88
138
|
class: "mn-b-semi"
|
89
139
|
}, {
|
90
|
-
default:
|
91
|
-
(
|
92
|
-
key:
|
93
|
-
product:
|
94
|
-
array:
|
95
|
-
products:
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
140
|
+
default: m(() => [
|
141
|
+
(i(!0), u(w, null, P(e.current.positions, (r, n) => (i(), $(U, {
|
142
|
+
key: r._id,
|
143
|
+
product: r,
|
144
|
+
array: e.current.positions,
|
145
|
+
products: y.value,
|
146
|
+
onUpdate: (p) => b.update(
|
147
|
+
e.current.positions,
|
148
|
+
p,
|
149
|
+
n
|
150
|
+
),
|
151
|
+
onDelete: (p) => b.delete(
|
152
|
+
e.current.positions,
|
153
|
+
p,
|
154
|
+
n
|
104
155
|
),
|
105
|
-
|
106
|
-
t.current.positions,
|
107
|
-
a,
|
108
|
-
_
|
109
|
-
)
|
156
|
+
class: "mn-b-small radius-medium bg-white pd-small"
|
110
157
|
}, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
|
111
158
|
]),
|
112
159
|
_: 1
|
113
|
-
}),
|
114
|
-
|
115
|
-
default:
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
onClick:
|
160
|
+
}, 8, ["actions"]),
|
161
|
+
l(x, { class: "" }, {
|
162
|
+
default: m(() => [
|
163
|
+
a("section", T, [
|
164
|
+
a("h3", W, " In total: " + k(o.formatPrice(N.value)), 1),
|
165
|
+
a("a", {
|
166
|
+
onClick: s[1] || (s[1] = (r) => L()),
|
120
167
|
class: "bg-main button"
|
121
168
|
}, " Save "),
|
122
|
-
|
169
|
+
a("a", {
|
123
170
|
class: "t-white bg-second button",
|
124
|
-
onClick:
|
171
|
+
onClick: s[2] || (s[2] = (r) => D())
|
125
172
|
}, " Reset "),
|
126
|
-
|
173
|
+
v(t).params.leftover ? (i(), u("a", {
|
127
174
|
key: 0,
|
128
|
-
onClick:
|
175
|
+
onClick: s[3] || (s[3] = (r) => R()),
|
129
176
|
class: "t-white bg-red button"
|
130
|
-
}, " Delete ")) :
|
177
|
+
}, " Delete ")) : A("", !0)
|
131
178
|
])
|
132
179
|
]),
|
133
180
|
_: 1
|
134
181
|
})
|
135
|
-
]
|
182
|
+
]));
|
136
183
|
}
|
137
184
|
};
|
138
185
|
export {
|
139
|
-
|
186
|
+
de as default
|
140
187
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),p=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},f={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),_={class:"mn-b-semi pd-medium bg-grey radius-big"},g=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const n=a.useRoute();a.useRouter();const s=e.ref(n.query.tab?n.query.tab:"all"),i=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((l,c)=>l+c.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",f,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",_,[g,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(i.value)),1)]),e.createVNode(d.default,{selected:s.value,"onUpdate:selected":r[1]||(r[1]=t=>s.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,organization:e.unref(n).params._id,...s.value!=="all"&&{type:s.value}}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,l=>(e.openBlock(),e.createBlock(p.default,{leftover:l,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as m, computed as p, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as f, createVNode as u, unref as v, withCtx as b, Fragment as _, renderList as h, createBlock as g } from "vue";
|
2
2
|
import { useRoute as y, useRouter as k } from "vue-router";
|
3
|
-
import L from "../../../../components/Tab/Tab.
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { state as
|
3
|
+
import L from "../../../../components/Tab/Tab.vue.js";
|
4
|
+
import x from "../../../../components/Feed/Feed.vue.js";
|
5
|
+
import C from "../blocks/CardLeftover.vue.js";
|
6
|
+
import { state as $, actions as w } from "../../store/leftovers.js";
|
7
7
|
import "./Leftovers.vue2.js";
|
8
|
-
const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, q = /* @__PURE__ */ o("h2", { class: "mn-r-medium" }, "Inventory", -1), A = { class: "mn-b-semi pd-medium bg-grey radius-big" }, E = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, "Spended:", -1),
|
8
|
+
const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, q = /* @__PURE__ */ o("h2", { class: "mn-r-medium" }, "Inventory", -1), A = { class: "mn-b-semi pd-medium bg-grey radius-big" }, E = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, "Spended:", -1), O = {
|
9
9
|
__name: "Leftovers",
|
10
10
|
setup(F) {
|
11
|
-
const
|
11
|
+
const n = y();
|
12
12
|
k();
|
13
|
-
const
|
14
|
-
const e = t.positions.reduce((
|
13
|
+
const s = m(n.query.tab ? n.query.tab : "all"), c = p(() => $.all.reduce((r, t) => {
|
14
|
+
const e = t.positions.reduce((l, d) => l + d.price, 0);
|
15
15
|
return t.type === "stock-in" ? r - e : t.type === "stock-out" ? r + e : r;
|
16
16
|
}, 0));
|
17
17
|
return (r, t) => (a(), i("div", B, [
|
@@ -29,17 +29,16 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
|
|
29
29
|
o("h3", null, f(r.formatPrice(c.value)), 1)
|
30
30
|
]),
|
31
31
|
u(L, {
|
32
|
-
selected:
|
33
|
-
"onUpdate:selected": t[1] || (t[1] = (e) =>
|
32
|
+
selected: s.value,
|
33
|
+
"onUpdate:selected": t[1] || (t[1] = (e) => s.value = e),
|
34
34
|
tabs: [
|
35
35
|
{ name: "All", value: "all" },
|
36
36
|
{ name: "Stock-In", value: "stock-in" },
|
37
|
-
{ name: "Stock-Out", value: "stock-out" }
|
38
|
-
{ name: "Write-Off", value: "write-off" }
|
37
|
+
{ name: "Stock-Out", value: "stock-out" }
|
39
38
|
],
|
40
39
|
class: "mn-b-small o-hidden h5 radius-big bg-grey"
|
41
40
|
}, null, 8, ["selected"]),
|
42
|
-
u(
|
41
|
+
u(x, {
|
43
42
|
states: {
|
44
43
|
empty: {
|
45
44
|
title: "No Leftovers Found",
|
@@ -47,19 +46,20 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
|
|
47
46
|
}
|
48
47
|
},
|
49
48
|
store: {
|
50
|
-
read: (e) =>
|
49
|
+
read: (e) => w.read(e)
|
51
50
|
},
|
52
51
|
options: {
|
53
52
|
limit: 15,
|
54
|
-
organization: v(
|
53
|
+
organization: v(n).params._id,
|
54
|
+
...s.value !== "all" && { type: s.value }
|
55
55
|
// user: user
|
56
56
|
}
|
57
57
|
}, {
|
58
58
|
default: b(({
|
59
59
|
items: e
|
60
60
|
}) => [
|
61
|
-
(a(!0), i(_, null, h(e, (
|
62
|
-
leftover:
|
61
|
+
(a(!0), i(_, null, h(e, (l) => (a(), g(C, {
|
62
|
+
leftover: l,
|
63
63
|
class: "bg-grey pd-small mn-b-thin radius-small"
|
64
64
|
}, null, 8, ["leftover"]))), 256))
|
65
65
|
]),
|
@@ -69,5 +69,5 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
|
|
69
69
|
}
|
70
70
|
};
|
71
71
|
export {
|
72
|
-
|
72
|
+
O as default
|
73
73
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router"),d=require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const l=require("../sections/PopularProducts.vue.cjs"),p=require("../sections/SectionProduct.vue.cjs");require("../../store/categories.cjs");const m=require("../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.cjs"),_=require("../../../auth/store/auth.cjs"),t=require("../../store/products.cjs");require("./Product.vue2.cjs");const q={class:"flex flex-column w-100 o-hidden gap-thin pd-thin"},v={__name:"Product",async setup(f){let u,o;const r=s.useRoute();s.useRouter(),[u,o]=e.withAsyncContext(()=>t.actions.fetchProduct(r.params.product)),await u,o(),r.meta.title.en=t.state.current.name,r.meta.title.ru=t.state.current.name;const c=e.computed(()=>t.state.current),n={messages:{en:{},ru:{}}},{t:a}=d.useI18n(n),i=e.computed(()=>({title:t.state.current.name,description:a("description")}));return m.useMeta(i),e.onMounted(()=>{}),(h,M)=>(e.openBlock(),e.createElementBlock("div",q,[c.value?(e.openBlock(),e.createBlock(p.default,{key:0,product:c.value,user:_.state.user,class:"pos-relative"},null,8,["product","user"])):e.createCommentVNode("",!0),e.createVNode(l.default)]))}};exports.default=v;
|