115 lines
5.4 KiB
PHP
115 lines
5.4 KiB
PHP
@extends('layouts.app')
|
|
@section('title', __('shopfloor::lang.module_name'))
|
|
@section('content')
|
|
@include('shopfloor::layouts.nav')
|
|
<section class="content">
|
|
<div class="row">
|
|
@foreach([
|
|
['key' => 'avg_oee', 'icon' => 'fa-tachometer', 'color' => 'bg-green', 'suffix' => '%'],
|
|
['key' => 'active_work_centers', 'icon' => 'fa-cogs', 'color' => 'bg-aqua', 'suffix' => ''],
|
|
['key' => 'open_downtime', 'icon' => 'fa-pause-circle', 'color' => 'bg-yellow', 'suffix' => ''],
|
|
['key' => 'today_events', 'icon' => 'fa-play-circle', 'color' => 'bg-purple', 'suffix' => ''],
|
|
] as $kpi)
|
|
<div class="col-md-3 col-sm-6">
|
|
<div class="info-box {{ $kpi['color'] }}">
|
|
<span class="info-box-icon"><i class="fa {{ $kpi['icon'] }}"></i></span>
|
|
<div class="info-box-content">
|
|
<span class="info-box-text">@lang('shopfloor::lang.'.$kpi['key'])</span>
|
|
<span class="info-box-number">{{ $stats[$kpi['key']] ?? 0 }}{{ $kpi['suffix'] }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="box box-primary">
|
|
<div class="box-header"><h3 class="box-title">@lang('shopfloor::lang.today_oee')</h3></div>
|
|
<div class="box-body table-responsive">
|
|
<table class="table table-bordered table-striped">
|
|
<thead><tr>
|
|
<th>@lang('shopfloor::lang.work_center')</th>
|
|
<th>@lang('shopfloor::lang.oee_pct')</th>
|
|
<th>@lang('shopfloor::lang.availability_pct')</th>
|
|
<th>@lang('shopfloor::lang.performance_pct')</th>
|
|
<th>@lang('shopfloor::lang.quality_pct')</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
@forelse($todayOee as $snap)
|
|
<tr>
|
|
<td>{{ $snap->workCenter?->name ?? '—' }}</td>
|
|
<td>{{ number_format($snap->oee_pct, 2) }}%</td>
|
|
<td>{{ number_format($snap->availability_pct, 2) }}%</td>
|
|
<td>{{ number_format($snap->performance_pct, 2) }}%</td>
|
|
<td>{{ number_format($snap->quality_pct, 2) }}%</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="5" class="text-center">—</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="box box-primary">
|
|
<div class="box-header"><h3 class="box-title">@lang('shopfloor::lang.work_centers')</h3></div>
|
|
<div class="box-body table-responsive">
|
|
<table class="table table-bordered table-striped">
|
|
<thead><tr>
|
|
<th>@lang('shopfloor::lang.code')</th>
|
|
<th>@lang('shopfloor::lang.name')</th>
|
|
<th>@lang('shopfloor::lang.status')</th>
|
|
<th>@lang('shopfloor::lang.line_template')</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
@forelse($workCenters->take(8) as $wc)
|
|
<tr>
|
|
<td>{{ $wc->code }}</td>
|
|
<td>{{ $wc->name }}</td>
|
|
<td>{{ $wc->status }}</td>
|
|
<td>{{ $wc->lineTemplate?->template_code ?? '—' }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="4" class="text-center">—</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box box-primary">
|
|
<div class="box-header"><h3 class="box-title">@lang('shopfloor::lang.recent_events')</h3></div>
|
|
<div class="box-body table-responsive">
|
|
<table class="table table-bordered table-striped">
|
|
<thead><tr>
|
|
<th>@lang('shopfloor::lang.recorded_at')</th>
|
|
<th>@lang('shopfloor::lang.work_center')</th>
|
|
<th>@lang('shopfloor::lang.event_type')</th>
|
|
<th>@lang('shopfloor::lang.work_order')</th>
|
|
<th>@lang('shopfloor::lang.quantity')</th>
|
|
<th>@lang('shopfloor::lang.recorded_by')</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
@forelse($recentEvents as $event)
|
|
<tr>
|
|
<td>{{ $event->recorded_at?->format('Y-m-d H:i') }}</td>
|
|
<td>{{ $event->workCenter?->name ?? '—' }}</td>
|
|
<td>{{ $event->event_type }}</td>
|
|
<td>{{ $event->workOrder?->work_order_number ?? '—' }}</td>
|
|
<td>{{ $event->quantity }}</td>
|
|
<td>{{ $event->recordedBy?->user_full_name ?? '—' }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="6" class="text-center">—</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|