@ozdao/prometheus-framework 0.2.66 → 0.2.68
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/community.server.js +3 -3
- package/dist/community.server.mjs +2 -2
- package/dist/events.server.js +3 -3
- package/dist/events.server.mjs +2 -2
- package/dist/main-BDrW8oeL.mjs +13755 -0
- package/dist/main-CNIKtifM.js +91 -0
- package/dist/main.css +1 -1
- package/dist/metadata.schema-BLGSCSmy.mjs +55 -0
- package/dist/metadata.schema-DWR97jhW.js +54 -0
- package/dist/ownership.schema-CGqscZIi.js +159 -0
- package/dist/ownership.schema-DtT2IgqC.mjs +160 -0
- package/dist/products.server.js +51 -15
- package/dist/products.server.mjs +51 -15
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +55 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -55
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +40 -39
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +7 -6
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +97 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -97
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +9 -8
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +59 -45
- package/dist/prometheus-framework/src/modules/globals/store/globals.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/store/globals.js +5 -5
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.js +86 -56
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +82 -67
- 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 +14 -14
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js +10 -9
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +24 -23
- 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-6-zYDWMA.js +1 -0
- package/dist/web-TZtLKurO.mjs +54 -0
- package/package.json +1 -1
- package/src/modules/products/controllers/leftovers.controller.js +3 -3
- package/src/modules/products/models/leftover.model.js +2 -3
- package/src/modules/products/store/leftovers.js +4 -3
package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../../components/Field/Field.vue.cjs"),b=require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../../components/Field/Field.vue.cjs"),b=require("../../../../components/Select/Select.vue.cjs"),v=require("../../../../components/Button/Button.vue.cjs");require("../../../middlewares/client/inputs.validation.cjs");const s=require("../../store/invites.cjs"),f={class:"mn-b-medium radius-medium pd-semi bg-grey"},h=e.createElementVNode("h3",{class:"mn-b-medium"},"Add members",-1),g=e.createElementVNode("p",{class:"mn-b-small t-transp p-medium"},"Укажите email или телефон, чтобы отправить ссылку с приглашением:",-1),k={key:0,class:"mn-r-medium flex-v-center flex"},E=["onClick"],V=e.createElementVNode("p",{class:"t-blue mn-r-small"},"+ Добавить приглашение",-1),N=[V],w=e.createElementVNode("span",null,"Invite to organization",-1),B={__name:"MembersAdd",props:{organization:Object},emits:["send-invite"],setup(c,{emit:q}){const i=c,r=e.ref(null),t=e.ref([{contact:"",role:""}]);function d(){t.value.push({contact:"",role:""})}function m(l){t.value.splice(l,1)}async function u(l){await s.actions.create(i.organization._id,t.value)}function p(){}return(l,x)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("section",f,[h,g,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(n,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"br-1px br-solid br-grey flex gap-thin radius-small mn-b-thin"},[e.createVNode(_.default,{field:n.contact,"onUpdate:field":o=>n.contact=o,placeholder:"Enter email or phone",class:"pd-small radius-small w-100 bg-white",validation:r.value},null,8,["field","onUpdate:field","validation"]),e.createVNode(b.default,{select:n.role,"onUpdate:select":o=>n.role=o,label:"Role",options:["owner","manager","member"],placeholder:"Select",class:"pos-relative w-100 bg-white radius-small pd-small"},null,8,["select","onUpdate:select"]),a>0?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("button",{onClick:o=>m(a),class:"button-small button"},"×",8,E)])):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("div",{onClick:d,class:"mn-b-small flex-v-center flex-nowrap flex"},N),e.createVNode(v.default,{submit:l.a=()=>u(s.state.invites),callback:p,class:"w-100 bg-main"},{default:e.withCtx(()=>[w]),_:1},8,["submit"])])]))}};exports.default=B;
|
package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ref as r, openBlock as a, createElementBlock as s, createElementVNode as e, Fragment as v, renderList as h, createVNode as c, createCommentVNode as g, withCtx as w } from "vue";
|
2
2
|
import k from "../../../../components/Field/Field.vue.js";
|
3
|
-
import x from "../../../../components/Select/Select.
|
3
|
+
import x from "../../../../components/Select/Select.vue.js";
|
4
4
|
import y from "../../../../components/Button/Button.vue.js";
|
5
5
|
import "../../../middlewares/client/inputs.validation.js";
|
6
6
|
import { state as C, actions as U } from "../../store/invites.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../../../components/Tab/Tab.vue2.cjs");require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../../../components/Tab/Tab.vue2.cjs");require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/Button/Button.vue2.cjs");require("../../../../components/Dropdown/Dropdown.vue2.cjs");require("../../../../components/Chips/Chips.vue2.cjs");const q=require("../../../auth/store/auth.cjs");require("../../store/memberships.cjs");require("vue-i18n");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../reports/store/reports.cjs");const y=require("../../store/organizations.cjs"),m=require("../blocks/CardOrganization.vue.cjs"),b=require("../blocks/EmptyState.vue.cjs");require("./Unit.vue.cjs");require("./Organizations.vue2.cjs");const g={class:"for-transition bg-white radius-big w-100"},k={class:""},_={key:1,class:"cols-1"},h={__name:"Organizations",props:{owner:{type:String,default:null},user:{type:[String,Number],default:null},onlyuser:{type:[String,Number],default:null}},async setup(c){let t,u;const o=c,a=e.ref(null);a.value=([t,u]=e.withAsyncContext(()=>y.actions.read({owner:o.owner,user:o.user,onlyuser:o.onlyuser})),t=await t,u(),t);const d=s.useRouter(),n=s.useRoute();let p=n.query.tab?n.query.tab:"details";const i=e.ref(p);return n.query.tab=i.value,e.watch(i,r=>{d.replace({query:{...n.query,tab:r}})}),(r,v)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",k,[a.value<1?(e.openBlock(),e.createBlock(b.default,{key:0,title:"You Haven't Joined Any Organization Yet",description:"Weeder is all about community. Join an organization or maybe you want to create your own?",action:"Create organization",callback:r.a=()=>r.$router.push("/app/organization/create/details")},null,8,["callback"])):(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createBlock(m.default,{key:l._id,organization:l,user:q.state.user,onUpdateMembership:r.handleMembershipUpdate,class:e.normalizeClass(["w-100",{"mn-r-small":r.index!==a.value.length-1}])},null,8,["organization","user","onUpdateMembership","class"]))),128))]))])]))}};exports.default=h;
|
package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js
CHANGED
@@ -3,9 +3,9 @@ import { useRouter as v, useRoute as z } from "vue-router";
|
|
3
3
|
import "../../../../../../node_modules/js-cookie/dist/js.cookie.js";
|
4
4
|
import "../../../../components/Tab/Tab.vue2.js";
|
5
5
|
import "../../../../components/Field/Field.vue2.js";
|
6
|
-
import "../../../../components/Select/Select.
|
6
|
+
import "../../../../components/Select/Select.vue2.js";
|
7
7
|
import "../../../../components/Button/Button.vue2.js";
|
8
|
-
import "../../../../components/Dropdown/Dropdown.
|
8
|
+
import "../../../../components/Dropdown/Dropdown.vue2.js";
|
9
9
|
import "../../../../components/Chips/Chips.vue2.js";
|
10
10
|
import { state as k } from "../../../auth/store/auth.js";
|
11
11
|
import "../../store/memberships.js";
|
package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router"),c=require("../../../globals/components/blocks/CardHeader.vue.cjs"),i=require("../../../icons/navigation/IconEdit.vue.cjs"),d=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("./CardLeftover.vue2.cjs");const m=t=>(e.pushScopeId("data-v-839424cb"),t=t(),e.popScopeId(),t),u={class:"flex-column pos-relative flex-wrap"},f={class:"mn-t-small w-100 bg-white radius-small pd-small spoiler"},v={class:"flex-child flex-child-shrink-0"},h={key:0,class:"mn-r-thin mn-l-thin t-transp"},p={key:1,class:"flex-child flex-child-shrink-0"},k={key:2,class:"mn-r-thin mn-l-thin t-transp"},g={key:3,class:"t-truncate"},y={key:0},V={class:"mn-t-small w-100 mn-b-thin flex"},N={class:"w-50 flex"},E=m(()=>e.createElementVNode("span",{class:"mn-r-thin mn-l-thin t-transp"},"|",-1)),x={class:"w-50"},B={class:"t-transp"},C={class:"t-right w-50"},w={class:"t-transp"},S={__name:"CardLeftover",props:{leftover:Object},setup(t){s.useRouter();const r=e.ref(!0);return(n,l)=>{const a=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",u,[e.createVNode(c.default,{entity:t.leftover,entityType:"leftover",user:n.user,owner:t.leftover.creator,creator:t.leftover.creator,date:t.leftover.createdAt},null,8,["entity","user","owner","creator","date"]),e.createVNode(a,{to:{name:"LeftoverEdit",params:{_id:t.leftover.organization,leftover:t.leftover._id}},class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"},{default:e.withCtx(()=>[e.createVNode(i.default,{class:"i-regular",classes:"fill-white"})]),_:1},8,["to"]),e.createElementVNode("div",f,[e.createElementVNode("div",{onClick:l[0]||(l[0]=o=>r.value=!r.value),class:"flex-v-center flex"},[e.createElementVNode("span",{class:e.normalizeClass(["flex-child flex-child-shrink-0 capitalize w-max mn-r-thin t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin",{"bg-green":t.leftover.type==="stock-in","bg-red":t.leftover.type==="stock-out"}])},e.toDisplayString(t.leftover.type),3),e.createElementVNode("span",v,"Positions "+e.toDisplayString(t.leftover.positions.length),1),t.leftover.order?(e.openBlock(),e.createElementBlock("span",h,"|")):e.createCommentVNode("",!0),t.leftover.order?(e.openBlock(),e.createElementBlock("span",p,"For order "+e.toDisplayString(t.leftover.order),1)):e.createCommentVNode("",!0),t.leftover.comment?(e.openBlock(),e.createElementBlock("span",k,"|")):e.createCommentVNode("",!0),t.leftover.comment?(e.openBlock(),e.createElementBlock("p",g,"Comment: "+e.toDisplayString(t.leftover.comment),1)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.leftover.positions,o=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",N,[e.createElementVNode("span",null,e.toDisplayString(o.name),1),E,e.createElementVNode("span",x,[e.createTextVNode(e.toDisplayString(o.price)+" ",1),e.createElementVNode("span",B,e.toDisplayString(n.returnCurrency()),1)])]),e.createElementVNode("div",C,[e.createTextVNode(e.toDisplayString(o.quantity)+" ",1),e.createElementVNode("span",w,e.toDisplayString(o.type),1)])]))),256))])):e.createCommentVNode("",!0)]),_:1})])])}}},_=d.default(S,[["__scopeId","data-v-839424cb"]]);exports.default=_;
|
package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.js
CHANGED
@@ -1,71 +1,101 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as h, resolveComponent as v, openBlock as s, createElementBlock as o, createVNode as a, withCtx as m, createElementVNode as t, normalizeClass as p, toDisplayString as r, createCommentVNode as l, Transition as x, Fragment as y, renderList as _, createTextVNode as f, pushScopeId as k, popScopeId as g } from "vue";
|
2
2
|
import { useRouter as w } from "vue-router";
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
3
|
+
import b from "../../../globals/components/blocks/CardHeader.vue.js";
|
4
|
+
import C from "../../../icons/navigation/IconEdit.vue.js";
|
5
|
+
import I from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
6
6
|
import "./CardLeftover.vue2.js";
|
7
|
-
const
|
7
|
+
const L = (e) => (k("data-v-839424cb"), e = e(), g(), e), N = { class: "flex-column pos-relative flex-wrap" }, S = { class: "mn-t-small w-100 bg-white radius-small pd-small spoiler" }, V = { class: "flex-child flex-child-shrink-0" }, z = {
|
8
|
+
key: 0,
|
9
|
+
class: "mn-r-thin mn-l-thin t-transp"
|
10
|
+
}, E = {
|
11
|
+
key: 1,
|
12
|
+
class: "flex-child flex-child-shrink-0"
|
13
|
+
}, T = {
|
14
|
+
key: 2,
|
15
|
+
class: "mn-r-thin mn-l-thin t-transp"
|
16
|
+
}, $ = {
|
17
|
+
key: 3,
|
18
|
+
class: "t-truncate"
|
19
|
+
}, B = { key: 0 }, F = { class: "mn-t-small w-100 mn-b-thin flex" }, j = { class: "w-50 flex" }, q = /* @__PURE__ */ L(() => /* @__PURE__ */ t("span", { class: "mn-r-thin mn-l-thin t-transp" }, "|", -1)), A = { class: "w-50" }, D = { class: "t-transp" }, O = { class: "t-right w-50" }, P = { class: "t-transp" }, R = {
|
8
20
|
__name: "CardLeftover",
|
9
21
|
props: {
|
10
22
|
leftover: Object
|
11
23
|
},
|
12
|
-
setup(
|
24
|
+
setup(e) {
|
13
25
|
w();
|
14
|
-
const i =
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
date
|
26
|
-
|
27
|
-
|
28
|
-
e("p", k, l(t.leftover.type), 1),
|
29
|
-
c(x, {
|
30
|
-
onClick: r[0] || (r[0] = (s) => o.$router.push({
|
26
|
+
const i = h(!0);
|
27
|
+
return (c, d) => {
|
28
|
+
const u = v("router-link");
|
29
|
+
return s(), o("div", N, [
|
30
|
+
a(b, {
|
31
|
+
entity: e.leftover,
|
32
|
+
entityType: "leftover",
|
33
|
+
user: c.user,
|
34
|
+
owner: e.leftover.creator,
|
35
|
+
creator: e.leftover.creator,
|
36
|
+
date: e.leftover.createdAt
|
37
|
+
}, null, 8, ["entity", "user", "owner", "creator", "date"]),
|
38
|
+
a(u, {
|
39
|
+
to: {
|
31
40
|
name: "LeftoverEdit",
|
32
41
|
params: {
|
33
|
-
_id:
|
34
|
-
leftover:
|
42
|
+
_id: e.leftover.organization,
|
43
|
+
leftover: e.leftover._id
|
35
44
|
}
|
36
|
-
}
|
37
|
-
class: "pos-absolute pos-t-regular pos-r-regular
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}, [
|
45
|
-
e("span", null, "Всего товаров " + l(t.leftover.positions.length), 1)
|
46
|
-
]),
|
47
|
-
c(u, { name: "fade" }, {
|
48
|
-
default: v(() => [
|
49
|
-
i.value ? (a(), n("div", $, [
|
50
|
-
(a(!0), n(m, null, p(t.leftover.positions, (s) => (a(), n("div", L, [
|
51
|
-
e("div", V, [
|
52
|
-
e("span", null, l(s.name), 1)
|
53
|
-
]),
|
54
|
-
e("div", E, [
|
55
|
-
e("span", T, [
|
56
|
-
_(l(s.quantity) + " ", 1),
|
57
|
-
e("span", q, l(d(s.quantity, ["единица", " единицы", " единиц"])), 1)
|
58
|
-
])
|
59
|
-
])
|
60
|
-
]))), 256))
|
61
|
-
])) : h("", !0)
|
45
|
+
},
|
46
|
+
class: "cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"
|
47
|
+
}, {
|
48
|
+
default: m(() => [
|
49
|
+
a(C, {
|
50
|
+
class: "i-regular",
|
51
|
+
classes: "fill-white"
|
52
|
+
})
|
62
53
|
]),
|
63
54
|
_: 1
|
64
|
-
})
|
65
|
-
|
66
|
-
|
55
|
+
}, 8, ["to"]),
|
56
|
+
t("div", S, [
|
57
|
+
t("div", {
|
58
|
+
onClick: d[0] || (d[0] = (n) => i.value = !i.value),
|
59
|
+
class: "flex-v-center flex"
|
60
|
+
}, [
|
61
|
+
t("span", {
|
62
|
+
class: p(["flex-child flex-child-shrink-0 capitalize w-max mn-r-thin t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin", {
|
63
|
+
"bg-green": e.leftover.type === "stock-in",
|
64
|
+
"bg-red": e.leftover.type === "stock-out"
|
65
|
+
}])
|
66
|
+
}, r(e.leftover.type), 3),
|
67
|
+
t("span", V, "Positions " + r(e.leftover.positions.length), 1),
|
68
|
+
e.leftover.order ? (s(), o("span", z, "|")) : l("", !0),
|
69
|
+
e.leftover.order ? (s(), o("span", E, "For order " + r(e.leftover.order), 1)) : l("", !0),
|
70
|
+
e.leftover.comment ? (s(), o("span", T, "|")) : l("", !0),
|
71
|
+
e.leftover.comment ? (s(), o("p", $, "Comment: " + r(e.leftover.comment), 1)) : l("", !0)
|
72
|
+
]),
|
73
|
+
a(x, { name: "fade" }, {
|
74
|
+
default: m(() => [
|
75
|
+
i.value ? (s(), o("div", B, [
|
76
|
+
(s(!0), o(y, null, _(e.leftover.positions, (n) => (s(), o("div", F, [
|
77
|
+
t("div", j, [
|
78
|
+
t("span", null, r(n.name), 1),
|
79
|
+
q,
|
80
|
+
t("span", A, [
|
81
|
+
f(r(n.price) + " ", 1),
|
82
|
+
t("span", D, r(c.returnCurrency()), 1)
|
83
|
+
])
|
84
|
+
]),
|
85
|
+
t("div", O, [
|
86
|
+
f(r(n.quantity) + " ", 1),
|
87
|
+
t("span", P, r(n.type), 1)
|
88
|
+
])
|
89
|
+
]))), 256))
|
90
|
+
])) : l("", !0)
|
91
|
+
]),
|
92
|
+
_: 1
|
93
|
+
})
|
94
|
+
])
|
95
|
+
]);
|
96
|
+
};
|
67
97
|
}
|
68
|
-
},
|
98
|
+
}, U = /* @__PURE__ */ I(R, [["__scopeId", "data-v-839424cb"]]);
|
69
99
|
export {
|
70
|
-
|
100
|
+
U as default
|
71
101
|
};
|
package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Select/Select.vue.cjs"),y=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),g=require("../../../icons/navigation/IconAdd.vue.cjs"),V=require("../../../icons/navigation/IconDelete.vue.cjs"),k={class:"gap-thin"},h={class:"gap-thin mn-b-thin flex-nowrap flex"},q=["disabled"],w={class:"gap-thin flex-nowrap flex"},x={__name:"CardPosition",props:{product:Object,array:Array,products:Array},emits:["add","delete","update"],setup(s,{emit:i}){const t=s,c=i,l=e.ref(null),a=e.ref(1),r=e.ref("pcs"),u=e.ref(0),p=e.computed(()=>l.value&&a.value>0&&u.value>0);e.watch(t.array,()=>{l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type}),t.product&&(l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type),e.watch([l,a,u,r],()=>{c("update",{...l.value,price:u.value,quantity:a.value||1,type:r.value})});function m(){c("add",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}function v(){c("delete",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}return(b,d)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",h,[e.createVNode(y.default,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=o=>l.value=o),options:s.products,label:"name",multiple:!1,taggable:!1,placeholder:"Select a product",class:"bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["modelValue","options"]),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,disabled:!p.value,onClick:m,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(g.default),{class:"i-semi"})],8,q)),s.product?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:v,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(V.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),e.createElementVNode("div",w,[e.createVNode(n.default,{field:u.value,"onUpdate:field":d[1]||(d[1]=o=>u.value=o),type:"number",label:"Price",symbol:b.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(n.default,{field:a.value,"onUpdate:field":d[3]||(d[3]=o=>a.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(f.default,{select:r.value,"onUpdate:select":d[2]||(d[2]=o=>r.value=o),options:["pcs","g","ml"],class:"bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])]))}};exports.default=x;
|
package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
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 P from "../../../../components/Select/Select.
|
3
|
+
import P from "../../../../components/Select/Select.vue.js";
|
4
4
|
import q from "../../../../components/SelectMulti/SelectMulti.vue.js";
|
5
5
|
import S from "../../../icons/navigation/IconAdd.vue.js";
|
6
6
|
import U from "../../../icons/navigation/IconDelete.vue.js";
|
package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),g=require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),g=require("../../../../components/Select/Select.vue.cjs"),d=require("../../../../components/Field/Field.vue.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");require("./CategoryEdit.vue2.cjs");const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
|
@@ -2,7 +2,7 @@ import { computed as h, openBlock as o, createElementBlock as c, Fragment as m,
|
|
2
2
|
import { useRoute as k, useRouter as v } from "vue-router";
|
3
3
|
import g from "../../../icons/navigation/IconDelete.vue.js";
|
4
4
|
import S from "../../../../components/Button/Button.vue.js";
|
5
|
-
import E from "../../../../components/Select/Select.
|
5
|
+
import E from "../../../../components/Select/Select.vue.js";
|
6
6
|
import i from "../../../../components/Field/Field.vue.js";
|
7
7
|
import p from "../../../../components/Block/Block.vue.js";
|
8
8
|
import { actions as f, state as t } from "../../store/categories.js";
|
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"),d=require("../../../../components/Block/Block.vue.cjs"),N=require("../../../../components/Field/Field.vue.cjs"),w=require("../../../../components/Feed/Feed.vue.cjs"),C=require("../../../../components/Select/Select.vue.cjs"),q=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const P=require("../blocks/CardPosition.vue.cjs"),V=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),x=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const E={class:"pd-thin"},B={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),L={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},R={class:"gap-thin flex-v-center flex-nojustify flex"},F={class:"mn-r-auto"},O={__name:"EditLeftover",setup(z){const r=v.useRoute(),i=v.useRouter(),f=e.ref(m.state.all);e.ref(null);const b=e.computed(()=>Number(t.state.current.positions.reduce((a,s)=>Number(a)+Number(s.price),0))),c=e.ref(!1);function _(){c.value=!0}function h(){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 a=await m.actions.read({organization:r.params._id,limit:100});f.value=a}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(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")):(t.state.current.creator={type:"user",target:x.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(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error"))}return(a,s)=>(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("header",B,[e.createElementVNode("h2",S,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(C.default,{select:t.state.current.type,"onUpdate:select":s[0]||(s[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:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[D,e.createElementVNode("div",L,[e.createVNode(w.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>m.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,l)=>(e.openBlock(),e.createBlock(V.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",p.actions.add(t.state.current.positions,u),h()},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(d.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>_()}],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:f.value,onUpdate:l=>p.actions.update(t.state.current.positions,l,n),onDelete:l=>p.actions.delete(t.state.current.positions,l,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(d.default,{title:"Comment",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(N.default,{field:t.state.current.comment,"onUpdate:field":s[1]||(s[1]=o=>t.state.current.comment=o),label:"Comment",type:"textarea",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),_:1}),e.createVNode(d.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",R,[e.createElementVNode("h3",F," In total: "+e.toDisplayString(a.formatPrice(b.value)),1),e.createElementVNode("a",{onClick:s[2]||(s[2]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:s[3]||(s[3]=o=>g())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s[4]||(s[4]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=O;
|
@@ -1,79 +1,79 @@
|
|
1
|
-
import { ref as h, computed as z, onMounted as E, openBlock as
|
2
|
-
import
|
3
|
-
import "../../../../components/Field/Field.
|
1
|
+
import { ref as h, computed as z, onMounted as E, openBlock as l, createElementBlock as p, createElementVNode as n, toDisplayString as k, unref as b, createVNode as a, withCtx as c, Fragment as P, renderList as x, createBlock as $, createCommentVNode as U } from "vue";
|
2
|
+
import v from "../../../../components/Block/Block.vue.js";
|
3
|
+
import A from "../../../../components/Field/Field.vue.js";
|
4
4
|
import B from "../../../../components/Feed/Feed.vue.js";
|
5
|
-
import
|
6
|
-
import
|
5
|
+
import F from "../../../../components/Select/Select.vue.js";
|
6
|
+
import I from "../../../../components/Popup/Popup.vue.js";
|
7
7
|
import "../../../../components/SelectMulti/SelectMulti.vue2.js";
|
8
|
-
import
|
8
|
+
import O from "../blocks/CardPosition.vue.js";
|
9
9
|
import V from "../../../orders/components/blocks/CardOrderItem.vue.js";
|
10
|
-
import { useRoute as
|
11
|
-
import { actions as
|
12
|
-
import { state as
|
13
|
-
import { state as e, actions as
|
14
|
-
import { state as
|
10
|
+
import { useRoute as j, useRouter as q } from "vue-router";
|
11
|
+
import { actions as y } from "../../../globals/store/globals.js";
|
12
|
+
import { state as M } from "../../../auth/store/auth.js";
|
13
|
+
import { state as e, actions as u } from "../../store/leftovers.js";
|
14
|
+
import { state as G, actions as C } from "../../store/products.js";
|
15
15
|
import "./EditLeftover.vue2.js";
|
16
|
-
const
|
16
|
+
const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, K = { class: "" }, Q = /* @__PURE__ */ n("h3", { class: "mn-b-small" }, "Add to order", -1), T = { class: "bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" }, W = { class: "gap-thin flex-v-center flex-nojustify flex" }, X = { class: "mn-r-auto" }, fe = {
|
17
17
|
__name: "EditLeftover",
|
18
|
-
setup(
|
19
|
-
const t =
|
18
|
+
setup(Y) {
|
19
|
+
const t = j(), d = q(), g = h(G.all);
|
20
20
|
h(null);
|
21
|
-
const N = z(() => Number(e.current.positions.reduce((
|
21
|
+
const N = z(() => Number(e.current.positions.reduce((s, o) => Number(s) + Number(o.price), 0))), f = h(!1);
|
22
22
|
function S() {
|
23
23
|
f.value = !0;
|
24
24
|
}
|
25
|
-
function
|
25
|
+
function w() {
|
26
26
|
f.value = !1;
|
27
27
|
}
|
28
28
|
E(async () => {
|
29
29
|
if (t.params.leftover)
|
30
30
|
try {
|
31
|
-
await
|
31
|
+
await u.fetch(t.params.leftover);
|
32
32
|
} catch {
|
33
33
|
console.error("error");
|
34
34
|
}
|
35
35
|
else
|
36
36
|
e.current = { type: "", order: "", positions: [] };
|
37
37
|
try {
|
38
|
-
const
|
38
|
+
const s = await C.read({
|
39
39
|
organization: t.params._id,
|
40
40
|
limit: 100
|
41
41
|
});
|
42
|
-
|
42
|
+
g.value = s;
|
43
43
|
} catch {
|
44
44
|
console.error("error");
|
45
45
|
}
|
46
46
|
});
|
47
47
|
function D() {
|
48
|
-
t.params.leftover ?
|
48
|
+
t.params.leftover ? u.fetch(t.params.leftover) : e.current = { type: "", order: "", positions: [] };
|
49
49
|
}
|
50
50
|
function L() {
|
51
|
-
e.current.organization = t.params._id, t.params.leftover ?
|
51
|
+
e.current.organization = t.params._id, t.params.leftover ? u.update(e.current).then(
|
52
52
|
() => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
|
53
|
-
(
|
53
|
+
(s) => console.error("error")
|
54
54
|
) : (e.current.creator = {
|
55
55
|
type: "user",
|
56
|
-
target:
|
56
|
+
target: M.user._id
|
57
57
|
}, e.current.owner = {
|
58
58
|
type: "organization",
|
59
59
|
target: t.params._id
|
60
|
-
}, console.log("leftover state is", e.current),
|
60
|
+
}, console.log("leftover state is", e.current), u.create(e.current).then(
|
61
61
|
() => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
|
62
|
-
(
|
62
|
+
(s) => console.error("error")
|
63
63
|
));
|
64
64
|
}
|
65
65
|
function R() {
|
66
|
-
|
66
|
+
u.delete(t.params.leftover).then(
|
67
67
|
() => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
|
68
|
-
(
|
68
|
+
(s) => console.error("error")
|
69
69
|
);
|
70
70
|
}
|
71
|
-
return (
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
return (s, o) => (l(), p("div", H, [
|
72
|
+
n("header", J, [
|
73
|
+
n("h2", K, k(b(t).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
|
74
|
+
a(F, {
|
75
75
|
select: e.current.type,
|
76
|
-
"onUpdate:select":
|
76
|
+
"onUpdate:select": o[0] || (o[0] = (r) => e.current.type = r),
|
77
77
|
options: [
|
78
78
|
"stock-in",
|
79
79
|
"stock-out"
|
@@ -82,16 +82,16 @@ const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-cente
|
|
82
82
|
class: "bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
|
83
83
|
}, null, 8, ["select"])
|
84
84
|
]),
|
85
|
-
|
85
|
+
a(I, {
|
86
86
|
title: "Add position",
|
87
|
-
onClosePopup:
|
87
|
+
onClosePopup: w,
|
88
88
|
isPopupOpen: f.value,
|
89
89
|
class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
|
90
90
|
}, {
|
91
|
-
default:
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
default: c(() => [
|
92
|
+
Q,
|
93
|
+
n("div", T, [
|
94
|
+
a(B, {
|
95
95
|
search: !0,
|
96
96
|
states: {
|
97
97
|
empty: {
|
@@ -104,20 +104,20 @@ const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-cente
|
|
104
104
|
state: null
|
105
105
|
},
|
106
106
|
options: {
|
107
|
-
organization:
|
107
|
+
organization: b(t).params._id
|
108
108
|
},
|
109
109
|
class: ""
|
110
110
|
}, {
|
111
|
-
default:
|
111
|
+
default: c(({
|
112
112
|
items: r
|
113
113
|
}) => [
|
114
|
-
(
|
115
|
-
key:
|
114
|
+
(l(!0), p(P, null, x(r, (i, m) => (l(), $(V, {
|
115
|
+
key: i._id,
|
116
116
|
editable: !1,
|
117
|
-
product:
|
117
|
+
product: i,
|
118
118
|
onClick: () => {
|
119
|
-
let _ = { ...
|
120
|
-
_.quantity = 1, _.type = "pcs",
|
119
|
+
let _ = { ...i };
|
120
|
+
_.quantity = 1, _.type = "pcs", y.add(e.current.positions, _), w();
|
121
121
|
},
|
122
122
|
class: "bg-white pd-thin radius-medium w-100 mn-b-thin"
|
123
123
|
}, null, 8, ["product", "onClick"]))), 128))
|
@@ -128,7 +128,7 @@ const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-cente
|
|
128
128
|
]),
|
129
129
|
_: 1
|
130
130
|
}, 8, ["isPopupOpen"]),
|
131
|
-
|
131
|
+
a(v, {
|
132
132
|
title: "Invetory Sheet",
|
133
133
|
actions: [{
|
134
134
|
label: "+",
|
@@ -137,44 +137,59 @@ const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-cente
|
|
137
137
|
placeholder: "No positions added yet",
|
138
138
|
class: "mn-b-semi"
|
139
139
|
}, {
|
140
|
-
default:
|
141
|
-
(
|
140
|
+
default: c(() => [
|
141
|
+
(l(!0), p(P, null, x(e.current.positions, (r, i) => (l(), $(O, {
|
142
142
|
key: r._id,
|
143
143
|
product: r,
|
144
144
|
array: e.current.positions,
|
145
|
-
products:
|
146
|
-
onUpdate: (
|
145
|
+
products: g.value,
|
146
|
+
onUpdate: (m) => y.update(
|
147
147
|
e.current.positions,
|
148
|
-
|
149
|
-
|
148
|
+
m,
|
149
|
+
i
|
150
150
|
),
|
151
|
-
onDelete: (
|
151
|
+
onDelete: (m) => y.delete(
|
152
152
|
e.current.positions,
|
153
|
-
|
154
|
-
|
153
|
+
m,
|
154
|
+
i
|
155
155
|
),
|
156
156
|
class: "mn-b-small radius-medium bg-white pd-small"
|
157
157
|
}, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
|
158
158
|
]),
|
159
159
|
_: 1
|
160
160
|
}, 8, ["actions"]),
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
161
|
+
a(v, {
|
162
|
+
title: "Comment",
|
163
|
+
class: "mn-b-semi"
|
164
|
+
}, {
|
165
|
+
default: c(() => [
|
166
|
+
a(A, {
|
167
|
+
field: e.current.comment,
|
168
|
+
"onUpdate:field": o[1] || (o[1] = (r) => e.current.comment = r),
|
169
|
+
label: "Comment",
|
170
|
+
type: "textarea",
|
171
|
+
class: "w-100 bg-white radius-small pd-medium"
|
172
|
+
}, null, 8, ["field"])
|
173
|
+
]),
|
174
|
+
_: 1
|
175
|
+
}),
|
176
|
+
a(v, { class: "" }, {
|
177
|
+
default: c(() => [
|
178
|
+
n("section", W, [
|
179
|
+
n("h3", X, " In total: " + k(s.formatPrice(N.value)), 1),
|
180
|
+
n("a", {
|
181
|
+
onClick: o[2] || (o[2] = (r) => L()),
|
167
182
|
class: "bg-main button"
|
168
183
|
}, " Save "),
|
169
|
-
|
184
|
+
n("a", {
|
170
185
|
class: "t-white bg-second button",
|
171
|
-
onClick:
|
186
|
+
onClick: o[3] || (o[3] = (r) => D())
|
172
187
|
}, " Reset "),
|
173
|
-
|
188
|
+
b(t).params.leftover ? (l(), p("a", {
|
174
189
|
key: 0,
|
175
|
-
onClick:
|
190
|
+
onClick: o[4] || (o[4] = (r) => R()),
|
176
191
|
class: "t-white bg-red button"
|
177
|
-
}, " Delete ")) :
|
192
|
+
}, " Delete ")) : U("", !0)
|
178
193
|
])
|
179
194
|
]),
|
180
195
|
_: 1
|
@@ -183,5 +198,5 @@ const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-cente
|
|
183
198
|
}
|
184
199
|
};
|
185
200
|
export {
|
186
|
-
|
201
|
+
fe as default
|
187
202
|
};
|