@revenexx/cover 0.1.0
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/LICENSE +21 -0
- package/README.md +39 -0
- package/app/api/account.ts +8 -0
- package/app/api/categories.ts +3 -0
- package/app/api/checkout.ts +6 -0
- package/app/api/images.ts +4 -0
- package/app/api/markets.ts +3 -0
- package/app/api/product.ts +3 -0
- package/app/api/products.ts +4 -0
- package/app/api/search.ts +4 -0
- package/app/app.config.ts +29 -0
- package/app/assets/css/cover.css +25 -0
- package/app/components/account/AccountMenu.vue +30 -0
- package/app/components/account/AccountShell.vue +18 -0
- package/app/components/account/AccountSidebar.vue +90 -0
- package/app/components/account/address/AccountAddressCard.vue +287 -0
- package/app/components/account/carts/AccountCartsTable.vue +284 -0
- package/app/components/account/dashboard/AccountDashboard.vue +351 -0
- package/app/components/account/directorder/AccountDirectOrder.vue +512 -0
- package/app/components/account/governance/AccountApprovalLimitsTable.vue +221 -0
- package/app/components/account/governance/AccountCostCenterDetail.vue +276 -0
- package/app/components/account/governance/AccountCostCentersTable.vue +252 -0
- package/app/components/account/governance/AccountRequisitionDetail.vue +295 -0
- package/app/components/account/governance/AccountRequisitionsTable.vue +255 -0
- package/app/components/account/governance/AccountWorkflowDetail.vue +215 -0
- package/app/components/account/governance/AccountWorkflowsTable.vue +168 -0
- package/app/components/account/governance/GovernanceApprovalLimitModal.vue +183 -0
- package/app/components/account/governance/GovernanceCostCenterModal.vue +188 -0
- package/app/components/account/governance/GovernanceWorkflowModal.vue +191 -0
- package/app/components/account/orderlists/AccountOrderListDetail.vue +349 -0
- package/app/components/account/orderlists/AccountOrderListsTable.vue +352 -0
- package/app/components/account/orders/AccountOrderDetail.vue +376 -0
- package/app/components/account/orders/AccountOrdersTable.vue +281 -0
- package/app/components/account/preferences/AccountPreferences.vue +50 -0
- package/app/components/auth/AuthForgotPasswordPanel.vue +88 -0
- package/app/components/auth/AuthLoginPanel.vue +103 -0
- package/app/components/auth/AuthLoginTeaser.vue +24 -0
- package/app/components/auth/AuthPageHeader.vue +21 -0
- package/app/components/auth/AuthRegisterPanel.vue +431 -0
- package/app/components/auth/AuthRegisterTeaser.vue +24 -0
- package/app/components/auth/AuthResetPasswordPanel.vue +115 -0
- package/app/components/cart/CartButton.vue +42 -0
- package/app/components/cart/actions/CartCostCenterModal.vue +110 -0
- package/app/components/cart/actions/CartExportModal.vue +82 -0
- package/app/components/cart/actions/CartPositionTextsModal.vue +92 -0
- package/app/components/cart/actions/CartSaveToListModal.vue +177 -0
- package/app/components/cart/actions/CartWorkflowPickerModal.vue +64 -0
- package/app/components/cart/drawer/CartDrawer.vue +49 -0
- package/app/components/cart/item/CartItem.vue +318 -0
- package/app/components/cart/manage/CartNameModal.vue +68 -0
- package/app/components/cart/position/CartPosition.vue +369 -0
- package/app/components/cart/quickadd/CartQuickAdd.vue +145 -0
- package/app/components/cart/recommend/CartCrossSell.vue +102 -0
- package/app/components/cart/recommend/CartRecommendCard.vue +59 -0
- package/app/components/cart/recommend/CartReorderStrip.vue +108 -0
- package/app/components/cart/requisition/CartRequisitionGroup.vue +74 -0
- package/app/components/cart/skeleton/CartSkeleton.vue +18 -0
- package/app/components/cart/summary/CartSummary.vue +25 -0
- package/app/components/cart/summary/CartSummaryBreakdown.vue +35 -0
- package/app/components/cart/switcher/CartSwitcher.vue +147 -0
- package/app/components/cart/target/CartTargetModal.vue +129 -0
- package/app/components/cart/view/CartApprovalsPanel.vue +89 -0
- package/app/components/cart/view/CartListHeader.vue +86 -0
- package/app/components/cart/view/CartPositionList.vue +94 -0
- package/app/components/cart/view/CartSummaryPanel.vue +254 -0
- package/app/components/cart/view/CartView.vue +310 -0
- package/app/components/category/info/CategoryPrice.vue +47 -0
- package/app/components/category/info/CategorySku.vue +15 -0
- package/app/components/category/info/CategoryStock.vue +25 -0
- package/app/components/category/list/CategoryItemCount.vue +27 -0
- package/app/components/category/list/CategoryListPagination.vue +81 -0
- package/app/components/category/skeleton/CategoryDetailSkeleton.vue +12 -0
- package/app/components/category/skeleton/CategoryListSkeleton.vue +65 -0
- package/app/components/category/view/CategoryViewToggle.vue +33 -0
- package/app/components/category/view/GridView.vue +78 -0
- package/app/components/category/view/ListView.vue +80 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationView.vue +289 -0
- package/app/components/checkout/form/CheckoutSchemaForm.vue +72 -0
- package/app/components/checkout/onepage/CheckoutAddressPickerModal.vue +260 -0
- package/app/components/checkout/onepage/CheckoutAddressSection.vue +186 -0
- package/app/components/checkout/onepage/CheckoutDeliverySection.vue +158 -0
- package/app/components/checkout/onepage/CheckoutGate.vue +67 -0
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +154 -0
- package/app/components/checkout/onepage/CheckoutNotesSection.vue +62 -0
- package/app/components/checkout/onepage/CheckoutOnePageView.vue +77 -0
- package/app/components/checkout/onepage/CheckoutPaymentSection.vue +181 -0
- package/app/components/checkout/onepage/CheckoutSectionTitle.vue +18 -0
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +211 -0
- package/app/components/checkout/onepage/CheckoutWorkflowPanel.vue +38 -0
- package/app/components/layout/AppLogo.vue +21 -0
- package/app/components/layout/footer/Footer.vue +148 -0
- package/app/components/layout/header/AppBar.vue +75 -0
- package/app/components/layout/header/CategoryNav.vue +93 -0
- package/app/components/layout/header/HeaderActionItem.vue +81 -0
- package/app/components/layout/header/LocaleSwitcher.vue +123 -0
- package/app/components/layout/header/MainNav.vue +61 -0
- package/app/components/layout/header/MobileMenu.vue +81 -0
- package/app/components/layout/header/TopBar.vue +63 -0
- package/app/components/listing/ListingView.vue +227 -0
- package/app/components/product/detail/ProductDetailAddToCart.vue +188 -0
- package/app/components/product/detail/ProductDetailDescription.vue +20 -0
- package/app/components/product/detail/ProductDetailImageGallery.vue +58 -0
- package/app/components/product/detail/ProductDetailPricing.vue +108 -0
- package/app/components/product/detail/ProductDetailSaveToList.vue +291 -0
- package/app/components/product/detail/ProductDetailSpecifications.vue +33 -0
- package/app/components/product/detail/ProductDetailStock.vue +36 -0
- package/app/components/search/filter/SearchFacets.vue +256 -0
- package/app/components/search/filter/SearchFacetsDrawer.vue +58 -0
- package/app/components/ui/AppShell.vue +7 -0
- package/app/components/ui/debug/PiniaStateCard.vue +106 -0
- package/app/components/ui/feedback/EmptyState.vue +30 -0
- package/app/components/ui/feedback/ErrorBoundary.vue +44 -0
- package/app/components/ui/feedback/NotFound.vue +34 -0
- package/app/components/ui/forms/CountrySelection.vue +14 -0
- package/app/components/ui/forms/FormKitDatePicker.vue +124 -0
- package/app/components/ui/forms/PasswordInput.vue +136 -0
- package/app/components/ui/forms/SearchInput.vue +213 -0
- package/app/components/ui/table/TableSortButton.vue +51 -0
- package/app/components/ui/table/TableToolbar.vue +66 -0
- package/app/composables/useAccount.ts +27 -0
- package/app/composables/useAccountAddresses.ts +116 -0
- package/app/composables/useAccountOrders.ts +18 -0
- package/app/composables/useAppUrl.ts +38 -0
- package/app/composables/useAuthStore.ts +202 -0
- package/app/composables/useB2BContext.ts +23 -0
- package/app/composables/useCartActions.ts +25 -0
- package/app/composables/useCartCalculation.ts +90 -0
- package/app/composables/useCartSelection.ts +46 -0
- package/app/composables/useCartStore.ts +837 -0
- package/app/composables/useCartSummaryFormatting.ts +28 -0
- package/app/composables/useCategories.ts +29 -0
- package/app/composables/useCheckoutOnePage.ts +438 -0
- package/app/composables/useCheckoutProfileSource.ts +8 -0
- package/app/composables/useCheckoutSchema.ts +28 -0
- package/app/composables/useDataTable.ts +14 -0
- package/app/composables/useFormValidation.ts +29 -0
- package/app/composables/useIcons.ts +17 -0
- package/app/composables/useLocalePreferences.ts +45 -0
- package/app/composables/useMarkets.ts +15 -0
- package/app/composables/useProduct.ts +89 -0
- package/app/composables/useProductCard.ts +8 -0
- package/app/composables/useProductCardActions.ts +106 -0
- package/app/composables/useProductImage.ts +12 -0
- package/app/composables/useProductListing.ts +210 -0
- package/app/composables/useProductUrl.ts +17 -0
- package/app/composables/useProducts.ts +130 -0
- package/app/composables/useSearch.ts +12 -0
- package/app/composables/useThemeStore.ts +81 -0
- package/app/composables/useViewMode.ts +18 -0
- package/app/config/countries.ts +74 -0
- package/app/config/icons.ts +283 -0
- package/app/config/navigation.ts +191 -0
- package/app/config/palette.ts +13 -0
- package/app/config/themes.ts +20 -0
- package/app/formkit.config.ts +50 -0
- package/app/interfaces/account/address-list.ts +34 -0
- package/app/interfaces/account/order-list.ts +47 -0
- package/app/interfaces/account/order-lists.ts +35 -0
- package/app/interfaces/account/profile.ts +17 -0
- package/app/interfaces/account.ts +3 -0
- package/app/interfaces/address.ts +9 -0
- package/app/interfaces/auth.ts +104 -0
- package/app/interfaces/b2b.ts +234 -0
- package/app/interfaces/cart-calculation.ts +131 -0
- package/app/interfaces/cart-item.ts +45 -0
- package/app/interfaces/checkout-draft.ts +4 -0
- package/app/interfaces/checkout.ts +43 -0
- package/app/interfaces/delivery.ts +13 -0
- package/app/interfaces/market.ts +24 -0
- package/app/interfaces/payment.ts +19 -0
- package/app/interfaces/persisted-cart.ts +10 -0
- package/app/interfaces/product-detail.ts +54 -0
- package/app/interfaces/product-list.ts +33 -0
- package/app/interfaces/search-facets.ts +14 -0
- package/app/interfaces/validation.ts +14 -0
- package/app/layouts/default.vue +78 -0
- package/app/layouts/focus.vue +80 -0
- package/app/plugins/formkit-locale.client.ts +23 -0
- package/app/shared/constants.ts +1 -0
- package/app/validations/companyName.ts +18 -0
- package/app/validations/emailFormat.ts +10 -0
- package/app/validations/formValidationConfig.ts +50 -0
- package/app/validations/maxLength.ts +12 -0
- package/app/validations/minLength.ts +9 -0
- package/app/validations/optionalCompanyName.ts +23 -0
- package/app/validations/passwordsMatch.ts +5 -0
- package/app/validations/phoneNumber.ts +19 -0
- package/app/validations/required.ts +11 -0
- package/app/validations/termsRequired.ts +4 -0
- package/app/validations/types.ts +10 -0
- package/app/validations/zipCode.ts +15 -0
- package/i18n/locales/de/account.json +458 -0
- package/i18n/locales/de/auth.json +155 -0
- package/i18n/locales/de/cart.json +263 -0
- package/i18n/locales/de/checkout.json +217 -0
- package/i18n/locales/de/common.json +80 -0
- package/i18n/locales/de/cover.json +33 -0
- package/i18n/locales/de/order.json +1 -0
- package/i18n/locales/de/product.json +71 -0
- package/i18n/locales/de/search.json +54 -0
- package/i18n/locales/de/validation.json +12 -0
- package/i18n/locales/en/account.json +458 -0
- package/i18n/locales/en/auth.json +155 -0
- package/i18n/locales/en/cart.json +263 -0
- package/i18n/locales/en/checkout.json +217 -0
- package/i18n/locales/en/common.json +80 -0
- package/i18n/locales/en/cover.json +33 -0
- package/i18n/locales/en/order.json +1 -0
- package/i18n/locales/en/product.json +71 -0
- package/i18n/locales/en/search.json +54 -0
- package/i18n/locales/en/validation.json +12 -0
- package/nuxt.config.ts +109 -0
- package/package.json +65 -0
- package/public/img/product-placeholder.svg +8 -0
- package/public/templates/direct-order-template.csv +3 -0
- package/public/templates/direct-order-template.xlsx +0 -0
- package/server/api/account/address/[id].delete.ts +51 -0
- package/server/api/account/address/[id].put.ts +83 -0
- package/server/api/account/address/index.post.ts +60 -0
- package/server/api/account/addresses.get.ts +25 -0
- package/server/api/account/context.get.ts +16 -0
- package/server/api/account/governance/[domain]/[id].put.ts +57 -0
- package/server/api/account/governance/[domain].post.ts +111 -0
- package/server/api/account/order-lists/[id].delete.ts +22 -0
- package/server/api/account/order-lists/[id].get.ts +17 -0
- package/server/api/account/order-lists/[id].put.ts +46 -0
- package/server/api/account/order-lists/index.get.ts +14 -0
- package/server/api/account/order-lists/index.post.ts +38 -0
- package/server/api/account/orders/[id].get.ts +35 -0
- package/server/api/account/orders.get.ts +35 -0
- package/server/api/account/profile.get.ts +56 -0
- package/server/api/account/profile.put.ts +128 -0
- package/server/api/account/requisitions/[id].get.ts +15 -0
- package/server/api/account/requisitions.get.ts +23 -0
- package/server/api/auth/login.post.ts +37 -0
- package/server/api/auth/logout.post.ts +4 -0
- package/server/api/auth/me.get.ts +3 -0
- package/server/api/auth/personas.get.ts +7 -0
- package/server/api/auth/recovery.post.ts +32 -0
- package/server/api/auth/recovery.put.ts +37 -0
- package/server/api/auth/register.post.ts +126 -0
- package/server/api/cart/calculate.post.ts +25 -0
- package/server/api/cart/export.post.ts +81 -0
- package/server/api/cart/index.delete.ts +10 -0
- package/server/api/cart/index.get.ts +10 -0
- package/server/api/cart/sync.post.ts +14 -0
- package/server/api/carts/[id]/activate.post.ts +18 -0
- package/server/api/carts/[id]/index.delete.ts +18 -0
- package/server/api/carts/[id]/index.put.ts +19 -0
- package/server/api/carts/[id]/items.post.ts +21 -0
- package/server/api/carts/index.get.ts +14 -0
- package/server/api/carts/index.post.ts +14 -0
- package/server/api/categories/[slug].get.ts +22 -0
- package/server/api/categories/index.get.ts +11 -0
- package/server/api/checkout/profile.get.ts +21 -0
- package/server/api/checkout/schema/[key].get.ts +19 -0
- package/server/api/checkout/session.post.ts +8 -0
- package/server/api/images/detail/[filename].get.ts +18 -0
- package/server/api/images/list/[filename].get.ts +17 -0
- package/server/api/markets.get.ts +9 -0
- package/server/api/orders/index.post.ts +376 -0
- package/server/api/payment/methods.post.ts +65 -0
- package/server/api/product/[id].get.ts +29 -0
- package/server/api/products/[id].get.ts +30 -0
- package/server/api/products/index.get.ts +21 -0
- package/server/api/requisitions/index.post.ts +67 -0
- package/server/api/shipping/rates.post.ts +70 -0
- package/server/api/themes/index.get.ts +9 -0
- package/server/api/typesense/drop.get.ts +22 -0
- package/server/api/typesense/health.get.ts +9 -0
- package/server/api/typesense/search.post.ts +199 -0
- package/server/api/typesense/seed.get.ts +112 -0
- package/server/api/typesense/suggest.post.ts +69 -0
- package/server/config/account/organization.json +146 -0
- package/server/config/account/personas.json +169 -0
- package/server/config/account/user.json +8 -0
- package/server/config/account/workflows.json +19 -0
- package/server/data/account/address-list.json +103 -0
- package/server/data/account/order-list.json +491 -0
- package/server/data/account/order-lists.json +149 -0
- package/server/data/account/profile.json +9 -0
- package/server/data/account/registration-requests.json +3 -0
- package/server/data/account/requisitions.json +686 -0
- package/server/data/categories.json +186 -0
- package/server/data/forms/checkout/add-address.json +24 -0
- package/server/data/list/5137-1.png +0 -0
- package/server/data/list/5498-1.png +0 -0
- package/server/data/list/5498-2.png +0 -0
- package/server/data/list/5498-3.png +0 -0
- package/server/data/list/5498-4.png +0 -0
- package/server/data/list/5498-5.png +0 -0
- package/server/data/list/5498-6.png +0 -0
- package/server/data/list/5519-1.png +0 -0
- package/server/data/list/5713-1.png +0 -0
- package/server/data/list/5789-1.png +0 -0
- package/server/data/list/5930-1.png +0 -0
- package/server/data/list/6127-1.png +0 -0
- package/server/data/list/6234-1.png +0 -0
- package/server/data/list/6238-1.png +0 -0
- package/server/data/list/6246-1.png +0 -0
- package/server/data/list/6270-1.png +0 -0
- package/server/data/list/6330-1.png +0 -0
- package/server/data/list/6336-1.png +0 -0
- package/server/data/list/6360-1.png +0 -0
- package/server/data/list/6363-1.png +0 -0
- package/server/data/list/6375-1.png +0 -0
- package/server/data/list/6385-1.png +0 -0
- package/server/data/list/6413-1.png +0 -0
- package/server/data/list/6418-1.png +0 -0
- package/server/data/list/6465-1.png +0 -0
- package/server/data/list/6477-1.png +0 -0
- package/server/data/list/6509-1.png +0 -0
- package/server/data/list/6545-1.png +0 -0
- package/server/data/list/6548-1.png +0 -0
- package/server/data/list/6566-1.png +0 -0
- package/server/data/list/6581-1.png +0 -0
- package/server/data/list/6609-1.png +0 -0
- package/server/data/list/6611-1.png +0 -0
- package/server/data/list/6641-1.png +0 -0
- package/server/data/list/6659-1.png +0 -0
- package/server/data/list/6662-1.png +0 -0
- package/server/data/list/6689-1.png +0 -0
- package/server/data/list/6698-1.png +0 -0
- package/server/data/list/6701-1.png +0 -0
- package/server/data/list/6752-1.png +0 -0
- package/server/data/list/6755-1.png +0 -0
- package/server/data/list/6837-1.png +0 -0
- package/server/data/list/6841-1.png +0 -0
- package/server/data/list/6844-1.png +0 -0
- package/server/data/list/6846-1.png +0 -0
- package/server/data/list/6886-1.png +0 -0
- package/server/data/list/6895-1.png +0 -0
- package/server/data/list/6897-1.png +0 -0
- package/server/data/list/6919-1.png +0 -0
- package/server/data/list/6977-1.png +0 -0
- package/server/data/list/6983-1.png +0 -0
- package/server/data/list/6984-1.png +0 -0
- package/server/data/list/6985-1.png +0 -0
- package/server/data/list/6986-1.png +0 -0
- package/server/data/list/6989-1.png +0 -0
- package/server/data/list/6995-1.png +0 -0
- package/server/data/list/6998-1.png +0 -0
- package/server/data/markets.json +24 -0
- package/server/data/product-detail.json +2450 -0
- package/server/data/product-list.json +2450 -0
- package/server/data/themes.json +8 -0
- package/server/interfaces/account.ts +20 -0
- package/server/interfaces/auth.ts +32 -0
- package/server/interfaces/b2bContext.ts +23 -0
- package/server/interfaces/cart.ts +46 -0
- package/server/interfaces/cartCalculation.ts +17 -0
- package/server/interfaces/category.ts +12 -0
- package/server/interfaces/checkoutProfile.ts +5 -0
- package/server/interfaces/log.ts +3 -0
- package/server/interfaces/market.ts +10 -0
- package/server/interfaces/product.ts +21 -0
- package/server/interfaces/schema.ts +20 -0
- package/server/interfaces/theme.ts +10 -0
- package/server/services/ApiAuthService.ts +138 -0
- package/server/services/ApiCartService.ts +254 -0
- package/server/services/ApiCategoryService.ts +25 -0
- package/server/services/ApiMarketService.ts +71 -0
- package/server/services/ApiProductService.ts +53 -0
- package/server/services/LocalFileCategoryService.ts +23 -0
- package/server/services/LocalFileCheckoutProfileService.ts +117 -0
- package/server/services/LocalFileProductService.ts +128 -0
- package/server/services/LocalFileSchemaService.ts +70 -0
- package/server/services/LocalFileThemeService.ts +18 -0
- package/server/services/LogService.ts +28 -0
- package/server/services/MockAccountService.ts +58 -0
- package/server/services/MockAuthService.ts +105 -0
- package/server/services/MockB2BContextService.ts +149 -0
- package/server/services/MockCartCalculationService.ts +395 -0
- package/server/services/MockMarketService.ts +18 -0
- package/server/services/SdkAccountService.ts +56 -0
- package/server/services/SdkAuthService.ts +83 -0
- package/server/services/SessionCartService.ts +31 -0
- package/server/utils/accountService.ts +30 -0
- package/server/utils/authCookie.ts +13 -0
- package/server/utils/authService.ts +43 -0
- package/server/utils/b2bService.ts +49 -0
- package/server/utils/cartService.ts +59 -0
- package/server/utils/categoryService.ts +19 -0
- package/server/utils/checkoutProfileService.ts +9 -0
- package/server/utils/checkoutSession.ts +38 -0
- package/server/utils/coverData.ts +84 -0
- package/server/utils/governanceStore.ts +38 -0
- package/server/utils/i18n.ts +76 -0
- package/server/utils/inventoryService.ts +14 -0
- package/server/utils/liveCatalog.ts +234 -0
- package/server/utils/liveInventories.ts +76 -0
- package/server/utils/liveOrders.ts +139 -0
- package/server/utils/livePrices.ts +93 -0
- package/server/utils/locale.ts +39 -0
- package/server/utils/logService.ts +19 -0
- package/server/utils/marketService.ts +24 -0
- package/server/utils/orderService.ts +14 -0
- package/server/utils/paymentService.ts +14 -0
- package/server/utils/priceService.ts +14 -0
- package/server/utils/productService.ts +28 -0
- package/server/utils/productsSchema.ts +30 -0
- package/server/utils/revenexxApi.ts +136 -0
- package/server/utils/schemaService.ts +25 -0
- package/server/utils/serviceMode.ts +70 -0
- package/server/utils/shippingService.ts +14 -0
- package/server/utils/shopSdk.ts +88 -0
- package/server/utils/themeService.ts +16 -0
- package/server/utils/typesense.ts +27 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import CartNameModal from "../../cart/manage/CartNameModal.vue";
|
|
3
|
+
import type { TableColumn } from "@nuxt/ui";
|
|
4
|
+
|
|
5
|
+
import type { CartSummaryEntry } from "../../../composables/useCartStore";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* All carts currently being filled (multiple-carts feature) as a data
|
|
9
|
+
* table: switch the active cart, create, rename and delete — the cart
|
|
10
|
+
* content itself is edited on the cart page.
|
|
11
|
+
*/
|
|
12
|
+
const { icon } = useIcons();
|
|
13
|
+
const { t, d } = useI18n();
|
|
14
|
+
const { to } = useAppUrl();
|
|
15
|
+
const toast = useToast();
|
|
16
|
+
const cart = useCartStore();
|
|
17
|
+
const { settings } = useB2BContext();
|
|
18
|
+
const { formatCurrency } = useCartSummaryFormatting();
|
|
19
|
+
const { tableUi } = useDataTable();
|
|
20
|
+
|
|
21
|
+
const enabled = computed(() => settings.value?.cart.multipleCarts === true);
|
|
22
|
+
|
|
23
|
+
/* ---- search ----------------------------------------------------------- */
|
|
24
|
+
const search = ref("");
|
|
25
|
+
|
|
26
|
+
const filtered = computed(() => {
|
|
27
|
+
const query = search.value.trim().toLowerCase();
|
|
28
|
+
if (!query) {
|
|
29
|
+
return cart.cartSummaries;
|
|
30
|
+
}
|
|
31
|
+
return cart.cartSummaries.filter(summary => summary.name.toLowerCase().includes(query));
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/* ---- columns + sorting -------------------------------------------------- */
|
|
35
|
+
const sorting = ref([{ id: "updatedAt", desc: true }]);
|
|
36
|
+
|
|
37
|
+
const columns = computed<TableColumn<CartSummaryEntry>[]>(() => [
|
|
38
|
+
{ accessorKey: "name", header: t("cart.multi.page.columns.name") },
|
|
39
|
+
{
|
|
40
|
+
accessorKey: "positions",
|
|
41
|
+
header: t("cart.multi.page.columns.positions"),
|
|
42
|
+
meta: { class: { th: "text-right", td: "text-right" } },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
accessorKey: "value",
|
|
46
|
+
header: t("cart.multi.page.columns.value"),
|
|
47
|
+
meta: { class: { th: "text-right", td: "text-right" } },
|
|
48
|
+
},
|
|
49
|
+
{ accessorKey: "updatedAt", header: t("cart.multi.page.columns.updatedAt") },
|
|
50
|
+
{ id: "status", header: t("cart.multi.page.columns.status"), enableSorting: false },
|
|
51
|
+
{ id: "actions", header: "", enableSorting: false },
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
const formatDate = (value: string) => d(new Date(value), { dateStyle: "medium", timeStyle: "short" });
|
|
55
|
+
|
|
56
|
+
/* ---- actions ------------------------------------------------------------ */
|
|
57
|
+
const createOpen = ref(false);
|
|
58
|
+
const renameOpen = ref(false);
|
|
59
|
+
const renameTarget = ref<CartSummaryEntry | null>(null);
|
|
60
|
+
const deleteTarget = ref<CartSummaryEntry | null>(null);
|
|
61
|
+
|
|
62
|
+
function onCreate(name: string): void {
|
|
63
|
+
cart.createCart(name, false);
|
|
64
|
+
toast.add({
|
|
65
|
+
title: t("cart.multi.created", { name }),
|
|
66
|
+
color: "success",
|
|
67
|
+
icon: icon("success"),
|
|
68
|
+
duration: 1500,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function openRename(summary: CartSummaryEntry): void {
|
|
73
|
+
renameTarget.value = summary;
|
|
74
|
+
renameOpen.value = true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function onRename(name: string): void {
|
|
78
|
+
if (renameTarget.value) {
|
|
79
|
+
cart.renameCart(renameTarget.value.id, name);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function activate(summary: CartSummaryEntry): Promise<void> {
|
|
84
|
+
cart.switchCart(summary.id);
|
|
85
|
+
toast.add({
|
|
86
|
+
title: t("cart.multi.switched", { name: summary.name }),
|
|
87
|
+
color: "primary",
|
|
88
|
+
icon: icon("cart"),
|
|
89
|
+
duration: 1500,
|
|
90
|
+
});
|
|
91
|
+
await navigateTo(to("/cart"));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function onDelete(): void {
|
|
95
|
+
if (!deleteTarget.value) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
cart.deleteCart(deleteTarget.value.id);
|
|
99
|
+
deleteTarget.value = null;
|
|
100
|
+
toast.add({
|
|
101
|
+
title: t("cart.multi.deleted"),
|
|
102
|
+
color: "success",
|
|
103
|
+
icon: icon("success"),
|
|
104
|
+
duration: 1500,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<template>
|
|
110
|
+
<div>
|
|
111
|
+
<UAlert
|
|
112
|
+
v-if="!enabled"
|
|
113
|
+
color="neutral"
|
|
114
|
+
variant="subtle"
|
|
115
|
+
:icon="icon('info')"
|
|
116
|
+
:title="t('cart.multi.page.disabled')"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<template v-else>
|
|
120
|
+
<UiTableToolbar
|
|
121
|
+
v-model:search="search"
|
|
122
|
+
:search-placeholder="t('cart.multi.page.searchPlaceholder')"
|
|
123
|
+
>
|
|
124
|
+
<template #actions>
|
|
125
|
+
<UButton
|
|
126
|
+
color="primary"
|
|
127
|
+
tabindex="0"
|
|
128
|
+
:icon="icon('plus')"
|
|
129
|
+
:label="t('cart.multi.newCart')"
|
|
130
|
+
@click="createOpen = true"
|
|
131
|
+
/>
|
|
132
|
+
</template>
|
|
133
|
+
</UiTableToolbar>
|
|
134
|
+
|
|
135
|
+
<UTable
|
|
136
|
+
v-model:sorting="sorting"
|
|
137
|
+
:data="filtered"
|
|
138
|
+
:columns="columns"
|
|
139
|
+
:ui="tableUi"
|
|
140
|
+
>
|
|
141
|
+
<template #name-header="{ column }">
|
|
142
|
+
<UiTableSortButton
|
|
143
|
+
:column="column"
|
|
144
|
+
:label="t('cart.multi.page.columns.name')"
|
|
145
|
+
/>
|
|
146
|
+
</template>
|
|
147
|
+
<template #positions-header="{ column }">
|
|
148
|
+
<UiTableSortButton
|
|
149
|
+
:column="column"
|
|
150
|
+
:label="t('cart.multi.page.columns.positions')"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
<template #value-header="{ column }">
|
|
154
|
+
<UiTableSortButton
|
|
155
|
+
:column="column"
|
|
156
|
+
:label="t('cart.multi.page.columns.value')"
|
|
157
|
+
/>
|
|
158
|
+
</template>
|
|
159
|
+
<template #updatedAt-header="{ column }">
|
|
160
|
+
<UiTableSortButton
|
|
161
|
+
:column="column"
|
|
162
|
+
:label="t('cart.multi.page.columns.updatedAt')"
|
|
163
|
+
/>
|
|
164
|
+
</template>
|
|
165
|
+
|
|
166
|
+
<template #name-cell="{ row }">
|
|
167
|
+
<span class="font-semibold text-highlighted">{{ row.original.name }}</span>
|
|
168
|
+
</template>
|
|
169
|
+
<template #positions-cell="{ row }">
|
|
170
|
+
<span class="tabular-nums">{{ row.original.positions }}</span>
|
|
171
|
+
</template>
|
|
172
|
+
<template #value-cell="{ row }">
|
|
173
|
+
<span class="tabular-nums text-highlighted">{{ formatCurrency(row.original.value) }}</span>
|
|
174
|
+
</template>
|
|
175
|
+
<template #updatedAt-cell="{ row }">
|
|
176
|
+
{{ formatDate(row.original.updatedAt) }}
|
|
177
|
+
</template>
|
|
178
|
+
<template #status-cell="{ row }">
|
|
179
|
+
<UBadge
|
|
180
|
+
v-if="row.original.active"
|
|
181
|
+
color="primary"
|
|
182
|
+
variant="subtle"
|
|
183
|
+
size="sm"
|
|
184
|
+
:label="t('cart.multi.activeBadge')"
|
|
185
|
+
/>
|
|
186
|
+
<span
|
|
187
|
+
v-else
|
|
188
|
+
class="text-dimmed"
|
|
189
|
+
>—</span>
|
|
190
|
+
</template>
|
|
191
|
+
<template #actions-cell="{ row }">
|
|
192
|
+
<div class="flex items-center justify-end gap-1">
|
|
193
|
+
<UTooltip
|
|
194
|
+
v-if="!row.original.active"
|
|
195
|
+
:text="t('cart.multi.activate')"
|
|
196
|
+
>
|
|
197
|
+
<UButton
|
|
198
|
+
color="primary"
|
|
199
|
+
variant="soft"
|
|
200
|
+
size="sm"
|
|
201
|
+
tabindex="0"
|
|
202
|
+
:icon="icon('cart')"
|
|
203
|
+
:aria-label="t('cart.multi.activate')"
|
|
204
|
+
@click="activate(row.original)"
|
|
205
|
+
/>
|
|
206
|
+
</UTooltip>
|
|
207
|
+
<UTooltip :text="t('cart.multi.rename')">
|
|
208
|
+
<UButton
|
|
209
|
+
color="neutral"
|
|
210
|
+
variant="ghost"
|
|
211
|
+
size="sm"
|
|
212
|
+
tabindex="0"
|
|
213
|
+
:icon="icon('edit')"
|
|
214
|
+
:aria-label="t('cart.multi.rename')"
|
|
215
|
+
@click="openRename(row.original)"
|
|
216
|
+
/>
|
|
217
|
+
</UTooltip>
|
|
218
|
+
<UTooltip :text="t('cart.multi.delete')">
|
|
219
|
+
<UButton
|
|
220
|
+
color="neutral"
|
|
221
|
+
variant="ghost"
|
|
222
|
+
size="sm"
|
|
223
|
+
tabindex="0"
|
|
224
|
+
:icon="icon('delete')"
|
|
225
|
+
:aria-label="t('cart.multi.delete')"
|
|
226
|
+
@click="deleteTarget = row.original"
|
|
227
|
+
/>
|
|
228
|
+
</UTooltip>
|
|
229
|
+
</div>
|
|
230
|
+
</template>
|
|
231
|
+
|
|
232
|
+
<template #empty>
|
|
233
|
+
<UiFeedbackEmptyState
|
|
234
|
+
:icon="icon('cart')"
|
|
235
|
+
:title="t('cart.multi.page.empty.title')"
|
|
236
|
+
:description="t('cart.multi.page.empty.description')"
|
|
237
|
+
/>
|
|
238
|
+
</template>
|
|
239
|
+
</UTable>
|
|
240
|
+
|
|
241
|
+
<CartNameModal
|
|
242
|
+
v-model:open="createOpen"
|
|
243
|
+
mode="create"
|
|
244
|
+
@save="onCreate"
|
|
245
|
+
/>
|
|
246
|
+
<CartNameModal
|
|
247
|
+
v-model:open="renameOpen"
|
|
248
|
+
mode="rename"
|
|
249
|
+
:initial-name="renameTarget?.name"
|
|
250
|
+
@save="onRename"
|
|
251
|
+
/>
|
|
252
|
+
|
|
253
|
+
<UModal
|
|
254
|
+
:open="deleteTarget !== null"
|
|
255
|
+
:title="t('cart.multi.deleteTitle')"
|
|
256
|
+
@update:open="(value: boolean) => { if (!value) deleteTarget = null; }"
|
|
257
|
+
>
|
|
258
|
+
<template #body>
|
|
259
|
+
<p class="text-sm text-muted">
|
|
260
|
+
{{ t('cart.multi.deleteDescription', {
|
|
261
|
+
name: deleteTarget?.name ?? '',
|
|
262
|
+
count: deleteTarget?.positions ?? 0,
|
|
263
|
+
}) }}
|
|
264
|
+
</p>
|
|
265
|
+
</template>
|
|
266
|
+
<template #footer>
|
|
267
|
+
<UButton
|
|
268
|
+
color="neutral"
|
|
269
|
+
variant="ghost"
|
|
270
|
+
tabindex="0"
|
|
271
|
+
:label="t('cart.item.cancel')"
|
|
272
|
+
@click="deleteTarget = null"
|
|
273
|
+
/>
|
|
274
|
+
<UButton
|
|
275
|
+
color="error"
|
|
276
|
+
tabindex="0"
|
|
277
|
+
:label="t('cart.multi.delete')"
|
|
278
|
+
@click="onDelete"
|
|
279
|
+
/>
|
|
280
|
+
</template>
|
|
281
|
+
</UModal>
|
|
282
|
+
</template>
|
|
283
|
+
</div>
|
|
284
|
+
</template>
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Requisition } from "../../../interfaces/b2b";
|
|
3
|
+
import type { AccountOrderStatus } from "../../../interfaces/account/order-list";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The account dashboard: KPI band (open orders, awaiting approval, 30-day
|
|
7
|
+
* spend, budget utilization), recent orders, open requisitions, cost
|
|
8
|
+
* center budget bars and quick actions — the buyer's daily starting point.
|
|
9
|
+
*/
|
|
10
|
+
const { icon } = useIcons();
|
|
11
|
+
const { t, d } = useI18n();
|
|
12
|
+
const localePath = useLocalePath();
|
|
13
|
+
const auth = useAuthStore();
|
|
14
|
+
const { orders, status: ordersStatus } = useAccountOrders();
|
|
15
|
+
const { costCenters, status: contextStatus } = useB2BContext();
|
|
16
|
+
const { formatCurrency } = useCartSummaryFormatting();
|
|
17
|
+
|
|
18
|
+
const { data: requisitions, status: requisitionsStatus } = useFetch<Requisition[]>(
|
|
19
|
+
"/api/account/requisitions",
|
|
20
|
+
{ key: "account-requisitions", default: () => [] },
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const pending = computed(() =>
|
|
24
|
+
ordersStatus.value === "pending"
|
|
25
|
+
|| contextStatus.value === "pending"
|
|
26
|
+
|| requisitionsStatus.value === "pending");
|
|
27
|
+
|
|
28
|
+
/* ---- KPIs ------------------------------------------------------------ */
|
|
29
|
+
const OPEN_STATUSES: AccountOrderStatus[] = ["processing", "approval-pending", "shipped"];
|
|
30
|
+
|
|
31
|
+
const openOrdersCount = computed(() =>
|
|
32
|
+
orders.value.filter(order => OPEN_STATUSES.includes(order.status)).length);
|
|
33
|
+
|
|
34
|
+
const awaitingApprovalCount = computed(() =>
|
|
35
|
+
orders.value.filter(order => order.status === "approval-pending").length
|
|
36
|
+
+ requisitions.value.filter(requisition => requisition.status === "open").length);
|
|
37
|
+
|
|
38
|
+
const spend30 = computed(() => {
|
|
39
|
+
const cutoff = Date.now() - 30 * 24 * 60 * 60 * 1000;
|
|
40
|
+
return orders.value
|
|
41
|
+
.filter(order => order.status !== "cancelled" && new Date(order.date).getTime() >= cutoff)
|
|
42
|
+
.reduce((sum, order) => sum + order.total, 0);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const budgetedCostCenters = computed(() =>
|
|
46
|
+
costCenters.value.filter(cc =>
|
|
47
|
+
cc.limit?.totalBudget !== undefined && cc.limit.availableBudget !== undefined));
|
|
48
|
+
|
|
49
|
+
const budgetUtilization = computed(() => {
|
|
50
|
+
const total = budgetedCostCenters.value.reduce((sum, cc) => sum + (cc.limit?.totalBudget ?? 0), 0);
|
|
51
|
+
if (!total) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const available = budgetedCostCenters.value.reduce((sum, cc) => sum + (cc.limit?.availableBudget ?? 0), 0);
|
|
55
|
+
return Math.round(((total - available) / total) * 100);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
/* ---- lists ------------------------------------------------------------ */
|
|
59
|
+
const recentOrders = computed(() => orders.value.slice(0, 5));
|
|
60
|
+
|
|
61
|
+
const openRequisitions = computed(() =>
|
|
62
|
+
requisitions.value.filter(requisition => requisition.status === "open").slice(0, 4));
|
|
63
|
+
|
|
64
|
+
const statusColors: Record<AccountOrderStatus, "info" | "warning" | "primary" | "success" | "error"> = {
|
|
65
|
+
"processing": "info",
|
|
66
|
+
"approval-pending": "warning",
|
|
67
|
+
"shipped": "primary",
|
|
68
|
+
"delivered": "success",
|
|
69
|
+
"cancelled": "error",
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const utilization = (used: number, total: number): number =>
|
|
73
|
+
total > 0 ? Math.min(100, Math.round((used / total) * 100)) : 0;
|
|
74
|
+
|
|
75
|
+
const budgetBars = computed(() =>
|
|
76
|
+
budgetedCostCenters.value.map((cc) => {
|
|
77
|
+
const total = cc.limit?.totalBudget ?? 0;
|
|
78
|
+
const available = cc.limit?.availableBudget ?? 0;
|
|
79
|
+
return { id: cc.id, label: cc.label, total, available, used: utilization(total - available, total) };
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
const formatDate = (value: string) => {
|
|
83
|
+
const parsed = new Date(value);
|
|
84
|
+
return Number.isNaN(parsed.getTime()) ? value : d(parsed, { dateStyle: "medium" });
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/* ---- quick actions ----------------------------------------------------- */
|
|
88
|
+
const quickActions = [
|
|
89
|
+
{ to: "/account/direct-order", labelKey: "directOrder.title", token: "direct-order" },
|
|
90
|
+
{ to: "/account/orders", labelKey: "account.nav.orders", token: "orders" },
|
|
91
|
+
{ to: "/account/order-lists", labelKey: "account.nav.orderLists", token: "order-list" },
|
|
92
|
+
{ to: "/account/requisitions", labelKey: "account.nav.requisitions", token: "check" },
|
|
93
|
+
{ to: "/account/cost-centers", labelKey: "account.nav.costCenters", token: "briefcase" },
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
/** Divider-separated KPI cells: 2-col grid on mobile, 4-col from lg. */
|
|
97
|
+
const statCell = `p-4 sm:p-5 border-(--ui-border)
|
|
98
|
+
max-lg:nth-[n+3]:border-t max-lg:nth-[2n]:border-l lg:not-first:border-l`;
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<div>
|
|
103
|
+
<!-- Greeting -->
|
|
104
|
+
<div class="mb-8">
|
|
105
|
+
<h1 class="text-2xl font-semibold text-highlighted">
|
|
106
|
+
{{ auth.user?.name
|
|
107
|
+
? t('account.dashboard.greeting', { name: auth.user.name })
|
|
108
|
+
: t('account.dashboard.title') }}
|
|
109
|
+
</h1>
|
|
110
|
+
<p class="text-sm text-muted mt-1">
|
|
111
|
+
{{ t('account.dashboard.description') }}
|
|
112
|
+
</p>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div
|
|
116
|
+
v-if="pending"
|
|
117
|
+
class="space-y-6"
|
|
118
|
+
>
|
|
119
|
+
<USkeleton class="h-28 w-full rounded-xl" />
|
|
120
|
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
121
|
+
<USkeleton class="h-72 rounded-xl lg:col-span-2" />
|
|
122
|
+
<USkeleton class="h-72 rounded-xl" />
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div
|
|
127
|
+
v-else
|
|
128
|
+
class="space-y-6"
|
|
129
|
+
>
|
|
130
|
+
<!-- KPI band -->
|
|
131
|
+
<dl class="border border-(--ui-border) rounded-xl grid grid-cols-2 lg:grid-cols-4">
|
|
132
|
+
<div :class="statCell">
|
|
133
|
+
<dt class="text-sm text-muted truncate">
|
|
134
|
+
{{ t('account.dashboard.stats.openOrders') }}
|
|
135
|
+
</dt>
|
|
136
|
+
<dd class="mt-1 text-2xl font-semibold text-highlighted tabular-nums">
|
|
137
|
+
{{ openOrdersCount }}
|
|
138
|
+
</dd>
|
|
139
|
+
</div>
|
|
140
|
+
<div :class="statCell">
|
|
141
|
+
<dt class="text-sm text-muted truncate">
|
|
142
|
+
{{ t('account.dashboard.stats.awaitingApproval') }}
|
|
143
|
+
</dt>
|
|
144
|
+
<dd
|
|
145
|
+
class="mt-1 text-2xl font-semibold tabular-nums"
|
|
146
|
+
:class="awaitingApprovalCount > 0 ? 'text-warning' : 'text-highlighted'"
|
|
147
|
+
>
|
|
148
|
+
{{ awaitingApprovalCount }}
|
|
149
|
+
</dd>
|
|
150
|
+
</div>
|
|
151
|
+
<div :class="statCell">
|
|
152
|
+
<dt class="text-sm text-muted truncate">
|
|
153
|
+
{{ t('account.dashboard.stats.spend30') }}
|
|
154
|
+
</dt>
|
|
155
|
+
<dd class="mt-1 text-2xl font-semibold text-highlighted tabular-nums">
|
|
156
|
+
{{ formatCurrency(spend30) }}
|
|
157
|
+
</dd>
|
|
158
|
+
</div>
|
|
159
|
+
<div :class="statCell">
|
|
160
|
+
<dt class="text-sm text-muted truncate">
|
|
161
|
+
{{ t('account.dashboard.stats.budgetUsed') }}
|
|
162
|
+
</dt>
|
|
163
|
+
<dd
|
|
164
|
+
class="mt-1 text-2xl font-semibold tabular-nums"
|
|
165
|
+
:class="(budgetUtilization ?? 0) >= 90 ? 'text-warning' : 'text-highlighted'"
|
|
166
|
+
>
|
|
167
|
+
{{ budgetUtilization !== null ? `${budgetUtilization} %` : '—' }}
|
|
168
|
+
</dd>
|
|
169
|
+
</div>
|
|
170
|
+
</dl>
|
|
171
|
+
|
|
172
|
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 items-start">
|
|
173
|
+
<!-- Left column: recent orders + open requisitions -->
|
|
174
|
+
<div class="lg:col-span-2 space-y-6">
|
|
175
|
+
<section class="border border-(--ui-border) rounded-xl overflow-hidden">
|
|
176
|
+
<header class="flex items-center justify-between px-4 sm:px-5 py-3 bg-elevated/60 border-b border-(--ui-border)">
|
|
177
|
+
<h2 class="text-sm font-semibold text-highlighted">
|
|
178
|
+
{{ t('account.dashboard.recentOrders') }}
|
|
179
|
+
</h2>
|
|
180
|
+
<ULink
|
|
181
|
+
class="text-xs font-medium text-primary hover:underline"
|
|
182
|
+
:to="localePath('/account/orders')"
|
|
183
|
+
>
|
|
184
|
+
{{ t('account.dashboard.viewAll') }} →
|
|
185
|
+
</ULink>
|
|
186
|
+
</header>
|
|
187
|
+
<ul
|
|
188
|
+
v-if="recentOrders.length"
|
|
189
|
+
class="divide-y divide-(--ui-border)"
|
|
190
|
+
>
|
|
191
|
+
<li
|
|
192
|
+
v-for="order in recentOrders"
|
|
193
|
+
:key="order.id"
|
|
194
|
+
>
|
|
195
|
+
<NuxtLink
|
|
196
|
+
:to="localePath(`/account/orders/${order.id}`)"
|
|
197
|
+
class="flex flex-wrap items-center gap-x-4 gap-y-1 px-4 sm:px-5 py-3
|
|
198
|
+
hover:bg-elevated/40 transition-colors"
|
|
199
|
+
>
|
|
200
|
+
<span class="text-sm font-semibold text-highlighted">{{ order.id }}</span>
|
|
201
|
+
<span class="text-xs text-muted">{{ formatDate(order.date) }}</span>
|
|
202
|
+
<span class="flex items-center gap-3 ms-auto">
|
|
203
|
+
<UBadge
|
|
204
|
+
:color="statusColors[order.status]"
|
|
205
|
+
variant="subtle"
|
|
206
|
+
size="sm"
|
|
207
|
+
:label="t(`orders.status.${order.status}`)"
|
|
208
|
+
/>
|
|
209
|
+
<span class="text-sm tabular-nums text-highlighted min-w-20 text-right">
|
|
210
|
+
{{ formatCurrency(order.total) }}
|
|
211
|
+
</span>
|
|
212
|
+
</span>
|
|
213
|
+
</NuxtLink>
|
|
214
|
+
</li>
|
|
215
|
+
</ul>
|
|
216
|
+
<p
|
|
217
|
+
v-else
|
|
218
|
+
class="px-4 sm:px-5 py-6 text-sm text-muted"
|
|
219
|
+
>
|
|
220
|
+
{{ t('account.dashboard.noOrders') }}
|
|
221
|
+
</p>
|
|
222
|
+
</section>
|
|
223
|
+
|
|
224
|
+
<section class="border border-(--ui-border) rounded-xl overflow-hidden">
|
|
225
|
+
<header class="flex items-center justify-between px-4 sm:px-5 py-3 bg-elevated/60 border-b border-(--ui-border)">
|
|
226
|
+
<h2 class="text-sm font-semibold text-highlighted">
|
|
227
|
+
{{ t('account.dashboard.openRequisitions') }}
|
|
228
|
+
</h2>
|
|
229
|
+
<ULink
|
|
230
|
+
class="text-xs font-medium text-primary hover:underline"
|
|
231
|
+
:to="localePath('/account/requisitions')"
|
|
232
|
+
>
|
|
233
|
+
{{ t('account.dashboard.viewAll') }} →
|
|
234
|
+
</ULink>
|
|
235
|
+
</header>
|
|
236
|
+
<ul
|
|
237
|
+
v-if="openRequisitions.length"
|
|
238
|
+
class="divide-y divide-(--ui-border)"
|
|
239
|
+
>
|
|
240
|
+
<li
|
|
241
|
+
v-for="requisition in openRequisitions"
|
|
242
|
+
:key="requisition.id"
|
|
243
|
+
>
|
|
244
|
+
<NuxtLink
|
|
245
|
+
:to="localePath(`/account/requisitions/${requisition.id}`)"
|
|
246
|
+
class="flex flex-wrap items-center gap-x-4 gap-y-1 px-4 sm:px-5 py-3
|
|
247
|
+
hover:bg-elevated/40 transition-colors"
|
|
248
|
+
>
|
|
249
|
+
<span class="text-sm font-semibold text-highlighted">{{ requisition.id }}</span>
|
|
250
|
+
<span class="text-xs text-muted">{{ requisition.requestedBy.name }}</span>
|
|
251
|
+
<span class="text-sm tabular-nums text-highlighted ms-auto">
|
|
252
|
+
{{ formatCurrency(requisition.totalValue) }}
|
|
253
|
+
</span>
|
|
254
|
+
</NuxtLink>
|
|
255
|
+
</li>
|
|
256
|
+
</ul>
|
|
257
|
+
<p
|
|
258
|
+
v-else
|
|
259
|
+
class="px-4 sm:px-5 py-6 text-sm text-muted"
|
|
260
|
+
>
|
|
261
|
+
{{ t('account.dashboard.noRequisitions') }}
|
|
262
|
+
</p>
|
|
263
|
+
</section>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<!-- Right column: budgets + quick actions -->
|
|
267
|
+
<div class="space-y-6">
|
|
268
|
+
<section class="border border-(--ui-border) rounded-xl overflow-hidden">
|
|
269
|
+
<header class="flex items-center justify-between px-4 sm:px-5 py-3 bg-elevated/60 border-b border-(--ui-border)">
|
|
270
|
+
<h2 class="text-sm font-semibold text-highlighted">
|
|
271
|
+
{{ t('account.dashboard.budgets') }}
|
|
272
|
+
</h2>
|
|
273
|
+
<ULink
|
|
274
|
+
class="text-xs font-medium text-primary hover:underline"
|
|
275
|
+
:to="localePath('/account/cost-centers')"
|
|
276
|
+
>
|
|
277
|
+
{{ t('account.dashboard.viewAll') }} →
|
|
278
|
+
</ULink>
|
|
279
|
+
</header>
|
|
280
|
+
<ul
|
|
281
|
+
v-if="budgetBars.length"
|
|
282
|
+
class="divide-y divide-(--ui-border)"
|
|
283
|
+
>
|
|
284
|
+
<li
|
|
285
|
+
v-for="bar in budgetBars"
|
|
286
|
+
:key="bar.id"
|
|
287
|
+
class="px-4 sm:px-5 py-3"
|
|
288
|
+
>
|
|
289
|
+
<div class="flex items-baseline justify-between gap-2">
|
|
290
|
+
<p class="text-sm font-medium text-highlighted truncate">
|
|
291
|
+
{{ bar.label }}
|
|
292
|
+
</p>
|
|
293
|
+
<p class="text-xs text-muted tabular-nums shrink-0">
|
|
294
|
+
{{ bar.used }} %
|
|
295
|
+
</p>
|
|
296
|
+
</div>
|
|
297
|
+
<div class="mt-2 h-1.5 rounded-full bg-elevated overflow-hidden">
|
|
298
|
+
<div
|
|
299
|
+
class="h-full rounded-full w-(--budget-used)"
|
|
300
|
+
:class="bar.used >= 90 ? 'bg-warning' : 'bg-primary'"
|
|
301
|
+
:style="{ '--budget-used': `${bar.used}%` }"
|
|
302
|
+
/>
|
|
303
|
+
</div>
|
|
304
|
+
<p class="mt-1.5 text-xs text-muted tabular-nums">
|
|
305
|
+
{{ t('account.dashboard.budgetAvailable', {
|
|
306
|
+
available: formatCurrency(bar.available),
|
|
307
|
+
total: formatCurrency(bar.total),
|
|
308
|
+
}) }}
|
|
309
|
+
</p>
|
|
310
|
+
</li>
|
|
311
|
+
</ul>
|
|
312
|
+
<p
|
|
313
|
+
v-else
|
|
314
|
+
class="px-4 sm:px-5 py-6 text-sm text-muted"
|
|
315
|
+
>
|
|
316
|
+
{{ t('account.dashboard.noBudgets') }}
|
|
317
|
+
</p>
|
|
318
|
+
</section>
|
|
319
|
+
|
|
320
|
+
<section class="border border-(--ui-border) rounded-xl overflow-hidden">
|
|
321
|
+
<h2 class="px-4 sm:px-5 py-3 text-sm font-semibold text-highlighted bg-elevated/60 border-b border-(--ui-border)">
|
|
322
|
+
{{ t('account.dashboard.quickAccess') }}
|
|
323
|
+
</h2>
|
|
324
|
+
<ul class="divide-y divide-(--ui-border)">
|
|
325
|
+
<li
|
|
326
|
+
v-for="action in quickActions"
|
|
327
|
+
:key="action.to"
|
|
328
|
+
>
|
|
329
|
+
<NuxtLink
|
|
330
|
+
:to="localePath(action.to)"
|
|
331
|
+
class="flex items-center gap-3 px-4 sm:px-5 py-3 text-sm text-highlighted
|
|
332
|
+
hover:bg-elevated/40 transition-colors"
|
|
333
|
+
>
|
|
334
|
+
<UIcon
|
|
335
|
+
:name="icon(action.token)"
|
|
336
|
+
class="size-4.5 text-primary shrink-0"
|
|
337
|
+
/>
|
|
338
|
+
<span class="truncate">{{ t(action.labelKey) }}</span>
|
|
339
|
+
<UIcon
|
|
340
|
+
:name="icon('chevron-right')"
|
|
341
|
+
class="size-4 text-dimmed ms-auto shrink-0"
|
|
342
|
+
/>
|
|
343
|
+
</NuxtLink>
|
|
344
|
+
</li>
|
|
345
|
+
</ul>
|
|
346
|
+
</section>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
</template>
|