demo seed change
This commit is contained in:
@@ -193,7 +193,7 @@ const MaquinariaPage: React.FC = () => {
|
||||
maintenance: { color: getStatusColor('info'), text: t('equipment_status.maintenance'), icon: Wrench },
|
||||
down: { color: getStatusColor('error'), text: t('equipment_status.down'), icon: AlertTriangle }
|
||||
};
|
||||
return configs[status];
|
||||
return configs[status] || { color: getStatusColor('other'), text: status, icon: Settings };
|
||||
};
|
||||
|
||||
const getTypeIcon = (type: Equipment['type']) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useMemo } from 'react';
|
||||
import { Plus, Clock, AlertCircle, CheckCircle, Timer, ChefHat, Eye, Edit, Package, PlusCircle, Play } from 'lucide-react';
|
||||
import { Plus, Clock, AlertCircle, CheckCircle, Timer, ChefHat, Eye, Edit, Package, PlusCircle, Play, Info } from 'lucide-react';
|
||||
import { Button, StatsGrid, EditViewModal, Toggle, SearchAndFilter, type FilterConfig, EmptyState } from '../../../../components/ui';
|
||||
import { statusColors } from '../../../../styles/colors';
|
||||
import { formatters } from '../../../../components/ui/Stats/StatsPresets';
|
||||
@@ -666,6 +666,58 @@ const ProductionPage: React.FC = () => {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Detalles del Razonamiento',
|
||||
icon: Info,
|
||||
fields: [
|
||||
{
|
||||
label: 'Causa Principal',
|
||||
value: selectedBatch.reasoning_data?.trigger_type
|
||||
? t(`reasoning:triggers.${selectedBatch.reasoning_data.trigger_type.toLowerCase()}`)
|
||||
: 'No especificado',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
label: 'Descripción del Razonamiento',
|
||||
value: selectedBatch.reasoning_data?.trigger_description || 'No especificado',
|
||||
type: 'textarea',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
label: 'Factores Clave',
|
||||
value: selectedBatch.reasoning_data?.factors && Array.isArray(selectedBatch.reasoning_data.factors)
|
||||
? selectedBatch.reasoning_data.factors.map(factor =>
|
||||
t(`reasoning:factors.${factor.toLowerCase()}`) || factor
|
||||
).join(', ')
|
||||
: 'No especificados',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
label: 'Consecuencias Potenciales',
|
||||
value: selectedBatch.reasoning_data?.consequence || 'No especificado',
|
||||
type: 'textarea',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
label: 'Nivel de Confianza',
|
||||
value: selectedBatch.reasoning_data?.confidence_score
|
||||
? `${selectedBatch.reasoning_data.confidence_score}%`
|
||||
: 'No especificado'
|
||||
},
|
||||
{
|
||||
label: 'Variación Histórica',
|
||||
value: selectedBatch.reasoning_data?.variance
|
||||
? `${selectedBatch.reasoning_data.variance}%`
|
||||
: 'No especificado'
|
||||
},
|
||||
{
|
||||
label: 'Detalles de la Predicción',
|
||||
value: selectedBatch.reasoning_data?.prediction_details || 'No especificado',
|
||||
type: 'textarea',
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Calidad y Costos',
|
||||
icon: CheckCircle,
|
||||
@@ -733,6 +785,10 @@ const ProductionPage: React.FC = () => {
|
||||
'Estado': 'status',
|
||||
'Prioridad': 'priority',
|
||||
'Personal Asignado': 'staff_assigned',
|
||||
// Reasoning section editable fields
|
||||
'Descripción del Razonamiento': 'reasoning_data.trigger_description',
|
||||
'Consecuencias Potenciales': 'reasoning_data.consequence',
|
||||
'Detalles de la Predicción': 'reasoning_data.prediction_details',
|
||||
// Schedule - most fields are read-only datetime
|
||||
// Quality and Costs
|
||||
'Notas de Producción': 'production_notes',
|
||||
@@ -744,6 +800,7 @@ const ProductionPage: React.FC = () => {
|
||||
['Producto', 'Número de Lote', 'Cantidad Planificada', 'Cantidad Producida', 'Estado', 'Prioridad', 'Personal Asignado', 'Equipos Utilizados'],
|
||||
['Inicio Planificado', 'Fin Planificado', 'Duración Planificada', 'Inicio Real', 'Fin Real', 'Duración Real'],
|
||||
[], // Process Stage Tracker section - no editable fields
|
||||
['Causa Principal', 'Descripción del Razonamiento', 'Factores Clave', 'Consecuencias Potenciales', 'Nivel de Confianza', 'Variación Histórica', 'Detalles de la Predicción'], // Reasoning section
|
||||
['Puntuación de Calidad', 'Rendimiento', 'Costo Estimado', 'Costo Real', 'Notas de Producción', 'Notas de Calidad']
|
||||
];
|
||||
|
||||
@@ -760,10 +817,22 @@ const ProductionPage: React.FC = () => {
|
||||
processedValue = parseFloat(value as string) || 0;
|
||||
}
|
||||
|
||||
setSelectedBatch({
|
||||
...selectedBatch,
|
||||
[propertyName]: processedValue
|
||||
});
|
||||
// Handle nested reasoning_data fields
|
||||
if (propertyName.startsWith('reasoning_data.')) {
|
||||
const nestedProperty = propertyName.split('.')[1];
|
||||
setSelectedBatch({
|
||||
...selectedBatch,
|
||||
reasoning_data: {
|
||||
...(selectedBatch.reasoning_data || {}),
|
||||
[nestedProperty]: processedValue
|
||||
}
|
||||
});
|
||||
} else {
|
||||
setSelectedBatch({
|
||||
...selectedBatch,
|
||||
[propertyName]: processedValue
|
||||
});
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user