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

73 lines
3.2 KiB
PHP

@extends('layouts.app')
@section('title', __('maintenance::lang.work_orders'))
@section('content')
@include('maintenance::layouts.nav')
<section class="content no-print mt-page">
<div class="mt-page-header">
<h1><i class="fas fa-clipboard-list" style="color:#14b8a6;margin-left:8px;"></i> @lang('maintenance::lang.work_orders')</h1>
@can('maintenance.work_orders.create')
<a href="{{ action([\Modules\Maintenance\Http\Controllers\WorkOrderController::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_work_orders')</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_work_orders_table" style="width:100%">
<thead>
<tr>
<th>@lang('maintenance::lang.work_order_number')</th>
<th>@lang('maintenance::lang.equipment')</th>
<th>@lang('maintenance::lang.assigned_technician')</th>
<th>@lang('maintenance::lang.priority')</th>
<th>@lang('maintenance::lang.status')</th>
<th>@lang('maintenance::lang.scheduled_at')</th>
<th>@lang('maintenance::lang.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_work_orders_table').DataTable({
processing: true, serverSide: true,
ajax: {
url: '{{ action([\Modules\Maintenance\Http\Controllers\WorkOrderController::class, "index"]) }}',
data: function(d) {
d.project_id = $('.mm-filter-project').val();
d.production_line_id = $('.mm-filter-line').val();
d.equipment_id = $('.mm-filter-equipment').val();
d.status = $('.mm-filter-status').val();
}
},
columns: [
{ data: 'work_order_number', name: 'work_order_number' },
{ data: 'equipment_name', name: 'equipment_name', orderable: false },
{ data: 'technician_name', name: 'technician_name', orderable: false },
{ data: 'priority_label', name: 'priority' },
{ data: 'status_label', name: 'status' },
{ data: 'scheduled_at', name: 'scheduled_at' },
{ data: 'cost', name: 'cost' },
{ data: 'action', name: 'action', orderable: false, searchable: false }
]
});
$('.mm-apply-filters').on('click', function() { table.ajax.reload(); });
});
</script>
@endsection