This commit is contained in:
@@ -150,7 +150,11 @@
|
|||||||
<!-- Modal: Ver Trazabilidad -->
|
<!-- Modal: Ver Trazabilidad -->
|
||||||
<UModal
|
<UModal
|
||||||
v-model:open="showTrazabilidadModal"
|
v-model:open="showTrazabilidadModal"
|
||||||
:ui="{ content: 'w-[calc(100vw-2rem)] max-w-4xl rounded-lg shadow-lg ring ring-default max-h-[80vh] overflow-y-auto' }"
|
scrollable
|
||||||
|
:ui="{
|
||||||
|
content: 'w-[calc(100vw-2rem)] max-w-4xl rounded-lg shadow-lg ring ring-default max-h-[80vh]',
|
||||||
|
body: 'overflow-y-auto'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<LotesTrazabilidad
|
<LotesTrazabilidad
|
||||||
@@ -173,6 +177,17 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</UModal>
|
</UModal>
|
||||||
|
|
||||||
|
<!-- Modal: Ver Detalle de Operación -->
|
||||||
|
<UModal v-model:open="showOperacionDetailModal">
|
||||||
|
<template #content>
|
||||||
|
<OperacionesCard
|
||||||
|
v-if="selectedOperacion"
|
||||||
|
:operacion="selectedOperacion"
|
||||||
|
@close="closeOperacionDetailModal"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</UModal>
|
||||||
</UApp>
|
</UApp>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -194,9 +209,11 @@ const showLoteDetailModal = ref(false)
|
|||||||
const showTrazabilidadModal = ref(false)
|
const showTrazabilidadModal = ref(false)
|
||||||
const showCreateLoteModal = ref(false)
|
const showCreateLoteModal = ref(false)
|
||||||
const showCreateOperacionModal = ref(false)
|
const showCreateOperacionModal = ref(false)
|
||||||
|
const showOperacionDetailModal = ref(false)
|
||||||
|
|
||||||
// Estados de datos
|
// Estados de datos
|
||||||
const selectedLote = ref<Lote | null>(null)
|
const selectedLote = ref<Lote | null>(null)
|
||||||
|
const selectedOperacion = ref<Operacion | null>(null)
|
||||||
const trazabilidadLoteId = ref<string | null>(null)
|
const trazabilidadLoteId = ref<string | null>(null)
|
||||||
|
|
||||||
// Handlers para Lotes
|
// Handlers para Lotes
|
||||||
@@ -240,8 +257,8 @@ const handleLoteFormSuccess = () => {
|
|||||||
|
|
||||||
// Handlers para Operaciones
|
// Handlers para Operaciones
|
||||||
const handleViewOperacion = (operacion: Operacion) => {
|
const handleViewOperacion = (operacion: Operacion) => {
|
||||||
// TODO: Implementar vista de detalle de operación si es necesario
|
selectedOperacion.value = operacion
|
||||||
console.log('Ver operación:', operacion)
|
showOperacionDetailModal.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOperacionFormSuccess = () => {
|
const handleOperacionFormSuccess = () => {
|
||||||
@@ -249,6 +266,15 @@ const handleOperacionFormSuccess = () => {
|
|||||||
// Las tablas se recargarán automáticamente
|
// Las tablas se recargarán automáticamente
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closeOperacionDetailModal = () => {
|
||||||
|
showOperacionDetailModal.value = false
|
||||||
|
selectedOperacion.value = null
|
||||||
|
}
|
||||||
|
const closeOperacionDetailModal = () => {
|
||||||
|
showOperacionDetailModal.value = false
|
||||||
|
selectedOperacion.value = null
|
||||||
|
}
|
||||||
|
|
||||||
// ⚠️⚠️⚠️ FUNCIONES DE DEBUG - TEMPORALES ⚠️⚠️⚠️
|
// ⚠️⚠️⚠️ FUNCIONES DE DEBUG - TEMPORALES ⚠️⚠️⚠️
|
||||||
// NO ELIMINAR SIN CONSULTAR A DARIO/DRAGANEL/NUCLEO000
|
// NO ELIMINAR SIN CONSULTAR A DARIO/DRAGANEL/NUCLEO000
|
||||||
const resettingDB = ref(false)
|
const resettingDB = ref(false)
|
||||||
|
|||||||
@@ -55,8 +55,10 @@
|
|||||||
|
|
||||||
<div v-if="lote.meta" class="pt-4 border-t">
|
<div v-if="lote.meta" class="pt-4 border-t">
|
||||||
<p class="text-sm text-gray-500 mb-2">Información Adicional</p>
|
<p class="text-sm text-gray-500 mb-2">Información Adicional</p>
|
||||||
<UCard class="bg-gray-50">
|
<UCard class="bg-gray-50 dark:bg-slate-900/70 border border-gray-200 dark:border-slate-800">
|
||||||
<pre class="text-xs overflow-x-auto">{{ JSON.stringify(lote.meta, null, 2) }}</pre>
|
<pre class="text-xs overflow-x-auto text-gray-800 dark:text-slate-200 whitespace-pre-wrap">
|
||||||
|
{{ JSON.stringify(lote.meta, null, 2) }}
|
||||||
|
</pre>
|
||||||
</UCard>
|
</UCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,20 +21,20 @@
|
|||||||
|
|
||||||
<div v-else-if="trazabilidad" class="space-y-6">
|
<div v-else-if="trazabilidad" class="space-y-6">
|
||||||
<!-- Estadísticas -->
|
<!-- Estadísticas -->
|
||||||
<div class="grid grid-cols-3 gap-4 p-4 bg-gray-50 rounded-lg">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
<div class="text-center">
|
<div class="rounded-xl border border-gray-200 dark:border-slate-800 bg-white/80 dark:bg-slate-900/70 p-4 shadow-sm">
|
||||||
<p class="text-2xl font-bold text-blue-600">{{ trazabilidad.estadisticas.total_ancestros }}</p>
|
<p class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">Lotes ancestros</p>
|
||||||
<p class="text-sm text-gray-600">Lotes ancestros</p>
|
<p class="text-3xl font-semibold text-blue-600 dark:text-cyan-300">{{ trazabilidad.estadisticas.total_ancestros }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="rounded-xl border border-gray-200 dark:border-slate-800 bg-white/80 dark:bg-slate-900/70 p-4 shadow-sm">
|
||||||
<p class="text-2xl font-bold text-green-600">{{ trazabilidad.estadisticas.profundidad_maxima }}</p>
|
<p class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">Niveles de profundidad</p>
|
||||||
<p class="text-sm text-gray-600">Niveles de profundidad</p>
|
<p class="text-3xl font-semibold text-green-600 dark:text-emerald-300">{{ trazabilidad.estadisticas.profundidad_maxima }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="rounded-xl border border-gray-200 dark:border-slate-800 bg-white/80 dark:bg-slate-900/70 p-4 shadow-sm">
|
||||||
<p class="text-2xl font-bold text-orange-600">
|
<p class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">Kilos iniciales</p>
|
||||||
|
<p class="text-3xl font-semibold text-orange-600 dark:text-amber-300">
|
||||||
{{ trazabilidad.estadisticas.kg_iniciales.toLocaleString('es-AR') }} kg
|
{{ trazabilidad.estadisticas.kg_iniciales.toLocaleString('es-AR') }} kg
|
||||||
</p>
|
</p>
|
||||||
<p class="text-sm text-gray-600">Kilos iniciales</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -44,11 +44,11 @@
|
|||||||
<!-- Árbol de Trazabilidad (texto) -->
|
<!-- Árbol de Trazabilidad (texto) -->
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<h4 class="font-semibold text-lg">Historial</h4>
|
<h4 class="font-semibold text-lg">Historial</h4>
|
||||||
<div class="space-y-1">
|
<div class="space-y-2">
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in sortedHistorial"
|
v-for="(item, index) in sortedHistorial"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="flex items-start gap-3 p-3 rounded-lg hover:bg-gray-50 transition-colors"
|
class="flex items-start gap-3 p-3 rounded-lg border border-gray-100 dark:border-slate-800 bg-white/80 dark:bg-slate-900/60 hover:border-primary/40 transition-colors"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-blue-50': item.profundidad === 0,
|
'bg-blue-50': item.profundidad === 0,
|
||||||
'border-l-4 border-blue-500': item.profundidad === 0,
|
'border-l-4 border-blue-500': item.profundidad === 0,
|
||||||
|
|||||||
@@ -53,16 +53,26 @@
|
|||||||
|
|
||||||
<!-- Aristas -->
|
<!-- Aristas -->
|
||||||
<g stroke="url(#edgeGradient)" stroke-width="2.5" stroke-linecap="round">
|
<g stroke="url(#edgeGradient)" stroke-width="2.5" stroke-linecap="round">
|
||||||
|
<template v-for="edge in edges" :key="`${edge.from}-${edge.to}`">
|
||||||
|
<!-- tramo vertical -->
|
||||||
<line
|
<line
|
||||||
v-for="edge in edges"
|
|
||||||
:key="`${edge.from}-${edge.to}`"
|
|
||||||
:x1="edge.fromPos.x"
|
:x1="edge.fromPos.x"
|
||||||
:y1="edge.fromPos.y"
|
:y1="edge.fromPos.y"
|
||||||
|
:x2="edge.fromPos.x"
|
||||||
|
:y2="edge.midPos.y"
|
||||||
|
class="transition-opacity duration-200"
|
||||||
|
:opacity="0.9"
|
||||||
|
/>
|
||||||
|
<!-- tramo horizontal -->
|
||||||
|
<line
|
||||||
|
:x1="edge.fromPos.x"
|
||||||
|
:y1="edge.midPos.y"
|
||||||
:x2="edge.toPos.x"
|
:x2="edge.toPos.x"
|
||||||
:y2="edge.toPos.y"
|
:y2="edge.toPos.y"
|
||||||
class="transition-opacity duration-200"
|
class="transition-opacity duration-200"
|
||||||
:opacity="0.9"
|
:opacity="0.9"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<!-- Nodos -->
|
<!-- Nodos -->
|
||||||
@@ -208,6 +218,7 @@ const edges = computed(() => {
|
|||||||
to: string
|
to: string
|
||||||
fromPos: { x: number; y: number }
|
fromPos: { x: number; y: number }
|
||||||
toPos: { x: number; y: number }
|
toPos: { x: number; y: number }
|
||||||
|
midPos: { x: number; y: number }
|
||||||
}[] = []
|
}[] = []
|
||||||
|
|
||||||
for (const row of props.historial) {
|
for (const row of props.historial) {
|
||||||
@@ -220,6 +231,7 @@ const edges = computed(() => {
|
|||||||
to: toNode.id,
|
to: toNode.id,
|
||||||
fromPos: { x: fromNode.x, y: fromNode.y + nodeBox.height / 2 },
|
fromPos: { x: fromNode.x, y: fromNode.y + nodeBox.height / 2 },
|
||||||
toPos: { x: toNode.x, y: toNode.y - nodeBox.height / 2 },
|
toPos: { x: toNode.x, y: toNode.y - nodeBox.height / 2 },
|
||||||
|
midPos: { x: fromNode.x, y: (fromNode.y + toNode.y) / 2 },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user