first commit
This commit is contained in:
@ -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'
|
||||
|
@ -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 },
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user