103 lines
4.9 KiB
PHP
103 lines
4.9 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', __('maintenance::lang.rebuilds'))
|
|
|
|
@section('content')
|
|
@include('maintenance::layouts.nav')
|
|
|
|
<section class="content no-print mt-page">
|
|
<div class="mt-page-header">
|
|
<h1><i class="fas fa-recycle" style="color:#7c3aed;margin-left:8px;"></i> @lang('maintenance::lang.rebuilds')</h1>
|
|
@can('maintenance.rebuild.create')
|
|
<a href="{{ action([\Modules\Maintenance\Http\Controllers\RebuildController::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_rebuilds')</h3></div>
|
|
<div class="mt-card-body">
|
|
<div class="row mm-filter-row" style="margin-bottom:12px;">
|
|
<div class="col-md-3">
|
|
<select class="form-control mm-filter-project select2">
|
|
<option value="">@lang('maintenance::lang.all') @lang('maintenance::lang.project')</option>
|
|
@foreach($projects as $id => $name)
|
|
<option value="{{ $id }}">{{ $name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<select class="form-control mm-filter-scope">
|
|
<option value="">@lang('maintenance::lang.all') @lang('maintenance::lang.scope_type')</option>
|
|
@foreach($scope_types as $key => $label)
|
|
<option value="{{ $key }}">{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<select class="form-control mm-filter-status">
|
|
<option value="">@lang('maintenance::lang.all') @lang('maintenance::lang.status')</option>
|
|
@foreach($statuses as $key => $label)
|
|
<option value="{{ $key }}">{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="button" class="btn btn-primary mm-apply-filters">@lang('maintenance::lang.filter')</button>
|
|
</div>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-striped" id="mm_rebuilds_table" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th>@lang('maintenance::lang.rebuild_number')</th>
|
|
<th>@lang('maintenance::lang.title')</th>
|
|
<th>@lang('maintenance::lang.scope_type')</th>
|
|
<th>@lang('maintenance::lang.production_line')</th>
|
|
<th>@lang('maintenance::lang.equipment')</th>
|
|
<th>@lang('maintenance::lang.supervisor')</th>
|
|
<th>@lang('maintenance::lang.progress')</th>
|
|
<th>@lang('maintenance::lang.status')</th>
|
|
<th>@lang('maintenance::lang.planned_start')</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_rebuilds_table').DataTable({
|
|
processing: true, serverSide: true,
|
|
ajax: {
|
|
url: '{{ action([\Modules\Maintenance\Http\Controllers\RebuildController::class, "index"]) }}',
|
|
data: function(d) {
|
|
d.project_id = $('.mm-filter-project').val();
|
|
d.scope_type = $('.mm-filter-scope').val();
|
|
d.status = $('.mm-filter-status').val();
|
|
}
|
|
},
|
|
columns: [
|
|
{ data: 'rebuild_number', name: 'rebuild_number' },
|
|
{ data: 'title', name: 'title' },
|
|
{ data: 'scope_label', name: 'scope_type', orderable: false },
|
|
{ data: 'line_name', name: 'line_name', orderable: false },
|
|
{ data: 'equipment_count', name: 'equipment_count', orderable: false, searchable: false },
|
|
{ data: 'supervisor_name', name: 'supervisor_name', orderable: false },
|
|
{ data: 'progress_percent', name: 'progress_percent' },
|
|
{ data: 'status_label', name: 'status' },
|
|
{ data: 'planned_start_date', name: 'planned_start_date' },
|
|
{ data: 'action', name: 'action', orderable: false, searchable: false }
|
|
]
|
|
});
|
|
$('.mm-apply-filters').on('click', function() { table.ajax.reload(); });
|
|
});
|
|
</script>
|
|
@endsection
|