diff --git a/src/app/api/events/route.ts b/src/app/api/events/route.ts index 287ef52..a843f11 100644 --- a/src/app/api/events/route.ts +++ b/src/app/api/events/route.ts @@ -63,7 +63,7 @@ export async function GET(req: NextRequest) { // Heartbeat to keep connection alive const intervalId = setInterval(() => { try { - controller.enqueue(encoder.encode(`:\n\n`)) + controller.enqueue(encoder.encode(':\n\n')) } catch (e) { clearInterval(intervalId) } diff --git a/src/app/api/graphql/route.ts b/src/app/api/graphql/route.ts index 4c91228..d17101b 100644 --- a/src/app/api/graphql/route.ts +++ b/src/app/api/graphql/route.ts @@ -25,20 +25,20 @@ const server = new ApolloServer({ operationType, operationName, timestamp: new Date().toISOString(), - variables: requestContext.request.variables + variables: requestContext.request.variables, }) }, didEncounterErrors(requestContext) { console.error('❌ GraphQL ERROR:', { errors: requestContext.errors?.map(e => e.message), operationName: requestContext.request.operationName, - timestamp: new Date().toISOString() + timestamp: new Date().toISOString(), }) - } + }, } - } - } - ] + }, + }, + ], }) // Создаем Next.js handler diff --git a/src/components/fulfillment-supplies/fulfillment-supplies-dashboard.tsx b/src/components/fulfillment-supplies/fulfillment-supplies-dashboard.tsx index 6bf82db..599de19 100644 --- a/src/components/fulfillment-supplies/fulfillment-supplies-dashboard.tsx +++ b/src/components/fulfillment-supplies/fulfillment-supplies-dashboard.tsx @@ -6,8 +6,8 @@ import React, { useState } from 'react' import { Sidebar } from '@/components/dashboard/sidebar' import { GET_PENDING_SUPPLIES_COUNT } from '@/graphql/queries' -import { useSidebar } from '@/hooks/useSidebar' import { useRealtime } from '@/hooks/useRealtime' +import { useSidebar } from '@/hooks/useSidebar' // Импорты компонентов подразделов import { FulfillmentConsumablesOrdersTab } from './fulfillment-supplies/fulfillment-consumables-orders-tab' diff --git a/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-detailed-supplies-tab.tsx b/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-detailed-supplies-tab.tsx index 09b7168..db6fcdd 100644 --- a/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-detailed-supplies-tab.tsx +++ b/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-detailed-supplies-tab.tsx @@ -137,12 +137,12 @@ const formatCurrency = (amount: number) => { } // Функция для форматирования даты -const formatDate = (dateString: string) => { +const _formatDate = (dateString: string) => { return new Date(dateString).toLocaleDateString('ru-RU') } // Функция для отображения статуса -const getStatusBadge = (status: string) => { +const _getStatusBadge = (status: string) => { const statusConfig = { PENDING: { label: 'Ожидает одобрения поставщика', @@ -217,7 +217,7 @@ export function FulfillmentDetailedSuppliesTab() { // Получаем поставки с многоуровневой структурой для фулфилмента // Фильтруем поставки где мы являемся получателем (фулфилмент-центром) // И это расходники фулфилмента (FULFILLMENT_CONSUMABLES) - const ourSupplyOrders: SupplyOrder[] = (data?.mySupplyOrders || []).filter((order: any) => { + const ourSupplyOrders: SupplyOrder[] = (data?.mySupplyOrders || []).filter((order: SupplyOrder) => { // Проверяем что order существует и имеет нужные поля if (!order || !order.fulfillmentCenterId) return false @@ -246,11 +246,11 @@ export function FulfillmentDetailedSuppliesTab() { break case 'cancel': // Отменить поставку (если разрешено) - console.log('Отмена поставки:', supplyId) + console.warn('Отмена поставки:', supplyId) toast.info('Функция отмены поставки в разработке') break default: - console.log('Неизвестное действие фулфилмента:', action, supplyId) + console.warn('Неизвестное действие фулфилмента:', action, supplyId) } } catch (error) { console.error('Ошибка при выполнении действия фулфилмента:', error) @@ -260,7 +260,7 @@ export function FulfillmentDetailedSuppliesTab() { // Функция для приема заказа фулфилментом - const handleReceiveOrder = async (orderId: string) => { + const _handleReceiveOrder = async (orderId: string) => { try { await fulfillmentReceiveOrder({ variables: { id: orderId }, diff --git a/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-goods-orders-tab.tsx b/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-goods-orders-tab.tsx index d630979..d0d0a17 100644 --- a/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-goods-orders-tab.tsx +++ b/src/components/fulfillment-supplies/fulfillment-supplies/fulfillment-goods-orders-tab.tsx @@ -18,6 +18,7 @@ import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Card } from '@/components/ui/card' import { Separator } from '@/components/ui/separator' +import { ASSIGN_LOGISTICS_TO_SUPPLY } from '@/graphql/mutations' import { GET_SUPPLY_ORDERS, GET_MY_EMPLOYEES, @@ -26,7 +27,6 @@ import { GET_PENDING_SUPPLIES_COUNT, GET_WAREHOUSE_PRODUCTS, } from '@/graphql/queries' -import { ASSIGN_LOGISTICS_TO_SUPPLY } from '@/graphql/mutations' import { useAuth } from '@/hooks/useAuth' interface SupplyOrder { diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StatCard.tsx b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StatCard.tsx index 8880d06..2289608 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StatCard.tsx +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StatCard.tsx @@ -1,6 +1,7 @@ 'use client' import { TrendingUp, TrendingDown } from 'lucide-react' + import { Card } from '@/components/ui/card' interface StatCardProps { diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StoreDataTableBlock.tsx b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StoreDataTableBlock.tsx index 7e37ffa..05e153d 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StoreDataTableBlock.tsx +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/StoreDataTableBlock.tsx @@ -1,5 +1,5 @@ -import React from 'react' import { ChevronDown, ChevronRight, Eye } from 'lucide-react' +import React from 'react' import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { Button } from '@/components/ui/button' diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/TableHeadersBlock.tsx b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/TableHeadersBlock.tsx index 4823ab8..2363e08 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/TableHeadersBlock.tsx +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/TableHeadersBlock.tsx @@ -1,10 +1,10 @@ -import React from 'react' import { Search } from 'lucide-react' +import React from 'react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' -import { TableHeader } from '../components/TableHeader' +import { TableHeader } from '../components/TableHeader' import type { TableHeadersBlockProps, StoreDataField } from '../types' /** diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/WarehouseStatsBlock.tsx b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/WarehouseStatsBlock.tsx index 3f2bedd..ce7c4a9 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/WarehouseStatsBlock.tsx +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/blocks/WarehouseStatsBlock.tsx @@ -1,8 +1,7 @@ -import React from 'react' import { Package, Box, AlertTriangle, RotateCcw, Users, Wrench } from 'lucide-react' +import React from 'react' import { StatCard } from '../components/StatCard' - import type { WarehouseStatsBlockProps } from '../types' /** @@ -19,7 +18,7 @@ import type { WarehouseStatsBlockProps } from '../types' export const WarehouseStatsBlock = React.memo(({ warehouseStats, warehouseStatsData, - isStatsLoading + isStatsLoading, }) => { return (
diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useStoreData.ts b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useStoreData.ts index c43811b..08eda80 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useStoreData.ts +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useStoreData.ts @@ -19,7 +19,7 @@ export function useStoreData( sellerSupplies: any[], searchTerm: string, sortField: StoreDataField, - sortOrder: 'asc' | 'desc' + sortOrder: 'asc' | 'desc', ): UseStoreDataReturn { // === СОЗДАНИЕ СТРУКТУРИРОВАННЫХ ДАННЫХ СКЛАДА === @@ -206,7 +206,7 @@ export function useStoreData( // Фильтрация по поисковому термину if (searchTerm) { filtered = filtered.filter(store => - store.name.toLowerCase().includes(searchTerm.toLowerCase()) + store.name.toLowerCase().includes(searchTerm.toLowerCase()), ) } @@ -258,7 +258,7 @@ export function useStoreData( defectsChange: 0, sellerSuppliesChange: 0, pvzReturnsChange: 0, - } + }, ) }, [filteredAndSortedStores]) diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useWarehouseStats.ts b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useWarehouseStats.ts index ed58ea6..ab0933c 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useWarehouseStats.ts +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/hooks/useWarehouseStats.ts @@ -15,7 +15,7 @@ export function useWarehouseStats( supplyOrders: any[], warehouseStatsData: any, warehouseStatsLoading: boolean, - sellerSupplies: any[] = [] + sellerSupplies: any[] = [], ): UseWarehouseStatsReturn { // === РАСЧЕТ ПОСТУПЛЕНИЙ РАСХОДНИКОВ ЗА СУТКИ === diff --git a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/index.tsx b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/index.tsx index 17161a3..adea559 100644 --- a/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/index.tsx +++ b/src/components/fulfillment-warehouse/fulfillment-warehouse-dashboard/index.tsx @@ -47,10 +47,11 @@ import { GET_SUPPLY_MOVEMENTS, // Движения товаров (прибыло/убыло) } from '@/graphql/queries' import { useAuth } from '@/hooks/useAuth' -import { useSidebar } from '@/hooks/useSidebar' import { useRealtime } from '@/hooks/useRealtime' +import { useSidebar } from '@/hooks/useSidebar' import { WbReturnClaims } from '../wb-return-claims' + import { StatCard } from './blocks/StatCard' // Типы данных для 3-уровневой иерархии @@ -284,37 +285,37 @@ export function FulfillmentWarehouseDashboard() { current: stats.products?.current || 0, change: stats.products?.change || 0, arrived: movements?.arrived?.products || 0, - departed: movements?.departed?.products || 0 + departed: movements?.departed?.products || 0, }, goods: { current: stats.goods?.current || 0, change: stats.goods?.change || 0, arrived: movements?.arrived?.goods || 0, - departed: movements?.departed?.goods || 0 + departed: movements?.departed?.goods || 0, }, defects: { current: stats.defects?.current || 0, change: stats.defects?.change || 0, arrived: movements?.arrived?.defects || 0, - departed: movements?.departed?.defects || 0 + departed: movements?.departed?.defects || 0, }, pvzReturns: { current: stats.pvzReturns?.current || 0, change: stats.pvzReturns?.change || 0, arrived: movements?.arrived?.pvzReturns || 0, - departed: movements?.departed?.pvzReturns || 0 + departed: movements?.departed?.pvzReturns || 0, }, fulfillmentSupplies: { current: stats.fulfillmentSupplies?.current || 0, change: stats.fulfillmentSupplies?.change || 0, arrived: movements?.arrived?.fulfillmentSupplies || 0, - departed: movements?.departed?.fulfillmentSupplies || 0 + departed: movements?.departed?.fulfillmentSupplies || 0, }, sellerSupplies: { current: stats.sellerSupplies?.current || 0, change: stats.sellerSupplies?.change || 0, arrived: movements?.arrived?.sellerSupplies || 0, - departed: movements?.departed?.sellerSupplies || 0 + departed: movements?.departed?.sellerSupplies || 0, }, } } @@ -329,37 +330,37 @@ export function FulfillmentWarehouseDashboard() { current: warehouseProducts.filter((p: any) => p.type === 'PRODUCT').length, change: 0, arrived: movements?.arrived?.products || 0, - departed: movements?.departed?.products || 0 + departed: movements?.departed?.products || 0, }, goods: { current: warehouseProducts.filter((p: any) => p.type === 'GOODS').length, change: 0, arrived: movements?.arrived?.goods || 0, - departed: movements?.departed?.goods || 0 + departed: movements?.departed?.goods || 0, }, defects: { current: warehouseProducts.filter((p: any) => p.type === 'DEFECTS').length, change: 0, arrived: movements?.arrived?.defects || 0, - departed: movements?.departed?.defects || 0 + departed: movements?.departed?.defects || 0, }, pvzReturns: { current: warehouseProducts.filter((p: any) => p.type === 'PVZ_RETURNS').length, change: 0, arrived: movements?.arrived?.pvzReturns || 0, - departed: movements?.departed?.pvzReturns || 0 + departed: movements?.departed?.pvzReturns || 0, }, fulfillmentSupplies: { current: fulfillmentSupplies.length, change: 0, arrived: movements?.arrived?.fulfillmentSupplies || 0, - departed: movements?.departed?.fulfillmentSupplies || 0 + departed: movements?.departed?.fulfillmentSupplies || 0, }, sellerSupplies: { current: sellerSupplies.length, change: 0, arrived: movements?.arrived?.sellerSupplies || 0, - departed: movements?.departed?.sellerSupplies || 0 + departed: movements?.departed?.sellerSupplies || 0, }, } }, [warehouseStatsData, warehouseData, sellerSuppliesData, fulfillmentSuppliesData, supplyMovementsData]) @@ -448,7 +449,7 @@ export function FulfillmentWarehouseDashboard() { sellerSuppliesQuantity: 0, pvzReturnsQuantity: 0, sellerSuppliesOwners: [], - variants: [] + variants: [], } } @@ -464,7 +465,7 @@ export function FulfillmentWarehouseDashboard() { // КРИТИЧНО: Группировка расходников селлера по ВЛАДЕЛЬЦУ (не по названию!) const sellerSuppliesForThisSeller = sellerSupplies.filter((supply: any) => supply.type === 'SELLER_CONSUMABLES' && - supply.sellerId === sellerId + supply.sellerId === sellerId, ) console.warn(`📦 Расходники для селлера ${sellerName}:`, sellerSuppliesForThisSeller.length) @@ -484,7 +485,7 @@ export function FulfillmentWarehouseDashboard() { sellerSuppliesQuantity: 0, pvzReturnsQuantity: 0, sellerSuppliesOwners: [ownerKey], - variants: [] + variants: [], } } @@ -504,7 +505,7 @@ export function FulfillmentWarehouseDashboard() { sellerSupplies: acc.sellerSupplies + (item.sellerSuppliesQuantity || 0), pvzReturns: acc.pvzReturns + (item.pvzReturnsQuantity || 0), }), - { products: 0, goods: 0, defects: 0, sellerSupplies: 0, pvzReturns: 0 } + { products: 0, goods: 0, defects: 0, sellerSupplies: 0, pvzReturns: 0 }, ) console.warn(`📊 Итоги для ${sellerName}:`, totals) @@ -541,7 +542,7 @@ export function FulfillmentWarehouseDashboard() { if (searchTerm) { filtered = filtered.filter((store) => - store.name.toLowerCase().includes(searchTerm.toLowerCase()) + store.name.toLowerCase().includes(searchTerm.toLowerCase()), ) } @@ -573,7 +574,7 @@ export function FulfillmentWarehouseDashboard() { sellerSupplies: acc.sellerSupplies + store.sellerSupplies, pvzReturns: acc.pvzReturns + store.pvzReturns, }), - { products: 0, goods: 0, defects: 0, sellerSupplies: 0, pvzReturns: 0 } + { products: 0, goods: 0, defects: 0, sellerSupplies: 0, pvzReturns: 0 }, ) }, [filteredAndSortedStores]) diff --git a/src/components/market/market-business.tsx.backup b/src/components/market/market-business.tsx.backup new file mode 100644 index 0000000..15f909b --- /dev/null +++ b/src/components/market/market-business.tsx.backup @@ -0,0 +1,57 @@ +'use client' + +import { Building, Users, Target, Briefcase } from 'lucide-react' + +import { Card } from '@/components/ui/card' + +export function MarketBusiness() { + return ( +
+ {/* Заголовок с иконкой */} +
+ +
+

Бизнес

+

Бизнес-возможности и развитие

+
+
+ + {/* Контент раздела */} +
+
+ +
+ +

Франшизы

+
+

Готовые бизнес-решения и франшизы в сфере логистики и торговли

+
+ + +
+ +

Партнёрство

+
+

Поиск бизнес-партнёров для совместных проектов и развития

+
+ + +
+ +

Консалтинг

+
+

Бизнес-консультации и стратегическое планирование развития

+
+
+ +
+
+ +
+

Раздел в разработке

+

Бизнес-функционал будет доступен в ближайших обновлениях

+
+
+
+ ) +} diff --git a/src/components/market/market-investments.tsx.backup b/src/components/market/market-investments.tsx.backup new file mode 100644 index 0000000..2078ee2 --- /dev/null +++ b/src/components/market/market-investments.tsx.backup @@ -0,0 +1,61 @@ +'use client' + +import { TrendingUp, DollarSign, BarChart3 } from 'lucide-react' + +import { Card } from '@/components/ui/card' + +export function MarketInvestments() { + return ( +
+ {/* Заголовок с иконкой */} +
+ +
+

Инвестиции

+

Инвестиционные возможности и проекты

+
+
+ + {/* Контент раздела */} +
+
+ +
+ +

Инвестиционные проекты

+
+

+ Поиск и анализ перспективных инвестиционных проектов в сфере логистики и e-commerce +

+
+ + +
+ +

Аналитика рынка

+
+

+ Исследования и аналитические отчёты для принятия инвестиционных решений +

+
+ + +
+ +

Доходность

+
+

Отслеживание доходности инвестиций и планирование бюджета

+
+
+ +
+
+ +
+

Раздел в разработке

+

Функционал инвестиций будет доступен в ближайших обновлениях

+
+
+
+ ) +} diff --git a/src/components/messenger/messenger-chat.tsx b/src/components/messenger/messenger-chat.tsx index 3c26970..d4d70b9 100644 --- a/src/components/messenger/messenger-chat.tsx +++ b/src/components/messenger/messenger-chat.tsx @@ -22,9 +22,9 @@ import { } from '@/graphql/mutations' import { GET_MESSAGES, GET_CONVERSATIONS } from '@/graphql/queries' import { useAuth } from '@/hooks/useAuth' +import { useRealtime } from '@/hooks/useRealtime' import { MessengerAttachments } from './messenger-attachments' -import { useRealtime } from '@/hooks/useRealtime' interface Organization { id: string diff --git a/src/components/messenger/messenger-dashboard.tsx b/src/components/messenger/messenger-dashboard.tsx index dc00b29..a26b599 100644 --- a/src/components/messenger/messenger-dashboard.tsx +++ b/src/components/messenger/messenger-dashboard.tsx @@ -9,8 +9,8 @@ import { Sidebar } from '@/components/dashboard/sidebar' import { Button } from '@/components/ui/button' import { Card } from '@/components/ui/card' import { GET_CONVERSATIONS, GET_MY_COUNTERPARTIES } from '@/graphql/queries' -import { useSidebar } from '@/hooks/useSidebar' import { useRealtime } from '@/hooks/useRealtime' +import { useSidebar } from '@/hooks/useSidebar' import { MessengerChat } from './messenger-chat' import { MessengerConversations } from './messenger-conversations' diff --git a/src/components/partners/partners-dashboard.tsx b/src/components/partners/partners-dashboard.tsx index ed82f1c..9cc990e 100644 --- a/src/components/partners/partners-dashboard.tsx +++ b/src/components/partners/partners-dashboard.tsx @@ -6,8 +6,8 @@ import { Sidebar } from '@/components/dashboard/sidebar' import { Card } from '@/components/ui/card' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { GET_INCOMING_REQUESTS } from '@/graphql/queries' -import { useSidebar } from '@/hooks/useSidebar' import { useRealtime } from '@/hooks/useRealtime' +import { useSidebar } from '@/hooks/useSidebar' import { MarketCounterparties } from '../market/market-counterparties' import { MarketFulfillment } from '../market/market-fulfillment' diff --git a/src/components/supplier-orders/supplier-orders-tabs.tsx b/src/components/supplier-orders/supplier-orders-tabs.tsx index bf4a685..ac86434 100644 --- a/src/components/supplier-orders/supplier-orders-tabs.tsx +++ b/src/components/supplier-orders/supplier-orders-tabs.tsx @@ -3,18 +3,19 @@ import { useQuery, useMutation } from '@apollo/client' import { Clock, CheckCircle, Settings, Truck, Package, Calendar, Search } from 'lucide-react' import { useState, useMemo } from 'react' +import { toast } from 'sonner' +import { MultiLevelSuppliesTable } from '@/components/supplies/multilevel-supplies-table' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Card } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' -import { GET_SUPPLY_ORDERS, GET_MY_SUPPLY_ORDERS } from '@/graphql/queries' import { SUPPLIER_APPROVE_ORDER, SUPPLIER_REJECT_ORDER, SUPPLIER_SHIP_ORDER } from '@/graphql/mutations' +import { GET_SUPPLY_ORDERS, GET_MY_SUPPLY_ORDERS } from '@/graphql/queries' import { useAuth } from '@/hooks/useAuth' -import { toast } from 'sonner' -import { MultiLevelSuppliesTable } from '@/components/supplies/multilevel-supplies-table' + import { SupplierOrderStats } from './supplier-order-stats' import { SupplierOrdersSearch } from './supplier-orders-search' diff --git a/src/components/supplies/create-suppliers/blocks/DetailedCatalogBlock.tsx b/src/components/supplies/create-suppliers/blocks/DetailedCatalogBlock.tsx index 4a73867..4c7a835 100644 --- a/src/components/supplies/create-suppliers/blocks/DetailedCatalogBlock.tsx +++ b/src/components/supplies/create-suppliers/blocks/DetailedCatalogBlock.tsx @@ -263,7 +263,7 @@ function ProductTableRow({ console.log('🎯 Услуги ФФ:', { fulfillmentServicesCount: fulfillmentServices.length, fulfillmentServices: fulfillmentServices, - selectedFulfillment: selectedFulfillment + selectedFulfillment: selectedFulfillment, }) return null })()} @@ -288,7 +288,7 @@ function ProductTableRow({ productId: product.id, serviceName: service.name, isSelected: isSelected, - newRecipe: newRecipe + newRecipe: newRecipe, }) onRecipeChange(product.id, newRecipe) @@ -453,7 +453,7 @@ function MarketplaceCardSelector({ productId, onCardSelect, selectedCardId }: Ma dataExists: !!data, warehouseDataExists: !!data?.getWBWarehouseData, cacheExists: !!data?.getWBWarehouseData?.cache, - rawData: data + rawData: data, }) // Извлекаем карточки из кеша склада WB, как на странице склада @@ -464,7 +464,7 @@ function MarketplaceCardSelector({ productId, onCardSelect, selectedCardId }: Ma hasWBData: !!data?.getWBWarehouseData, hasCache: !!data?.getWBWarehouseData?.cache, cache: data?.getWBWarehouseData?.cache, - cacheData: data?.getWBWarehouseData?.cache?.data + cacheData: data?.getWBWarehouseData?.cache?.data, }) const cacheData = data?.getWBWarehouseData?.cache?.data @@ -512,7 +512,7 @@ function MarketplaceCardSelector({ productId, onCardSelect, selectedCardId }: Ma }} > - + Не выбрано diff --git a/src/components/supplies/create-suppliers/hooks/useSupplyCart.ts b/src/components/supplies/create-suppliers/hooks/useSupplyCart.ts index db4defa..562915f 100644 --- a/src/components/supplies/create-suppliers/hooks/useSupplyCart.ts +++ b/src/components/supplies/create-suppliers/hooks/useSupplyCart.ts @@ -145,7 +145,7 @@ export function useSupplyCart({ selectedSupplier, allCounterparties, productReci console.log('🔎 Проверка услуг для товаров:', { selectedGoods: selectedGoods.map(item => ({ id: item.id, name: item.name })), productRecipesKeys: Object.keys(productRecipes), - productRecipes: productRecipes + productRecipes: productRecipes, }) const result = selectedGoods.every((item) => { @@ -215,7 +215,7 @@ export function useSupplyCart({ selectedSupplier, allCounterparties, productReci fulfillmentConsumables: recipe.selectedFFConsumables || [], sellerConsumables: recipe.selectedSellerConsumables || [], marketplaceCardId: recipe.selectedWBCard || null, - } + }, } }), notes: selectedGoods @@ -232,7 +232,7 @@ export function useSupplyCart({ selectedSupplier, allCounterparties, productReci selectedGoodsCount: selectedGoods.length, deliveryDateType: typeof deliveryDate, deliveryDateValue: deliveryDate, - convertedDate: new Date(deliveryDate).toISOString() + convertedDate: new Date(deliveryDate).toISOString(), }) console.warn('🔍 ДЕТАЛЬНАЯ ПРОВЕРКА inputData перед отправкой:', JSON.stringify(inputData, null, 2)) diff --git a/src/components/supplies/create-suppliers/index.tsx b/src/components/supplies/create-suppliers/index.tsx index 8a6fcfe..a30d628 100644 --- a/src/components/supplies/create-suppliers/index.tsx +++ b/src/components/supplies/create-suppliers/index.tsx @@ -147,7 +147,7 @@ export function CreateSuppliersSupplyPage() { (productId: string, recipe: ProductRecipe) => { console.log('📝 handleRecipeChange вызван:', { productId: productId, - recipe: recipe + recipe: recipe, }) setProductRecipes((prev) => ({ diff --git a/src/components/supplies/goods-supplies-table.tsx b/src/components/supplies/goods-supplies-table.tsx index 5e84cad..9ae68cf 100644 --- a/src/components/supplies/goods-supplies-table.tsx +++ b/src/components/supplies/goods-supplies-table.tsx @@ -6,45 +6,38 @@ import { Calendar, DollarSign, Search, - Filter, ChevronDown, ChevronRight, Smartphone, - Eye, - MoreHorizontal, MapPin, - TrendingUp, - AlertTriangle, - Warehouse, } from 'lucide-react' import React, { useState } from 'react' import { Badge } from '@/components/ui/badge' -import { Button } from '@/components/ui/button' import { Card } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { formatCurrency } from '@/lib/utils' // Простые компоненты таблицы -const Table = ({ children, ...props }: any) => ( +const Table = ({ children, ...props }: { children: React.ReactNode; [key: string]: unknown }) => (
{children}
) -const TableHeader = ({ children, ...props }: any) => {children} -const TableBody = ({ children, ...props }: any) => {children} -const TableRow = ({ children, className, ...props }: any) => ( +const TableHeader = ({ children, ...props }: { children: React.ReactNode; [key: string]: unknown }) => {children} +const TableBody = ({ children, ...props }: { children: React.ReactNode; [key: string]: unknown }) => {children} +const TableRow = ({ children, className, ...props }: { children: React.ReactNode; className?: string; [key: string]: unknown }) => ( {children} ) -const TableHead = ({ children, className, ...props }: any) => ( +const TableHead = ({ children, className, ...props }: { children: React.ReactNode; className?: string; [key: string]: unknown }) => ( {children} ) -const TableCell = ({ children, className, ...props }: any) => ( +const TableCell = ({ children, className, ...props }: { children: React.ReactNode; className?: string; [key: string]: unknown }) => ( {children} @@ -94,7 +87,7 @@ interface GoodsSupplyRoute { } // Основной интерфейс поставки товаров согласно rules2.md 9.5.4 -interface GoodsSupply { +interface _GoodsSupply { id: string number: string creationMethod: 'cards' | 'suppliers' // 📱 карточки / 🏢 поставщик @@ -243,7 +236,7 @@ function CreationMethodIcon({ method }: { method: 'cards' | 'suppliers' }) { } // Компонент для статуса поставки -function StatusBadge({ status }: { status: string }) { +function _StatusBadge({ status }: { status: string }) { const getStatusColor = (status: string) => { switch (status.toLowerCase()) { case 'pending': diff --git a/src/components/supplies/multilevel-supplies-table.tsx b/src/components/supplies/multilevel-supplies-table.tsx index 46c8391..6eda526 100644 --- a/src/components/supplies/multilevel-supplies-table.tsx +++ b/src/components/supplies/multilevel-supplies-table.tsx @@ -3,9 +3,6 @@ import { Package, Building2, - DollarSign, - ChevronDown, - ChevronRight, MapPin, Truck, Clock, @@ -17,7 +14,6 @@ import { createPortal } from 'react-dom' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' -import { Card } from '@/components/ui/card' import { Dialog, DialogContent, @@ -137,25 +133,25 @@ interface MultiLevelSuppliesTableProps { } // Простые компоненты таблицы -const Table = ({ children, ...props }: any) => ( +const Table = ({ children, ...props }: { children: React.ReactNode; [key: string]: unknown }) => (
{children}
) -const TableHeader = ({ children, ...props }: any) => {children} -const TableBody = ({ children, ...props }: any) => {children} -const TableRow = ({ children, className, ...props }: any) => ( +const TableHeader = ({ children, ...props }: { children: React.ReactNode; [key: string]: unknown }) => {children} +const TableBody = ({ children, ...props }: { children: React.ReactNode; [key: string]: unknown }) => {children} +const TableRow = ({ children, className, ...props }: { children: React.ReactNode; className?: string; [key: string]: unknown }) => ( {children} ) -const TableHead = ({ children, className, ...props }: any) => ( +const TableHead = ({ children, className, ...props }: { children: React.ReactNode; className?: string; [key: string]: unknown }) => ( {children} ) -const TableCell = ({ children, className, ...props }: any) => ( +const TableCell = ({ children, className, ...props }: { children: React.ReactNode; className?: string; [key: string]: unknown }) => ( {children} @@ -214,7 +210,7 @@ function ContextMenu({ isOpen, position, onClose, - onCancel + onCancel, }: { isOpen: boolean position: { x: number; y: number } @@ -241,7 +237,7 @@ function ContextMenu({ top: position.y, zIndex: 9999, backgroundColor: 'rgb(17, 24, 39)', - borderColor: 'rgba(255, 255, 255, 0.2)' + borderColor: 'rgba(255, 255, 255, 0.2)', }} > ) case 'FULFILLMENT': // Фулфилмент @@ -666,7 +667,7 @@ export function MultiLevelSuppliesTable({ MozUserSelect: 'none', msUserSelect: 'none', userSelect: 'none', - backgroundColor: getLevelBackgroundColor(1, index) + backgroundColor: getLevelBackgroundColor(1, index), }} onClick={() => { toggleSupplyExpansion(supply.id) @@ -787,9 +788,9 @@ export function MultiLevelSuppliesTable({ : [{ id: `route-${supply.id}`, createdDate: supply.deliveryDate, - fromLocation: "Садовод", - toLocation: "SFERAV Logistics ФФ", - price: 0 + fromLocation: 'Садовод', + toLocation: 'SFERAV Logistics ФФ', + price: 0, }] return mockRoutes.map((route) => { @@ -1033,7 +1034,7 @@ export function MultiLevelSuppliesTable({ item.totalPrice + (item.recipe?.services || []).reduce((sum, service) => sum + service.price * item.quantity, 0) + (item.recipe?.fulfillmentConsumables || []).reduce((sum, consumable) => sum + consumable.price * item.quantity, 0) + - (item.recipe?.sellerConsumables || []).reduce((sum, consumable) => sum + consumable.price * item.quantity, 0) + (item.recipe?.sellerConsumables || []).reduce((sum, consumable) => sum + consumable.price * item.quantity, 0), )} diff --git a/src/components/supplies/supplies-dashboard.tsx b/src/components/supplies/supplies-dashboard.tsx index 2871447..51cee01 100644 --- a/src/components/supplies/supplies-dashboard.tsx +++ b/src/components/supplies/supplies-dashboard.tsx @@ -10,8 +10,8 @@ import { Alert, AlertDescription } from '@/components/ui/alert' import { Button } from '@/components/ui/button' import { GET_PENDING_SUPPLIES_COUNT, GET_MY_SUPPLY_ORDERS } from '@/graphql/queries' import { useAuth } from '@/hooks/useAuth' -import { useSidebar } from '@/hooks/useSidebar' import { useRealtime } from '@/hooks/useRealtime' +import { useSidebar } from '@/hooks/useSidebar' import { AllSuppliesTab } from './fulfillment-supplies/all-supplies-tab' import { RealSupplyOrdersTab } from './fulfillment-supplies/real-supply-orders-tab' diff --git a/src/graphql/resolvers.ts b/src/graphql/resolvers.ts index 034705b..5a822a3 100644 --- a/src/graphql/resolvers.ts +++ b/src/graphql/resolvers.ts @@ -84,7 +84,7 @@ const autoCreateWarehouseEntry = async (sellerId: string, fulfillmentId: string) products: [], // Пустой массив продуктов } - console.warn(`✅ AUTO WAREHOUSE ENTRY CREATED:`, { + console.warn('✅ AUTO WAREHOUSE ENTRY CREATED:', { sellerId, storeName: warehouseEntry.storeName, storeOwner: warehouseEntry.storeOwner, @@ -933,7 +933,7 @@ export const resolvers = { userId: context.user.id, organizationType: currentUser.organization.type, organizationId: currentUser.organization.id, - organizationName: currentUser.organization.name + organizationName: currentUser.organization.name, }) try { @@ -990,7 +990,7 @@ export const resolvers = { acc[order.status] = (acc[order.status] || 0) + 1 return acc }, {}), - orderIds: orders.map(o => o.id) + orderIds: orders.map(o => o.id), }) return orders @@ -1770,7 +1770,7 @@ export const resolvers = { // Получаем всех партнеров-селлеров const counterparties = await prisma.counterparty.findMany({ where: { - organizationId: currentUser.organization.id + organizationId: currentUser.organization.id, }, include: { counterparty: true, @@ -2678,14 +2678,14 @@ export const resolvers = { ...item, recipe, } - }) + }), ) return { ...order, items: processedItems, } - }) + }), ) console.warn('✅ Данные обработаны для многоуровневой таблицы') @@ -3868,7 +3868,7 @@ export const resolvers = { await autoCreateWarehouseEntry(request.senderId, request.receiverId) console.warn(`✅ AUTO WAREHOUSE ENTRY: Created for seller ${request.senderId} with fulfillment ${request.receiverId}`) } catch (error) { - console.error(`❌ AUTO WAREHOUSE ENTRY ERROR:`, error) + console.error('❌ AUTO WAREHOUSE ENTRY ERROR:', error) // Не прерываем основной процесс, если не удалось создать запись склада } } else if (request.sender.type === 'FULFILLMENT' && request.receiver.type === 'SELLER') { @@ -3877,7 +3877,7 @@ export const resolvers = { await autoCreateWarehouseEntry(request.receiverId, request.senderId) console.warn(`✅ AUTO WAREHOUSE ENTRY: Created for seller ${request.receiverId} with fulfillment ${request.senderId}`) } catch (error) { - console.error(`❌ AUTO WAREHOUSE ENTRY ERROR:`, error) + console.error('❌ AUTO WAREHOUSE ENTRY ERROR:', error) } } } @@ -5089,7 +5089,7 @@ export const resolvers = { console.warn('🔍 Автоматическое определение типа расходников:', { organizationType: currentUser.organization.type, consumableType: consumableType, - inputType: args.input.consumableType // Для отладки + inputType: args.input.consumableType, // Для отладки }) // Подготавливаем данные для создания заказа @@ -5188,7 +5188,7 @@ export const resolvers = { toAddress: fulfillmentCenterId ? (await prisma.organization.findUnique({ where: { id: fulfillmentCenterId }, - select: { addressFull: true, address: true } + select: { addressFull: true, address: true }, }))?.addressFull || null : null, status: 'pending', createdDate: new Date(), diff --git a/src/hooks/useRealtime.ts b/src/hooks/useRealtime.ts index 1d7e19e..d8fd651 100644 --- a/src/hooks/useRealtime.ts +++ b/src/hooks/useRealtime.ts @@ -1,4 +1,4 @@ -"use client" +'use client' import { useEffect, useRef } from 'react'