up
This commit is contained in:
@@ -28,7 +28,8 @@ class PipelineOrdersWidget extends Widget
|
||||
{
|
||||
$this->ordersByState = [];
|
||||
foreach (array_keys($this->states) as $s) {
|
||||
$this->ordersByState[$s] = OrdenProduccion::where('estado', $s)
|
||||
$this->ordersByState[$s] = OrdenProduccion::with(['tela', 'confeccions', 'tintorerias', 'procesosAcabado'])
|
||||
->where('estado', $s)
|
||||
->orderBy('fecha_entrega_estimada')
|
||||
->limit(12)
|
||||
->get();
|
||||
|
||||
@@ -9,8 +9,26 @@
|
||||
<div class="op-card bg-white rounded border p-2 shadow-sm" draggable="true" ondragstart="dragStart(event, {{ $op->id }})">
|
||||
<div class="text-sm font-semibold">#{{ $op->numero_orden }} — {{ $op->prenda_modelo }}</div>
|
||||
|
||||
<div class="text-xs text-gray-500">
|
||||
Cant: {{ $op->cantidad_total }} · Realizado: {{ $op->realizado }} · Faltan: {{ $op->faltantes }}<br>
|
||||
{{-- Barra de progreso --}}
|
||||
<div class="mt-1 h-2 bg-gray-200 rounded overflow-hidden">
|
||||
@php
|
||||
$pct = $op->cantidad_total ? round(($op->realizado / $op->cantidad_total) * 100) : 0;
|
||||
$pct = max(0, min(100, $pct));
|
||||
@endphp
|
||||
<div class="h-2 bg-green-500" style="width: {{ $pct }}%"></div>
|
||||
</div>
|
||||
|
||||
<div class="text-xs text-gray-500 mt-2">
|
||||
<strong>Cant:</strong> {{ $op->cantidad_total }} · <strong>Realizado:</strong> {{ $op->realizado }} ({{ $pct }}%) · <strong>Faltan:</strong> {{ $op->faltantes }}<br>
|
||||
|
||||
{{-- Desglose por etapas --}}
|
||||
@php
|
||||
$confRec = $op->confeccions->whereNotNull('fecha_recepcion')->sum('cantidad_recibida');
|
||||
$tintRec = $op->tintorerias->whereNotNull('fecha_recepcion')->sum('cantidad_recibida');
|
||||
$acabRec = $op->procesosAcabado->whereNotNull('fecha_recepcion')->sum('cantidad_recibida');
|
||||
@endphp
|
||||
<span class="text-xs">Confección: {{ $confRec }} · Tintorería: {{ $tintRec }} · Acabados: {{ $acabRec }}</span><br>
|
||||
|
||||
Tela: {{ $op->tela?->codigo ?? '—' }} · Estado: <span class="inline-block px-2 py-0.5 rounded text-xs bg-gray-100">{{ \Illuminate\Support\Str::title(str_replace('_', ' ', $op->estado)) }}</span> · Entrega: {{ $op->fecha_entrega_estimada }}
|
||||
</div>
|
||||
<div class="mt-2 flex gap-2">
|
||||
|
||||
Reference in New Issue
Block a user