ultimatepos/Modules/IndustrialEngineering/Resources/views/dashboard/index.blade.php

158 lines
9.2 KiB
PHP

@extends('layouts.app')
@section('title', __('industrialengineering::lang.dashboard'))
@section('content')
@include('industrialengineering::layouts.nav')
<section class="content-header">
<h1>@lang('industrialengineering::lang.dashboard_welcome')</h1>
</section>
<section class="content">
@if(session('line_fully_resolved') && session('resolved_line_id'))
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<i class="fa fa-check-circle"></i> @lang('industrialengineering::lang.line_fully_resolved')
</div>
@endif
@if(session('status'))
<div class="alert alert-{{ session('status.success') ? 'success' : 'warning' }} alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{{ session('status.msg') }}
</div>
@endif
@if(session('integration_messages'))
@foreach(session('integration_messages') as $msg)
<div class="alert alert-{{ $msg['type'] === 'success' ? 'success' : ($msg['type'] === 'warning' ? 'warning' : 'info') }} alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<i class="fa fa-plug"></i> {{ $msg['text'] }}
</div>
@endforeach
@endif
<div class="row">
<div class="col-md-12">
<div class="callout callout-info">
<h4><i class="fa fa-rocket"></i> @lang('industrialengineering::lang.quick_start')</h4>
<p>@lang('industrialengineering::lang.quick_start_hint')</p>
@can('ie.platforms.create')
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\ProductHubController::class, 'create']) }}" class="btn btn-primary btn-sm">
<i class="fa fa-plus"></i> @lang('industrialengineering::lang.create_product')
</a>
@endcan
@canany(['ie.revisions.view', 'ie.bom.view', 'ie.platforms.view', 'ie.view', 'ie.access'])
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\ProductionLineController::class, 'index']) }}" class="btn btn-success btn-sm">
<i class="fa fa-industry"></i> @lang('industrialengineering::lang.menu_production_lines')
</a>
@endcanany
</div>
</div>
</div>
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="info-box bg-aqua">
<span class="info-box-icon"><i class="fa fa-link"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('industrialengineering::lang.erp_link_pct')</span>
<span class="info-box-number">{{ $thread['erp_link_pct'] }}%</span>
<div class="progress"><div class="progress-bar" style="width: {{ $thread['erp_link_pct'] }}%"></div></div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="info-box bg-green">
<span class="info-box-icon"><i class="fa fa-wrench"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('industrialengineering::lang.cmms_link_pct')</span>
<span class="info-box-number">{{ $thread['cmms_link_pct'] }}%</span>
<div class="progress"><div class="progress-bar" style="width: {{ $thread['cmms_link_pct'] }}%"></div></div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="info-box bg-yellow">
<span class="info-box-icon"><i class="fa fa-sitemap"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('industrialengineering::lang.bom_health')</span>
<span class="info-box-number">{{ $thread['bom_integration_health'] }}%</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="info-box bg-red">
<span class="info-box-icon"><i class="fa fa-exclamation-triangle"></i></span>
<div class="info-box-content">
<span class="info-box-text">@lang('industrialengineering::lang.total_shortage_value')</span>
<span class="info-box-number">{{ number_format($thread['total_shortage_value'], 0) }}</span>
</div>
</div>
</div>
</div>
<div class="row">
@foreach([
['label' => __('industrialengineering::lang.products'), 'value' => $stats['products'], 'color' => 'bg-aqua', 'icon' => 'fa-cube'],
['label' => __('industrialengineering::lang.production_lines'), 'value' => $stats['production_lines'], 'color' => 'bg-green', 'icon' => 'fa-industry'],
['label' => __('industrialengineering::lang.open_ecos'), 'value' => $thread['open_ecos'], 'color' => 'bg-orange', 'icon' => 'fa-exchange-alt'],
['label' => __('industrialengineering::lang.pending_releases'), 'value' => $thread['pending_releases'], 'color' => 'bg-purple', 'icon' => 'fa-check-circle'],
['label' => __('industrialengineering::lang.active_research'), 'value' => $thread['active_research'], 'color' => 'bg-navy', 'icon' => 'fa-flask'],
['label' => __('industrialengineering::lang.mrp_runs_month'), 'value' => $thread['mrp_runs_month'], 'color' => 'bg-teal', 'icon' => 'fa-cogs'],
] as $card)
<div class="col-md-4 col-sm-6">
<div class="info-box {{ $card['color'] }}">
<span class="info-box-icon"><i class="fa {{ $card['icon'] }}"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ $card['label'] }}</span>
<span class="info-box-number">{{ $card['value'] }}</span>
</div>
</div>
</div>
@endforeach
</div>
@if(!empty($thread['lines_needing_attention']))
<div class="row">
<div class="col-md-12">
<div class="box box-warning">
<div class="box-header"><h3 class="box-title"><i class="fa fa-bell"></i> @lang('industrialengineering::lang.lines_needing_attention')</h3></div>
<div class="box-body table-responsive">
<table class="table table-striped">
<thead><tr><th>@lang('industrialengineering::lang.production_line')</th><th>@lang('industrialengineering::lang.issues')</th><th></th></tr></thead>
<tbody>
@foreach($thread['lines_needing_attention'] as $row)
<tr class="{{ ($row['status'] ?? '') === 'erp_pending' ? 'warning' : '' }}">
<td>
{{ $row['line']->name }}
@if(($row['erp_unlinked'] ?? 0) > 0)
<br><small class="text-muted">{{ __('industrialengineering::lang.unlinked_count', ['n' => $row['erp_unlinked']]) }}</small>
@endif
</td>
<td><ul class="list-unstyled" style="margin:0">@foreach($row['issues'] as $issue)<li class="text-warning"><i class="fa fa-exclamation-circle"></i> {{ $issue }}</li>@endforeach</ul></td>
<td nowrap>
@if(($row['status'] ?? '') === 'empty_bom')
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\ProductionLineController::class, 'structure'], $row['line']->id) }}" class="btn btn-xs btn-primary">
<i class="fa fa-plus"></i> @lang('industrialengineering::lang.add_parts')
</a>
@else
<form method="POST" action="{{ action([\Modules\IndustrialEngineering\Http\Controllers\LineOperationsController::class, 'resolveConnections'], $row['line']->id) }}" style="display:inline">
@csrf
<input type="hidden" name="redirect_to" value="dashboard">
<input type="hidden" name="sync_cmms" value="1">
<button type="submit" class="btn btn-xs btn-warning" title="@lang('industrialengineering::lang.auto_resolve_connections')">
<i class="fa fa-magic"></i> @lang('industrialengineering::lang.fix_connections')
</button>
</form>
@endif
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\ProductionLineController::class, 'structure'], $row['line']->id) }}" class="btn btn-xs btn-default" title="@lang('industrialengineering::lang.edit_structure')">
<i class="fa fa-sitemap"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif
</section>
@endsection