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

71 lines
3.1 KiB
PHP

@extends('layouts.app')
@section('title', __('maintenance::lang.overhauls'))
@section('content')
@include('maintenance::layouts.nav')
<section class="content no-print mt-page">
<div class="mt-page-header">
<h1><i class="fas fa-hammer" style="color:#14b8a6;margin-left:8px;"></i> @lang('maintenance::lang.overhauls')</h1>
@can('maintenance.overhaul.create')
<a href="{{ action([\Modules\Maintenance\Http\Controllers\OverhaulController::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_overhauls')</h3></div>
<div class="mt-card-body">
@include('maintenance::partials.scope_filters', ['projects' => $projects, 'equipment' => $equipment, 'show_status' => true, 'statuses' => $statuses])
<div class="table-responsive">
<table class="table table-bordered table-striped" id="mm_overhauls_table" style="width:100%">
<thead>
<tr>
<th>@lang('maintenance::lang.title')</th>
<th>@lang('maintenance::lang.equipment')</th>
<th>@lang('maintenance::lang.supervisor')</th>
<th>@lang('maintenance::lang.start_date')</th>
<th>@lang('maintenance::lang.end_date')</th>
<th>@lang('maintenance::lang.status')</th>
<th>@lang('maintenance::lang.estimated_cost')</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_overhauls_table').DataTable({
processing: true, serverSide: true,
ajax: {
url: '{{ action([\Modules\Maintenance\Http\Controllers\OverhaulController::class, "index"]) }}',
data: function(d) {
d.project_id = $('.mm-filter-project').val();
d.equipment_id = $('.mm-filter-equipment').val();
d.status = $('.mm-filter-status').val();
}
},
columns: [
{ data: 'title', name: 'title' },
{ data: 'equipment_name', name: 'equipment_name', orderable: false },
{ data: 'supervisor_name', name: 'supervisor_name', orderable: false },
{ data: 'start_date', name: 'start_date' },
{ data: 'end_date', name: 'end_date' },
{ data: 'status_label', name: 'status' },
{ data: 'estimated_cost', name: 'estimated_cost' },
{ data: 'action', name: 'action', orderable: false, searchable: false }
]
});
$('.mm-apply-filters').on('click', function() { table.ajax.reload(); });
});
</script>
@endsection