@ozdao/prometheus-framework 0.2.92 → 0.2.94
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/events.server.js +14 -6
- package/dist/events.server.mjs +14 -6
- package/dist/main-CX2ISR43.mjs +13629 -0
- package/dist/main-cffh4bbv.js +92 -0
- package/dist/main.css +1 -1
- package/dist/orders.server.js +37 -23
- package/dist/orders.server.mjs +37 -23
- package/dist/organizations.server.js +2 -1
- package/dist/organizations.server.mjs +2 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
- package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- 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/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
- 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 +45 -45
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +28 -28
- 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 +99 -70
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +28 -26
- 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 +11 -11
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +47 -44
- 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 +162 -168
- 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 +27 -26
- 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 +7 -7
- 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/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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +14 -15
- 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 +22 -20
- 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/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
- 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/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.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-CQQEUA9l.js +1 -0
- package/dist/web-D2Em-p-C.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Address/Address.vue +23 -34
- package/src/components/LocationMarker/LocationMarker.vue +6 -1
- package/src/components/LocationSelection/LocationSelection.vue +4 -0
- package/src/components/Map/Map.vue +29 -15
- package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
- package/src/modules/events/controllers/events.controller.js +4 -4
- package/src/modules/globals/components/blocks/CardHeader.vue +2 -2
- package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
- package/src/modules/landing/components/pages/Farming.vue +226 -0
- package/src/modules/landing/components/pages/Governance.vue +3 -5
- package/src/modules/landing/components/pages/Home.vue +0 -3
- package/src/modules/landing/components/pages/Hotel.vue +1 -3
- package/src/modules/landing/components/pages/Page.vue +0 -3
- package/src/modules/landing/components/sections/Examples.vue +4 -56
- package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
- package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
- package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
- package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
- package/src/modules/landing/router/landing.js +11 -0
- package/src/modules/marketplace/components/sections/Filters.vue +26 -23
- package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
- package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
- package/src/modules/orders/components/pages/Order.vue +2 -6
- package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
- package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
- package/src/modules/orders/components/pages/Orders.vue +60 -11
- package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
- package/src/modules/orders/controllers/orders.controller.js +30 -19
- package/src/modules/orders/models/order.model.js +8 -2
- package/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/src/modules/orders/router/orders.router.js +2 -2
- package/src/modules/orders/store/orders.js +3 -7
- package/src/modules/orders/store/shopcart.js +1 -1
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
- package/src/modules/organizations/components/pages/Department.vue +5 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
- package/src/modules/organizations/components/pages/Members.vue +2 -1
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/controllers/memberships.controller.js +3 -1
- package/src/modules/organizations/store/memberships.js +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +2 -3
- package/src/modules/products/components/pages/ProductEdit.vue +10 -13
- package/src/modules/products/components/pages/Products.vue +2 -0
- package/src/modules/products/store/products.js +25 -2
- package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
- package/src/modules/users/components/blocks/CardUser.vue +1 -0
- package/src/modules/landing/components/sections/AboutSection.vue +0 -69
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("vue-router"),z=require("../../../globals/components/sections/SectionPageTitle.vue.cjs"),T=require("../../../../components/Popup/Popup.vue.cjs"),F=require("../../../icons/entities/IconTime.vue.cjs"),P=require("../blocks/CardOrderItem.vue.cjs"),L=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),R=require("../../../chats/components/pages/ChatPage.vue.cjs"),A=require("../blocks/StatusHistory.vue.cjs"),H=require("../../../globals/store/globals.cjs"),c=require("../../store/orders.cjs"),U=require("../../../products/store/products.cjs"),W=require("../../../organizations/store/organizations.cjs");require("./OrderBackoffice.vue2.cjs");const j=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),r=b=>(e.pushScopeId("data-v-36d45d04"),b=b(),e.popScopeId(),b),Q={key:0,class:"pd-thin"},Y={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-big"},$={class:"mn-b-small flex-nowrap flex"},G=r(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-r-auto"}," Progress ",-1)),J={class:"t-medium p-medium"},K={class:"p-small t-transp"},X=r(()=>e.createElementVNode("h2",{class:"mn-b-small"},null,-1)),Z={class:"radius-extra mn-b-medium flex-nowrap flex pos-relative"},ee={class:"flex-nowrap flex"},te={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},se={class:"t-medium mn-r-auto"},ae={class:"bg-grey radius-small pd-small mn-b-thin"},re={class:"bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi"},le={key:1,class:"gap-thin cols-2"},ne={class:"w-100"},oe={class:"mn-b-thin bg-grey w-100 o-hidden radius-medium"},ie={class:"pd-small flex-nowrap flex"},ce={class:"mn-r-auto"},de=r(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Your order is",-1)),ue={class:"t-lh-075 h2 d-block mn-b-small"},me=r(()=>e.createElementVNode("p",{class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},"as on 29 aug 2021, Friday",-1)),pe=r(()=>e.createElementVNode("div",{class:"t-right"},[e.createTextVNode(" Cancel order"),e.createElementVNode("br"),e.createTextVNode(" Exchange item "),e.createElementVNode("hr",{class:"mn-b-thin mn-t-thin"}),e.createTextVNode(" For Delivery Queries Contact Us ")],-1)),_e={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},he=r(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),be={class:"w-100 t-right"},ge={key:0,class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},ve={class:"w-100 t-medium p-medium"},Ne={class:"w-100 t-right"},fe=r(()=>e.createElementVNode("div",{class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},[e.createElementVNode("p",{class:"t-medium p-medium"}," Address "),e.createElementVNode("p",{class:"w-100 t-right"})],-1)),Ve={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},Ee=r(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ye={class:"w-100 t-right mn-b-small"},ke={key:2,class:"t-transp"},we={class:"bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Se=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),xe={class:"flex gap-thin flex-column mn-b-semi"},Ce={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},Be={class:"pd-small br-solid br-b br-black-transp-10 flex"},De=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),Oe={class:"pd-small br-solid br-b br-black-transp-10 flex"},qe=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),Pe={class:"pd-small flex-bottom flex"},Ie=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Me={class:"p-big t-semi"},ze=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),Te={__name:"OrderBackoffice",setup(b){q.useRouter();const _=q.useRoute(),s=e.ref(null),g=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Order Confirming","Order Confirmed","Packing","In Delivery","Delivered"],v=t=>o.slice(t).includes(s.value.status),N=e.ref(!1),E=e.ref(null),f=e.ref([]);function I(t){N.value=!0,typeof t=="number"&&(E.value=t)}function y(){N.value=!1,E.value=null}e.onMounted(async()=>{var a,l;s.value=await c.actions.read({_id:_.params.order}),s.value=s.value[0],g.value=await U.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(g.value);const t=g.value.reduce((d,u)=>(d[u._id]=u,d),{});console.log(t),f.value=s.value.positions.map(({_id:d,quantity:u})=>{const m=t[d];return{name:m.name,images:m.images,price:m.price,_id:m._id,quantity:u}}),n.value=await W.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(l=H.state.position)==null?void 0:l.location})});let k=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.price*l.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.quantity,0))});function h(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function M(){const t=h(c.state.current.status);t?(c.state.current.status=t,await c.actions.update(c.state.current)):console.error("Next status is void. Must handle somehow."),y()}return(t,a)=>{var l,d,u,m,S,x,C,B,D,O;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(z.default,{title:`Order is ${s.value.status}`,class:"mn-b-small bg-grey bg-grey radius-big"},null,8,["title"]),s.value?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",$,[G,e.createElementVNode("p",J,[e.createTextVNode(" Order No: "),e.createElementVNode("span",K,"#"+e.toDisplayString(s.value._id),1)])]),X,e.createElementVNode("div",Z,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(p,i)=>e.createElementVNode("div",{key:i,class:"mn-r-thin w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-grey br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":v(i)},{"t-transp":!v(i)},{blink:s.value.status===o[i]&&h(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!v(i)},"mn-t-thin t-medium uppercase"])},e.toDisplayString(V[i]),3)])),64))]),e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createVNode(F.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",se,"Estimated Arrival "+e.toDisplayString(t.formatDate(s.value.deadline)),1)]),h(s.value.status)&&e.unref(_).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:I,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(h(s.value.status))),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createVNode(T.default,{title:"Change status",onClosePopup:y,isPopupOpen:N.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createElementVNode("p",ae,"Estimated Arrival "+e.toDisplayString(t.formatDate(s.value.deadline)),1),e.createElementVNode("ul",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,i)=>(e.openBlock(),e.createBlock(P.default,{key:p._id,editable:!1,product:p},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:M,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(h(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("div",ne,[n.value[0]?(e.openBlock(),e.createBlock(L.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",oe,[e.createElementVNode("div",ie,[e.createElementVNode("div",ce,[de,e.createElementVNode("span",ue,e.toDisplayString(s.value.status),1),me]),pe]),e.createElementVNode("div",_e,[he,e.createElementVNode("p",be,e.toDisplayString((l=s.value.user)==null?void 0:l.number),1)]),(d=s.value.user)!=null&&d.messenger.type?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("p",ve,e.toDisplayString((u=s.value.user)==null?void 0:u.messenger.type),1),e.createElementVNode("p",Ne,e.toDisplayString((m=s.value.user)==null?void 0:m.messenger.value),1)])):e.createCommentVNode("",!0),fe,e.createElementVNode("div",Ve,[Ee,e.createElementVNode("p",ye,e.toDisplayString((S=s.value.delivery)==null?void 0:S.type),1)])]),c.state.current.status_history?(e.openBlock(),e.createBlock(A.default,{key:1,statuses:o,statusHistory:c.state.current.status_history,statusCurrent:c.state.current.status,edit:e.unref(_).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ke,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",we,[Se,e.createElementVNode("ul",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,i)=>(e.openBlock(),e.createBlock(P.default,{key:p._id,editable:!1,product:p},null,8,["product"]))),128))]),e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[De,e.createElementVNode("p",null,e.toDisplayString(e.unref(k))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",Oe,[qe,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((x=n.value[0])==null?void 0:x.distance)-7,5*(((C=n.value[0])==null?void 0:C.distance)/10))),1)]),e.createElementVNode("div",Pe,[Ie,e.createElementVNode("p",Me,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((B=n.value[0])==null?void 0:B.distance)-7,5*(((D=n.value[0])==null?void 0:D.distance)/10))+e.unref(k)),1)])]),ze,e.createVNode(R.default,{username:e.unref(_).name==="Order Status"?((O=s.value.user)==null?void 0:O.name)||"User":"Weeder Support",chatID:e.unref(_).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Fe=j.default(Te,[["__scopeId","data-v-36d45d04"]]);exports.default=Fe;
|
@@ -0,0 +1,242 @@
|
|
1
|
+
import { ref as v, onMounted as G, computed as q, openBlock as l, createElementBlock as o, createVNode as x, createElementVNode as s, createTextVNode as O, toDisplayString as a, Fragment as N, renderList as $, normalizeClass as H, unref as g, createCommentVNode as m, withCtx as J, createBlock as C, pushScopeId as K, popScopeId as X } from "vue";
|
2
|
+
import { useRouter as Z, useRoute as ss } from "vue-router";
|
3
|
+
import ts from "../../../globals/components/sections/SectionPageTitle.vue.js";
|
4
|
+
import es from "../../../../components/Popup/Popup.vue.js";
|
5
|
+
import as from "../../../icons/entities/IconTime.vue.js";
|
6
|
+
import W from "../blocks/CardOrderItem.vue.js";
|
7
|
+
import rs from "../../../organizations/components/blocks/CardOrganization.vue.js";
|
8
|
+
import ls from "../../../chats/components/pages/ChatPage.vue.js";
|
9
|
+
import ns from "../blocks/StatusHistory.vue.js";
|
10
|
+
import { state as is } from "../../../globals/store/globals.js";
|
11
|
+
import { actions as Q, state as f } from "../../store/orders.js";
|
12
|
+
import { actions as os } from "../../../products/store/products.js";
|
13
|
+
import { actions as us } from "../../../organizations/store/organizations.js";
|
14
|
+
import "./OrderBackoffice.vue2.js";
|
15
|
+
import ds from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
16
|
+
const n = (k) => (K("data-v-36d45d04"), k = k(), X(), k), cs = {
|
17
|
+
key: 0,
|
18
|
+
class: "pd-thin"
|
19
|
+
}, ms = {
|
20
|
+
key: 0,
|
21
|
+
class: "mn-b-thin pos-relative w-100 bg-main radius-big pd-big"
|
22
|
+
}, ps = { class: "mn-b-small flex-nowrap flex" }, _s = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "t-medium p-medium mn-r-auto" }, " Progress ", -1)), hs = { class: "t-medium p-medium" }, bs = { class: "p-small t-transp" }, vs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h2", { class: "mn-b-small" }, null, -1)), gs = { class: "radius-extra mn-b-medium flex-nowrap flex pos-relative" }, fs = { class: "flex-nowrap flex" }, ys = { class: "w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20" }, ws = { class: "t-medium mn-r-auto" }, ks = { class: "bg-grey radius-small pd-small mn-b-thin" }, xs = { class: "bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi" }, Cs = {
|
23
|
+
key: 1,
|
24
|
+
class: "gap-thin cols-2"
|
25
|
+
}, Os = { class: "w-100" }, Ss = { class: "mn-b-thin bg-grey w-100 o-hidden radius-medium" }, Ps = { class: "pd-small flex-nowrap flex" }, Is = { class: "mn-r-auto" }, Ds = /* @__PURE__ */ n(() => /* @__PURE__ */ s("span", { class: "d-block t-medium p-medium" }, "Your order is", -1)), Ns = { class: "t-lh-075 h2 d-block mn-b-small" }, $s = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max" }, "as on 29 aug 2021, Friday", -1)), Es = /* @__PURE__ */ n(() => /* @__PURE__ */ s("div", { class: "t-right" }, [
|
26
|
+
/* @__PURE__ */ O(" Cancel order"),
|
27
|
+
/* @__PURE__ */ s("br"),
|
28
|
+
/* @__PURE__ */ O(" Exchange item "),
|
29
|
+
/* @__PURE__ */ s("hr", { class: "mn-b-thin mn-t-thin" }),
|
30
|
+
/* @__PURE__ */ O(" For Delivery Queries Contact Us ")
|
31
|
+
], -1)), Ms = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, zs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "w-100 t-medium p-medium" }, " Phone ", -1)), Bs = { class: "w-100 t-right" }, Fs = {
|
32
|
+
key: 0,
|
33
|
+
class: "pd-small cols-2 br-t br-black-transp-10 br-solid"
|
34
|
+
}, As = { class: "w-100 t-medium p-medium" }, Rs = { class: "w-100 t-right" }, Vs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("div", { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, [
|
35
|
+
/* @__PURE__ */ s("p", { class: "t-medium p-medium" }, " Address "),
|
36
|
+
/* @__PURE__ */ s("p", { class: "w-100 t-right" })
|
37
|
+
], -1)), Ls = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Ts = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-b-small t-medium p-medium" }, " Delivery ", -1)), Us = { class: "w-100 t-right mn-b-small" }, qs = {
|
38
|
+
key: 2,
|
39
|
+
class: "t-transp"
|
40
|
+
}, Hs = { class: "bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100" }, Ws = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "Order Summary", -1)), Qs = { class: "flex gap-thin flex-column mn-b-semi" }, Ys = { class: "mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100" }, js = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Gs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "In total", -1)), Js = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Ks = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "Delivery", -1)), Xs = { class: "pd-small flex-bottom flex" }, Zs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "In total to pay", -1)), st = { class: "p-big t-semi" }, tt = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "Chat With Us", -1)), et = {
|
41
|
+
__name: "OrderBackoffice",
|
42
|
+
setup(k) {
|
43
|
+
Z();
|
44
|
+
const y = ss(), e = v(null), S = v(null), u = v(null), d = ["created", "confirmed", "packing", "in delivery", "delivered"], E = ["Order Confirming", "Order Confirmed", "Packing", "In Delivery", "Delivered"], P = (t) => d.slice(t).includes(e.value.status), I = v(!1), M = v(null), D = v([]);
|
45
|
+
function Y(t) {
|
46
|
+
I.value = !0, typeof t == "number" && (M.value = t);
|
47
|
+
}
|
48
|
+
function z() {
|
49
|
+
I.value = !1, M.value = null;
|
50
|
+
}
|
51
|
+
G(async () => {
|
52
|
+
var r, i;
|
53
|
+
e.value = await Q.read({ _id: y.params.order }), e.value = e.value[0], S.value = await os.read({
|
54
|
+
organization: e.value.owner.target._id,
|
55
|
+
limit: 1e3
|
56
|
+
}), console.log(S.value);
|
57
|
+
const t = S.value.reduce((p, _) => (p[_._id] = _, p), {});
|
58
|
+
console.log(t), D.value = e.value.positions.map(({ _id: p, quantity: _ }) => {
|
59
|
+
const h = t[p];
|
60
|
+
return {
|
61
|
+
name: h.name,
|
62
|
+
images: h.images,
|
63
|
+
price: h.price,
|
64
|
+
_id: h._id,
|
65
|
+
quantity: _
|
66
|
+
};
|
67
|
+
}), u.value = await us.read({
|
68
|
+
_id: (r = e.value) == null ? void 0 : r.owner.target._id,
|
69
|
+
location: (i = is.position) == null ? void 0 : i.location
|
70
|
+
});
|
71
|
+
});
|
72
|
+
let B = q(() => {
|
73
|
+
var t;
|
74
|
+
return Number((t = e.value) == null ? void 0 : t.positions.reduce((r, i) => r + i.price * i.quantity, 0));
|
75
|
+
});
|
76
|
+
q(() => {
|
77
|
+
var t;
|
78
|
+
return Number((t = e.value) == null ? void 0 : t.positions.reduce((r, i) => r + i.quantity, 0));
|
79
|
+
});
|
80
|
+
function w(t) {
|
81
|
+
const r = d.indexOf(t);
|
82
|
+
return r !== -1 && r + 1 < d.length ? d[r + 1] : null;
|
83
|
+
}
|
84
|
+
function F(t) {
|
85
|
+
const r = d.indexOf(t);
|
86
|
+
return t ? E[r] : "";
|
87
|
+
}
|
88
|
+
async function j() {
|
89
|
+
const t = w(f.current.status);
|
90
|
+
t ? (f.current.status = t, await Q.update(f.current)) : console.error("Next status is void. Must handle somehow."), z();
|
91
|
+
}
|
92
|
+
return (t, r) => {
|
93
|
+
var i, p, _, h, A, R, V, L, T, U;
|
94
|
+
return e.value && u.value ? (l(), o("div", cs, [
|
95
|
+
x(ts, {
|
96
|
+
title: `Order is ${e.value.status}`,
|
97
|
+
class: "mn-b-small bg-grey bg-grey radius-big"
|
98
|
+
}, null, 8, ["title"]),
|
99
|
+
e.value ? (l(), o("div", ms, [
|
100
|
+
s("div", ps, [
|
101
|
+
_s,
|
102
|
+
s("p", hs, [
|
103
|
+
O(" Order No: "),
|
104
|
+
s("span", bs, "#" + a(e.value._id), 1)
|
105
|
+
])
|
106
|
+
]),
|
107
|
+
vs,
|
108
|
+
s("div", gs, [
|
109
|
+
(l(), o(N, null, $(d, (b, c) => s("div", {
|
110
|
+
key: c,
|
111
|
+
class: "mn-r-thin w-20"
|
112
|
+
}, [
|
113
|
+
s("div", {
|
114
|
+
class: H([
|
115
|
+
"bg-grey br-anim br-glow radius-extra h-1r w-100",
|
116
|
+
{ "br-glow-anim": P(c) },
|
117
|
+
{ "t-transp": !P(c) },
|
118
|
+
{ blink: e.value.status === d[c] && w(e.value.status) }
|
119
|
+
])
|
120
|
+
}, null, 2),
|
121
|
+
s("div", {
|
122
|
+
class: H([{ "t-transp": !P(c) }, "mn-t-thin t-medium uppercase"])
|
123
|
+
}, a(E[c]), 3)
|
124
|
+
])), 64))
|
125
|
+
]),
|
126
|
+
s("div", fs, [
|
127
|
+
s("div", ys, [
|
128
|
+
x(as, {
|
129
|
+
class: "i-semi t-transp",
|
130
|
+
fill: "rgb(var(--black)"
|
131
|
+
}),
|
132
|
+
s("p", ws, "Estimated Arrival " + a(t.formatDate(e.value.deadline)), 1)
|
133
|
+
]),
|
134
|
+
w(e.value.status) && g(y).name === "Order Edit" ? (l(), o("button", {
|
135
|
+
key: 0,
|
136
|
+
onClick: Y,
|
137
|
+
class: "mn-l-auto bg-black t-white button"
|
138
|
+
}, " Mark as " + a(F(w(e.value.status))), 1)) : m("", !0)
|
139
|
+
])
|
140
|
+
])) : m("", !0),
|
141
|
+
x(es, {
|
142
|
+
title: "Change status",
|
143
|
+
onClosePopup: z,
|
144
|
+
isPopupOpen: I.value,
|
145
|
+
class: "bg-white w-min-30r w-max-30r radius-big pd-big"
|
146
|
+
}, {
|
147
|
+
default: J(() => [
|
148
|
+
s("p", ks, "Estimated Arrival " + a(t.formatDate(e.value.deadline)), 1),
|
149
|
+
s("ul", xs, [
|
150
|
+
(l(!0), o(N, null, $(D.value, (b, c) => (l(), C(W, {
|
151
|
+
key: b._id,
|
152
|
+
editable: !1,
|
153
|
+
product: b
|
154
|
+
}, null, 8, ["product"]))), 128))
|
155
|
+
]),
|
156
|
+
s("button", {
|
157
|
+
onClick: j,
|
158
|
+
class: "w-100 bg-black-small t-white button"
|
159
|
+
}, a("Confirm Changing to " + F(w(e.value.status))), 1)
|
160
|
+
]),
|
161
|
+
_: 1
|
162
|
+
}, 8, ["isPopupOpen"]),
|
163
|
+
e.value ? (l(), o("div", Cs, [
|
164
|
+
s("div", Os, [
|
165
|
+
u.value[0] ? (l(), C(rs, {
|
166
|
+
key: 0,
|
167
|
+
organization: u.value[0],
|
168
|
+
showRating: !0,
|
169
|
+
showFollowers: !1,
|
170
|
+
showProducts: !1,
|
171
|
+
class: "bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"
|
172
|
+
}, null, 8, ["organization"])) : m("", !0),
|
173
|
+
s("div", Ss, [
|
174
|
+
s("div", Ps, [
|
175
|
+
s("div", Is, [
|
176
|
+
Ds,
|
177
|
+
s("span", Ns, a(e.value.status), 1),
|
178
|
+
$s
|
179
|
+
]),
|
180
|
+
Es
|
181
|
+
]),
|
182
|
+
s("div", Ms, [
|
183
|
+
zs,
|
184
|
+
s("p", Bs, a((i = e.value.user) == null ? void 0 : i.number), 1)
|
185
|
+
]),
|
186
|
+
(p = e.value.user) != null && p.messenger.type ? (l(), o("div", Fs, [
|
187
|
+
s("p", As, a((_ = e.value.user) == null ? void 0 : _.messenger.type), 1),
|
188
|
+
s("p", Rs, a((h = e.value.user) == null ? void 0 : h.messenger.value), 1)
|
189
|
+
])) : m("", !0),
|
190
|
+
Vs,
|
191
|
+
s("div", Ls, [
|
192
|
+
Ts,
|
193
|
+
s("p", Us, a((A = e.value.delivery) == null ? void 0 : A.type), 1)
|
194
|
+
])
|
195
|
+
]),
|
196
|
+
f.current.status_history ? (l(), C(ns, {
|
197
|
+
key: 1,
|
198
|
+
statuses: d,
|
199
|
+
statusHistory: f.current.status_history,
|
200
|
+
statusCurrent: f.current.status,
|
201
|
+
edit: g(y).name === "Order Edit"
|
202
|
+
}, null, 8, ["statusHistory", "statusCurrent", "edit"])) : m("", !0),
|
203
|
+
t.payment && t.payment.Status === "CONFIRMED" ? (l(), o("span", qs, "Paid")) : m("", !0)
|
204
|
+
]),
|
205
|
+
s("div", Hs, [
|
206
|
+
Ws,
|
207
|
+
s("ul", Qs, [
|
208
|
+
(l(!0), o(N, null, $(D.value, (b, c) => (l(), C(W, {
|
209
|
+
key: b._id,
|
210
|
+
editable: !1,
|
211
|
+
product: b
|
212
|
+
}, null, 8, ["product"]))), 128))
|
213
|
+
]),
|
214
|
+
s("div", Ys, [
|
215
|
+
s("div", js, [
|
216
|
+
Gs,
|
217
|
+
s("p", null, a(g(B)) + " " + a(t.returnCurrency()), 1)
|
218
|
+
]),
|
219
|
+
s("div", Js, [
|
220
|
+
Ks,
|
221
|
+
s("p", null, a(t.returnCurrency()) + " " + a(Math.trunc(100 + 20 * ((R = u.value[0]) == null ? void 0 : R.distance) - 7, 5 * (((V = u.value[0]) == null ? void 0 : V.distance) / 10))), 1)
|
222
|
+
]),
|
223
|
+
s("div", Xs, [
|
224
|
+
Zs,
|
225
|
+
s("p", st, a(t.returnCurrency()) + " " + a(Math.trunc(100 + 20 * ((L = u.value[0]) == null ? void 0 : L.distance) - 7, 5 * (((T = u.value[0]) == null ? void 0 : T.distance) / 10)) + g(B)), 1)
|
226
|
+
])
|
227
|
+
]),
|
228
|
+
tt,
|
229
|
+
x(ls, {
|
230
|
+
username: g(y).name === "Order Status" ? ((U = e.value.user) == null ? void 0 : U.name) || "User" : "Weeder Support",
|
231
|
+
chatID: g(y).params.order,
|
232
|
+
class: "radius-semi bg-white o-hidden"
|
233
|
+
}, null, 8, ["username", "chatID"])
|
234
|
+
])
|
235
|
+
])) : m("", !0)
|
236
|
+
])) : m("", !0);
|
237
|
+
};
|
238
|
+
}
|
239
|
+
}, gt = /* @__PURE__ */ ds(et, [["__scopeId", "data-v-36d45d04"]]);
|
240
|
+
export {
|
241
|
+
gt as default
|
242
|
+
};
|
package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("../blocks/CardOrderItem.vue.cjs"),N=require("../sections/AskToLogin.vue.cjs"),q=require("../sections/Succes.vue.cjs"),E=require("../sections/EmptyState.vue.cjs"),S=require("../sections/FormCustomerDetails.vue.cjs"),P=require("../sections/FormDelivery.vue.cjs"),D=require("../sections/FormPayment.vue.cjs"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("../blocks/CardOrderItem.vue.cjs"),N=require("../sections/AskToLogin.vue.cjs"),q=require("../sections/Succes.vue.cjs"),E=require("../sections/EmptyState.vue.cjs"),S=require("../sections/FormCustomerDetails.vue.cjs"),P=require("../sections/FormDelivery.vue.cjs"),D=require("../sections/FormPayment.vue.cjs"),g=require("vue-router"),w=require("../../../globals/store/globals.cjs"),m=require("../../../auth/store/auth.cjs"),o=require("../../store/shopcart.cjs"),y=require("../../../organizations/store/organizations.cjs"),t=require("../../store/orders.cjs"),M=require("../../../users/store/users.cjs");require("./OrderCreate.vue2.cjs");const O={class:"pd-thin"},T={class:"gap-small mn-b-thin cols-2"},z={key:2,class:"order-form col"},F={key:3},I=e.createElementVNode("p",{class:"p-big mn-b-small"},"Your Order",-1),R={class:"mn-b-semi"},A={style:{"border-bottom":"1px solid #f7f7f7","border-top":"1px solid #f7f7f7"},class:"pd-b-medium pd-t-medium mn-b-medium"},G={class:"mn-b-thin"},L={class:"mn-b-thin"},Q={class:"h3"},j=e.createElementVNode("p",{class:"mn-b-thin"}," By making this purchase you agree to the General Terms and Conditions. ",-1),U=e.createElementVNode("p",{class:"mn-b-small"}," I agree that placing the order places me under an obligation to make a payment in accordance with the General Terms and Conditions. ",-1),Y=["disabled"],$={__name:"OrderCreate",setup(H){g.useRoute();const _=g.useRouter(),p=e.computed(()=>t.state.current);e.computed(()=>M.state.current);const h=e.computed(()=>o.getters.cartTotalPrice),n=e.ref({});e.onMounted(async()=>{var r;n.value=await y.actions.read({_id:o.state.organization,location:(r=w.state.position)==null?void 0:r.location})}),e.watch(()=>t.state.current.delivery.address,async(r,s)=>{n.value=await y.actions.read({_id:o.state.organization,location:t.state.current.delivery.location})},{deep:!0});const v=e.computed(()=>{var r;return((r=t.state.current.customer.name)==null?void 0:r.length)<2}),k=e.computed(()=>{var c,u,i,a;const r=(c=t.state.current.customer.messenger)==null?void 0:c.type,s=((i=(u=t.state.current.customer.messenger)==null?void 0:u.value)==null?void 0:i.length)>2;return!(((a=t.state.current.customer.number)==null?void 0:a.length)>0)&&!(r&&s)}),f=e.computed(()=>t.state.current.delivery.type!=="Pickup"&&t.state.current.delivery.address<2),b=e.computed(()=>!t.state.current.delivery.type),B=e.computed(()=>!t.state.current.payment.type);async function C(){t.state.current.status="created",t.state.current.owner={target:o.state.organization,type:"organization"},m.state.user._id&&(t.state.current.creator={target:m.state.user._id,type:"User"}),t.state.current.positions=o.state.positions;const r=localStorage.getItem("referalCode");r&&(t.state.current.referralCode=r);let s=await t.actions.create(t.state.current);s?(o.actions.resetShopcart(),_.push({name:"Order Status",params:{order:s._id}})):alert("something wrong")}return(r,s)=>{var d,c,u,i;return e.openBlock(),e.createElementBlock("section",O,[m.state.access.status===!1?(e.openBlock(),e.createBlock(N.default,{key:0,class:"mn-b-big"})):e.createCommentVNode("",!0),e.createElementVNode("div",T,[o.state.positions<1?(e.openBlock(),e.createBlock(E.default,{key:0})):e.createCommentVNode("",!0),p.value.status===!0&&o.state.positions.length>0?(e.openBlock(),e.createBlock(q.default,{key:1,order:p.value},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(S.default,{customer:t.state.current.customer},null,8,["customer"]),t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createBlock(P.default,{key:0,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createBlock(D.default,{key:1,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",F,[I,e.createElementVNode("ul",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.state.positions,a=>(e.openBlock(),e.createBlock(V.default,{key:a._id,editable:"true",product:a,increase:l=>o.actions.incrementItemQuantity(l._id),decrease:l=>o.actions.decrementItemQuantity(l._id),remove:l=>o.actions.removeProduct(l._id)},null,8,["product","increase","decrease","remove"]))),128))]),e.createElementVNode("div",A,[e.createElementVNode("p",G," Subtotal: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(h.value),1),e.createElementVNode("p",L," Delivery: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((d=n.value[0])==null?void 0:d.distance)-7,5*(((c=n.value[0])==null?void 0:c.distance)/10))),1),e.createElementVNode("p",Q," Total: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((i=n.value[0])==null?void 0:i.distance)/10))+h.value.value),1)]),j,U,t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:v.value||k.value||r.errorCity||f.value||b.value||B.value,onClick:s[0]||(s[0]=a=>C()),class:"bg-main pd-small radius-big w-100 button"}," Place an Order ",8,Y)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])}}};exports.default=$;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { computed as a, ref as z, onMounted as
|
1
|
+
import { computed as a, ref as z, onMounted as S, watch as B, openBlock as s, createElementBlock as h, createBlock as l, createCommentVNode as i, createElementVNode as o, createVNode as I, Fragment as N, renderList as D, toDisplayString as d } from "vue";
|
2
2
|
import F from "../blocks/CardOrderItem.vue.js";
|
3
3
|
import E from "../sections/AskToLogin.vue.js";
|
4
4
|
import G from "../sections/Succes.vue.js";
|
@@ -6,36 +6,36 @@ import Q from "../sections/EmptyState.vue.js";
|
|
6
6
|
import R from "../sections/FormCustomerDetails.vue.js";
|
7
7
|
import A from "../sections/FormDelivery.vue.js";
|
8
8
|
import L from "../sections/FormPayment.vue.js";
|
9
|
-
import { useRoute as
|
10
|
-
import { state as
|
11
|
-
import { state as
|
12
|
-
import { getters as
|
9
|
+
import { useRoute as U, useRouter as Y } from "vue-router";
|
10
|
+
import { state as j } from "../../../globals/store/globals.js";
|
11
|
+
import { state as v } from "../../../auth/store/auth.js";
|
12
|
+
import { getters as q, state as t, actions as y } from "../../store/shopcart.js";
|
13
13
|
import { actions as $ } from "../../../organizations/store/organizations.js";
|
14
|
-
import { state as e, actions as
|
15
|
-
import { state as
|
14
|
+
import { state as e, actions as x } from "../../store/orders.js";
|
15
|
+
import { state as H } from "../../../users/store/users.js";
|
16
16
|
import "./OrderCreate.vue2.js";
|
17
|
-
const
|
17
|
+
const J = { class: "pd-thin" }, K = { class: "gap-small mn-b-thin cols-2" }, W = {
|
18
18
|
key: 2,
|
19
19
|
class: "order-form col"
|
20
|
-
}, X = { key: 3 }, Z = /* @__PURE__ */
|
20
|
+
}, X = { key: 3 }, Z = /* @__PURE__ */ o("p", { class: "p-big mn-b-small" }, "Your Order", -1), ee = { class: "mn-b-semi" }, re = {
|
21
21
|
style: { "border-bottom": "1px solid #f7f7f7", "border-top": "1px solid #f7f7f7" },
|
22
22
|
class: "pd-b-medium pd-t-medium mn-b-medium"
|
23
|
-
}, te = { class: "mn-b-thin" }, se = { class: "mn-b-thin" },
|
23
|
+
}, te = { class: "mn-b-thin" }, se = { class: "mn-b-thin" }, oe = { class: "h3" }, ne = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, " By making this purchase you agree to the General Terms and Conditions. ", -1), ae = /* @__PURE__ */ o("p", { class: "mn-b-small" }, " I agree that placing the order places me under an obligation to make a payment in accordance with the General Terms and Conditions. ", -1), ie = ["disabled"], Pe = {
|
24
24
|
__name: "OrderCreate",
|
25
|
-
setup(
|
26
|
-
|
27
|
-
const C =
|
28
|
-
a(() =>
|
29
|
-
const k = a(() =>
|
30
|
-
|
25
|
+
setup(ce) {
|
26
|
+
U();
|
27
|
+
const C = Y(), b = a(() => e.current);
|
28
|
+
a(() => H.current);
|
29
|
+
const k = a(() => q.cartTotalPrice), c = z({});
|
30
|
+
S(async () => {
|
31
31
|
var r;
|
32
|
-
|
33
|
-
_id:
|
34
|
-
location: (r =
|
32
|
+
c.value = await $.read({
|
33
|
+
_id: t.organization,
|
34
|
+
location: (r = j.position) == null ? void 0 : r.location
|
35
35
|
});
|
36
|
-
}),
|
37
|
-
|
38
|
-
_id:
|
36
|
+
}), B(() => e.current.delivery.address, async (r, n) => {
|
37
|
+
c.value = await $.read({
|
38
|
+
_id: t.organization,
|
39
39
|
location: e.current.delivery.location
|
40
40
|
});
|
41
41
|
}, { deep: !0 });
|
@@ -43,77 +43,77 @@ const K = { class: "pd-thin" }, U = { class: "gap-small mn-b-thin cols-2" }, W =
|
|
43
43
|
var r;
|
44
44
|
return ((r = e.current.customer.name) == null ? void 0 : r.length) < 2;
|
45
45
|
}), P = a(() => {
|
46
|
-
var m, p, _,
|
47
|
-
const r = (m = e.current.customer.messenger) == null ? void 0 : m.type,
|
48
|
-
return !(((
|
46
|
+
var m, p, _, u;
|
47
|
+
const r = (m = e.current.customer.messenger) == null ? void 0 : m.type, n = ((_ = (p = e.current.customer.messenger) == null ? void 0 : p.value) == null ? void 0 : _.length) > 2;
|
48
|
+
return !(((u = e.current.customer.number) == null ? void 0 : u.length) > 0) && !(r && n);
|
49
49
|
}), M = a(() => e.current.delivery.type !== "Pickup" && e.current.delivery.address < 2), O = a(() => !e.current.delivery.type), T = a(() => !e.current.payment.type);
|
50
50
|
async function V() {
|
51
51
|
e.current.status = "created", e.current.owner = {
|
52
|
-
target:
|
52
|
+
target: t.organization,
|
53
53
|
type: "organization"
|
54
|
-
},
|
55
|
-
target:
|
56
|
-
type: "
|
57
|
-
}), e.current.positions =
|
54
|
+
}, v.user._id && (e.current.creator = {
|
55
|
+
target: v.user._id,
|
56
|
+
type: "User"
|
57
|
+
}), e.current.positions = t.positions;
|
58
58
|
const r = localStorage.getItem("referalCode");
|
59
59
|
r && (e.current.referralCode = r);
|
60
|
-
let
|
61
|
-
|
60
|
+
let n = await x.create(e.current);
|
61
|
+
n ? (y.resetShopcart(), C.push({
|
62
62
|
name: "Order Status",
|
63
63
|
params: {
|
64
|
-
order:
|
64
|
+
order: n._id
|
65
65
|
}
|
66
|
-
}) : alert("something wrong");
|
66
|
+
})) : alert("something wrong");
|
67
67
|
}
|
68
|
-
return (r,
|
69
|
-
var
|
70
|
-
return
|
71
|
-
|
68
|
+
return (r, n) => {
|
69
|
+
var g, m, p, _;
|
70
|
+
return s(), h("section", J, [
|
71
|
+
v.access.status === !1 ? (s(), l(E, {
|
72
72
|
key: 0,
|
73
73
|
class: "mn-b-big"
|
74
74
|
})) : i("", !0),
|
75
|
-
|
76
|
-
|
77
|
-
b.value.status === !0 &&
|
75
|
+
o("div", K, [
|
76
|
+
t.positions < 1 ? (s(), l(Q, { key: 0 })) : i("", !0),
|
77
|
+
b.value.status === !0 && t.positions.length > 0 ? (s(), l(G, {
|
78
78
|
key: 1,
|
79
79
|
order: b.value
|
80
80
|
}, null, 8, ["order"])) : i("", !0),
|
81
|
-
e.current.status !== !0 &&
|
82
|
-
|
83
|
-
|
84
|
-
}, null, 8, ["
|
85
|
-
e.current.status !== !0 &&
|
81
|
+
e.current.status !== !0 && t.positions.length > 0 ? (s(), h("div", W, [
|
82
|
+
I(R, {
|
83
|
+
customer: e.current.customer
|
84
|
+
}, null, 8, ["customer"]),
|
85
|
+
e.current.status !== !0 && t.positions.length > 0 ? (s(), l(A, {
|
86
86
|
key: 0,
|
87
87
|
order: e.current
|
88
88
|
}, null, 8, ["order"])) : i("", !0),
|
89
|
-
e.current.status !== !0 &&
|
89
|
+
e.current.status !== !0 && t.positions.length > 0 ? (s(), l(L, {
|
90
90
|
key: 1,
|
91
91
|
order: e.current
|
92
92
|
}, null, 8, ["order"])) : i("", !0)
|
93
93
|
])) : i("", !0),
|
94
|
-
|
94
|
+
t.positions.length > 0 ? (s(), h("div", X, [
|
95
95
|
Z,
|
96
|
-
|
97
|
-
(
|
98
|
-
key:
|
96
|
+
o("ul", ee, [
|
97
|
+
(s(!0), h(N, null, D(t.positions, (u) => (s(), l(F, {
|
98
|
+
key: u._id,
|
99
99
|
editable: "true",
|
100
|
-
product:
|
101
|
-
increase: (f) =>
|
102
|
-
decrease: (f) =>
|
103
|
-
remove: (f) =>
|
100
|
+
product: u,
|
101
|
+
increase: (f) => y.incrementItemQuantity(f._id),
|
102
|
+
decrease: (f) => y.decrementItemQuantity(f._id),
|
103
|
+
remove: (f) => y.removeProduct(f._id)
|
104
104
|
}, null, 8, ["product", "increase", "decrease", "remove"]))), 128))
|
105
105
|
]),
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
106
|
+
o("div", re, [
|
107
|
+
o("p", te, " Subtotal: " + d(r.returnCurrency()) + " " + d(k.value), 1),
|
108
|
+
o("p", se, " Delivery: " + d(r.returnCurrency()) + " " + d(Math.trunc(100 + 20 * ((g = c.value[0]) == null ? void 0 : g.distance) - 7, 5 * (((m = c.value[0]) == null ? void 0 : m.distance) / 10))), 1),
|
109
|
+
o("p", oe, " Total: " + d(r.returnCurrency()) + " " + d(Math.trunc(100 + 20 * ((p = c.value[0]) == null ? void 0 : p.distance) - 7, 5 * (((_ = c.value[0]) == null ? void 0 : _.distance) / 10)) + k.value.value), 1)
|
110
110
|
]),
|
111
|
-
|
111
|
+
ne,
|
112
112
|
ae,
|
113
|
-
e.current.status !== !0 &&
|
113
|
+
e.current.status !== !0 && t.positions.length > 0 ? (s(), h("button", {
|
114
114
|
key: 0,
|
115
115
|
disabled: w.value || P.value || r.errorCity || M.value || O.value || T.value,
|
116
|
-
onClick:
|
116
|
+
onClick: n[0] || (n[0] = (u) => V()),
|
117
117
|
class: "bg-main pd-small radius-big w-100 button"
|
118
118
|
}, " Place an Order ", 8, ie)) : i("", !0)
|
119
119
|
])) : i("", !0)
|
package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/store/globals.cjs"),F=require("../../../auth/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");require("./OrderCreateBackoffice.vue2.cjs");const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=h.useRoute(),y=h.useRouter();let g=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function v(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"user",target:F.state.user._id},t.state.current.owner={type:"organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){y.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(async()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-grey mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let f={...o};f.quantity=1,l.actions.add(t.state.current.positions,f),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>v()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-grey h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(g))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
|