158 lines
8.8 KiB
PHP
158 lines
8.8 KiB
PHP
@extends('layouts.app')
|
|
@section('title', $platform->name)
|
|
@section('content')
|
|
@include('industrialengineering::layouts.nav')
|
|
<section class="content-header">
|
|
<h1>
|
|
<i class="fa fa-cube"></i> {{ $platform->name }}
|
|
<small>{{ $platform->effectiveCode() }}</small>
|
|
@if($platform->auto_code && $platform->auto_code !== $platform->platform_code)
|
|
<span class="label label-default">@lang('industrialengineering::lang.system_code'): {{ $platform->auto_code }}</span>
|
|
@endif
|
|
</h1>
|
|
</section>
|
|
<section class="content">
|
|
@if(session('status'))
|
|
<div class="alert alert-{{ session('status.success') ? 'success' : 'danger' }} alert-dismissible">
|
|
<button type="button" class="close" data-dismiss="alert">×</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">×</button>
|
|
<i class="fa fa-plug"></i> {{ $msg['text'] }}
|
|
</div>
|
|
@endforeach
|
|
@endif
|
|
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<div class="box box-solid box-primary">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title">@lang('industrialengineering::lang.add_production_line')</h3>
|
|
</div>
|
|
{!! Form::open(['url' => action([\Modules\IndustrialEngineering\Http\Controllers\ProductHubController::class, 'storeLine'], $platform->id), 'method' => 'post']) !!}
|
|
<div class="box-body">
|
|
<div class="form-group">
|
|
{!! Form::label('template_code', __('industrialengineering::lang.manual_code_optional')) !!}
|
|
{!! Form::text('template_code', null, ['class' => 'form-control', 'placeholder' => $suggestedLineCode]) !!}
|
|
</div>
|
|
<div class="form-group">
|
|
{!! Form::label('name', __('industrialengineering::lang.line_name')) !!}
|
|
{!! Form::text('name', null, ['class' => 'form-control', 'required', 'placeholder' => __('industrialengineering::lang.line_name_placeholder')]) !!}
|
|
</div>
|
|
<div class="form-group">
|
|
{!! Form::label('description', __('industrialengineering::lang.description')) !!}
|
|
{!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => 2]) !!}
|
|
</div>
|
|
</div>
|
|
<div class="box-footer">
|
|
<button type="submit" class="btn btn-primary btn-block"><i class="fa fa-plus"></i> @lang('industrialengineering::lang.add_line')</button>
|
|
</div>
|
|
{!! Form::close() !!}
|
|
</div>
|
|
|
|
<div class="box box-default">
|
|
<div class="box-header"><h3 class="box-title">@lang('industrialengineering::lang.product_info')</h3></div>
|
|
<div class="box-body">
|
|
<dl class="dl-horizontal">
|
|
<dt>@lang('industrialengineering::lang.system_code')</dt><dd>{{ $platform->auto_code ?? '—' }}</dd>
|
|
<dt>@lang('industrialengineering::lang.code')</dt><dd>{{ $platform->platform_code }}</dd>
|
|
<dt>@lang('industrialengineering::lang.industry_segment')</dt><dd>{{ $platform->industry_segment ?? '—' }}</dd>
|
|
<dt>@lang('industrialengineering::lang.production_lines')</dt><dd>{{ count($structure) }}</dd>
|
|
</dl>
|
|
@if($platform->description)<p>{{ $platform->description }}</p>@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
|
@forelse($structure as $idx => $block)
|
|
@php $line = $block['line']; $revision = $block['revision']; $mbom = $block['mbom']; @endphp
|
|
<div class="box box-success">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title">
|
|
<i class="fa fa-industry"></i>
|
|
{{ $line->name }}
|
|
<small class="text-muted">{{ $line->effectiveCode() }}</small>
|
|
</h3>
|
|
@if($revision)
|
|
<span class="label label-{{ $revision->status === 'released' ? 'success' : 'warning' }} pull-left" style="margin-left:8px">
|
|
@lang('industrialengineering::lang.revision') {{ $revision->revision_code }} — {{ __('industrialengineering::lang.status_'.$revision->status) }}
|
|
</span>
|
|
@endif
|
|
</div>
|
|
<div class="box-body">
|
|
@if($line->description)<p class="text-muted">{{ $line->description }}</p>@endif
|
|
|
|
@if($revision)
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>@lang('industrialengineering::lang.add_machine')</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
{!! Form::open(['url' => action([\Modules\IndustrialEngineering\Http\Controllers\ProductHubController::class, 'storeMachine'], [$platform->id, $revision->id]), 'method' => 'post', 'class' => 'form-inline']) !!}
|
|
<div class="form-group">
|
|
<input type="text" name="name" class="form-control" placeholder="@lang('industrialengineering::lang.machine_name')" required style="min-width:180px">
|
|
</div>
|
|
<div class="form-group">
|
|
<input type="text" name="item_code" class="form-control" placeholder="@lang('industrialengineering::lang.manual_code_optional')" style="width:140px">
|
|
</div>
|
|
<div class="form-group">
|
|
<input type="text" name="position_code" class="form-control" placeholder="@lang('industrialengineering::lang.position')" style="width:80px">
|
|
</div>
|
|
<button type="submit" class="btn btn-sm btn-success"><i class="fa fa-cog"></i> @lang('industrialengineering::lang.add_machine')</button>
|
|
{!! Form::close() !!}
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<h4><i class="fa fa-sitemap"></i> @lang('industrialengineering::lang.structure_tree')</h4>
|
|
@if(empty($block['tree']))
|
|
<p class="text-muted">@lang('industrialengineering::lang.no_machines_yet')</p>
|
|
@else
|
|
<div style="margin-right:12px">
|
|
@include('industrialengineering::partials.bom_tree', ['nodes' => $block['tree']])
|
|
</div>
|
|
@endif
|
|
|
|
@if($mbom)
|
|
<div class="text-left" style="margin-top:12px">
|
|
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\ProductionLineController::class, 'structure'], $line->id) }}" class="btn btn-sm btn-primary">
|
|
<i class="fa fa-sitemap"></i> @lang('industrialengineering::lang.open_structure_editor')
|
|
</a>
|
|
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\BomController::class, 'show'], $mbom->id) }}" class="btn btn-sm btn-default">
|
|
<i class="fa fa-list"></i> @lang('industrialengineering::lang.bom_flat')
|
|
</a>
|
|
@if($revision)
|
|
<a href="{{ action([\Modules\IndustrialEngineering\Http\Controllers\CostScenarioController::class, 'create'], ['line_revision_id' => $revision->id]) }}" class="btn btn-sm btn-warning">
|
|
<i class="fa fa-calculator"></i> @lang('industrialengineering::lang.cost_scenario')
|
|
</a>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<div class="box box-default">
|
|
<div class="box-body text-center text-muted" style="padding:40px">
|
|
<i class="fa fa-industry fa-3x"></i>
|
|
<p style="margin-top:16px">@lang('industrialengineering::lang.add_first_line_hint')</p>
|
|
</div>
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|
|
|
|
@section('css')
|
|
<style>
|
|
.ie-tree-machine { margin-bottom: 16px; }
|
|
.ie-tree-node { padding: 6px 0; font-size: 15px; }
|
|
.ie-tree-part { padding: 4px 0; font-size: 13px; }
|
|
</style>
|
|
@endsection
|