@extends('layouts.app') @section('title', 'Pilih Alat - Servis Check Mekanik') @section('content')
🔧

Scan QR — Servis Check Mekanik

Pilih alat yang akan Anda servis atau periksa

@if($equipments->count() > 0)
@foreach($equipments as $equipment) @php $activeRepair = $equipment->repairs()->whereIn('status', ['open', 'in_progress'])->latest()->first(); $isUnderRepair = $activeRepair && $activeRepair->status === 'in_progress'; if ($isUnderRepair) { $statusText = 'Sedang Dikerjakan'; $statusStyle = 'background-color: #4f46e5; color: white;'; } else { $statusStyle = $equipment->status === 'damaged' ? 'background-color: #ef4444; color: white;' : ($equipment->status === 'active' ? 'background-color: #22c55e; color: white;' : 'background-color: #f59e0b; color: white;'); $statusText = $equipment->status === 'damaged' ? 'Rusak' : ($equipment->status === 'active' ? 'Active' : 'Stand By'); } $hasActiveRepair = (bool)$activeRepair; @endphp
{{ $equipment->code }}
{{ $equipment->name }}
{{ $equipment->location?->name ?? 'Lokasi tidak tersedia' }}
@if($hasActiveRepair)
⚠️ Ada perbaikan aktif
@endif
{{ $statusText }}
Servis >
@endforeach
@else

Tidak ada equipment yang tersedia

Kembali ke Dashboard
@endif
@endsection