Refine order code and calendar cards

This commit is contained in:
Ruslan Bakiev
2026-04-04 15:27:00 +07:00
parent 309d0e78db
commit e20565b4ae
6 changed files with 167 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ import {
OrderDetailDocument,
type OrderDetailQuery,
} from '~/composables/graphql/generated';
import { formatOrderCode } from '~/composables/useOrderCodePresentation';
import {
orderDeliveryStateText,
orderLogisticsStateText,
@@ -20,6 +21,8 @@ const orderQuery = useQuery(OrderDetailDocument, () => ({
const currentOrder = computed<OrderItem | null>(() =>
orderQuery.result.value?.order ?? null,
);
const currentOrderCode = computed(() => formatOrderCode(currentOrder.value?.code));
</script>
<template>
@@ -37,7 +40,7 @@ const currentOrder = computed<OrderItem | null>(() =>
<template v-else>
<div class="manager-hero">
<p class="manager-eyebrow">Заказ</p>
<h1 class="manager-title">{{ currentOrder.code }}</h1>
<h1 class="manager-title">{{ currentOrderCode }}</h1>
</div>
<div class="space-y-4">

View File

@@ -4,6 +4,7 @@ import {
MyOrdersDocument,
type MyOrdersQuery,
} from '~/composables/graphql/generated';
import { formatOrderCode } from '~/composables/useOrderCodePresentation';
type OrderItem = MyOrdersQuery['myOrders'][number];
@@ -34,6 +35,7 @@ const filteredOrders = computed(() => {
return orders.filter((order) => {
const text = [
order.code,
formatOrderCode(order.code),
...order.items.map((item) => item.productName),
]
.join(' ')