diff --git a/app/Http/Controllers/ProjectoDatacontroller.php b/app/Http/Controllers/ProjectoDatacontroller.php index 79ba123e..a77fd08d 100755 --- a/app/Http/Controllers/ProjectoDatacontroller.php +++ b/app/Http/Controllers/ProjectoDatacontroller.php @@ -11,16 +11,25 @@ use App\Models\Equipment; use App\Models\Plant; use App\Models\CompanyProject; - - - - +use App\Models\User; use App\Models\ConstructionWorkstation; +use App\Models\EquipmentType; +use Mockery\Undefined; class ProjectoDatacontroller extends Controller { + public function receivePlants($clientId){ + if($clientId == 'all'){ + $allPlants = Plant::all(); + return response()->json($allPlants); + } + dd($clientId); + + } + + public function getEquipmentDetails($receiveListEquipmentId) { $ids = explode(',', $receiveListEquipmentId); @@ -88,8 +97,10 @@ public function ManageAssets() // ->select('equipaments.*', 'factories.factories_name', 'equipament_types.equipment_type_name') // ->get(); - // return view('Admin/DataManagement/manageassets', compact('units','equipaments')); - return view('Admin/DataManagement/manageassets', compact('units', 'equipments')); + $allEquipmentType = EquipmentType::all(); + $allClients = User::where('type_users', 3)->get(); + + return view('Admin/DataManagement/manageassets', compact('units', 'equipments','allEquipmentType','allClients')); } public function showUnit($id) @@ -99,6 +110,8 @@ public function showUnit($id) return view('Admin/DataManagement/showEquipament', compact('equipaments')); } + + public function receiveEquipmentsProject($receiveNumberProject) @@ -130,7 +143,6 @@ public function receiveEquipmentsProject($receiveNumberProject) ->where('company_projects_id', $receiveNumberProject); } } - return DataTables::of($model) ->addColumn('equipment_type', function ($row) { return $row->equipmentType->equipment_type_name; @@ -157,6 +169,22 @@ public function receiveEquipmentsProject($receiveNumberProject) ->toJson(); } + public function receiveAllEquipments() + { + $model = Equipment::all(); + // ->with(['equipmentType', 'unit']); + + + return DataTables::of($model) + // ->addColumn('equipment_type', function ($row) { + // return $row->equipmentType->equipment_type_name; + // }) + // ->addColumn('Unit', function ($row) { + // return $row->unit->unit_name; + // }) + ->toJson(); + } + public function receiveWorkstationProject($receiveNumberProject) { $model = ConstructionWorkstation::where('company_projects_id', $receiveNumberProject)->with('workstationsAssociationTasks'); diff --git a/public/assets/dist/css/adminlte.css b/public/assets/dist/css/adminlte.css index 272d226e..59932698 100644 --- a/public/assets/dist/css/adminlte.css +++ b/public/assets/dist/css/adminlte.css @@ -2655,6 +2655,14 @@ .show > .btn-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 0 rgba(130, 138, 145, 0.5); } + +.btn-test{ + color: #fff; + background-color: purple; + border-color: purple; + box-shadow: none; +} + .btn-success { color: #fff; background-color: #28a745; diff --git a/resources/views/Admin/DataManagement/manageassets.blade.php b/resources/views/Admin/DataManagement/manageassets.blade.php index fb5ab2ed..257b1218 100755 --- a/resources/views/Admin/DataManagement/manageassets.blade.php +++ b/resources/views/Admin/DataManagement/manageassets.blade.php @@ -23,722 +23,389 @@
- -
-
-
-

Instalações

+
+
+ +
+
+ Criar + ativos -
- -
- -
- -
- -
-
-

Inserir nova instalação

- -
- -
-
- -
-
- - -
-
- - -
-
- - -
-
- - - -
- - - - - - - - - - - @foreach ($units as $unit) + + +
+ +
+
+

Tabela de Ativos

+
+ +
+
+
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+ + +
+ +
+
+
InstalaçãoFábricaClienteEditar
+ - - - - - + + + + - @endforeach - -
{{ $unit->unit_name }}{{ $unit->plant_name }}{{ $unit->user_name }} - - - - - - TagTipo EquipamentoFábricasDescrição Equipamento
-
- -
-
- - - - - - -
-
-
-

Equipamentos

- -
- -
- -
- -
- -
-
-

Inserir novo equipamento

- -
- -
-
-
- -
- - -
- -
- - -
- - -
-
-

PSV

-
- -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- -
- - -
-
-

Válvula de isolamento

-
- -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- -
- -
-
-

Válvula de controlo

-
- -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
-
-
- -
- -
-
- - -
-
-
- + +
+ - + +
+ {{-- ./cardAssetsTable --}} - -
- - - - - - - - - - - - - - - - @foreach ($equipments as $equipment) - - - - - - - - - - - - - @endforeach - -
ID equipamentoFabricaTipo equipamentoTagDescrição equipamentoNúmero de Serie MarcaModeloEdicao
{{ $equipment->equipment_id }}{{ $equipment->unit_id }}{{ $equipment->equipment_type_id }}{{ $equipment->equipment_tag }}{{ $equipment->equipment_description }}{{ $equipment->equipment_serial_number }}{{ $equipment->equipment_brand }}{{ $equipment->equipment_model }} - {{-- --}} - - - - - - - -
-
- +
+
- - - -
+
- - - - - - - - - - - - - - - - - - - - @endsection @section('scriptsTemplateAdmin') - + - + $('#receiveAllClients').on('change', function(){ + var receiveAllClients = $(this).val(); + console.log(receiveAllClients); + if(receiveAllClients) { + $.ajax({ + url: '/api/receivePlants/' + receiveAllClients, + type: 'GET', + success: function(data) { + console.log(data); + } + }) + } + }) + }) + + + + + + + + @endsection diff --git a/resources/views/projectsClients/createProject.blade.php b/resources/views/projectsClients/createProject.blade.php index ce562c38..05a1219e 100755 --- a/resources/views/projectsClients/createProject.blade.php +++ b/resources/views/projectsClients/createProject.blade.php @@ -91,7 +91,7 @@
- +
@@ -99,7 +99,7 @@
- +
diff --git a/resources/views/projectsClients/preparedProject.blade.php b/resources/views/projectsClients/preparedProject.blade.php index 90a6431d..a2a7a8c1 100755 --- a/resources/views/projectsClients/preparedProject.blade.php +++ b/resources/views/projectsClients/preparedProject.blade.php @@ -95,7 +95,7 @@ class="btn btn-block bg-gradient-primary btn-lg">Articulado
{{-- Editar --}} - @@ -114,8 +114,8 @@ class="btn btn-block bg-gradient-primary btn-lg">Articulado

Articulado

+ class="fas fa-plus"> + -->
@@ -200,7 +200,7 @@ class="form-control"> @@ -274,7 +274,8 @@ class="form-control">
- +
@@ -289,7 +290,7 @@ class="form-control"> + /.modal-dialog --> @@ -525,7 +526,7 @@ class="checkboxChoseTasksOficesCV" - + - @endsection {{-- // ajax: { @@ -718,4 +718,4 @@ class="checkboxChoseTasksOficesCV" // d.ambits_id = $('#AmbitsEquipments_list').val(); // d.inspec = $('#inspecValvula').val(); // }, - // }, --}} \ No newline at end of file + // }, --}} diff --git a/routes/api.php b/routes/api.php index 889937e1..4fa18d6b 100755 --- a/routes/api.php +++ b/routes/api.php @@ -1,5 +1,6 @@ get('/user', function (Request $request) { return $request->user(); }); + +Route::get('receivePlants/{clientId}',[ProjectoDatacontroller::class,'receivePlants']); \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 14b64574..f52f5922 100755 --- a/routes/web.php +++ b/routes/web.php @@ -41,6 +41,7 @@ Route::get('/ReceiveEquipmentIdForShowModal/{EquipmentID}',[ExecutionProjectController::class,'receiveEquipmentIdForShowModal'])->name('ReceiveEquipmentIdForShowModal '); // Route::get('/api/receiveEquipmentsExecutionProject/{receiveNumberProject}',[ExecutionProjectController::class,'receiveEquipmentsExecutionProject'])->name('receiveEquipmentsExecutionProject'); +Route::get('/api/receiveAllEquipments',[ProjectoDatacontroller::class,'receiveAllEquipments']); Route::get('/api/receiveEquipmentsProject/{receiveNumberProject}',[ProjectoDatacontroller::class,'receiveEquipmentsProject']); Route::get('/api/receiveWorkstationProject/{receiveNumberProject}',[ProjectoDatacontroller::class,'receiveWorkstationProject' ]);
Postos de Trabalho