From 8a46069d8e951264cfa70f975cdae29fd5fa0b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Tue, 11 Aug 2026 11:08:04 -0300 Subject: [PATCH] Refocus cutting plan table --- src/pages/Cutting.tsx | 61 ++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/src/pages/Cutting.tsx b/src/pages/Cutting.tsx index d9565e1..5349c84 100644 --- a/src/pages/Cutting.tsx +++ b/src/pages/Cutting.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react'; import { Link, useOutletContext, useSearchParams } from 'react-router-dom'; -import { AlertTriangle, ArrowLeft, ClipboardList, Download, Eye, Layers3, Pencil, RotateCcw, Ruler, Save as SaveIcon, Scissors, Search, Settings2, X } from 'lucide-react'; +import { AlertTriangle, ArrowLeft, ClipboardList, Download, Layers3, Pencil, RotateCcw, Ruler, Save as SaveIcon, Scissors, Search, Settings2, X } from 'lucide-react'; import DateRangePicker from '../components/DateRangePicker'; import PaginationControls from '../components/PaginationControls'; import ProductColorBadge from '../components/ProductColorBadge'; @@ -668,7 +668,7 @@ const Cutting = () => { const renderCutStatus = (row: CutPlanSkuRow) => { const readiness = materialReadinessByProductId.get(row.id); if (readiness?.status === 'ready') { - return Pronto para cortar; + return ; } if (readiness?.status === 'material_ready') { return issueLabels[issue]).join(', ')}>Dados pendentes; @@ -1355,30 +1355,31 @@ const Cutting = () => { ) : (
- +
- - - - - - + + + + + - + - - - - + + + - {paginatedRows.map(row => ( - + {paginatedRows.map(row => { + const readiness = materialReadinessByProductId.get(row.id); + const needsAttention = readiness?.status !== 'ready'; + return ( + - - + - ))} + )})}
ProdutoDemandaEstoqueNecessidadeSituação para corteCortar agoraDemanda / disponívelStatus Ações
-
{row.name}
+ {row.name}
#{row.id} {row.family.materialLabel} @@ -1387,21 +1388,17 @@ const Cutting = () => {
Média: {formatNumber(row.dailySales, 2)} un./dia · Cobertura: {formatDays(row.daysOfCover)}
{formatNumber(row.projectedDemand, 1)} un. -
{formatNumber(row.stock)} un.
- {!!row.openProductionQuantity && ( -
Disp. {formatNumber(row.availableQuantity)} un.
- )} +
{formatNumber(row.suggestedCutQuantity)} un.
+
necessidade calculada
- 0 ? 'font-bold text-red-300' : 'font-bold text-emerald-300'}> - {formatNumber(row.suggestedCutQuantity)} un. - +
Demanda {formatNumber(row.projectedDemand, 1)} un.
+
Disponível {formatNumber(row.availableQuantity)} un.{row.openProductionQuantity ? ` · ${formatNumber(row.openProductionQuantity)} em OP` : ''}
{renderCutStatus(row)}{renderCutStatus(row)} -
+
- - -