update pdf for reports
This commit is contained in:
parent
bb45616797
commit
476f31fe32
|
|
@ -9,6 +9,7 @@
|
|||
use App\Models\EquipmentAssociationAmbit;
|
||||
use App\Models\EquipmentComment;
|
||||
use App\Models\EquipmentWorkHistory;
|
||||
use App\Models\HistoryOfEquipmentAmbitsInTheProject;
|
||||
use App\Models\ReceiveImagesControlEquipmentWorkstation;
|
||||
use App\Models\TasksAssociationAmbits;
|
||||
use App\Models\Unit;
|
||||
|
|
@ -44,11 +45,35 @@ class ProjectoDatacontroller extends Controller
|
|||
public function createPDFforcompletedEquipment($equipmentId)
|
||||
{
|
||||
$detailsEquipmentWorkHistory = EquipmentWorkHistory::where('equipment_id', $equipmentId)->first();
|
||||
$detailsEquipment = Equipment::where('equipment_id', $equipmentId)->first();
|
||||
$receiveDetailsProject = CompanyProject::where('company_projects_id', $detailsEquipmentWorkHistory->company_projects_id)->first();
|
||||
$receiveAmbit = EquipmentAssociationAmbit::where('equipmentWorkHistorys_id', $detailsEquipmentWorkHistory->equipmentWorkHistorys_id)->first();
|
||||
|
||||
// dd($receiveDetailsProject->plant->company->company_logo);
|
||||
$detailsEquipment = Equipment::where('equipment_id', $equipmentId)->first();
|
||||
// Inicializa o array para armazenar os atributos específicos
|
||||
$specificAttributesArray = [];
|
||||
|
||||
$receiveSpecificAttributes = SpecificAttributesEquipmentType::where('equipment_id', $detailsEquipment->equipment_id)->get();
|
||||
$receiveAmbit = EquipmentAssociationAmbit::where('equipmentWorkHistorys_id', $detailsEquipmentWorkHistory->equipmentWorkHistorys_id)->first();
|
||||
$receiveDetailsProject = CompanyProject::where('company_projects_id', $detailsEquipmentWorkHistory->company_projects_id)->first();
|
||||
|
||||
// Corre a coleção e preenche o array 'specificAttributesArray'
|
||||
foreach ($receiveSpecificAttributes as $attribute) {
|
||||
// Verifica se a relação com 'generalAttributesEquipment' existe para evitar erro
|
||||
if (isset($attribute->generalAttributesEquipment)) {
|
||||
$key = $attribute->general_attributes_equipment_id;
|
||||
$description = $attribute->generalAttributesEquipment->general_attributes_equipment_description;
|
||||
$value = $attribute->specific_attributes_value;
|
||||
|
||||
// Adiciona ao array temporário com a estrutura chave => [description, value]
|
||||
$specificAttributesArray[$key] = [
|
||||
'description' => $description,
|
||||
'value' => $value
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Atribui o array de 'SpecificAttributes' ao modelo usando o método 'setAttribute'
|
||||
$detailsEquipment->setAttribute('specificAttributes', $specificAttributesArray);
|
||||
|
||||
// dd($detailsEquipment);
|
||||
|
||||
// Recebe apenas as tarefas já feitas
|
||||
$completedTasksHistory = ControlEquipmentWorkstation::with('workstationsTaskAnswers', 'receiveImages')
|
||||
|
|
@ -59,38 +84,104 @@ public function createPDFforcompletedEquipment($equipmentId)
|
|||
->orderBy('elemental_tasks_id', 'asc')
|
||||
->get();
|
||||
|
||||
// Verifica se a coleção tem registros
|
||||
if ($completedTasksHistory->isNotEmpty()) {
|
||||
// Obter a data mais antiga (primeira tarefa feita)
|
||||
$oldestDate = $completedTasksHistory->min('departure_date');
|
||||
|
||||
// Cria uma coleção para armazenar todas as tarefas, concluídas e não concluídas
|
||||
// Obter a data mais recente (última tarefa feita)
|
||||
$latestDate = $completedTasksHistory->max('departure_date');
|
||||
|
||||
// Formata as datas apenas para mostrar o dia
|
||||
$startDate = \Carbon\Carbon::parse($oldestDate)->format('Y-m-d');
|
||||
$endDate = \Carbon\Carbon::parse($latestDate)->format('Y-m-d');
|
||||
|
||||
} else {
|
||||
|
||||
// Caso não haja dados, defina datas nulas
|
||||
$oldestDate = null;
|
||||
$latestDate = null;
|
||||
}
|
||||
|
||||
// Apos receber todas as tarefas deve verificar qual o ambito atual e comparar em qual ambito foram feitas as tarefas, ai sim verificar oque foi feito no Ambito antigo e oque foi feito no atual.
|
||||
|
||||
// histórico de âmbitos por time_change_ambit do mais antigo ao mais recente
|
||||
$receiveAmbitHistory = HistoryOfEquipmentAmbitsInTheProject::where('equipmentWorkHistorys_id', $detailsEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->orderBy('time_change_ambit', 'desc')
|
||||
->get();
|
||||
|
||||
|
||||
// Identifica o último âmbito (o mais recente)
|
||||
$latestAmbitHistory = $receiveAmbitHistory->last();
|
||||
|
||||
// Separa as tarefas do histórico por âmbitos diferentes
|
||||
$tasksByAmbit = $completedTasksHistory->groupBy('history_of_equipment_ambits_id');
|
||||
|
||||
|
||||
//coleção para armazenar todas as tarefas, concluídas e não concluídas
|
||||
$receiveAllTasksHistiory = collect();
|
||||
$taskImages = [];
|
||||
|
||||
foreach ($completedTasksHistory as $taskHistory) {
|
||||
$taskHistory->cardTypeStyle = 'gray';
|
||||
$taskHistory->typeStatusHistory = 'historic';
|
||||
// Contador para a ordem dos âmbitos
|
||||
$ambitCounter = 1;
|
||||
|
||||
$workstationTaskAnswer = $taskHistory->workstationsTaskAnswers->first();
|
||||
// Itera sobre cada âmbito anterior
|
||||
foreach ($receiveAmbitHistory as $index => $ambitHistory) {
|
||||
|
||||
if ($workstationTaskAnswer && $workstationTaskAnswer->answer_json) {
|
||||
$answersArray = json_decode($workstationTaskAnswer->answer_json, true);
|
||||
$formattedAnswers = [];
|
||||
foreach ($answersArray as $item) {
|
||||
if (isset($item['question']) && isset($item['value'])) {
|
||||
$formattedAnswers[$item['question']] = $item['value'];
|
||||
$ambitId = $ambitHistory->history_of_equipment_ambits_id;
|
||||
|
||||
// Verifica se há tarefas associadas a esse âmbito
|
||||
if ($tasksByAmbit->has($ambitId)) {
|
||||
$tasksForAmbit = $tasksByAmbit->get($ambitId);
|
||||
|
||||
foreach ($tasksForAmbit as $taskHistory) {
|
||||
if ($ambitId == $latestAmbitHistory->history_of_equipment_ambits_id) {
|
||||
// Se a tarefa pertence ao último âmbito (mais recente)
|
||||
$taskHistory->cardTypeStyle = 'gray';
|
||||
$taskHistory->typeStatusHistory = 'historic';
|
||||
} else {
|
||||
// Se a tarefa pertence a âmbitos anteriores
|
||||
$taskHistory->cardTypeStyle = 'blue';
|
||||
$taskHistory->AmbitHistoryTimeChange = $ambitHistory->time_change_ambit;
|
||||
$taskHistory->AmbitHistoryOrder = $ambitCounter; // Adiciona o contador
|
||||
$taskHistory->typeStatusHistory = 'historic';
|
||||
|
||||
// Adiciona AmbitName dinamicamente
|
||||
if ($ambitHistory->AmbitsEquipment) {
|
||||
$taskHistory->AmbitName = $ambitHistory->AmbitsEquipment->ambits_description;
|
||||
} else {
|
||||
$taskHistory->AmbitName = 'N/A'; // Defina 'N/A' ou outro valor se não houver AmbitsEquipment
|
||||
}
|
||||
}
|
||||
|
||||
$workstationTaskAnswer = $taskHistory->workstationsTaskAnswers->first();
|
||||
|
||||
if ($workstationTaskAnswer && $workstationTaskAnswer->answer_json) {
|
||||
$answersArray = json_decode($workstationTaskAnswer->answer_json, true);
|
||||
$formattedAnswers = [];
|
||||
foreach ($answersArray as $item) {
|
||||
if (isset($item['question']) && isset($item['value'])) {
|
||||
$formattedAnswers[$item['question']] = $item['value'];
|
||||
}
|
||||
}
|
||||
$taskHistory->formatted_answers = $formattedAnswers;
|
||||
} else {
|
||||
$taskHistory->formatted_answers = [];
|
||||
}
|
||||
|
||||
if ($taskHistory->receiveImages) {
|
||||
$imagePaths = $taskHistory->receiveImages->image_paths;
|
||||
$taskImages[$taskHistory->control_equipment_workstation_id] = is_array($imagePaths) ? $imagePaths : json_decode($imagePaths, true);
|
||||
} else {
|
||||
$taskImages[$taskHistory->control_equipment_workstation_id] = [];
|
||||
}
|
||||
|
||||
$receiveAllTasksHistiory->push($taskHistory);
|
||||
}
|
||||
$taskHistory->formatted_answers = $formattedAnswers;
|
||||
} else {
|
||||
$taskHistory->formatted_answers = [];
|
||||
}
|
||||
|
||||
if ($taskHistory->receiveImages) {
|
||||
$imagePaths = $taskHistory->receiveImages->image_paths;
|
||||
$taskImages[$taskHistory->control_equipment_workstation_id] = is_array($imagePaths) ? $imagePaths : json_decode($imagePaths, true);
|
||||
} else {
|
||||
$taskImages[$taskHistory->control_equipment_workstation_id] = [];
|
||||
}
|
||||
|
||||
$receiveAllTasksHistiory->push($taskHistory);
|
||||
// Incrementa o contador para o próximo âmbito
|
||||
$ambitCounter++;
|
||||
}
|
||||
|
||||
// Agrupa as tarefas concluídas por elemental_tasks_id e seleciona a mais recente por departure_date
|
||||
|
|
@ -100,20 +191,11 @@ public function createPDFforcompletedEquipment($equipmentId)
|
|||
return $group->sortByDesc('departure_date')->first();
|
||||
});
|
||||
|
||||
|
||||
// // Define os caminhos das logos
|
||||
// $defaultLogoPath = '/img/ispt/4.0/Ispt4.0_Símbolo_Fundo_Azul-Marinho@2x-100.jpg';
|
||||
|
||||
// // Verifica se a logo do projeto está definida e não está vazia
|
||||
// $projectLogoPath = !empty($receiveDetailsProject->plant->company->project_logo) ? $receiveDetailsProject->plant->company->project_logo : $defaultLogoPath;
|
||||
|
||||
// // Verifica se a logo da empresa está definida e não está vazia
|
||||
// $companyLogoPath = !empty($receiveDetailsProject->plant->company->company_logo) ? $receiveDetailsProject->plant->company->company_logo : $defaultLogoPath;
|
||||
|
||||
|
||||
// Define os caminhos das logos
|
||||
// Define os caminhos das logos- Simbolo ISPT_4.0
|
||||
$defaultLogoPath = '/img/ispt/4.0/Ispt4.0_Símbolo_Fundo_Azul-Marinho@2x-100.jpg';
|
||||
|
||||
$isptLogoPath = '/img/ispt/ispt.jpg';
|
||||
|
||||
// Verifica se a logo do projeto está definida e não está vazia
|
||||
$projectLogoPath = !empty($receiveDetailsProject->plant->company->project_logo) ? $receiveDetailsProject->plant->company->project_logo : $defaultLogoPath;
|
||||
|
||||
|
|
@ -124,24 +206,57 @@ public function createPDFforcompletedEquipment($equipmentId)
|
|||
$companyLogoPath = $defaultLogoPath;
|
||||
}
|
||||
|
||||
// Cria uma coleção para armazenar os históricos de âmbitos
|
||||
$ambitHistories = collect();
|
||||
|
||||
// Itera sobre a coleção original $receiveAllTasksHistiory
|
||||
foreach ($receiveAllTasksHistiory as $taskHistory) {
|
||||
|
||||
// Verifica se os campos AmbitHistoryTimeChange e AmbitHistoryOrder estão presentes
|
||||
if (isset($taskHistory->AmbitHistoryTimeChange) && isset($taskHistory->AmbitHistoryOrder)) {
|
||||
|
||||
// Extrai apenas a data da coluna AmbitHistoryTimeChange
|
||||
$ambitDate = \Carbon\Carbon::parse($taskHistory->AmbitHistoryTimeChange)->format('Y-m-d');
|
||||
|
||||
// Cria uma nova entrada com os valores desejados
|
||||
$ambitHistories->push([
|
||||
'AmbitHistoryOrder' => $taskHistory->AmbitHistoryOrder,
|
||||
'AmbitName' => isset($taskHistory->AmbitName) ? $taskHistory->AmbitName : 'N/A',
|
||||
'AmbitHistoryTimeChange' => $ambitDate
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
//Precisamos receber o Tipo de equipamento e detalhes da Obra, alem do atributos especificos de acordo com o tipo de equipamento.
|
||||
|
||||
// Converte as imagens para base64 usando o serviço PdfWrapper
|
||||
$pdfWrapper = new PdfWrapper();
|
||||
|
||||
// dd($receiveAllTasksHistiory);
|
||||
|
||||
// Gera e retorna o PDF
|
||||
return $pdfWrapper
|
||||
|
||||
|
||||
// ->setIncludePath('$PATH:/usr/bin')
|
||||
->loadView('projectsClients.pdf.testePdf', [
|
||||
'tag' => $detailsEquipment->equipment_tag,
|
||||
'numeroPanini' => $detailsEquipmentWorkHistory->ispt_number,
|
||||
'nObra' => $receiveDetailsProject->project_company_name,
|
||||
|
||||
// 'tag' => $detailsEquipment->equipment_tag,
|
||||
// 'numeroPanini' => $detailsEquipmentWorkHistory->ispt_number,
|
||||
// 'nObra' => $receiveDetailsProject->project_company_name,
|
||||
|
||||
'detailsEquipment' => $detailsEquipment,
|
||||
'detailsEquipmentWorkHistory' => $detailsEquipmentWorkHistory,
|
||||
'receiveDetailsProject' => $receiveDetailsProject,
|
||||
'ambitHistories' => $ambitHistories,
|
||||
|
||||
'ambito' => $receiveAmbit->ambitsEquipment->ambits_description,
|
||||
'receiveAllTasksHistiory' => $receiveAllTasksHistiory,
|
||||
'taskImages' => $taskImages,
|
||||
'projectLogoPath' => $projectLogoPath,
|
||||
'companyLogoPath' => $companyLogoPath
|
||||
'companyLogoPath' => $companyLogoPath,
|
||||
'isptLogoPath' => $isptLogoPath,
|
||||
|
||||
'oldestDate' => $startDate, // Data mais antiga
|
||||
'latestDate' => $endDate // Data mais recente
|
||||
])
|
||||
|
||||
->stream('ispt40.pdf');
|
||||
|
|
|
|||
|
|
@ -228,15 +228,21 @@ public function receiveAnswersEquipment(Request $request, $control_equipment_wor
|
|||
// Busca a Ws com base no id recebido da tabela Control.
|
||||
$receiveDataControlWs = ControlEquipmentWorkstation::find($control_equipment_workstation_id);
|
||||
|
||||
// Cria um novo comentario para a tarefa em particular.
|
||||
$newTaskEquipmentComments = new TaskEquipmentComment;
|
||||
$newTaskEquipmentComments->equipmentWorkHistorys_id = $receiveDataControlWs->equipmentWorkHistorys_id;
|
||||
$newTaskEquipmentComments->control_equipment_workstation_id = $receiveDataControlWs->control_equipment_workstation_id;
|
||||
$newTaskEquipmentComments->task_comment = $request->comment;
|
||||
$newTaskEquipmentComments->save();
|
||||
//Antes de criar um comentario, verifica se existe comentario
|
||||
if ($request->comment <> null) {
|
||||
// Cria um novo comentario para a tarefa em particular.
|
||||
$newTaskEquipmentComments = new TaskEquipmentComment;
|
||||
$newTaskEquipmentComments->equipmentWorkHistorys_id = $receiveDataControlWs->equipmentWorkHistorys_id;
|
||||
$newTaskEquipmentComments->control_equipment_workstation_id = $receiveDataControlWs->control_equipment_workstation_id;
|
||||
$newTaskEquipmentComments->task_comment = $request->comment;
|
||||
$newTaskEquipmentComments->save();
|
||||
|
||||
// Apos ter cria um novo comentario para a tarefa, adiciona na control para relacionar o comentario a tarefa atual
|
||||
$receiveDataControlWs->task_equipment_comments_id = $newTaskEquipmentComments->task_equipment_comments_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Apos ter cria um novo comentario para a tarefa, adiciona na control para relacionar o comentario a tarefa atual
|
||||
$receiveDataControlWs->task_equipment_comments_id = $newTaskEquipmentComments->task_equipment_comments_id;
|
||||
|
||||
$receiveDataControlWs->elemental_tasks_id = $elementalTaskID;
|
||||
$receiveDataControlWs->departure_date = now();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ public function compose(View $view)
|
|||
$receiveDataEmail = User::where('email', $userEmail)->first();
|
||||
$receiveDataWs = ConstructionWorkstation::where('name_workstations', $receiveDataEmail->user_name)->first();
|
||||
|
||||
|
||||
$equipmentToReview = collect(); // Coleção para armazenar equipamentos para revisão
|
||||
$executionEquipment = collect();// Coleção para armazenar equipamentos em execussao
|
||||
$completedEquipments = collect(); // Coleção para armazenar equipamentos concluídos
|
||||
|
||||
// Verifica equipamentos que tenho 2 dados com o departure_date = NULL e especificamente um dado tem o elemental_tasks_id = 9 e o outro igual a NULL.
|
||||
//Isto para ser possivel identificar equipamentos (psv-Provavelmente) que esta sendo feitas em simultanio suas pecas e nao deve ser diponivel ate uma de suas pecas tiverem deponivel.
|
||||
$excludedEquipmentsQuery = ControlEquipmentWorkstation::select('equipmentWorkHistorys_id')
|
||||
|
|
@ -94,17 +99,13 @@ public function compose(View $view)
|
|||
return $equipment;
|
||||
});
|
||||
|
||||
$equipmentToReview = collect(); // Coleção para armazenar equipamentos para revisão
|
||||
|
||||
$completedEquipments = collect(); // Coleção para armazenar equipamentos concluídos
|
||||
|
||||
// Inicializa um array para armazenar o status de cada equipamento
|
||||
$equipmentStatus = [];
|
||||
|
||||
foreach ($receiveAllEquipmentOfProject as $equipment) {
|
||||
|
||||
// Agora 'equipmentWorkHistoryId' contém um único ID, então não usamos 'pluck'
|
||||
$workHistoryId = $equipment->equipmentWorkHistoryId; // Obter ID do histórico de trabalho diretamente
|
||||
$workHistoryId = $equipment->equipmentWorkHistoryId; //// Obter ID do histórico de trabalho diretamente
|
||||
|
||||
// Verifica se existe um workHistoryId antes de prosseguir
|
||||
//POREM POR NORMA, TODOS DEVEM TER
|
||||
|
|
@ -113,7 +114,8 @@ public function compose(View $view)
|
|||
}
|
||||
|
||||
$taskIds = OrderEquipmentTasks::where('equipmentWorkHistorys_id', $workHistoryId)
|
||||
->pluck('elemental_tasks_id'); // Obter IDs de tarefas elementares baseado em um único workHistoryId
|
||||
->pluck('elemental_tasks_id'); // Obter IDs de tarefas elementares baseado em um único workHistoryId(recebe as tarefas para o equipamento atual)
|
||||
|
||||
|
||||
if ($taskIds->isEmpty()) {
|
||||
continue; // Se não houver tarefas, continua para o próximo equipamento
|
||||
|
|
@ -122,10 +124,15 @@ public function compose(View $view)
|
|||
// Busca registros na ControlEquipmentWorkstation com base no equipmentWorkHistoryId
|
||||
$controlRecords = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $workHistoryId)->get();
|
||||
|
||||
// Remover equipamentos concluídos da coleção original
|
||||
if ($controlRecords->isEmpty()) {
|
||||
// Se não houver registros, considera como valor 0 (nenhuma tarefa ativa)
|
||||
$equipmentStatus[$equipment->equipment_id] = 0;
|
||||
} else {
|
||||
//Caso ja tenha dados sobre o equipamento no control, significa que ja e um equipamento 'Em execussao'
|
||||
//Ao colocar aqui a adicao a execussao, ele apenas considera os equipamentos que estao em algum posto de trabalho, sem considerar as tarefas ja feitas.
|
||||
$executionEquipment->push($equipment);
|
||||
|
||||
//Deve verificar se o departure_date e NULL e o id_workstations <> null, e status = 0
|
||||
// $activeTasks = $controlRecords->whereNull('departure_date');
|
||||
$activeTasks = $controlRecords->whereNull('departure_date')
|
||||
|
|
@ -141,7 +148,7 @@ public function compose(View $view)
|
|||
$hasCorpoTask = $activeTasks->contains('elemental_tasks_id', null);
|
||||
|
||||
if ($hasObturadorTask) {
|
||||
// Se tiver tarefa ativa para Obturador, valor = 2
|
||||
// Verifica as condições para determinar os valores 1 ou 2
|
||||
$equipmentStatus[$equipment->equipment_id] = 2;
|
||||
} elseif ($hasCorpoTask) {
|
||||
// Se tiver tarefa ativa para Corpo, valor = 1
|
||||
|
|
@ -153,39 +160,6 @@ public function compose(View $view)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// $workstationTaskCounts = ControlEquipmentWorkstation::whereIn('elemental_tasks_id', $taskIds)
|
||||
// ->select('elemental_tasks_id', DB::raw('count(*) as total'))
|
||||
// ->groupBy('elemental_tasks_id')
|
||||
// ->pluck('total', 'elemental_tasks_id'); // Contagem de tarefas nas estações de trabalho
|
||||
|
||||
|
||||
// Vai verificar diretamente na base de dados , busca todos os dados do equipmentWorkHistorys_id, nesta obra e verificar com base na colecao recebida, se entre todos os seus valores, tem pelo menos um elemental_tasks_id, presente na variavel $taskIds
|
||||
// $taskCountsInControlRecords = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $workHistoryId)
|
||||
// ->whereNotNull('departure_date')
|
||||
// ->whereIn('elemental_tasks_id', $taskIds)
|
||||
// ->groupBy('elemental_tasks_id')
|
||||
// ->select('elemental_tasks_id', DB::raw('COUNT(*) as count'))
|
||||
// ->pluck('count', 'elemental_tasks_id');
|
||||
|
||||
// // Verifica se todas as tarefas foram concluídas pelo menos uma vez
|
||||
// $allTasksCompleted = $taskIds->every(function ($taskId) use ($taskCountsInControlRecords) {
|
||||
// return isset ($taskCountsInControlRecords[$taskId]) && $taskCountsInControlRecords[$taskId] > 0;
|
||||
// });
|
||||
|
||||
// //$allTasksCompleted vai ter TRUE, apenas quando se verificar todos as tarefas foram feitas no equipamento.
|
||||
// if ($allTasksCompleted) {
|
||||
// $changeEquipmentStatus = EquipmentWorkHistory::where('equipmentWorkHistorys_id', $equipment->equipmentWorkHistoryId)->first();
|
||||
|
||||
// if ($changeEquipmentStatus->equipment_status_project == 2) {
|
||||
// $completedEquipments->push($equipment);
|
||||
// $changeEquipmentStatus->equipment_status_project = 1;
|
||||
// $changeEquipmentStatus->save();
|
||||
// } elseif ($changeEquipmentStatus->equipment_status_project == 4) {
|
||||
// $equipmentToReview->push($equipment);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Vai verificar diretamente na base de dados , busca todos os dados do equipmentWorkHistorys_id, nesta obra e verificar com base na colecao recebida, se entre todos os seus valores, tem pelo menos um elemental_tasks_id, presente na variavel $taskIds
|
||||
$taskCountsInControlRecords = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $workHistoryId)
|
||||
->whereNotNull('departure_date')
|
||||
|
|
@ -206,38 +180,35 @@ public function compose(View $view)
|
|||
$changeEquipmentStatus->equipment_status_project = 1;
|
||||
$changeEquipmentStatus->save();
|
||||
} elseif ($changeEquipmentStatus->equipment_status_project == 2) {
|
||||
|
||||
// Equipamento sera movido para $completedEquipments e removido de outros estados
|
||||
$completedEquipments->push($equipment);
|
||||
$executionEquipment = $executionEquipment->reject(function ($e) use ($equipment) {
|
||||
return $e->equipment_id == $equipment->equipment_id;
|
||||
});
|
||||
$equipmentToReview = $equipmentToReview->reject(function ($e) use ($equipment) {
|
||||
return $e->equipment_id == $equipment->equipment_id;
|
||||
});
|
||||
} elseif ($changeEquipmentStatus->equipment_status_project == 4) {
|
||||
|
||||
//Equipamento sera movido para $equipmentToReview e removido de outros estados
|
||||
$equipmentToReview->push($equipment);
|
||||
$executionEquipment = $executionEquipment->reject(function ($e) use ($equipment) {
|
||||
return $e->equipment_id == $equipment->equipment_id;
|
||||
});
|
||||
$completedEquipments = $completedEquipments->reject(function ($e) use ($equipment) {
|
||||
return $e->equipment_id == $equipment->equipment_id;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remover equipamentos concluídos da coleção original
|
||||
$receiveAllEquipmentOfProject = $receiveAllEquipmentOfProject->reject(function ($equipment) use ($completedEquipments) {
|
||||
return $completedEquipments->contains($equipment);
|
||||
});
|
||||
|
||||
|
||||
// Remover equipamentos a serem revisados da coleção original
|
||||
$receiveAllEquipmentOfProject = $receiveAllEquipmentOfProject->reject(function ($equipment) use ($equipmentToReview) {
|
||||
return $equipmentToReview->contains($equipment);
|
||||
});
|
||||
|
||||
// if ($allTasksCompleted) {
|
||||
// $completedEquipments->push($equipment);
|
||||
|
||||
// //Se o equipamento for verificado como concluido, altera o seu status na Obra, para o mesmo ser indicado como um equipamento pendente a aplovacao de Admin.
|
||||
// $changeEquipmentStatus = EquipmentWorkHistory::where('equipmentWorkHistorys_id',$equipment->equipmentWorkHistoryId)->first();
|
||||
// $changeEquipmentStatus->equipment_status_project = 1;
|
||||
// $changeEquipmentStatus->save();
|
||||
// }
|
||||
}
|
||||
|
||||
// Remover equipamentos concluídos da coleção original
|
||||
// $receiveAllEquipmentOfProject = $receiveAllEquipmentOfProject->reject(function ($equipment) use ($completedEquipments) {
|
||||
// return $completedEquipments->contains($equipment);
|
||||
// });
|
||||
// Remover equipamentos já concluidos das coleções
|
||||
$receiveAllEquipmentOfProject = $receiveAllEquipmentOfProject->reject(function ($equipment) use ($completedEquipments, $equipmentToReview, $executionEquipment) {
|
||||
return $completedEquipments->contains($equipment)
|
||||
|| $equipmentToReview->contains($equipment)
|
||||
|| $executionEquipment->contains($equipment);
|
||||
});
|
||||
|
||||
$equipmentIds = array_keys($equipmentStatus);
|
||||
|
||||
|
|
@ -283,6 +254,7 @@ public function compose(View $view)
|
|||
'receiveAllEquipmentOfProject' => $receiveAllEquipmentOfProject,
|
||||
// foi alterado para a variavel 'filteredQrcodeEquipments' pois nao tem a necessidade do utilizador selecionar 'Flange'(AINDA NAO !)
|
||||
'receiveQrcodeEquipmentsProject' => $filteredQrcodeEquipments,
|
||||
'executionEquipment' => $executionEquipment,
|
||||
'completedEquipments' => $completedEquipments,
|
||||
'equipmentToReview' => $equipmentToReview,
|
||||
'receiveDataWs' => $receiveDataWs,
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public function equipmentAssociationAmbit()
|
|||
}
|
||||
|
||||
public function HistoryOfEquipmentAmbitsInTheProject (){
|
||||
return $this->hasMany(HistoryOfEquipmentAmbitsInTheProject::class, 'ambits_id', 'ambits_id');
|
||||
return $this->hasMany(HistoryOfEquipmentAmbitsInTheProject::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ public function AmbitsEquipment (){
|
|||
}
|
||||
|
||||
public function EquipmentWorkHistory (){
|
||||
return $this->belongsTo(EquipmentWorkHistory::class, 'ambits_id', 'ambits_id');
|
||||
return $this->belongsTo(EquipmentWorkHistory::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,481 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ config('app.name') }}</title>
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="{{ URL::asset('assets/dist/img/favicon.ico') }}">
|
||||
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
{{-- <link rel="stylesheet" href="{{ URL::asset('assets/plugins/fontawesome-free/css/all.min.css') }}"> --}}
|
||||
<link rel="stylesheet" href="{{ asset('assets/plugins/fontawesome-6.4.2/css/all.css') }}">
|
||||
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
||||
<!-- Tempusdominus Bootstrap 4 -->
|
||||
<link rel="stylesheet"
|
||||
href="{{ URL::asset('assets/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css') }}">
|
||||
<!-- iCheck -->
|
||||
<link rel="stylesheet" href="{{ URL::asset('assets/plugins/icheck-bootstrap/icheck-bootstrap.min.css') }}">
|
||||
<!-- JQVMap -->
|
||||
<link rel="stylesheet" href="{{ URL::asset('assets/plugins/jqvmap/jqvmap.min.css') }}">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="{{ URL::asset('assets/dist/css/adminlte.min.css') }}">
|
||||
<!-- overlayScrollbars -->
|
||||
<link rel="stylesheet" href="{{ URL::asset('assets/plugins/overlayScrollbars/css/OverlayScrollbars.min.css') }}">
|
||||
<!-- Daterange picker -->
|
||||
<link rel="stylesheet" href="{{ URL::asset('assets/plugins/daterangepicker/daterangepicker.css') }}">
|
||||
<!-- summernote -->
|
||||
<link rel="stylesheet" href="{{ URL::asset('assets/plugins/summernote/summernote-bs4.min.css') }}">
|
||||
|
||||
<style>
|
||||
[class*=sidebar-dark] .btn-sidebar2,
|
||||
[class*=sidebar-dark] .form-control-sidebar2 {
|
||||
background-color: #3f474e;
|
||||
border: 1px solid #56606a;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition sidebar-mini layout-fixed">
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- Navbar -->
|
||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light" style="background-color: #00B0EA">
|
||||
<!-- Left navbar links -->
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"
|
||||
style="color:#1f2d3d"></i></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link">
|
||||
<i class="fas fa-play" style="color:#1f3d2f"></i>
|
||||
<span class="badge badge-info navbar-badge">{{ count($receiveAllEquipmentOfProject) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link">
|
||||
<i class="fas fa-check" style="color:#1f2d3d"></i>
|
||||
<span class="badge badge-success navbar-badge"
|
||||
style="background-color: #28a745">{{ count($completedEquipments) }} </span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Right navbar links -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<!--<div class="nav-link">{{ Auth::user()->user_name }}</div>-->
|
||||
<div class="nav-link" style="color:#1f2d3d">{{ $receiveDataWs->nomenclature_workstation }}</div>
|
||||
</li>
|
||||
<!-- User Dropdown Menu -->
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#">
|
||||
<img src="{{ URL::asset('assets/dist/img/ispt.jpg') }}" class="img-circle elevation-2"
|
||||
alt="User Image" style="width:30px;height:30px;">
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST">
|
||||
@csrf
|
||||
@method('POST')
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
|
||||
<i class="fas fa-sign-out-alt text-danger"></i>
|
||||
<span>Terminar sessão</span>
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
<!-- Control sidebar -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-widget="control-sidebar" data-controlsidebar-slide="true" href="#"
|
||||
role="button" style="color:#1f2d3d">
|
||||
<i class="fas fa-bars"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary elevation-4" style="background-color: #09255C">
|
||||
<!-- Brand Logo -->
|
||||
<p class="brand-link">
|
||||
<img src="{{ URL::asset('assets/dist/img/ispt40.jpg') }}" alt="Ispt4.0 Logo"
|
||||
class="brand-image img-circle elevation-3" style="opacity: .8">
|
||||
<span class="brand-text font-weight-light">{{ config('app.name') }}</span>
|
||||
</p>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar mt-4">
|
||||
|
||||
<!-- SidebarSearch Form -->
|
||||
<div class="form-inline">
|
||||
<div class="input-group" data-widget="sidebar-search">
|
||||
<input id="qrtextleft" class="form-control form-control-sidebar text-white" type="search"
|
||||
placeholder="Procurar" aria-label="Search">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-sidebar">
|
||||
<i class="fas fa-search fa-fw text-white"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar" data-widget="treeview" role="menu">
|
||||
|
||||
<!-- <ul class="nav nav-pills nav-sidebar flex-column searchable" data-widget="treeview" role="menu" data-accordion="false" style="display: none;">
|
||||
Add icons to the links using the .nav-icon class
|
||||
with font-awesome or any other icon font library -->
|
||||
<li class="nav-item menu-closed">
|
||||
<a href="#" class="nav-link text-white" style="background-color: #007BFF;">
|
||||
<i class="nav-icon fas fa-play"></i>
|
||||
<p>
|
||||
{{ count($receiveAllEquipmentOfProject) }}
|
||||
a iniciar
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach ($receiveAllEquipmentOfProject as $equipmentOfProject)
|
||||
<li class="nav-item">
|
||||
<a href="{{ route('getEquipmentData', $equipmentOfProject->equipment_id) }}"
|
||||
class="nav-link text-white">
|
||||
<i class="fas fa-tag nav-icon"></i>
|
||||
<p>{{ $equipmentOfProject->equipment_tag }}</p>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{-- <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||
data-accordion="false"> --}}
|
||||
<ul id="realQrcodes" class="nav nav-pills nav-sidebar flex-column searchable"
|
||||
data-widget="treeview" role="menu" data-accordion="false" style="display: none;">
|
||||
{{-- <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||
data-accordion="false" style="display: none;"> --}}
|
||||
<!-- Add icons to the links using the .nav-icon class
|
||||
with font-awesome or any other icon font library -->
|
||||
<li class="nav-item menu-closed">
|
||||
<a href="#" class="nav-link text-white" style="background-color: #007BFF;">
|
||||
<i class="nav-icon fas fa-play"></i>
|
||||
<p>
|
||||
{{ count($receiveQrcodeEquipmentsProject) }}
|
||||
a iniciar QrCodes
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach ($receiveQrcodeEquipmentsProject as $equipmentOfProject)
|
||||
<li class="nav-item">
|
||||
<a href="{{ route('getEquipmentData', $equipmentOfProject->equipment_id) }}"
|
||||
class="nav-link text-white">
|
||||
<i class="fas fa-tag nav-icon"></i>
|
||||
<p>{{ $equipmentOfProject->component_tag }}</p>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<!-- Info box1 -->
|
||||
<div class="col-sm-6">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- /.col -->
|
||||
<div class="col-sm-6">
|
||||
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
@yield('content')
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<footer class="main-footer" style="background-color: #00B0EA">
|
||||
<strong>Copyright © 2017-{{ date('Y') }} <a href="https://www.isptgroup.com" target="_blank">ISPT -
|
||||
Industrial Services,
|
||||
SA</a>.</strong>
|
||||
Todos os direitos reservados.
|
||||
<div class="float-right d-none d-sm-inline-block">
|
||||
<b>Versão</b> {{ config('app.version') }}
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark" data-widget="control-treeview"
|
||||
style="background-color: #09255C">
|
||||
<!-- Control sidebar content goes here -->
|
||||
<div class="p-3 control-sidebar-content">
|
||||
|
||||
<!-- SidebarSearch Form -->
|
||||
<div class="form-inline">
|
||||
<div class="input-group" data-widget="sidebar-search">
|
||||
<input id="qrtextright" class="form-control form-control-sidebar text-white" type="search"
|
||||
placeholder="Procurar" aria-label="Search">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-sidebar">
|
||||
<i class="fas fa-search fa-fw text-white"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column control-sidebar-treeview" role="menu"
|
||||
data-accordion="false">
|
||||
<!-- Add icons to the links using the .nav-icon class
|
||||
with font-awesome or any other icon font library -->
|
||||
<li class="nav-item menu-closed">
|
||||
<a href="#" class="nav-link text-white" style="background-color: #28a745;">
|
||||
<i class="nav-icon fas fa-check"></i>
|
||||
<p>
|
||||
{{ count($completedEquipments) }}
|
||||
válvulas concluídas
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach ($completedEquipments as $equipmentDone)
|
||||
<li class="nav-item-right">
|
||||
<a href="#" class="nav-link text-white">
|
||||
<i class="fas fa-tag nav-icon"></i>
|
||||
<p>{{ $equipmentDone->equipment_tag }}</p>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.control-sidebar-menu -->
|
||||
</div>
|
||||
</aside>
|
||||
<!-- /.control-sidebar -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{{ URL::asset('assets/plugins/jquery/jquery.min.js') }}"></script>
|
||||
<!-- jQuery UI 1.11.4 -->
|
||||
<script src="{{ URL::asset('assets/plugins/jquery-ui/jquery-ui.min.js') }}"></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button)
|
||||
</script>
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="{{ URL::asset('assets/plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<!-- ChartJS -->
|
||||
<script src="{{ URL::asset('assets/plugins/chart.js/Chart.min.js') }}"></script>
|
||||
<!-- Sparkline -->
|
||||
<script src="{{ URL::asset('assets/plugins/sparklines/sparkline.js') }}"></script>
|
||||
<!-- JQVMap -->
|
||||
<script src="{{ URL::asset('assets/plugins/jqvmap/jquery.vmap.min.js') }}"></script>
|
||||
<script src="{{ URL::asset('assets/plugins/jqvmap/maps/jquery.vmap.usa.js') }}"></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script src="{{ URL::asset('assets/plugins/jquery-knob/jquery.knob.min.js') }}"></script>
|
||||
<!-- daterangepicker -->
|
||||
<script src="{{ URL::asset('assets/plugins/moment/moment.min.js') }}"></script>
|
||||
<script src="{{ URL::asset('assets/plugins/daterangepicker/daterangepicker.js') }}"></script>
|
||||
<!-- Tempusdominus Bootstrap 4 -->
|
||||
<script src="{{ URL::asset('assets/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') }}">
|
||||
</script>
|
||||
<!-- Summernote -->
|
||||
<script src="{{ URL::asset('assets/plugins/summernote/summernote-bs4.min.js') }}"></script>
|
||||
<!-- overlayScrollbars -->
|
||||
<script src="{{ URL::asset('assets/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js') }}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="{{ URL::asset('assets/dist/js/adminlte.js') }}"></script>
|
||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
||||
<script src="{{ URL::asset('assets/dist/js/pages/dashboard.js') }}"></script>
|
||||
<!-- HTML5 QRCode-->
|
||||
<script src="{{ URL::asset('assets/plugins/html5-qrcode/html5-qrcode.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
function searchForValueAndNavigate(value, itemsSelector, containerSelector) {
|
||||
var searchQuery = value.toLowerCase();
|
||||
var found = false; // Variable to track if any item is found
|
||||
|
||||
$(itemsSelector).each(function() {
|
||||
var itemText = $(this).text().toLowerCase();
|
||||
if (itemText.includes(searchQuery)) {
|
||||
found = true;
|
||||
window.location.href = $(this).attr('href');
|
||||
return false; // Exit the .each loop after attempting navigation
|
||||
}
|
||||
});
|
||||
|
||||
// If no item is found, change the class of <li> elements
|
||||
if (!found) {
|
||||
$(containerSelector + ' .nav-item.menu-open').each(function() {
|
||||
$(this).removeClass('menu-open').addClass('menu-closed');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let scanner = new Html5Qrcode("reader");
|
||||
let startScan = document.getElementById("startScan");
|
||||
let reader = document.getElementById("reader");
|
||||
let qrtextleft = document.getElementById("qrtextleft");
|
||||
let qrtextright = document.getElementById("qrtextright");
|
||||
|
||||
startScan.addEventListener('click', function() {
|
||||
// Hiding the startScan button and showing the reader
|
||||
startScan.style.display = "none";
|
||||
reader.style.display = "block";
|
||||
|
||||
scanner.start({
|
||||
facingMode: "environment"
|
||||
}, {
|
||||
fps: 20,
|
||||
qrbox: {
|
||||
width: 250,
|
||||
height: 250
|
||||
}
|
||||
},
|
||||
function(qrCodeMessage) {
|
||||
// This is called when a QR Code is scanned
|
||||
|
||||
// Suppress every text in front of "@" including it
|
||||
qrCodeMessage = qrCodeMessage.split('@')[0];
|
||||
|
||||
scanner.stop().then(() => {
|
||||
qrtextleft.value = qrCodeMessage;
|
||||
qrtextright.value = qrCodeMessage;
|
||||
reader.style.display = "none";
|
||||
startScan.style.display = "block";
|
||||
|
||||
// Trigger the search functionality for both sidebars
|
||||
searchForValueAndNavigate(qrCodeMessage,
|
||||
'.main-sidebar .nav.nav-pills.nav-sidebar.flex-column li a',
|
||||
'.main-sidebar');
|
||||
searchForValueAndNavigate(qrCodeMessage,
|
||||
'.control-sidebar .nav.nav-pills.nav-sidebar.flex-column li a',
|
||||
'.control-sidebar');
|
||||
});
|
||||
},
|
||||
function(errorMessage) {
|
||||
// In case of errors
|
||||
console.log(errorMessage);
|
||||
}
|
||||
)
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Clone the behavior of treeview to control-treeview
|
||||
$(document).on('click', '[data-widget="control-treeview"] .nav-link', function(event) {
|
||||
event.preventDefault();
|
||||
var checkElement = $(this).next();
|
||||
|
||||
if ((checkElement.is('.nav-treeview')) && (checkElement.is(':visible'))) {
|
||||
checkElement.slideUp('normal', function() {
|
||||
checkElement.removeClass('menu-open');
|
||||
});
|
||||
checkElement.parent("li").removeClass("menu-open");
|
||||
} else if ((checkElement.is('.nav-treeview')) && (!checkElement.is(':visible'))) {
|
||||
var parent = $(this).parents('ul').first();
|
||||
var ul = parent.find('ul:visible').slideUp('normal');
|
||||
ul.removeClass('menu-open');
|
||||
var parent_li = $(this).parent("li");
|
||||
|
||||
checkElement.slideDown('normal', function() {
|
||||
checkElement.addClass('menu-open');
|
||||
parent.find('.menu-open').not(checkElement).removeClass('menu-open');
|
||||
});
|
||||
}
|
||||
if (checkElement.is('.nav-treeview')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function handleSearch(inputSelector, itemsSelector, containerSelector) {
|
||||
console.log(inputSelector);
|
||||
$(inputSelector).on('keyup', function() {
|
||||
var searchQuery = $(this).val().toLowerCase();
|
||||
var found = false; // Variable to track if any item is found
|
||||
|
||||
$(itemsSelector).each(function() {
|
||||
var itemText = $(this).text().toLowerCase();
|
||||
if (itemText.includes(searchQuery)) {
|
||||
$(this).show();
|
||||
found = true;
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
|
||||
// If any item is found, change the class of <li> elements
|
||||
if (found) {
|
||||
$(containerSelector + ' .nav-item.menu-closed').each(function() {
|
||||
$(this).removeClass('menu-closed').addClass('menu-open');
|
||||
});
|
||||
} else {
|
||||
$(containerSelector + ' .nav-item.menu-open').each(function() {
|
||||
$(this).removeClass('menu-open').addClass('menu-closed');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Nao me parece fazer nada, nao encontrei funcionalidade ainda, ja que a pesquisa ainda e feita, e a selacao tambem.
|
||||
handleSearch('#qrtextleft', '.searchable .nav.nav-pills.nav-sidebar.flex-column li', '.searchable');
|
||||
|
||||
|
||||
|
||||
// Apply the search functionality for the main sidebar
|
||||
// handleSearch('#qrtextleft', '.main-sidebar .nav.nav-pills.nav-sidebar.flex-column li', '.main-sidebar');
|
||||
|
||||
// Apply the search functionality for the control sidebar
|
||||
// handleSearch('#qrtextright', '.control-sidebar .nav.nav-pills.nav-sidebar.flex-column li', '.control-sidebar');
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -3,75 +3,124 @@
|
|||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PDF Report</title>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 50px;
|
||||
/* Ajuste conforme necessário */
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
margin-bottom: 100px;
|
||||
@page {
|
||||
size: A4;
|
||||
margin-top: 15mm;
|
||||
margin-bottom: 15mm;
|
||||
margin-left: 15mm;
|
||||
margin-right: 15mm;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* css para as pagina principal */
|
||||
.container-frist-page {
|
||||
/* border: 1px solid black; */
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-frist-page {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
.header-frist-page .title {
|
||||
text-align: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.header-frist-page .info {
|
||||
text-align: right;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.info-table,
|
||||
.spec-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.info {
|
||||
text-align: center;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.info-table td,
|
||||
.spec-table td,
|
||||
.info-table th,
|
||||
.spec-table th {
|
||||
border: 1px solid black;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.spec-table .section-title {
|
||||
background-color: #f2f2f2;
|
||||
text-align: left;
|
||||
padding-left: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* css para as paginas de loop */
|
||||
.container-loop-pages {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-container-loop-pages {
|
||||
/* border: 1px solid black; */
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.content-loop-pages {
|
||||
margin-top: 40px;
|
||||
padding: 0px;
|
||||
|
||||
}
|
||||
|
||||
.footer-container {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 170px;
|
||||
/* Aumente para dar mais espaço para o cabeçalho */
|
||||
margin-bottom: 50px;
|
||||
/* Espaço para o rodapé */
|
||||
/* padding: 0 5px; */
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<header class="mb-3">
|
||||
@include(
|
||||
'projectsClients.pdf._header',
|
||||
compact('tag', 'numeroPanini', 'nObra', 'ambito', 'projectLogoPath', 'companyLogoPath'))
|
||||
</header>
|
||||
<!-- Primeira Página -->
|
||||
@yield('firstPage')
|
||||
|
||||
<div>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
{{-- <footer>
|
||||
@include('projectsClients.pdf._footer', ['pageCounter' => $pageCounter])
|
||||
@include('projectsClients.pdf._footer')
|
||||
</footer> --}}
|
||||
</div>
|
||||
<!-- Páginas subsequentes -->
|
||||
@yield('loopPages')
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
|||
92
resources/views/components/pdf-layout.blade.php.bak
Normal file
92
resources/views/components/pdf-layout.blade.php.bak
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 50px;
|
||||
/* Ajuste conforme necessário */
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 170px;
|
||||
/* Aumente para dar mais espaço para o cabeçalho */
|
||||
margin-bottom: 50px;
|
||||
/* Espaço para o rodapé */
|
||||
/* padding: 0 5px; */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
{{-- <div class="container">
|
||||
<header class="mb-3">
|
||||
@include(
|
||||
'projectsClients.pdf._header',
|
||||
compact('tag', 'numeroPanini', 'nObra', 'ambito', 'projectLogoPath', 'companyLogoPath'))
|
||||
</header>
|
||||
|
||||
<div>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
<!-- <footer>
|
||||
@include('projectsClients.pdf._footer', ['pageCounter' => $pageCounter])
|
||||
@include('projectsClients.pdf._footer')
|
||||
</footer> -->
|
||||
</div> --}}
|
||||
|
||||
<div class="container">
|
||||
|
||||
<!-- Conteúdo específico da primeira página -->
|
||||
{{-- <div class="first-page"> --}}
|
||||
@yield('firstPage')
|
||||
|
||||
<!-- Conteúdo para o restante das páginas -->
|
||||
{{-- <div class="loop-pages">
|
||||
@yield('loopPages')
|
||||
</div> --}}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,37 +1,46 @@
|
|||
<div class="container">
|
||||
<div class="header-container-loop-pages">
|
||||
<!-- Logo -->
|
||||
<div class="row" style="height: 70px; margin-bottom: 15px;">
|
||||
<!-- Imagem no extremo esquerdo -->
|
||||
<div class="col d-flex justify-content-start align-items-center" style="height: 100%; ">
|
||||
<img src="{{ public_path($projectLogoPath) }}" alt="Project Logo" class="img-fluid"
|
||||
style="max-width: 70px; max-height: 70px;">
|
||||
</div>
|
||||
<!-- Imagem no extremo esquerdo -->
|
||||
<div class="col d-flex justify-content-start align-items-center" style="height: 100%;">
|
||||
<img src="{{ public_path($projectLogoPath) }}" alt="Project Logo" class="img-fluid"
|
||||
style="max-width: 85px; max-height: 85px;">
|
||||
<!-- Imagem no extremo direito -->
|
||||
<div class="col d-flex justify-content-end align-items-center" style="height: 100%;">
|
||||
<img src="{{ public_path($companyLogoPath) }}" alt="Company Logo" class="img-fluid"
|
||||
style="max-width: 70px; max-height: 70px;">
|
||||
{{-- <img src="{{ public_path($companyLogoPath) }}" alt="Company Logo" class="img-fluid"
|
||||
style="max-width: 70px; max-height: 70px;"> --}}
|
||||
<img src="{{ public_path($projectLogoPath) }}" alt="Company Logo" class="img-fluid"
|
||||
style="max-width: 85px; max-height: 85px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Relatório de Dados -->
|
||||
<div class="row" style="margin-left: 2px;">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>Tag:</strong> {{ $tag ?? 'N/A' }}</p>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>Número Panini:</strong>
|
||||
{{ $numeroPanini ?? 'N/A' }}</p>
|
||||
</div>
|
||||
{{-- <div class="row">
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>Tag:</strong> {{ $tag ?? 'N/A' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="row ">
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>N. Obra:</strong> {{ $nObra ?? 'N/A' }}</p>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>Âmbito:</strong> {{ $ambito ?? 'N/A' }}</p>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>Número Panini:</strong>
|
||||
{{ $numeroPanini ?? 'N/A' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ">
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>N. Obra:</strong> {{ $nObra ?? 'N/A' }}</p>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<p class="mb-0" style="border-style: double;"><strong>Âmbito:</strong> {{ $ambito ?? 'N/A' }}</p>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<!-- Relatório de Dados -->
|
||||
<table class="info-table">
|
||||
<tr>
|
||||
<td> <b>Tag:</b> <span>{{ $detailsEquipment->equipment_tag ?? 'N/A' }}</span></td>
|
||||
<td> <b>N. ISPT:</b> <span>{{ $detailsEquipmentWorkHistory->ispt_number ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <b>N. Obra:</b> <span>{{ $nObra ?? 'N/A' }}</span></td>
|
||||
<td> <b>Âmbito:</b> <span>{{ $ambito ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{{-- @php
|
||||
$pageCounter = 1;
|
||||
@endphp
|
||||
@endphp
|
||||
|
||||
<x-pdf-layout :tag="$tag" :numeroPanini="$numeroPanini" :nObra="$nObra" :ambito="$ambito" :projectLogoPath="$projectLogoPath"
|
||||
<x-pdf-layout :tag="$tag" :numeroPanini="$numeroPanini" :nObra="$nObra" :ambito="$ambito" :projectLogoPath="$projectLogoPath"
|
||||
:pageCounter="$pageCounter" :companyLogoPath="$companyLogoPath">
|
||||
|
||||
|
||||
|
|
@ -37,10 +37,9 @@
|
|||
|
||||
|
||||
|
||||
<x-pdf-layout :tag="$tag" :numeroPanini="$numeroPanini" :nObra="$nObra" :ambito="$ambito" :projectLogoPath="$projectLogoPath"
|
||||
{{-- <x-pdf-layout :tag="$tag" :numeroPanini="$numeroPanini" :nObra="$nObra" :ambito="$ambito" :projectLogoPath="$projectLogoPath"
|
||||
:companyLogoPath="$companyLogoPath">
|
||||
|
||||
|
||||
@php
|
||||
$pageCounter = 1;
|
||||
@endphp
|
||||
|
|
@ -56,13 +55,11 @@
|
|||
</header>
|
||||
|
||||
<div class="content mr-4">
|
||||
{{-- <h1>Lorem ipsum dolor sit amet consectetur adipisicing elit. Amet quas eligendi pariatur eum alias, aliquam distinctio cumque ut corporis. Vero illo omnis rem eligendi laudantium sunt? Autem dolores alias officiis.</h1> --}}
|
||||
@include('components.elemental-tasks', ['task_todo' => $task_todo])
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
@if (isset($taskImages[$task_todo->control_equipment_workstation_id]) &&
|
||||
is_array($taskImages[$task_todo->control_equipment_workstation_id]))
|
||||
@if (isset($taskImages[$task_todo->control_equipment_workstation_id]) && is_array($taskImages[$task_todo->control_equipment_workstation_id]))
|
||||
<div class="row no-gutters">
|
||||
@foreach ($taskImages[$task_todo->control_equipment_workstation_id] as $image)
|
||||
<div class="col-4">
|
||||
|
|
@ -94,4 +91,276 @@
|
|||
@endphp
|
||||
@endforeach
|
||||
|
||||
</x-pdf-layout>
|
||||
</x-pdf-layout> --}}
|
||||
|
||||
@extends('components.pdf-layout')
|
||||
|
||||
@section('firstPage')
|
||||
<div class="container-frist-page">
|
||||
|
||||
<div style=" border: 1px solid black;">
|
||||
|
||||
<!-- Header-frist-page -->
|
||||
<div class="header-frist-page">
|
||||
<img src="{{ public_path($isptLogoPath) }}" alt="Company Logo" class="img-fluid"
|
||||
style="max-width: 150px; max-height: 150px; border:1px solid black">
|
||||
<div class="title">
|
||||
|
||||
<!-- PSV -->
|
||||
@if ($detailsEquipment->equipment_type_id == 3)
|
||||
<h2>FICHA DE BENEFICIAÇÃO E REPARAÇÃO<br>DE<br>VÁLVULAS DE SECCIONAMENTO</h2>
|
||||
|
||||
<!-- CV -->
|
||||
@elseif($detailsEquipment->equipment_type_id == 1)
|
||||
<h2>FICHA DE BENEFICIAÇÃO E REPARAÇÃO<br>DE<br>VÁLVULAS DE CONTROLO E ON/OFF</h2>
|
||||
|
||||
<!-- ISV -->
|
||||
@else
|
||||
<h2>FICHA DE BENEFICIAÇÃO E REPARAÇÃO<br>DE<br>VÁLVULAS DE SEGURANCA</h2>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="info">
|
||||
<p> OBRA Nº:<b>N/A</b>
|
||||
<br>FICHA Nº: {{ $detailsEquipmentWorkHistory->ispt_number }}
|
||||
<br>FOLHA: 1 de 2
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Info Table -->
|
||||
<table class="info-table">
|
||||
<tr>
|
||||
<td> <b>Cliente:</b> <span>{{ $receiveDetailsProject->plant->company->company_name }}</span></td>
|
||||
<td> <b>Obra Cliente:</b> <span><b>N/A</b></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <b>Unidade:</b> <span>{{ $receiveDetailsProject->plant->plant_name }}</span></td>
|
||||
<td> <b>Trabalhos Realizados de:</b> <span>{{ $oldestDate }}</span> a <span>{{ $latestDate }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- PSV -->
|
||||
@if ($detailsEquipment->equipment_type_id == 3)
|
||||
<!-- Specifications Table -->
|
||||
{{-- <table class="spec-table">
|
||||
<tr>
|
||||
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS PSV</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TAG Válvula: <span>{{ $detailsEquipment->equipment_tag ?? 'N/A' }}</span></td>
|
||||
<td>Descrição: <span>{{ $detailsEquipment->equipment_description ?? 'N/A' }}</span></td>
|
||||
<td>N Série: <span>{{ $detailsEquipment->equipment_serial_number ?? 'N/A' }}</span></td>
|
||||
<td>Marca: <span>{{ $detailsEquipment->equipment_brand ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Modelo: <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>Dimensão: <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>Rating: <span>{{ $detailsEquipment->specificAttributes[17]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>Dim Certa: <span>{{ $detailsEquipment->specificAttributes[10]['value'] ?? 'N/A' }}</span></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Main Equipament: <span>{{ $detailsEquipment->specificAttributes[18]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td>P&ID: <span>{{ $detailsEquipment->specificAttributes[11]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>Nº SAP: <span>{{ $detailsEquipment->specificAttributes[12]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>Manufacturer: <span>{{ $detailsEquipment->specificAttributes[22]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dn_ent: <span>{{ $detailsEquipment->specificAttributes[9]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>dn_sai: <span>{{ $detailsEquipment->specificAttributes[39]['value'] ?? 'N/A' }}</span></td>
|
||||
<td>rating_flange_mount:
|
||||
<span>{{ $detailsEquipment->specificAttributes[33]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td>rating_flange_jusante:
|
||||
<span>{{ $detailsEquipment->specificAttributes[34]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sp_bar_cold: <span>{{ $detailsEquipment->specificAttributes[19]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td>back_presure_bar:
|
||||
<span>{{ $detailsEquipment->specificAttributes[20]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<!-- Ainda falta criar no general_attributes_equipaments -->
|
||||
<!-- <td colspan="2">decontamination:
|
||||
<span>{{ $detailsEquipment->specificAttributes[34]['value'] ?? 'N/A' }}</span> </td> -->
|
||||
|
||||
</tr>
|
||||
</table> --}}
|
||||
|
||||
<table class="spec-table">
|
||||
<tr>
|
||||
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS PSV</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>TAG Válvula:</b> <span>{{ $detailsEquipment->equipment_tag ?? 'N/A' }}</span></td>
|
||||
<td><b>Descrição:</b> <span>{{ $detailsEquipment->equipment_description ?? 'N/A' }}</span></td>
|
||||
<td><b>N Série:</b> <span>{{ $detailsEquipment->equipment_serial_number ?? 'N/A' }}</span></td>
|
||||
<td><b>Marca:</b> <span>{{ $detailsEquipment->equipment_brand ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Modelo:</b> <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>Dimensão:</b> <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>Rating:</b> <span>{{ $detailsEquipment->specificAttributes[17]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>Dim Certa:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[10]['value'] ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Main Equipament:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[18]['value'] ?? 'N/A' }}</span></td>
|
||||
<td><b>P&ID:</b> <span>{{ $detailsEquipment->specificAttributes[11]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>Nº SAP:</b> <span>{{ $detailsEquipment->specificAttributes[12]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>Manufacturer:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[22]['value'] ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>dn_ent:</b> <span>{{ $detailsEquipment->specificAttributes[9]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>dn_sai:</b> <span>{{ $detailsEquipment->specificAttributes[39]['value'] ?? 'N/A' }}</span>
|
||||
</td>
|
||||
<td><b>rating_flange_mount:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[33]['value'] ?? 'N/A' }}</span></td>
|
||||
<td><b>rating_flange_jusante:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[34]['value'] ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>sp_bar_cold:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[19]['value'] ?? 'N/A' }}</span></td>
|
||||
<td><b>back_presure_bar:</b>
|
||||
<span>{{ $detailsEquipment->specificAttributes[20]['value'] ?? 'N/A' }}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- CV -->
|
||||
@elseif($detailsEquipment->equipment_type_id == 1)
|
||||
<!-- Specifications Table -->
|
||||
<table class="spec-table">
|
||||
<tr>
|
||||
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS CV</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TAG Válvula: <span>PP.PCV-116</span></td>
|
||||
<td>Tipo de Atuador: <span>Linear</span></td>
|
||||
<td>Tipo de Válvula: <span>Controle</span></td>
|
||||
<td>Atuador: <span>Rotativo</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fabricante da Válvula: <span>Fisher</span></td>
|
||||
<td>Tipo de Atuador: <span>Eletro</span></td>
|
||||
<td>Modelo da Válvula: <span>Globo Frontal</span></td>
|
||||
<td>Atuador: <span>Pneumático</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Modelo de Atuador: <span>Fisher 1B</span></td>
|
||||
<td colspan="3">Mais especificações aqui...</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- ISV -->
|
||||
@else
|
||||
<!-- Specifications Table -->
|
||||
<table class="spec-table">
|
||||
<tr>
|
||||
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS ISV</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TAG Válvula: <span>PP.PCV-116</span></td>
|
||||
<td>Tipo de Atuador: <span>Linear</span></td>
|
||||
<td>Tipo de Válvula: <span>Controle</span></td>
|
||||
<td>Atuador: <span>Rotativo</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fabricante da Válvula: <span>Fisher</span></td>
|
||||
<td>Tipo de Atuador: <span>Eletro</span></td>
|
||||
<td>Modelo da Válvula: <span>Globo Frontal</span></td>
|
||||
<td>Atuador: <span>Pneumático</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Modelo de Atuador: <span>Fisher 1B</span></td>
|
||||
<td colspan="3">Mais especificações aqui...</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="footer-container">
|
||||
<h4>Lista de Históricos de Âmbitos</h4>
|
||||
<ul>
|
||||
@foreach ($ambitHistories as $history)
|
||||
<li>{{ $history['AmbitHistoryOrder'] }} - {{ $history['AmbitName'] }}
|
||||
({{ $history['AmbitHistoryTimeChange'] }})
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('loopPages')
|
||||
@foreach ($receiveAllTasksHistiory as $task_todo)
|
||||
<div class="page-break"></div>
|
||||
|
||||
<div class="container-loop-pages">
|
||||
|
||||
<header>
|
||||
@include(
|
||||
'projectsClients.pdf._header',
|
||||
compact(
|
||||
'detailsEquipment',
|
||||
'detailsEquipmentWorkHistory',
|
||||
'receiveDetailsProject',
|
||||
'ambito',
|
||||
'projectLogoPath',
|
||||
'companyLogoPath'))
|
||||
</header>
|
||||
|
||||
<div class="content-loop-pages">
|
||||
@include('components.elemental-tasks', ['task_todo' => $task_todo])
|
||||
|
||||
@if (isset($taskImages[$task_todo->control_equipment_workstation_id]) &&
|
||||
is_array($taskImages[$task_todo->control_equipment_workstation_id]))
|
||||
<div class="row no-gutters">
|
||||
@foreach ($taskImages[$task_todo->control_equipment_workstation_id] as $image)
|
||||
<div class="col-4">
|
||||
<img src="{{ public_path($image) }}" alt="Image" class="pdf-image"
|
||||
style="border: 3px solid #00B0EA">
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="footer-container">
|
||||
<div class="row">
|
||||
<div class="col-sm generated-at">
|
||||
Generated at: {{ \Carbon\Carbon::now()->addHour()->format('Y-m-d H:i:s') }}
|
||||
</div>
|
||||
<div class="col-sm generated-at" style=" text-align: right;">
|
||||
Page: 1234
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
@endsection
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user