- {/* Статистика с кнопкой */}
-
-
-
-
-
-
-
Поставок
-
- {filteredSupplies.length}
-
-
-
-
+
+
+ {/* Вкладки товаров */}
+
+
+
+ Новые
+
+
+
+ Приёмка
+
+
+
+ Принято
+
+
-
-
-
-
-
-
-
Стоимость
-
- {formatCurrency(getTotalValue())}
-
-
-
-
+
+
+
-
-
-
-
-
Товаров
-
- {getTotalQuantity()} ед.
-
-
-
-
+
+
+
-
-
-
-
-
-
-
Объём
-
- {getTotalVolume().toFixed(1)} м³
-
-
-
-
-
-
-
-
-
- {/* Фильтры */}
-
-
-
- setSearchTerm(e.target.value)}
- className="glass-input pl-10 text-white placeholder:text-white/40"
- />
-
-
-
-
-
- {/* Список поставок */}
-
-
- {filteredSupplies.map((supply, index) => {
- const isSellerExpanded = expandedSellers.has(supply.seller.id);
- const isSupplyExpanded = expandedSupplies.has(supply.id);
-
- return (
-
-
- {/* Компактный блок с названием магазина */}
-
-
-
-
-
-
-
- {supply.seller.storeName}
-
-
•
-
- {supply.seller.managerName}
-
-
•
-
- {supply.seller.phone}
-
-
•
-
-
-
-
-
-
- Номер поставки
-
-
- {supply.supplyNumber}
-
-
-
-
-
-
- {/* Скрытая детальная информация о магазине */}
- {isSellerExpanded && (
-
-
-
-
- Юридическое название
-
-
- {supply.seller.name}
-
-
-
-
ИНН
-
- {supply.seller.inn}
-
-
-
-
-
Email
-
- {supply.seller.email}
-
-
-
- )}
-
- {/* Единый блок со всеми параметрами в одной строке */}
-
toggleSupplyExpansion(supply.id)}
- >
-
- {/* Порядковый номер */}
-
-
№
-
-
-
- {filteredSupplies.length - index}
-
-
-
-
-
- {/* Дата поставки */}
-
-
Дата
-
- {formatDate(supply.supplyDate)}
-
-
-
- {/* Количество товаров */}
-
-
Товаров
-
- {supply.itemsQuantity}
-
-
-
- {/* Количество мест */}
-
-
Мест
-
- {supply.cargoPlaces}
-
-
-
- {/* Объём */}
-
-
Объём
-
- {supply.volume} м³
-
-
-
- {/* Стоимость */}
-
-
Стоимость
-
- {formatCurrency(supply.totalValue)}
-
-
-
- {/* Ответственный сотрудник */}
-
e.stopPropagation()}
- >
-
- Ответственный
-
-
-
-
- {/* Логистический партнер */}
-
e.stopPropagation()}
- >
-
Логистика
-
-
-
- {/* Статус */}
-
-
Статус
-
- {getStatusBadge(supply.status)}
-
-
-
-
- {/* Второй уровень - Маршруты */}
- {isSupplyExpanded &&
- supply.routes &&
- supply.routes.length > 0 && (
-
-
-
-
- Маршруты ({supply.routes.length})
-
-
-
- {supply.routes.map((route) => {
- const isRouteExpanded = expandedRoutes.has(
- route.id
- );
- return (
-
-
- toggleRouteExpansion(route.id)
- }
- >
- {/* Название маршрута */}
-
-
- Маршрут
-
-
-
- {route.routeName}
-
-
-
-
-
- {/* Откуда */}
-
-
- Откуда
-
-
- {route.fromAddress}
-
-
-
- {/* Куда */}
-
-
- Куда
-
-
- {route.toAddress}
-
-
-
- {/* Расстояние */}
-
-
- Расстояние
-
-
- {route.distance} км
-
-
-
- {/* Время в пути */}
-
-
- Время
-
-
- {route.estimatedTime}
-
-
-
- {/* Транспорт */}
-
-
- Транспорт
-
-
- {route.transportType}
-
-
-
- {/* Стоимость и статус */}
-
-
- Стоимость
-
-
- {formatCurrency(route.cost)}
-
- {getRouteStatusBadge(route.status)}
-
-
-
- {/* Третий уровень - Поставщики/Оптовики */}
- {isRouteExpanded &&
- route.suppliers &&
- route.suppliers.length > 0 && (
-
-
-
-
- Поставщики/Оптовики (
- {route.suppliers.length})
-
-
-
- {route.suppliers.map((supplier) => {
- const isSupplierExpanded =
- expandedSuppliers.has(
- supplier.id
- );
- return (
-
-
- toggleSupplierExpansion(
- supplier.id
- )
- }
- >
- {/* Название поставщика */}
-
-
- Поставщик
-
-
-
- {supplier.name}
-
-
-
-
-
- {/* ИНН */}
-
-
- ИНН
-
-
- {supplier.inn}
-
-
-
- {/* Тип */}
-
-
- Тип
-
-
- {supplier.type ===
- "WHOLESALE"
- ? "Оптовик"
- : "Поставщик"}
-
-
-
- {/* Менеджер */}
-
-
- Менеджер
-
-
- {supplier.managerName}
-
-
-
- {/* Стоимость */}
-
-
- Стоимость
-
-
- {formatCurrency(
- supplier.totalValue
- )}
-
-
-
- {/* Статус */}
-
-
- Статус
-
- {getSupplierStatusBadge(
- supplier.status
- )}
-
-
-
- {/* Детальная информация о поставщике */}
- {isSupplierExpanded && (
-
-
-
-
- Полное название
-
-
- {supplier.fullName ||
- supplier.name}
-
-
-
-
- Телефон
-
-
-
- {supplier.phone}
-
-
-
-
-
-
- Email
-
-
- {supplier.email}
-
-
-
-
-
- Адрес
-
-
- {supplier.address}
-
-
-
- )}
-
- );
- })}
-
-
- )}
-
- );
- })}
-
-
- )}
-
-
-
- );
- })}
-
-
+
+
+
+
);
+
+ function TabContent({ tabName }: { tabName: string }) {
+ const tabFilteredSupplies = getFilteredSuppliesByTab(tabName);
+
+ const getTabTotalValue = () => {
+ return tabFilteredSupplies.reduce(
+ (sum, supply) => sum + supply.totalValue,
+ 0
+ );
+ };
+
+ const getTabTotalQuantity = () => {
+ return tabFilteredSupplies.reduce(
+ (sum, supply) => sum + supply.itemsQuantity,
+ 0
+ );
+ };
+
+ const getTabTotalVolume = () => {
+ return tabFilteredSupplies.reduce(
+ (sum, supply) => sum + supply.volume,
+ 0
+ );
+ };
+
+ return (
+
+ {/* Статистика с кнопкой */}
+
+
+
+
+
+
+
Поставок
+
+ {tabFilteredSupplies.length}
+
+
+
+
+
+
+
+
+
+
+
+
Стоимость
+
+ {formatCurrency(getTabTotalValue())}
+
+
+
+
+
+
+
+
+
+
Товаров
+
+ {getTabTotalQuantity()} ед.
+
+
+
+
+
+
+
+
+
+
+
+
Объём
+
+ {getTabTotalVolume().toFixed(1)} м³
+
+
+
+
+
+
+
+
+
+ {/* Фильтры */}
+
+
+
+ setSearchTerm(e.target.value)}
+ className="glass-input pl-10 text-white placeholder:text-white/40"
+ />
+
+
+
+
+
+ {/* Список поставок */}
+
+
+ {tabFilteredSupplies.map((supply, index) => {
+ const isSellerExpanded = expandedSellers.has(supply.seller.id);
+ const isSupplyExpanded = expandedSupplies.has(supply.id);
+
+ return (
+
+
+ {/* Компактный блок с названием магазина */}
+
+
+
+
+
+
+
+ {supply.seller.storeName}
+
+
•
+
+ {supply.seller.managerName}
+
+
•
+
+ {supply.seller.phone}
+
+
•
+
+
+
+
+
+
+ Номер поставки
+
+
+ {supply.supplyNumber}
+
+
+
+
+
+
+ {/* Скрытая детальная информация о магазине */}
+ {isSellerExpanded && (
+
+
+
+
+ Юридическое название
+
+
+ {supply.seller.name}
+
+
+
+
ИНН
+
+ {supply.seller.inn}
+
+
+
+
+
Email
+
+ {supply.seller.email}
+
+
+
+ )}
+
+ {/* Единый блок со всеми параметрами в одной строке */}
+
toggleSupplyExpansion(supply.id)}
+ >
+
+ {/* Порядковый номер */}
+
+
№
+
+
+
+ {tabFilteredSupplies.length - index}
+
+
+
+
+
+ {/* Дата поставки */}
+
+
Дата
+
+ {formatDate(supply.supplyDate)}
+
+
+
+ {/* Количество товаров */}
+
+
Товаров
+
+ {supply.itemsQuantity}
+
+
+
+ {/* Количество мест */}
+
+
Мест
+
+ {supply.cargoPlaces}
+
+
+
+ {/* Объём */}
+
+
Объём
+
+ {supply.volume} м³
+
+
+
+ {/* Стоимость */}
+
+
+ Стоимость
+
+
+ {formatCurrency(supply.totalValue)}
+
+
+
+ {/* Ответственный сотрудник */}
+
e.stopPropagation()}
+ >
+
+ Ответственный
+
+
+
+
+ {/* Логистический партнер */}
+
e.stopPropagation()}
+ >
+
+ Логистика
+
+
+
+
+ {/* Статус */}
+
+
Статус
+
+ {getStatusBadge(supply.status)}
+
+
+
+
+ {/* Второй уровень - Маршруты */}
+ {isSupplyExpanded &&
+ supply.routes &&
+ supply.routes.length > 0 && (
+
+
+
+
+ Маршруты ({supply.routes.length})
+
+
+
+ {supply.routes.map((route) => {
+ const isRouteExpanded = expandedRoutes.has(
+ route.id
+ );
+ return (
+
+
+ toggleRouteExpansion(route.id)
+ }
+ >
+ {/* Название маршрута */}
+
+
+ Маршрут
+
+
+
+ {route.routeName}
+
+
+
+
+
+ {/* Откуда */}
+
+
+ Откуда
+
+
+ {route.fromAddress}
+
+
+
+ {/* Куда */}
+
+
+ Куда
+
+
+ {route.toAddress}
+
+
+
+ {/* Расстояние */}
+
+
+ Расстояние
+
+
+ {route.distance} км
+
+
+
+ {/* Время в пути */}
+
+
+ Время
+
+
+ {route.estimatedTime}
+
+
+
+ {/* Транспорт */}
+
+
+ Транспорт
+
+
+ {route.transportType}
+
+
+
+ {/* Стоимость и статус */}
+
+
+ Стоимость
+
+
+ {formatCurrency(route.cost)}
+
+ {getRouteStatusBadge(route.status)}
+
+
+
+ {/* Третий уровень - Поставщики/Оптовики */}
+ {isRouteExpanded &&
+ route.suppliers &&
+ route.suppliers.length > 0 && (
+
+
+
+
+ Поставщики/Оптовики (
+ {route.suppliers.length})
+
+
+
+ {route.suppliers.map((supplier) => {
+ const isSupplierExpanded =
+ expandedSuppliers.has(
+ supplier.id
+ );
+ return (
+
+
+ toggleSupplierExpansion(
+ supplier.id
+ )
+ }
+ >
+ {/* Название поставщика */}
+
+
+ Поставщик
+
+
+
+ {supplier.name}
+
+
+
+
+
+ {/* ИНН */}
+
+
+ ИНН
+
+
+ {supplier.inn}
+
+
+
+ {/* Тип */}
+
+
+ Тип
+
+
+ {supplier.type ===
+ "WHOLESALE"
+ ? "Оптовик"
+ : "Поставщик"}
+
+
+
+ {/* Менеджер */}
+
+
+ Менеджер
+
+
+ {supplier.managerName}
+
+
+
+ {/* Стоимость */}
+
+
+ Стоимость
+
+
+ {formatCurrency(
+ supplier.totalValue
+ )}
+
+
+
+ {/* Статус */}
+
+
+ Статус
+
+ {getSupplierStatusBadge(
+ supplier.status
+ )}
+
+
+
+ {/* Детальная информация о поставщике */}
+ {isSupplierExpanded && (
+
+
+
+
+ Полное название
+
+
+ {supplier.fullName ||
+ supplier.name}
+
+
+
+
+ Телефон
+
+
+
+ {supplier.phone}
+
+
+
+
+
+
+ Email
+
+
+ {supplier.email}
+
+
+
+
+
+ Адрес
+
+
+ {supplier.address}
+
+
+
+ )}
+
+ );
+ })}
+
+
+ )}
+
+ );
+ })}
+
+
+ )}
+
+
+
+ );
+ })}
+
+
+
+ );
+ }
}
diff --git a/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-supplies-tab.tsx b/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-supplies-tab.tsx
index 14d8352..a1885fc 100644
--- a/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-supplies-tab.tsx
+++ b/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-supplies-tab.tsx
@@ -35,7 +35,7 @@ export function FulfillmentSuppliesTab() {
className="data-[state=active]:bg-white/20 data-[state=active]:text-white text-white/70 flex items-center gap-1 text-xs"
>
- Расходники (название текущего кабинета)
+ Наши расходники