68 lines
2.9 KiB
PHP
68 lines
2.9 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', __('maintenance::lang.inspection_visits'))
|
|
|
|
@section('content')
|
|
@include('maintenance::layouts.nav')
|
|
|
|
<section class="content no-print mt-page">
|
|
<div class="mt-page-header">
|
|
<h1><i class="fas fa-search" style="color:#14b8a6;margin-left:8px;"></i> @lang('maintenance::lang.inspection_visits')</h1>
|
|
@can('maintenance.inspections.create')
|
|
<a href="{{ action([\Modules\Maintenance\Http\Controllers\InspectionVisitController::class, 'create']) }}" class="mt-btn-primary btn">
|
|
<i class="fa fa-plus"></i> @lang('maintenance::lang.add')
|
|
</a>
|
|
@endcan
|
|
</div>
|
|
<div class="mt-card">
|
|
<div class="mt-card-header"><h3 class="mt-card-title">@lang('maintenance::lang.all_visits')</h3></div>
|
|
<div class="mt-card-body">
|
|
@include('maintenance::partials.scope_filters', ['projects' => $projects, 'equipment' => $equipment])
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-striped" id="mm_visits_table" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th>@lang('maintenance::lang.visit_date')</th>
|
|
<th>@lang('maintenance::lang.equipment')</th>
|
|
<th>@lang('maintenance::lang.project')</th>
|
|
<th>@lang('maintenance::lang.inspector')</th>
|
|
<th>@lang('maintenance::lang.status')</th>
|
|
<th>@lang('maintenance::lang.health_percentage')</th>
|
|
<th>@lang('maintenance::lang.action')</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|
|
|
|
@section('javascript')
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('.select2').select2();
|
|
var table = $('#mm_visits_table').DataTable({
|
|
processing: true, serverSide: true,
|
|
ajax: {
|
|
url: '{{ action([\Modules\Maintenance\Http\Controllers\InspectionVisitController::class, "index"]) }}',
|
|
data: function(d) {
|
|
d.project_id = $('.mm-filter-project').val();
|
|
d.equipment_id = $('.mm-filter-equipment').val();
|
|
}
|
|
},
|
|
columns: [
|
|
{ data: 'visit_date', name: 'visit_date' },
|
|
{ data: 'equipment_name', name: 'equipment_name', orderable: false },
|
|
{ data: 'project_name', name: 'project_name', orderable: false },
|
|
{ data: 'inspector_name', name: 'inspector_name', orderable: false },
|
|
{ data: 'status_label', name: 'status' },
|
|
{ data: 'health_percentage', name: 'health_percentage' },
|
|
{ data: 'action', name: 'action', orderable: false, searchable: false }
|
|
]
|
|
});
|
|
$('.mm-apply-filters').on('click', function() { table.ajax.reload(); });
|
|
});
|
|
</script>
|
|
@endsection
|