Commit 351409a9 authored by sandroresende's avatar sandroresende

funcionalidade pesquisar propostas

parent 55ea6b64
...@@ -43,7 +43,11 @@ class HomeController extends Controller ...@@ -43,7 +43,11 @@ class HomeController extends Controller
$propostasCadastradas = ViewPropostasCadastradasUf::get(); $propostasCadastradas = ViewPropostasCadastradasUf::get();
$totalProposta = ['total_propostas'=> 0, $totalProposta = ['total_propostas'=> 0,
'total_inteverncao'=> 0, 'total_intervencao'=> 0,
'total_propostas_sistema'=> 0,
'total_intervencao_sistema'=> 0,
'total_propostas_forms'=> 0,
'total_intervencao_forms'=> 0,
'total_num_propostas_ac'=> 0, 'total_num_propostas_ac'=> 0,
'total_num_propostas_al'=> 0, 'total_num_propostas_al'=> 0,
'total_num_propostas_am'=> 0, 'total_num_propostas_am'=> 0,
...@@ -77,7 +81,11 @@ class HomeController extends Controller ...@@ -77,7 +81,11 @@ class HomeController extends Controller
foreach($propostasCadastradas as $valor){ foreach($propostasCadastradas as $valor){
$totalProposta['total_propostas'] += $valor->num_propostas; $totalProposta['total_propostas'] += $valor->num_propostas;
$totalProposta['total_inteverncao'] += $valor->num_propostas; $totalProposta['total_intervencao'] += $valor->num_propostas;
$totalProposta['total_propostas_sistema'] += $valor->num_propostas_enviadas_sistema;
$totalProposta['total_intervencao_sistema'] += $valor->vlr_intervencao_enviadas_sistema;
$totalProposta['total_propostas_forms'] += $valor->num_propostas_enviadas_forms;
$totalProposta['total_intervencao_forms'] += $valor->vlr_intervencao_enviadas_forms;
$totalProposta['total_num_propostas_ac'] += $valor->num_propostas_ac; $totalProposta['total_num_propostas_ac'] += $valor->num_propostas_ac;
$totalProposta['total_num_propostas_al'] += $valor->num_propostas_al; $totalProposta['total_num_propostas_al'] += $valor->num_propostas_al;
$totalProposta['total_num_propostas_am'] += $valor->num_propostas_am; $totalProposta['total_num_propostas_am'] += $valor->num_propostas_am;
......
...@@ -16,6 +16,7 @@ use App\Http\Flash; ...@@ -16,6 +16,7 @@ use App\Http\Flash;
use App\Propostas\CronogramaSelecao; use App\Propostas\CronogramaSelecao;
use App\Propostas\Propostas; use App\Propostas\Propostas;
use App\Propostas\RlcItensFinanciaveisProposta; use App\Propostas\RlcItensFinanciaveisProposta;
use App\Propostas\ViewPropostasCadastradas;
use App\RlcArquivoUser; use App\RlcArquivoUser;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
...@@ -49,7 +50,7 @@ class SelecaoController extends Controller ...@@ -49,7 +50,7 @@ class SelecaoController extends Controller
$propostas->load('situacaoProposta','modalidadeParticipacao','usuario'); $propostas->load('situacaoProposta','modalidadeParticipacao','usuario');
if(count($propostas)>0){ if(count($propostas)>0){
return view('modulo_propostas.proposta.ListaPropostas',compact('usuario','cronogramas','propostas')); return view('modulo_propostas.proposta.ListaPropostasEnte',compact('usuario','cronogramas','propostas'));
}else{ }else{
flash()->erro("Erro", "Não existem propostas cadastradas"); flash()->erro("Erro", "Não existem propostas cadastradas");
return back(); return back();
...@@ -129,4 +130,35 @@ class SelecaoController extends Controller ...@@ -129,4 +130,35 @@ class SelecaoController extends Controller
} }
public function consultarPropostas(){
return view('modulo_propostas.proposta.ConsultarPropostas');
}
public function pesquisarPropostas(Request $request){
$where = [];
//return $request->all();
if($request->estado){
$where[] = ['id_uf', $request->estado];
}
if($request->municipio){
$where[] = ['municipio_id', $request->municipio];
}
$propostas = ViewPropostasCadastradas::where($where)->get();
return view('modulo_propostas.proposta.ListaPropostasApresentadas',compact('propostas'));
}
} }
This diff is collapsed.
...@@ -38,6 +38,11 @@ Vue.component('valida-oficio', require('./components/mod_sistema/admin/arquivos/ ...@@ -38,6 +38,11 @@ Vue.component('valida-oficio', require('./components/mod_sistema/admin/arquivos/
Vue.component('tabela-oficios', require('./components/mod_sistema/admin/arquivos/TabelaOficios.vue')); Vue.component('tabela-oficios', require('./components/mod_sistema/admin/arquivos/TabelaOficios.vue'));
///mod propostas
Vue.component('filtro-propostas', require('./components/mod_propostas/FiltroPropostas.vue'));
......
<template>
<div class="form-group">
<div class="row">
<div class="column col-xs-12 col-md-3">
<label for="uf">UF</label>
<select
id="estado"
class="form-select br-select"
name="estado"
:="requeruf == 'true'"
@change="onChangeEstado"
v-model="estado">
<option value="">Escolha um Estado:</option>
<option v-for="estado in estados" v-text="estado.txt_sigla_uf" :value="estado.id" :key="estado.id"></option>
</select>
</div>
<div class="column col-xs-12 col-md-9">
<!-- municipio -->
<label for="municipio">Município</label>
<select
id="municipio"
class="form-select br-select"
name="municipio"
:="requermunicipio == 'true'"
@change="onChangeMunicipio"
:disabled="estado == '' || buscando"
v-model="municipio">
<option value="" v-text="textoEscolhaMunicipio"></option>
<option v-for="municipio in municipios" v-text="municipio.ds_municipio" :value="municipio.municipio_id" :key="municipio.municipio_id"></option>
</select>
</div>
</div>
<div class="p-3 text-right">
<button class="br-button primary mr-3" type="submit" :disabled="estado == '' && municipio == ''">Pesquisar
</button>
<button class="br-button danger mr-3" type="button" onclick="javascript:window.history.go(-1)">Voltar
</button>
</div>
</div>
</template>
<script>
export default {
props:['url','municipioselecionado','ufselecionada','coluf','colmun','requermunicipio','requeruf','complementonomelabelmun'],
data(){
return{
estados:'',
estado:'',
municipios: '',
municipio:'',
}
},
methods:{
onChangeEstado() {
this.textoEscolhaMunicipio = "Buscando...";
this.municipio = '';
this.buscando = true;
if(this.estado != '') {
//busca dados no banco de dados para carregar no componente
axios.get(this.url + '/api/municipios/' + this.estado).then(resposta => {
this.textoEscolhaMunicipio = "Escolha um municipio:";
this.buscando = false;
this.municipios = resposta.data;
}).catch(error => {
console.log(error);
});
} else {
this.buscando = false;
this.municipio = '';
this.textoEscolhaMunicipio = "Filtre o Estado"
}
},
onChangeMunicipio() {
if(this.municipio){
this.municipioselecionado = this.municipio;
}
}
},
mounted() {
//console.log(this.form._token);
axios.get(this.url + '/api/ufs').then(resposta => {
//console.log(resposta.data);
this.estados = resposta.data;
this.estado = '';
this.municipio = '';
}).catch(erro => {
console.log(erro);
})
}
}
</script>
...@@ -92,6 +92,13 @@ ...@@ -92,6 +92,13 @@
<button class="br-button" type="button" aria-label="Botão de ação"><i class="fas fa-user" aria-hidden="true"></i> <button class="br-button" type="button" aria-label="Botão de ação"><i class="fas fa-user" aria-hidden="true"></i>
</button> </button>
</div> </div>
@if ($errors->has('email'))
<span class="feedback danger" role="alert">
<i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('email') }}
</span>
@endif
</br> </br>
<div class="br-input large input-button"> <div class="br-input large input-button">
<label for="input-login-small">Senha</label> <label for="input-login-small">Senha</label>
...@@ -99,7 +106,11 @@ ...@@ -99,7 +106,11 @@
<button class="br-button" type="button" aria-label="Botão de ação"><i class="fas fa-lock" aria-hidden="true"></i> <button class="br-button" type="button" aria-label="Botão de ação"><i class="fas fa-lock" aria-hidden="true"></i>
</button> </button>
</div> </div>
@if ($errors->has('password'))
<span class="feedback danger" role="alert">
<i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('password') }}
</span>
@endif
<div class="form-group row"> <div class="form-group row">
<div class="col offset-md-12"> <div class="col offset-md-12">
......
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" required autofocus> <input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" required autofocus>
@if ($errors->has('name')) @if ($errors->has('name'))
<span class="invalid-feedback" role="alert"> <span class="feedback danger" role="alert">
<strong>{{ $errors->first('name') }}</strong> <i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('name') }}
</span> </span>
@endif @endif
</div> </div>
</div> </div>
...@@ -50,9 +50,10 @@ ...@@ -50,9 +50,10 @@
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required> <input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
@if ($errors->has('email')) @if ($errors->has('email'))
<span class="invalid-feedback" role="alert"> <span class="feedback danger" role="alert">
<strong>{{ $errors->first('email') }}</strong> <i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('email') }}
</span> </span>
@endif @endif
</div> </div>
</div> </div>
...@@ -73,9 +74,9 @@ ...@@ -73,9 +74,9 @@
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required> <input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
@if ($errors->has('password')) @if ($errors->has('password'))
<span class="invalid-feedback" role="alert"> <span class="feedback danger" role="alert">
<strong>{{ $errors->first('password') }}</strong> <i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('password') }}
</span> </span>
@endif @endif
</div> </div>
</div> </div>
......
...@@ -33,7 +33,11 @@ ...@@ -33,7 +33,11 @@
<th class="text-center">Modalidade</th> <th class="text-center">Modalidade</th>
<th class="text-center">Seleção</th> <th class="text-center">Seleção</th>
<th class="text-center">Propostas</th> <th class="text-center">Propostas</th>
<th class="text-center">Valor</th> <th class="text-center">Valor</th>
<th class="text-center">Envio Sist</th>
<th class="text-center">Valor Env Sist</th>
<th class="text-center">Envio Forms</th>
<th class="text-center">Valor Env Forms</th>
<th class="text-center">AC</th> <th class="text-center">AC</th>
<th class="text-center">AL</th> <th class="text-center">AL</th>
<th class="text-center">AM</th> <th class="text-center">AM</th>
...@@ -81,6 +85,10 @@ ...@@ -81,6 +85,10 @@
<td class="text-center">{{$dados->num_selecao}}ª</td> <td class="text-center">{{$dados->num_selecao}}ª</td>
<td class="text-center">{{number_format( ($dados->num_propostas), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($dados->num_propostas), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->vlr_total), 2, ',' , '.')}}</td> <td class="text-center">{{number_format( ($dados->vlr_total), 2, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->num_propostas_enviadas_sistema), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->vlr_intervencao_enviadas_sistema), 2, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->num_propostas_enviadas_forms), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->vlr_intervencao_enviadas_forms), 2, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->num_propostas_ac), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($dados->num_propostas_ac), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->num_propostas_al), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($dados->num_propostas_al), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($dados->num_propostas_am), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($dados->num_propostas_am), 0, ',' , '.')}}</td>
...@@ -113,7 +121,11 @@ ...@@ -113,7 +121,11 @@
<tr class="total text-weight-semi-bold"> <tr class="total text-weight-semi-bold">
<td colspan="2" class="text-center">TOTAL</td> <td colspan="2" class="text-center">TOTAL</td>
<td class="text-center">{{number_format( ($totalProposta['total_propostas']), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($totalProposta['total_propostas']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_inteverncao']), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($totalProposta['total_intervencao']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_propostas_sistema']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_intervencao_sistema']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_propostas_forms']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_intervencao_forms']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_num_propostas_ac']), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($totalProposta['total_num_propostas_ac']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_num_propostas_al']), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($totalProposta['total_num_propostas_al']), 0, ',' , '.')}}</td>
<td class="text-center">{{number_format( ($totalProposta['total_num_propostas_am']), 0, ',' , '.')}}</td> <td class="text-center">{{number_format( ($totalProposta['total_num_propostas_am']), 0, ',' , '.')}}</td>
...@@ -153,14 +165,13 @@ ...@@ -153,14 +165,13 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
<div class="d-flex" style="padding-top: 10px;"> <div class="d-flex" style="padding-top: 10px;">
<form class="form-horizontal" role="form" method="get" action='{{ url("/propostas/consultar") }}'>
{{ csrf_field() }}
<button type="submit" class="br-button block secondary mr-3" aria-label="Ícone ilustrativo"> <button type="button" class="br-button block secondary mr-3" aria-label="Ícone ilustrativo" onclick="window.location.href='/selecao/propostas/consultar'">
<i class="fas fa-eye" aria-hidden="true"></i>Consultar Propostas <i class="fas fa-eye" aria-hidden="true"></i>Consultar Propostas
</button> </button>
</form>
</div> </div>
</div> </div>
</div><!-- br-card --> </div><!-- br-card -->
...@@ -232,14 +243,13 @@ ...@@ -232,14 +243,13 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
<div class="d-flex" style="padding-top: 10px;"> <div class="d-flex" style="padding-top: 10px;">
<form class="form-horizontal" role="form" method="get" action='{{ url("/admin/ente_publico/oficios/consultar") }}'>
{{ csrf_field() }}
<button type="submit" class="br-button block secondary mr-3" aria-label="Ícone ilustrativo"> <button type="button" class="br-button block secondary mr-3" aria-label="Ícone ilustrativo" onclick="window.location.href='/admin/ente_publico/oficios/consultar'">
<i class="fas fa-edit" aria-hidden="true"></i>Validar Ofícios <i class="fas fa-edit" aria-hidden="true"></i>Validar Ofícios
</button> </button>
</form>
</div> </div>
</div> </div>
</div><!-- br-card --> </div><!-- br-card -->
......
@extends('layouts.app')
@section('scriptscss')
<link rel="stylesheet" type="text/css" href="{{URL::asset('css/custom.css')}}" media="screen" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/relatorio_executivo.css') }}" media="screen" >
@endsection
@section('content')
<historico-navegacao
:url="'{{ url('/home') }}'"
:telanterior01="'Propostas'"
:telatual="'Consultar Propostas'"
>
</historico-navegacao>
<div class="main-content pl-sm-3 mt-5" id="main-content" style="min-height: 100% width 100%">
<cabecalho-relatorios
:titulo="'Consulta Propostas'"
barracompartilhar="false">
</cabecalho-relatorios>
<div class="form-group">
<p>
Este formulário permite que você filtre os ente públicos que enviaram ofícios para validarem seu acesso ao sistema.
</p>
<span class="br-divider my-3"></span>
<form action="{{ url('/selecao/propostas/pesquisar') }}" role="form" method="POST">
{{ csrf_field() }}
<div class="row">
<filtro-propostas
url='{{ url("/") }}' >
</filtro-propostas>
</div>
</form>
</div>
</div>
@endsection
@extends('layouts.app')
@section('scriptscss')
<link rel="stylesheet" type="text/css" href="{{URL::asset('css/custom.css')}}" media="screen" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/relatorio_executivo.css') }}" media="screen" >
@endsection
@section('content')
<historico-navegacao
:url="'{{ url('/home') }}'"
:telanterior01="'Propostas'"
:telanterior02="'Consultar Propostas'"
:telatual="'Propostas Apresentadas'"
>
</historico-navegacao>
<div class="main-content pl-sm-3 mt-5" id="main-content">
<cabecalho-relatorios
:titulo="'Propostas Apresentadas'"
barracompartilhar="false">
</cabecalho-relatorios>
<div class="form-group">
@if(count($propostas) > 0)
<div class="titulo"><h3>Propostas Cadastradas</h3> </div>
<div class="table-responsive-sm">
<table class="table table-hover">
<thead>
<tr class="text-center" >
<th>UF</th>
<th>Município</th>
<th>Ente Público</th>
<th>Modalidade</th>
<th>Situação</th>
<th>Valor</th>
<th>Data</th>
<th>Via Sistema</th>
<th class="text-center">Ação</th>
</tr>
</thead>
<tbody>
@foreach($propostas as $dados)
@if($dados->modalidade_participacao_id == 1)
<tr class="text-center table-primary">
@elseif($dados->modalidade_participacao_id == 2)
<tr class="text-center table-success">
@else
<tr class="text-center table-warning">
@endif
<td>{{$dados->sg_uf}}</td>
<td>{{$dados->ds_municipio}}</td>
<td>{{$dados->txt_ente_publico}}</td>
<td>{{$dados->txt_modalidade_participacao}}</td>
<td>{{$dados->txt_situacao_proposta}}</td>
<td>{{number_format( ($dados->vlr_intervencao), 2, ',' , '.')}}</td>
<td>@if($dados->created_at) {{date('d/m/Y',strtotime($dados->created_at))}} @endif</td>
<td>@if($dados->bln_propostas_recebidas_sistema) Sim @else Não @endif</td>
<td>
<button type="button" class="br-button circle secondary small mr-3" aria-label="Ícone ilustrativo"
onclick='window.location.href="{{ url("selecao/proposta/$dados->proposta_id")}}"'>
<i class="fas fa-eye" aria-hidden="true"></i>
</button>
</td>
</tr>
@endforeach
</tbody><!-- fechar tbody-->
</table><!-- fechar table-->
</div> <!-- table-responsive-sm -->
@endif
<div class="p-3 text-right">
<button class="br-button primary mr-3" type="button" name="imprimir" value="Imprimir" onclick="window.print();">Imprimir
</button>
<button class="br-button danger mr-3" type="button" onclick="window.location.href='/home_ente_publico'">Fechar
</button>
</div>
</div>
@endsection
...@@ -65,10 +65,17 @@ Route::get('/usuario/{userProp}/{userLog}/proposta/excluir/{proposta}', 'Propost ...@@ -65,10 +65,17 @@ Route::get('/usuario/{userProp}/{userLog}/proposta/excluir/{proposta}', 'Propost
//selecao //selecao
Route::get('/selecao/ente_publico/propostas', 'Propostas\SelecaoController@listaPropostas'); Route::get('/selecao/ente_publico/propostas', 'Propostas\SelecaoController@listaPropostasEnte');
Route::get('/selecao/proposta/{proposta}', 'Propostas\SelecaoController@dadosProposta'); Route::get('/selecao/proposta/{proposta}', 'Propostas\SelecaoController@dadosProposta');
Route::get('/selecao/andamento', 'Propostas\SelecaoController@selecoesAndamento'); Route::get('/selecao/andamento', 'Propostas\SelecaoController@selecoesAndamento');
Route::get('/selecao/propostas/consultar', 'Propostas\SelecaoController@consultarPropostas');
Route::post('/selecao/propostas/pesquisar', 'Propostas\SelecaoController@pesquisarPropostas');
......
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