Commit bdb5d654 authored by Yuri Resende's avatar Yuri Resende
Browse files

Front da edição de projetos submetidos. Integrando a parte de integrantes e participantes

parent bed68413
...@@ -1265,7 +1265,7 @@ class TrabalhoController extends Controller ...@@ -1265,7 +1265,7 @@ class TrabalhoController extends Controller
$participante->save(); $participante->save();
if ($request->has('anexoPlanoTrabalho')) { if ($request->has('anexoPlanoTrabalho')) {
dd("plano de trabalho"); // dd("plano de trabalho");
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/'; $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/';
$nome = $data['nomePlanoTrabalho'] . ".pdf"; $nome = $data['nomePlanoTrabalho'] . ".pdf";
$file = $request->anexoPlanoTrabalho[$part]; $file = $request->anexoPlanoTrabalho[$part];
......
...@@ -14,15 +14,16 @@ ...@@ -14,15 +14,16 @@
</div> </div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6">
<div class="row" id="integrante"> <div class="row" id="integrante" style="display:none">
</div> </div>
@include('projeto.editaFormulario.participantes')
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="modalIntegrante" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="modalIntegrante" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl"> <div class="modal-dialog modal-dialog-centered modal-sm">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5> <h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5>
...@@ -31,24 +32,38 @@ ...@@ -31,24 +32,38 @@
</button> </button>
</div> </div>
<div class="form-row" style="padding: 30px;"> <div class="container">
<div class="col-md-8"> <div class="row justify-content-center" style="padding-left:35px; padding-right:45px">
<label for="cpf_consulta">CPF:</label>
<input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();"> <div class="form-controll" style="margin-left:10px; margin-top:10px; margin-bottom:15px; font-weight:bold;">
</div>
<div class="col-md-4 mt-4"> <div class="form-row d-flex">
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button> <label for="cpf_consulta">CPF:</label>
<input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();">
</div>
<div class="form-row d-flex" style="margin-top:10px">
<label for="funcao_participante">Função do Integrante:</label>
<select name="" id="funcao_participante" class="form-control">
@foreach($funcaoParticipantes as $funcao)
@if($funcao->nome != 'Bolsista')
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@elseif($edital->tipo != "CONTINUO")
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endif
@endforeach
</select>
</div>
<div class="form-row justify-content-center" style="margin-top:20px;">
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button>
</div>
</div>
</div> </div>
</div> </div>
<div class="form-row" style="padding: 0px 30px 30px 30px;">
<label for="funcao_participante">Função do Participante:</label>
<select name="" id="funcao_participante" class="form-control">
@foreach($funcaoParticipantes as $funcao)
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endforeach
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -94,6 +109,26 @@ ...@@ -94,6 +109,26 @@
</div> </div>
<div class="modal fade" id="aviso-modal-limite-de-integrantes" data-backdrop="static" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="background-color: #dc3545;">
<h5 class="modal-title" id="exampleModalLabel" style="color: white;">Aviso</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" >
<span id="texto-erro">O limite de integrantes para esse projeto foi atingido.</span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-color-dafault" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
<script> <script>
function mask_cpf() { function mask_cpf() {
...@@ -122,6 +157,11 @@ ...@@ -122,6 +157,11 @@
} }
function preencherUsuarioExistente() { function preencherUsuarioExistente() {
if(!document.getElementById(`exampleModal${modal_id}`)){
exibirModalNumeroMaximoDeIntegrantes();
return;
}
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
...@@ -139,12 +179,12 @@ ...@@ -139,12 +179,12 @@
success: function (data) { success: function (data) {
console.log(data) // console.log(data)
if(data == 'inexistente' || $('#cpf_consulta').val() == ""){ if(data == 'inexistente' || $('#cpf_consulta').val() == ""){
$('#texto-erro').html('CPF não consta no sistema!'); $('#texto-erro').html('CPF não consta no sistema!');
exibirModalUsuarioInexistente(); exibirModalUsuarioInexistente();
}else { }else {
exibirUsuarioAdicionado(); exibirUsuarioAdicionado(data);
$('#integrante').append(` $('#integrante').append(`
<div id="integrante${data[0]['id']}" class="col-md-6"> <div id="integrante${data[0]['id']}" class="col-md-6">
<div class="row"> <div class="row">
...@@ -171,13 +211,60 @@ ...@@ -171,13 +211,60 @@
$('#aviso-modal-usuario-nao-existe').modal('show'); $('#aviso-modal-usuario-nao-existe').modal('show');
} }
function exibirUsuarioAdicionado() { function exibirModalNumeroMaximoDeIntegrantes() {
$('#aviso-modal-usuario-adicionado').modal('show');; $('#aviso-modal-limite-de-integrantes').modal('show');
}
let modal_id = 0;
function exibirUsuarioAdicionado(data) {
// console.log(`${modal_id}`, data);
$('#modalIntegrante').modal('hide');
document.getElementById(`nome${modal_id}`).value = data[0]['name'];
document.getElementById(`nome${modal_id}`).setAttribute("readonly", "");
document.getElementById(`email${modal_id}`).value = data[0]['email'];
document.getElementById(`email${modal_id}`).setAttribute("readonly", "");
document.getElementById(`data_de_nascimento${modal_id}`).value = (new Date(data[2]['data_de_nascimento'])).toLocaleDateString();
document.getElementById(`data_de_nascimento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cpf${modal_id}`).value = data[0]['cpf'];
document.getElementById(`cpf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rg${modal_id}`).value = data[2]['rg'];
document.getElementById(`rg${modal_id}`).setAttribute("readonly", "");
document.getElementById(`celular${modal_id}`).value = data[0]['celular'];
document.getElementById(`celular${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cep${modal_id}`).value = data[3]['cep'];
document.getElementById(`cep${modal_id}`).setAttribute("readonly", "");
document.getElementById(`uf${modal_id}`).value = data[3]['uf'];
document.getElementById(`uf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cidade${modal_id}`).value = data[3]['cidade'];
document.getElementById(`cidade${modal_id}`).setAttribute("readonly", "");
document.getElementById(`bairro${modal_id}`).value = data[3]['bairro'];
document.getElementById(`bairro${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rua${modal_id}`).value = data[3]['rua'];
document.getElementById(`rua${modal_id}`).setAttribute("readonly", "");
document.getElementById(`numero${modal_id}`).value = data[3]['numero'];
document.getElementById(`numero${modal_id}`).setAttribute("readonly", "");
document.getElementById(`complemento${modal_id}`).value = data[3]['complemento'];
document.getElementById(`complemento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`instituicao[${modal_id}]`).value = data[0]['instituicao'];
document.getElementById(`instituicao[${modal_id}]`).setAttribute("readonly", "");
document.getElementById(`curso[${modal_id}]`).value = data[2]['curso'];
document.getElementById(`curso[${modal_id}]`).setAttribute("readonly", "");
$(`#exampleModal${modal_id}`).modal('show');
} }
$(document).ready(function() { $(document).ready(function() {
@foreach($trabalhos_user as $trabalho_user) @foreach($trabalhos_user as $trabalho_user)
modal_id += 1;
$('#integrante').append(` $('#integrante').append(`
<div id="integrante{{$trabalho_user->id}}" class="col-md-6"> <div id="integrante{{$trabalho_user->id}}" class="col-md-6">
<div class="row"> <div class="row">
......
<!-- Participantes AKI--> <!-- Participantes AKI-->
<div class="col-md-12" <!-- <div class="col-md-12"
style="margin-top: 20px"> style="margin-top: 20px">
<div class="card" <div class="card"
style="border-radius: 5px"> style="border-radius: 5px">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</a> </a>
</div> </div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6"> -->
<div class="row-cols-sm-12 justify-content-start"> <div class="row-cols-sm-12 justify-content-start">
<ol <ol
style="counter-reset: item;list-style-type: none; margin-left:-20px; margin-right:20px; margin-top:10px"> style="counter-reset: item;list-style-type: none; margin-left:-20px; margin-right:20px; margin-top:10px">
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
$participante = null; $participante = null;
if ($projeto->participantes->keys()->contains($i)) { if ($projeto->participantes->keys()->contains($i)) {
$participante = $projeto->participantes[$i]; $participante = $projeto->participantes[$i];
} }
@endphp @endphp
<div @if (!$participante) hidden @endif <div @if (!$participante) hidden @endif
...@@ -59,29 +58,50 @@ ...@@ -59,29 +58,50 @@
@else @else
Nome: {{ $participante->user->name }} Nome: {{ $participante->user->name }}
@endif @endif
@if (isset(old('nomePlanoTrabalho')[$i])) <br>
<br> Plano: {{ old('nomePlanoTrabalho')[$i] }}
@if($edital->tipo != "CONTINUO")
<br>
@if (isset(old('nomePlanoTrabalho')[$i]))
Plano: {{ old('nomePlanoTrabalho')[$i] }}
@else
Plano:
{{ $participante->planoTrabalho->titulo ?? 'Não informado' }}
@endif
@endif
@if (isset(old('email')[$i]))
E-mail: {{ old('email')[$i] }}
@else
E-mail: {{ $participante->user->email }}
@endif
<br>
@if (isset(old('cpf')[$i]))
CPF:{{ old('cpf')[$i] }}
@else
CPF: {{ $participante->user->cpf }}
@endif
<br>
@if (isset(old('funcao')[$i]))
Função: {{ old('funcao')[$i] }}
@else @else
<br>Plano: Função: {{ $participante->funcao }}
{{ $participante->planoTrabalho->titulo ?? 'Não informado' }}
@endif @endif
@else
Discente
@endif @endif
<h6> <h6>
<a href="" <a id="nomePart{{ $i + 1 }}"></a>
style=""
class="justify-content-center"
data-toggle="modal"
data-target="#exampleModal{{ $i }}"
id="nomePart{{ $i + 1 }}">Informações</a>
</h6> </h6>
<a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}">Mais Informações</a>
<div class="col-sm-5 pl-0" <div class="col-sm-5 pl-0"
style="margin-top: 10px; text-align: left;"> style="margin-top: 10px; text-align: left;">
<button data-dismiss="modal" <button data-dismiss="modal"
type="button" type="button"
id="cancelar{{ $i }}" id="cancelar{{ $i }}"
class=" btn btn-danger" class=" btn btn-danger btn-sm"
style="font-size: 12px" style="font-size: 12px"
onclick="desmarcar({{ $i }})" onclick="desmarcar({{ $i }})"
@if (isset(old('marcado')[$i + 1])) disabled @endif>Excluir</button> @if (isset(old('marcado')[$i + 1])) disabled @endif>Excluir</button>
...@@ -96,7 +116,8 @@ ...@@ -96,7 +116,8 @@
tabindex="-1" tabindex="-1"
role="dialog" role="dialog"
aria-labelledby="exampleModalLabel" aria-labelledby="exampleModalLabel"
aria-hidden="true"> aria-hidden="true"
style="overflow:auto;">
<div class="modal-dialog modal-dialog-centered modal-xl"> <div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
...@@ -181,11 +202,12 @@ ...@@ -181,11 +202,12 @@
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento']) @component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" <input type="text"
class="form-control" class="form-control"
value="{{ old('data_de_nascimento')[$i] ?? ($participante->data_de_nascimento ?? '') }}" value="{{ old('data_de_nascimento')[$i] ?? ($participante->data_de_nascimento ?? '') }}"
name="data_de_nascimento[{{ $i }}]" name="data_de_nascimento[{{ $i }}]"
placeholder="Data de nascimento" /> placeholder="Data de nascimento"
id="data_de_nascimento{{$i}}" />
@error('data_de_nascimento.' . $i) @error('data_de_nascimento.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
...@@ -201,7 +223,8 @@ ...@@ -201,7 +223,8 @@
class="form-control cpf" class="form-control cpf"
value="{{ old('cpf')[$i] ?? ($participante->user->cpf ?? '') }}" value="{{ old('cpf')[$i] ?? ($participante->user->cpf ?? '') }}"
name="cpf[{{ $i }}]" name="cpf[{{ $i }}]"
placeholder="CPF" /> placeholder="CPF"
id="cpf{{$i}}"/>
@error('cpf.' . $i) @error('cpf.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
...@@ -220,7 +243,8 @@ ...@@ -220,7 +243,8 @@
maxlength="9" maxlength="9"
value="{{ old('rg')[$i] ?? ($participante->rg ?? '') }}" value="{{ old('rg')[$i] ?? ($participante->rg ?? '') }}"
name="rg[{{ $i }}]" name="rg[{{ $i }}]"
placeholder="RG" /> placeholder="RG"
id="rg{{$i}}"/>
@error('rg.' . $i) @error('rg.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
...@@ -236,7 +260,8 @@ ...@@ -236,7 +260,8 @@
class="form-control celular" class="form-control celular"
value="{{ old('celular')[$i] ?? ($participante->user->celular ?? '') }}" value="{{ old('celular')[$i] ?? ($participante->user->celular ?? '') }}"
name="celular[{{ $i }}]" name="celular[{{ $i }}]"
placeholder="Celular" /> placeholder="Celular"
id="celular{{$i}}"/>
@error('celular.' . $i) @error('celular.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
...@@ -246,6 +271,7 @@ ...@@ -246,6 +271,7 @@
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<h5>Endereço</h5> <h5>Endereço</h5>
</div> </div>
...@@ -332,7 +358,8 @@ ...@@ -332,7 +358,8 @@
<input name="numero[{{ $i }}]" <input name="numero[{{ $i }}]"
type="text" type="text"
class="form-control" class="form-control"
value="{{ old('numero')[$i] ?? ($participante->user->endereco->numero ?? '') }}" /> value="{{ old('numero')[$i] ?? ($participante->user->endereco->numero ?? '') }}"
id="numero{{$i}}"/>
@error('numero.' . $i) @error('numero.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
...@@ -373,7 +400,8 @@ ...@@ -373,7 +400,8 @@
<select style="display: inline" <select style="display: inline"
onchange="showInstituicao(this)" onchange="showInstituicao(this)"
class="form-control" class="form-control"
name="instituicao[{{ $i }}]"> name="instituicao[{{ $i }}]"
id="instituicao[{{$i}}]">
<option value="" <option value=""
disabled disabled
selected selected
...@@ -421,7 +449,8 @@ ...@@ -421,7 +449,8 @@
<select style="display: inline" <select style="display: inline"
class="form-control" class="form-control"
name="curso[{{ $i }}]" name="curso[{{ $i }}]"
onchange="showCurso(this)"> onchange="showCurso(this)"
id="curso[{{ $i }}]">
<option value="" <option value=""
disabled disabled
selected selected
...@@ -490,7 +519,8 @@ ...@@ -490,7 +519,8 @@
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6">
@if($edital->natureza_id != 3) <div class="col-6">
@component('componentes.select', ['label' => 'Turno']) @component('componentes.select', ['label' => 'Turno'])
<select name="turno[{{ $i }}]" <select name="turno[{{ $i }}]"
class="form-control"> class="form-control">
...@@ -516,77 +546,76 @@ ...@@ -516,77 +546,76 @@
@php @php
$options = ['3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, '10' => 10, '11' => 11, '12' => 12]; $options = ['3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, '10' => 10, '11' => 11, '12' => 12];
@endphp @endphp
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Total de períodos/anos do curso']) @component('componentes.select', ['label' => 'Total de períodos/anos do curso'])
<select <select
name="total_periodos[{{ $i }}]" name="total_periodos[{{ $i }}]"
class="form-control" class="form-control"
onchange="gerarPeriodo(this)"> onchange="gerarPeriodo(this)">
<option value="" <option value=""
selected>-- Selecione uma opção -- selected>-- Selecione uma opção --
</option> </option>
@foreach ($options as $key => $value) @foreach ($options as $key => $value)
<option <option
@if ((old('total_periodos')[$i] ?? ($participante->total_periodos ?? '')) == $key) selected @endif @if ((old('total_periodos')[$i] ?? ($participante->total_periodos ?? '')) == $key) selected @endif
value="{{ $key }}"> value="{{ $key }}">
{{ $value }}</option> {{ $value }}</option>
@endforeach @endforeach
</select> </select>
@error('total_periodos.' . $i) @error('total_periodos.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
style="overflow: visible; display:block"> style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Período/Ano atual']) @component('componentes.select', ['label' => 'Período/Ano atual'])
<select name="periodo_atual[]" <select name="periodo_atual[]"
class="form-control"> class="form-control">
<option value="" <option value=""
selected>-- Selecione uma opção -- selected>-- Selecione uma opção --
</option> </option>
<option selected <option selected
value="{{ old('periodo_atual')[$i] ?? ($participante->periodo_atual ?? '') }}"> value="{{ old('periodo_atual')[$i] ?? ($participante->periodo_atual ?? '') }}">
{{ old('periodo_atual')[$i] ?? ($participante->periodo_atual ?? '') }} {{ old('periodo_atual')[$i] ?? ($participante->periodo_atual ?? '') }}
</option> </option>
</select> </select>
@error('periodo_atual.' . $i) @error('periodo_atual.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
style="overflow: visible; display:block"> style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade']) @component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" <select name="ordem_prioridade[]"
class="form-control"> class="form-control">
<option value="" <option value=""
selected>-- ORDEM --</option> selected>-- ORDEM --</option>
@for ($j = 1; $j <= $edital->numParticipantes; $j++) @for ($j = 1; $j <= $edital->numParticipantes; $j++)
<option <option
@if ((old('ordem_prioridade')[$i] ?? ($participante->ordem_prioridade ?? '')) == $j) selected @endif @if ((old('ordem_prioridade')[$i] ?? ($participante->ordem_prioridade ?? '')) == $j) selected @endif
value="{{ $j }}"> value="{{ $j }}">
{{ $j }}</option> {{ $j }}</option>
@endfor @endfor
</select> </select>
@error('ordem_prioridade.' . $i) @error('ordem_prioridade.' . $i)
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
style="overflow: visible; display:block"> style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
@if ($edital->tipo != 'PIBEX')
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento (média geral)']) @component('componentes.input', ['label' => 'Coeficiente de rendimento (média geral)'])
<input type="number" <input type="number"
...@@ -606,65 +635,70 @@ ...@@ -606,65 +635,70 @@
@endcomponent @endcomponent
</div> </div>
@endif @endif
<div class="col-md-12">
<h5>Plano de trabalho</h5> @if($edital->tipo != 'CONTINUO')
</div> <div class="col-md-12">
<div class="col-12"> <h5>Plano de trabalho</h5>
@component('componentes.input', ['label' => 'Título']) </div>
<input type="text" <div class="col-12">
class="form-control" @component('componentes.input', ['label' => 'Título'])
value="{{ old('nomePlanoTrabalho')[$i] ?? ($participante->planoTrabalho->titulo ?? '') }}" <input type="text"
name="nomePlanoTrabalho[{{ $i }}]" class="form-control"
placeholder="Digite o título do plano de trabalho" value="{{ old('nomePlanoTrabalho')[$i] ?? ($participante->planoTrabalho->titulo ?? '') }}"
maxlength="255" name="nomePlanoTrabalho[{{ $i }}]"
id="nomePlanoTrabalho{{ $i }}"> placeholder="Digite o título do plano de trabalho"
<span style="color: red; font-size: 12px" maxlength="255"
id="caracsRestantesnomePlanoTrabalho{{ $i }}"> id="nomePlanoTrabalho{{ $i }}">
</span> <span style="color: red; font-size: 12px"
@error('nomePlanoTrabalho.' . $i) id="caracsRestantesnomePlanoTrabalho{{ $i }}">
</span>
@error('nomePlanoTrabalho.' . $i)
<span class="invalid-feedback"
role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12"
style="margin-bottom: 10px">
<label>Anexo (.pdf)<span
style="color: red;font-weight: bold">*
</span>
@if ($participante != null && $participante->planoTrabalho)
<a style="margin-left: 5px"
href="{{ route('baixar.plano', ['id' => $participante->planoTrabalho->id]) }}">
<i
class="fas fa-file-pdf fa-2x"></i></a>
@endif
</label>
<input type="file"
class="input-group-text"
value="{{ old('anexoPlanoTrabalho')[$i] ?? '' }}"
name="anexoPlanoTrabalho[{{ $i }}]"
accept=".pdf"
placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.' . $i)
<span class="invalid-feedback"
role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" <span class="invalid-feedback"
role="alert" role="alert"
style="overflow: visible; display:block"> style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent
</div>
<div class="col-12"
style="margin-bottom: 10px">
<label>Anexo (.pdf)<span
style="color: red;font-weight: bold">*
</span>
@if ($participante != null && $participante->planoTrabalho)
<a style="margin-left: 5px"
href="{{ route('baixar.plano', ['id' => $participante->planoTrabalho->id]) }}">
<i
class="fas fa-file-pdf fa-2x"></i></a>
@endif
</label>
<input type="file"
class="input-group-text"
value="{{ old('anexoPlanoTrabalho')[$i] ?? '' }}"
name="anexoPlanoTrabalho[{{ $i }}]"
accept=".pdf"
placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.' . $i)
<span class="invalid-feedback"
role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback"
role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div> </div>
@endif
{{-- <div class="col-6"> {{-- <div class="col-6">
<button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if (isset(old('marcado')[$i + 1])) disabled @endif>Excluir</button> <button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if (isset(old('marcado')[$i + 1])) disabled @endif>Excluir</button>
</div> --}} </div> --}}
...@@ -704,10 +738,10 @@ ...@@ -704,10 +738,10 @@
</ol> </ol>
</div> </div>
</div> <!-- </div>
</div> </div>
</div> </div>
</div> </div> -->
<script> <script>
function limpa_formulário_cep(id) { function limpa_formulário_cep(id) {
//Limpa valores do formulário de cep. //Limpa valores do formulário de cep.
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
@include('projeto.editaFormulario.proponente') @include('projeto.editaFormulario.proponente')
@if ($edital->numParticipantes != 0) @if ($edital->numParticipantes != 0)
@include('projeto.editaFormulario.participantes')
@endif
@if($edital->natureza_id == 3)
@include('projeto.editaFormulario.integrantes') @include('projeto.editaFormulario.integrantes')
@endif @endif
...@@ -50,13 +46,13 @@ ...@@ -50,13 +46,13 @@
</div> </div>
</div> </div>
</form> </form>
@if ($edital->numParticipantes != 0) <!-- @if ($edital->numParticipantes != 0)
<div id="participanteFirst" > <div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ]) @component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent @endcomponent
</div> </div>
@endif @endif -->
<!-- Modal de Aviso Edit --> <!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> <div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
...@@ -233,33 +229,41 @@ ...@@ -233,33 +229,41 @@
let linkNome = document.getElementById("nomePart"+(id+1)); let linkNome = document.getElementById("nomePart"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1)); let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id); let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
let cpf = document.getElementById("cpf"+id);
let funcao = document.getElementById("funcao_participante");
let email = document.getElementById("email"+id);
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho.value != ""){ if(planoTrabalho != null && planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcao.value}`;
}else { }else {
linkNome.innerText = `Nome: ${nome.value}`; linkNome.innerText = `Nome: ${nome.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcao.value}`;
} }
} }
if(id >=1){ if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true); document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
} }
console.log(document.getElementById("exampleModal"+id));
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
$("#atribuir1").attr('data-target','#exampleModal'+(id+1)); // $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
modal_id += 1;
document.getElementById("part"+id).removeAttribute("hidden"); document.getElementById("part"+id).removeAttribute("hidden");
document.getElementById("exampleModal"+id).modal('hide'); // document.getElementById("exampleModal"+id).modal('hide');
} }
function desmarcar(id){ function desmarcar(id){
if(id >= 1){; if(id >= 1){
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled"); document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
} }
document.getElementById("checkB"+id).checked = false; document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true); document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id)); // $("#atribuir1").attr('data-target','#exampleModal'+(id));
document.getElementById("exampleModal"+id).modal('hide'); // document.getElementById("exampleModal"+id).modal('hide');
modal_id -= 1;
} }
@endif @endif
</script> </script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment