Modules

Orders

The order list with views, late orders, fulfilment progress, a quick view and the order detail page.

composables/useOrders.ts
View in the demo

Orders carry channel, shippingMethod, an optional card (brand and last 4), discount, estimatedDelivery, gift and note. They are built from the customers and products mocks, so every line points to a real product.

Files

File
Role
pages/e-commerce/orders/index.vueThe list.
pages/e-commerce/orders/[id].vueThe order detail; 404 when the id does not exist.
composables/useOrders.tsOrders, statuses and tones, totals, lines and the next status.
types/models/orders.tsOrders, events, totals.
config/orders.config.tsViews, channel icons and dispatch and delivery windows.
utils/orders.tsPure rules, unit tested.
components/pages/orders/OrderProductStack, OrderFulfillment, OrderTracker, OrderQuickView, OrderItemsCard, OrderPaymentMethod, OrderStatusCard, OrderActivityCard, OrderDetailsAside.

Data

useOrders() loads its data through a OrdersProvider (types/models/orders.ts); the demo uses createOrdersMockProvider(). Write a provider that calls your API and make it the default: the pages do not change. See Connect your API.

Permissions

The list and the detail need orders.view.

Configuration

ORDER_VIEWS

The views of the list.

config/orders.config.ts
const ORDER_VIEWS: OrderView[]

ORDER_URGENT_VIEWS

Views whose count turns red when it is not zero.

config/orders.config.ts
const ORDER_URGENT_VIEWS: OrderView[]

ORDER_STEPS

The fulfilment steps of the tracker.

config/orders.config.ts
const ORDER_STEPS: OrderStep[]

ORDER_CHANNEL_ICONS

The icon of each sales channel.

config/orders.config.ts
const ORDER_CHANNEL_ICONS: Record<OrderChannel, string>

ORDER_DISPATCH_HOURS

Hours to dispatch an order before it is late.

config/orders.config.ts
const ORDER_DISPATCH_HOURS: Record<OrderShippingMethod, number>

ORDER_DELIVERY_HOURS

Delivery hours per shipping method.

config/orders.config.ts
const ORDER_DELIVERY_HOURS: Record<OrderShippingMethod, number>

Rules

Pure functions in utils/, unit tested in tests/unit/. Statuses and segments are derived from the stored data, never stored themselves.

orderStepIndex()

The fulfilment step.

utils/orders.ts
orderStepIndex(order: Pick<Order, 'status'>): number

orderDispatchDue()

When it must be dispatched.

utils/orders.ts
orderDispatchDue(order: Order): string

isOrderLate()

Whether it is late.

utils/orders.ts
isOrderLate(order: Order, now: Date): boolean

matchesOrderView()

Whether it belongs to a view.

utils/orders.ts
matchesOrderView(order: Pick<Order, 'status' | 'paymentStatus'>, view: OrderView): boolean

orderViewCounts()

The count of every view.

utils/orders.ts
orderViewCounts(orders: Pick<Order, 'status' | 'paymentStatus'>[]): Record<OrderView, number>

orderAttention()

Orders that need attention.

utils/orders.ts
orderAttention(orders: Order[], now: Date): { late: number; unpaid: number; }
Returnslateunpaid

How it works

  • Operational screens have no KPI cards: analytics live in the dashboards. A warning BaseAlert appears only when something needs attention, and its action filters the table.
  • The table toolbar starts with the views as a BaseToggleGroup compact fit; urgent counts turn red through countColor.
  • Columns: order (id, channel and relative date), customer (country, city and segment), products (OrderProductStack), total with payment method and status, and delivery (OrderFulfillment: a BaseStepProgress plus express, late and gift chips).
  • Clicking a row opens OrderQuickView, a BaseQuickView with OrderTracker, tracking, lines, totals, customer and the next-status action. The id links to the detail page. It starts with OrderStatusCard: the payment chip, a headline and a sentence from orderSummary() (waiting for payment, ready to prepare, dispatch or delivery late, delivered…) with its date, the actions (mark as paid, next status, refund) and the tracker. Below come the items and OrderActivityCard, which merges the events with the team notes added through addComment(); the side column is one OrderDetailsAside card with the customer, shipping, the customer note and the payment.
  • Status tones for BaseStatusChip are ORDER_STATUS_TONES and ORDER_PAYMENT_TONES.
© 2026 melsami UI.
Developer documentation for melsami UI.