bug fixes for the work in progress, change to yajra in prepared works and qrcode searches
This commit is contained in:
parent
2ce2e0d455
commit
e712ff2a27
File diff suppressed because it is too large
Load Diff
|
|
@ -51,7 +51,6 @@ public function changeStateProject($projectId)
|
||||||
|
|
||||||
public function deleteProject($projectId)
|
public function deleteProject($projectId)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Encontra o projeto pelo ID
|
// Encontra o projeto pelo ID
|
||||||
$deleteProject = CompanyProject::where('company_projects_id', $projectId)->first();
|
$deleteProject = CompanyProject::where('company_projects_id', $projectId)->first();
|
||||||
|
|
||||||
|
|
@ -845,7 +844,6 @@ public function CreateNewEquipmentFromPendingEquipment(Request $request, $id)
|
||||||
|
|
||||||
public function processStep1(Request $request)
|
public function processStep1(Request $request)
|
||||||
{
|
{
|
||||||
dd($request);
|
|
||||||
//NAO DEVE SER CRIAR UMA NOVA EMPRESA NA CRIACAO DA OBRA (era uma boa ideia para facilitar ao Admin ter que criar a empresa para Depois a Obra, mas e necessario pelo facto da autentificao de 2 factores e envio e email , entao devido essa adicoes, nao preciso atualmente fazer sentido criar isto)
|
//NAO DEVE SER CRIAR UMA NOVA EMPRESA NA CRIACAO DA OBRA (era uma boa ideia para facilitar ao Admin ter que criar a empresa para Depois a Obra, mas e necessario pelo facto da autentificao de 2 factores e envio e email , entao devido essa adicoes, nao preciso atualmente fazer sentido criar isto)
|
||||||
// Dito isto vamos sempre pensar que o Cliente ja deve estar criado , para ser feita uma Obra para o mesmo.
|
// Dito isto vamos sempre pensar que o Cliente ja deve estar criado , para ser feita uma Obra para o mesmo.
|
||||||
// dd($request);
|
// dd($request);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public function getDataEquipmentClient(Request $request)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$query = Equipment::with('equipmentType', 'unit')
|
$query = Equipment::with('equipmentType', 'unit', 'equipmentWorkHistory', 'equipmentAssociationAmbit', 'ambitsEquipment')
|
||||||
->whereIn('unit_id', $unitsIds)
|
->whereIn('unit_id', $unitsIds)
|
||||||
->select(['equipment_id', 'ispt_number', 'equipment_tag', 'unit_id', 'equipment_type_id']);
|
->select(['equipment_id', 'ispt_number', 'equipment_tag', 'unit_id', 'equipment_type_id']);
|
||||||
|
|
||||||
|
|
@ -71,10 +71,13 @@ public function getDataEquipmentClient(Request $request)
|
||||||
|
|
||||||
public function getDataEquipment(Request $request)
|
public function getDataEquipment(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
//Variaveis recebidos da Obra em Planeamento (Filtros)
|
//Variaveis recebidos da Obra em Planeamento (Filtros)
|
||||||
$numberProject = $request->get('numberProject');
|
$numberProject = $request->get('numberProject');
|
||||||
$receiveRespostUnitsSelect = $request->get('checkUnits');
|
$receiveRespostUnitsSelect = $request->get('checkUnits');
|
||||||
$receiveRespostPlatsSelect = $request->get('tipo_valvulasList');
|
|
||||||
|
// Tanto para em Planeamento como gestor de Ativos.
|
||||||
|
$receiveTypeValveSelected = $request->get('tipo_valvulasList');
|
||||||
|
|
||||||
// Variaveis recebidas da gestao de ativos (Filtros)
|
// Variaveis recebidas da gestao de ativos (Filtros)
|
||||||
$receiveAllClients = $request->get('receiveAllClients');
|
$receiveAllClients = $request->get('receiveAllClients');
|
||||||
|
|
@ -82,10 +85,7 @@ public function getDataEquipment(Request $request)
|
||||||
$receiveAllUnits = $request->get('receiveAllUnits');
|
$receiveAllUnits = $request->get('receiveAllUnits');
|
||||||
$receiveEquipmentsType = $request->get('receiveEquipmentsType');
|
$receiveEquipmentsType = $request->get('receiveEquipmentsType');
|
||||||
|
|
||||||
|
// Se receber o numero do projecto. /Se existir
|
||||||
|
|
||||||
|
|
||||||
// Se receber o numero do projecto.
|
|
||||||
if ($numberProject) {
|
if ($numberProject) {
|
||||||
|
|
||||||
// Query para DataTables do Planeamento
|
// Query para DataTables do Planeamento
|
||||||
|
|
@ -97,8 +97,8 @@ public function getDataEquipment(Request $request)
|
||||||
$query->where('unit_id', $receiveRespostUnitsSelect);
|
$query->where('unit_id', $receiveRespostUnitsSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($receiveRespostPlatsSelect && $receiveRespostPlatsSelect !== '#') {
|
if ($receiveTypeValveSelected && $receiveTypeValveSelected !== '#') {
|
||||||
$query->where('equipment_type_id', $receiveRespostPlatsSelect);
|
$query->where('equipment_type_id', $receiveTypeValveSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executa a consulta e obtém os resultados
|
// Executa a consulta e obtém os resultados
|
||||||
|
|
@ -157,6 +157,7 @@ public function getDataEquipment(Request $request)
|
||||||
})
|
})
|
||||||
->make(true);
|
->make(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Query padrão que todas as dataTables recebem, a partir dele fazemos os filt
|
// Query padrão que todas as dataTables recebem, a partir dele fazemos os filt
|
||||||
$query = Equipment::with('equipmentType', 'unit')
|
$query = Equipment::with('equipmentType', 'unit')
|
||||||
->select(['equipment_id', 'equipment_tag', 'unit_id', 'equipment_type_id', 'equipment_description']);
|
->select(['equipment_id', 'equipment_tag', 'unit_id', 'equipment_type_id', 'equipment_description']);
|
||||||
|
|
@ -165,7 +166,7 @@ public function getDataEquipment(Request $request)
|
||||||
if ($receiveAllClients && $receiveAllClients !== '#') {
|
if ($receiveAllClients && $receiveAllClients !== '#') {
|
||||||
// Filtra os equipamentos cujas unidades estão associadas às plantas do usuário especificado
|
// Filtra os equipamentos cujas unidades estão associadas às plantas do usuário especificado
|
||||||
$query->whereHas('unit.plant', function ($query) use ($receiveAllClients) {
|
$query->whereHas('unit.plant', function ($query) use ($receiveAllClients) {
|
||||||
$query->where('user_id', $receiveAllClients);
|
$query->where('company_id', $receiveAllClients);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//Filtar equipamentos por uma instalacao .
|
//Filtar equipamentos por uma instalacao .
|
||||||
|
|
@ -190,7 +191,11 @@ public function getDataEquipment(Request $request)
|
||||||
return DataTables::of($equipment)
|
return DataTables::of($equipment)
|
||||||
|
|
||||||
->addColumn('client_name', function ($equipment) {
|
->addColumn('client_name', function ($equipment) {
|
||||||
return $equipment->unit->plant->user ? $equipment->unit->plant->user->user_name : 'N/A';
|
return $equipment->unit->plant->company ? $equipment->unit->plant->company->company_name : 'N/A';
|
||||||
|
})
|
||||||
|
|
||||||
|
->addColumn('plant_name', function ($equipment) {
|
||||||
|
return $equipment->unit->plant ? $equipment->unit->plant->plant_name : 'N/A';
|
||||||
})
|
})
|
||||||
|
|
||||||
->addColumn('unit_name', function ($equipment) {
|
->addColumn('unit_name', function ($equipment) {
|
||||||
|
|
@ -217,10 +222,9 @@ public function getDataEquipment(Request $request)
|
||||||
</a>';
|
</a>';
|
||||||
// Adiciona a ação para abrir a modal para apagar
|
// Adiciona a ação para abrir a modal para apagar
|
||||||
$dropdownHtml .= '<button class="dropdown-item text-primary" data-toggle="modal" data-target="#modal-confirmDeleteEquipmentInProject-' . $equipment->equipment_id . '">
|
$dropdownHtml .= '<button class="dropdown-item text-primary" data-toggle="modal" data-target="#modal-confirmDeleteEquipmentInProject-' . $equipment->equipment_id . '">
|
||||||
<i class="fa-solid fa-trash text-primary"></i>
|
<i class="fa-solid fa-trash text-primary"></i>
|
||||||
Apagar
|
Apagar
|
||||||
</button>';
|
</button>';
|
||||||
|
|
||||||
|
|
||||||
// Adicionar outras ações aqui, como editar e deletar, conforme necessário
|
// Adicionar outras ações aqui, como editar e deletar, conforme necessário
|
||||||
//Adicionar o "Apagar" e "Trocar de Ambito"
|
//Adicionar o "Apagar" e "Trocar de Ambito"
|
||||||
|
|
@ -230,14 +234,59 @@ public function getDataEquipment(Request $request)
|
||||||
return $dropdownHtml;
|
return $dropdownHtml;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
->make(true);
|
->make(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDetailsEquipmentQrcode(Request $request)
|
||||||
|
{
|
||||||
|
// Filtros de pesquisa
|
||||||
|
$equipmentTypeSelected = $request->get('equipmentTypeSelected');
|
||||||
|
$unitSelected = $request->get('unitSelected');
|
||||||
|
|
||||||
|
// Recebe o Id do projecto atual
|
||||||
|
$receiveNumberProject = $request->get('receiveNumberProject');
|
||||||
|
|
||||||
|
$initialQuery = Equipment::where('company_projects_id', $receiveNumberProject);
|
||||||
|
|
||||||
|
//Filtrar por tipo de equipamento
|
||||||
|
if ($equipmentTypeSelected && $equipmentTypeSelected !== '#') {
|
||||||
|
$initialQuery->where('equipment_type_id', $equipmentTypeSelected);
|
||||||
|
}
|
||||||
|
//Filtrar por Uma fabrica
|
||||||
|
if ($unitSelected && $unitSelected !== '#') {
|
||||||
|
$initialQuery->where('unit_id', $unitSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $initialQuery->get();
|
||||||
|
|
||||||
|
return DataTables::of($query)
|
||||||
|
|
||||||
|
->addColumn('equipment_type_name', function ($query) {
|
||||||
|
// Retorna 'equipment_type_name' do relacionamento 'equipmentType'
|
||||||
|
return $query->equipmentType ? $query->equipmentType->equipment_type_name : 'N/A';
|
||||||
|
})
|
||||||
|
->addColumn('unit_name', function ($query) {
|
||||||
|
// Retorna 'unit_name' do relacionamento 'unit'
|
||||||
|
return $query->unit ? $query->unit->unit_name : 'N/A';
|
||||||
|
})
|
||||||
|
->addColumn('ambit_name', function ($query) {
|
||||||
|
$firstEquipmentWorkHistory = $query->equipmentWorkHistory->first();
|
||||||
|
return $firstEquipmentWorkHistory->equipmentAssociationAmbit->ambitsEquipment->ambits_description;
|
||||||
|
})
|
||||||
|
|
||||||
|
->addColumn('action', function ($equipment) use ($receiveNumberProject) {
|
||||||
|
$pdfUrl = route('showDetailsEquipmentForQrCode', ['equipmentId' => $equipment->equipment_id, 'projectId' => $receiveNumberProject]);
|
||||||
|
|
||||||
|
// Retorna apenas a ação para visualizar o PDF
|
||||||
|
$dropdownHtml = ' <a href="' . $pdfUrl . '" class="dropdown-item text-primary">
|
||||||
|
<i class="fa-solid fa-file-pdf"></i>
|
||||||
|
Visualizar PDF
|
||||||
|
</a>';
|
||||||
|
return $dropdownHtml;
|
||||||
|
})
|
||||||
|
->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
public function getDataEquipment1(Request $request)
|
public function getDataEquipment1(Request $request)
|
||||||
{
|
{
|
||||||
|
|
@ -534,6 +583,27 @@ public function receiveEquipmentIdForShowModal($EquipmentID)
|
||||||
return response()->json(['task_codes' => $task_codes, 'receveControlEquipment' => $receveControlEquipment, 'receiveCommentsEquipment' => $receiveCommentsEquipment]);
|
return response()->json(['task_codes' => $task_codes, 'receveControlEquipment' => $receveControlEquipment, 'receiveCommentsEquipment' => $receiveCommentsEquipment]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showQrcodesInProject($projectNumber)
|
||||||
|
{
|
||||||
|
|
||||||
|
$numberProject = CompanyProject::find($projectNumber);
|
||||||
|
|
||||||
|
$equipmentsTypes = EquipmentType::all();
|
||||||
|
|
||||||
|
$plant = Plant::where('plant_id', $numberProject->plant_id)->first();
|
||||||
|
|
||||||
|
$unitsProject = Unit::where('plant_id', $plant->plant_id)->get();
|
||||||
|
|
||||||
|
// Carrega todos os equipamentos para um dado projeto
|
||||||
|
$equipmentsProjects = Equipment::where('company_projects_id', $projectNumber)->get();
|
||||||
|
|
||||||
|
return view('projectsClients/showQrcodesInProject')
|
||||||
|
->with('numberProject', $numberProject)
|
||||||
|
->with('unitsProject', $unitsProject)
|
||||||
|
->with('equipmentsTypes', $equipmentsTypes)
|
||||||
|
->with('equipmentsProjects', $equipmentsProjects);
|
||||||
|
}
|
||||||
|
|
||||||
// public function receiveEquipmentsExecutionProject($receiveNumberProject)
|
// public function receiveEquipmentsExecutionProject($receiveNumberProject)
|
||||||
// {
|
// {
|
||||||
// // Recebe os dados vindos da funcao 'data' criada na view
|
// // Recebe os dados vindos da funcao 'data' criada na view
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public function validateForm(Request $request)
|
||||||
{
|
{
|
||||||
$value = $request->get('value');
|
$value = $request->get('value');
|
||||||
$type = $request->get('type');
|
$type = $request->get('type');
|
||||||
|
|
||||||
|
|
||||||
// Inicializa os resultados como null para indicar que não foram verificados
|
// Inicializa os resultados como null para indicar que não foram verificados
|
||||||
$resultEmail = null;
|
$resultEmail = null;
|
||||||
|
|
@ -97,13 +97,25 @@ public function ListPendingUsers()
|
||||||
public function ShowFormUser($id)
|
public function ShowFormUser($id)
|
||||||
{
|
{
|
||||||
$pend_user = PendingUser::findOrFail($id);
|
$pend_user = PendingUser::findOrFail($id);
|
||||||
$types = TypeUser::all();
|
$allTypes = TypeUser::all();
|
||||||
$allCompanies = Company::all();
|
$allCompanies = Company::all();
|
||||||
|
|
||||||
return view('Admin.CrudUsers.createUser', compact('pend_user', 'types','allCompanies'));
|
// Verifica se o usuário autenticado é de um tipo específico
|
||||||
|
if (auth()->user()->type_users == 1) {
|
||||||
|
// Se o usuário autenticado tem tipo '1', envia todos os tipos
|
||||||
|
$types = $allTypes;
|
||||||
|
} else {
|
||||||
|
// Caso contrário, filtra os tipos para excluir o tipo '1'
|
||||||
|
$types = $allTypes->reject(function ($type) {
|
||||||
|
return $type->type_user_id == 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('Admin.CrudUsers.createUser', compact('pend_user', 'types', 'allCompanies'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
// dd($request);
|
// dd($request);
|
||||||
|
|
@ -115,7 +127,7 @@ public function store(Request $request)
|
||||||
'pending_nif' => 'required',
|
'pending_nif' => 'required',
|
||||||
'pending_password' => 'required|min:8|confirmed',
|
'pending_password' => 'required|min:8|confirmed',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$joinName = $request->get('name') . ' ' . $request->get('lastName');
|
$joinName = $request->get('name') . ' ' . $request->get('lastName');
|
||||||
|
|
||||||
$pendingUser = new PendingUser();
|
$pendingUser = new PendingUser();
|
||||||
|
|
@ -128,9 +140,9 @@ public function store(Request $request)
|
||||||
$pendingUser->save();
|
$pendingUser->save();
|
||||||
|
|
||||||
//Recebe o token criado para preencher o formulario e apaga o mesmo apos criar o User.
|
//Recebe o token criado para preencher o formulario e apaga o mesmo apos criar o User.
|
||||||
$receiveToken = FormAccessToken::where('token',$request->get('receiveToken'))->first();
|
$receiveToken = FormAccessToken::where('token', $request->get('receiveToken'))->first();
|
||||||
|
|
||||||
if($receiveToken){
|
if ($receiveToken) {
|
||||||
$receiveToken->delete();
|
$receiveToken->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,6 @@ public function PreparedProject($ProjectId)
|
||||||
->where('company_projects.company_projects_id', '=', $numberProject->company_projects_id)
|
->where('company_projects.company_projects_id', '=', $numberProject->company_projects_id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
// dd($equipmentsProjects);
|
|
||||||
return view('projectsClients/preparedProject')
|
return view('projectsClients/preparedProject')
|
||||||
->with('equipmentsTypes', $equipmentsTypes)
|
->with('equipmentsTypes', $equipmentsTypes)
|
||||||
->with('units', $checkUnits)
|
->with('units', $checkUnits)
|
||||||
|
|
|
||||||
|
|
@ -620,12 +620,6 @@ public function ManageAssets()
|
||||||
|
|
||||||
$equipments = Equipment::all();
|
$equipments = Equipment::all();
|
||||||
|
|
||||||
// $equipaments = DB::table('equipaments')
|
|
||||||
// ->join('factories','equipaments.factory_id', '=', 'factories.factories_id')
|
|
||||||
// ->join('equipament_types', 'equipaments.equipament_type_id', '=' , 'equipament_types.equipament_type_id')
|
|
||||||
// ->select('equipaments.*', 'factories.factories_name', 'equipament_types.equipment_type_name')
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
$allEquipmentType = EquipmentType::all();
|
$allEquipmentType = EquipmentType::all();
|
||||||
|
|
||||||
$allClients = Company::all();
|
$allClients = Company::all();
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ protected function getAllowedRoutesForUserType($userType)
|
||||||
'deletePendingEquipments','CreateNewEquipmentFromPendingEquipment','removeEquipment','receiveEquipmentToAssociateTasks',
|
'deletePendingEquipments','CreateNewEquipmentFromPendingEquipment','removeEquipment','receiveEquipmentToAssociateTasks',
|
||||||
'createCompany','ShowPendingUser','register','download','projectDetails_11','editEquipment','EditprocessStep1','createWorkStations','workstationsAssociationTasks','finishCreatingProject',
|
'createCompany','ShowPendingUser','register','download','projectDetails_11','editEquipment','EditprocessStep1','createWorkStations','workstationsAssociationTasks','finishCreatingProject',
|
||||||
'preparedProject','EditProjectForArticulated','companyEdit','reportingDataClient','ExecutionProject',
|
'preparedProject','EditProjectForArticulated','companyEdit','reportingDataClient','ExecutionProject',
|
||||||
'changeFromExecutionToPlanning',
|
'changeFromExecutionToPlanning','deleteWorkstation','deleteProject','showQrcodesInProject',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ class="form-control">
|
||||||
<th>Tag</th>
|
<th>Tag</th>
|
||||||
<th>Descricao</th>
|
<th>Descricao</th>
|
||||||
<th>Cliente</th>
|
<th>Cliente</th>
|
||||||
|
<th>Instalação</th>
|
||||||
<th>Fabrica</th>
|
<th>Fabrica</th>
|
||||||
<th>Tipo</th>
|
<th>Tipo</th>
|
||||||
<th>Ações</th>
|
<th>Ações</th>
|
||||||
|
|
@ -146,6 +147,10 @@ class="form-control">
|
||||||
data: 'client_name',
|
data: 'client_name',
|
||||||
name: 'client_name'
|
name: 'client_name'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
data: 'plant_name',
|
||||||
|
name: 'plant_name'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
data: 'unit_name',
|
data: 'unit_name',
|
||||||
name: 'unit_name'
|
name: 'unit_name'
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@
|
||||||
<form method="POST" action="{{ route('processStep1') }}" id="idDoFormulario">
|
<form method="POST" action="{{ route('processStep1') }}" id="idDoFormulario">
|
||||||
|
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Identificação do projecto -->
|
<!-- Identificação do projecto -->
|
||||||
<div class="form-group col-sm">
|
<div class="form-group col-sm">
|
||||||
|
|
@ -82,7 +81,8 @@
|
||||||
<div class="form-group col-sm" id="companyField">
|
<div class="form-group col-sm" id="companyField">
|
||||||
<label>{{ __('messages.createProject.select_company.contracting_company') }} <b
|
<label>{{ __('messages.createProject.select_company.contracting_company') }} <b
|
||||||
style="color:red">*</b></label>
|
style="color:red">*</b></label>
|
||||||
<select class="form-control" name="company_select" id="company_select">
|
<select class="form-control" name="company_select" id="company_select"
|
||||||
|
@required(true)>
|
||||||
{{-- <option>{{ __('messages.createProject.select_plant.plant') }} ...</option> --}}
|
{{-- <option>{{ __('messages.createProject.select_plant.plant') }} ...</option> --}}
|
||||||
<option value="#">Selecione Uma Empresa …</option>
|
<option value="#">Selecione Uma Empresa …</option>
|
||||||
{{-- <option value="new_company">Criar Empresa …</option> --}}
|
{{-- <option value="new_company">Criar Empresa …</option> --}}
|
||||||
|
|
@ -99,18 +99,20 @@
|
||||||
|
|
||||||
<!-- Gestor de Projeto da Empresa -->
|
<!-- Gestor de Projeto da Empresa -->
|
||||||
<div class="form-group col-sm" id="companyProjectManager">
|
<div class="form-group col-sm" id="companyProjectManager">
|
||||||
<label for="user_id">{{ __('messages.createProject.compan_project_manager') }}<b style="color:red">*</b></label>
|
<label for="user_id">{{ __('messages.createProject.compan_project_manager') }}<b
|
||||||
|
style="color:red">*</b></label>
|
||||||
<select class="form-control" name="user_id" id="user_id" required>
|
<select class="form-control" name="user_id" id="user_id" required>
|
||||||
<option value="#" disabled selected>Select a manager</option>
|
<option value="#" disabled selected>Selecione um gestor...</option>
|
||||||
<!-- As opções de instalação serão preenchidas dinamicamente -->
|
<!-- As opções de instalação serão preenchidas dinamicamente -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Instalação -->
|
<!-- Instalação -->
|
||||||
<div class="form-group col-sm" id="installationField">
|
<div class="form-group col-sm" id="installationField">
|
||||||
<label>{{ __('messages.createProject.select_plant.plant') }} <b
|
<label>{{ __('messages.createProject.select_plant.plant') }} <b
|
||||||
style="color:red">*</b></label>
|
style="color:red">*</b></label>
|
||||||
<select class="form-control" name="installation_id" id="installationSelect" required>
|
<select class="form-control" name="installation_id" id="installationSelect"
|
||||||
|
required>
|
||||||
<!-- As opções de instalação serão preenchidas dinamicamente -->
|
<!-- As opções de instalação serão preenchidas dinamicamente -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -162,7 +164,7 @@
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
<label>{{ __('messages.createProject.company_project_number') }}<b
|
<label>{{ __('messages.createProject.company_project_number') }}<b
|
||||||
style="color:red">*</b></label>
|
style="color:red">*</b></label>
|
||||||
|
|
||||||
<input type="number" name="project_company_number" class="form-control"
|
<input type="number" name="project_company_number" class="form-control"
|
||||||
data-type="company"
|
data-type="company"
|
||||||
placeholder="{{ __('messages.createProject.company_project_number') }}…"
|
placeholder="{{ __('messages.createProject.company_project_number') }}…"
|
||||||
|
|
@ -172,9 +174,12 @@
|
||||||
|
|
||||||
<!-- Data de Início do Projeto -->
|
<!-- Data de Início do Projeto -->
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
<label>{{ __('messages.createProject.project_start_date') }} : <b style="color:red">*</b></label>
|
<label>{{ __('messages.createProject.project_start_date') }} : <b
|
||||||
|
style="color:red">*</b></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="date_started" type="datetime-local" class="form-control float-right" required min="{{ now()->format('Y-m-d\TH:i') }}">
|
<input name="date_started" type="datetime-local"
|
||||||
|
class="form-control float-right" required
|
||||||
|
min="{{ now()->format('Y-m-d\TH:i') }}">
|
||||||
</div>
|
</div>
|
||||||
<!-- /.input group -->
|
<!-- /.input group -->
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -218,7 +223,7 @@ class="btn btn-primary">{{ __('messages.buttons.save') }}</button>
|
||||||
container.append(`
|
container.append(`
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="factoryName${i}">Nome da Fábrica ${i}</label>
|
<label for="factoryName${i}">Nome da Fábrica ${i}</label>
|
||||||
<input type="text" id="factoryName${i}" name="factoryNames[]" class="form-control" placeholder="Nome da Fábrica ${i}">
|
<input type="text" id="factoryName${i}" name="factoryNames[]" class="form-control" placeholder="Nome da Fábrica ${i}" required>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
@ -227,119 +232,10 @@ class="btn btn-primary">{{ __('messages.buttons.save') }}</button>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{-- <script>
|
{{-- <script>
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
var installationsData; // Esta variável irá armazenar as informações das instalações
|
|
||||||
|
|
||||||
$('#company_select').change(function() {
|
|
||||||
var user_id = $(this).val();
|
|
||||||
|
|
||||||
if (user_id == '#') {
|
|
||||||
$('#installationField').attr('hidden', 'hidden');
|
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_div').hide();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$.get('/api/installations?user_id=' + user_id, function(data) {
|
|
||||||
|
|
||||||
var select = $('#installationSelect');
|
|
||||||
select.empty();
|
|
||||||
|
|
||||||
// Adicione as opções fixas aqui
|
|
||||||
select.append('<option value="#">Selecione uma instalação...</option>');
|
|
||||||
select.append(
|
|
||||||
'<option value="new_install">Criar uma nova Instalação ?</option>');
|
|
||||||
|
|
||||||
// Agora você pode adicionar suas opções dinâmicas.
|
|
||||||
|
|
||||||
$.each(data, function(index, installation) {
|
|
||||||
|
|
||||||
select.append('<option value="' + installation.plant_id +
|
|
||||||
'">' +
|
|
||||||
installation.plant_name + '</option>');
|
|
||||||
});
|
|
||||||
// Armazene os dados em installationsData
|
|
||||||
installationsData = data;
|
|
||||||
|
|
||||||
$('#installationField').removeAttr('hidden');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// Adicione este código para lidar com a mudança na seleção da instalação
|
|
||||||
// $('#installationSelect').change(function() {
|
|
||||||
|
|
||||||
// var selectedValue = $(this).val();
|
|
||||||
|
|
||||||
// if (this.value == 'new_install') {
|
|
||||||
// $('#new_company_div').show();
|
|
||||||
// $('#localization_installation_client').hide();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// $('#new_company_div').hide();
|
|
||||||
// $('#localization_installation_client').show();
|
|
||||||
|
|
||||||
// if (this.value == '#') {
|
|
||||||
// $('#new_company_div').hide();
|
|
||||||
// $('#localization_installation_client').hide();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Verifique se installationsData está definido
|
|
||||||
// if (installationsData) {
|
|
||||||
// // Encontre a instalação selecionada nos dados da instalação
|
|
||||||
// var selectedInstallation = installationsData.find(function(installation) {
|
|
||||||
// return installation.plant_id == this.value;
|
|
||||||
// }.bind(this));
|
|
||||||
|
|
||||||
// if (selectedInstallation) {
|
|
||||||
// // Preencha o valor do campo de endereço com o endereço da instalação selecionada
|
|
||||||
// $('#localization_installation_client input').val(selectedInstallation
|
|
||||||
// .plant_address);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
$('#installationSelect').change(function() {
|
|
||||||
var selectedValue = $(this).val();
|
|
||||||
|
|
||||||
// Esconde os campos por padrão
|
|
||||||
$('#new_company_div').hide();
|
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_input')
|
|
||||||
.show(); // Mostra por padrão, será escondido conforme condição abaixo
|
|
||||||
|
|
||||||
if (selectedValue == 'new_install') {
|
|
||||||
$('#new_company_div').show(); // Mostra a div com os inputs
|
|
||||||
$('#new_company_input').hide(); // Esconde o input para nova empresa
|
|
||||||
$('#localization_installation_client').hide(); // Esconde outro conteúdo
|
|
||||||
} else if (selectedValue != '#') {
|
|
||||||
$('#localization_installation_client')
|
|
||||||
.show(); // Mostra conteúdo relacionado a instalação existente
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verifique se installationsData está definido
|
|
||||||
if (installationsData) {
|
|
||||||
// Encontre a instalação selecionada nos dados da instalação
|
|
||||||
var selectedInstallation = installationsData.find(function(installation) {
|
|
||||||
return installation.plant_id == selectedValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (selectedInstallation) {
|
|
||||||
// Preencha o valor do campo de endereço com o endereço da instalação selecionada
|
|
||||||
$('#localization_installation_client input').val(selectedInstallation
|
|
||||||
.plant_address);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_div').hide();
|
|
||||||
});
|
|
||||||
</script> --}}
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Função para atualizar o estado do botão de envio com base na validade dos inputs
|
// Função para atualizar o estado do botão de envio com base na validade dos inputs
|
||||||
function updateSubmitButtonState() {
|
function updateSubmitButtonState() {
|
||||||
// Verifica se ambos os inputs possuem a classe 'valid-input', o que indica que são válidos
|
// Verifica se ambos os inputs possuem a classe 'valid-input', o que indica que são válidos
|
||||||
|
|
@ -348,6 +244,7 @@ function updateSubmitButtonState() {
|
||||||
$('#submitButton').prop('disabled', !allValid);
|
$('#submitButton').prop('disabled', !allValid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Aguarda o documento HTML estar completamente carregado para executar o script
|
// Aguarda o documento HTML estar completamente carregado para executar o script
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Adiciona um ouvinte de evento 'input' para cada input especificado
|
// Adiciona um ouvinte de evento 'input' para cada input especificado
|
||||||
|
|
@ -396,240 +293,184 @@ function updateSubmitButtonState() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script> --}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
function updateSubmitButtonState() {
|
||||||
|
// Verifica se os inputs e os selects são válidos
|
||||||
|
var inputsValid = $('.valid-input').length === 2;
|
||||||
|
var selectsValid = $('#company_select').val() !== '#' &&
|
||||||
|
$('#user_id').val() !== '#' &&
|
||||||
|
$('#installationSelect').val() !== '#';
|
||||||
|
|
||||||
|
// Habilita ou desabilita o botão de envio com base na validade dos inputs e selects
|
||||||
|
$('#submitButton').prop('disabled', !(inputsValid && selectsValid));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verifica mudanças nos inputs especificados
|
||||||
|
$('input[name="n_project_ispt"], input[name="project_company_number"]').on('input', function() {
|
||||||
|
var number = $(this).val();
|
||||||
|
var type = $(this).data('type');
|
||||||
|
|
||||||
|
if (number.length > 0) {
|
||||||
|
$.ajax({
|
||||||
|
url: '{{ route('checkProjectIsptNumber') }}',
|
||||||
|
type: 'GET',
|
||||||
|
data: {
|
||||||
|
number: number,
|
||||||
|
type: type
|
||||||
|
},
|
||||||
|
success: function(response) {
|
||||||
|
if (response.exists) {
|
||||||
|
$(this).css('border', '2px solid red').removeClass(
|
||||||
|
'valid-input').addClass('invalid-input');
|
||||||
|
$('#project-number-exists-' + type).text('Número já existe')
|
||||||
|
.css('color', 'red');
|
||||||
|
} else {
|
||||||
|
$(this).css('border', '2px solid green').removeClass(
|
||||||
|
'invalid-input').addClass('valid-input');
|
||||||
|
$('#project-number-exists-' + type).text('');
|
||||||
|
}
|
||||||
|
updateSubmitButtonState();
|
||||||
|
}.bind(this)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$(this).css('border', '1px solid #ced4da').removeClass('valid-input invalid-input');
|
||||||
|
$('#project-number-exists-' + type).text('');
|
||||||
|
updateSubmitButtonState();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Verifica mudanças nos selects
|
||||||
|
$('#company_select, #user_id, #installationSelect').on('change', function() {
|
||||||
|
updateSubmitButtonState();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
{{-- <script>
|
{{-- <script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
var installationSelect = $('#installationSelect');
|
||||||
|
|
||||||
// Esconde os elementos no carregamento da página
|
// Inicializa o select de instalações com a opção placeholder e a opção para criar nova instalação
|
||||||
$('#companyProjectManager').hide();
|
installationSelect.empty();
|
||||||
$('#installationField').hide();
|
installationSelect.append('<option value="#">Selecione uma instalação...</option>');
|
||||||
|
installationSelect.append('<option value="new_install">Criar instalação</option>');
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_div').hide();
|
$('#new_company_div').hide();
|
||||||
|
|
||||||
|
var userManagerSelect = $('#user_id');
|
||||||
|
var newCompanyDiv = $('#new_company_div');
|
||||||
|
|
||||||
$('#company_select').change(function() {
|
$('#company_select').change(function() {
|
||||||
var companyId = $(this).val();
|
var companyId = $(this).val();
|
||||||
var userManagerSelect = $('#user_id'); // Define a variável corretamente
|
var userManagerSelect = $('#user_id');
|
||||||
|
|
||||||
// Se a seleção é '#', esconde os elementos e retorna
|
|
||||||
if (companyId === '#' || companyId === '') {
|
if (companyId === '#' || companyId === '') {
|
||||||
$('#companyProjectManager').hide();
|
$('#companyProjectManager').hide();
|
||||||
$('#installationField').hide();
|
$('#installationField').hide();
|
||||||
|
$('#localization_installation_client').hide();
|
||||||
|
$('#new_company_div').hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Se a seleção é válida (diferente de '#'), mostra os elementos
|
|
||||||
$('#companyProjectManager').show();
|
$('#companyProjectManager').show();
|
||||||
$('#installationField').show();
|
$('#installationField').show();
|
||||||
|
|
||||||
// Limpa o select antes de adicionar novas opções
|
|
||||||
userManagerSelect.empty();
|
userManagerSelect.empty();
|
||||||
userManagerSelect.append('<option value="#">Selecione um usuário...</option>');
|
userManagerSelect.append('<option value="#">Selecione um usuário...</option>');
|
||||||
|
|
||||||
// Busca dados combinados de gestores e instalações
|
// Apenas limpa e adiciona a opção placeholder se uma empresa válida for selecionada
|
||||||
|
installationSelect.empty();
|
||||||
|
installationSelect.append('<option value="#">Selecione uma instalação...</option>');
|
||||||
|
installationSelect.append('<option value="new_install">Criar instalação</option>');
|
||||||
|
|
||||||
$.get('/api/installations?company_id=' + companyId, function(response) {
|
$.get('/api/installations?company_id=' + companyId, function(response) {
|
||||||
console.log(response);
|
|
||||||
response.users.forEach(function(user) {
|
response.users.forEach(function(user) {
|
||||||
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
||||||
user.user_name + '</option>');
|
user.user_name + '</option>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
response.installations.forEach(function(plant) {
|
||||||
|
installationSelect.append('<option value="' + plant.plant_id +
|
||||||
|
'">' + plant.plant_name + '</option>');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#installationSelect').change(function() {
|
||||||
|
var selectedValue = $(this).val();
|
||||||
|
if (selectedValue === 'new_install') {
|
||||||
|
$('#localization_installation_client').hide();
|
||||||
|
$('#new_company_div').show();
|
||||||
|
} else {
|
||||||
|
$('#localization_installation_client').show();
|
||||||
|
$('#new_company_div').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script> --}}
|
</script> --}}
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Esconde os elementos no carregamento da página
|
var installationSelect = $('#installationSelect');
|
||||||
$('#companyProjectManager').hide();
|
var userManagerSelect = $('#user_id');
|
||||||
$('#installationField').hide();
|
var newCompanyDiv = $('#new_company_div');
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_div').hide();
|
// Inicializa com o select de instalações e esconde o div para nova instalação
|
||||||
|
installationSelect.append('<option value="#">Selecione uma instalação...</option>');
|
||||||
|
installationSelect.append('<option value="new_install">Criar instalação</option>');
|
||||||
|
newCompanyDiv.hide();
|
||||||
|
|
||||||
$('#company_select').change(function() {
|
$('#company_select').change(function() {
|
||||||
var companyId = $(this).val();
|
var companyId = $(this).val();
|
||||||
var userManagerSelect = $('#user_id'); // Define a variável corretamente
|
|
||||||
var installationSelect = $(
|
|
||||||
'#installationSelect'); // Define a variável para o select de instalações
|
|
||||||
|
|
||||||
// Se a seleção é '#', esconde os elementos e retorna
|
|
||||||
if (companyId === '#' || companyId === '') {
|
if (companyId === '#' || companyId === '') {
|
||||||
$('#companyProjectManager').hide();
|
$('#companyProjectManager').hide();
|
||||||
$('#installationField').hide();
|
$('#installationField').hide();
|
||||||
$('#localization_installation_client').hide();
|
newCompanyDiv.hide();
|
||||||
$('#new_company_div').hide();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Se a seleção é válida (diferente de '#'), mostra os elementos
|
|
||||||
$('#companyProjectManager').show();
|
$('#companyProjectManager').show();
|
||||||
$('#installationField').show();
|
$('#installationField').show();
|
||||||
|
|
||||||
// Limpa o select antes de adicionar novas opções
|
|
||||||
userManagerSelect.empty();
|
userManagerSelect.empty();
|
||||||
userManagerSelect.append('<option value="#">Selecione um usuário...</option>');
|
userManagerSelect.append('<option value="#">Selecione um usuário...</option>');
|
||||||
|
|
||||||
// Adiciona a opção de 'Criar instalação'
|
installationSelect.empty();
|
||||||
installationSelect.empty(); // Garante que o select de instalações esteja vazio
|
installationSelect.append('<option value="#">Selecione uma instalação...</option>');
|
||||||
installationSelect.append(
|
installationSelect.append('<option value="new_install">Criar instalação</option>');
|
||||||
'<option value="#">Selecione uma instalação...</option>'); // Opção placeholder
|
|
||||||
installationSelect.append(
|
|
||||||
'<option value="new_install">Criar instalação</option>'); // Opção para criar nova instalação
|
|
||||||
|
|
||||||
// Busca dados combinados de gestores e instalações
|
|
||||||
$.get('/api/installations?company_id=' + companyId, function(response) {
|
$.get('/api/installations?company_id=' + companyId, function(response) {
|
||||||
|
|
||||||
response.users.forEach(function(user) {
|
response.users.forEach(function(user) {
|
||||||
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
||||||
user.user_name + '</option>');
|
user.user_name + '</option>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
response.installations.forEach(function(plant) {
|
||||||
|
installationSelect.append('<option value="' + plant.plant_id + '">' + plant.plant_name + '</option>');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Trata a mudança de seleção no select de instalações
|
|
||||||
$('#installationSelect').change(function() {
|
$('#installationSelect').change(function() {
|
||||||
var selectedValue = $(this).val();
|
var selectedValue = $(this).val();
|
||||||
|
|
||||||
// Se a opção selecionada é 'Criar instalação'
|
|
||||||
if (selectedValue === 'new_install') {
|
if (selectedValue === 'new_install') {
|
||||||
$('#localization_installation_client').hide();
|
newCompanyDiv.show();
|
||||||
$('#new_company_div').show(); // Mostra o div para criar nova instalação
|
// Adiciona o atributo 'required' para os inputs dentro de #new_company_div
|
||||||
|
$('#new_company_div input[type="text"], #new_company_div select').attr('required', true);
|
||||||
} else {
|
} else {
|
||||||
$('#localization_installation_client')
|
newCompanyDiv.hide();
|
||||||
.show(); // Caso contrário, mostra os demais elementos relevantes
|
// Remove o atributo 'required' quando não é a opção de nova instalação
|
||||||
$('#new_company_div').hide();
|
$('#new_company_div input[type="text"], #new_company_div select').removeAttr('required');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{-- <script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
// $('#installationField').attr('hidden', 'hidden');
|
|
||||||
|
|
||||||
// Esconde os elementos no carregamento da página
|
|
||||||
$('#companyProjectManager').hide();
|
|
||||||
$('#installationField').hide();
|
|
||||||
|
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_div').hide();
|
|
||||||
|
|
||||||
$('#company_select').change(function() {
|
|
||||||
var companyId = $(this).val();
|
|
||||||
|
|
||||||
// Se a seleção é '#', esconde os elementos e retorna
|
|
||||||
if (companyId === '#' || companyId === '') {
|
|
||||||
$('#companyProjectManager').hide();
|
|
||||||
$('#installationField').hide();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Se a seleção é válida (diferente de '#'), mostra os elementos
|
|
||||||
$('#companyProjectManager').show();
|
|
||||||
$('#installationField').show();
|
|
||||||
|
|
||||||
// Limpa o select antes de adicionar novas opções
|
|
||||||
userManagerSelect.empty();
|
|
||||||
userManagerSelect.append('<option value="#">Selecione um usuário...</option>');
|
|
||||||
|
|
||||||
|
|
||||||
// Busca dados combinados de gestores e instalações
|
|
||||||
$.get('/api/installations?company_id=' + companyId, function(response) {
|
|
||||||
console.log(response);
|
|
||||||
response.users.forEach(function(user) {
|
|
||||||
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
|
||||||
user.user_name + '</option>');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// $.get('/api/installations?company_id=' + companyId, function(response) {
|
|
||||||
|
|
||||||
// var select = $('#installationSelect');
|
|
||||||
// select.empty();
|
|
||||||
// // Adicione as opções fixas aqui
|
|
||||||
// select.append('<option value="#">Selecione uma instalação...</option>');
|
|
||||||
// select.append(
|
|
||||||
// '<option value="new_install">Criar uma nova Instalação ?</option>');
|
|
||||||
// // Agora você pode adicionar suas opções dinâmicas.
|
|
||||||
// $.each(data, function(index, installation) {
|
|
||||||
// select.append('<option value="' + installation.plant_id + '">' +
|
|
||||||
// installation.plant_name + '</option>');
|
|
||||||
// });
|
|
||||||
// // Armazene os dados em installationsData
|
|
||||||
// installationsData = data;
|
|
||||||
// $('#installationField').removeAttr('hidden');
|
|
||||||
// });
|
|
||||||
});
|
|
||||||
|
|
||||||
// $('#company_select').change(function() {
|
|
||||||
// var user_id = $(this).val();
|
|
||||||
|
|
||||||
// // Se a seleção é 'Criar Empresa ...'
|
|
||||||
// if (user_id === 'new_company') {
|
|
||||||
// $('#new_company_div').show();
|
|
||||||
// $('#installationField').attr('hidden', 'hidden');
|
|
||||||
// $('#localization_installation_client').hide();
|
|
||||||
// return;
|
|
||||||
// } else {
|
|
||||||
// $('#new_company_div').hide();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Se a seleção é o placeholder ou '#'
|
|
||||||
// if (user_id == '#' || user_id === '') {
|
|
||||||
// $('#installationField').attr('hidden', 'hidden');
|
|
||||||
// $('#localization_installation_client').hide();
|
|
||||||
// $('#new_company_div').hide();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// });
|
|
||||||
|
|
||||||
$('#installationSelect').change(function() {
|
|
||||||
var selectedValue = $(this).val();
|
|
||||||
|
|
||||||
if (selectedValue == 'new_install') {
|
|
||||||
$('#new_company_div').show();
|
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
$('#new_company_input').hide(); // Esconde o input para nova empresa
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
$('#new_company_div').hide();
|
|
||||||
$('#localization_installation_client').show();
|
|
||||||
$('#new_company_input').show(); // Mostra o input para nova empresa
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedValue == '#' || selectedValue === '') {
|
|
||||||
$('#new_company_div').hide();
|
|
||||||
$('#localization_installation_client').hide();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verifique se installationsData está definido
|
|
||||||
if (installationsData) {
|
|
||||||
// Encontre a instalação selecionada nos dados da instalação
|
|
||||||
var selectedInstallation = installationsData.find(function(installation) {
|
|
||||||
return installation.plant_id == selectedValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (selectedInstallation) {
|
|
||||||
// Preencha o valor do campo de endereço com o endereço da instalação selecionada
|
|
||||||
$('#localization_installation_client input').val(selectedInstallation
|
|
||||||
.plant_address);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script> --}}
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
let formSubmitted = false;
|
let formSubmitted = false;
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,15 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="row m-3">
|
<div class="row m-3 justify-content-between">
|
||||||
<div class="ml-auto">
|
<div>
|
||||||
<button class="btn btn-info" data-toggle="modal" data-target="#exampleModal">Adicionar
|
<button class="btn btn-info" data-toggle="modal" data-target="#exampleModal">Adicionar equipamentos a Obra</button>
|
||||||
equipamentos a Obra</button>
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="{{ route('showQrcodesInProject',['projectNumber' => $DatasProject->company_projects_id])}}" class="btn btn-danger" >Imprimir Qrcodes</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
|
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
@extends('Templates/templateAdmin')
|
@extends('Templates/templateAdmin')
|
||||||
|
|
||||||
@section('Main-content')
|
@section('Main-content')
|
||||||
|
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
@ -22,136 +21,157 @@
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content-header -->
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
|
|
||||||
{{-- Foreach para criar varios qrcodes para os equipamentos --}}
|
|
||||||
{{-- @foreach ($equipmentsProjects as $equipment)
|
|
||||||
<div class="print-container">
|
|
||||||
<div class="card-to-printAll">
|
|
||||||
|
|
||||||
<div class="custom-rowAll">
|
|
||||||
<div class="col-sm text-center"
|
|
||||||
style="display: flex; align-items: center; justify-content: center; background-color: #09255C; position: relative;">
|
|
||||||
<div id="circulo"
|
|
||||||
style="position: absolute; left: 10px; top: 50%; transform: translateY(-50%);">
|
|
||||||
</div>
|
|
||||||
<img style="width:50px;"
|
|
||||||
src="{{ asset('img/ispt/4.0/Ispt4.0_Símbolo_Fundo_Azul-Marinho@2x-100.jpg') }}"
|
|
||||||
alt="imagem nao encontrada">
|
|
||||||
<div style="line-height: 2.5; color: white;">
|
|
||||||
ISPT 4.0</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-rowAll" style="margin-top: 10px;">
|
|
||||||
<div class="col-sm qrcode-output" style="padding-left: 13px;"
|
|
||||||
data-equipment-id="{{ $equipment->equipment_id }}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-rowAll">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<div style="margin-bottom: 13px;font-size: 1.1rem;color: #00B0EA">
|
|
||||||
<b>TAG</b>
|
|
||||||
{{ $equipment->equipment_tag }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-rowAll">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<h6 style="line-height: 2.5;margin-block-end: 0;color: #00B0EA;">
|
|
||||||
{{ $equipment->equipmentType->equipment_type_name }}
|
|
||||||
</h6>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<h6 style="line-height: 2.5;margin-block-end: 0; color: #00B0EA;">
|
|
||||||
{{ $equipment->unit->unit_name }}</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-rowAll" style="margin-top: 23px;">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<img style="width: 35px;" src="{{ asset('img/ispt/4.0/galpLogo1.png') }}"
|
|
||||||
alt="Imagem nao encontrada galp ">
|
|
||||||
</div>
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<img style="width: 30px;" src="{{ asset('img/ispt/4.0/isptLogoVertical.png') }}"
|
|
||||||
alt="Imagem nao contrada Ispt">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endforeach --}}
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<!-- Card box criar instalção -->
|
<div class="row mb-4">
|
||||||
<form>
|
<div class="col-sm-6 mb-2" id="BotaoDetalhesObra">
|
||||||
<div class="row mb-4">
|
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Detalhes
|
||||||
<div class="col-sm-6 mb-2" id="BotaoDetalhesObra">
|
da Obra</a>
|
||||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Detalhes
|
</div>
|
||||||
da Obra</a>
|
<div class="col-sm-6 mb-2" id="BotaoArticulado">
|
||||||
</div>
|
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Articulado</a>
|
||||||
<div class="col-sm-6 mb-2" id="BotaoArticulado">
|
</div>
|
||||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Articulado</a>
|
<div class="col-sm-6 mb-2" id="BotaoPostosDeTrabalho">
|
||||||
</div>
|
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Postos de Trabalho</a>
|
||||||
<div class="col-sm-6 mb-2" id="BotaoPostosDeTrabalho">
|
</div>
|
||||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Postos de
|
</div>
|
||||||
Trabalho</a>
|
<!-- ./row mb-4 -->
|
||||||
|
|
||||||
|
<!-- CardDetalhesObra -->
|
||||||
|
<div class="card card-primary" id="CardDetalhesObra">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Detalhes da Obra</h3>
|
||||||
|
</div>
|
||||||
|
<!-- /.card-header -->
|
||||||
|
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<table class="table table-striped text-center">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Descrição da obra:</td>
|
||||||
|
<td>{{ $numberProject->company_project_description }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>N.º obra ISPT:</td>
|
||||||
|
<td>{{ $numberProject->project_ispt_number }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Resp.ISPT:</td>
|
||||||
|
<td>{{ $numberProject->project_ispt_responsible }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Cliente :</td>
|
||||||
|
<td>Cliente1</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>N.º obra Cliente :</td>
|
||||||
|
<td>{{ $numberProject->project_company_number }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Resp.Cliente:</td>
|
||||||
|
<td>{{ $numberProject->project_company_responsible }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Data de Inicio :</td>
|
||||||
|
<td>{{ $numberProject->date_started }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- /.card-body -->
|
||||||
|
|
||||||
|
<div class="card-footer">
|
||||||
|
<div class="float-right">
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal"
|
||||||
|
data-target="#ModalTransferForArticulated">Editar
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ./CardDetalhesObra -->
|
||||||
|
|
||||||
<div class="card card-primary" id="CardDetalhesObra">
|
<!-- CardArticuladoObra -->
|
||||||
<div class="card-header">
|
<div class="card card-primary" id="CardArticuladoObra">
|
||||||
<h3 class="card-title">Detalhes da Obra</h3>
|
<div class="card-header">
|
||||||
<div class="card-tools">
|
<h3 class="card-title">Articulado</h3>
|
||||||
|
<!-- /.card-tools -->
|
||||||
|
</div>
|
||||||
|
<!-- /.card-header -->
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<!-- Table articulado de obra -->
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Equipamentos da obra</h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card-tools -->
|
<!-- /.card-header -->
|
||||||
</div>
|
|
||||||
<!-- /.card-header -->
|
|
||||||
|
|
||||||
<div class="card-body p-0">
|
<div class="card-body">
|
||||||
<table class="table table-striped text-center">
|
|
||||||
<tbody>
|
<div class="table-responsive">
|
||||||
<tr>
|
<div class="row text-center">
|
||||||
<td>Descrição da obra:</td>
|
|
||||||
<td>{{ $numberProject->company_project_description }}</td>
|
{{-- Para colocar os filtros a Funcionar, deve primeiro alterar a tabela para Yajra --}}
|
||||||
</tr>
|
|
||||||
<tr>
|
<div class="form-group col-sm">
|
||||||
<td>N.º obra ISPT:</td>
|
<label>Tipo de Equipamento </label>
|
||||||
<td>{{ $numberProject->project_ispt_number }}</td>
|
<select id="tipo_valvulasList" name="tipo_valvulasList"
|
||||||
</tr>
|
class="form-control">
|
||||||
<tr>
|
<option value='#' selected>Mostrar Todos</option>
|
||||||
<td>Resp.ISPT:</td>
|
@foreach ($equipmentsTypes as $equipmentsType)
|
||||||
<td>{{ $numberProject->project_ispt_responsible }}</td>
|
<option value="{{ $equipmentsType->equipment_type_id }}">
|
||||||
</tr>
|
{{ $equipmentsType->equipment_type_name }}</option>
|
||||||
<tr>
|
@endforeach
|
||||||
<td>Cliente :</td>
|
</select>
|
||||||
<td>Cliente1</td>
|
</div>
|
||||||
</tr>
|
|
||||||
<tr>
|
<div class="col-sm">
|
||||||
<td>N.º obra Cliente :</td>
|
<div class="form-group">
|
||||||
<td>{{ $numberProject->project_company_number }}</td>
|
<label> Fabricas </label>
|
||||||
</tr>
|
<select id="unitsList" name="unitsList" class="form-control">
|
||||||
<tr>
|
<option value='#' selected>Mostrar Todos</option>
|
||||||
<td>Resp.Cliente:</td>
|
@foreach ($units as $unit)
|
||||||
<td>{{ $numberProject->project_company_responsible }}</td>
|
<option value="{{ $unit->unit_id }}">
|
||||||
</tr>
|
{{ $unit->unit_name }}</option>
|
||||||
<tr>
|
@endforeach
|
||||||
<td>Data de Inicio :</td>
|
</select>
|
||||||
<td>{{ $numberProject->date_started }}</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</tbody>
|
|
||||||
</table>
|
</div>
|
||||||
|
|
||||||
|
<table id="tableEquipmentWithQrcode" class="table table-bordered table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Tag</th>
|
||||||
|
<th>Descrição</th>
|
||||||
|
<th>Tipo Equipamento</th>
|
||||||
|
<th>Fabrica</th>
|
||||||
|
<th>Âmbito</th>
|
||||||
|
<th>Ação</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- ./table-responsive-->
|
||||||
|
</div>
|
||||||
|
<!--./card-body-->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card-body -->
|
<!-- ./card -->
|
||||||
|
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
|
<!-- Botao para criar os Multiplos Qrcodes nas Folhas -->
|
||||||
|
<div class="float-left">
|
||||||
|
<a href="{{ route('showAllEquipmentsInProjectForQrCode', ['projectId' => $numberProject->company_projects_id]) }}"
|
||||||
|
class="btn btn-outline-primary"> Imprimir Códigos QR</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal"
|
<button type="button" class="btn btn-primary" data-toggle="modal"
|
||||||
data-target="#ModalTransferForArticulated">
|
data-target="#ModalTransferForArticulated">
|
||||||
|
|
@ -159,264 +179,19 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card -->
|
<!-- ./card -->
|
||||||
</form>
|
</div>
|
||||||
<!-- /.Card box criar instalção -->
|
<!-- ./CardArticuladoObra -->
|
||||||
|
|
||||||
{{-- Onde Inicialmente estava o botao alterar para execussao --}}
|
<!--CardPostosDeTrabalhoObra -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Card box criar equipamentos -->
|
|
||||||
<form>
|
|
||||||
<!-- Articulado -->
|
|
||||||
<div class="card card-primary" id="CardArticuladoObra">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">Articulado</h3>
|
|
||||||
<!-- /.card-tools -->
|
|
||||||
</div>
|
|
||||||
<!-- /.card-header -->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card-body">
|
|
||||||
<!-- Table articulado de obra -->
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">Equipamentos da obra</h3>
|
|
||||||
</div>
|
|
||||||
<!-- /.card-header -->
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="table-responsive">
|
|
||||||
<div class="row text-center">
|
|
||||||
|
|
||||||
{{-- Para colocar os filtros a Funcionar, deve primeiro alterar a tabela para Yajra --}}
|
|
||||||
|
|
||||||
{{-- <div class="form-group col-sm">
|
|
||||||
<label>Tipo de Equipamento </label>
|
|
||||||
<select id="tipo_valvulasList" name="equipmentTypeId"
|
|
||||||
class="form-control">
|
|
||||||
<option value='#' selected>Mostrar Todos</option>
|
|
||||||
@foreach ($equipmentsTypes as $equipmentsType)
|
|
||||||
<option value="{{ $equipmentsType->equipment_type_id }}">
|
|
||||||
{{ $equipmentsType->equipment_type_name }}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm">
|
|
||||||
<div class="form-group">
|
|
||||||
<label> Fabricas </label>
|
|
||||||
<select id="UnitsList" class="form-control">
|
|
||||||
<option value='#' selected>Mostrar Todos</option>
|
|
||||||
@foreach ($units as $unit)
|
|
||||||
<option value="{{ $unit->unit_id }}">
|
|
||||||
{{ $unit->unit_name }}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Âmbitos </label>
|
|
||||||
<select class="form-control" name="EquipmentAmbit"
|
|
||||||
id="AmbitsEquipments_list" required>
|
|
||||||
<option value="#" hidden>Mostrar Todos</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div> --}}
|
|
||||||
|
|
||||||
{{-- <div class="col-sm-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Inspeção de Equipamentos </label>
|
|
||||||
<select id="inspecValvula" class="form-control">
|
|
||||||
<option value="#">Mostrar Todos</option>
|
|
||||||
<option value="Sim">Sim </option>
|
|
||||||
<option value="Nao">Nao </option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div> --}}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
{{-- Tabela para integracao do yajra com livewire futuramente --}}
|
|
||||||
{{-- <table id="myTable" class="table table-bordered table-striped">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Tag</th>
|
|
||||||
<th>Tipo Equipamento</th>
|
|
||||||
<th>Fabrica</th>
|
|
||||||
<th>Âmbito</th>
|
|
||||||
<th>Inspecionar</th>
|
|
||||||
<th>Acao</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
</table> --}}
|
|
||||||
|
|
||||||
{{-- Por enquanto nao vamos ter o botao imprimir apenas um Qrcode, e ja imprimimos todos de uma vez --}}
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-bordered table-striped" id="preparedProjetTable">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Tag</th>
|
|
||||||
<th>Tipo Equipamento</th>
|
|
||||||
<th>Fabrica</th>
|
|
||||||
<th>Âmbito</th>
|
|
||||||
<th>Imprimir QR</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($equipmentsProjects as $equipment)
|
|
||||||
<tr>
|
|
||||||
<td>{{ $equipment->equipment_tag }}</td>
|
|
||||||
<td>{{ $equipment->equipment_type_id }}</td>
|
|
||||||
<td>{{ $equipment->unit->unit_name }}</td>
|
|
||||||
<td>{{ $equipment->ambits_description }}</td>
|
|
||||||
<td>
|
|
||||||
<a href="{{ route('showDetailsEquipmentForQrCode', ['equipmentId' => $equipment->equipment_id, 'projectId' => $numberProject]) }}"><i
|
|
||||||
class="fa-solid fa-file-pdf fa-2x"></i></a>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{{-- <td><a href="#" data-toggle="modal"
|
|
||||||
data-target="#yourModalId-{{ $equipment->equipment_id }}"
|
|
||||||
data-equipment-id=""><i class="fa-solid fa-eye"
|
|
||||||
style="color:rgb(62, 62, 62)"></i></a></td> --}}
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
{{-- Por algum motivo se tirar esta modal, ele nao encontra o qrcode do componente ?????????????? WHY????????? --}}
|
|
||||||
<div class="modal fade"
|
|
||||||
id="yourModalId-{{ $equipment->equipment_id }}"
|
|
||||||
tabindex="-1" role="dialog">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Detalhes do
|
|
||||||
Equipamentos</h5>
|
|
||||||
<button type="button" class="close"
|
|
||||||
data-dismiss="modal">×</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-body">
|
|
||||||
ID do Equipamento:
|
|
||||||
<span>{{ $equipment->equipment_id }}</span>
|
|
||||||
<input type="text" class="valor-input"
|
|
||||||
data-equipment-id="{{ $equipment->equipment_id }}"
|
|
||||||
value="{{ $equipment->equipment_tag }}">
|
|
||||||
<div class="qrcode-output"
|
|
||||||
data-equipment-id="{{ $equipment->equipment_id }}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary"
|
|
||||||
data-dismiss="modal">Fechar</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Botão para acionar a impressão -->
|
|
||||||
{{-- <button onclick="printEquipments()">Imprimir Equipamentos</button> --}}
|
|
||||||
|
|
||||||
{{-- <script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>
|
|
||||||
<script>
|
|
||||||
function createQrCode(equipmentId) {
|
|
||||||
var userInput = document.querySelector('.valor-input[data-equipment-id="' + equipmentId + '"]').value;
|
|
||||||
var qrcodeOutput = document.querySelector('.qrcode-output[data-equipment-id="' + equipmentId + '"]');
|
|
||||||
|
|
||||||
new QRCode(qrcodeOutput, {
|
|
||||||
text: userInput,
|
|
||||||
width: 140,
|
|
||||||
height: 140,
|
|
||||||
colorDark: '#09255C',
|
|
||||||
colorLight: "white",
|
|
||||||
correctLevel: QRCode.CorrectLevel.H
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adiciona o listener para o evento shown.bs.modal
|
|
||||||
$('.modal').on('shown.bs.modal', function() {
|
|
||||||
var equipmentId = $(this).find('.valor-input').data('equipment-id');
|
|
||||||
createQrCode(equipmentId);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Gere os QR Codes automaticamente assim que a página é carregada
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
|
||||||
@foreach ($equipmentsProjects as $equipment)
|
|
||||||
createQrCode('{{ $equipment->equipment_id }}');
|
|
||||||
@endforeach
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function printEquipments() {
|
|
||||||
// Acione a impressão
|
|
||||||
window.print();
|
|
||||||
}
|
|
||||||
|
|
||||||
function printCard() {
|
|
||||||
window.print();
|
|
||||||
}
|
|
||||||
</script> --}}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- /. Table-->
|
|
||||||
</div>
|
|
||||||
<!--/table obra-->
|
|
||||||
</div>
|
|
||||||
<!-- /.card-body -->
|
|
||||||
|
|
||||||
<div class="card-footer">
|
|
||||||
<!-- Botao para criar os Multiplos Qrcodes nas Folhas -->
|
|
||||||
<div class="float-left">
|
|
||||||
<a href="{{ route('showAllEquipmentsInProjectForQrCode', ['projectId' => $numberProject->company_projects_id])}}" class="btn btn-outline-primary"> Imprimir Códigos QR</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="float-right">
|
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal"
|
|
||||||
data-target="#ModalTransferForArticulated">
|
|
||||||
Editar
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- ./card -->
|
|
||||||
</div>
|
|
||||||
{{-- card-body --}}
|
|
||||||
|
|
||||||
<!-- TEM DE TER FOOTER -->
|
|
||||||
</div>
|
|
||||||
<!--/.CardArticuladoObra -->
|
|
||||||
</form>
|
|
||||||
<!-- /.card -->
|
|
||||||
<!-- /.Card box criar equipamentos -->
|
|
||||||
|
|
||||||
<form>
|
|
||||||
<div class="card card-primary" id="CardPostosDeTrabalhoObra">
|
<div class="card card-primary" id="CardPostosDeTrabalhoObra">
|
||||||
|
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title">Postos de Trabalho</h3>
|
<h3 class="card-title">Postos de Trabalho</h3>
|
||||||
|
|
||||||
<div class="card-tools">
|
|
||||||
<!-- <button type="button" class="btn btn-tool" data-card-widget="collapse">
|
|
||||||
<i class="fas fa-plus"></i>
|
|
||||||
</button> -->
|
|
||||||
</div>
|
|
||||||
<!-- /.card-tools -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card-header -->
|
<!-- /.card-header -->
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<!-- Criar tarefa -->
|
<!-- Criar tarefa -->
|
||||||
|
|
@ -451,6 +226,7 @@ function printCard() {
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!--/Criar tarefa-->
|
<!--/Criar tarefa-->
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title">Listas de Postos de Obra</h3>
|
<h3 class="card-title">Listas de Postos de Obra</h3>
|
||||||
|
|
@ -481,6 +257,7 @@ class="table table-bordered table-striped">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- modal Remover -->
|
<!-- modal Remover -->
|
||||||
<div class="modal fade" id="modal-ViewOfices">
|
<div class="modal fade" id="modal-ViewOfices">
|
||||||
<div class="modal-dialog modal-xl">
|
<div class="modal-dialog modal-xl">
|
||||||
|
|
@ -658,7 +435,7 @@ class="checkboxChoseTasksOficesCV"
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-content --
|
<!-- /.modal-content --
|
||||||
/.modal-dialog -->
|
/.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal remover-->
|
<!-- /.modal remover-->
|
||||||
|
|
||||||
|
|
@ -668,43 +445,50 @@ class="checkboxChoseTasksOficesCV"
|
||||||
<!-- /.card -->
|
<!-- /.card -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card-body -->
|
<!-- /.card-body -->
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a style="margin: 10px" data-bs-toggle="modal" data-bs-target="#exampleModal"
|
|
||||||
class="btn btn-primary float-right">Alterar para Execussao</a>
|
|
||||||
|
|
||||||
<!-- Modal -->
|
|
||||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
|
|
||||||
aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h3 class="modal-title fs-5" id="exampleModalLabel">Confirmação de alteração para
|
|
||||||
execução</h3>
|
|
||||||
</div>
|
|
||||||
<form
|
|
||||||
action="{{ route('changeStateProject', ['projectId' => $numberProject->company_projects_id]) }}">
|
|
||||||
@csrf
|
|
||||||
<div class="modal-body">
|
|
||||||
<p>
|
|
||||||
A inicialização está planeada para {{ $numberProject->date_started }} Ao
|
|
||||||
prosseguir, irá alterar o estado para execução imediata. Confirma a operação?
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
||||||
<button type="submit" class="btn btn-primary">Alterar</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- ./CardPostosDeTrabalhoObra -->
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
<a style="margin: 10px" data-bs-toggle="modal" data-bs-target="#modelChangeProjectForExecution"
|
||||||
|
class="btn btn-primary float-right">Alterar para Execussao</a>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="modelChangeProjectForExecution" tabindex="-1" aria-labelledby="modelChangeProjectForExecution"
|
||||||
|
aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-title fs-5" id="exampleModalLabel">Confirmação de alteração para
|
||||||
|
execução</h3>
|
||||||
|
</div>
|
||||||
|
<form
|
||||||
|
action="{{ route('changeStateProject', ['projectId' => $numberProject->company_projects_id]) }}">
|
||||||
|
@csrf
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>
|
||||||
|
A inicialização está planeada para {{ $numberProject->date_started }} Ao
|
||||||
|
prosseguir, irá alterar o estado para execução imediata. Confirma a operação?
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary"
|
||||||
|
data-bs-dismiss="modal">Close</button>
|
||||||
|
<button type="submit" class="btn btn-primary">Alterar</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--/.col-md-12 -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- /.container-fluid -->
|
||||||
</section>
|
</section>
|
||||||
<!-- ./content -->
|
<!-- ./content -->
|
||||||
|
|
||||||
|
|
@ -734,24 +518,6 @@ class="btn btn-primary float-right">Alterar para Execussao</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{{-- Modal onde vai ficar os QRCODE --}}
|
|
||||||
<div class="modal fade" id="yourModalId" tabindex="-1" role="dialog">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Detalhes do Equipamento</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
ID do Equipamento: <span id="modalEquipmentId"></span>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -793,99 +559,88 @@ class="btn btn-primary float-right">Alterar para Execussao</a>
|
||||||
|
|
||||||
<script type="Text/javascript">
|
<script type="Text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#TablePreparedProjectWorkstation').DataTable({
|
$('#TablePreparedProjectWorkstation').DataTable({
|
||||||
autoWidth: false,
|
autoWidth: false,
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/receiveWorkstationProject/' + $('#receiveNumberProject').val()
|
url: '/api/receiveWorkstationProject/' + $('#receiveNumberProject').val()
|
||||||
},
|
},
|
||||||
columns: [{
|
columns: [{
|
||||||
data: 'name_workstations',
|
data: 'name_workstations',
|
||||||
name: 'name_workstations'
|
name: 'name_workstations'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'nomenclature_workstation',
|
data: 'nomenclature_workstation',
|
||||||
name: 'nomenclature_workstation'
|
name: 'nomenclature_workstation'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'workstations_Association_Tasks',
|
data: 'workstations_Association_Tasks',
|
||||||
name: 'workstations_Association_Tasks'
|
name: 'workstations_Association_Tasks'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{-- Script para funcionar com dataTables yajra, futura implementacao com livewire --}}
|
|
||||||
{{-- <script>
|
<script type="text/javascript">
|
||||||
|
var dataTables;
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#myTable').DataTable({
|
|
||||||
autoWidth: false,
|
dataTables = $('#tableEquipmentWithQrcode').DataTable({
|
||||||
|
responsive: true,
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/receiveEquipmentsProject/' + $('#receiveNumberProject').val(),
|
url: '{{ route('getDetailsEquipmentQrcode') }}',
|
||||||
|
type: 'GET',
|
||||||
data: function(d) {
|
data: function(d) {
|
||||||
d.equipment_type_id = $('#tipo_valvulasList').val();
|
|
||||||
d.ambits_id = $('#AmbitsEquipments_list').val();
|
d.receiveNumberProject = $('#receiveNumberProject').val();
|
||||||
},
|
// Envia as variaveis de acordo com as opcoes selecionadas para o DataTables
|
||||||
|
d.equipmentTypeSelected = $('#tipo_valvulasList').val();
|
||||||
|
d.unitSelected = $('#unitsList').val();
|
||||||
|
d.receiveAllUnits = $('#receiveUnitsClientRelated').val();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
columns: [{
|
columns: [{
|
||||||
data: 'equipment_tag',
|
data: 'equipment_tag',
|
||||||
name: 'equipment_tag'
|
name: 'equipment_tag'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'equipment_type',
|
data: 'equipment_description',
|
||||||
name: 'equipment_type'
|
name: 'equipment_description'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'Unit',
|
data: 'equipment_type_name',
|
||||||
name: 'Unit'
|
name: 'equipment_type_name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'Ambits',
|
data: 'unit_name',
|
||||||
name: 'Ambits'
|
name: 'unit_name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'Inspec',
|
data: 'ambit_name',
|
||||||
name: 'Inspec'
|
name: 'ambit_name'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
data: 'equipment_id',
|
|
||||||
name: 'equipment_id',
|
|
||||||
render: function(data, type, row) {
|
|
||||||
return '<a href="#" data-toggle="modal" data-target="#yourModalId" data-equipment-id="' +
|
|
||||||
data +
|
|
||||||
'"><i class="fa-solid fa-eye" style="color:rgb(62, 62, 62)"></i></a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
{
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
orderable: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
],
|
],
|
||||||
rowId: 'equipment_id'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Scripts para que com base no recebido , ele atualiza a pagina automaticamente
|
|
||||||
$('#tipo_valvulasList').on('change', function() {
|
|
||||||
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
|
|
||||||
$('#myTable').DataTable().ajax.reload();
|
|
||||||
});
|
|
||||||
$('#UnitsList').on('change', function() {
|
|
||||||
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
|
|
||||||
$('#myTable').DataTable().ajax.reload();
|
|
||||||
});
|
|
||||||
$('#AmbitsEquipments_list').on('change', function() {
|
|
||||||
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
|
|
||||||
$('#myTable').DataTable().ajax.reload();
|
|
||||||
});
|
|
||||||
$('#inspecValvula').on('change', function() {
|
|
||||||
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
|
|
||||||
$('#myTable').DataTable().ajax.reload();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script> --}}
|
|
||||||
|
//De acordo com os valores deste campos, como anteriormente ja sao enviados para a DataTables para fazer as filtragens, agora atualizamos a Tabela com base no filtros feitos
|
||||||
|
$('#tipo_valvulasList,#unitsList,#receiveUnitsClientRelated').on('change',
|
||||||
|
function() {
|
||||||
|
dataTables.ajax.reload();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
|
||||||
|
|
@ -1,155 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>Document</title>
|
|
||||||
|
|
||||||
{{-- <style>
|
|
||||||
body {
|
|
||||||
font-family: 'Arial', sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-to-print {
|
|
||||||
width: 65mm;
|
|
||||||
height: 85mm;
|
|
||||||
border: 3px solid blue;
|
|
||||||
}
|
|
||||||
.card-header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
background-color: #00B0EA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box {
|
|
||||||
/* Como nao entende o flex-box, cada box vai pegar metade do conteudo pai */
|
|
||||||
width: 33.33%;
|
|
||||||
float: left;
|
|
||||||
/* padding: 15px 0px 0px 25px; */
|
|
||||||
/* top right bottom left */
|
|
||||||
|
|
||||||
/* margin-bottom: 50%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#circulo {
|
|
||||||
width: 20px;
|
|
||||||
/*Largura do círculo */
|
|
||||||
height: 20px;
|
|
||||||
/* Altura do círculo */
|
|
||||||
background-color: red;
|
|
||||||
/* Cor do círculo */
|
|
||||||
border-radius: 50%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</style> --}}
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="box-card">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card-to-print">
|
|
||||||
<div class="top">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- <div class="custom-row"> --}}
|
|
||||||
{{-- <div class="col-sm text-center" style="position: relative; background-color: #09255C;">
|
|
||||||
<div id="circulo"></div>
|
|
||||||
<!-- Restante do seu HTML -->
|
|
||||||
</div> --}}
|
|
||||||
<div class="card-header">
|
|
||||||
{{-- style="display: flex; align-items: center; justify-content: center; background-color: #09255C; position: relative;"> --}}
|
|
||||||
<div class="box">
|
|
||||||
<div id="circulo"></div>
|
|
||||||
</div>
|
|
||||||
<div class="box box-text">
|
|
||||||
<div style="line-height: 2.5;">ISPT 4.0</div>
|
|
||||||
</div>
|
|
||||||
<div class="box last-box"">
|
|
||||||
Imagem
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{{-- <img style="width:50px;"
|
|
||||||
src="{{ asset('img/ispt/4.0/Ispt4.0_Símbolo_Fundo_Azul-Marinho@2x-100.jpg') }}"
|
|
||||||
alt="imagem nao encontrada"> --}}
|
|
||||||
{{-- </div> --}}
|
|
||||||
|
|
||||||
<div class="custom-row" style="margin-top: 10px;">
|
|
||||||
|
|
||||||
<div class="col-sm qrcode-output" style="padding-left: 13px;" Qr-Code {{-- data-equipment-id="{{ $associatedEquipment->id }}" --}}
|
|
||||||
{{-- data-component-tag="{{ $associatedEquipment->component_tag }}"> --}} </div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="custom-row">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<div style="margin-bottom: 13px;font-size: 1.1rem;color: #00B0EA">
|
|
||||||
<b>TAG</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- Serve para receber o conteudo que tem apos a @ --}}
|
|
||||||
<div class="custom-row">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<div style="font-size: 1.1rem;color: #00B0EA">
|
|
||||||
{{ $detailsEquipment->equipment_tag }}
|
|
||||||
Parte do Equipamento (Corpo)
|
|
||||||
{{-- {{ explode('@', $associatedEquipment->component_tag)[1] }} --}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-row">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<h6 style="line-height: 2.5;margin-block-end: 0;color: #00B0EA;">
|
|
||||||
Tipo de Equipamento
|
|
||||||
{{-- {{ $equipment->equipmentType->equipment_type_name }} --}}
|
|
||||||
</h6>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
<h6 style="line-height: 2.5;margin-block-end: 0; color: #00B0EA;">
|
|
||||||
Fabrica
|
|
||||||
{{-- {{ $equipment->unit->unit_name }} --}}
|
|
||||||
</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- Imagens demoram muito a carregar , ver oque da para fazer --}}
|
|
||||||
<div class="custom-row" style="margin-top: 10px;">
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
{{ $detailsEquipment->equipment_tag }}
|
|
||||||
Logo ISPT
|
|
||||||
{{-- <img style="width: 25px;" src="{{ asset('img/ispt/4.0/galpLogo1.png') }}"
|
|
||||||
alt="Imagem nao encontrada galp "> --}}
|
|
||||||
</div>
|
|
||||||
<div class="col-sm text-center">
|
|
||||||
{{ $detailsEquipment->equipment_tag }}
|
|
||||||
Logo Empresa
|
|
||||||
{{-- <img style="width: 20px;"
|
|
||||||
src="{{ asset('img/ispt/4.0/isptLogoVertical.png') }}"
|
|
||||||
alt="Imagem nao contrada Ispt"> --}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>Document</title>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.box-pai {
|
|
||||||
width: 65mm;
|
|
||||||
height: 95mm;
|
|
||||||
border: 1px solid blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
|
||||||
border: 1px solid red;
|
|
||||||
background-color: aqua;
|
|
||||||
font-size: 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.col {
|
|
||||||
border: 1px solid green;
|
|
||||||
width: 32.50%;
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.test {
|
|
||||||
width: 10mm;
|
|
||||||
height: 10mm;
|
|
||||||
border: 1px solid blue;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="box-pai">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<div class="test"></div>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
ISPT 4.0
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<img src="{{ $userLogoPath }}" alt="User Logo">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
193
resources/views/projectsClients/showQrcodesInProject.blade.php
Executable file
193
resources/views/projectsClients/showQrcodesInProject.blade.php
Executable file
|
|
@ -0,0 +1,193 @@
|
||||||
|
@extends('Templates/templateAdmin')
|
||||||
|
|
||||||
|
@section('Main-content')
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1>{{ $numberProject->company_project_description }} - Qrcodes</h1>
|
||||||
|
<input type="hidden" value="{{ $numberProject->company_projects_id }}" id="receiveNumberProject">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<ol class="breadcrumb float-sm-right">
|
||||||
|
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||||
|
{{-- <li class="breadcrumb-item"><a href="{{ route('')}}./preparadas.html">Preparadas</a></li> --}}
|
||||||
|
<li class="breadcrumb-item"> <a href=" {{ route('ExecutionProject',['projectID' => $numberProject->company_projects_id])}}">{{ $numberProject->company_project_description }}</a></li>
|
||||||
|
|
||||||
|
<li class="breadcrumb-item active">{{ $numberProject->company_project_description }} - Qrcodes</li>
|
||||||
|
</ol>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div>
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</section>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<!-- Articulado -->
|
||||||
|
<div class="card card-primary" id="CardArticuladoObra">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Articulado</h3>
|
||||||
|
<!-- /.card-tools -->
|
||||||
|
</div>
|
||||||
|
<!-- /.card-header -->
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<!-- Table articulado de obra -->
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Equipamentos da obra</h3>
|
||||||
|
</div>
|
||||||
|
<!-- /.card-header -->
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<div class="row text-center">
|
||||||
|
|
||||||
|
{{-- Para colocar os filtros a Funcionar, deve primeiro alterar a tabela para Yajra --}}
|
||||||
|
|
||||||
|
<div class="form-group col-sm">
|
||||||
|
<label>Tipo de Equipamento </label>
|
||||||
|
<select id="tipo_valvulasList" name="tipo_valvulasList"
|
||||||
|
class="form-control">
|
||||||
|
<option value='#' selected>Mostrar Todos</option>
|
||||||
|
@foreach ($equipmentsTypes as $equipmentsType)
|
||||||
|
<option value="{{ $equipmentsType->equipment_type_id }}">
|
||||||
|
{{ $equipmentsType->equipment_type_name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> Fabricas </label>
|
||||||
|
<select id="unitsList" name="unitsList" class="form-control">
|
||||||
|
<option value='#' selected>Mostrar Todos</option>
|
||||||
|
@foreach ($unitsProject as $unit)
|
||||||
|
<option value="{{ $unit->unit_id }}">
|
||||||
|
{{ $unit->unit_name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table id="tableEquipmentWithQrcode" class="table table-bordered table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Tag</th>
|
||||||
|
<th>Descrição</th>
|
||||||
|
<th>Tipo Equipamento</th>
|
||||||
|
<th>Fabrica</th>
|
||||||
|
<th>Âmbito</th>
|
||||||
|
<th>Ação</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- ./table-responsive-->
|
||||||
|
</div>
|
||||||
|
<!--./card-body-->
|
||||||
|
</div>
|
||||||
|
<!-- ./card -->
|
||||||
|
|
||||||
|
<div class="card-footer">
|
||||||
|
<!-- Botao para criar os Multiplos Qrcodes nas Folhas -->
|
||||||
|
<div class="float-left">
|
||||||
|
<a href="{{ route('showAllEquipmentsInProjectForQrCode', ['projectId' => $numberProject->company_projects_id]) }}"
|
||||||
|
class="btn btn-outline-primary"> Imprimir Códigos QR</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ./card-footer -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- ./card-body -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- ./card card-primary -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--/.col-md-12 -->
|
||||||
|
</div>
|
||||||
|
<!-- ./row justify-content-center -->
|
||||||
|
</div>
|
||||||
|
<!-- ./container-fluid -->
|
||||||
|
|
||||||
|
</section>
|
||||||
|
<!-- ./content -->
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
@section('scriptsTemplateAdmin')
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var dataTables;
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
dataTables = $('#tableEquipmentWithQrcode').DataTable({
|
||||||
|
responsive: true,
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
ajax: {
|
||||||
|
url: '{{ route('getDetailsEquipmentQrcode') }}',
|
||||||
|
type: 'GET',
|
||||||
|
data: function(d) {
|
||||||
|
|
||||||
|
d.receiveNumberProject = $('#receiveNumberProject').val();
|
||||||
|
// Envia as variaveis de acordo com as opcoes selecionadas para o DataTables
|
||||||
|
d.equipmentTypeSelected = $('#tipo_valvulasList').val();
|
||||||
|
d.unitSelected = $('#unitsList').val();
|
||||||
|
d.receiveAllUnits = $('#receiveUnitsClientRelated').val();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [{
|
||||||
|
data: 'equipment_tag',
|
||||||
|
name: 'equipment_tag'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'equipment_description',
|
||||||
|
name: 'equipment_description'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'equipment_type_name',
|
||||||
|
name: 'equipment_type_name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'unit_name',
|
||||||
|
name: 'unit_name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'ambit_name',
|
||||||
|
name: 'ambit_name'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
orderable: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//De acordo com os valores deste campos, como anteriormente ja sao enviados para a DataTables para fazer as filtragens, agora atualizamos a Tabela com base no filtros feitos
|
||||||
|
$('#tipo_valvulasList,#unitsList,#receiveUnitsClientRelated').on('change',
|
||||||
|
function() {
|
||||||
|
dataTables.ajax.reload();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|
@ -6760,6 +6760,15 @@ class="btn btn-primary float-right">Guardar</button>
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<button data-form-id type="button" class="btn btn-primary float-left" data-toggle="modal" data-target="#AddPhoneInElementalTaskModal">
|
||||||
|
Adicionar Imagens
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<input type="hidden" name="capturedImages" id="capturedImagesInput-form15">
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="controlEquipmentID"
|
<input type="hidden" name="controlEquipmentID"
|
||||||
value="{{ $receiveDataControlEquipment->control_equipment_workstation_id ?? '' }}">
|
value="{{ $receiveDataControlEquipment->control_equipment_workstation_id ?? '' }}">
|
||||||
|
|
||||||
|
|
@ -6823,8 +6832,6 @@ class="btn btn-primary float-right">Guardar</button>
|
||||||
<option value="Monel OR C/Gorotex"
|
<option value="Monel OR C/Gorotex"
|
||||||
@if (isset($task_todo->formatted_answers['gasket_type']) &&
|
@if (isset($task_todo->formatted_answers['gasket_type']) &&
|
||||||
$task_todo->formatted_answers['gasket_type'] == 'Monel OR C/Gorotex') selected @endif>Monel OR C/Gorotex</option>
|
$task_todo->formatted_answers['gasket_type'] == 'Monel OR C/Gorotex') selected @endif>Monel OR C/Gorotex</option>
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@
|
||||||
|
|
||||||
|
|
||||||
Route::get('getDataEquipment', [ExecutionProjectController::class, 'getDataEquipment'])->name('getDataEquipment');
|
Route::get('getDataEquipment', [ExecutionProjectController::class, 'getDataEquipment'])->name('getDataEquipment');
|
||||||
|
Route::get('getDetailsEquipmentQrcode', [ExecutionProjectController::class, 'getDetailsEquipmentQrcode'])->name('getDetailsEquipmentQrcode');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Route::post('deleteEquipmentInProject', [CreateProjectController::class, 'deleteEquipmentInProject'])->name('deleteEquipmentInProject');
|
Route::post('deleteEquipmentInProject', [CreateProjectController::class, 'deleteEquipmentInProject'])->name('deleteEquipmentInProject');
|
||||||
|
|
@ -274,7 +276,7 @@
|
||||||
Route::get('ExecutionProject/{projectID}', [ExecutionProjectController::class, 'receiveExecutionProject'])->name('ExecutionProject');
|
Route::get('ExecutionProject/{projectID}', [ExecutionProjectController::class, 'receiveExecutionProject'])->name('ExecutionProject');
|
||||||
Route::get('/ReceiveEquipmentIdForShowModal/{EquipmentID}', [ExecutionProjectController::class, 'receiveEquipmentIdForShowModal'])->name('ReceiveEquipmentIdForShowModal ');
|
Route::get('/ReceiveEquipmentIdForShowModal/{EquipmentID}', [ExecutionProjectController::class, 'receiveEquipmentIdForShowModal'])->name('ReceiveEquipmentIdForShowModal ');
|
||||||
Route::post('/changeFromExecutionToPlanning/{projectID}', [ExecutionProjectController::class, 'changeFromExecutionToPlanning'])->name('changeFromExecutionToPlanning');
|
Route::post('/changeFromExecutionToPlanning/{projectID}', [ExecutionProjectController::class, 'changeFromExecutionToPlanning'])->name('changeFromExecutionToPlanning');
|
||||||
|
Route::get('showQrcodesInProject/{projectNumber}', [ExecutionProjectController::class,'showQrcodesInProject'])->name('showQrcodesInProject');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user