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)
|
||||
{
|
||||
|
||||
// Encontra o projeto pelo ID
|
||||
$deleteProject = CompanyProject::where('company_projects_id', $projectId)->first();
|
||||
|
||||
|
|
@ -845,7 +844,6 @@ public function CreateNewEquipmentFromPendingEquipment(Request $request, $id)
|
|||
|
||||
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)
|
||||
// Dito isto vamos sempre pensar que o Cliente ja deve estar criado , para ser feita uma Obra para o mesmo.
|
||||
// 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)
|
||||
->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)
|
||||
{
|
||||
|
||||
//Variaveis recebidos da Obra em Planeamento (Filtros)
|
||||
$numberProject = $request->get('numberProject');
|
||||
$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)
|
||||
$receiveAllClients = $request->get('receiveAllClients');
|
||||
|
|
@ -82,10 +85,7 @@ public function getDataEquipment(Request $request)
|
|||
$receiveAllUnits = $request->get('receiveAllUnits');
|
||||
$receiveEquipmentsType = $request->get('receiveEquipmentsType');
|
||||
|
||||
|
||||
|
||||
|
||||
// Se receber o numero do projecto.
|
||||
// Se receber o numero do projecto. /Se existir
|
||||
if ($numberProject) {
|
||||
|
||||
// Query para DataTables do Planeamento
|
||||
|
|
@ -97,8 +97,8 @@ public function getDataEquipment(Request $request)
|
|||
$query->where('unit_id', $receiveRespostUnitsSelect);
|
||||
}
|
||||
|
||||
if ($receiveRespostPlatsSelect && $receiveRespostPlatsSelect !== '#') {
|
||||
$query->where('equipment_type_id', $receiveRespostPlatsSelect);
|
||||
if ($receiveTypeValveSelected && $receiveTypeValveSelected !== '#') {
|
||||
$query->where('equipment_type_id', $receiveTypeValveSelected);
|
||||
}
|
||||
|
||||
// Executa a consulta e obtém os resultados
|
||||
|
|
@ -157,6 +157,7 @@ public function getDataEquipment(Request $request)
|
|||
})
|
||||
->make(true);
|
||||
} else {
|
||||
|
||||
// Query padrão que todas as dataTables recebem, a partir dele fazemos os filt
|
||||
$query = Equipment::with('equipmentType', 'unit')
|
||||
->select(['equipment_id', 'equipment_tag', 'unit_id', 'equipment_type_id', 'equipment_description']);
|
||||
|
|
@ -165,7 +166,7 @@ public function getDataEquipment(Request $request)
|
|||
if ($receiveAllClients && $receiveAllClients !== '#') {
|
||||
// Filtra os equipamentos cujas unidades estão associadas às plantas do usuário especificado
|
||||
$query->whereHas('unit.plant', function ($query) use ($receiveAllClients) {
|
||||
$query->where('user_id', $receiveAllClients);
|
||||
$query->where('company_id', $receiveAllClients);
|
||||
});
|
||||
}
|
||||
//Filtar equipamentos por uma instalacao .
|
||||
|
|
@ -190,7 +191,11 @@ public function getDataEquipment(Request $request)
|
|||
return DataTables::of($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) {
|
||||
|
|
@ -221,7 +226,6 @@ public function getDataEquipment(Request $request)
|
|||
Apagar
|
||||
</button>';
|
||||
|
||||
|
||||
// Adicionar outras ações aqui, como editar e deletar, conforme necessário
|
||||
//Adicionar o "Apagar" e "Trocar de Ambito"
|
||||
|
||||
|
|
@ -230,14 +234,59 @@ public function getDataEquipment(Request $request)
|
|||
return $dropdownHtml;
|
||||
})
|
||||
|
||||
|
||||
|
||||
->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)
|
||||
{
|
||||
|
|
@ -534,6 +583,27 @@ public function receiveEquipmentIdForShowModal($EquipmentID)
|
|||
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)
|
||||
// {
|
||||
// // Recebe os dados vindos da funcao 'data' criada na view
|
||||
|
|
|
|||
|
|
@ -97,13 +97,25 @@ public function ListPendingUsers()
|
|||
public function ShowFormUser($id)
|
||||
{
|
||||
$pend_user = PendingUser::findOrFail($id);
|
||||
$types = TypeUser::all();
|
||||
$allTypes = TypeUser::all();
|
||||
$allCompanies = Company::all();
|
||||
|
||||
// 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)
|
||||
{
|
||||
// dd($request);
|
||||
|
|
|
|||
|
|
@ -297,7 +297,6 @@ public function PreparedProject($ProjectId)
|
|||
->where('company_projects.company_projects_id', '=', $numberProject->company_projects_id)
|
||||
->get();
|
||||
|
||||
// dd($equipmentsProjects);
|
||||
return view('projectsClients/preparedProject')
|
||||
->with('equipmentsTypes', $equipmentsTypes)
|
||||
->with('units', $checkUnits)
|
||||
|
|
|
|||
|
|
@ -620,12 +620,6 @@ public function ManageAssets()
|
|||
|
||||
$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();
|
||||
|
||||
$allClients = Company::all();
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ protected function getAllowedRoutesForUserType($userType)
|
|||
'deletePendingEquipments','CreateNewEquipmentFromPendingEquipment','removeEquipment','receiveEquipmentToAssociateTasks',
|
||||
'createCompany','ShowPendingUser','register','download','projectDetails_11','editEquipment','EditprocessStep1','createWorkStations','workstationsAssociationTasks','finishCreatingProject',
|
||||
'preparedProject','EditProjectForArticulated','companyEdit','reportingDataClient','ExecutionProject',
|
||||
'changeFromExecutionToPlanning',
|
||||
'changeFromExecutionToPlanning','deleteWorkstation','deleteProject','showQrcodesInProject',
|
||||
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class="form-control">
|
|||
<th>Tag</th>
|
||||
<th>Descricao</th>
|
||||
<th>Cliente</th>
|
||||
<th>Instalação</th>
|
||||
<th>Fabrica</th>
|
||||
<th>Tipo</th>
|
||||
<th>Ações</th>
|
||||
|
|
@ -146,6 +147,10 @@ class="form-control">
|
|||
data: 'client_name',
|
||||
name: 'client_name'
|
||||
},
|
||||
{
|
||||
data: 'plant_name',
|
||||
name: 'plant_name'
|
||||
},
|
||||
{
|
||||
data: 'unit_name',
|
||||
name: 'unit_name'
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
<form method="POST" action="{{ route('processStep1') }}" id="idDoFormulario">
|
||||
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<!-- Identificação do projecto -->
|
||||
<div class="form-group col-sm">
|
||||
|
|
@ -82,7 +81,8 @@
|
|||
<div class="form-group col-sm" id="companyField">
|
||||
<label>{{ __('messages.createProject.select_company.contracting_company') }} <b
|
||||
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 value="#">Selecione Uma Empresa …</option>
|
||||
{{-- <option value="new_company">Criar Empresa …</option> --}}
|
||||
|
|
@ -99,9 +99,10 @@
|
|||
|
||||
<!-- Gestor de Projeto da Empresa -->
|
||||
<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>
|
||||
<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 -->
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -110,7 +111,8 @@
|
|||
<div class="form-group col-sm" id="installationField">
|
||||
<label>{{ __('messages.createProject.select_plant.plant') }} <b
|
||||
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 -->
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -172,9 +174,12 @@
|
|||
|
||||
<!-- Data de Início do Projeto -->
|
||||
<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">
|
||||
<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>
|
||||
<!-- /.input group -->
|
||||
</div>
|
||||
|
|
@ -218,7 +223,7 @@ class="btn btn-primary">{{ __('messages.buttons.save') }}</button>
|
|||
container.append(`
|
||||
<div class="form-group">
|
||||
<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>
|
||||
`);
|
||||
}
|
||||
|
|
@ -227,119 +232,10 @@ class="btn btn-primary">{{ __('messages.buttons.save') }}</button>
|
|||
</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
|
||||
function updateSubmitButtonState() {
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
// Aguarda o documento HTML estar completamente carregado para executar o script
|
||||
$(document).ready(function() {
|
||||
// Adiciona um ouvinte de evento 'input' para cada input especificado
|
||||
|
|
@ -396,241 +293,185 @@ 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>
|
||||
$(document).ready(function() {
|
||||
var installationSelect = $('#installationSelect');
|
||||
|
||||
// Esconde os elementos no carregamento da página
|
||||
$('#companyProjectManager').hide();
|
||||
$('#installationField').hide();
|
||||
|
||||
$('#localization_installation_client').hide();
|
||||
// Inicializa o select de instalações com a opção placeholder e a opção para criar nova instalação
|
||||
installationSelect.empty();
|
||||
installationSelect.append('<option value="#">Selecione uma instalação...</option>');
|
||||
installationSelect.append('<option value="new_install">Criar instalação</option>');
|
||||
$('#new_company_div').hide();
|
||||
|
||||
var userManagerSelect = $('#user_id');
|
||||
var newCompanyDiv = $('#new_company_div');
|
||||
|
||||
$('#company_select').change(function() {
|
||||
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 === '') {
|
||||
$('#companyProjectManager').hide();
|
||||
$('#installationField').hide();
|
||||
$('#localization_installation_client').hide();
|
||||
$('#new_company_div').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
|
||||
// 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) {
|
||||
console.log(response);
|
||||
response.users.forEach(function(user) {
|
||||
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
||||
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>
|
||||
$(document).ready(function() {
|
||||
// Esconde os elementos no carregamento da página
|
||||
$('#companyProjectManager').hide();
|
||||
$('#installationField').hide();
|
||||
$('#localization_installation_client').hide();
|
||||
$('#new_company_div').hide();
|
||||
var installationSelect = $('#installationSelect');
|
||||
var userManagerSelect = $('#user_id');
|
||||
var newCompanyDiv = $('#new_company_div');
|
||||
|
||||
// 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() {
|
||||
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 === '') {
|
||||
$('#companyProjectManager').hide();
|
||||
$('#installationField').hide();
|
||||
$('#localization_installation_client').hide();
|
||||
$('#new_company_div').hide();
|
||||
newCompanyDiv.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>');
|
||||
|
||||
// Adiciona a opção de 'Criar instalação'
|
||||
installationSelect.empty(); // Garante que o select de instalações esteja vazio
|
||||
installationSelect.append(
|
||||
'<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
|
||||
installationSelect.empty();
|
||||
installationSelect.append('<option value="#">Selecione uma instalação...</option>');
|
||||
installationSelect.append('<option value="new_install">Criar instalação</option>');
|
||||
|
||||
// Busca dados combinados de gestores e instalações
|
||||
$.get('/api/installations?company_id=' + companyId, function(response) {
|
||||
|
||||
response.users.forEach(function(user) {
|
||||
userManagerSelect.append('<option value="' + user.user_id + '">' +
|
||||
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() {
|
||||
var selectedValue = $(this).val();
|
||||
|
||||
// Se a opção selecionada é 'Criar instalação'
|
||||
if (selectedValue === 'new_install') {
|
||||
$('#localization_installation_client').hide();
|
||||
$('#new_company_div').show(); // Mostra o div para criar nova instalação
|
||||
newCompanyDiv.show();
|
||||
// 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 {
|
||||
$('#localization_installation_client')
|
||||
.show(); // Caso contrário, mostra os demais elementos relevantes
|
||||
$('#new_company_div').hide();
|
||||
newCompanyDiv.hide();
|
||||
// Remove o atributo 'required' quando não é a opção de nova instalação
|
||||
$('#new_company_div input[type="text"], #new_company_div select').removeAttr('required');
|
||||
}
|
||||
});
|
||||
});
|
||||
</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">
|
||||
let formSubmitted = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -88,13 +88,16 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row m-3">
|
||||
<div class="ml-auto">
|
||||
<button class="btn btn-info" data-toggle="modal" data-target="#exampleModal">Adicionar
|
||||
equipamentos a Obra</button>
|
||||
<div class="row m-3 justify-content-between">
|
||||
<div>
|
||||
<button class="btn btn-info" data-toggle="modal" data-target="#exampleModal">Adicionar equipamentos a Obra</button>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ route('showQrcodesInProject',['projectNumber' => $DatasProject->company_projects_id])}}" class="btn btn-danger" >Imprimir Qrcodes</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
@extends('Templates/templateAdmin')
|
||||
|
||||
@section('Main-content')
|
||||
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
|
|
@ -22,76 +21,12 @@
|
|||
</section>
|
||||
<!-- /.content-header -->
|
||||
|
||||
|
||||
<!-- Main 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="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
|
||||
<!-- Card box criar instalção -->
|
||||
<form>
|
||||
<div class="row mb-4">
|
||||
<div class="col-sm-6 mb-2" id="BotaoDetalhesObra">
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Detalhes
|
||||
|
|
@ -101,17 +36,15 @@
|
|||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Articulado</a>
|
||||
</div>
|
||||
<div class="col-sm-6 mb-2" id="BotaoPostosDeTrabalho">
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Postos de
|
||||
Trabalho</a>
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg">Postos de Trabalho</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./row mb-4 -->
|
||||
|
||||
<!-- CardDetalhesObra -->
|
||||
<div class="card card-primary" id="CardDetalhesObra">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Detalhes da Obra</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
<!-- /.card-tools -->
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
|
||||
|
|
@ -154,22 +87,14 @@
|
|||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal"
|
||||
data-target="#ModalTransferForArticulated">
|
||||
Editar
|
||||
data-target="#ModalTransferForArticulated">Editar
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</form>
|
||||
<!-- /.Card box criar instalção -->
|
||||
<!-- ./CardDetalhesObra -->
|
||||
|
||||
{{-- Onde Inicialmente estava o botao alterar para execussao --}}
|
||||
|
||||
|
||||
<!-- Card box criar equipamentos -->
|
||||
<form>
|
||||
<!-- Articulado -->
|
||||
<!-- CardArticuladoObra -->
|
||||
<div class="card card-primary" id="CardArticuladoObra">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Articulado</h3>
|
||||
|
|
@ -177,23 +102,25 @@
|
|||
</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">
|
||||
<div class="form-group col-sm">
|
||||
<label>Tipo de Equipamento </label>
|
||||
<select id="tipo_valvulasList" name="equipmentTypeId"
|
||||
<select id="tipo_valvulasList" name="tipo_valvulasList"
|
||||
class="form-control">
|
||||
<option value='#' selected>Mostrar Todos</option>
|
||||
@foreach ($equipmentsTypes as $equipmentsType)
|
||||
|
|
@ -206,7 +133,7 @@ class="form-control">
|
|||
<div class="col-sm">
|
||||
<div class="form-group">
|
||||
<label> Fabricas </label>
|
||||
<select id="UnitsList" class="form-control">
|
||||
<select id="unitsList" name="unitsList" class="form-control">
|
||||
<option value='#' selected>Mostrar Todos</option>
|
||||
@foreach ($units as $unit)
|
||||
<option value="{{ $unit->unit_id }}">
|
||||
|
|
@ -216,171 +143,33 @@ class="form-control">
|
|||
</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">
|
||||
<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>Inspecionar</th>
|
||||
<th>Acao</th>
|
||||
<th>Ação</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-->
|
||||
<!-- ./table-responsive-->
|
||||
</div>
|
||||
<!--/table obra-->
|
||||
<!--./card-body-->
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
<!-- ./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>
|
||||
<a href="{{ route('showAllEquipmentsInProjectForQrCode', ['projectId' => $numberProject->company_projects_id]) }}"
|
||||
class="btn btn-outline-primary"> Imprimir Códigos QR</a>
|
||||
</div>
|
||||
|
||||
<div class="float-right">
|
||||
|
|
@ -394,29 +183,15 @@ function printCard() {
|
|||
</div>
|
||||
<!-- ./card -->
|
||||
</div>
|
||||
{{-- card-body --}}
|
||||
<!-- ./CardArticuladoObra -->
|
||||
|
||||
<!-- TEM DE TER FOOTER -->
|
||||
</div>
|
||||
<!--/.CardArticuladoObra -->
|
||||
</form>
|
||||
<!-- /.card -->
|
||||
<!-- /.Card box criar equipamentos -->
|
||||
|
||||
<form>
|
||||
<!--CardPostosDeTrabalhoObra -->
|
||||
<div class="card card-primary" id="CardPostosDeTrabalhoObra">
|
||||
|
||||
<div class="card-header">
|
||||
<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>
|
||||
<!-- /.card-header -->
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<!-- Criar tarefa -->
|
||||
|
|
@ -451,6 +226,7 @@ function printCard() {
|
|||
|
||||
</div>
|
||||
<!--/Criar tarefa-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Listas de Postos de Obra</h3>
|
||||
|
|
@ -481,6 +257,7 @@ class="table table-bordered table-striped">
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal Remover -->
|
||||
<div class="modal fade" id="modal-ViewOfices">
|
||||
<div class="modal-dialog modal-xl">
|
||||
|
|
@ -669,14 +446,17 @@ class="checkboxChoseTasksOficesCV"
|
|||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<a style="margin: 10px" data-bs-toggle="modal" data-bs-target="#exampleModal"
|
||||
<!-- ./CardPostosDeTrabalhoObra -->
|
||||
|
||||
|
||||
|
||||
<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="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
|
||||
<div class="modal fade" id="modelChangeProjectForExecution" tabindex="-1" aria-labelledby="modelChangeProjectForExecution"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
|
@ -694,7 +474,8 @@ class="btn btn-primary float-right">Alterar para Execussao</a>
|
|||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-bs-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary">Alterar</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -704,7 +485,10 @@ class="btn btn-primary float-right">Alterar para Execussao</a>
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<!--/.col-md-12 -->
|
||||
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
</section>
|
||||
<!-- ./content -->
|
||||
|
||||
|
|
@ -734,24 +518,6 @@ class="btn btn-primary float-right">Alterar para Execussao</a>
|
|||
</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
|
||||
|
||||
|
||||
|
|
@ -815,77 +581,66 @@ class="btn btn-primary float-right">Alterar para Execussao</a>
|
|||
]
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
{{-- Script para funcionar com dataTables yajra, futura implementacao com livewire --}}
|
||||
{{-- <script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var dataTables;
|
||||
$(document).ready(function() {
|
||||
$('#myTable').DataTable({
|
||||
autoWidth: false,
|
||||
|
||||
dataTables = $('#tableEquipmentWithQrcode').DataTable({
|
||||
responsive: true,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '/api/receiveEquipmentsProject/' + $('#receiveNumberProject').val(),
|
||||
url: '{{ route('getDetailsEquipmentQrcode') }}',
|
||||
type: 'GET',
|
||||
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: [{
|
||||
data: 'equipment_tag',
|
||||
name: 'equipment_tag'
|
||||
},
|
||||
{
|
||||
data: 'equipment_type',
|
||||
name: 'equipment_type'
|
||||
data: 'equipment_description',
|
||||
name: 'equipment_description'
|
||||
},
|
||||
{
|
||||
data: 'Unit',
|
||||
name: 'Unit'
|
||||
data: 'equipment_type_name',
|
||||
name: 'equipment_type_name'
|
||||
},
|
||||
{
|
||||
data: 'Ambits',
|
||||
name: 'Ambits'
|
||||
data: 'unit_name',
|
||||
name: 'unit_name'
|
||||
},
|
||||
{
|
||||
data: 'Inspec',
|
||||
name: 'Inspec'
|
||||
data: 'ambit_name',
|
||||
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();
|
||||
//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();
|
||||
});
|
||||
$('#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> --}}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(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
|
||||
|
||||
<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"
|
||||
value="{{ $receiveDataControlEquipment->control_equipment_workstation_id ?? '' }}">
|
||||
|
||||
|
|
@ -6823,8 +6832,6 @@ class="btn btn-primary float-right">Guardar</button>
|
|||
<option value="Monel OR C/Gorotex"
|
||||
@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>
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@
|
|||
|
||||
|
||||
Route::get('getDataEquipment', [ExecutionProjectController::class, 'getDataEquipment'])->name('getDataEquipment');
|
||||
Route::get('getDetailsEquipmentQrcode', [ExecutionProjectController::class, 'getDetailsEquipmentQrcode'])->name('getDetailsEquipmentQrcode');
|
||||
|
||||
|
||||
|
||||
Route::post('deleteEquipmentInProject', [CreateProjectController::class, 'deleteEquipmentInProject'])->name('deleteEquipmentInProject');
|
||||
|
|
@ -274,7 +276,7 @@
|
|||
Route::get('ExecutionProject/{projectID}', [ExecutionProjectController::class, 'receiveExecutionProject'])->name('ExecutionProject');
|
||||
Route::get('/ReceiveEquipmentIdForShowModal/{EquipmentID}', [ExecutionProjectController::class, 'receiveEquipmentIdForShowModal'])->name('ReceiveEquipmentIdForShowModal ');
|
||||
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