From a764213a77d03b40c5adb63d0b25d15daa2eca45 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 May 2026 14:16:00 +0000 Subject: [PATCH] feat: logistics board as grouped tables with column headers --- .../logistics/LogisticsReadinessBoard.jsx | 112 +++++++++--------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/components/logistics/LogisticsReadinessBoard.jsx b/src/components/logistics/LogisticsReadinessBoard.jsx index 4c0b4de..ca5301b 100644 --- a/src/components/logistics/LogisticsReadinessBoard.jsx +++ b/src/components/logistics/LogisticsReadinessBoard.jsx @@ -9,16 +9,7 @@ import { import { Badge } from "../UI/Badge"; import { Panel } from "../UI/Panel"; import { OrderFilters } from "../orders/OrderFilters"; - -const renderOrderNumbersCompact = (group) => { - if (!Array.isArray(group.orderNumbers) || !group.orderNumbers.length) { - return null; - } - const text = group.orderNumbers.length <= 3 - ? group.orderNumbers.join(", ") - : group.orderNumbers.slice(0, 3).join(", ") + ` +${group.orderNumbers.length - 3}`; - return {text}; -}; +import { formatDateTime } from "../../utils/formatters"; export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusOptions = ORDER_GROUP_DISPLAY_STATUS_OPTIONS }) => { const [filters, setFilters] = React.useState({ query: "", displayStatus: "all" }); @@ -60,6 +51,19 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO const totalGroups = filteredGroups.length; + const TableHeader = () => ( + + + Клиент + Телефон + Дата доставки + Заказы + Статус + Обновлён + + + ); + return (
@@ -82,7 +86,7 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO По этому поиску ничего не найдено.
) : ( -
+
{Array.from(statusGroups.entries()).sort(([a], [b]) => { const idxA = FUNNEL_ORDER.indexOf(a); const idxB = FUNNEL_ORDER.indexOf(b); @@ -94,10 +98,10 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO const isCollapsed = collapsedSections.has(statusValue); return ( -
+ - {!isCollapsed && groups.map((group) => ( - - ))} -
+ {!isCollapsed && ( +
+ + + + {groups.map((group) => ( + { if (onSelectSet) onSelectSet(group.id); }} + > + + + + + + + + ))} + +
+
{group.displayTitle || group.customerName || group.groupKey}
+
{group.customerPhone || "—"}
+
{group.deliveryDate || "—"}
+
+ {group.customerPhone || "—"} + + {group.deliveryDate + ? {group.deliveryDate}{group.deliveryTime ? · {group.deliveryTime} : ""} + : + } + + {group.ordersCount || 0} {group.ordersCount === 1 ? "заказ" : group.ordersCount < 5 ? "заказа" : "заказов"} + + {getOrderGroupDisplayStatusLabel(group)} + + {formatDateTime(group.updatedAt)} +
+
+ )} + ); })}