@ozdao/martyrs 0.2.564 → 0.2.565
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abac-BPl9Bmf9.js +1527 -0
- package/dist/builder.js +51 -39
- package/dist/{common.schema-GFSlNJo7.js → common.schema-DswiUXKB.js} +1 -1
- package/dist/community.server.js +48 -9
- package/dist/core.server.js +6 -4
- package/dist/{crud-C7FSTUes.js → crud-q1ye5IhV.js} +7 -7
- package/dist/events.server.js +3 -3
- package/dist/gallery.server.js +2 -2
- package/dist/inventory.server.js +4 -6
- package/dist/{main-CmjWiDVF.js → main-B9o1iBAZ.js} +1279 -1287
- package/dist/marketplace.server.js +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +36 -45
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/Field/{Field.vue2.js → Field.vue.js} +2 -2
- package/dist/martyrs/src/components/Field/Field.vue.js.map +1 -0
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +2 -2
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js.map +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js → Loader.vue.js} +3 -4
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -0
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
- package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Select/{Select.vue2.js → Select.vue.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -0
- package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue.js → SelectMulti.vue2.js} +2 -2
- package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Tree/Tree.vue.js +6 -3
- package/dist/martyrs/src/components/Tree/Tree.vue.js.map +1 -1
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/auth.client.js +10 -7
- package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +13 -13
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js +116 -0
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +180 -0
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -0
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +4 -4
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.js +1 -1
- package/dist/martyrs/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/martyrs/src/modules/core/locales/en.js +45 -0
- package/dist/martyrs/src/modules/core/locales/en.js.map +1 -1
- package/dist/martyrs/src/modules/core/locales/ru.js +45 -0
- package/dist/martyrs/src/modules/core/locales/ru.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js +9 -0
- package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterRange.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/mixins/mixins.js +1 -2
- package/dist/martyrs/src/modules/core/views/mixins/mixins.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/router/addRoutes.js +6 -1
- package/dist/martyrs/src/modules/core/views/router/addRoutes.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +4 -4
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +4 -4
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +3 -3
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +3 -3
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +5 -5
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +3 -3
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +4 -4
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +3 -3
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +4 -4
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js +3 -0
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +3 -3
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +3 -3
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +5 -5
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js +15 -2
- package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +10 -7
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +7 -6
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +11 -2
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +11 -8
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +211 -61
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +4 -4
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +2 -2
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.js +11 -12
- package/dist/notifications.server.js +0 -3
- package/dist/orders.server.js +5 -6
- package/dist/organizations.server.js +9 -10
- package/dist/products.server.js +27 -26
- package/dist/{queryProcessor-CBQgZycY.js → queryProcessor-C_5Iipam.js} +4 -1
- package/dist/rents.server.js +2 -3
- package/dist/spots.server.js +1 -1
- package/dist/style.css +38 -23
- package/dist/{web-cNKIl_cL.js → web-BF3ijvEr.js} +1 -1
- package/package.json +1 -1
- package/src/builder/modes/ssr.rspack.dev.js +4 -3
- package/src/builder/rspack/rspack.config.api.js +15 -4
- package/src/builder/rspack/rspack.config.base.js +3 -3
- package/src/builder/rspack/rspack.config.ssr.client.js +28 -28
- package/src/builder/templates/page.js +2 -2
- package/src/components/Button/Button.vue +50 -37
- package/src/components/FieldPhone/FieldPhone.vue +1 -1
- package/src/components/Loader/Loader.vue +1 -1
- package/src/components/Tree/Tree.vue +6 -3
- package/src/modules/PROCESS.md +0 -0
- package/src/modules/TASKS.MD +17 -0
- package/src/modules/auth/auth.client.js +11 -7
- package/src/modules/auth/views/components/pages/SignIn.vue +1 -1
- package/src/modules/auth/views/router/auth.router.js +94 -0
- package/src/modules/auth/views/router/users.router.js +153 -0
- package/src/modules/backoffice/components/partials/Sidebar.vue +7 -7
- package/src/modules/community/community.server.js +8 -0
- package/src/modules/community/policies/blog.policies.js +55 -0
- package/src/modules/community/routes/blog.routes.js +1 -1
- package/src/modules/community/routes/comments.routes.js +1 -1
- package/src/modules/community/routes/reactions.routes.js +1 -4
- package/src/modules/core/controllers/classes/abac/abac.adapter.express.js +206 -124
- package/src/modules/core/controllers/classes/abac/abac.adapter.ws.js +203 -50
- package/src/modules/core/controllers/classes/abac/abac.core.js +127 -36
- package/src/modules/core/controllers/classes/abac/abac.fields.js +144 -179
- package/src/modules/core/controllers/classes/abac/abac.js +201 -10
- package/src/modules/core/controllers/classes/abac/abac.policies.js +147 -57
- package/src/modules/core/controllers/classes/crud/crud.policies.js +5 -5
- package/src/modules/core/controllers/policies/core.policies.js +5 -2
- package/src/modules/core/controllers/utils/queryProcessor.js +4 -1
- package/src/modules/core/core.server.js +1 -0
- package/src/modules/core/locales/en.js +45 -0
- package/src/modules/core/locales/ru.js +45 -0
- package/src/modules/core/models/schemas/common.schema.js +1 -1
- package/src/modules/core/views/classes/i18n.manager.js +13 -0
- package/src/modules/core/views/components/sections/filters/FilterPrice.vue +81 -0
- package/src/modules/core/views/mixins/mixins.js +1 -2
- package/src/modules/core/views/router/addRoutes.js +6 -1
- package/src/modules/events/routes/events.routes.js +1 -1
- package/src/modules/inventory/components/pages/InventoryEdit.vue +3 -3
- package/src/modules/inventory/policies/inventory.policies.js +1 -1
- package/src/modules/inventory/routes/inventory.routes.js +1 -1
- package/src/modules/marketplace/marketplace.router.js +66 -0
- package/src/modules/marketplace/views/components/layouts/Marketplace.vue +363 -0
- package/src/modules/marketplace/views/components/pages/Catalog.vue +73 -0
- package/src/modules/music/controllers/stream.controller.js +1 -1
- package/src/modules/music/music.server.js +1 -1
- package/src/modules/music/policies/music.policies.js +3 -2
- package/src/modules/music/router/library.router.js +26 -0
- package/src/modules/music/router/music.router.js +176 -0
- package/src/modules/notifications/components/elements/NotificationBadge.vue +5 -6
- package/src/modules/notifications/notifications.server.js +1 -3
- package/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue +5 -0
- package/src/modules/orders/orders.server.js +0 -1
- package/src/modules/organizations/components/blocks/CardOrganization.vue +2 -2
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +2 -2
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +2 -2
- package/src/modules/organizations/policies/organizations.policies.js +12 -6
- package/src/modules/organizations/routes/organizations.routes.js +1 -3
- package/src/modules/products/components/blocks/CardCategory.vue +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +16 -2
- package/src/modules/products/components/pages/Categories.vue +9 -6
- package/src/modules/products/components/pages/CategoryEdit.vue +8 -4
- package/src/modules/products/components/pages/Product.vue +11 -5
- package/src/modules/products/components/sections/SectionProduct.vue +11 -7
- package/src/modules/products/controllers/categories.controller.js +32 -27
- package/src/modules/products/routes/categories.routes.js +1 -1
- package/src/modules/rents/controllers/routes/rents.routes.js +1 -1
- package/src/modules/rents/views/components/pages/RentsEdit.vue +208 -49
- package/src/modules/spots/components/pages/Map.vue +2 -2
- package/dist/abac-DYoheWuc.js +0 -1031
- package/dist/core.abac-DUPBnlk6.js +0 -298
- package/dist/core.logger-C3q8A9dl.js +0 -51
- package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
- package/dist/martyrs/src/components/Field/Field.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/components/Select/Select.vue2.js.map +0 -1
- package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/auth.router.js +0 -342
- package/dist/martyrs/src/modules/auth/auth.router.js.map +0 -1
- package/src/modules/auth/auth.router.js +0 -262
- package/src/modules/core/controllers/classes/abac/v2/abac-core-fixed.js +0 -313
- package/src/modules/core/controllers/classes/abac/v2/abac-express-fixed.js +0 -276
- package/src/modules/core/controllers/classes/abac/v2/abac-fields-fixed.js +0 -425
- package/src/modules/core/controllers/classes/abac/v2/abac-main-fixed.js +0 -295
- package/src/modules/core/controllers/classes/abac/v2/abac-policies-fixed.js +0 -316
- package/src/modules/core/controllers/classes/abac/v2/abac-ws-fixed.js +0 -237
- package/src/modules/core/controllers/classes/core.abac.js +0 -310
- package/src/modules/core/controllers/classes/core.crud.js +0 -89
- package/src/modules/governance/reactcode/eslint.config.js +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionProduct.vue.js","sources":["../../../../../../../src/modules/products/components/sections/SectionProduct.vue"],"sourcesContent":["<template>\n\t<div class=\"cols-2-1_2 pd-small w-100 gap-thin\">\n\t\t\n\t\t<div class=\"pd-small bg-light radius-medium flex-nowrap flex-column flex pos-relative\">\n\t\t\t<div class=\"w-100 bg-light radius-semi o-hidden\">\n\t\t\t\t<!-- PRODUCT IMAGE -->\n\t\t\t\t<Image360\n\t\t\t\t\tv-if=\"product && product.image3d\"\n\t\t\t\t\tclass=\"h-100 w-100\"\n\t\t\t\t\t:imagePath=\"`/assets/images/products/${product.image3d}`\"\n\t\t\t\t\t:imageCount=\"36\"\n\t\t\t\t/>\n\n\t\t\t\t<img loading=\"lazy\" \n\t\t\t\t\tv-if=\"images[0] && !product.image3d\"\n\t\t\t\t\tclass=\"h-max bg-light w-100\"\n\t\t\t\t\tstyle=\"object-fit: contain;\"\n\t\t\t\t\t:src=\"(FILE_SERVER_URL || '') + images[0]\"\n\t\t\t\t/>\n\n\t\t\t\t<PlaceholderImage\n\t\t\t\t\tv-if=\"!images[0] && !product.image3d\"\n\t\t\t\t\tclass=\"h-max-20r h-100 w-100\"\n\t\t\t\t\tstyle=\"object-fit: cover;\"\n\t\t\t\t/>\n\n\t\t\t</div>\n\n\t\t\t<ProductImages\n\t\t\t\tv-if=\"images.length > 1\"\n\t\t\t\t:images=\"images\"\n\t\t\t\tclass=\"mn-t-thin\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div class=\"radius-medium pos-relative w-100 h-100 flex-column flex-justify flex col\">\n\n\t\t\t<IconEdit\n\t\t\t\tv-if=\"accesses && hasAccess(route.params._id, 'products', 'edit', accesses)\"\n\t\t\t\t@click=\"$router.push(
|
|
1
|
+
{"version":3,"file":"SectionProduct.vue.js","sources":["../../../../../../../src/modules/products/components/sections/SectionProduct.vue"],"sourcesContent":["<template>\n\t<div class=\"cols-2-1_2 pd-small w-100 gap-thin\">\n\t\t\n\t\t<div class=\"pd-small bg-light radius-medium flex-nowrap flex-column flex pos-relative\">\n\t\t\t<div class=\"w-100 bg-light radius-semi o-hidden\">\n\t\t\t\t<!-- PRODUCT IMAGE -->\n\t\t\t\t<Image360\n\t\t\t\t\tv-if=\"product && product.image3d\"\n\t\t\t\t\tclass=\"h-100 w-100\"\n\t\t\t\t\t:imagePath=\"`/assets/images/products/${product.image3d}`\"\n\t\t\t\t\t:imageCount=\"36\"\n\t\t\t\t/>\n\n\t\t\t\t<img loading=\"lazy\" \n\t\t\t\t\tv-if=\"images[0] && !product.image3d\"\n\t\t\t\t\tclass=\"h-max bg-light w-100\"\n\t\t\t\t\tstyle=\"object-fit: contain;\"\n\t\t\t\t\t:src=\"(FILE_SERVER_URL || '') + images[0]\"\n\t\t\t\t/>\n\n\t\t\t\t<PlaceholderImage\n\t\t\t\t\tv-if=\"!images[0] && !product.image3d\"\n\t\t\t\t\tclass=\"h-max-20r h-100 w-100\"\n\t\t\t\t\tstyle=\"object-fit: cover;\"\n\t\t\t\t/>\n\n\t\t\t</div>\n\n\t\t\t<ProductImages\n\t\t\t\tv-if=\"images.length > 1\"\n\t\t\t\t:images=\"images\"\n\t\t\t\tclass=\"mn-t-thin\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div class=\"radius-medium pos-relative w-100 h-100 flex-column flex-justify flex col\">\n\n\t\t\t<IconEdit\n\t\t\t\tv-if=\"accesses && hasAccess(route.params._id, 'products', 'edit', accesses)\"\n\t\t\t\t@click=\"$router.push(editPath)\"\n\t\t\t\tclass=\"pos-absolute pos-t-regular pos-r-regular i-medium t-transp\"\n\t\t\t/>\n\n\t\t\t<h2 v-if=\"recommendation\" class=\"t-main t-semi p-medium\">{{t('airecommend')}}</h2>\n\t\t\t<!-- Name -->\n\t\t\t<h1 class=\"w-100 h1-product mn-b-small\">{{ product.name }}</h1>\n\t\t\t<!-- Price -->\n\t\t\t<Price v-if=\"product.listing !== 'rent'\" :product=\"product\" size=\"big\" class=\"mn-b-semi\" />\n\t\t\t<!-- Variants -->\n\t\t\t<!-- <div v-if=\"product.variants.length > 0\" class=\"flex-nojustify flex\">\n\t\t\t\t<SelectElement v-if=\"sizes2.length > 0\" :elements=\"sizes2\" :selected=\"product.selectedSize\" class=\"mn-r-medium\" />\n\t\t\t</div> -->\n\t\t\t<!-- Description -->\n\t\t\t<h3 v-if=\"recommendation\" class=\"mn-b-semi\">\n\t\t\t\t{{ recommendation }}\n\t\t\t</h3>\n\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabProduct\"\n\t\t\t\t:tabs=\"[\n\t\t\t\t\t{name: 'Description', value: 'description'},\n\t\t\t\t\t{name: 'Specifications', value: 'specifications'}\n\t\t\t\t]\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t\tclass=\"bg-light mn-b-small\"\n\t\t\t/>\n\n\t\t\t<div class=\"h-min-5r pos-relative\">\n\t\t\t\t<transition name=\"slide-fade\">\n\n\t\t\t\t\t<div v-if=\"tabProduct === 'description'\" class=\"pd-medium radius-medium bg-light \">\n\t\t\t\t\t\t<p v-if=\"product.description && !product.translations < 1 && !recommendation\" class=\"w-100 t-transp\">\n\t\t\t\t\t\t\t{{ product.description }}\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<p v-if=\"product.translations && product.translations.length > 1 && !recommendation\" class=\"w-100 t-transp\">\n\t\t\t\t\t\t\t{{ t('description') }}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div \n\t\t\t\t\t\tv-else\n\t\t\t\t\t\tclass=\"cols-2 w-100 bg-light radius-medium pd-medium gap-small\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div \n\t\t\t\t\t\t\tv-if=\"product.attributes.length > 0\" \n\t\t\t\t\t\t\tv-for=\"attributes in product.attributes\" \n\t\t\t\t\t\t\tclass=\"w-100 pd-small radius-small bg-white product-attributes\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p class=\"t-demi\">{{ attributes.name }}</p>\n\t\t\t\t\t\t\t<p>{{ attributes.value }}</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</transition>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"product.listing === 'rent'\" class=\"mn-t-small max-w-33rem mobile-w-100 t-white gap-small cols-2\">\n\t\t\t\t<Button\n\t\t\t\t\t:submit=\"() => { addToCart(product) } \" \n\t\t\t\t\t:text=\"{\n\t\t\t\t\t\tsuccess: ' ✔ Added',\n\t\t\t\t\t\terror: 'error'\n\t\t\t\t\t}\"\n\t\t\t\t\tclass=\"h-3r w-100 mn-r-small bg-main button\"\n\t\t\t\t> \n\t\t\t\t\t{{ t('addtoorder') }}\n\t\t\t\t</Button>\n\t\t\t</div>\n\n\t\t\t<!-- Actions -->\n\t\t\t<div v-else class=\"mn-t-small max-w-33rem mobile-w-100 t-white gap-small cols-2\">\n\t\t\t\t<Button\n\t\t\t\t\tv-if=\"product.quantity > 0\"\n\t\t\t\t\t:submit=\"a => addToCart(product)\" \n\t\t\t\t\t:disabled=\"validateToCard(product)\" \n\t\t\t\t\t:text=\"{\n\t\t\t\t\t\tsuccess: ' ✔ Added',\n\t\t\t\t\t\terror: 'error'\n\t\t\t\t\t}\"\n\t\t\t\t\tclass=\"h-3r w-100 mn-r-small bg-main button\"\n\t\t\t\t> \n\t\t\t\t\t\t{{ t('addtoorder') }}\n\t\t\t\t</Button>\n\t\t\t\t<div v-else class=\"flex-center flex uppercase radius-medium t-black w-max pd-small t-medium bg-grey h-3r w-100 mn-r-smallbutton\">\n\t\t\t\t\tOut of Stock\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup>\nimport Button from '@martyrs/src/components/Button/Button.vue'\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\nimport PlaceholderImage from '@martyrs/src/modules/icons/placeholders/PlaceholderImage.vue'\n\nimport Image360 \tfrom '@martyrs/src/modules/products/components/elements/Image360.vue'\nimport ProductImages from \"@martyrs/src/modules/products/components/blocks/ProductImages.vue\";\n\nimport THC from '@martyrs/src/modules/products/components/elements/THC.vue'\nimport Price from '@martyrs/src/modules/products/components/elements/Price.vue'\n// import SelectElement \tfrom '@/components/elements/SelectElement.vue'\n\nimport { computed, ref } from 'vue'\n\n\timport { useRoute,useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n\nimport * as shopcart from '@martyrs/src/modules/orders/store/shopcart.js';\n\n// Props\nconst props = defineProps({\n product: {\n type: Object,\n required: true\n },\n user: {\n type: String,\n },\n accesses: {\n type: Object,\n\t default: null\n },\n recommendation: {\n \ttype: String\n }\n})\n\n\n\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n// Computed properties\nconst images = computed(() => {\n return props.product.images\n})\n\nconst editPath = computed(() => {\n\tif (route.meta.context === 'backoffice') {\n\t\treturn `/backoffice/products/${props.product._id}/edit`\n\t}\n\tif (route.meta.context === 'organization') {\n\t\treturn `/organizations/${props.product.owner.target}/products/${props.product._id}/edit`\n\t}\n\treturn `/products/${props.product._id}/edit`\n})\n\nconst tabProduct = ref('description')\n\nconst text = {\n\tmessages: {\n\t en: {\n\t \tairecommend: 'AI Recommends You',\n\t \tdescription: '',\n\t \taddtoorder: 'Add to order',\n\t fastorder: 'Fast Order'\n\t },\n\t ru: {\n\t \tairecommend: 'AI Рекомендует вам',\n\t \tdescription: '',\n\t \taddtoorder: 'Добавить в корзину',\n\t fastorder: 'Быстрый заказ'\n\t }\n\t}\n}\n\nconst { t } = useI18n(text)\n\n// Methods\nfunction validateToCard(product) {\n if (product.quantity > 0) {\n return false\n }\n return true\n}\nasync function addToCart(product) {\n\tconsole.log(product)\n try {\n if (shopcart.state.organization !== product.owner.target) {\n shopcart.state.organization = product.owner.target\n shopcart.state.positions = []\n }\n await shopcart.actions.addProductToCart(product, product.owner.target)\n return true // Make sure we return something\n } catch (error) {\n console.error('Ошибка при добавлении товара в корзину:', error)\n throw error\n }\n}\n</script>\n"],"names":["shopcart.state","shopcart.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwJA,UAAM,QAAQ;AAmBb,UAAM,QAAQ,SAAQ;AACP,cAAS;AAGzB,UAAM,SAAS,SAAS,MAAM;AAC5B,aAAO,MAAM,QAAQ;AAAA,IACvB,CAAC;AAED,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{ computed, ref, watch, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
|
|
2
2
|
import dayjs from "../../../../../../../../_virtual/dayjs.min.js";
|
|
3
3
|
import _sfc_main$2 from "../../../../../../components/Tab/Tab.vue2.js";
|
|
4
|
-
import _sfc_main$3 from "../../../../../../components/Button/Button.
|
|
4
|
+
import _sfc_main$3 from "../../../../../../components/Button/Button.vue2.js";
|
|
5
5
|
import _sfc_main$4 from "../../../../../../components/Dropdown/Dropdown.vue.js";
|
|
6
6
|
import Calendar from "../../../../../../components/Calendar/Calendar.vue2.js";
|
|
7
7
|
import _sfc_main$1 from "./DateLabel.vue.js";
|
|
@@ -1,27 +1,45 @@
|
|
|
1
|
-
import { ref, computed, onMounted, createElementBlock, openBlock, createElementVNode, createVNode, toDisplayString, unref, withCtx, Fragment, renderList, createBlock, createCommentVNode } from "vue";
|
|
1
|
+
import { ref, computed, onMounted, createElementBlock, openBlock, createElementVNode, createVNode, toDisplayString, unref, withCtx, Fragment, renderList, createBlock, createCommentVNode, createTextVNode } from "vue";
|
|
2
2
|
import _sfc_main$4 from "../../../../../components/Block/Block.vue.js";
|
|
3
|
-
import
|
|
3
|
+
import _sfc_main$5 from "../../../../../components/Button/Button.vue2.js";
|
|
4
|
+
import Field from "../../../../../components/Field/Field.vue.js";
|
|
4
5
|
import _sfc_main$2 from "../../../../../components/Feed/Feed.vue.js";
|
|
5
6
|
import _sfc_main$1 from "../../../../../components/Popup/Popup.vue.js";
|
|
7
|
+
import { useGlobalMixins } from "../../../../core/views/mixins/mixins.js";
|
|
6
8
|
import _sfc_main$3 from "../../../../orders/components/blocks/CardOrderItem.vue.js";
|
|
7
9
|
import { useRoute, useRouter } from "vue-router";
|
|
8
10
|
import { state as state$2 } from "../../../../auth/views/store/auth.js";
|
|
9
11
|
import { state as state$1, actions, mutations } from "../../store/rents.store.js";
|
|
10
12
|
import { state, actions as actions$1 } from "../../../../products/store/products.js";
|
|
13
|
+
import variantsStore from "../../../../products/store/variants.store.js";
|
|
11
14
|
/* empty css */
|
|
12
15
|
const _hoisted_1 = { class: "pd-thin" };
|
|
13
16
|
const _hoisted_2 = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" };
|
|
14
|
-
const _hoisted_3 = { class: "
|
|
15
|
-
const _hoisted_4 =
|
|
16
|
-
const _hoisted_5 = {
|
|
17
|
-
|
|
17
|
+
const _hoisted_3 = { class: "gap-thin flex flex-column" };
|
|
18
|
+
const _hoisted_4 = ["onClick"];
|
|
19
|
+
const _hoisted_5 = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "aspect-1x1 h-3r radius-small o-hidden"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_6 = ["src"];
|
|
24
|
+
const _hoisted_7 = { class: "t-medium" };
|
|
25
|
+
const _hoisted_8 = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "t-small t-transp"
|
|
28
|
+
};
|
|
29
|
+
const _hoisted_9 = { class: "mn-l-auto" };
|
|
30
|
+
const _hoisted_10 = { class: "flex gap-small" };
|
|
31
|
+
const _hoisted_11 = { class: "gap-thin flex-v-center flex-nojustify flex" };
|
|
32
|
+
const _hoisted_12 = { class: "mn-r-auto" };
|
|
18
33
|
const _sfc_main = {
|
|
19
34
|
__name: "RentsEdit",
|
|
20
35
|
setup(__props) {
|
|
21
36
|
const route = useRoute();
|
|
22
37
|
const router = useRouter();
|
|
38
|
+
const { formatPrice } = useGlobalMixins();
|
|
23
39
|
const Products = ref(state.all);
|
|
24
40
|
const isOpenProductsPopup = ref(false);
|
|
41
|
+
const isVariantsPopupOpen = ref(false);
|
|
42
|
+
const selectedProduct = ref({});
|
|
25
43
|
const totalDays = computed(() => {
|
|
26
44
|
const start = new Date(state$1.current.startDate);
|
|
27
45
|
const end = new Date(state$1.current.endDate);
|
|
@@ -35,9 +53,40 @@ const _sfc_main = {
|
|
|
35
53
|
function closeProductsPopup() {
|
|
36
54
|
isOpenProductsPopup.value = false;
|
|
37
55
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
56
|
+
function closeVariantsPopup() {
|
|
57
|
+
isVariantsPopupOpen.value = false;
|
|
58
|
+
selectedProduct.value = {};
|
|
59
|
+
}
|
|
60
|
+
function selectProduct(product) {
|
|
61
|
+
selectedProduct.value = product;
|
|
40
62
|
closeProductsPopup();
|
|
63
|
+
if (product.variants && product.variants.length === 1) {
|
|
64
|
+
addVariantToRent(product.variants[0]);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
isVariantsPopupOpen.value = true;
|
|
68
|
+
}
|
|
69
|
+
function formatProductName(product, variant) {
|
|
70
|
+
if (!variant || product.variants?.length === 1 && !variant.attributes?.length)
|
|
71
|
+
return product.name;
|
|
72
|
+
const attrs = variant.attributes?.map((a) => a.value).filter(Boolean);
|
|
73
|
+
if (attrs?.length) {
|
|
74
|
+
return `${product.name} / ${attrs.join(" / ")}`;
|
|
75
|
+
}
|
|
76
|
+
return variant.name || product.name;
|
|
77
|
+
}
|
|
78
|
+
function addVariantToRent(variant) {
|
|
79
|
+
state$1.current.product = {
|
|
80
|
+
_id: selectedProduct.value._id,
|
|
81
|
+
variant: variant._id,
|
|
82
|
+
name: formatProductName(selectedProduct.value, variant),
|
|
83
|
+
images: variant.images || selectedProduct.value.images || [],
|
|
84
|
+
price: variant.price || variant.cost || 0,
|
|
85
|
+
unit: variant.unit || "pcs",
|
|
86
|
+
quantity: 1,
|
|
87
|
+
listing: "rent"
|
|
88
|
+
};
|
|
89
|
+
closeVariantsPopup();
|
|
41
90
|
}
|
|
42
91
|
onMounted(async () => {
|
|
43
92
|
try {
|
|
@@ -46,7 +95,7 @@ const _sfc_main = {
|
|
|
46
95
|
} else {
|
|
47
96
|
mutations.clean();
|
|
48
97
|
}
|
|
49
|
-
await actions$1.read({
|
|
98
|
+
await actions$1.read({ owner: route.params._id, listing: "rent", limit: 100 });
|
|
50
99
|
Products.value = state.all;
|
|
51
100
|
} catch (error) {
|
|
52
101
|
console.error("Ошибка при загрузке данных:", error);
|
|
@@ -55,21 +104,30 @@ const _sfc_main = {
|
|
|
55
104
|
async function onSubmit() {
|
|
56
105
|
try {
|
|
57
106
|
if (route.params.rent) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
107
|
+
const rentData = {
|
|
108
|
+
_id: state$1.current._id,
|
|
109
|
+
product: state$1.current.product._id,
|
|
110
|
+
variant: state$1.current.product.variant,
|
|
111
|
+
startDate: new Date(state$1.current.startDate),
|
|
112
|
+
endDate: new Date(state$1.current.endDate),
|
|
113
|
+
comment: state$1.current.comment,
|
|
114
|
+
status: state$1.current.status
|
|
115
|
+
};
|
|
116
|
+
await actions.update(rentData);
|
|
63
117
|
} else {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
118
|
+
const rentData = {
|
|
119
|
+
product: state$1.current.product._id,
|
|
120
|
+
variant: state$1.current.product.variant,
|
|
121
|
+
startDate: new Date(state$1.current.startDate),
|
|
122
|
+
endDate: new Date(state$1.current.endDate),
|
|
123
|
+
comment: state$1.current.comment || "",
|
|
124
|
+
status: state$1.current.status || "active",
|
|
125
|
+
creator: { type: "user", target: state$2.user._id },
|
|
126
|
+
owner: { type: "organization", target: route.params._id }
|
|
127
|
+
};
|
|
128
|
+
await actions.create(rentData);
|
|
72
129
|
}
|
|
130
|
+
router.push({ name: "Rents", params: { _id: route.params._id } });
|
|
73
131
|
} catch (error) {
|
|
74
132
|
console.error("Ошибка при отправке данных:", error);
|
|
75
133
|
}
|
|
@@ -102,30 +160,104 @@ const _sfc_main = {
|
|
|
102
160
|
title: "Add Product to Rent",
|
|
103
161
|
onClosePopup: closeProductsPopup,
|
|
104
162
|
isPopupOpen: isOpenProductsPopup.value,
|
|
105
|
-
class: "bg-white w-
|
|
163
|
+
class: "bg-white w-100 w-max-30r radius-medium pd-medium"
|
|
106
164
|
}, {
|
|
107
165
|
default: withCtx(() => [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
166
|
+
createVNode(_sfc_main$2, {
|
|
167
|
+
search: {
|
|
168
|
+
class: "bg-light radius-small"
|
|
169
|
+
},
|
|
170
|
+
states: {
|
|
171
|
+
empty: {
|
|
172
|
+
title: "No Products Found",
|
|
173
|
+
description: "No products available for rent."
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
store: {
|
|
177
|
+
read: (options) => actions$1.read(options),
|
|
178
|
+
state: null
|
|
179
|
+
},
|
|
180
|
+
options: {
|
|
181
|
+
owner: unref(route).params._id,
|
|
182
|
+
listing: "rent"
|
|
183
|
+
},
|
|
184
|
+
class: "flex-column flex gap-thin h-max-20r o-scroll"
|
|
185
|
+
}, {
|
|
186
|
+
default: withCtx(({ items }) => [
|
|
187
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(items, (product, index) => {
|
|
188
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
189
|
+
key: `${product._id}_${product.variant || "no-variant"}_${index}`,
|
|
190
|
+
editable: false,
|
|
191
|
+
productId: product._id,
|
|
192
|
+
variantId: product.variant,
|
|
193
|
+
images: product.images,
|
|
194
|
+
name: product.name,
|
|
195
|
+
quantity: product.quantity || 1,
|
|
196
|
+
unit: product.unit,
|
|
197
|
+
dates: product.date,
|
|
198
|
+
listing: product.listing,
|
|
199
|
+
price: product.price,
|
|
200
|
+
onClick: () => selectProduct(product),
|
|
201
|
+
class: "bg-light pd-small radius-small w-100"
|
|
202
|
+
}, null, 8, ["productId", "variantId", "images", "name", "quantity", "unit", "dates", "listing", "price", "onClick"]);
|
|
203
|
+
}), 128))
|
|
204
|
+
]),
|
|
205
|
+
_: 1
|
|
206
|
+
}, 8, ["store", "options"])
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
}, 8, ["isPopupOpen"]),
|
|
210
|
+
createVNode(_sfc_main$1, {
|
|
211
|
+
title: "Select variant",
|
|
212
|
+
onClosePopup: closeVariantsPopup,
|
|
213
|
+
isPopupOpen: isVariantsPopupOpen.value,
|
|
214
|
+
class: "bg-white w-100 w-max-30r radius-medium pd-medium"
|
|
215
|
+
}, {
|
|
216
|
+
default: withCtx(() => [
|
|
217
|
+
createVNode(_sfc_main$2, {
|
|
218
|
+
store: unref(variantsStore),
|
|
219
|
+
options: {
|
|
220
|
+
product: selectedProduct.value._id
|
|
221
|
+
},
|
|
222
|
+
skeleton: {
|
|
223
|
+
structure: [
|
|
224
|
+
{ block: "text", size: "small" },
|
|
225
|
+
{ block: "text", size: "medium" },
|
|
226
|
+
{ block: "text", size: "small" }
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
states: {
|
|
230
|
+
empty: {
|
|
231
|
+
title: "No variants",
|
|
232
|
+
description: "Create your first variant"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
default: withCtx(({ items }) => [
|
|
237
|
+
createElementVNode("div", _hoisted_3, [
|
|
238
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(items, (variant, index) => {
|
|
239
|
+
return openBlock(), createElementBlock("div", {
|
|
240
|
+
key: index,
|
|
241
|
+
onClick: ($event) => addVariantToRent(variant),
|
|
242
|
+
class: "w-100 cursor-pointer hover-scale-1 bg-light pd-small radius-small flex-v-center flex-nowrap flex gap-thin"
|
|
243
|
+
}, [
|
|
244
|
+
variant.images && variant.images.length ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
245
|
+
createElementVNode("img", {
|
|
246
|
+
src: (_ctx.FILE_SERVER_URL || "") + variant.images[0],
|
|
247
|
+
class: "w-100 h-100 object-fit-cover"
|
|
248
|
+
}, null, 8, _hoisted_6)
|
|
249
|
+
])) : createCommentVNode("", true),
|
|
250
|
+
createElementVNode("div", null, [
|
|
251
|
+
createElementVNode("p", _hoisted_7, toDisplayString(variant.name || "Default variant"), 1),
|
|
252
|
+
variant.attributes && variant.attributes.length ? (openBlock(), createElementBlock("p", _hoisted_8, toDisplayString(variant.attributes.map((attr) => `${attr.name}: ${attr.value}`).join(", ")), 1)) : createCommentVNode("", true)
|
|
253
|
+
]),
|
|
254
|
+
createElementVNode("p", _hoisted_9, toDisplayString(unref(formatPrice)(variant.price || variant.cost)), 1)
|
|
255
|
+
], 8, _hoisted_4);
|
|
124
256
|
}), 128))
|
|
125
|
-
])
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
])
|
|
257
|
+
])
|
|
258
|
+
]),
|
|
259
|
+
_: 1
|
|
260
|
+
}, 8, ["store", "options"])
|
|
129
261
|
]),
|
|
130
262
|
_: 1
|
|
131
263
|
}, 8, ["isPopupOpen"]),
|
|
@@ -134,7 +266,7 @@ const _sfc_main = {
|
|
|
134
266
|
class: "mn-b-semi"
|
|
135
267
|
}, {
|
|
136
268
|
default: withCtx(() => [
|
|
137
|
-
createElementVNode("div",
|
|
269
|
+
createElementVNode("div", _hoisted_10, [
|
|
138
270
|
createVNode(Field, {
|
|
139
271
|
field: state$1.current.startDate,
|
|
140
272
|
"onUpdate:field": _cache[0] || (_cache[0] = ($event) => state$1.current.startDate = $event),
|
|
@@ -154,8 +286,8 @@ const _sfc_main = {
|
|
|
154
286
|
_: 1
|
|
155
287
|
}),
|
|
156
288
|
createVNode(_sfc_main$4, {
|
|
157
|
-
title: "Rented
|
|
158
|
-
actions: [{ label: "+", function: openProductsPopup }],
|
|
289
|
+
title: "Rented Product",
|
|
290
|
+
actions: state$1.current.product ? [] : [{ label: "+", function: openProductsPopup }],
|
|
159
291
|
placeholder: "No products added yet",
|
|
160
292
|
class: "mn-b-semi"
|
|
161
293
|
}, {
|
|
@@ -168,7 +300,10 @@ const _sfc_main = {
|
|
|
168
300
|
name: state$1.current.product.name,
|
|
169
301
|
quantity: state$1.current.product.quantity || 1,
|
|
170
302
|
unit: state$1.current.product.unit,
|
|
171
|
-
dates:
|
|
303
|
+
dates: {
|
|
304
|
+
start: state$1.current.startDate,
|
|
305
|
+
end: state$1.current.endDate
|
|
306
|
+
},
|
|
172
307
|
listing: state$1.current.product.listing,
|
|
173
308
|
price: state$1.current.product.price,
|
|
174
309
|
editable: false,
|
|
@@ -195,21 +330,36 @@ const _sfc_main = {
|
|
|
195
330
|
}),
|
|
196
331
|
createVNode(_sfc_main$4, null, {
|
|
197
332
|
default: withCtx(() => [
|
|
198
|
-
createElementVNode("section",
|
|
199
|
-
createElementVNode("h3",
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
class: "bg-main
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
333
|
+
createElementVNode("section", _hoisted_11, [
|
|
334
|
+
createElementVNode("h3", _hoisted_12, "Total Days: " + toDisplayString(totalDays.value), 1),
|
|
335
|
+
createVNode(_sfc_main$5, {
|
|
336
|
+
submit: onSubmit,
|
|
337
|
+
class: "pd-small radius-medium bg-main t-black uppercase t-medium"
|
|
338
|
+
}, {
|
|
339
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
340
|
+
createTextVNode(" Save ")
|
|
341
|
+
])),
|
|
342
|
+
_: 1
|
|
343
|
+
}),
|
|
344
|
+
createVNode(_sfc_main$5, {
|
|
345
|
+
submit: onReset,
|
|
346
|
+
class: "pd-small radius-medium t-white bg-second uppercase t-medium"
|
|
347
|
+
}, {
|
|
348
|
+
default: withCtx(() => _cache[5] || (_cache[5] = [
|
|
349
|
+
createTextVNode(" Reset ")
|
|
350
|
+
])),
|
|
351
|
+
_: 1
|
|
352
|
+
}),
|
|
353
|
+
unref(route).params._id ? (openBlock(), createBlock(_sfc_main$5, {
|
|
209
354
|
key: 0,
|
|
210
|
-
|
|
211
|
-
class: "t-white bg-red
|
|
212
|
-
},
|
|
355
|
+
submit: onDelete,
|
|
356
|
+
class: "pd-small radius-medium t-white bg-red uppercase t-medium"
|
|
357
|
+
}, {
|
|
358
|
+
default: withCtx(() => _cache[6] || (_cache[6] = [
|
|
359
|
+
createTextVNode(" Delete ")
|
|
360
|
+
])),
|
|
361
|
+
_: 1
|
|
362
|
+
})) : createCommentVNode("", true)
|
|
213
363
|
])
|
|
214
364
|
]),
|
|
215
365
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RentsEdit.vue.js","sources":["../../../../../../../../src/modules/rents/views/components/pages/RentsEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin\">\n <header class=\"mn-b-medium gap-small flex-v-center flex-nowrap flex\">\n <h2>{{ route.params._id ? 'Edit' : 'Add' }} Rent</h2>\n </header>\n\n <Popup \n title=\"Add Product to Rent\" \n @close-popup=\"closeProductsPopup\" \n :isPopupOpen=\"isOpenProductsPopup\"\n class=\"bg-white w-min-30r w-max-30r radius-big pd-medium\"\n >\n <div class=\"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big\">\n <Feed\n :search=\"true\"\n :states=\"{ empty: { title: 'No Products Found', description: 'No products available for rent.' } }\"\n :store=\"{ read: (options) => products.actions.read(options) }\"\n :options=\"{ organization: route.params._id, listing: 'rent' }\"\n v-slot=\"{ items }\"\n >\n <CardOrderItem\n v-for=\"product in items\" \n :key=\"product._id\"\n :editable=\"false\" \n :product=\"product\" \n @click=\"addProduct(product)\"\n class=\"bg-white pd-thin radius-medium w-100 mn-b-thin\"\n />\n </Feed>\n </div>\n </Popup>\n\n <Block title=\"Rent Period\" class=\"mn-b-semi\">\n <div class=\"flex gap-small\">\n <Field v-model:field=\"rents.state.current.startDate\" label=\"Start Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n <Field v-model:field=\"rents.state.current.endDate\" label=\"End Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n </div>\n </Block>\n\n <Block\n title=\"Rented Products\"\n :actions=\"[{ label: '+', function: openProductsPopup }]\"\n placeholder=\"No products added yet\"\n class=\"mn-b-semi\"\n >\n <CardOrderItem\n v-if=\"rents.state.current.product\"\n :key=\"rents.state.current.product._id\" \n :productId=\"rents.state.current.product._id\"\n :variantId=\"rents.state.current.product.variant\"\n :images=\"rents.state.current.product.images\"\n :name=\"rents.state.current.product.name\"\n :quantity=\"rents.state.current.product.quantity || 1\"\n :unit=\"rents.state.current.product.unit\"\n :dates=\"rents.state.current.product.date\"\n :listing=\"rents.state.current.product.listing\"\n :price=\"rents.state.current.product.price\"\n :editable=\"false\" \n @click=\"() => rents.state.current.product = null\"\n class=\"mn-b-small radius-medium bg-white pd-small\"\n />\n </Block>\n\n <Block title=\"Comment\" class=\"mn-b-semi\">\n <Field v-model:field=\"rents.state.current.comment\" label=\"Comment\" type=\"textarea\" class=\"w-100 bg-white radius-small pd-medium\" /> \n </Block>\n\n <Block>\n <section class=\"gap-thin flex-v-center flex-nojustify flex\">\n <h3 class=\"mn-r-auto\">Total Days: {{ totalDays }}</h3>\n <a @click=\"onSubmit\" class=\"bg-main button\">Save</a> \n <a @click=\"onReset\" class=\"t-white bg-second button\">Reset</a>\n <a v-if=\"route.params._id\" @click=\"onDelete\" class=\"t-white bg-red button\">Delete</a>\n </section>\n </Block>\n </div>\n</template>\n\n<script setup>\nimport Block from '@martyrs/src/components/Block/Block.vue';\nimport Field from '@martyrs/src/components/Field/Field.vue';\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport Popup from '@martyrs/src/components/Popup/Popup.vue';\nimport CardPosition from '@martyrs/src/modules/products/components/blocks/CardPosition.vue';\nimport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue';\n\nimport { computed, onMounted, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport * as rents from '@martyrs/src/modules/rents/views/store/rents.store';\nimport * as products from '@martyrs/src/modules/products/store/products.js';\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst Products = ref(products.state.all);\nconst isOpenProductsPopup = ref(false);\n\nconst totalDays = computed(() => {\n const start = new Date(rents.state.current.startDate);\n const end = new Date(rents.state.current.endDate);\n if (!start || !end) return 0;\n const diffTime = Math.abs(end - start);\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n});\n\nfunction openProductsPopup() { isOpenProductsPopup.value = true; }\nfunction closeProductsPopup() { isOpenProductsPopup.value = false; }\n\nfunction addProduct(product) {\n rents.state.current.product = product\n closeProductsPopup();\n}\n\nfunction updateItem(index, updatedItem) {\n rents.state.current.items[index] = { product: updatedItem.product._id || updatedItem.product, quantity: updatedItem.quantity || 1 };\n}\n\nfunction deleteItem(index) {\n try {\n rents.state.current.items.splice(index, 1);\n } catch (error) {\n console.error('Ошибка при удалении элемента:', error);\n }\n}\n\nonMounted(async () => {\n try {\n if (route.params.rent) {\n await rents.actions.read({ _id: route.params.rent });\n } else {\n rents.mutations.clean();\n }\n\n await products.actions.read({ organization: route.params._id, listing: 'rent', limit: 100 });\n Products.value = products.state.all;\n } catch (error) {\n console.error('Ошибка при загрузке данных:', error);\n }\n});\n\nasync function onSubmit() {\n try {\n if (route.params.rent) {\n let newProduct = rents.state.current\n newProduct.product = rents.state.current.product._id\n newProduct.startDate = new Date(rents.state.current.startDate);\n newProduct.endDate = new Date(rents.state.current.endDate);\n await rents.actions.update(newProduct);\n } else {\n rents.state.current.creator = { type: 'user', target: auth.state.user._id };\n rents.state.current.owner = { type: 'organization', target: route.params._id };\n rents.state.current.owner = { type: 'organization', target: route.params._id };\n let newProduct = rents.state.current\n newProduct.product = rents.state.current.product._id\n newProduct.startDate = new Date(rents.state.current.startDate);\n newProduct.endDate = new Date(rents.state.current.endDate);\n await rents.actions.create(newProduct);\n }\n // router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при отправке данных:', error);\n }\n}\n\nasync function onReset() {\n try {\n if (route.params._id) {\n await rents.actions.read({ _id: route.params._id });\n } else {\n rents.mutations.clean();\n }\n } catch (error) {\n console.error('Ошибка при сбросе данных:', error);\n }\n}\n\nasync function onDelete() {\n try {\n await rents.actions.delete(route.params._id);\n router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при удалении:', error);\n }\n}\n\n</script>\n\n<style lang=\"scss\">\n.round-stat {\n padding: 1rem;\n border-radius: 5rem;\n width: 3rem;\n height: 3rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(0,0,0,0.1);\n}\n</style>"],"names":["products.state","rents.state","rents.actions","rents.mutations","products.actions","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4FA,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,WAAW,IAAIA,MAAe,GAAG;AACvC,UAAM,sBAAsB,IAAI,KAAK;AAErC,UAAM,YAAY,SAAS,MAAM;AAC/B,YAAM,QAAQ,IAAI,KAAKC,QAAY,QAAQ,SAAS;AACpD,YAAM,MAAM,IAAI,KAAKA,QAAY,QAAQ,OAAO;AAChD,UAAI,CAAC,SAAS,CAAC,IAAK,QAAO;AAC3B,YAAM,WAAW,KAAK,IAAI,MAAM,KAAK;AACrC,aAAO,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAAG;AAAA,IACnD,CAAC;AAED,aAAS,oBAAoB;AAAE,0BAAoB,QAAQ;AAAA,IAAM;AACjE,aAAS,qBAAqB;AAAE,0BAAoB,QAAQ;AAAA,IAAO;AAEnE,aAAS,WAAW,SAAS;AAC3BA,cAAY,QAAQ,UAAU;AAC9B,yBAAkB;AAAA,IACpB;AAcA,cAAU,YAAY;AACpB,UAAI;AACF,YAAI,MAAM,OAAO,MAAM;AACrB,gBAAMC,QAAc,KAAK,EAAE,KAAK,MAAM,OAAO,MAAM;AAAA,QACrD,OAAO;AACLC,oBAAgB,MAAK;AAAA,QACvB;AAEA,cAAMC,UAAiB,KAAK,EAAE,cAA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AW;AACxB,UAAI;AACF,cAAMD,QAAc,OAAO,MAAM,OAAO,GAAG;AAC3C,eAAO,KAAK,EAAE,MAAM,SAAS,QAAQ,EAAE,KAAK,MAAM,OAAO,IAAG,EAAE,CAAE;AAAA,MAClE,SAAS,OAAO;AACd,gBAAQ,MAAM,wBAAwB,KAAK;AAAA,MAC7C;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"RentsEdit.vue.js","sources":["../../../../../../../../src/modules/rents/views/components/pages/RentsEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin\">\n <header class=\"mn-b-medium gap-small flex-v-center flex-nowrap flex\">\n <h2>{{ route.params._id ? 'Edit' : 'Add' }} Rent</h2>\n </header>\n\n <Popup\n title=\"Add Product to Rent\"\n @close-popup=\"closeProductsPopup\"\n :isPopupOpen=\"isOpenProductsPopup\"\n class=\"bg-white w-100 w-max-30r radius-medium pd-medium\"\n >\n <Feed\n :search=\"{\n class: 'bg-light radius-small'\n }\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'No products available for rent.'\n }\n }\"\n :store=\"{\n read: (options) => products.actions.read(options),\n state: null\n }\"\n :options=\"{\n owner: route.params._id,\n listing: 'rent'\n }\"\n v-slot=\"{ items }\"\n class=\"flex-column flex gap-thin h-max-20r o-scroll\"\n >\n <CardOrderItem\n v-for=\"(product, index) in items\"\n :key=\"`${product._id}_${product.variant || 'no-variant'}_${index}`\"\n :editable=\"false\"\n :productId=\"product._id\"\n :variantId=\"product.variant\"\n :images=\"product.images\"\n :name=\"product.name\"\n :quantity=\"product.quantity || 1\"\n :unit=\"product.unit\"\n :dates=\"product.date\"\n :listing=\"product.listing\"\n :price=\"product.price\"\n @click=\"() => selectProduct(product)\"\n class=\"bg-light pd-small radius-small w-100\"\n />\n </Feed>\n </Popup>\n\n <!-- Popup for selecting variant of the product -->\n <Popup\n title=\"Select variant\"\n @close-popup=\"closeVariantsPopup\"\n :isPopupOpen=\"isVariantsPopupOpen\"\n class=\"bg-white w-100 w-max-30r radius-medium pd-medium\"\n >\n <Feed\n :store=\"variants\"\n :options=\"{\n product: selectedProduct._id,\n }\"\n :skeleton=\"{\n structure: [\n { block: 'text', size: 'small' },\n { block: 'text', size: 'medium' },\n { block: 'text', size: 'small' }\n ]\n }\"\n :states=\"{\n empty: {\n title: 'No variants',\n description: 'Create your first variant'\n }\n }\"\n v-slot=\"{ items }\"\n >\n <div class=\"gap-thin flex flex-column\">\n <div\n v-for=\"(variant, index) in items\"\n :key=\"index\"\n @click=\"addVariantToRent(variant)\"\n class=\"w-100 cursor-pointer hover-scale-1 bg-light pd-small radius-small flex-v-center flex-nowrap flex gap-thin\"\n >\n <div v-if=\"variant.images && variant.images.length\" class=\"aspect-1x1 h-3r radius-small o-hidden\">\n <img\n :src=\"(FILE_SERVER_URL || '') + variant.images[0]\"\n class=\"w-100 h-100 object-fit-cover\"\n />\n </div>\n <div>\n <p class=\"t-medium\">{{ variant.name || 'Default variant' }}</p>\n <p v-if=\"variant.attributes && variant.attributes.length\" class=\"t-small t-transp\">\n {{ variant.attributes.map(attr => `${attr.name}: ${attr.value}`).join(', ') }}\n </p>\n </div>\n <p class=\"mn-l-auto\">{{ formatPrice(variant.price || variant.cost) }}</p>\n </div>\n </div>\n </Feed>\n </Popup>\n\n <Block title=\"Rent Period\" class=\"mn-b-semi\">\n <div class=\"flex gap-small\">\n <Field v-model:field=\"rents.state.current.startDate\" label=\"Start Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n <Field v-model:field=\"rents.state.current.endDate\" label=\"End Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n </div>\n </Block>\n\n <Block\n title=\"Rented Product\"\n :actions=\"rents.state.current.product ? [] : [{ label: '+', function: openProductsPopup }]\"\n placeholder=\"No products added yet\"\n class=\"mn-b-semi\"\n >\n <CardOrderItem\n v-if=\"rents.state.current.product\"\n :key=\"rents.state.current.product._id\"\n :productId=\"rents.state.current.product._id\"\n :variantId=\"rents.state.current.product.variant\"\n :images=\"rents.state.current.product.images\"\n :name=\"rents.state.current.product.name\"\n :quantity=\"rents.state.current.product.quantity || 1\"\n :unit=\"rents.state.current.product.unit\"\n :dates=\"{\n start: rents.state.current.startDate,\n end: rents.state.current.endDate\n }\"\n :listing=\"rents.state.current.product.listing\"\n :price=\"rents.state.current.product.price\"\n :editable=\"false\"\n @click=\"() => rents.state.current.product = null\"\n class=\"mn-b-small radius-medium bg-white pd-small\"\n />\n </Block>\n\n <Block title=\"Comment\" class=\"mn-b-semi\">\n <Field v-model:field=\"rents.state.current.comment\" label=\"Comment\" type=\"textarea\" class=\"w-100 bg-white radius-small pd-medium\" /> \n </Block>\n\n <Block>\n <section class=\"gap-thin flex-v-center flex-nojustify flex\">\n <h3 class=\"mn-r-auto\">Total Days: {{ totalDays }}</h3>\n\n <Button\n :submit=\"onSubmit\"\n class=\"pd-small radius-medium bg-main t-black uppercase t-medium\"\n >\n Save\n </Button>\n\n <Button\n :submit=\"onReset\"\n class=\"pd-small radius-medium t-white bg-second uppercase t-medium\"\n >\n Reset\n </Button>\n\n <Button\n v-if=\"route.params._id\"\n :submit=\"onDelete\"\n class=\"pd-small radius-medium t-white bg-red uppercase t-medium\"\n >\n Delete\n </Button>\n </section>\n </Block>\n </div>\n</template>\n\n<script setup>\nimport Block from '@martyrs/src/components/Block/Block.vue';\nimport Button from '@martyrs/src/components/Button/Button.vue';\nimport Field from '@martyrs/src/components/Field/Field.vue';\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport Popup from '@martyrs/src/components/Popup/Popup.vue';\nimport CardPosition from '@martyrs/src/modules/products/components/blocks/CardPosition.vue';\nimport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue';\n\nimport { computed, onMounted, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js';\n\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport * as rents from '@martyrs/src/modules/rents/views/store/rents.store';\nimport * as products from '@martyrs/src/modules/products/store/products.js';\nimport variants from '@martyrs/src/modules/products/store/variants.store.js';\n\nconst route = useRoute();\nconst router = useRouter();\nconst { formatPrice } = useGlobalMixins();\n\nconst Products = ref(products.state.all);\nconst isOpenProductsPopup = ref(false);\nconst isVariantsPopupOpen = ref(false);\nconst selectedProduct = ref({});\n\nconst totalDays = computed(() => {\n const start = new Date(rents.state.current.startDate);\n const end = new Date(rents.state.current.endDate);\n if (!start || !end) return 0;\n const diffTime = Math.abs(end - start);\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n});\n\nfunction openProductsPopup() {\n isOpenProductsPopup.value = true;\n}\n\nfunction closeProductsPopup() {\n isOpenProductsPopup.value = false;\n}\n\nfunction closeVariantsPopup() {\n isVariantsPopupOpen.value = false;\n selectedProduct.value = {};\n}\n\nfunction selectProduct(product) {\n selectedProduct.value = product;\n closeProductsPopup();\n\n // If product has only one variant, add it directly without showing popup\n if (product.variants && product.variants.length === 1) {\n addVariantToRent(product.variants[0]);\n return;\n }\n\n // If product has multiple variants or no variants defined, show popup\n isVariantsPopupOpen.value = true;\n}\n\nfunction formatProductName(product, variant) {\n if (!variant || product.variants?.length === 1 && !(variant.attributes?.length))\n return product.name;\n\n const attrs = variant.attributes?.map(a => a.value).filter(Boolean);\n if (attrs?.length) {\n return `${product.name} / ${attrs.join(' / ')}`;\n }\n\n // Если variant.name уже содержит product.name, не дублируем\n return variant.name || product.name;\n}\n\nfunction addVariantToRent(variant) {\n // Create product object with variant information\n rents.state.current.product = {\n _id: selectedProduct.value._id,\n variant: variant._id,\n name: formatProductName(selectedProduct.value, variant),\n images: variant.images || selectedProduct.value.images || [],\n price: variant.price || variant.cost || 0,\n unit: variant.unit || 'pcs',\n quantity: 1,\n listing: 'rent'\n };\n\n closeVariantsPopup();\n}\n\nfunction updateItem(index, updatedItem) {\n rents.state.current.items[index] = { product: updatedItem.product._id || updatedItem.product, quantity: updatedItem.quantity || 1 };\n}\n\nfunction deleteItem(index) {\n try {\n rents.state.current.items.splice(index, 1);\n } catch (error) {\n console.error('Ошибка при удалении элемента:', error);\n }\n}\n\nonMounted(async () => {\n try {\n if (route.params.rent) {\n await rents.actions.read({ _id: route.params.rent });\n } else {\n rents.mutations.clean();\n }\n\n await products.actions.read({ owner: route.params._id, listing: 'rent', limit: 100 });\n Products.value = products.state.all;\n } catch (error) {\n console.error('Ошибка при загрузке данных:', error);\n }\n});\n\nasync function onSubmit() {\n try {\n if (route.params.rent) {\n // Update existing rent\n const rentData = {\n _id: rents.state.current._id,\n product: rents.state.current.product._id,\n variant: rents.state.current.product.variant,\n startDate: new Date(rents.state.current.startDate),\n endDate: new Date(rents.state.current.endDate),\n comment: rents.state.current.comment,\n status: rents.state.current.status\n };\n await rents.actions.update(rentData);\n } else {\n // Create new rent - БЕЗ _id!\n const rentData = {\n product: rents.state.current.product._id,\n variant: rents.state.current.product.variant,\n startDate: new Date(rents.state.current.startDate),\n endDate: new Date(rents.state.current.endDate),\n comment: rents.state.current.comment || '',\n status: rents.state.current.status || 'active',\n creator: { type: 'user', target: auth.state.user._id },\n owner: { type: 'organization', target: route.params._id }\n };\n await rents.actions.create(rentData);\n }\n router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при отправке данных:', error);\n }\n}\n\nasync function onReset() {\n try {\n if (route.params._id) {\n await rents.actions.read({ _id: route.params._id });\n } else {\n rents.mutations.clean();\n }\n } catch (error) {\n console.error('Ошибка при сбросе данных:', error);\n }\n}\n\nasync function onDelete() {\n try {\n await rents.actions.delete(route.params._id);\n router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при удалении:', error);\n }\n}\n\n</script>\n\n<style lang=\"scss\">\n.round-stat {\n padding: 1rem;\n border-radius: 5rem;\n width: 3rem;\n height: 3rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(0,0,0,0.1);\n}\n</style>"],"names":["products.state","rents.state","rents.actions","rents.mutations","products.actions","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8LA,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AACxB,UAAM,EAAE,YAAW,IAAK,gBAAe;AAEvC,UAAM,WAAW,IAAIA,MAAe,GAAG;AACvC,UAAM,sBAAsB,IAAI,KAAK;AACrC,UAAM,sBAAsB,IAAI,KAAK;AACrC,UAAM,kBAAkB,IAAI,EAAE;AAE9B,UAAM,YAAY,SAAS,MAAM;AAC/B,YAAM,QAAQ,IAAI,KAAKC,QAAY,QAAQ,SAAS;AACpD,YAAM,MAAM,IAAI,KAAKA,QAAY,QAAQ,OAAO;AAChD,UAAI,CAAC,SAAS,CAAC,IAAK,QAAO;AAC3B,YAAM,WAAW,KAAK,IAAI,MAAM,KAAK;AACrC,aAAO,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAAG;AAAA,IACnD,CAAC;AAED,aAAS,oBAAoB;AAC3B,0BAAoB,QAAQ;AAAA,IAC9B;AAEA,aAAS,qBAAqB;AAC5B,0BAAoB,QAAQ;AAAA,IAC9B;AAEA,aAAS,qBAAqB;AAC5B,0BAAoB,QAAQ;AAC5B,sBAAgB,QAAQ,CAAA;AAAA,IAC1B;AAEA,aAAS,cAAc,SAAS;AAC9B,sBAAgB,QAAQ;AACxB,yBAAkB;AAGlB,UAAI,QAAQ,YAAY,QAAQ,SAAS,WAAW,GAAG;AACrD,yBAAiB,QAAQ,SAAS,CAAC,CAAC;AACpC;AAAA,MACF;AAGA,0BAAoB,QAAQ;AAAA,IAC9B;AAEA,aAAS,kBAAkB,SAAS,SAAS;AAC3C,UAAI,CAAC,WAAW,QAAQ,UAAU,WAAW,KAAK,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AAO;AACd,gBAAQ,MAAM,wBAAwB,KAAK;AAAA,MAC7C;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { reactive, ref, createElementBlock, openBlock, renderSlot, createVNode, withCtx, createElementVNode, createTextVNode } from "vue";
|
|
2
2
|
import _sfc_main$1 from "../../../../components/Popup/Popup.vue.js";
|
|
3
|
-
import _sfc_main$2 from "../../../../components/Button/Button.
|
|
4
|
-
import Select from "../../../../components/Select/Select.
|
|
3
|
+
import _sfc_main$2 from "../../../../components/Button/Button.vue2.js";
|
|
4
|
+
import Select from "../../../../components/Select/Select.vue.js";
|
|
5
5
|
import { actions } from "../../store/reports.js";
|
|
6
6
|
const _sfc_main = {
|
|
7
7
|
__name: "FormReport",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, computed, resolveComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, createBlock, toDisplayString } from "vue";
|
|
2
|
-
/* empty css
|
|
2
|
+
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
/* empty css
|
|
4
|
+
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
const _hoisted_1 = { class: "br-grey-transp-25 radius-small mn-b-small" };
|
|
7
7
|
const _hoisted_2 = {
|
|
@@ -2,7 +2,7 @@ import { ref, onMounted, watch, resolveComponent, createElementBlock, openBlock,
|
|
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
4
|
/* empty css */
|
|
5
|
-
/* empty css
|
|
5
|
+
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { useStore } from "../../../core/views/store/core.store.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, onMounted, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
|
|
2
2
|
import { useRouter, useRoute } from "vue-router";
|
|
3
3
|
import { Loader } from "../../../../../../node_modules/.pnpm/@googlemaps_js-api-loader@1.16.8/node_modules/@googlemaps/js-api-loader/dist/index.js";
|
|
4
|
-
import _sfc_main$1 from "../../../../components/Button/Button.
|
|
4
|
+
import _sfc_main$1 from "../../../../components/Button/Button.vue2.js";
|
|
5
5
|
import { actions, state as state$1 } from "../../../organizations/store/organizations.js";
|
|
6
6
|
import { useStore } from "../../../core/views/store/core.store.js";
|
|
7
7
|
import { state } from "../../../marketplace/views/store/marketplace.js";
|
|
@@ -432,7 +432,7 @@ const _sfc_main = {
|
|
|
432
432
|
}
|
|
433
433
|
});
|
|
434
434
|
marker.addListener("click", () => {
|
|
435
|
-
router.push(
|
|
435
|
+
router.push("/organizations/" + org._id);
|
|
436
436
|
});
|
|
437
437
|
return marker;
|
|
438
438
|
}
|
|
@@ -494,7 +494,7 @@ const _sfc_main = {
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
marker.addListener("click", () => {
|
|
497
|
-
router.push(
|
|
497
|
+
router.push("/organizations/" + org._id);
|
|
498
498
|
});
|
|
499
499
|
return marker;
|
|
500
500
|
}
|
|
@@ -525,7 +525,7 @@ const _sfc_main = {
|
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
|
-
const Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
528
|
+
const Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e9370e2c"]]);
|
|
529
529
|
export {
|
|
530
530
|
Map as default
|
|
531
531
|
};
|