updating the client profile, updating the graphics of the work in progress, creating a comment structure between admin and technician and updating the methodology for approving equipment
This commit is contained in:
parent
745e7d71c5
commit
d26bdacd70
|
|
@ -419,11 +419,8 @@ public function getDataProjects(Request $request)
|
|||
public function receiveProjectsClient()
|
||||
{
|
||||
$client = Auth::user()->user_id;
|
||||
// DD($client);
|
||||
$recebeCompanyID = AssociationCompanyUser::where('user_id', $client)->first();
|
||||
|
||||
|
||||
|
||||
$recevePlantClient = Plant::where('company_id', $recebeCompanyID->company_id)->get();
|
||||
|
||||
// Extrai os plant_id da coleção $recevePlantClient
|
||||
|
|
@ -439,7 +436,11 @@ public function receiveManageAssetsClient()
|
|||
{
|
||||
$client = Auth::user()->user_id;
|
||||
|
||||
$allPlantsClient = Plant::where('user_id', $client)->get();
|
||||
$recebeCompanyID = AssociationCompanyUser::where('user_id', $client)->first();
|
||||
|
||||
$client = $recebeCompanyID->company_id;
|
||||
|
||||
$allPlantsClient = Plant::where('company_id', $client)->get();
|
||||
|
||||
// Extrai os plant_id da coleção $recevePlantClient
|
||||
$plantsIds = $allPlantsClient->pluck('plant_id');
|
||||
|
|
@ -460,12 +461,19 @@ public function receiveManageAssetsClient()
|
|||
|
||||
public function reportingDataClient($clientID = null)
|
||||
{
|
||||
|
||||
//Deve separar bem, entre receber o cliente pelo perfil de Admin e entrar como cliente.
|
||||
// Se clientID não foi passado, usamos o ID do usuário autenticado
|
||||
if (is_null($clientID)) {
|
||||
$clientID = Auth::user()->user_id;
|
||||
$recebeAssociationCompany = AssociationCompanyUser::where('user_id', $clientID)->first();
|
||||
|
||||
$receiveCompany = Company::where('company_id',$recebeAssociationCompany->company_id)->first();
|
||||
|
||||
$clientID = $recebeAssociationCompany->company_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$companyDetails = Company::where('company_id', $clientID)->first();
|
||||
|
||||
// Busca todas as Instalacoes com base no id do CLIENTE
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ public function getDataEquipment(Request $request)
|
|||
// Tanto para em Planeamento como gestor de Ativos.
|
||||
$receiveTypeValveSelected = $request->get('tipo_valvulasList');
|
||||
|
||||
|
||||
// Variaveis recebidas da gestao de ativos (Filtros)
|
||||
$receiveAllClients = $request->get('receiveAllClients');
|
||||
$receiveAllPlants = $request->get('receiveAllPlants');
|
||||
|
|
@ -157,10 +158,20 @@ public function getDataEquipment(Request $request)
|
|||
->make(true);
|
||||
} else {
|
||||
|
||||
|
||||
// Query padrão que todas as dataTables recebem, a partir dele fazemos os filt
|
||||
$query = Equipment::with('equipmentType', 'unit')
|
||||
->select(['equipment_id', 'equipment_tag', 'unit_id', 'equipment_type_id', 'equipment_description']);
|
||||
|
||||
//Tratamento para o portifólio do Cliente.
|
||||
if ($request->get('clientId')) {
|
||||
$company = $request->get('clientId');
|
||||
$query->whereHas('unit.plant',function ($query) use ($company){
|
||||
$query->where('company_id',$company);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//Filtar equipamentos por um cliente .
|
||||
if ($receiveAllClients && $receiveAllClients !== '#') {
|
||||
// Filtra os equipamentos cujas unidades estão associadas às plantas do usuário especificado
|
||||
|
|
@ -537,11 +548,13 @@ public function receiveExecutionProject($ProjectId)
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
// $allEquipmentsFullyCompleted será true se todos os equipamentos tiverem todos seus históricos com status 2
|
||||
//Deve verificar se todos os equipamentos ja foram concluidos e se for o caso, deve alterar para Obra concluido, autorizar os relatorios e dessasociar todos os equipamento da Obra atual.
|
||||
if ($allEquipmentsFullyCompleted) {
|
||||
|
||||
$DatasProject->order_project = 4;
|
||||
$DatasProject->end_date = now();
|
||||
$DatasProject->save();
|
||||
|
||||
// Desassocia todos os equipamentos do projeto
|
||||
|
|
@ -553,6 +566,7 @@ public function receiveExecutionProject($ProjectId)
|
|||
} else {
|
||||
//Caso nem todos os equipamento tenham-se concluidos, deve voltar a pagina de Execussao normalmente
|
||||
// Retornando a view com os dados necessários
|
||||
|
||||
return view('projectsClients/executionProjectNew', [
|
||||
'DatasProject' => $DatasProject,
|
||||
'equipmentsTypes' => $equipmentsTypes,
|
||||
|
|
@ -677,8 +691,19 @@ public function receiveDetailsEquipmentsProject(Request $request)
|
|||
->whereHas('equipmentWorkHistory', function ($query) use ($tableType) {
|
||||
//Para a tabela com status = pending' deve ir equipamentos com status = 1 pois estao pendentes para Aprovar
|
||||
// Para os restantes equipamentos vao para a tabela que lista os equipamentos da Obra,porem apenas os equipmentos com status = 0
|
||||
//Equipamentos concluidos e aprovados, nao vao entrar em nenhuma das 2 listas ate agora.
|
||||
$status = $tableType === 'pending' ? 1 : 0;
|
||||
//Equipamentos concluidos e aprovados,vao ter o status = 2 e servir apenas para visualizar
|
||||
|
||||
// $status = $tableType === 'pending' ? 1 : 0;
|
||||
// $query->where('equipment_status_project', $status);
|
||||
|
||||
// Definir o status com base no tipo de tabela
|
||||
if ($tableType === 'pending') {
|
||||
$status = 1; // Equipamentos pendentes para aprovação
|
||||
} else if ($tableType === 'completed') {
|
||||
$status = 2; // Equipamentos concluídos e aprovados
|
||||
} else {
|
||||
$status = 0; // Outros equipamentos em andamento (normal)
|
||||
}
|
||||
$query->where('equipment_status_project', $status);
|
||||
});
|
||||
|
||||
|
|
@ -699,8 +724,12 @@ public function receiveDetailsEquipmentsProject(Request $request)
|
|||
})
|
||||
|
||||
//Vai ser 2 tipos de action, para as tabelas.
|
||||
// ->addColumn('action', function ($dataEquipment) use ($numberProject, $tableType) {
|
||||
// $equipmentStatus = $tableType === 'pending' ? 1 : 0;
|
||||
// $actionBtn = '<a title="Detalhes do equipamento" href="' . route('showAmbitDetailsProjectHistory', ['equipmentStatus' => $equipmentStatus, 'projectID' => $numberProject, 'equipmentID' => $dataEquipment->equipment_id]) . '"><i class="fa-solid fa-eye text-primary"></i></a>';
|
||||
// return $actionBtn;
|
||||
->addColumn('action', function ($dataEquipment) use ($numberProject, $tableType) {
|
||||
$equipmentStatus = $tableType === 'pending' ? 1 : 0;
|
||||
$equipmentStatus = ($tableType === 'pending' ? 1 : ($tableType === 'completed' ? 2 : 0));
|
||||
$actionBtn = '<a title="Detalhes do equipamento" href="' . route('showAmbitDetailsProjectHistory', ['equipmentStatus' => $equipmentStatus, 'projectID' => $numberProject, 'equipmentID' => $dataEquipment->equipment_id]) . '"><i class="fa-solid fa-eye text-primary"></i></a>';
|
||||
return $actionBtn;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -154,19 +154,29 @@ public function showAmbitDetailsProjectHistory($equipmentStatus, $projectID, $eq
|
|||
$detailsProject->user_id = $detailsCliente->user_id;
|
||||
|
||||
|
||||
$detalsEquipmentWorkProject = EquipmentWorkHistory::where('equipment_id', $equipmentID)
|
||||
$detailsEquipmentWorkProject = EquipmentWorkHistory::where('equipment_id', $equipmentID)
|
||||
->where('company_projects_id', $projectID)->first();
|
||||
|
||||
$receiveComments = EquipmentComment::with(['user'])
|
||||
->where('equipmentWorkHistorys_id', $detailsEquipmentWorkProject->equipmentWorkHistorys_id)
|
||||
->where('company_projects_id', $detailsProject->company_projects_id)
|
||||
->get()
|
||||
->transform(function ($comment) {
|
||||
// Adiciona uma nova propriedade ao objeto de comentário
|
||||
$comment->type_users = $comment->user->type_users;
|
||||
return $comment;
|
||||
});
|
||||
|
||||
$detalsEquipment = Equipment::where('equipment_id', $equipmentID)->first();
|
||||
|
||||
//recebe todos os dados referentes ao equipamento
|
||||
// OBS : Porem deveria confirma se a tarefa foi mesmo concluida.
|
||||
// $receiveAllTasksHistiory = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $detalsEquipmentWorkProject->equipmentWorkHistorys_id)->get();
|
||||
// $receiveAllTasksHistiory = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $detailsEquipmentWorkProject->equipmentWorkHistorys_id)->get();
|
||||
|
||||
$receiveAllTasksEquipmentInHistory = OrderEquipmentTasks::where('equipmentWorkHistorys_id', $detalsEquipmentWorkProject->equipmentWorkHistorys_id)->get();
|
||||
$receiveAllTasksEquipmentInHistory = OrderEquipmentTasks::where('equipmentWorkHistorys_id', $detailsEquipmentWorkProject->equipmentWorkHistorys_id)->get();
|
||||
|
||||
|
||||
$receiveAmbit = EquipmentAssociationAmbit::where('equipmentWorkHistorys_id', $detalsEquipmentWorkProject->equipmentWorkHistorys_id)->first();
|
||||
$receiveAmbit = EquipmentAssociationAmbit::where('equipmentWorkHistorys_id', $detailsEquipmentWorkProject->equipmentWorkHistorys_id)->first();
|
||||
// $tasksAssociatedWithAmbit = TasksAssociationAmbits::where('ambits_equipment_id', $receiveAmbit->ambits_id)->get();
|
||||
|
||||
$tasksAssociatedWithAmbit = TasksAssociationAmbits::with('elementalTask')
|
||||
|
|
@ -183,14 +193,13 @@ public function showAmbitDetailsProjectHistory($equipmentStatus, $projectID, $eq
|
|||
}
|
||||
}
|
||||
$receiveAllTasksHistiory = ControlEquipmentWorkstation::with('workstationsTaskAnswers')
|
||||
->where('equipmentWorkHistorys_id', $detalsEquipmentWorkProject->equipmentWorkHistorys_id)
|
||||
->where('equipmentWorkHistorys_id', $detailsEquipmentWorkProject->equipmentWorkHistorys_id)
|
||||
->whereNotNull('entry_date') // Verifica se 'entry_date' não é null
|
||||
->whereNotNull('departure_date') // Verifica se 'departure_date' não é null
|
||||
->has('workstationsTaskAnswers') // Garante que haja pelo menos uma 'workstationsTaskAnswers' relacionada
|
||||
->orderBy('elemental_tasks_id', 'asc')
|
||||
->get();
|
||||
|
||||
// dd($receiveAllTasksHistiory);
|
||||
|
||||
foreach ($receiveAllTasksHistiory as $taskHistory) {
|
||||
$taskHistory->cardTypeStyle = 'gray'; // Adiciona o campo 'cardTypeStyle'
|
||||
|
||||
|
|
@ -245,7 +254,6 @@ public function showAmbitDetailsProjectHistory($equipmentStatus, $projectID, $eq
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Nao esta a receber itens
|
||||
|
||||
// dd($allWorkstationsTaskAnswers);
|
||||
|
|
@ -255,7 +263,7 @@ public function showAmbitDetailsProjectHistory($equipmentStatus, $projectID, $eq
|
|||
// dd($receiveAmbit);
|
||||
|
||||
|
||||
return view('projectsClients.showAmbitDetailProjectHistory', compact('equipmentStatus', 'detailsProject', 'receiveAmbit', 'receiveAllTasksHistiory', 'detalsEquipment'));
|
||||
return view('projectsClients.showAmbitDetailProjectHistory', compact('receiveComments', 'equipmentStatus', 'detailsProject', 'receiveAmbit', 'receiveAllTasksHistiory', 'detalsEquipment','detailsEquipmentWorkProject'));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -416,42 +424,6 @@ public function projectDetails_11($projectID, $equipmentID)
|
|||
->get()
|
||||
->keyBy('elemental_tasks_id'); // Keying by elemental_tasks_id para fácil acesso
|
||||
|
||||
|
||||
// $filteredTasks = $filteredTasks->map(function ($task) use ($elementalTasksDetails) {
|
||||
// // Verifica se o detalhe da tarefa elemental existe na coleção $elementalTasksDetails, com base no elemental_tasks_id
|
||||
// if (isset ($elementalTasksDetails[$task->elemental_tasks_id])) {
|
||||
// $elementalTaskDetail = $elementalTasksDetails[$task->elemental_tasks_id];
|
||||
|
||||
// // Adiciona novos atributos ao item da coleção $task com os detalhes da tarefa elemental
|
||||
// $task->elemental_tasks_code = $elementalTaskDetail->elemental_tasks_code;
|
||||
// $task->elemental_tasks_description = $elementalTaskDetail->elemental_tasks_description;
|
||||
// $task->further_tasks_description = $elementalTaskDetail->further_tasks_description; // Ajuste este campo conforme sua existência e necessidade
|
||||
// }
|
||||
|
||||
// // Retorna o item modificado para a nova coleção
|
||||
// return $task;
|
||||
// });
|
||||
|
||||
// $filteredTasks = $filteredTasks->map(function ($task) use ($DetailsTasks) {
|
||||
// // Calcula o execution_order da tarefa anterior
|
||||
// $executionOrderBefore = $task->execution_order - 1;
|
||||
|
||||
// // Busca a tarefa anterior com base no execution_order calculado
|
||||
// $taskBefore = $DetailsTasks->first(function ($item) use ($executionOrderBefore) {
|
||||
// return $item->execution_order == $executionOrderBefore;
|
||||
// });
|
||||
|
||||
// // Se encontrou a tarefa anterior, adiciona seu elemental_tasks_id ao item atual
|
||||
// if ($taskBefore) {
|
||||
// $task->taskIDBeforeExecutionOrder = $taskBefore->elemental_tasks_id;
|
||||
// } else {
|
||||
// // Se não encontrar a tarefa anterior, pode definir como null ou outro valor padrão
|
||||
// $task->taskIDBeforeExecutionOrder = null;
|
||||
// }
|
||||
|
||||
// return $task;
|
||||
// });
|
||||
|
||||
$filteredTasks = $filteredTasks->map(function ($task) use ($elementalTasksDetails, $DetailsTasks) {
|
||||
// Primeiro bloco: Adiciona detalhes da tarefa elemental
|
||||
if (isset ($elementalTasksDetails[$task->elemental_tasks_id])) {
|
||||
|
|
@ -507,7 +479,9 @@ public function projectDetails_11($projectID, $equipmentID)
|
|||
$specificAttributesArray[$attribute->general_attributes_equipment_id] = $attribute->specific_attributes_value;
|
||||
}
|
||||
|
||||
return view('projectsClients.articulated_2_ShowEquipment', compact('detailsProject', 'dataEquipment', 'filteredTasks', 'OrdemTasks', 'DetailsTasks', 'detailsEquipmentWorkHistory', 'specificAttributesArray'));
|
||||
|
||||
|
||||
return view('projectsClients.articulated_2_ShowEquipment', compact('receiveComments', 'detailsProject', 'dataEquipment', 'filteredTasks', 'OrdemTasks', 'DetailsTasks', 'detailsEquipmentWorkHistory', 'specificAttributesArray'));
|
||||
}
|
||||
|
||||
//Funcao que recebe a Acoes do dataTables do portifolio.
|
||||
|
|
@ -753,21 +727,36 @@ public function changeEquipmentStatusOnProject(Request $request)
|
|||
|
||||
if ($request->choiseAdminForEquipment == 'approve') {
|
||||
//Se for aprovado, libera o equipamento para relatorio.
|
||||
$detailsEquipmentWorkHistory->equipment_status_project = 2 ;
|
||||
$detailsEquipmentWorkHistory->equipment_status_project = 2;
|
||||
$detailsEquipmentWorkHistory->save();
|
||||
}
|
||||
}
|
||||
|
||||
//Sempre vai criar o comentario, a diferenca a se o equipamento tem status : 2 o comanterio vai para o relatorio,se nao vai para os comentarios da Ws.
|
||||
$createCommet= new EquipmentComment;
|
||||
$createCommet = new EquipmentComment;
|
||||
$createCommet->equipmentWorkHistorys_id = $detailsEquipmentWorkHistory->equipmentWorkHistorys_id;
|
||||
$createCommet->user_id = $receivedetailsUser->user_id;
|
||||
$createCommet->company_projects_id = $detailsEquipmentWorkHistory->company_projects_id;
|
||||
$createCommet->creation_date = now();
|
||||
$createCommet->comment =$request->comment;
|
||||
$createCommet->comment = $request->comment;
|
||||
$createCommet->save();
|
||||
|
||||
return redirect()->route('ExecutionProject', ['projectID' => $request->projectID])
|
||||
->with('success', 'Equipamento aprovado, liberado para relatório.');
|
||||
->with('success', 'Equipamento aprovado, liberado para relatório.');
|
||||
|
||||
}
|
||||
|
||||
public function createComment(Request $request){
|
||||
|
||||
auth()->user();
|
||||
$newComment = new EquipmentComment;
|
||||
$newComment->company_projects_id = $request->projectID;
|
||||
$newComment->equipmentWorkHistorys_id = $request->equipmentID;
|
||||
$newComment->user_id = auth()->user()->user_id;
|
||||
$newComment->creation_date = now();
|
||||
$newComment->comment = $request->comment;
|
||||
$newComment->save();
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
use App\Models\ControlEquipmentWorkstation;
|
||||
use App\Models\ElementalTasks;
|
||||
use App\Models\Equipment;
|
||||
use App\Models\EquipmentComment;
|
||||
use App\Models\EquipmentWorkHistory;
|
||||
use App\Models\OrderEquipmentTasks;
|
||||
use App\Models\workstationsTaskAnswers;
|
||||
|
|
@ -262,7 +263,6 @@ 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, $component_tag)
|
||||
{
|
||||
// dd($equipment_id);
|
||||
//vai receber o email atual, no caso o da workstation que se encontra
|
||||
$userEmail = Auth::user();
|
||||
// Busca os dados da Ws com base no Login
|
||||
|
|
@ -307,7 +307,6 @@ public function getEquipmentData($equipment_id, $component_tag)
|
|||
->orderBy('execution_order', 'asc')
|
||||
->get();
|
||||
|
||||
// dd($recebeTasksForEquipment);
|
||||
|
||||
//Busca as tarefas que podem ser feitas pela WS Atual a partir do Email
|
||||
$userTasks = DB::table('users as u')
|
||||
|
|
@ -366,6 +365,7 @@ public function getEquipmentData($equipment_id, $component_tag)
|
|||
|
||||
$query = ControlEquipmentWorkstation::where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->whereNull('departure_date')
|
||||
->orderByDesc('departure_date') // Ordena por departure_date de forma decrescente
|
||||
->where('status', 0)
|
||||
->whereNull('id_workstations')
|
||||
->whereNull('elemental_tasks_id');
|
||||
|
|
@ -373,7 +373,6 @@ public function getEquipmentData($equipment_id, $component_tag)
|
|||
if ($query->first()) {
|
||||
|
||||
$existingDataControlEquipment = $query->first();
|
||||
|
||||
}
|
||||
}
|
||||
// Verifica se um registro foi encontrado e atualiza conforme necessário
|
||||
|
|
@ -438,12 +437,14 @@ public function getEquipmentData($equipment_id, $component_tag)
|
|||
elseif (in_array($task->elemental_tasks_id, $divisionElementalTasks[2])) {
|
||||
$task->cardType = 'card-primary';
|
||||
$task->cardTypeStyle = 'gray'; // Define o estilo de cor
|
||||
|
||||
// Consulta ControlEquipmentWorkstation para verificar as condições especificadas
|
||||
$controlEquipment = ControlEquipmentWorkstation::where('elemental_tasks_id', $task->elemental_tasks_id)
|
||||
->whereNotNull('entry_date')
|
||||
->whereNotNull('departure_date')
|
||||
->orderByDesc('departure_date') // Ordena por departure_date de forma decrescente
|
||||
->first();
|
||||
|
||||
|
||||
if ($controlEquipment) {
|
||||
// Se encontrar, atribuir control_equipment_workstation_id
|
||||
$task->control_equipment_workstation_id = $controlEquipment->control_equipment_workstation_id;
|
||||
|
|
@ -480,6 +481,7 @@ public function getEquipmentData($equipment_id, $component_tag)
|
|||
->where('elemental_tasks_id', $task->elemental_tasks_id)
|
||||
->whereNotNull('entry_date')
|
||||
->whereNotNull('departure_date')
|
||||
->orderByDesc('departure_date') // Ordena por departure_date de forma decrescente
|
||||
->first();
|
||||
|
||||
if ($controlEquipment) {
|
||||
|
|
@ -526,10 +528,22 @@ public function getEquipmentData($equipment_id, $component_tag)
|
|||
$recebeTasksForEquipment = $recebeTasksForEquipment->sortBy('execution_order');
|
||||
}
|
||||
|
||||
// dd($recebeTasksForEquipment);
|
||||
$receiveComments = EquipmentComment::with(['user'])
|
||||
->where('equipmentWorkHistorys_id', $receiveEquipmentWorkHistory->equipmentWorkHistorys_id)
|
||||
->where('company_projects_id', $receiveDataEquipment->company_projects_id)
|
||||
->get()
|
||||
->transform(function ($comment) {
|
||||
// Adiciona uma nova propriedade ao objeto de comentário
|
||||
$comment->type_users = $comment->user->type_users;
|
||||
return $comment;
|
||||
});
|
||||
|
||||
// dd($recebeTasksForEquipment);
|
||||
|
||||
|
||||
return view('workstations.workstations', [
|
||||
// Deve receber o atual COntrol ID ? tudo a vez que atualizar ??
|
||||
'receiveComments' => $receiveComments,
|
||||
'dataControlEquipment' => $receiveDataControlEquipment,
|
||||
'receiveDataEquipment' => $receiveDataEquipment,
|
||||
'recebeTasksForEquipment' => $recebeTasksForEquipment,
|
||||
|
|
|
|||
|
|
@ -194,8 +194,6 @@ public function compose(View $view)
|
|||
return $equipment;
|
||||
});
|
||||
|
||||
dd($receiveAllEquipmentOfProject);
|
||||
|
||||
$completedEquipments = collect(); // Coleção para armazenar equipamentos concluídos
|
||||
|
||||
// Inicializa um array para armazenar o status de cada equipamento
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public function refreshDataEquipments($datasProject)
|
|||
|
||||
$totalEquipments = EquipmentWorkHistory::where('company_projects_id', $datasProject->company_projects_id)->get();
|
||||
|
||||
// $detalsEquipmentWorkProject = EquipmentWorkHistory::where('equipment_id', $equipmentID)
|
||||
// $detailsEquipmentWorkProject = EquipmentWorkHistory::where('equipment_id', $equipmentID)
|
||||
// ->where('company_projects_id', $projectID)->first();
|
||||
|
||||
// Busca o valor total de todos os equipamentos encontrados
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ public function mount($datasProject)
|
|||
return $group->unique('equipmentWorkHistorys_id')->count();
|
||||
});
|
||||
|
||||
|
||||
$newArray = [];
|
||||
|
||||
foreach ($tasksCount as $taskId => $count) {
|
||||
|
|
|
|||
|
|
@ -15,4 +15,6 @@ class AssociationCompanyUser extends Model
|
|||
|
||||
protected $fillable = ['association_company_user_id', 'company_id', 'user_id'];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
class User extends Authenticatable
|
||||
// implements MustVerifyEmail
|
||||
// implements MustVerifyEmail
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
|
|
@ -26,8 +26,8 @@ class User extends Authenticatable
|
|||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
|
||||
protected $fillable = ['user_id','user_name', 'email', 'password', 'user_phone', 'user_nif', 'type_users'];
|
||||
|
||||
protected $fillable = ['user_id', 'user_name', 'email', 'password', 'user_phone', 'user_nif', 'type_users'];
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -53,16 +53,24 @@ class User extends Authenticatable
|
|||
// return $this->belongsTo(TypeUser::class, 'type_users', 'type_user_id');
|
||||
// }
|
||||
|
||||
public function userType() {
|
||||
public function userType()
|
||||
{
|
||||
return $this->belongsTo(TypeUser::class, 'type_users', 'type_user_id');
|
||||
}
|
||||
|
||||
public function plants(){
|
||||
return $this->hasMany(Plant::class,'user_id', 'user_id');
|
||||
public function plants()
|
||||
{
|
||||
return $this->hasMany(Plant::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
|
||||
public function companies()
|
||||
{
|
||||
return $this->belongsToMany(Company::class, 'association_company_user', 'user_id', 'company_id');
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany(EquipmentComment::class, 'user_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-primary" id="cardAssetsTable">
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
</div>
|
||||
</div> --}}
|
||||
|
||||
<div class="row">
|
||||
{{-- Botao de fazer reload ao grafico sem recarregar a pagina , Atualmente nao funciona --}}
|
||||
{{-- <div class="row">
|
||||
<div class="col-sm d-flex justify-content-end">
|
||||
<button class="btn btn-primary mb-2" wire:click="updateTimeGrafics">
|
||||
<i class="fa-solid fa-arrows-rotate"></i>
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
{{ $lastUpdated }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
{{-- <div class="row text-center">
|
||||
<div class="col-sm-6">
|
||||
|
|
|
|||
|
|
@ -11,13 +11,15 @@
|
|||
<h1>{{ $DatasProject->company_project_description }}</h1>
|
||||
<input type="hidden" value="{{ $DatasProject->company_projects_id }}" id="receiveNumberProject">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="./preparadas.html">Em Execucao</a></li>
|
||||
<li class="breadcrumb-item active">{{ $DatasProject->company_project_description }}</li>
|
||||
</ol>
|
||||
</div><!-- /.col -->
|
||||
@if ((auth()->user() && auth()->user()->type_users == 2) || (auth()->user() && auth()->user()->type_users == 1))
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="./preparadas.html">Em Execucao</a></li>
|
||||
<li class="breadcrumb-item active">{{ $DatasProject->company_project_description }}</li>
|
||||
</ol>
|
||||
</div><!-- /.col -->
|
||||
@endif
|
||||
</div>
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
|
|
@ -47,23 +49,18 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-sm" id="ViewDetailsButton">
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
<a href="#CardViewDetails" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
style="margin-bottom: 2%;">Detalhes</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm" id="ViewEquipmentsButton">
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
<a href="#CardViewEquipments" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
style="margin-bottom: 2%;"> Equipamentos</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm" id="ViewWorkstationButton">
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
style="margin-bottom: 2%;">Postos de Trabalho</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm" id="ViewTasksButton">
|
||||
<a href="#" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
style="margin-bottom: 2%;">Tarefas</a>
|
||||
<a href="#CardViewWorkstations" type="button" class="btn btn-block bg-primary btn-lg"
|
||||
style="margin-bottom: 2%;">Listas</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -104,16 +101,19 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row m-3 justify-content-between">
|
||||
<div>
|
||||
@if ((auth()->user() && auth()->user()->type_users == 2) || (auth()->user() && auth()->user()->type_users == 1))
|
||||
<div class="row m-3 justify-content-between">
|
||||
{{-- <div>
|
||||
<button class="btn btn-info" data-toggle="modal" data-target="#exampleModal">Adicionar
|
||||
equipamentos a Obra</button>
|
||||
</div> --}}
|
||||
|
||||
<div>
|
||||
<a href="{{ route('showQrcodesInProject', ['projectNumber' => $DatasProject->company_projects_id]) }}"
|
||||
class="btn btn-danger">Imprimir Qrcodes</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ route('showQrcodesInProject', ['projectNumber' => $DatasProject->company_projects_id]) }}"
|
||||
class="btn btn-danger">Imprimir Qrcodes</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
|
|
@ -155,53 +155,80 @@ class="btn btn-danger">Imprimir Qrcodes</a>
|
|||
|
||||
</div>
|
||||
|
||||
<div class="card card-primary" id="CardViewEquipments">
|
||||
<div class="card card-primary" id="CardViewWorkstations">
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Equipamentos</h3>
|
||||
<h3 class="card-title">Listas de equipamentos</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@livewire('execução.equipments-dashboard', ['datasProject' => $DatasProject], key($DatasProject->company_projects_id))
|
||||
|
||||
<div class="card card-info mt-4">
|
||||
@if ((auth()->user() && auth()->user()->type_users == 2) || (auth()->user() && auth()->user()->type_users == 1))
|
||||
{{-- Faça algo específico para esse tipo de usuário --}}
|
||||
<div class="card card-info mt-4">
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Lista de equipamentos da Obra</h3>
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Lista de equipamentos da Obra - Em execução</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<table id="TableListEquipmentInProject" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tag</th>
|
||||
<th>Descrição</th>
|
||||
<th>Tipo Equipamento</th>
|
||||
<th>Fabrica</th>
|
||||
<th>Âmbito</th>
|
||||
<th>Ação</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<!-- ./card card-info -->
|
||||
|
||||
<div class="card-body">
|
||||
<div class="card card-info mt-4">
|
||||
|
||||
<table id="TableListEquipmentInProject" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tag</th>
|
||||
<th>Descrição</th>
|
||||
<th>Tipo Equipamento</th>
|
||||
<th>Fabrica</th>
|
||||
<th>Âmbito</th>
|
||||
<th>Ação</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="card-header ">
|
||||
<h3 class="card-title">Equipamentos Concluidos - por Aprovar</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<table id="TableListEquipmentInProjectPendingsForApprove"
|
||||
class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tag</th>
|
||||
<th>Descrição</th>
|
||||
<th>Tipo Equipamento</th>
|
||||
<th>Fabrica</th>
|
||||
<th>Âmbito</th>
|
||||
<th>Ação</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./card card-info -->
|
||||
|
||||
|
||||
<!-- ./card card-info -->
|
||||
@endif
|
||||
<div class="card card-info mt-4">
|
||||
|
||||
<div class="card-header ">
|
||||
<h3 class="card-title">Concluidos, por Aprovar</h3>
|
||||
<h3 class="card-title">Equipamento finalizados</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<table id="TableListEquipmentInProjectPendingsForApprove"
|
||||
<table id="TableListOfCompletedProjectEquipment"
|
||||
class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -218,195 +245,100 @@ class="table table-bordered table-striped">
|
|||
</div>
|
||||
</div>
|
||||
<!-- ./card card-info -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card card-primary" id="CardViewWorkstations">
|
||||
<div class="card card-primary" id="CardViewEquipments">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Postos de Trabalho</h3>
|
||||
<h3 class="card-title">Equipamentos</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-striped text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome do Posto</th>
|
||||
<th>Login</th>
|
||||
<th>Senha</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ((auth()->user() && auth()->user()->type_users == 2) || (auth()->user() && auth()->user()->type_users == 1))
|
||||
<div class="card card-success">
|
||||
|
||||
@foreach ($filteredUsers as $user)
|
||||
<tr>
|
||||
<td>{{ $user->nomenclature_workstation }}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td>{{ $user->realPassword }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- Adicione mais linhas conforme necessário -->
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Postos de Trabalho</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-striped text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome do Posto</th>
|
||||
<th>Login</th>
|
||||
<th>Senha</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($filteredUsers as $user)
|
||||
<tr>
|
||||
<td>{{ $user->nomenclature_workstation }}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td>{{ $user->realPassword }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- Adicione mais linhas conforme necessário -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card card-success">
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Graficos Equipamentos</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@livewire('execução.equipments-dashboard', ['datasProject' => $DatasProject], key($DatasProject->company_projects_id))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-success">
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Postos de Trabalho</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@livewire('execução.tasks-dashboard', ['datasProject' => $DatasProject], key($DatasProject->company_projects_id))
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card card-primary" id="CardViewTasks">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tarefas</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@livewire('execução.tasks-dashboard', ['datasProject' => $DatasProject], key($DatasProject->company_projects_id))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- <div class="card card-primary" id="CardViewWorkstations">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Postos de Trabalho</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>teste</p>
|
||||
@livewire('execução.tasks-dashboard', ['datasProject' => $DatasProject], key($DatasProject->company_projects_id))
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
{{-- <div class="card card-primary" id="CardViewWorkstations">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Postos de Trabalho</h3>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>teste</p>
|
||||
@livewire('execução.workstation-dashboard', ['datasProject' => $DatasProject], key($DatasProject->company_projects_id))
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- ./Main content -->
|
||||
@endsection
|
||||
|
||||
@section('scriptsTemplateAdmin')
|
||||
{{-- Antigocode para funcioanr o yajra, porem apenas para uma tabela, quando concluir osyajrada pagina,pode apagar. --}}
|
||||
{{-- <script type="text/javascript">
|
||||
var dataTables;
|
||||
$(document).ready(function() {
|
||||
|
||||
dataTables = $('#TableListEquipmentInProject', '#TableListEquipmentInProjectPendingsForApprove')
|
||||
.DataTable({
|
||||
responsive: true,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '{{ route('receiveDetailsEquipmentsProject') }}',
|
||||
type: 'GET',
|
||||
data: function(d) {
|
||||
d.receiveNumberProject = $('#receiveNumberProject').val();
|
||||
// Envia as variaveis de acordo com as opcoes selecionadas para o DataTables
|
||||
d.equipmentTypeSelected = $('#tipo_valvulasList').val();
|
||||
d.unitSelected = $('#unitsList').val();
|
||||
d.receiveAllUnits = $('#receiveUnitsClientRelated').val();
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'equipment_tag',
|
||||
name: 'equipment_tag'
|
||||
},
|
||||
{
|
||||
data: 'equipment_description',
|
||||
name: 'equipment_description'
|
||||
},
|
||||
// {
|
||||
// data: 'equipment_type_name',
|
||||
// name: 'equipment_type_name'
|
||||
// },
|
||||
// {
|
||||
// data: 'unit_name',
|
||||
// name: 'unit_name'
|
||||
// },
|
||||
// {
|
||||
// data: 'ambit_name',
|
||||
// name: 'ambit_name'
|
||||
// },
|
||||
|
||||
// {
|
||||
// data: 'action',
|
||||
// name: 'action',
|
||||
// orderable: false,
|
||||
// searchable: false
|
||||
// },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
//De acordo com os valores deste campos, como anteriormente ja sao enviados para a DataTables para fazer as filtragens, agora atualizamos a Tabela com base no filtros feitos
|
||||
// $('#tipo_valvulasList,#unitsList,#receiveUnitsClientRelated').on('change',
|
||||
// function() {
|
||||
// dataTables.ajax.reload();
|
||||
// });
|
||||
</script> --}}
|
||||
|
||||
{{-- <script type="text/javascript">
|
||||
// Inicialize as tabelas deequipamentos
|
||||
$(document).ready(function() {
|
||||
setupDataTable('#TableListEquipmentInProject', 'normal');
|
||||
setupDataTable('#TableListEquipmentInProjectPendingsForApprove', 'pending');
|
||||
});
|
||||
|
||||
function setupDataTable(tableSelector) {
|
||||
$(tableSelector).DataTable({
|
||||
responsive: true,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '{{ route('receiveDetailsEquipmentsProject') }}',
|
||||
type: 'GET',
|
||||
data: function(d) {
|
||||
d.receiveNumberProject = $('#receiveNumberProject').val();
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'equipment_tag',
|
||||
name: 'equipment_tag'
|
||||
},
|
||||
{
|
||||
data: 'equipment_description',
|
||||
name: 'equipment_description'
|
||||
},
|
||||
{
|
||||
data: 'equipment_type_name',
|
||||
name: 'equipment_type_name'
|
||||
},
|
||||
{
|
||||
data: 'unit_name',
|
||||
name: 'unit_name'
|
||||
},
|
||||
{
|
||||
data: 'ambit_name',
|
||||
name: 'ambit_name'
|
||||
},
|
||||
]
|
||||
});
|
||||
}
|
||||
</script> --}}
|
||||
|
||||
<script type="text/javascript">
|
||||
// Inicialize as tabelas deequipamentos
|
||||
function setupDataTable(tableSelector, tableType) { // Adiciona tableType como um parâmetro
|
||||
|
|
@ -454,71 +386,17 @@ function setupDataTable(tableSelector, tableType) { // Adiciona tableType como u
|
|||
$(document).ready(function() {
|
||||
setupDataTable('#TableListEquipmentInProject', 'normal');
|
||||
setupDataTable('#TableListEquipmentInProjectPendingsForApprove', 'pending');
|
||||
setupDataTable('#TableListOfCompletedProjectEquipment', 'completed');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Ja vai ser inicializado no card Equipamentos.
|
||||
|
||||
// $("#ViewEquipmentsButton").hide();
|
||||
// $("#CardViewTasks").hide();
|
||||
// $("#CardViewWorkstations").hide();
|
||||
// $("#CardViewDetails").hide();
|
||||
|
||||
//Visualizacao das Tarefas
|
||||
// $("#ViewTasksButton").on('click', function() {
|
||||
|
||||
// $("#CardViewTasks").show();
|
||||
// $("#ViewEquipmentsButton").show();
|
||||
// $("#ViewWorkstationButton").show();
|
||||
// $("#ViewDetailsButton").show();
|
||||
|
||||
// $("#CardViewDetails").hide();
|
||||
// $("#CardViewEquipments").hide();
|
||||
// $("#CardViewWorkstations").hide();
|
||||
// $("#ViewTasksButton").hide();
|
||||
// })
|
||||
|
||||
//Visualizacao dos Equipamentos
|
||||
// $("#ViewEquipmentsButton").on('click', function() {
|
||||
|
||||
// $("#CardViewEquipments").show();
|
||||
|
||||
// $("#ViewTasksButton").show();
|
||||
// $("#ViewWorkstationButton").show();
|
||||
// $("#ViewDetailsButton").show();
|
||||
|
||||
// $("#CardViewDetails").hide();
|
||||
// $("#CardViewTasks").hide();
|
||||
// $("#CardViewWorkstations").hide();
|
||||
// $("#ViewEquipmentsButton").hide();
|
||||
// })
|
||||
|
||||
//Visualizacao das Workstatios
|
||||
// $("#ViewWorkstationButton").on('click', function() {
|
||||
|
||||
// $("#CardViewWorkstations").show();
|
||||
|
||||
// $("#ViewEquipmentsButton").show();
|
||||
// $("#ViewTasksButton").show();
|
||||
// $("#ViewDetailsButton").show();
|
||||
|
||||
|
||||
// $("#CardViewDetails").hide();
|
||||
// $("#CardViewEquipments").hide();
|
||||
// $("#CardViewTasks").hide();
|
||||
// $("#ViewWorkstationButton").hide();
|
||||
// })
|
||||
// $("#CardViewWorkstations").hide();
|
||||
|
||||
// $("#ViewDetailsButton").on('click', function() {
|
||||
|
||||
|
|
@ -526,8 +404,8 @@ function setupDataTable(tableSelector, tableType) { // Adiciona tableType como u
|
|||
|
||||
// $("#ViewDetailsButton").hide();
|
||||
// $("#ViewEquipmentsButton").show();
|
||||
// $("#ViewTasksButton").show();
|
||||
// $("#ViewWorkstationButton").show();
|
||||
// $("#ViewTasksButton").show();
|
||||
|
||||
|
||||
// $("#CardViewWorkstations").hide();
|
||||
|
|
@ -535,6 +413,54 @@ function setupDataTable(tableSelector, tableType) { // Adiciona tableType como u
|
|||
// $("#CardViewTasks").hide();
|
||||
|
||||
// })
|
||||
|
||||
//Visualizacao dos Equipamentos
|
||||
// $("#ViewEquipmentsButton").on('click', function() {
|
||||
|
||||
// $("#CardViewEquipments").show();
|
||||
|
||||
// $("#ViewWorkstationButton").show();
|
||||
// $("#ViewDetailsButton").show();
|
||||
// $("#ViewTasksButton").show();
|
||||
|
||||
// $("#CardViewDetails").hide();
|
||||
// $("#CardViewWorkstations").hide();
|
||||
// $("#ViewEquipmentsButton").hide();
|
||||
// $("#CardViewTasks").hide();
|
||||
|
||||
// })
|
||||
|
||||
//Visualizacao das Tarefas
|
||||
// $("#ViewTasksButton").on('click', function() {
|
||||
|
||||
// // $("#CardViewTasks").show();
|
||||
// // $("#ViewEquipmentsButton").show();
|
||||
// // $("#ViewWorkstationButton").show();
|
||||
// // $("#ViewDetailsButton").show();
|
||||
|
||||
// $("#CardViewDetails").hide();
|
||||
// $("#CardViewEquipments").hide();
|
||||
// $("#CardViewWorkstations").hide();
|
||||
// $("#ViewTasksButton").hide();
|
||||
// })
|
||||
|
||||
//Visualizacao das Workstatios
|
||||
// $("#ViewWorkstationButton").on('click', function() {
|
||||
|
||||
// $("#CardViewWorkstations").show();
|
||||
|
||||
// $("#ViewEquipmentsButton").show();
|
||||
// $("#ViewDetailsButton").show();
|
||||
// $("#ViewTasksButton").show();
|
||||
|
||||
// $("#CardViewDetails").hide();
|
||||
// $("#CardViewEquipments").hide();
|
||||
// $("#ViewWorkstationButton").hide();
|
||||
// $("#CardViewTasks").hide();
|
||||
// })
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -51,7 +51,7 @@
|
|||
<h5 class="progress-description">{{ $project->company_project_description }}
|
||||
</h5>
|
||||
<div class="card-tools">
|
||||
<a href="{{ route('ExecutionProject', ['ProjectId' => $project->company_projects_id]) }}"
|
||||
<a href="{{ route('ExecutionProject', ['projectID' => $project->company_projects_id]) }}"
|
||||
class="btn btn-tool">
|
||||
<i class="fa-solid fa-eye" style="color:rgb(62, 62, 62)"></i>
|
||||
</a>
|
||||
|
|
@ -90,7 +90,7 @@ class="btn btn-tool">
|
|||
<h5 class="progress-description">{{ $project->company_project_description }}
|
||||
</h5>
|
||||
<div class="card-tools">
|
||||
<a href="{{ route('ExecutionProject', ['ProjectId' => $project->company_projects_id]) }}"
|
||||
<a href="{{ route('ExecutionProject', ['projectID' => $project->company_projects_id]) }}"
|
||||
class="btn btn-tool">
|
||||
<i class="fa-solid fa-eye" style="color:rgb(62, 62, 62)"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -18,22 +18,9 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6" id="buttonCreateAssets">
|
||||
<a href="#" type="button"
|
||||
class="btn btn-block bg-primary btn-lg">{{ __('messages.portfolio.change_buttons.create_assets') }}</a>
|
||||
</div>
|
||||
<div class="col-sm-6" id="buttonAssetsTable">
|
||||
<a href="#" type="button"
|
||||
class="btn btn-block bg-primary btn-lg">{{ __('messages.portfolio.change_buttons.asset_table') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<div class="card-light" id="cardAssetsTable">
|
||||
<div class="card card-primary" id="cardAssetsTable">
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{{ __('messages.portfolio.change_buttons.asset_table') }}</h3>
|
||||
|
|
@ -84,7 +71,6 @@ class="form-control">
|
|||
<table id="showProjectEquipment" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Tag</th>
|
||||
<th>Fabrica</th>
|
||||
<th>Tipo</th>
|
||||
|
|
@ -99,7 +85,6 @@ class="form-control">
|
|||
|
||||
</div>
|
||||
{{-- ./cardAssetsTable --}}
|
||||
</div>
|
||||
{{-- ./col-md-12 --}}
|
||||
</div>
|
||||
{{-- ./justify-content-center --}}
|
||||
|
|
@ -130,21 +115,18 @@ class="form-control">
|
|||
d.receiveEquipmentsType = $('#tipo_valvulasList').val();
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'equipment_id',
|
||||
name: 'equipment_id'
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
data: 'equipment_tag',
|
||||
name: 'equipment_tag'
|
||||
},
|
||||
{
|
||||
data: 'unit_id',
|
||||
name: 'unit_id'
|
||||
data: 'unit_name',
|
||||
name: 'unit_name'
|
||||
},
|
||||
{
|
||||
data: 'equipment_type_id',
|
||||
name: 'equipment_type_id'
|
||||
data: 'equipment_type_name',
|
||||
name: 'equipment_type_name'
|
||||
},
|
||||
{
|
||||
data: 'action',
|
||||
|
|
|
|||
|
|
@ -1070,6 +1070,54 @@ class="form-control card_inputs" id="crane"
|
|||
<!-- Card corpo do equipamento para onde vai receber as Tarefas elementares -->
|
||||
<div class="card-body">
|
||||
|
||||
<div class="card card-success collapsed-card">
|
||||
<div class="card-header clickable">
|
||||
<h3 class="card-title">Comentários sobre o Equipamento</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool collapse-button"
|
||||
data-card-widget="collapse"><i class="fas fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="chat-container" style="height: 250px; overflow-y: scroll; padding: 10px; background-color: #f9f9f9; border: 1px solid #ddd;">
|
||||
|
||||
<!-- Mensagens do Chat -->
|
||||
@foreach ($receiveComments as $receiveComment)
|
||||
<div class="chat-message {{ $receiveComment->type_users == 2 ? 'right' : 'left' }} mt-1">
|
||||
<div class="flex-shrink-1 bg-light rounded py-2 px-3 {{ $receiveComment->type_users == 2 ? 'mr-3' : 'ml-3' }}" style="border: 1px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.1);">
|
||||
<div class="font-weight-bold mb-1">{{ $receiveComment->user->user_name }} <b>({{ $receiveComment->user->userType->type_user}})</b> </div>
|
||||
<p style="color:black">{{ $receiveComment->comment }}</p>
|
||||
<div class="text-muted small text-nowrap mt-2">
|
||||
{{ $receiveComment->creation_date}} ( {{ \Carbon\Carbon::parse($receiveComment->creation_date)->diffForHumans() }})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Área de envio de nova mensagem -->
|
||||
<div class="mt-3">
|
||||
<form action="{{route('createComment')}}" method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="projectID" value="{{$receiveDataEquipment->company_projects_id}}">
|
||||
<input type="hidden" name="equipmentID" value="{{$dataControlEquipment->equipmentWorkHistorys_id}}">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comment" class="form-label">Comentário</label>
|
||||
<textarea class="form-control" id="comment" name="comment" rows="3" required placeholder="Digite aqui suas observações ou comentário..."></textarea>
|
||||
</div>
|
||||
<button class="btn btn-success float-right" type="submit">Enviar</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('cancelElementalTaskForEquipment', ['controlEquipmentID' => $dataControlEquipment->control_equipment_workstation_id]) }}"
|
||||
method="get">
|
||||
<div class="card-footer">
|
||||
|
|
@ -1143,7 +1191,7 @@ class="btn btn-danger float-right" style="background-color: red">Finalizar Açõ
|
|||
|
||||
<!-- Conformidade da etiqueta -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6 icheck-primary">
|
||||
{{-- <div class="col-md-6 icheck-primary">
|
||||
<input id="ID1[confirm_label_compliance-checkbox]" type="checkbox"
|
||||
name="ID1[confirm_label_compliance-checkbox]"
|
||||
@if (isset($task_todo->formatted_answers['confirm_label_compliance']) &&
|
||||
|
|
@ -1151,7 +1199,7 @@ class="btn btn-danger float-right" style="background-color: red">Finalizar Açõ
|
|||
@if ($task_todo->cardTypeStyle == 'gray') disabled @endif required>
|
||||
<label for="ID1[confirm_label_compliance-checkbox]">Conformidade da
|
||||
etiqueta <span style="color: red;">*</span></label>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div> <!-- ./ Conformidade da etiqueta -->
|
||||
|
||||
<!-- Tipo de junta existente -->
|
||||
|
|
@ -6792,7 +6840,7 @@ class="btn btn-primary float-right">Guardar</button>
|
|||
|
||||
<!-- Conformidade da etiqueta -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6 icheck-primary">
|
||||
{{-- <div class="col-md-6 icheck-primary">
|
||||
<input id="ID15[confirm_label_compliance-checkbox]"
|
||||
type="checkbox"
|
||||
name="ID15[confirm_label_compliance-checkbox]"
|
||||
|
|
@ -6802,7 +6850,7 @@ class="btn btn-primary float-right">Guardar</button>
|
|||
<label for="ID15[confirm_label_compliance-checkbox]">
|
||||
Conformidade da etiqueta <span style="color: red;">*</span>
|
||||
</label>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
<!-- ./ Conformidade da etiqueta -->
|
||||
|
||||
|
|
@ -6892,7 +6940,7 @@ class="btn btn-primary float-right">Guardar</button>
|
|||
|
||||
<!-- Conformidade da etiqueta -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6 icheck-primary">
|
||||
{{-- <div class="col-md-6 icheck-primary">
|
||||
<input id="ID16[confirm_label_compliance-checkbox]"
|
||||
type="checkbox"
|
||||
name="ID16[confirm_label_compliance-checkbox]"
|
||||
|
|
@ -6902,7 +6950,7 @@ class="btn btn-primary float-right">Guardar</button>
|
|||
<label for="ID16[confirm_label_compliance-checkbox]">
|
||||
Conformidade da etiqueta <span style="color: red;">*</span>
|
||||
</label>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
<!-- ./ Conformidade da etiqueta -->
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
Route::get('showAllClientsForProjectReportsTable', [ProjectoDatacontroller::class, 'showAllClientsForProjectReportsTable'])->name('showAllClientsForProjectReportsTable');
|
||||
Route::post('changeEquipmentStatusOnProject',[ProjectoDatacontroller::class,'changeEquipmentStatusOnProject'])->name('changeEquipmentStatusOnProject');
|
||||
|
||||
Route::post('createComment',[ProjectoDatacontroller::class,'createComment'])->name('createComment');
|
||||
|
||||
Route::get('cancelElementalTaskForEquipment/{controlEquipmentID}', [WorkstationsJobsController::class, 'cancelElementalTaskForEquipment'])->name('cancelElementalTaskForEquipment');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user