78 lines
4.6 KiB
PHP
78 lines
4.6 KiB
PHP
@extends('portal::layouts.customer')
|
|
@section('title', $item->name)
|
|
@section('content')
|
|
<section class="portal-page-header"><h1>{{ $item->name }}</h1></section>
|
|
<section class="content">
|
|
<div class="box box-primary"><div class="box-body">
|
|
<div class="portal-stat-grid" style="margin-bottom:16px;">
|
|
<div class="portal-stat-card portal-stat-card--blue">
|
|
<div class="portal-stat-card__icon"><i class="fas fa-heartbeat"></i></div>
|
|
<div class="portal-stat-card__body">
|
|
<span class="portal-stat-card__label">@lang('portal::lang.health_status')</span>
|
|
<strong class="portal-stat-card__value">{{ $item->health_percentage ? $item->health_percentage.'%' : '-' }}</strong>
|
|
</div>
|
|
</div>
|
|
<div class="portal-stat-card portal-stat-card--green">
|
|
<div class="portal-stat-card__icon"><i class="fas fa-calendar-check"></i></div>
|
|
<div class="portal-stat-card__body">
|
|
<span class="portal-stat-card__label">@lang('portal::lang.next_service_date')</span>
|
|
<strong class="portal-stat-card__value">@if($item->next_service_date) @format_date($item->next_service_date) @else - @endif</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p><strong>@lang('maintenance::lang.code'):</strong> {{ $item->code }}</p>
|
|
<p><strong>@lang('maintenance::lang.serial_number'):</strong> {{ $item->serial_number }}</p>
|
|
<p><strong>@lang('maintenance::lang.model'):</strong> {{ $item->model }}</p>
|
|
<p><strong>@lang('portal::lang.status'):</strong> {{ $item->status }}</p>
|
|
@if($item->project)<p><strong>@lang('portal::lang.linked_project'):</strong> <a href="{{ action([\Modules\Portal\Http\Controllers\Customer\ProjectController::class, 'show'], [$item->project_id]) }}">{{ $item->project->name }}</a></p>@endif
|
|
@if($item->productionLine)<p><strong>@lang('portal::lang.linked_line'):</strong> <a href="{{ action([\Modules\Portal\Http\Controllers\Customer\ProductionLineController::class, 'show'], [$item->production_line_id]) }}">{{ $item->productionLine->name }}</a></p>@endif
|
|
@if($item->last_service_date)<p><strong>@lang('portal::lang.last_service_date'):</strong> @format_date($item->last_service_date)</p>@endif
|
|
</div></div>
|
|
|
|
@include('portal::partials.process_schedules', ['schedules' => $item->preventiveSchedules ?? collect()])
|
|
@include('portal::partials.process_work_orders', ['workOrders' => $item->workOrders ?? collect()])
|
|
|
|
@if($inspections->count())
|
|
<div class="box box-primary">
|
|
<div class="box-header"><h3 class="box-title">@lang('portal::lang.inspection_history')</h3></div>
|
|
<div class="box-body table-responsive">
|
|
<table class="table table-bordered table-striped">
|
|
<thead><tr><th>@lang('messages.date')</th><th>@lang('portal::lang.health_status')</th><th>@lang('portal::lang.status')</th></tr></thead>
|
|
<tbody>
|
|
@foreach($inspections as $visit)
|
|
<tr>
|
|
<td>@format_datetime($visit->visit_date)</td>
|
|
<td>{{ $visit->health_percentage ? $visit->health_percentage.'%' : '-' }}</td>
|
|
<td>{{ $visit->status ?? '-' }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@if($serviceRecords->count())
|
|
<div class="box box-primary">
|
|
<div class="box-header"><h3 class="box-title">@lang('portal::lang.service_history')</h3></div>
|
|
<div class="box-body table-responsive">
|
|
<table class="table table-bordered table-striped">
|
|
<thead><tr><th>@lang('maintenance::lang.title')</th><th>@lang('portal::lang.completed_at')</th><th>@lang('portal::lang.status')</th></tr></thead>
|
|
<tbody>
|
|
@foreach($serviceRecords as $record)
|
|
<tr>
|
|
<td>{{ $record->title }}</td>
|
|
<td>@if($record->completed_at) @format_datetime($record->completed_at) @else - @endif</td>
|
|
<td>{{ $record->status ?? '-' }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<p><a href="{{ action([\Modules\Portal\Http\Controllers\Customer\ServiceRequestController::class, 'create']) }}?equipment_id={{ $item->id }}" class="btn btn-primary"><i class="fas fa-headset"></i> @lang('portal::lang.new_service_request')</a></p>
|
|
</section>
|
|
@endsection
|