Update Ws CheckQrcode
This commit is contained in:
parent
91e57adef0
commit
19bfbf8857
|
|
@ -12,11 +12,31 @@ class Kernel extends ConsoleKernel
|
|||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
//Para atualizar a fObra para execussao quando chegar na hora estipulada.
|
||||
$schedule->call(function () {
|
||||
\App\Models\CompanyProject::where('order_project', 2)
|
||||
->where('date_started', '<=', now())
|
||||
->update(['order_project' => 3]);
|
||||
})->everyMinute(); // Ou ajuste para a frequência desejada
|
||||
|
||||
|
||||
//Funcao para libertar equipamentos na control caso nao seja atualizado em 1 minuto
|
||||
$schedule->call(function () {
|
||||
// Define o limite de inatividade, por exemplo, sessões não atualizadas nos últimos 1 minutos
|
||||
$inactiveLimit = now()->subMinutes(1);
|
||||
|
||||
// Atualiza sessões inativas
|
||||
\App\Models\ControlEquipmentWorkstation::where('status', 1)
|
||||
->where('last_active_at', '<', $inactiveLimit)
|
||||
->update([
|
||||
'status' => 0,
|
||||
'id_workstations' => null,
|
||||
'elemental_tasks_id' => null,
|
||||
'entry_date' => null
|
||||
]);
|
||||
|
||||
// Adicione outras tarefas necessárias aqui
|
||||
})->everyMinute();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1499,12 +1499,14 @@ public function showStep3($company_projects_id)
|
|||
|
||||
foreach ($equipments as $equipment) {
|
||||
$tags = [];
|
||||
// Se for psv tem o id 3 e atualmente sao os unicos tipos de valvulas que tem obturador (cv),(isv) nao apresentam.
|
||||
if ($equipment->equipment_type_id == 3) {
|
||||
$tags = ['@Corpo', '@Flange', '@Obturador'];
|
||||
} elseif ($equipment->equipment_type_id == 1) {
|
||||
} else {
|
||||
$tags = ['@Corpo', '@Flange'];
|
||||
}
|
||||
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
$associatedEquipment = QrcodesAssociatedEquipment::where('equipment_id', $equipment->equipment_id)
|
||||
->where('component_tag', 'LIKE', '%' . $tag)
|
||||
|
|
@ -1525,16 +1527,25 @@ public function showStep3($company_projects_id)
|
|||
}
|
||||
}
|
||||
|
||||
// 3. Verificar se há algum equipment_id em QrcodesAssociatedEquipment que não existe mais em Equipment e, se sim, excluí-lo.
|
||||
$allEquipmentIds = Equipment::where('company_projects_id', $company_projects_id)->pluck('equipment_id')->toArray();
|
||||
$orphanedEntries = QrcodesAssociatedEquipment::whereNotIn('equipment_id', $allEquipmentIds)->get();
|
||||
// Obter IDs de equipamentos ativos do projeto especificado.
|
||||
$activeEquipmentIds = Equipment::where('company_projects_id', $company_projects_id)
|
||||
->pluck('equipment_id')
|
||||
->toArray();
|
||||
|
||||
foreach ($orphanedEntries as $orphanedEntry) {
|
||||
$orphanedEntry->delete();
|
||||
// Identificar todos os equipment_id em QrcodesAssociatedEquipment.
|
||||
$equipmentIdsInQrcodes = QrcodesAssociatedEquipment::pluck('equipment_id')->unique()->toArray();
|
||||
|
||||
// Verificar quais desses equipment_id foram desassociados de qualquer projeto na tabela Equipment.
|
||||
$orphanEquipmentIds = Equipment::whereIn('equipment_id', $equipmentIdsInQrcodes)
|
||||
->whereNull('company_projects_id')
|
||||
->pluck('equipment_id')
|
||||
->toArray();
|
||||
|
||||
// Excluir todas as entradas em QrcodesAssociatedEquipment para os equipment_id desassociados.
|
||||
foreach ($orphanEquipmentIds as $orphanId) {
|
||||
QrcodesAssociatedEquipment::where('equipment_id', $orphanId)->delete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Sempre que entrar na view ja verifica se existe 'Workstations' preparadas para esta obra.
|
||||
$listWorkstations = ConstructionWorkstation::where('company_projects_id', $company_projects_id)->get();
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,105 @@
|
|||
|
||||
class WorkstationsJobsController extends Controller
|
||||
{
|
||||
|
||||
// public function reloadWsPage(Request $request, $controlEquipmentId)
|
||||
// {
|
||||
// $active = $request->input('active', false);
|
||||
// if (!$active) {
|
||||
// // Se o 'active' for false, isso significa que o usuário saiu da página
|
||||
// // e você deve fazer a limpeza necessária.
|
||||
// $receiveDataControlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
// if ($receiveDataControlEquipment) {
|
||||
// $receiveDataControlEquipment->delete();
|
||||
// }
|
||||
// } else {
|
||||
// // Se o 'active' for true, atualize o timestamp para refletir que o usuário ainda está ativo.
|
||||
// ControlEquipmentWorkstation::where('control_equipment_workstation_id', $controlEquipmentId)
|
||||
// ->update(['last_active_at' => now()]);
|
||||
// }
|
||||
// return response()->json(['success' => true]);
|
||||
// }
|
||||
|
||||
// public function reloadWsPage(Request $request, $controlEquipmentId)
|
||||
// {
|
||||
// dd($controlEquipmentId);
|
||||
// // Aqui você pode implementar a lógica para atualizar ou excluir o registro
|
||||
// $receiveDataControlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
// if($receiveDataControlEquipment){
|
||||
// $receiveDataControlEquipment->delete();
|
||||
// }
|
||||
// return response()->json(['success' => true]);
|
||||
// }
|
||||
|
||||
// public function reloadWsPage(Request $request, $controlEquipmentId)
|
||||
// {
|
||||
// // Ao buscar o id da control vamos desassociar a Ws atual com a linha de dados da control atual, sendo assim ele ficara disponivel para os outros metados,
|
||||
// $receiveDataControlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
// if ($receiveDataControlEquipment) {
|
||||
// $receiveDataControlEquipment->id_workstations = null;
|
||||
// $receiveDataControlEquipment->save();
|
||||
// }
|
||||
|
||||
// // Não precisa retornar uma resposta detalhada pois sendBeacon não manipula respostas
|
||||
// return response()->json(['success' => true]);
|
||||
// }
|
||||
|
||||
|
||||
// public function updateWorkstationStatus(Request $request)
|
||||
// {
|
||||
// $controlEquipmentId = $request->id;
|
||||
// $status = $request->status;
|
||||
|
||||
// $controlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
// if ($controlEquipment) {
|
||||
// $controlEquipment->status = $status;
|
||||
// $controlEquipment->save();
|
||||
// }
|
||||
|
||||
// return response()->json(['success' => true]);
|
||||
// }
|
||||
|
||||
// public function closeWorkstationSession(Request $request)
|
||||
// { dd($request);
|
||||
// $controlEquipmentId = $request->id;
|
||||
|
||||
// $controlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
// if ($controlEquipment) {
|
||||
// $controlEquipment->delete(); // Ou defina status como inativo, conforme a lógica do negócio.
|
||||
// }
|
||||
|
||||
// return response()->json(['success' => true]);
|
||||
// }
|
||||
public function updateSessionStatus(Request $request, $controlEquipmentId)
|
||||
{
|
||||
|
||||
$controlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
if ($controlEquipment) {
|
||||
$controlEquipment->status = $request->input('status', 1); // Assume 1 como padrão para sessão ativa
|
||||
$controlEquipment->last_active_at = now(); // Atualiza o timestamp da última atividade
|
||||
$controlEquipment->save();
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Sessão atualizada com sucesso.']);
|
||||
}
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Equipamento não encontrado.']);
|
||||
}
|
||||
|
||||
// public function closeSession(Request $request, $controlEquipmentId)
|
||||
// {
|
||||
// $controlEquipment = ControlEquipmentWorkstation::find($controlEquipmentId);
|
||||
// if ($controlEquipment) {
|
||||
// $controlEquipment->status = 0; // Marca a sessão como inativa
|
||||
// $controlEquipment->save();
|
||||
|
||||
// return response()->json(['success' => true, 'message' => 'Sessão fechada com sucesso.']);
|
||||
// }
|
||||
|
||||
// return response()->json(['success' => false, 'message' => 'Equipamento não encontrado.']);
|
||||
// }
|
||||
|
||||
public function receiveAnswersEquipment(Request $request, $control_equipment_workstation_id)
|
||||
{
|
||||
// dd($request);
|
||||
//No request recebemos ID(NUmero da tarela elementar) , esta variavel vai receber este ID apos selerar o id da string
|
||||
$elementalTaskID = 0;
|
||||
|
||||
|
|
@ -113,7 +209,7 @@ public function receiveAnswersEquipment(Request $request, $control_equipment_wor
|
|||
}
|
||||
|
||||
// Ao selecionar o equipamento para se inicializar a tarefa deve mostrar os dados relacionados.
|
||||
public function getEquipmentData($equipment_id)
|
||||
public function getEquipmentData($equipment_id, $component_tag)
|
||||
{
|
||||
//vai receber o email atual, no caso o da workstation que se encontra
|
||||
$userEmail = Auth::user();
|
||||
|
|
@ -121,14 +217,34 @@ public function getEquipmentData($equipment_id)
|
|||
// Busca os dados da Ws com base no Login
|
||||
$receiveDataWs = ConstructionWorkstation::where('name_workstations', $userEmail->user_name)->first();
|
||||
|
||||
|
||||
// Recebe os dados do Equipamento
|
||||
$receiveDataEquipment = Equipment::where('equipment_id', $equipment_id)->first();
|
||||
|
||||
// Recebe o id do Historico do equipamento, em sua obra atual
|
||||
$receiveEquipmentWorkHistory = EquipmentWorkHistory::where('equipment_id', $receiveDataEquipment->equipment_id)
|
||||
->where('company_projects_id', $receiveDataEquipment->company_projects_id)
|
||||
->first();
|
||||
|
||||
|
||||
|
||||
//Verificar se o equipamento ja esta sendo utilizado em outra Ws se sim, retorna para a pagina anterior.
|
||||
$equipmentInUse = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->whereNull('departure_date')
|
||||
->whereNotNull('id_workstations')
|
||||
->where('id_workstations', '!=', $receiveDataWs->id_workstations)
|
||||
->where('status', 1)
|
||||
->exists();
|
||||
|
||||
// Se o equipamento já estiver em uso, redirecione com uma mensagem de erro
|
||||
if ($equipmentInUse) {
|
||||
return redirect()->back()->with('danger', 'O equipamento já se encontra a executar tarefas noutro posto de trabalho.');
|
||||
}
|
||||
|
||||
// Recebe todas as tarefas elementares do equipamento.
|
||||
$recebeTasksForEquipment = OrderEquipmentTasks::where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)->get();
|
||||
|
||||
|
||||
//Busca as tarefas que podem ser feitas pela WS Atual a partir do Email
|
||||
$userTasks = DB::table('users as u')
|
||||
->join('construction_workstations as cw', 'u.user_name', '=', 'cw.name_workstations')
|
||||
|
|
@ -138,7 +254,6 @@ public function getEquipmentData($equipment_id)
|
|||
->groupBy('cw.id_workstations', 'cw.name_workstations')
|
||||
->get();
|
||||
|
||||
|
||||
// Primeiro, obtenha todos os IDs de tarefas elementares e outras tarefas de $userTasks
|
||||
$userTasksIds = $userTasks->pluck('all_tasks')->map(function ($tasks) {
|
||||
// Transforma a string 'all_tasks' em um array e remove espaços em branco
|
||||
|
|
@ -149,26 +264,66 @@ public function getEquipmentData($equipment_id)
|
|||
$equipmentTasksIds = $recebeTasksForEquipment->pluck('elemental_tasks_id')->filter()->unique();
|
||||
|
||||
// Agora, compare os dois conjuntos de IDs para encontrar os IDs comuns
|
||||
$commonIds = $equipmentTasksIds->intersect($userTasksIds);
|
||||
$comparisonBetweenBothTasks = $equipmentTasksIds->intersect($userTasksIds);
|
||||
|
||||
//recebe as tarefas que a Ws atual pode fazer.
|
||||
$divisionElementalTasks = [
|
||||
1 => $commonIds->all(),
|
||||
1 => $comparisonBetweenBothTasks->all(),
|
||||
];
|
||||
|
||||
// IDs que estão em $recebeTasksForEquipment mas não em $userTasks ou seja sao os ids que a Ws nao pode executar estas tarefas.
|
||||
$uniqueEquipmentTasksIds = $equipmentTasksIds->diff($userTasksIds);
|
||||
$receiveTasksThatCannotBeDone = $equipmentTasksIds->diff($userTasksIds);
|
||||
// Adicione esses IDs únicos ao array $divisionElementalTasks na chave [2]
|
||||
$divisionElementalTasks[2] = $uniqueEquipmentTasksIds->all();
|
||||
$divisionElementalTasks[2] = $receiveTasksThatCannotBeDone->all();
|
||||
|
||||
// Ao selecionar um equipamento cria na ControlEquipmentWorkstation dados sobre o mesmo indicando quando entrou.
|
||||
|
||||
//Aplica 2 condicoes a variavel a primeira e se os 3 campos forem nulos e a segunda e se a id_workstations nao for null e tiver o valor igual ao da sessao atual,
|
||||
$existingDataControlEquipment = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->where(function ($query) use ($receiveDataWs) {
|
||||
$query->where(function ($q) {
|
||||
$q->whereNull('elemental_tasks_id')
|
||||
->whereNull('departure_date')
|
||||
->whereNull('id_workstations');
|
||||
})->orWhere(function ($q) use ($receiveDataWs) {
|
||||
$q->whereNotNull('id_workstations')
|
||||
->where('id_workstations', $receiveDataWs->id_workstations)
|
||||
->whereNull('departure_date');
|
||||
});
|
||||
})
|
||||
->first();
|
||||
|
||||
|
||||
if ($existingDataControlEquipment) {
|
||||
// Registro existente encontrado, atualize conforme necessário
|
||||
if (strpos($component_tag, '@Obturador') !== false) {
|
||||
$existingDataControlEquipment->elemental_tasks_id = 9;
|
||||
}
|
||||
$existingDataControlEquipment->id_workstations = $receiveDataWs->id_workstations;
|
||||
$existingDataControlEquipment->entry_date = now();
|
||||
$existingDataControlEquipment->status = 1;
|
||||
$existingDataControlEquipment->last_active_at = now();
|
||||
|
||||
$existingDataControlEquipment->save();
|
||||
|
||||
$receiveDataControlEquipment = $existingDataControlEquipment;
|
||||
} else {
|
||||
// Nenhum registro existente encontrado, crie um novo
|
||||
$newDataControlEquipment = new ControlEquipmentWorkstation;
|
||||
|
||||
$newDataControlEquipment->equipmentWorkHistorys_id = $receiveEquipmentWorkHistory->equipmentWorkHistorys_id;
|
||||
$newDataControlEquipment->id_workstations = $receiveDataWs->id_workstations;
|
||||
$newDataControlEquipment->entry_date = now();
|
||||
|
||||
if (strpos($component_tag, '@Obturador') !== false) {
|
||||
$newDataControlEquipment->elemental_tasks_id = 9;
|
||||
}
|
||||
|
||||
$newDataControlEquipment->status = 1;
|
||||
$newDataControlEquipment->save();
|
||||
|
||||
$receiveDataControlEquipment = $newDataControlEquipment;
|
||||
}
|
||||
|
||||
|
||||
// Primeiro, obtenha o registro de ControlEquipmentWorkstation que não deve ter 'elemental_tasks_id' e 'departure_date' como null
|
||||
$completedTasks = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->whereNotNull('elemental_tasks_id')
|
||||
|
|
@ -199,7 +354,6 @@ public function getEquipmentData($equipment_id)
|
|||
elseif (in_array($task->elemental_tasks_id, $divisionElementalTasks[2])) {
|
||||
$task->cardType = 'card-primary';
|
||||
$task->cardTypeStyle = 'gray'; // Define o estilo de cor
|
||||
// $task->InputInCardOnlyReadOrNot = 'readonly';
|
||||
// Consulta ControlEquipmentWorkstation para verificar as condições especificadas
|
||||
$controlEquipment = ControlEquipmentWorkstation::where('elemental_tasks_id', $task->elemental_tasks_id)
|
||||
->whereNotNull('entry_date')
|
||||
|
|
@ -265,24 +419,43 @@ public function getEquipmentData($equipment_id)
|
|||
// Atribui o array formatado ao task
|
||||
$task->formatted_answers = $formattedAnswers;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $task;
|
||||
});
|
||||
|
||||
// dd($recebeTasksForEquipment);
|
||||
|
||||
// Verificar se component_tag contém '@Obturador'
|
||||
if (strpos($component_tag, '@Obturador') !== false) {
|
||||
// Filtrar para manter apenas a tarefa : elemental_tasks_id = 9 (Retificação e lapidação)
|
||||
$recebeTasksForEquipment = $recebeTasksForEquipment->filter(function ($task) {
|
||||
return $task->elemental_tasks_id == 9;
|
||||
});
|
||||
} else {
|
||||
//Se a Tag nao contém '@Obturador' significa que e um '@Corpo' sendo assim vai ser organizado o Menor para o maior entre as tarefas de acordo com o elemental_tasks_id
|
||||
// Alem de remover o 'elemental_tasks_id == 9' das tarefas, pois se é o corpo, nao faz sentido fazer a tarefas de (Retificação e lapidação), sendo assim para realizar esta tarefa so se entrar com a 'TAG de Obturador'.
|
||||
$recebeTasksForEquipment = $recebeTasksForEquipment->reject(function ($task) {
|
||||
return $task->elemental_tasks_id == 9;
|
||||
})->sortBy('elemental_tasks_id');
|
||||
|
||||
// Se desejar aplicar a ordenação de forma geral, independente da condição
|
||||
$recebeTasksForEquipment = $recebeTasksForEquipment->sortBy('elemental_tasks_id');
|
||||
}
|
||||
|
||||
dd($receiveDataControlEquipment);
|
||||
|
||||
return view('workstations.workstations', [
|
||||
// Deve receber o atual COntrol ID ? tudo a vez que atualizar atualiza ??
|
||||
'dataControlEquipment' => $newDataControlEquipment,
|
||||
// Deve receber o atual COntrol ID ? tudo a vez que atualizar ??
|
||||
'dataControlEquipment' => $receiveDataControlEquipment,
|
||||
'receiveDataEquipment' => $receiveDataEquipment,
|
||||
'recebeTasksForEquipment' => $recebeTasksForEquipment,
|
||||
'divisionElementalTasks' => $divisionElementalTasks,
|
||||
'receiveComponentTag' => $component_tag
|
||||
// 'divisionElementalTasks' => $divisionElementalTasks,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function cancelElementalTaskForEquipment($equipmentID)
|
||||
public function cancelElementalTaskForEquipment($equipmentID,)
|
||||
{
|
||||
//Nesta funcao se o utilizador da Ws utilizar o botao cancelar na view principal,o equipamento deve se desvincular na Ws atual e poder ser selecionado por outra.
|
||||
// Assim sendo mais pratico excluindo o ultimo dado desta Ws da tabela control_equipment_workstation, quando seu 'elemental_tasks_id' e 'departure_date' forem 'Null'
|
||||
|
|
@ -296,7 +469,17 @@ public function cancelElementalTaskForEquipment($equipmentID)
|
|||
$existingControlEquipment = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->whereNull('elemental_tasks_id')
|
||||
->whereNull('departure_date')
|
||||
->delete();
|
||||
->first();
|
||||
|
||||
if ($existingControlEquipment) {
|
||||
$existingControlEquipment->id_workstations = null;
|
||||
$existingControlEquipment->elemental_tasks_id = null;
|
||||
$existingControlEquipment->status = 0;
|
||||
$existingControlEquipment->entry_date = null;
|
||||
$existingControlEquipment->last_active_at = null;
|
||||
$existingControlEquipment->save();
|
||||
}
|
||||
|
||||
|
||||
return redirect(route('enterWorkstation'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,12 @@ class CheckUserType
|
|||
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
//Se o utilizador nao estiver autentificado vai para o login
|
||||
if (!auth()->check()) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
//Recebe o tipo de utilizador
|
||||
$userType = auth()->user()->type_users;
|
||||
|
||||
// Esta linha obtém o nome da rota que está sendo acessada na requisição atual.
|
||||
|
|
@ -53,17 +55,28 @@ protected function getAllowedRoutesForUserType($userType)
|
|||
switch ($userType) {
|
||||
case 5: // Técnico
|
||||
return ['enterWorkstation', 'getEquipmentData', 'receiveAnswersEquipment'];
|
||||
case 3:
|
||||
// Empresa
|
||||
case 3: // Empresa
|
||||
return ['dashboardClient','reportingDataClient', 'manageAssetsClient',
|
||||
// Obras em Execussao
|
||||
'ExecutionProject',
|
||||
//Relatorios
|
||||
'showDataDetailsProjectClient','showReportingForAmbitsProject',
|
||||
//Api.s
|
||||
'getDataAmbitsOfProject','getDataEquipmentsOfProject','getEquipmentsOfAmbit'
|
||||
'getDataAmbitsOfProject','getDataEquipmentsOfProject','getEquipmentsOfAmbit'];
|
||||
case 2: // Administrador
|
||||
return ['home',
|
||||
'createProject','processStep1','articulated_2',
|
||||
'showAllClientsForProjectReports',
|
||||
'manageAssets',
|
||||
'users.company','users.Show','users.edit','users.destroy','users.update','users.list',
|
||||
'CreateUsers',
|
||||
'enviar.formulario',
|
||||
'projectDetails_1','workStation_3','addFurtherTasks','deleteFurtherTasks',
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
// Adicione mais casos conforme necessário...
|
||||
default:
|
||||
return [];
|
||||
|
|
@ -76,7 +89,7 @@ protected function getAllowedRoutesForUserType($userType)
|
|||
protected function getDefaultRouteForUserType($userType)
|
||||
{
|
||||
switch ($userType) {
|
||||
case 1: // Super_Administrador
|
||||
case 2: // Administrador
|
||||
return 'home';
|
||||
case 5: // Técnico
|
||||
return 'enterWorkstation';
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
use App\Models\ControlEquipmentWorkstation;
|
||||
use App\Models\Equipment;
|
||||
use App\Models\EquipmentWorkHistory;
|
||||
use App\Models\OrderEquipmentTasks;
|
||||
use App\Models\QrcodesAssociatedEquipment;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
|
@ -21,25 +23,175 @@ public function compose(View $view)
|
|||
|
||||
$receiveDataWs = ConstructionWorkstation::where('name_workstations', $receiveDataEmail->user_name)->first();
|
||||
|
||||
$receiveAllEquipmentOfProject = Equipment::where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
->whereHas('equipmentWorkHistory', function ($query) use ($receiveDataWs) {
|
||||
$query->where('company_projects_id', $receiveDataWs->company_projects_id);
|
||||
})
|
||||
->whereDoesntHave('equipmentWorkHistory.controlEquipmentWorkstation', function ($query) {
|
||||
$query->whereNull('elemental_tasks_id')
|
||||
->whereNull('departure_date');
|
||||
})
|
||||
->get();
|
||||
// Busca todos os equipamentos associados a um determinado projeto.
|
||||
|
||||
// $receiveAllEquipmentOfProject = Equipment::where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
// // Verifica se existe histórico de trabalho associado ao equipamento e ao projeto específico.
|
||||
// ->whereHas('equipmentWorkHistory', function ($query) use ($receiveDataWs) {
|
||||
// $query->where('company_projects_id', $receiveDataWs->company_projects_id);
|
||||
// })
|
||||
// // Exclui os equipamentos cujo histórico de trabalho mais recente (controlEquipmentWorkstation) tem 'elemental_tasks_id' e 'departure_date' nulos.
|
||||
// ->whereDoesntHave('equipmentWorkHistory.controlEquipmentWorkstation', function ($query) {
|
||||
// $query->where(function ($q) {
|
||||
// $q->whereNull('elemental_tasks_id')
|
||||
// ->WhereNull('departure_date')
|
||||
// ->WhereNotNull('id_workstations');
|
||||
// }) ;
|
||||
// })
|
||||
|
||||
// // Carrega o histórico de trabalho associado ao equipamento e ao projeto específico.
|
||||
// ->with([
|
||||
// 'equipmentWorkHistory' => function ($query) use ($receiveDataWs) {
|
||||
// // Filtra o histórico de trabalho pelo 'company_projects_id' para obter os registros relevantes.
|
||||
// $query->where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
// ->select('equipment_id', 'equipmentWorkHistorys_id'); // Seleciona apenas os campos necessários.
|
||||
// }
|
||||
// ])
|
||||
// ->get() // Obtém os resultados da consulta.
|
||||
// ->map(function ($equipment) {
|
||||
// // Supondo que cada equipamento tem apenas um 'equipmentWorkHistory' relevante para este contexto
|
||||
// if (!$equipment->equipmentWorkHistory->isEmpty()) {
|
||||
// $equipmentWorkHistory = $equipment->equipmentWorkHistory->first();
|
||||
// $equipment->equipmentWorkHistoryId = $equipmentWorkHistory->equipmentWorkHistorys_id;
|
||||
// } else {
|
||||
// // Definir como null ou algum valor padrão se não houver histórico correspondente
|
||||
// $equipment->equipmentWorkHistoryId = null;
|
||||
// }
|
||||
// return $equipment;
|
||||
// });
|
||||
|
||||
// $receiveAllEquipmentOfProject = Equipment::where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
// // Primeiro filtro: Equipamentos sem ocorrência em ControlEquipmentWorkstation
|
||||
// ->whereDoesntHave('equipmentWorkHistory.controlEquipmentWorkstation')
|
||||
// // Segundo filtro: Equipamentos com ocorrências onde id_workstations e elemental_tasks_id são nulos
|
||||
// ->orWhereHas('equipmentWorkHistory.controlEquipmentWorkstation', function ($query) {
|
||||
// $query->whereNull('id_workstations')
|
||||
// ->whereNull('elemental_tasks_id');
|
||||
// })
|
||||
// // Terceiro filtro: Equipamentos com todas as ocorrências onde id_workstations, elemental_tasks_id e departure_date não são nulos
|
||||
// ->orWhereHas('equipmentWorkHistory.controlEquipmentWorkstation', function ($query) {
|
||||
// $query->whereNotNull('id_workstations')
|
||||
// ->whereNotNull('elemental_tasks_id')
|
||||
// ->whereNotNull('departure_date');
|
||||
// })
|
||||
// // Carrega o histórico de trabalho associado ao equipamento e ao projeto específico
|
||||
// ->with([
|
||||
// 'equipmentWorkHistory' => function ($query) use ($receiveDataWs) {
|
||||
// $query->where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
// ->select('equipment_id', 'equipmentWorkHistorys_id');
|
||||
// }
|
||||
// ])
|
||||
// ->get()
|
||||
// ->map(function ($equipment) {
|
||||
// if (!$equipment->equipmentWorkHistory->isEmpty()) {
|
||||
// $equipmentWorkHistory = $equipment->equipmentWorkHistory->first();
|
||||
// $equipment->equipmentWorkHistoryId = $equipmentWorkHistory->equipmentWorkHistorys_id;
|
||||
// } else {
|
||||
// $equipment->equipmentWorkHistoryId = null;
|
||||
// }
|
||||
// return $equipment;
|
||||
// });
|
||||
|
||||
|
||||
$receiveAllEquipmentOfProject = Equipment::where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
->where(function ($query) use ($receiveDataWs) {
|
||||
// Primeiro filtro: Equipamentos sem ocorrência em ControlEquipmentWorkstation
|
||||
$query->whereDoesntHave('equipmentWorkHistory.controlEquipmentWorkstation');
|
||||
|
||||
// Segundo filtro: Equipamentos com ocorrências onde id_workstations e elemental_tasks_id são nulos
|
||||
$query->orWhereHas('equipmentWorkHistory.controlEquipmentWorkstation', function ($subQuery) {
|
||||
$subQuery->whereNull('id_workstations')
|
||||
->whereNull('elemental_tasks_id');
|
||||
});
|
||||
|
||||
// Terceiro filtro: Equipamentos com todas as ocorrências onde id_workstations, elemental_tasks_id e departure_date não são nulos
|
||||
// Inclui a condição para elemental_tasks_id = 9
|
||||
$query->orWhereHas('equipmentWorkHistory.controlEquipmentWorkstation', function ($subQuery) {
|
||||
$subQuery->whereNotNull('id_workstations')
|
||||
->where(function ($innerQuery) {
|
||||
$innerQuery->whereNotNull('elemental_tasks_id')
|
||||
->whereNotNull('departure_date')
|
||||
->orWhere('elemental_tasks_id', 9); // Inclui equipamentos com elemental_tasks_id = 9 independentemente de outros critérios
|
||||
});
|
||||
});
|
||||
})
|
||||
->with([
|
||||
'equipmentWorkHistory' => function ($query) use ($receiveDataWs) {
|
||||
$query->where('company_projects_id', $receiveDataWs->company_projects_id)
|
||||
->select('equipment_id', 'equipmentWorkHistorys_id');
|
||||
}
|
||||
])
|
||||
->get()
|
||||
->map(function ($equipment) {
|
||||
if (!$equipment->equipmentWorkHistory->isEmpty()) {
|
||||
$equipmentWorkHistory = $equipment->equipmentWorkHistory->first();
|
||||
$equipment->equipmentWorkHistoryId = $equipmentWorkHistory->equipmentWorkHistorys_id;
|
||||
} else {
|
||||
$equipment->equipmentWorkHistoryId = null;
|
||||
}
|
||||
return $equipment;
|
||||
});
|
||||
|
||||
|
||||
|
||||
$completedEquipments = collect(); // Coleção para armazenar equipamentos concluídos
|
||||
|
||||
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
|
||||
|
||||
// Verifica se existe um workHistoryId antes de prosseguir
|
||||
if (is_null($workHistoryId)) {
|
||||
continue; // Se não houver histórico de trabalho, continua para o próximo equipamento
|
||||
}
|
||||
|
||||
$taskIds = OrderEquipmentTasks::where('equipmentWorkHistorys_id', $workHistoryId)
|
||||
->pluck('elemental_tasks_id'); // Obter IDs de tarefas elementares baseado em um único workHistoryId
|
||||
|
||||
if ($taskIds->isEmpty()) {
|
||||
continue; // Se não houver tarefas, continua para o próximo equipamento
|
||||
}
|
||||
|
||||
$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
|
||||
|
||||
// Verificar se todas as tarefas foram concluídas pelo menos uma vez
|
||||
$allTasksCompleted = $taskIds->every(function ($taskId) use ($workstationTaskCounts) {
|
||||
return isset ($workstationTaskCounts[$taskId]) && $workstationTaskCounts[$taskId] >= 1;
|
||||
});
|
||||
|
||||
if ($allTasksCompleted && $workstationTaskCounts->count() >= $taskIds->count()) {
|
||||
$completedEquipments->push($equipment); // Adicionar equipamento à lista de concluídos
|
||||
}
|
||||
}
|
||||
|
||||
// Remover equipamentos concluídos da coleção original
|
||||
$receiveAllEquipmentOfProject = $receiveAllEquipmentOfProject->reject(function ($equipment) use ($completedEquipments) {
|
||||
return $completedEquipments->contains($equipment);
|
||||
});
|
||||
|
||||
|
||||
$equipmentIds = $receiveAllEquipmentOfProject->pluck('equipment_id');
|
||||
|
||||
$receiveQrcodeEquipmentsProject = QrcodesAssociatedEquipment::whereIn('equipment_id', $equipmentIds)->get();
|
||||
|
||||
//VAMOS filtrar os valores recebidos e terar todas as correspondencias de Flange, ja nao e uma tag que nao vai entrar no percurso do Equipamento.
|
||||
$filteredQrcodeEquipments = $receiveQrcodeEquipmentsProject->reject(function ($item) {
|
||||
return strpos($item->component_tag, '@Flange') !== false;
|
||||
});
|
||||
|
||||
|
||||
$receiceCountAllEquipmentOfProject = count($receiveAllEquipmentOfProject);
|
||||
|
||||
//Returning values of the queries to workstations layout
|
||||
$view->with([
|
||||
'receiveAllEquipmentOfProject' => $receiveAllEquipmentOfProject,
|
||||
'receiceCountAllEquipmentOfProject' => $receiceCountAllEquipmentOfProject,
|
||||
// foi alterado para a variavel 'filteredQrcodeEquipments' pois nao tem a necessidade do utilizador selecionar 'Flange'(AINDA NAO !)
|
||||
'receiveQrcodeEquipmentsProject' => $filteredQrcodeEquipments,
|
||||
'completedEquipments' => $completedEquipments,
|
||||
'receiveDataWs' => $receiveDataWs,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
public/user_logos/1707911835.jpg
Normal file
BIN
public/user_logos/1707911835.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="card-light">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
Editar Utilizador : {{ $user->user_name }}
|
||||
</div>
|
||||
|
|
@ -33,14 +33,14 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="name">Nome:</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
value="{{ $user->user_name }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" class="form-control" id="email" name="email"
|
||||
value="{{ $user->email }}" required>
|
||||
|
|
@ -50,14 +50,14 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="password">Palavra-passe:</label>
|
||||
<input type="password" class="form-control" id="password" name="password"
|
||||
placeholder="Deixe em branco para não alterar">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="password_confirmation">Confirme a palavra-passe:</label>
|
||||
<input type="password" class="form-control" id="password_confirmation"
|
||||
name="password_confirmation">
|
||||
|
|
@ -67,14 +67,14 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="user_nif">NIF:</label>
|
||||
<input type="text" class="form-control" id="user_nif" name="user_nif"
|
||||
value="{{ $user->user_nif }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="user_phone">Telemóvel:</label>
|
||||
<input type="text" class="form-control" id="user_phone" name="user_phone"
|
||||
value="{{ $user->user_phone }}" required>
|
||||
|
|
@ -82,17 +82,20 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-light">
|
||||
<div class="form-group text-primary">
|
||||
<label for="user_type">Tipo de Utilizador:</label>
|
||||
<select class="form-control" id="user_type" name="user_type" required>
|
||||
<!-- Deve mostrar a Opção apenas para utilizadores 'Super_Admin' -->
|
||||
@if (Auth::user()->type_users == 1)
|
||||
<option value="Super_Administrador"
|
||||
{{ $user->user_type == 'Super_Administrador' ? 'selected' : '' }}>Super
|
||||
Administrador</option>
|
||||
@endif
|
||||
<option value="Administrador" {{ $user->user_type == 'Administrador' ? 'selected' : '' }}>
|
||||
Administrador
|
||||
</option>
|
||||
<option value="Utilizador" {{ $user->user_type == 'Utilizador' ? 'selected' : '' }}>
|
||||
Utilizador</option>
|
||||
<option value="Empresa" {{ $user->user_type == 'Empresa' ? 'selected' : '' }}>
|
||||
Empresa</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ class="actions-btn btn btn-light circle ">
|
|||
</button>
|
||||
<div id="group-actions-btn-14" class="dropdown-menu dropdown-menu-light">
|
||||
<a href="{{ route('users.Show', ['id' => $user->user_id]) }}"
|
||||
class="dropdown-item text-light">
|
||||
<i class="fa-solid fa-eye text-light"></i>
|
||||
class="dropdown-item text-primary">
|
||||
<i class="fa-solid fa-eye text-primary"></i>
|
||||
Detalhes
|
||||
</a>
|
||||
<a href="{{ route('users.edit', ['id' => $user->user_id]) }}"
|
||||
class="dropdown-item text-light">
|
||||
<i class="fa-solid fa-edit text-light"></i>
|
||||
class="dropdown-item text-primary">
|
||||
<i class="fa-solid fa-edit text-primary"></i>
|
||||
Editar
|
||||
</a>
|
||||
<form action="{{ route('users.destroy', $user) }}" method="POST"
|
||||
|
|
|
|||
|
|
@ -11,12 +11,20 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>{{__('messages.users_listUsers.top_view_part.companies')}}</h1>
|
||||
{{-- <h1>{{ __('messages.users_listUsers.top_view_part.companies') }}</h1>
|
||||
--}}
|
||||
<h1>Utilizadores</h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item active">{{__('messages.users_listUsers.top_view_part.administration')}}</li>
|
||||
<li class="breadcrumb-item active">{{__('messages.users_listUsers.top_view_part.companies')}}</li>
|
||||
<li class="breadcrumb-item active">
|
||||
{{ __('messages.users_listUsers.top_view_part.administration') }}
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
{{-- {{ __('messages.users_listUsers.top_view_part.companies') }} --}}
|
||||
Utilizadores
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -35,7 +43,7 @@
|
|||
<table class="table table-hover text-nowrap" id="TableReceiveAllUsers">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__('messages.portfolio.users_table.id')}}</th>
|
||||
{{-- <th>{{__('messages.portfolio.users_table.id')}}</th> --}}
|
||||
<th>{{ __('messages.portfolio.users_table.name') }}</th>
|
||||
<th>{{ __('messages.portfolio.users_table.email') }}</th>
|
||||
<th>{{ __('messages.portfolio.users_table.user_type') }}</th>
|
||||
|
|
@ -45,7 +53,7 @@
|
|||
<tbody>
|
||||
@foreach ($users as $user)
|
||||
<tr>
|
||||
<td>{{ $user->user_id }}</td>
|
||||
{{-- <td>{{ $user->user_id }}</td> --}}
|
||||
<td>{{ $user->user_name }}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td>{{ $user->userType->type_user }}</td>
|
||||
|
|
@ -57,15 +65,17 @@ class="actions-btn btn btn-light circle ">
|
|||
</button>
|
||||
<div id="group-actions-btn-14" class="dropdown-menu dropdown-menu-light">
|
||||
<a href="{{ route('users.Show', ['id' => $user->user_id]) }}"
|
||||
class="dropdown-item text-light">
|
||||
<i class="fa-solid fa-eye text-light"></i>
|
||||
class="dropdown-item text-primary">
|
||||
<i class="fa-solid fa-eye text-primary"></i>
|
||||
{{ __('messages.portfolio.users_table.actions.details') }}
|
||||
</a>
|
||||
@if (Auth::user()->type_users == 1)
|
||||
<a href="{{ route('users.edit', ['id' => $user->user_id]) }}"
|
||||
class="dropdown-item text-light">
|
||||
<i class="fa-solid fa-edit text-light"></i>
|
||||
class="dropdown-item text-primary">
|
||||
<i class="fa-solid fa-edit text-primary"></i>
|
||||
{{ __('messages.portfolio.users_table.actions.edit') }}
|
||||
</a>
|
||||
|
||||
<form action="{{ route('users.destroy', $user) }}" method="POST"
|
||||
onsubmit="return confirm('Are you sure you want to delete this user?');"
|
||||
style="display:inline;">
|
||||
|
|
@ -76,6 +86,7 @@ class="dropdown-item text-light">
|
|||
{{ __('messages.portfolio.users_table.actions.delete') }}
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
@extends('Templates/templateAdmin')
|
||||
|
||||
@section('Main-content')
|
||||
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
|
|
@ -22,17 +21,17 @@
|
|||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="card-light">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
Empresa : {{ $user->user_name }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
{{-- <tr>
|
||||
<th>ID</th>
|
||||
<td>{{ $user->user_id }}</td>
|
||||
</tr>
|
||||
</tr> --}}
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<td>{{ $user->user_name }}</td>
|
||||
|
|
@ -63,9 +62,11 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('users.edit', ['id' => $user->user_id]) }}" class="btn btn-light float-right">Editar
|
||||
@if (Auth::user()->type_users == 1)
|
||||
<a href="{{ route('users.edit', ['id' => $user->user_id]) }}"
|
||||
class="btn btn-light float-right">Editar
|
||||
Empresa</a>
|
||||
@endif
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
|
|
|||
|
|
@ -359,8 +359,8 @@ class="d-block">{{ Auth::user()->userType?->type_user }}</a>
|
|||
@endif
|
||||
|
||||
|
||||
{{-- Por enquanto, apenas o Super admin tem acesso a esta rotas --}}
|
||||
@if (Auth::user()->type_users == 1)
|
||||
<!-- Apenas os Super Admins e Admin tem acesso a estas Rotas -->
|
||||
@if (Auth::user()->type_users == 1 || Auth::user()->type_users == 2)
|
||||
<!-- Single menu item -->
|
||||
<li class="nav-item">
|
||||
<a href="#" class="nav-link">
|
||||
|
|
|
|||
|
|
@ -58,14 +58,15 @@
|
|||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link">
|
||||
<i class="fas fa-play" style="color:#1f2d3d"></i>
|
||||
<span class="badge badge-info navbar-badge">{{ $receiceCountAllEquipmentOfProject }}</span>
|
||||
<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">{{ $equipmentsDoneCount }}</span> --}}
|
||||
<span class="badge badge-success navbar-badge"
|
||||
style="background-color: #28a745">{{ count($completedEquipments) }} </span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -131,32 +132,81 @@ class="brand-image img-circle elevation-3" style="opacity: .8">
|
|||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||
data-accordion="false">
|
||||
{{-- <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" >
|
||||
|
||||
<!-- Add icons to the links using the .nav-icon class
|
||||
with font-awesome or any other icon font library -->
|
||||
<li class="menu-closed">
|
||||
<a href="#" class="nav-link text-white" style="background-color: #007BFF;">
|
||||
<i class="fas fa-play"></i>
|
||||
<p>
|
||||
{{ count($receiveAllEquipmentOfProject) }}
|
||||
a iniciar
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav-treeview">
|
||||
@foreach ($receiveAllEquipmentOfProject as $equipmentOfProject)
|
||||
<div class="row text-white">
|
||||
<div class="col-sm-1"><i class="fas fa-tag nav-icon"></i></div>
|
||||
<div class="col-sm-11"> <p>{{ $equipmentOfProject->equipment_tag }}</p></div>
|
||||
</div>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul> --}}
|
||||
<ul class="nav nav-pills nav-sidebar flex-column searchable" data-widget="treeview"
|
||||
role="menu" data-accordion="false">
|
||||
<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>
|
||||
{{ $receiceCountAllEquipmentOfProject }}
|
||||
{{ count($receiveAllEquipmentOfProject) }}
|
||||
a iniciar
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
@foreach ($receiveAllEquipmentOfProject as $equipmentOfProject)
|
||||
<div class="row text-white">
|
||||
<div class="col-sm-2 pl-4"><i class="fas fa-tag nav-icon"></i></div>
|
||||
<div class="col-sm-10">
|
||||
<p>{{ $equipmentOfProject->equipment_tag }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav nav-pills nav-sidebar flex-column searchable" 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) }}"
|
||||
<a href="{{ route('getEquipmentData', ['equipment_id' => $equipmentOfProject->equipment_id, 'component_tag' => $equipmentOfProject->component_tag]) }}"
|
||||
class="nav-link text-white">
|
||||
<i class="fas fa-tag nav-icon"></i>
|
||||
<p>{{ $equipmentOfProject->equipment_tag }}</p>
|
||||
<p class="Tags">{{ $equipmentOfProject->component_tag }}</p>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
|
|
@ -200,14 +250,6 @@ class="nav-link text-white">
|
|||
</div>
|
||||
</footer>
|
||||
|
||||
{{-- <footer class="main-footer">
|
||||
<strong>Copyright © 2017-2022 <a href="#">ISPT - Industrial Services, SA</a>.</strong>
|
||||
Todos os direitos reservados.
|
||||
<div class="float-right d-none d-sm-inline-block">
|
||||
<b>Versão</b> 1.0
|
||||
</div>
|
||||
</footer> --}}
|
||||
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark" data-widget="control-treeview"
|
||||
style="background-color: #09255C">
|
||||
|
|
@ -237,20 +279,20 @@ class="nav-link text-white">
|
|||
<a href="#" class="nav-link text-white" style="background-color: #28a745;">
|
||||
<i class="nav-icon fas fa-check"></i>
|
||||
<p>
|
||||
{{-- {{ $equipmentsDoneCount }} --}}
|
||||
{{ count($completedEquipments) }}
|
||||
válvulas concluídas
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
{{-- @foreach ($equipmentsDone as $equipmentDone)
|
||||
@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 --}}
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -301,6 +343,7 @@ class="nav-link text-white">
|
|||
<!-- 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();
|
||||
|
|
@ -347,7 +390,6 @@ 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;
|
||||
|
|
@ -375,6 +417,66 @@ function(errorMessage) {
|
|||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let scannerCheck = new Html5Qrcode("readerUnique");
|
||||
let startScanCheck = document.getElementById("startScanUnique");
|
||||
let readerCheck = document.getElementById("readerUnique");
|
||||
|
||||
|
||||
startScanCheck.addEventListener('click', function() {
|
||||
startScanCheck.style.display = "none";
|
||||
readerCheck.style.display = "block";
|
||||
|
||||
scannerCheck.start({
|
||||
facingMode: "environment"
|
||||
}, {
|
||||
fps: 20,
|
||||
qrbox: {
|
||||
width: 250,
|
||||
height: 250
|
||||
}
|
||||
},
|
||||
function(qrCodeMessage) {
|
||||
scannerCheck.stop().then(() => {
|
||||
const parts = qrCodeMessage.split('@');
|
||||
const valor = parts[0];
|
||||
const componente = parts[1];
|
||||
|
||||
|
||||
// Verifica se a variável do Laravel está definida e não é vazia.
|
||||
@if (isset($receiveComponentTag) && !empty($receiveComponentTag))
|
||||
expectedTag = "{{ $receiveComponentTag }}".split('@');
|
||||
@endif
|
||||
|
||||
const expectedValor = expectedTag[0];
|
||||
const expectedComponente = "Obturador";
|
||||
|
||||
let modalContent;
|
||||
if (valor === expectedValor && componente === expectedComponente) {
|
||||
modalContent =
|
||||
`Valores corretos.<br> QR Lido: ${valor}@${componente}. Esperado: ${expectedValor}@${expectedComponente}`;
|
||||
} else {
|
||||
modalContent =
|
||||
`Valores não correspondem.<br> QR Lido: ${valor}@${componente}.<br> Esperado: ${expectedValor}@${expectedComponente}`;
|
||||
}
|
||||
|
||||
// Atualiza o conteúdo da modal
|
||||
document.querySelector('#exampleModal .modal-body').innerHTML = modalContent;
|
||||
|
||||
// Esconde o botão para não permitir nova varredura
|
||||
readerCheck.style.display = "none";
|
||||
startScanCheck.style.display = "none";
|
||||
});
|
||||
},
|
||||
function(errorMessage) {
|
||||
console.log(errorMessage);
|
||||
}
|
||||
).catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Clone the behavior of treeview to control-treeview
|
||||
|
|
@ -407,6 +509,7 @@ function(errorMessage) {
|
|||
|
||||
<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
|
||||
|
|
@ -434,13 +537,20 @@ function handleSearch(inputSelector, itemsSelector, containerSelector) {
|
|||
});
|
||||
}
|
||||
|
||||
// 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.tags', '.searchable');
|
||||
|
||||
|
||||
|
||||
// Apply the search functionality for the main sidebar
|
||||
handleSearch('#qrtextleft', '.main-sidebar .nav.nav-pills.nav-sidebar.flex-column li', '.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');
|
||||
// handleSearch('#qrtextright', '.control-sidebar .nav.nav-pills.nav-sidebar.flex-column li', '.control-sidebar');
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
481
resources/views/Templates/templateWsBak.blade
Normal file
481
resources/views/Templates/templateWsBak.blade
Normal file
|
|
@ -0,0 +1,481 @@
|
|||
<!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>
|
||||
|
|
@ -6,12 +6,12 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Email</title>
|
||||
|
||||
<style>
|
||||
{{-- <style>
|
||||
.logo-img{
|
||||
width: 2cm;
|
||||
height: 2cm;
|
||||
}
|
||||
</style>
|
||||
</style> --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
@ -24,40 +24,9 @@
|
|||
<p>Agradecemos a sua atenção e ficamos ao dispor para qualquer esclarecimento.</p>
|
||||
<p>Com os melhores cumprimentos,</p>
|
||||
<p> Ispt4.0</p>
|
||||
<img class="" src="{{ public_path('/img/ispt/4.0/isptLogoVertical.png') }}"
|
||||
alt="Imagem ISPT 4.0"">
|
||||
{{-- <img src="{{ asset('/img/ispt/4.0/Ispt4.0_Símbolo_Fundo_Azul-Marinho@2x-100.jpg') }}" alt="Imagem ISPT 4.0""> --}}
|
||||
|
||||
|
||||
{{-- <img src="{{ asset('img/ispt/4.0/logo4.0.jpg')}}" alt="Imagem ISPT 4.0"> --}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
{{-- <x-mail::message>
|
||||
|
||||
<h1>
|
||||
@if (! empty($greeting))
|
||||
{{ $greeting }}
|
||||
@else
|
||||
@if ($level === 'error')
|
||||
@lang('Whoops!')
|
||||
@else
|
||||
@lang('Olá!')
|
||||
@endif
|
||||
@endif
|
||||
</h1>
|
||||
|
||||
<p>Temos o prazer de apresentar-lhe o acesso exclusivo ao formulário do projeto 'ISPT4.0'</p>
|
||||
|
||||
@isset($actionText)
|
||||
<a href="{{ $actionUrl }}" target="_blank" style="background-color: #00B0EA; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer;">{{ $actionText }}</a>
|
||||
@endisset
|
||||
|
||||
<p>Se não estava à espera deste e-mail ou não reconhece o projeto 'ISPT4.0', por favor, ignore esta mensagem.</p>
|
||||
<p>Agradecemos a sua atenção e ficamos ao dispor para qualquer esclarecimento.</p>
|
||||
<p>Com os melhores cumprimentos,</p>
|
||||
<p>Yure Ispt4.0</p>
|
||||
|
||||
<img src="{{ asset('img/ispt/4.0/logo4.0.jpg')}}" alt="">
|
||||
|
||||
</x-mail::message> --}}
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
<td>{{ $pend_user->pending_user_name }}</td>
|
||||
<td>{{ $pend_user->pending_user_email }}</td>
|
||||
<td><a href="{{ route('ShowPendingUser', ['id' => $pend_user->pending_user_id]) }}"><i
|
||||
class="fa-solid fa-eye text-light"></i></a></td>
|
||||
class="fa-solid fa-eye text-primary"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class="fas fa-plus"></i></button>
|
|||
<div class="form-group">
|
||||
<label>Tipo de equipamento</label>
|
||||
<select class="form-control" name="equipmentTypeId" {{-- equipmentType_id --}}
|
||||
id="equipmentType_id_list" required>
|
||||
id="equipmentType_id_listManual" required>
|
||||
<option value='' hidden>Selecionar Tipo de equipamento...</option>
|
||||
@foreach ($typeEquipments as $typeEquipment)
|
||||
<option value="{{ $typeEquipment->equipment_type_id }}">
|
||||
|
|
@ -981,9 +981,9 @@ class="form-control card_inputs" id="PositionerSerialNumber"
|
|||
|
||||
<div class="form-group">
|
||||
<label>Âmbitos</label>
|
||||
<select class="form-control" name="EquipmentAmbit" id="AmbitsEquipments_list"
|
||||
<select class="form-control" name="EquipmentAmbit" id="AmbitsEquipments_listManual"
|
||||
required>
|
||||
<option value='' hidden>Selecionar Âmbitos...</option>
|
||||
<option value='' hidden>Selecionar Âmbitos. sdd..</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
@ -1435,22 +1435,6 @@ class="btn btn-primary float-right">Postos de Trabalho</a>
|
|||
method="POST">
|
||||
@csrf
|
||||
|
||||
{{-- <div class="modal-body">
|
||||
<p>Ao optar por criar o equipamento, ele assumira a o nome ja exsitentes + (1) para indicar
|
||||
o numero da copia e para diferencias como um equipamento idividual em relacao ao
|
||||
equipamento original de mesma TAG</p>
|
||||
<h4>Tag: {{ $pendingEquipment->pending_equipment_tag }} <strong>(Número da copia)</strong>
|
||||
</h4>
|
||||
<h4>Descrição: {{ $pendingEquipment->pending_equipment_description }}
|
||||
<strong>(Número da copia)</strong>
|
||||
</h4>
|
||||
<h4>{{ $pendingEquipment->pending_equipment_type_id }}(Tipo de Equipamento)</h4>
|
||||
<select class="form-control" name="EquipmentAmbit"
|
||||
id="AmbitsEquipments_list-{{ $pendingEquipment->pending_equipment_id }}" required>
|
||||
<option value='' hidden>Selecionar Âmbitos...</option>
|
||||
</select>
|
||||
</div> --}}
|
||||
|
||||
<div class="modal-body">
|
||||
<p>Ao optar por criar o equipamento, este assumirá o nome já existente acrescido de (+1) para indicar o número da cópia e para diferenciá-lo como um equipamento individual em relação ao equipamento original de mesma TAG.</p>
|
||||
<h4><b>Tag:</b> {{ $pendingEquipment->pending_equipment_tag }} <strong>(Número da copia)</strong>
|
||||
|
|
@ -1518,6 +1502,7 @@ class="btn btn-primary float-right">Postos de Trabalho</a>
|
|||
@endsection
|
||||
|
||||
@section('scriptsTemplateAdmin')
|
||||
|
||||
<script>
|
||||
var dataTable;
|
||||
$(document).ready(function() {
|
||||
|
|
@ -1637,36 +1622,36 @@ class="btn btn-primary float-right">Postos de Trabalho</a>
|
|||
});
|
||||
</script> --}}
|
||||
|
||||
|
||||
{{-- <script>
|
||||
{{-- Receber os Ambitos para criacao de equipamento manual --}}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#equipmentType_id_list').on('change', function() {
|
||||
$('#equipmentType_id_listManual').on('change', function() {
|
||||
var equipmentTypeID = $(this).val();
|
||||
if (equipmentTypeID) {
|
||||
$.ajax({
|
||||
url: '/api/ambits/' + equipmentTypeID,
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
$('#AmbitsEquipments_list').empty(); // Limpar o select de ambits
|
||||
$('#AmbitsEquipments_list').append(
|
||||
$('#AmbitsEquipments_listManual').empty(); // Limpar o select de ambits
|
||||
$('#AmbitsEquipments_listManual').append(
|
||||
'<option value="" hidden>Selecionar Tipo de Âmbito...</option>'
|
||||
);
|
||||
$.each(data, function(key, value) {
|
||||
$('#AmbitsEquipments_list').append('<option value="' +
|
||||
$('#AmbitsEquipments_listManual').append('<option value="' +
|
||||
value.ambits_id + '">' + value
|
||||
.ambits_description + '</option>');
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#AmbitsEquipments_list')
|
||||
$('#AmbitsEquipments_listManual')
|
||||
.empty(); // Limpar o select de ambits se não há tipo de equipamento selecionado
|
||||
$('#AmbitsEquipments_list').append(
|
||||
$('#AmbitsEquipments_listManual').append(
|
||||
'<option value="" hidden>Selecionar Tipo de Âmbito...</option>');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script> --}}
|
||||
</script>
|
||||
|
||||
{{-- <script>
|
||||
$(document).ready(function() {
|
||||
|
|
@ -1700,14 +1685,15 @@ class="btn btn-primary float-right">Postos de Trabalho</a>
|
|||
});
|
||||
</script> --}}
|
||||
|
||||
{{-- esse script serve para receber o Ambito das Pendentes ? --}}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@isset($pendingEquipment)
|
||||
// Se $pendingEquipment está definido, executa o AJAX
|
||||
var equipmentTypeID =
|
||||
'{{ $pendingEquipment->pending_equipment_type_id }}'; // Usando Blade para inserir o valor
|
||||
var selectId =
|
||||
"AmbitsEquipments_list-{{ $pendingEquipment->pending_equipment_id }}"; // Usando Blade para inserir o valor
|
||||
var equipmentTypeID ='{{ $pendingEquipment->pending_equipment_type_id }}'; // Usando Blade para inserir o valor
|
||||
|
||||
var selectId = "AmbitsEquipments_list-{{ $pendingEquipment->pending_equipment_id }}"; // Usando Blade para inserir o valor
|
||||
|
||||
|
||||
if (equipmentTypeID) {
|
||||
$.ajax({
|
||||
|
|
@ -1883,6 +1869,7 @@ class="btn btn-primary float-right">Postos de Trabalho</a>
|
|||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var selectedTasks = []; // Esta variável armazena todas as tarefas selecionadas
|
||||
|
|
@ -2038,6 +2025,7 @@ function(task) {
|
|||
})
|
||||
</script>
|
||||
|
||||
{{-- DataTables puro --}}
|
||||
<script>
|
||||
$(function() {
|
||||
$("#ProjectEquipmentTable").DataTable({
|
||||
|
|
@ -2049,6 +2037,7 @@ function(task) {
|
|||
});
|
||||
</script>
|
||||
|
||||
{{-- DataTables Yajra --}}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#tableSelectEquipements').DataTable({
|
||||
|
|
@ -2323,6 +2312,7 @@ function(task) {
|
|||
</script>
|
||||
|
||||
|
||||
{{-- Script para devolver os Ambitos de acordo com o tipo, para equipamentos pendentes --}}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('[id^="modal-PendingEquipmentCreate-"]').on('show.bs.modal', function(e) {
|
||||
|
|
@ -2360,25 +2350,6 @@ function(task) {
|
|||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#mytable').DataTable();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{{-- <script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#cardHeader').on('click', function(e) {
|
||||
// Verifica se o clique não foi no botão
|
||||
if (!$(e.target).is('#collapseButton') && !$(e.target).is('#collapseButton *')) {
|
||||
$('#collapseButton').trigger('click');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script> --}}
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.clickable').on('click', function(e) {
|
||||
|
|
@ -2389,4 +2360,5 @@ function(task) {
|
|||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -514,4 +514,5 @@ function addBeforeUnload() {
|
|||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
@extends('Templates/templateAdmin')
|
||||
|
||||
@section('Main-content')
|
||||
<h2>test</h2>
|
||||
|
||||
<input type="hidden" value="98" id="receiveNumberProject">
|
||||
|
||||
|
||||
<table id="showProjectEquipment" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Tag</th>
|
||||
<th>Fabrica</th>
|
||||
<th>Tipo</th>
|
||||
<th>acao</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var numberProject = $('#receiveNumberProject').val();
|
||||
|
||||
$('#showProjectEquipment').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '{{ route('getDataEquipment') }}',
|
||||
type: 'GET',
|
||||
data: {
|
||||
'numberProject': numberProject
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'equipment_id',
|
||||
name: 'equipment_id'
|
||||
},
|
||||
{
|
||||
data: 'equipment_tag',
|
||||
name: 'equipment_tag'
|
||||
},
|
||||
{
|
||||
data: 'unit_id',
|
||||
name: 'unit_id'
|
||||
},
|
||||
{
|
||||
data: 'equipment_type_id',
|
||||
name: 'equipment_type_id'
|
||||
},
|
||||
{
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
@ -1,7 +1,24 @@
|
|||
@extends('Templates.templateWorkstations')
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
@if (session('danger'))
|
||||
<div class="content">
|
||||
<div class="alert alert-danger" role="alert" id="alert-message-danger" style="transition: opacity 1s;">
|
||||
{{ session('danger') }}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
$('#alert-message-danger').fadeOut('slow', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
}, 5000); // A mensagem desaparecerá após 5 segundos
|
||||
</script>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row justify-content-center align-items-center" style="height: 50vh">
|
||||
<div class="col-6">
|
||||
<div class="card card-info">
|
||||
|
|
@ -9,7 +26,8 @@
|
|||
<h3 class="card-title text-center">QRCode Scan</h3>
|
||||
</div>
|
||||
<div id="startScan" class="card-body text-center">
|
||||
<div class="text-white p-3 mt-3 rounded" style=" background-color: #00B0EA"> <!-- Updated class for rounded corners -->
|
||||
<div class="text-white p-3 mt-3 rounded" style=" background-color: #00B0EA">
|
||||
<!-- Updated class for rounded corners -->
|
||||
<i class="fas fa-qrcode fa-5x"></i> <!-- Icon -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
301
routes/web.bak.php
Normal file
301
routes/web.bak.php
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
<?php
|
||||
|
||||
use App\DataTables\UsersDataTable;
|
||||
use App\Http\Controllers\ClientController;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
|
||||
use App\Http\Controllers\Auth\ResetPasswordController;
|
||||
use App\Http\Controllers\Auth\RegisteredUserController;
|
||||
|
||||
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
|
||||
|
||||
use App\Http\Controllers\CustomRegistrationController;
|
||||
use App\Http\Controllers\CreateProjectController;
|
||||
|
||||
use App\Http\Controllers\ForgotPasswordController;
|
||||
use App\Http\Controllers\FormController;
|
||||
|
||||
use App\Http\Controllers\NewPasswordController;
|
||||
use App\Http\Controllers\userController;
|
||||
|
||||
use App\Http\Controllers\Pending_UserController;
|
||||
use App\Http\Controllers\ProjectoDatacontroller;
|
||||
|
||||
use App\Http\Controllers\PreparedProjectController;
|
||||
use App\Http\Controllers\ExecutionProjectController;
|
||||
use App\Http\Controllers\WorkstationsJobsController;
|
||||
use App\Http\Controllers\LanguageController;
|
||||
|
||||
|
||||
// Esta rota so pode aceder quem tiver o link atravez do email
|
||||
Route::get('formulario', function () {
|
||||
return view('email/FormAdmin');
|
||||
})->name('formulario');
|
||||
|
||||
Route::post('formulario/receive', [Pending_UserController::class, 'store'])->name('criarUser');
|
||||
|
||||
Route::post('/register', [CustomRegistrationController::class, 'store'])->name('register');
|
||||
|
||||
|
||||
// Rotas protegidas que exigem esta logado
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User_Type (Super_Administrador)
|
||||
|--------------------------------------------------------------------------
|
||||
|*** Routes unique access to the Super_Administrator, Administrator
|
||||
|
||||
*/
|
||||
Route::get('usersProfiles/{id}', [userController::class, 'UserProfile'])->name('usersProfiles');
|
||||
Route::post('editProfile/{id}', [userController::class, 'EditProfile'])->name('editProfile');
|
||||
|
||||
|
||||
|
||||
Route::middleware(['checkUserType:home'])->group(function () {
|
||||
|
||||
Route::get('/', [ProjectoDatacontroller::class, ('HomePage')])->name('home');
|
||||
|
||||
Route::controller(CreateProjectController::class)
|
||||
->group(function () {
|
||||
//Rotas de Criacao de Obra e de sua visualização da Obra no Planeamento
|
||||
Route::get('createProject', 'createProjectForStep1')->name('createProject');
|
||||
Route::post('newProject1', 'processStep1')->name('processStep1');
|
||||
Route::get('articulated_2/{id}', 'showStep2')->name('articulated_2');
|
||||
});
|
||||
// Pagina de Rolatórios
|
||||
Route::get('showAllClientsForProjectReports', [ProjectoDatacontroller::class, 'showAllClientsForProjectReports'])->name('showAllClientsForProjectReports');
|
||||
|
||||
// Pagina de Gestao de Ativos
|
||||
Route::get('manageAssets', [ProjectoDatacontroller::class, 'ManageAssets'])->name('manageAssets');
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CRUD - users
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
Route::controller(userController::class)
|
||||
->group(function () {
|
||||
|
||||
Route::get('users/listUsers', 'listUsers')->name('users.list'); //oK
|
||||
Route::get('users/listCompanies', 'listCompanies')->name('users.company'); //oK
|
||||
Route::get('users/{id}', 'show')->name('users.Show'); //ok
|
||||
Route::get('users/{id}/edit', 'edit')->name('users.edit'); // OK
|
||||
Route::put('users/{user}', 'update')->name('users.update'); //ok
|
||||
Route::delete('users/{user}', 'destroy')->name('users.destroy'); //ok
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Management of projects created
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
Route::controller(CreateProjectController::class)
|
||||
->group(function () {
|
||||
|
||||
// indication of progress bar to projects that are in 'Planning'
|
||||
Route::get('projectDetails_1/{id}', 'showStep1')->name('projectDetails_1'); //ok
|
||||
Route::get('workStation_3/{id}', 'showStep3')->name('workStation_3'); //ok
|
||||
|
||||
// Para adicionar uma tarefa Complementar
|
||||
Route::post('addFurtherTasks', 'addFurtherTasks')->name('addFurtherTasks'); //ok
|
||||
Route::post('deleteFurtherTasks', 'deleteFurtherTasks')->name('deleteFurtherTasks'); //ok
|
||||
|
||||
|
||||
Route::post('receiveEquipmentToAssociateTasks', 'receiveEquipmentToAssociateTasks')->name('receiveEquipmentToAssociateTasks');
|
||||
Route::get('finishCreatingProject/{numberProject}', 'finishCreatingProject')->name('finishCreatingProject');
|
||||
Route::get('testDataTables', 'testDataTables')->name('testDataTables');
|
||||
Route::get('workstationsAssociationTasks', 'workstationsAssociationTasks')->name('workstationsAssociationTasks');
|
||||
Route::get('AddNomenclatureWorkstation', 'AddNomenclatureWorkstation')->name('AddNomenclatureWorkstation');
|
||||
Route::get('removeProjectEquipment', 'removeProjectEquipment')->name('removeProjectEquipment');
|
||||
Route::delete('deleteWorkstation/{name}', 'deleteWorkstation')->name('deleteWorkstation');
|
||||
Route::post('editEquipment', 'EditEquipment')->name('editEquipment');
|
||||
Route::post('createWorkStations', 'createWorkStations')->name('createWorkStations');
|
||||
|
||||
Route::post('projectDetails_1', 'EditprocessStep1')->name('EditprocessStep1');
|
||||
Route::post('articulated_2', 'processStep2')->name('processStep2');
|
||||
Route::post('articulated_2CreateEquipment', 'createEquipmentManual')->name('articulated_2CreateEquipment');
|
||||
Route::post('workStation_3', 'processStep3');
|
||||
Route::delete('removeEquipment/{id}', 'removePendingEquipment')->name('removeEquipment');
|
||||
Route::post('CreateNewEquipmentFromPendingEquipment/{id}', 'CreateNewEquipmentFromPendingEquipment')->name('CreateNewEquipmentFromPendingEquipment');
|
||||
Route::post('create-equipament-project', 'createEquipamentProject')->name('createEquipamentProject');
|
||||
Route::get('equipments/{id}/attributes', 'getAttributes');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Template Excel
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
Route::get('template1/{numberProject}', 'receiveUnitsForExcelTemplate')->name('download');
|
||||
});
|
||||
|
||||
Route::get('user-data', [PreparedProjectController::class, 'getData1'])->name('getData');
|
||||
Route::get('preparedProject/{ProjectId}', [PreparedProjectController::class, 'PreparedProject'])->name('preparedProject');
|
||||
Route::get('EditProjectForArticulated', [PreparedProjectController::class, 'editProjectForArticulated'])->name('EditProjectForArticulated');
|
||||
|
||||
Route::get('ExecutionProject/{ProjectId}', [ExecutionProjectController::class, 'receiveExecutionProject'])->name('ExecutionProject');
|
||||
Route::get('/ReceiveEquipmentIdForShowModal/{EquipmentID}', [ExecutionProjectController::class, 'receiveEquipmentIdForShowModal'])->name('ReceiveEquipmentIdForShowModal ');
|
||||
|
||||
|
||||
//Gerir os Ativos gerais
|
||||
Route::get('units/{id}', [ProjectoDatacontroller::class, 'showUnit'])->name('showUnit');
|
||||
|
||||
Route::post('enviar-formulario', [FormController::class, 'enviarEmail'])->name('enviar.formulario');
|
||||
|
||||
Route::get('/CreateUsers/{id}', [Pending_UserController::class, 'ShowFormUser'])->name('ShowPendingUser');
|
||||
Route::get('/CreateUsers', [Pending_UserController::class, 'ListPendingUsers'])->name('CreateUsers');
|
||||
|
||||
// Mostrar Instalação click
|
||||
|
||||
});
|
||||
|
||||
/*manageAssets
|
||||
|--------------------------------------------------------------------------
|
||||
| User_Type (tecnico)
|
||||
|--------------------------------------------------------------------------
|
||||
|*** Routes unique access to the technical
|
||||
*/
|
||||
Route::middleware(['checkUserType:enterWorkstation'])->group(function () {
|
||||
|
||||
Route::get('enterWorkstation', function () {
|
||||
return view('workstations.start');
|
||||
})->name('enterWorkstation');
|
||||
|
||||
Route::get('/getEquipmentData/{equipment_id}', [WorkstationsJobsController::class, 'getEquipmentData'])->name('getEquipmentData');
|
||||
Route::post('receiveAnswersEquipment/{control_equipment_workstation_id}', [WorkstationsJobsController::class, 'receiveAnswersEquipment'])->name('receiveAnswersEquipment');
|
||||
});
|
||||
|
||||
Route::middleware(['checkUserType:testClient'])->group(function () {
|
||||
// Dashboard
|
||||
Route::get('dashboardClient', [ClientController::class, 'receiveProjectsClient'])->name('dashboardClient');
|
||||
// Relatorios
|
||||
Route::get('reportingDataClient/{clientID?}', [ClientController::class, 'reportingDataClient'])->name('reportingDataClient');
|
||||
//Api
|
||||
Route::get('/api/receiveMonths/{yearsProjects}', [ClientController::class, 'receiveMonths']);
|
||||
Route::get('/api/receiveDays/{yearProjects}/{monthProjects}', [ClientController::class, 'receiveDays']);
|
||||
|
||||
// Equipamentos do Cliente
|
||||
Route::get('manageAssetsClient', [ClientController::class, 'receiveManageAssetsClient'])->name('manageAssetsClient');
|
||||
|
||||
//Relatorios Obras Concluidas
|
||||
Route::get('showDataDetailsProjectClient/{projectID?}', [ClientController::class, 'showDataDetailsProjectClient'])->name('showDataDetailsProjectClient');
|
||||
//Api
|
||||
Route::get('getDataAmbitsOfProject', [ClientController::class, 'getDataAmbitsOfProject'])->name('getDataAmbitsOfProject');
|
||||
Route::get('getDataEquipmentsOfProject', [ClientController::class, 'getDataEquipmentsOfProject'])->name('getDataEquipmentsOfProject');
|
||||
|
||||
// Relatorio por Ambito de uma Determinada Obra.
|
||||
Route::get('showReportingForAmbitsProject/{ambitId}/{projectId}', [ClientController::class, 'showReportingForAmbitsProject'])->name('showReportingForAmbitsProject');
|
||||
//Api
|
||||
Route::get('getEquipmentsOfAmbit', [ClientController::class, 'getEquipmentsOfAmbit'])->name('getEquipmentsOfAmbit');
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
route::get('changeStateProject/{projectId}', [CreateProjectController::class, 'changeStateProject'])->name('changeStateProject');
|
||||
|
||||
route::get('deleteProject/{projectId}', [CreateProjectController::class, 'deleteProject'])->name('deleteProject');
|
||||
|
||||
Route::get('/checkProjectIsptNumber/{projectId?}', [ProjectoDatacontroller::class, 'checkProjectIsptNumber'])->name('checkProjectIsptNumber');
|
||||
|
||||
Route::post('deletePendingEquipments', [CreateProjectController::class, 'deletePendingEquipments'])->name('deletePendingEquipments');
|
||||
|
||||
|
||||
|
||||
Route::get('showDetailsEquipmentForQrCode/{equipmentId}/{projectId}', [PreparedProjectController::class, 'showDetailsEquipmentForQrCode'])->name('showDetailsEquipmentForQrCode');
|
||||
|
||||
Route::get('showAllEquipmentsInProjectForQrCode/{projectId}', [PreparedProjectController::class, 'showAllEquipmentsInProjectForQrCode'])->name('showAllEquipmentsInProjectForQrCode');
|
||||
|
||||
|
||||
Route::get('testRelatorio', [ProjectoDatacontroller::class, 'testRelatorio'])->name('testRelatorio');
|
||||
|
||||
|
||||
Route::get('showAllClientsForProjectReportsTable', [ProjectoDatacontroller::class, 'showAllClientsForProjectReportsTable'])->name('showAllClientsForProjectReportsTable');
|
||||
|
||||
|
||||
Route::get('cancelElementalTaskForEquipment/{equipmentID}', [WorkstationsJobsController::class, 'cancelElementalTaskForEquipment'])->name('cancelElementalTaskForEquipment');
|
||||
|
||||
Route::get('articulated_2/{projectID}/{equipmentID}', [ProjectoDatacontroller::class, 'projectDetails_11'])->name('projectDetails_11');
|
||||
Route::get('manageAssets/{equipmentID}', [ProjectoDatacontroller::class, 'articulated_22'])->name('articulated_22');
|
||||
Route::get('showAmbitDetailsProjectHistory/{projectID}/{equipmentID}', [ProjectoDatacontroller::class, 'showAmbitDetailsProjectHistory'])->name('showAmbitDetailsProjectHistory');
|
||||
|
||||
|
||||
Route::get('getDataEquipment', [ExecutionProjectController::class, 'getDataEquipment'])->name('getDataEquipment');
|
||||
|
||||
Route::post('deleteEquipmentInProject', [CreateProjectController::class, 'deleteEquipmentInProject'])->name('deleteEquipmentInProject');
|
||||
Route::post('changeAmbitEquipment', [CreateProjectController::class, 'changeAmbitEquipment'])->name('changeAmbitEquipment');
|
||||
|
||||
Route::get('getDataEquipmentClient', [ExecutionProjectController::class, 'getDataEquipmentClient'])->name('getDataEquipmentClient');
|
||||
|
||||
|
||||
Route::get('getDataProjectsClient', [ClientController::class, 'getDataProjectsClient'])->name('getDataProjectsClient');
|
||||
Route::get('showReportingEquipmentProject/{dataEquipment}', [ClientController::class, 'showReportingEquipmentProject'])->name('showReportingEquipmentProject'); //oK
|
||||
|
||||
Route::get('showReportingForAmbitsProjectPdf/{ambitId}/{projectId}', [ClientController::class, 'showReportingForAmbitsProjectPdf'])->name('showReportingForAmbitsProjectPdf'); //ok
|
||||
|
||||
Route::get('getDataAllEquipmentsForAmbitOfProject', [ClientController::class, 'getDataAllEquipmentsForAmbitOfProject'])->name('getDataAllEquipmentsForAmbitOfProject');
|
||||
|
||||
|
||||
Route::post('language/switch', [LanguageController::class, 'switchLanguage'])->name('language.switch');
|
||||
|
||||
|
||||
|
||||
// Email
|
||||
Route::get('/your-verification-route/{id}/{hash}', [UserController::class, 'yourVerificationMethod'])
|
||||
->middleware(['auth', 'signed', 'throttle:6,1'])
|
||||
->name('verification.verify');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// *** All api routes have been moved to api.php ***
|
||||
Route::get('/api/receiveEquipmentsExecutionProject/{receiveNumberProject}', [ExecutionProjectController::class, 'receiveEquipmentsExecutionProject'])->name('receiveEquipmentsExecutionProject');
|
||||
Route::get('/api/receiveAllEquipments', [ProjectoDatacontroller::class, 'receiveAllEquipments']);
|
||||
Route::get('/api/receiveEquipmentsProject/{receiveNumberProject}', [ProjectoDatacontroller::class, 'receiveEquipmentsProject']);
|
||||
Route::get('/api/receiveWorkstationProject/{receiveNumberProject}', [ProjectoDatacontroller::class, 'receiveWorkstationProject']);
|
||||
Route::get('/api/getEquipmentDetails/{receiveListEquipmentId}', [ProjectoDatacontroller::class, 'getEquipmentDetails']);
|
||||
// Route::get('/api/receiveAllInstallationEquipment/{receiveNumberProject}', [ProjectoDatacontroller::class, 'receiveAllInstallationEquipment']);
|
||||
Route::get('/api/receiveAllInstallationEquipment', [ProjectoDatacontroller::class, 'receiveAllInstallationEquipment'])->name('api_receiveAllInstallationEquipment');
|
||||
|
||||
Route::get('/api/receveTasksWorkstationPlanning/{WorkstationId}', [CreateProjectController::class, 'receveTasksWorkstationPlanning']);
|
||||
Route::get('/api/ambits/prepared{equipmentType}', [PreparedProjectController::class, 'getAmbits']);
|
||||
Route::get('/api/equipment/{id}', [CreateProjectController::class, 'showJson']);
|
||||
Route::get('/api/installations/', [CreateProjectController::class, 'getByUserNif']);
|
||||
Route::get('/api/ambits/{equipmentType}', [CreateProjectController::class, 'getAmbits']);
|
||||
|
||||
|
||||
Route::get('/api/receiveUnits/{numberProject}', [CreateProjectController::class, 'receiveUnits']);
|
||||
|
||||
Route::get('api/receivePlants/{receiveAllClients}', [ProjectoDatacontroller::class, 'receivePlants']);
|
||||
|
||||
Route::get('api/receiveUnitsManageAssets/{receivePlantClientRelated}', [ProjectoDatacontroller::class, 'receiveUnitsManageAssets']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// // Rotas para o tipo de usuário 'Técnico'
|
||||
|
||||
// Rotas para o tipo de usuário 'Empresa'
|
||||
Route::middleware(['auth', 'checkUserType:dashboardClient'])->group(function () {
|
||||
Route::get('dashboardClient', [ClientController::class, 'receiveProjectsClient'])->name('dashboardClient');
|
||||
// Adicione outras rotas específicas para 'Empresa' aqui
|
||||
});
|
||||
|
|
@ -135,7 +135,7 @@
|
|||
return view('workstations.start');
|
||||
})->name('enterWorkstation');
|
||||
|
||||
Route::get('/getEquipmentData/{equipment_id}', [WorkstationsJobsController::class, 'getEquipmentData'])->name('getEquipmentData');
|
||||
Route::get('/getEquipmentData/{equipment_id}/{component_tag}', [WorkstationsJobsController::class, 'getEquipmentData'])->name('getEquipmentData');
|
||||
Route::post('receiveAnswersEquipment/{control_equipment_workstation_id}', [WorkstationsJobsController::class, 'receiveAnswersEquipment'])->name('receiveAnswersEquipment');
|
||||
});
|
||||
|
||||
|
|
@ -293,6 +293,18 @@
|
|||
|
||||
Route::get('api/receiveUnitsManageAssets/{receivePlantClientRelated}', [ProjectoDatacontroller::class, 'receiveUnitsManageAssets']);
|
||||
|
||||
// Route::get('api/reloadWsPage{controlEquipmentId}',[WorkstationsJobsController::class,'reloadWsPage']);
|
||||
// Route::post('/api/reloadWsPage/{controlEquipmentId}', [WorkstationsJobsController::class, 'reloadWsPage']);
|
||||
// Route::post('/api/reloadWsPage/{controlEquipmentId}', [WorkstationsJobsController::class, 'reloadWsPage']);
|
||||
|
||||
// Route::post('/api/updateWorkstationStatus/', [WorkstationsJobsController::class, 'updateWorkstationStatus']);
|
||||
// Route::post('/api/closeWorkstationSession/', [WorkstationsJobsController::class, 'closeWorkstationSession']);
|
||||
|
||||
Route::post('/api/updateSessionStatus/{controlEquipmentId}', [WorkstationsJobsController::class, 'updateSessionStatus']);
|
||||
Route::post('/api/closeSession/{controlEquipmentId}', [WorkstationsJobsController::class, 'closeSession']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user