ultimatepos/Modules/Maintenance/Resources/views/overhauls/show.blade.php

82 lines
3.8 KiB
PHP

@extends('layouts.app')
@section('title', $overhaul->title)
@section('content')
@include('maintenance::layouts.nav')
@php $util = app(\Modules\Maintenance\Utils\MaintenanceUtil::class); @endphp
<section class="content no-print mt-page">
<div class="mt-page-header">
<h1>{{ $overhaul->title }} <small class="text-muted">{{ $overhaul->equipment?->name }}</small></h1>
<div>
@can('maintenance.overhaul.update')
<a href="{{ action([\Modules\Maintenance\Http\Controllers\OverhaulController::class, 'edit'], [$overhaul->id]) }}" class="btn btn-primary">@lang('maintenance::lang.edit')</a>
@endcan
<a href="{{ action([\Modules\Maintenance\Http\Controllers\OverhaulController::class, 'index']) }}" class="btn btn-default">@lang('maintenance::lang.back')</a>
</div>
</div>
<div class="mt-card">
<div class="mt-card-body">
<table class="table table-bordered">
<tr><th width="200">@lang('maintenance::lang.status')</th><td>{{ $util->statusLabel($overhaul->status) }}</td></tr>
<tr><th>@lang('maintenance::lang.supervisor')</th><td>{{ $overhaul->supervisor ? trim($overhaul->supervisor->first_name.' '.($overhaul->supervisor->last_name ?? '')) : '—' }}</td></tr>
<tr><th>@lang('maintenance::lang.start_date')</th><td>{{ $util->formatDate($overhaul->start_date) ?? '—' }}</td></tr>
<tr><th>@lang('maintenance::lang.end_date')</th><td>{{ $util->formatDate($overhaul->end_date) ?? '—' }}</td></tr>
<tr><th>@lang('maintenance::lang.estimated_cost')</th><td>{{ $util->formatMoney($overhaul->estimated_cost) }}</td></tr>
<tr><th>@lang('maintenance::lang.actual_cost')</th><td>{{ $util->formatMoney($overhaul->actual_cost) }}</td></tr>
<tr><th>@lang('maintenance::lang.shutdown_required')</th><td>{{ $overhaul->shutdown_required ? __('maintenance::lang.yes') : __('maintenance::lang.no') }}</td></tr>
</table>
@if($overhaul->description)<p><strong>@lang('maintenance::lang.description'):</strong> {{ $overhaul->description }}</p>@endif
@if($overhaul->safety_requirements)<p><strong>@lang('maintenance::lang.safety_requirements'):</strong> {{ $overhaul->safety_requirements }}</p>@endif
@if($overhaul->workOrders->isNotEmpty())
<h4>@lang('maintenance::lang.work_orders')</h4>
<table class="table table-striped">
<thead><tr><th>@lang('maintenance::lang.work_order_number')</th><th>@lang('maintenance::lang.status')</th></tr></thead>
<tbody>
@foreach($overhaul->workOrders as $wo)
<tr>
<td><a href="{{ action([\Modules\Maintenance\Http\Controllers\WorkOrderController::class, 'show'], [$wo->id]) }}">{{ $wo->work_order_number }}</a></td>
<td>{{ $util->statusLabel($wo->status) }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
</div>
@if(!empty($materialPanel))
<div class="row" style="margin-top:20px;">
<div class="col-md-12">
@include('maintenance::materials.panel', $materialPanel)
</div>
</div>
@endif
@if(!empty($missionPanel))
<div class="row" style="margin-top:20px;">
<div class="col-md-12">
@include('maintenance::field_missions.panel', $missionPanel)
</div>
</div>
@endif
</section>
@endsection
@section('javascript')
<script>
$(function(){
$('.select2').select2();
$('#fm_mission_panel .fm_item_type').on('change', function() {
var t = $(this).val();
$('#fm_mission_panel .fm_field_spare').toggle(t === 'spare_part');
$('#fm_mission_panel .fm_field_tool').toggle(t === 'tool');
});
});
</script>
@endsection