ispt4.0_laravel/resources/views/projectsClients/preparedProject.blade.php

1222 lines
60 KiB
PHP

@extends('Templates/templateAdmin')
@section('Main-content')
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{ $numberProject->company_project_description }}</h1>
{{-- <input type="hidden" value="{{$numberProject->company_projects_id}}" id="receiveNumberProject"> --}}
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
<li class="breadcrumb-item"><a href="./preparadas.html">Preparadas</a></li>
<li class="breadcrumb-item active">{{ $numberProject->company_project_description }}</li>
</ol>
</div><!-- /.col -->
</div>
</div><!-- /.container-fluid -->
</section>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-12">
<!-- Card box criar instalção -->
<form>
<div class="row">
<div class="col-sm-6" id="BotaoDetalhesObra">
<a href="#" type="button" class="btn btn-block bg-gradient-primary btn-lg">Detalhes
da Obra</a>
</div>
<div class="col-sm-6" id="BotaoArticulado">
<a href="#" type="button"
class="btn btn-block bg-gradient-primary btn-lg">Articulado</a>
</div>
<div class="col-sm-6" id="BotaoPostosDeTrabalho">
<a href="#" type="button" class="btn btn-block bg-gradient-primary btn-lg">Postos de
Trabalho</a>
</div>
</div>
<br><br>
<div class="card card-primary" id="CardDetalhesObra">
<div class="card-header">
<h3 class="card-title">Detalhes da Obra</h3>
<div class="card-tools">
</div>
<!-- /.card-tools -->
</div>
<!-- /.card-header -->
<div class="card-body p-0">
<table class="table table-striped text-center">
<tbody>
<tr>
<td>Descrição da obra:</td>
<td>{{ $numberProject->company_project_description }}</td>
</tr>
<tr>
<td>N.ºobra ISPT:</td>
<td>{{ $numberProject->project_ispt_number }}</td>
</tr>
<tr>
<td>Resp.ISPT:</td>
<td>{{ $numberProject->project_ispt_responsible }}</td>
</tr>
<tr>
<td>Cliente :</td>
<td>Cliente1</td>
</tr>
<tr>
<td>N.ºobra Cliente :</td>
<td>{{ $numberProject->project_company_number }}</td>
</tr>
<tr>
<td>Resp.Cliente:</td>
<td>{{ $numberProject->project_company_responsible }}</td>
</tr>
<tr>
<td>Data de Inicio :</td>
<td>{{ $numberProject->date_started }}</td>
</tr>
</tbody>
</table>
</div>
<!-- /.card-body -->
<div class="card-footer">
<div class="float-right">
{{-- <a href="#" type="button" class="btn btn-primary">Editar</a> --}}
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target="#ModalTransferForArticulated">
Editar
</button>
</div>
</div>
</div>
<!-- /.card -->
</form>
<!-- /.Card box criar instalção -->
<!-- Card box criar equipamentos -->
<form>
<!-- Articulado -->
<div class="card card-primary" id="CardArticuladoObra">
<div class="card-header">
<h3 class="card-title">Articulado</h3>
<div class="card-tools">
<!-- <button type="button" class="btn btn-tool" data-card-widget="collapse"><i
class="fas fa-plus"></i>
</button> -->
</div>
<!-- /.card-tools -->
</div>
<!-- /.card-header -->
<div class="card-body">
<!-- Table articulado de obra -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Equipamentos da obra</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="table-responsive">
<div class="row text-center">
<div class="form-group col-sm-3">
<label>Tipo de Equipamento </label>
<select id="tipo_valvulasList" name="equipmentTypeId"
class="form-control">
<option value='#' selected>Mostrar Todos</option>
@foreach ($equipmentsTypes as $equipmentsType)
<option value="{{ $equipmentsType->equipment_type_id }}">
{{ $equipmentsType->equipment_type_name }}</option>
@endforeach
</select>
</div>
<div class="col-sm-3">
<div class="form-group">
<label> Fabricas </label>
<select id="UnitsList" class="form-control">
<option value='#' selected>Mostrar Todos</option>
@foreach ($units as $unit)
<option value="{{ $unit->unit_id }}">
{{ $unit->unit_name }}</option>
@endforeach
</select>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Ambitos </label>
<select class="form-control" name="EquipmentAmbit"
id="AmbitsEquipments_list" required>
<option value="#" hidden>Mostrar Todos</option>
</select>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Inspeção de Equipamentos </label>
<select id="inspecValvula" class="form-control">
<option value="#">Mostrar Todos</option>
<option value="Sim">Sim </option>
<option value="Nao">Nao </option>
</select>
</div>
</div>
</div>
<br>
<table id="myTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Tag</th>
<th>Tipo Equipamento</th>
<th>Fabrica</th>
<th>Ambito</th>
<th>Inspecionar</th>
</tr>
</thead>
</table>
<!-- /. Table-->
</div>
<!--/table obra-->
</div>
<!-- /.card-body -->
<div class="card-footer">
<div class="float-right">
{{-- <a href="#" type="button" class="btn btn-primary">Editar</a> --}}
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target="#ModalTransferForArticulated">
Editar
</button>
</div>
</div>
</div>
<!-- ./card -->
</div>
{{-- card-body --}}
<!-- TEM DE TER FOOTER -->
</div>
<!--/.CardArticuladoObra -->
</form>
<!-- /.card -->
<!-- /.Card box criar equipamentos -->
<form>
<div class="card card-primary" id="CardPostosDeTrabalhoObra">
<div class="card-header">
<h3 class="card-title">Postos de Trabalho</h3>
<div class="card-tools">
<!-- <button type="button" class="btn btn-tool" data-card-widget="collapse">
<i class="fas fa-plus"></i>
</button> -->
</div>
<!-- /.card-tools -->
</div>
<!-- /.card-header -->
<div class="card-body">
<!-- Criar tarefa -->
<div class="card card-primary collapsed-card">
<!-- /.card-header -->
<div class="card-body">
<div class="card ">
<div class="form-group col-md-12">
<div class="card">
<div class="form-group">
<label>Selecione o Numero de Postos Pretendidos :
</label>
<input class="form-control" type="number" id="numberPosts">
</div>
</div>
<!-- <p id="receiveNumberPosts"></p> -->
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Postos de Trabalho</th>
</tr>
</thead>
<tbody id="receiveNumberPosts">
<!-- Vai receber o Numero de Oficinas -->
</tbody>
</table>
</div>
</div>
</div>
<!-- /.card-body -->
</div>
<!--/Criar tarefa-->
<div class="card">
<div class="card-header">
<h3 class="card-title">Listas de Postos de Obra</h3>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="example3" class="table table-bordered table-striped">
<thead>
<tr>
<th>Postos de Trabalho</th>
<th>Tarefas Elementares</th>
<th>Tarefas Complementares</th>
</tr>
</thead>
<tbody>
<tr>
<td>workstation1-69</td>
<td>TE2 - TE5 - TE11 - </td>
<td>TC1 - </td>
</tr>
<tr>
<td>workstation2-69</td>
<td>TE1 - TE2 - TE6 - </td>
<td></td>
</tr>
</tbody>
</table>
</div>
<!--/articulado de obra-->
</div>
<!-- /.card-body -->
<div class="card-footer">
<div class="float-right">
{{-- <a href="#" type="button" class="btn btn-primary">Editar</a> --}}
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target="#ModalTransferForArticulated">
Editar
</button>
</div>
</div>
</div>
<!-- modal Remover -->
<div class="modal fade" id="modal-ViewOfices">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header bg-primary">
<h4 class="modal-title">Posto de Trabalho X</h4>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">x</span>
</button>
</div>
<div class="modal-body">
<section class="content">
<div class="container-fluid">
<div class="row text-center">
<div class="col-sm-6">
<div class="card card-success">
<div class="card-header">
<h3 class="card-title">
Tarefas Elementares PSV</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool"
data-card-widget="collapse"><i
class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body">
<!-- Tabela de Checkbox -->
<div>
<p>TE1 - Desmontar da linha
<input type="checkbox"
class="checkboxChoseTasksOficesPSV"
value="TE1">
</p>
<p>TE2 - Descontaminar
<input type="checkbox"
class="checkboxChoseTasksOficesPSV"
value="TE2" checked>
</p>
<p>TE3 - Pré-teste
<input type="checkbox"
class="checkboxChoseTasksOficesPSV"
value="TE3">
</p>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">
Tarefas Elementares ISV</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool"
data-card-widget="collapse"><i
class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body">
<!-- Tabela de Checkbox -->
<div>
<p>TE1 - Desmontar da linha
<input type="checkbox"
class="checkboxChoseTasksOficesISV"
value="TE1">
</p>
<p>TE2 - Descontaminar
<input type="checkbox"
class="checkboxChoseTasksOficesISV"
value="TE2">
</p>
<p>TE5 - Limpeza e lavagem
dos componentes
<input type="checkbox"
class="checkboxChoseTasksOficesISV"
value="TE5">
</p>
</div>
</div>
</div>
</div>
<!-- Divisória Para Metade -->
<div class="col-sm-6">
<div class="card card-warning">
<div class="card-header">
<h3 class="card-title">
Tarefas Elementares CV</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool"
data-card-widget="collapse"><i
class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body">
<!-- Tabela de Checkbox -->
<div>
<p>TE12 - Inspeção visual
<input type="checkbox"
class="checkboxChoseTasksOficesCV"
value="TE12" checked>
</p>
<p>TE1 - Desmontar da linha
<input type="checkbox"
class="checkboxChoseTasksOficesCV"
value="TE1">
</p>
<p>TE14 - Ensaio
<input type="checkbox"
class="checkboxChoseTasksOficesCV"
value="TE14">
</p>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card card-info collapsed-card">
<div class="card-header">
<h3 class="card-title">
Outras Tarefas</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool"
data-card-widget="collapse">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<div class="card-body">
<!-- Tabela de Checkbox -->
<div>
<p>TE1 - Desmontar da linha
<input type="checkbox" id="">
</p>
<p>TE12 - Inspeção visual
<input type="checkbox" id="">
</p>
<p>TE14 - Ensaio
<input type="checkbox" id="">
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Tabelas das Tarefas selecionadas -->
<div class="card">
<h3>Tarefas Selecionadas para o Postos X:</h3>
<div class="row">
<div class="col-sm-4 text-center"
id="ReceiveCheckboxChoseTasksOficesPSV">
</div>
<div class="col-sm-4 text-center"
id="ReceiveCheckboxChoseTasksOficesCV">
</div>
<div class="col-sm-4 text-center"
id="ReceiveCheckboxChoseTasksOficesISV">
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<!-- Vai ficar o Footer -->
<button class="btn btn-danger">Cancelar</button>
<button class="btn btn-primary">Guardar</button>
</div>
</div>
<!-- /.modal-content --
/.modal-dialog -->
</div>
<!-- /.modal remover-->
</div>
<!-- /.Modal, Postos de Trabalho -->
</div>
<!-- /.card -->
</div>
<!-- /.card-body -->
</form>
</div>
</div>
</div>
</section>
<!-- ./content -->
<!-- Modal -->
<div class="modal fade" id="ModalTransferForArticulated" tabindex="-1" role="dialog"
aria-labelledby="ModalTransferForArticulated" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="ModalTransferForArticulatedLabel">Mudar Projeto para Articulado</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<P>Para Editar uma obra Preparada, a obra ira Voltar para o articulado, Deseja Editar ?</P>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
<form action="{{ route('EditProjectForArticulated') }}" method="get">
@csrf
<input type="hidden" name="ProjectId" value="{{ $numberProject->company_projects_id }}">
<button type="submit" class="btn btn-primary">Editar</button>
</form>
</div>
</div>
</div>
</div>
@endsection
{{-- Scripts --}}
@section('scriptsTemplateAdmin')
<script>
$(document).ready(function() {
$('#tipo_valvulasList').on('change', function() {
var equipmentTypeID = $(this).val();
if (equipmentTypeID) {
$.ajax({
url: '/api/ambits/prepared' + equipmentTypeID,
type: 'GET',
success: function(data) {
$('#AmbitsEquipments_list').empty(); // Limpar o select de ambits
$('#AmbitsEquipments_list').append(
'<option value="#" selected>Mostrar Todos</option>'
); // Opção para mostrar todos
$('#AmbitsEquipments_list').append(
'<option value="" hidden>Selecionar Tipo de Ambito...</option>'
);
$.each(data, function(key, value) {
$('#AmbitsEquipments_list').append('<option value="' +
value.ambits_id + '">' + value
.ambits_description + '</option>');
});
}
});
} else {
$('#AmbitsEquipments_list')
.empty(); // Limpar o select de ambits se não há tipo de equipamento selecionado
$('#AmbitsEquipments_list').append(
'<option value="#" hidden>Mostrar Todos</option>');
}
});
});
</script>
<script>
$(document).ready(function() {
$('#myTable').DataTable({
processing: true,
serverSide: true,
ajax: {
url: "{{ route('getData') }}",
data: function(d) {
// Adiciona o 'equipment_type_id' selecionado aos parâmetros da solicitação
d.equipment_type_id = $('#tipo_valvulasList').val();
d.unit_id = $('#UnitsList').val();
d.ambits_id = $('#AmbitsEquipments_list').val();
d.inspec = $('#inspecValvula').val();
},
},
columns: [{
data: 'equipment_tag',
name: 'equipment_tag'
},
{
data: 'equipment_type',
name: 'equipment_type'
},
{
data: 'Unit',
name: 'Unit'
},
{
data: 'Ambits',
name: 'Ambits'
},
{
data: 'Inspec',
name: 'Inspec'
},
],
rowId: 'equipment_id'
});
// Scripts para que com base no recebido , ele atualiza a pagina automaticamente
$('#tipo_valvulasList').on('change', function() {
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
$('#myTable').DataTable().ajax.reload();
});
$('#UnitsList').on('change', function() {
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
$('#myTable').DataTable().ajax.reload();
});
$('#AmbitsEquipments_list').on('change', function() {
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
$('#myTable').DataTable().ajax.reload();
});
$('#inspecValvula').on('change', function() {
// Atualiza a tabela quando o valor selecionado no select de tipo de válvulas for alterado
$('#myTable').DataTable().ajax.reload();
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
//Cards das div : Destricao - Articulado - Postos de Trabalho
// ******** Estrutura do Layout da Página :
// $("#CardDetalhesObra").hide();
$("#CardArticuladoObra").hide();
$("#CardPostosDeTrabalhoObra").hide();
//Botoes : Destricao - Articulado - Postos de Trabalho
$('#BotaoDetalhesObra').hide();
// $('#BotaoArticulado').hide();
// $('BotaoPostosDeTrabalho').hide();
$('#BotaoArticulado').on('click', function() {
// Mostra o Card do Articulado e o Botao de detalhes
$('#CardArticuladoObra').show();
$("#BotaoDetalhesObra").show();
$('#BotaoPostosDeTrabalho').show();
$('#BotaoArticulado').hide();
$("#CardPostosDeTrabalhoObra").hide();
$("#CardDetalhesObra").hide();
});
$('#BotaoDetalhesObra').on('click', function() {
// Mostra o Card do Articulado e o Botao de detalhes
$('#CardDetalhesObra').show();
$("#BotaoArticulado").show();
$('#BotaoPostosDeTrabalho').show();
$('#BotaoDetalhesObra').hide();
$("#CardPostosDeTrabalhoObra").hide();
$("#CardArticuladoObra").hide();
});
$('#BotaoPostosDeTrabalho').on('click', function() {
// Mostra o Card do Articulado e o Botao de detalhes
$('#CardPostosDeTrabalhoObra').show();
$("#BotaoArticulado").show();
$("#BotaoDetalhesObra").show();
$('#BotaoPostosDeTrabalho').hide();
$("#CardDetalhesObra").hide();
$("#CardArticuladoObra").hide();
});
// A Propriedade do Botao começa desabilitada
// Chamamos os 3 selects e verificamos
$("#tipo_valvulasList").change(function() {
var tipo_valvulas = $("#tipo_valvulasList").val();
// will show the scopes of each valve according to the selection of the type field in "create a new task"
if (tipo_valvulas == "PSV") {
$("#Val_PSV").show();
} else {
$("#Val_PSV").hide();
}
if (tipo_valvulas == "ISV") {
$("#Val_ISV").show();
} else {
$("#Val_ISV").hide();
}
if (tipo_valvulas == "CV") {
$("#Val_CV").show();
} else {
$("#Val_CV").hide();
}
if (tipo_valvulas == "Init") {
$("#DivAmbitos").show();
} else {
$("#DivAmbitos").hide();
}
})
// Tabelas de cada Valvula
$("#Val_PSV").hide();
$("#Val_ISV").hide();
$("#Val_CV").hide();
// Ambitos de PSV
$("#boxPSVSubs").hide();
$("#boxPSVCalib").hide();
$("#boxPSVRep_Local").hide();
$("#boxPSVRep_Oficina").hide();
// Ambitos de ISV
$("#boxISVRep_Local").hide();
$("#boxISVRep_Oficina").hide();
$("#boxISVSubs").hide();
$("#boxISVEmpan").hide();
$("#boxISVTestPress").hide();
// Ambitos de CV
$("#Amb_Oficina_Val_CV").hide();
$("#Amb_local_Val_CV").hide();
// Ambitos de CV Local
$("#boxCVLocalBenef_tip1").hide();
$("#boxCVLocalBenef_tip2B").hide();
// A Propriedade do Botao começa desabilitada
// Chamamos os 3 selects e verificamos
$("#tipo_valvulas").change(function() {
var tipo_valvulas = $("#tipo_valvulas").val();
if (tipo_valvulas == "PSV") {
$("#Val_PSV").show();
} else {
$("#Val_PSV").hide();
}
if (tipo_valvulas == "ISV") {
$("#Val_ISV").show();
} else {
$("#Val_ISV").hide();
}
if (tipo_valvulas == "CV") {
$("#Val_CV").show();
} else {
$("#Val_CV").hide();
}
})
// **** Para uma lista de tarefas elementares pre selecionadas de acordo com o ambito
$("#selectPSV").change(function() {
var Amb_PSV = $('#selectPSV').val();
if (Amb_PSV == "Subs") {
$("#boxPSVSubs").show();
} else {
$("#boxPSVSubs").hide();
}
if (Amb_PSV == "Calib") {
$("#boxPSVCalib").show();
} else {
$("#boxPSVCalib").hide();
}
if (Amb_PSV == "Rep_Local") {
$("#boxPSVRep_Local").show();
} else {
$("#boxPSVRep_Local").hide();
}
if (Amb_PSV == "Rep_Oficina") {
$("#boxPSVRep_Oficina").show();
} else {
$("#boxPSVRep_Oficina").hide();
}
})
// **** Para uma lista de tarefas elementares pre selecionadas de acordo com o ambito
$("#selectISV").change(function() {
var Amb_ISV = $('#selectISV').val();
if (Amb_ISV == "Rep_Local") {
$("#boxISVRep_Local").show();
} else {
$("#boxISVRep_Local").hide();
}
if (Amb_ISV == "Rep_Oficina") {
$("#boxISVRep_Oficina").show();
} else {
$("#boxISVRep_Oficina").hide();
}
if (Amb_ISV == "Subs") {
$("#boxISVSubs").show();
} else {
$("#boxISVSubs").hide();
}
if (Amb_ISV == "Empan") {
$("#boxISVEmpan").show();
} else {
$("#boxISVEmpan").hide();
}
if (Amb_ISV == "TestPress") {
$("#boxISVTestPress").show();
} else {
$("#boxISVTestPress").hide();
}
})
// **** Para uma lista de tarefas elementares pre selecionadas de acordo com o ambito
$("#selectCV").change(function() {
var Amb_CV = $('#selectCV').val();
if (Amb_CV == "Amb_Local") {
$("#Amb_local_Val_CV").show();
} else {
$("#Amb_local_Val_CV").hide();
}
if (Amb_CV == "Amb_Ofice") {
$("#Amb_Oficina_Val_CV").show();
} else {
$("#Amb_Oficina_Val_CV").hide();
}
})
// Ambitos locais, válvulas CV
$("#select_amb_local_CV").change(function() {
var Amb_CV_Local = $('#select_amb_local_CV').val();
if (Amb_CV_Local == "Benef_tip1") {
$("#boxCVLocalBenef_tip1").show();
} else {
$("#boxCVLocalBenef_tip1").hide();
}
if (Amb_CV_Local == "Benef_tip2B") {
$("#boxCVLocalBenef_tip2B").show();
} else {
$("#boxCVLocalBenef_tip2B").hide();
}
})
// Ambitos oficina, válvulas CV
$("#Amb_Oficina_Val_CV").change(function() {
var Amb_CVOficina = $('#Amb_Oficina_Val_CV').val();
if (Amb_CVOficina == "Benef_tip1") {
$("#boxCVLocalBenef_tip1").show();
} else {
$("#boxCVLocalBenef_tip1").hide();
}
if (Amb_CVOficina == "Benef_tip2B") {
$("#boxCVLocalBenef_tip2B").show();
} else {
$("#boxCVLocalBenef_tip2B").hide();
}
})
// Funcao onde recebemos os valores que esta em check nas tarefas elementares
updateValues_PSV_Subs();
$('.checkbox_PSV_Subs').change(updateValues_PSV_Subs);
updateValues_Inspec_PSV_Subs();
$('.checkbox_Inspec_PSV_Subs').change(updateValues_Inspec_PSV_Subs);
// Funções das tarefas dos Postos
updateTasksOfcicesCV();
$('.checkboxChoseTasksOficesCV').change(updateTasksOfcicesCV);
updateTasksOfcicesPSV();
$('.checkboxChoseTasksOficesPSV').change(updateTasksOfcicesPSV);
updateTasksOfcicesISV();
$('.checkboxChoseTasksOficesISV').change(updateTasksOfcicesISV);
})
function updateValues_PSV_Subs() {
var Values_PSV_Subs = [];
$('.checkbox_PSV_Subs:checked').each(function() {
Values_PSV_Subs.push($(this).val())
});
var list = "<ul>";
for (var i = 0; i < Values_PSV_Subs.length; i++) {
list += "<li>" + Values_PSV_Subs[i] + "</li>";
}
// Valor para a lista nao ordenada das tarefas selecionadas
$("#receiveValues_PSV_Subs").html(list);
// Valor para o campo de "Inspecionar"
$("#receiveValues_Inspec_PSV_Subs").val()
// $("#receiveValues_PSV_Subs").text(Values_PSV_Subs.join('<br>'));
}
function updateValues_Inspec_PSV_Subs() {
var receiveValuesInspec = [];
var list = [];
$('.checkbox_Inspec_PSV_Subs:checked').each(function() {
receiveValuesInspec.push($(this).val())
});
for (var i = 1; i <= receiveValuesInspec.length; i++) {
list = i;
}
$('#receiveValues_Inspec_PSV_Subs').val(list);
}
// Atualizar os valores
function updateTasksOfcicesCV() {
var receivetasksOfices = [];
// Para criar uma lista, só funciona se for "Classe" na Checkbox!!
$('.checkboxChoseTasksOficesCV:checked').each(function() {
receivetasksOfices.push($(this).val())
});
var list;
if (receivetasksOfices.length == 0) {
list = "";
} else {
list = "<h4>Válvula CV</h4><ul>";
}
for (var i = 0; i < receivetasksOfices.length; i++) {
list += "<li style='list-style:none'>" + receivetasksOfices[i] + "</li>";
}
$("#ReceiveCheckboxChoseTasksOficesCV").html(list);
}
function updateTasksOfcicesPSV() {
var receivetasksOfices = [];
// Para criar uma lista, só funciona se for "Classe" na Checkbox!!
$('.checkboxChoseTasksOficesPSV:checked').each(function() {
receivetasksOfices.push($(this).val())
});
var list;
if (receivetasksOfices.length == 0) {
list = "";
} else {
list = "<h4>Válvula PSV</h4><ul>";
}
for (var i = 0; i < receivetasksOfices.length; i++) {
list += "<li style='list-style:none'>" + receivetasksOfices[i] + "</li>";
}
$("#ReceiveCheckboxChoseTasksOficesPSV").html(list);
}
function updateTasksOfcicesISV() {
var receivetasksOfices = [];
// Para criar uma lista, só funciona se for "Classe" na Checkbox!!
$('.checkboxChoseTasksOficesISV:checked').each(function() {
receivetasksOfices.push($(this).val())
});
var list;
if (receivetasksOfices.length == 0) {
list = "";
} else {
list = "<h4>Válvula ISV</h4><ul>";
}
for (var i = 0; i < receivetasksOfices.length; i++) {
list += "<li style='list-style:none'>" + receivetasksOfices[i] + "</li>";
}
$("#ReceiveCheckboxChoseTasksOficesISV").html(list);
}
</script>
<script>
// $(document).ready(function () {
// $("input#numberPosts").on("input", function () {
// var num = parseInt($(this).val());
// var table = "<table><tbody>";
// for (var i = 1; i <= num; i++) {
// table += "<tr><td>" + i + "</td></tr>";
// }
// table += "</tbody></table>";
// $("#receiveNumberPosts").html(table);
// });
// });
$(document).ready(function() {
$("#numberPosts").on("input", function() {
var num = parseInt($(this).val());
var tablePosts = "<tr>";
var AddHTML =
"<th style='text-align: center;'><a href='#' data-toggle='modal' data-target='#modal-ViewOfices'><i class='fa-solid fa-eye text-secondary'></i></a></th>";
for (var i = 1; i <= num; i++) {
// Limitar o numero de postos
if (num >= 30) {
num = 30;
}
tablePosts += "<th>" + "Posto" + i + "</th>" + AddHTML + "</tr>";
}
$("#receiveNumberPosts").html(tablePosts);
});
});
</script>
<script src="dist/js/pages/dashboard.js"></script>
<script>
$(function() {
$('#description').hide();
$('#description2').hide();
$('#checkboxPrimary1').change(function() {
if ($('#checkboxPrimary1').is(':checked')) {
$('#description').fadeIn();
} else {
$('#description').hide();
}
});
$('#checkboxPrimary2').change(function() {
if ($('#checkboxPrimary2').is(':checked')) {
$('#description2').fadeIn();
} else {
$('#description2').hide();
}
});
});
</script>
<script>
$(function() {
$('input[name="daterange"]').daterangepicker({
opens: 'right'
}, function(start, end, label) {
console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end
.format('YYYY-MM-DD'));
});
});
</script>
<script>
$(function() {
// Copy e CSV... Secção do Detalhes da Obra
$("#example1").DataTable({
"responsive": true,
"lengthChange": false,
"autoWidth": false,
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
// Copy e CSV... Secção do Detalhes da Obra
$("#example2").DataTable({
"responsive": true,
"lengthChange": false,
"autoWidth": false,
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#example2_wrapper .col-md-6:eq(0)');
$("#example3").DataTable({
"responsive": true,
"lengthChange": false,
"autoWidth": false,
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#example3_wrapper .col-md-6:eq(0)');
});
</script>
<script>
$(function() {
//Datemask dd/mm/yyyy
$('#datemask').inputmask('dd/mm/yyyy', {
'placeholder': 'dd/mm/yyyy'
})
//Datemask2 mm/dd/yyyy
$('#datemask2').inputmask('mm/dd/yyyy', {
'placeholder': 'mm/dd/yyyy'
})
//Money Euro
$('[data-mask]').inputmask()
//Date picker
$('#reservationdate').datetimepicker({
format: 'L'
});
//Date and time picker
$('#reservationdatetime').datetimepicker({
icons: {
time: 'far fa-clock'
}
});
//Date range picker
$('#reservation').daterangepicker()
//Date range picker with time picker
$('#reservationtime').daterangepicker({
timePicker: true,
timePickerIncrement: 30,
locale: {
format: 'MM/DD/YYYY hh:mm A'
}
})
//Date range as a button
$('#daterange-btn').daterangepicker({
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1,
'month').endOf('month')]
},
startDate: moment().subtract(29, 'days'),
endDate: moment()
},
function(start, end) {
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format(
'MMMM D, YYYY'))
}
)
//Timepicker
$('#timepicker').datetimepicker({
format: 'LT'
})
//Bootstrap Duallistbox
$('.duallistbox').bootstrapDualListbox()
//Colorpicker
$('.my-colorpicker1').colorpicker()
//color picker with addon
$('.my-colorpicker2').colorpicker()
$('.my-colorpicker2').on('colorpickerChange', function(event) {
$('.my-colorpicker2 .fa-square').css('color', event.color.toString());
})
$("input[data-bootstrap-switch]").each(function() {
$(this).bootstrapSwitch('state', $(this).prop('checked'));
})
})
// BS-Stepper Init
document.addEventListener('DOMContentLoaded', function() {
window.stepper = new Stepper(document.querySelector('.bs-stepper'))
})
// DropzoneJS Demo Code Start
Dropzone.autoDiscover = false
// Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument
var previewNode = document.querySelector("#template")
previewNode.id = ""
var previewTemplate = previewNode.parentNode.innerHTML
previewNode.parentNode.removeChild(previewNode)
var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone
url: "/target-url", // Set the url
thumbnailWidth: 80,
thumbnailHeight: 80,
parallelUploads: 20,
previewTemplate: previewTemplate,
autoQueue: false, // Make sure the files aren't queued until manually added
previewsContainer: "#previews", // Define the container to display the previews
clickable: ".fileinput-button" // Define the element that should be used as click trigger to select files.
})
myDropzone.on("addedfile", function(file) {
// Hookup the start button
file.previewElement.querySelector(".start").onclick = function() {
myDropzone.enqueueFile(file)
}
})
// Update the total progress bar
myDropzone.on("totaluploadprogress", function(progress) {
document.querySelector("#total-progress .progress-bar").style.width = progress + "%"
})
myDropzone.on("sending", function(file) {
// Show the total progress bar when upload starts
document.querySelector("#total-progress").style.opacity = "1"
// And disable the start button
file.previewElement.querySelector(".start").setAttribute("disabled", "disabled")
})
// Hide the total progress bar when nothing's uploading anymore
myDropzone.on("queuecomplete", function(progress) {
document.querySelector("#total-progress").style.opacity = "0"
})
// Setup the buttons for all transfers
// The "add files" button doesn't need to be setup because the config
// `clickable` has already been specified.
document.querySelector("#actions .start").onclick = function() {
myDropzone.enqueueFiles(myDropzone.getFilesWithStatus(Dropzone.ADDED))
}
document.querySelector("#actions .cancel").onclick = function() {
myDropzone.removeAllFiles(true)
}
// DropzoneJS Demo Code End
</script>
@endsection