Commit d78a7743 authored by sandroresende's avatar sandroresende

filtro por ente publico

parent 0729167c
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\EntePublico;
use Illuminate\Http\Request;
use App\TipoUsuario;
......@@ -38,6 +39,7 @@ use App\Mod_saci\mod_pac\Eixo;
use App\Mod_saci\mod_pac\Tipo;
use App\Mod_saci\mod_pac\Programa;
use App\Propostas\AcaoPrograma;
use App\Propostas\ViewPropostasCadastradas;
use App\RlcModuloSistema;
use App\TipoIndeferimento;
use App\ViewArquivosEnviados;
......@@ -99,6 +101,14 @@ class ApiController extends Controller
return ViewArquivosEnviados::selectRaw('municipio_id, ds_municipio')->where('uf_id', $estado)->groupBy('municipio_id', 'ds_municipio')->orderBy('ds_municipio', 'asc')->get();
}
public function buscarEntePublico($municipio){
return ViewPropostasCadastradas::SelectRaw('ente_publico_id as id, txt_ente_publico')->where('municipio_id', $municipio)->groupBy('ente_publico_id', 'txt_ente_publico')->orderBy('txt_ente_publico', 'asc')->get();
}
/**APIS INDICADORES HABITACIONAIS */
......
......@@ -184,6 +184,11 @@ class SelecaoController extends Controller
$where[] = ['bln_propostas_recebidas_sistema', $request->recebidasSistema];
}
if($request->entepublico){
$where[] = ['ente_publico_id', str_pad($request->entepublico, 14, "0", STR_PAD_LEFT)];
}
$propostas = ViewPropostasCadastradas::where($where)->get();
if(count($propostas) == 0){
......
......@@ -50211,6 +50211,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
props: ['url', 'linkcompartilhar', 'barracompartilhar', 'titulo', 'subtitulo1', 'subtitulo2', 'subtitulo3', 'subtitulo4', 'dataatualizacao'],
......@@ -50253,6 +50254,10 @@ var render = function() {
_vm._v(_vm._s(_vm.subtitulo3) + " ")
]),
_vm._v(" "),
_c("p", { staticClass: "text-gray-70 text-center" }, [
_vm._v(_vm._s(_vm.subtitulo4) + " ")
]),
_vm._v(" "),
_vm._t("default"),
_vm._v(" "),
_c("span", { staticClass: "br-divider lg my-3" }),
......@@ -53615,6 +53620,22 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
props: ['url', 'municipioselecionado', 'ufselecionada', 'coluf', 'colmun', 'requermunicipio', 'requeruf', 'complementonomelabelmun'],
......@@ -53626,11 +53647,16 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
municipios: '',
municipio: '',
textoEscolhaMunicipio: "Filtre o Estado",
textoEscolhaEnte: "Filtre o Município",
entespublicos: '',
entepublico: '',
selecoes: '',
selecao: '',
situacoesPropostas: '',
situacaoProposta: '',
recebidasSistema: ''
recebidasSistema: '',
buscandoEnte: false,
buscando: false
};
},
......@@ -53659,36 +53685,52 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
}
},
onChangeMunicipio: function onChangeMunicipio() {
if (this.municipio) {
this.municipioselecionado = this.municipio;
var _this2 = this;
this.textoEscolhaEnte = "Buscando...";
this.entepublico = '';
this.buscandoEnte = true;
if (this.municipio != '') {
//busca dados no banco de dados para carregar no componente
axios.get(this.url + '/api/ente_publico/municipio/' + this.municipio).then(function (resposta) {
_this2.textoEscolhaEnte = "Escolha um municipio:";
_this2.buscandoEnte = false;
_this2.entespublicos = resposta.data;
}).catch(function (error) {
console.log(error);
});
} else {
this.buscandoEnte = false;
this.entepublico = '';
this.textoEscolhaEnte = "Filtre o Município";
}
}
},
mounted: function mounted() {
var _this2 = this;
var _this3 = this;
//console.log(this.form._token);
axios.get(this.url + '/api/ufs').then(function (resposta) {
//console.log(resposta.data);
_this2.estados = resposta.data;
_this2.estado = '';
_this2.municipio = '';
_this3.estados = resposta.data;
_this3.estado = '';
_this3.municipio = '';
}).catch(function (erro) {
console.log(erro);
});
axios.get(this.url + '/api/selecao').then(function (resposta) {
//console.log(resposta.data);
_this2.selecoes = resposta.data;
_this2.selecao = '';
_this3.selecoes = resposta.data;
_this3.selecao = '';
}).catch(function (erro) {
console.log(erro);
});
axios.get(this.url + '/api/situacaoPropostas').then(function (resposta) {
//console.log(resposta.data);
_this2.situacoesPropostas = resposta.data;
_this2.situacaoProposta = '';
_this3.situacoesPropostas = resposta.data;
_this3.situacaoProposta = '';
}).catch(function (erro) {
console.log(erro);
});
......@@ -53871,6 +53913,69 @@ var render = function() {
])
: _vm._e(),
_vm._v(" "),
!_vm.protocolodigitado
? _c("div", { staticClass: "row" }, [
_c("div", { staticClass: "col col-xs-12 col-sm-12 br-input" }, [
_c("label", { attrs: { for: "entepublico" } }, [
_vm._v("Ente Público")
]),
_vm._v(" "),
_c(
"select",
{
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.entepublico,
expression: "entepublico"
}
],
staticClass: "form-select br-select",
attrs: {
id: "entepublico",
name: "entepublico",
"": _vm.requermunicipio == "true",
disabled: _vm.municipio == "" || _vm.buscando
},
on: {
change: function($event) {
var $$selectedVal = Array.prototype.filter
.call($event.target.options, function(o) {
return o.selected
})
.map(function(o) {
var val = "_value" in o ? o._value : o.value
return val
})
_vm.entepublico = $event.target.multiple
? $$selectedVal
: $$selectedVal[0]
}
}
},
[
_c("option", {
attrs: { value: "" },
domProps: { textContent: _vm._s(_vm.textoEscolhaEnte) }
}),
_vm._v(" "),
_vm._l(_vm.entespublicos, function(entepublico) {
return _c("option", {
key: entepublico.id,
domProps: {
value: entepublico.id,
textContent: _vm._s(entepublico.txt_ente_publico)
}
})
})
],
2
)
])
])
: _vm._e(),
_vm._v(" "),
!_vm.protocolodigitado
? _c("div", { staticClass: "row" }, [
_c("div", { staticClass: "column col-xs-12 col-md-6" }, [
......@@ -4,6 +4,7 @@
<p class="h5-subtitulo text-blue-warm-vivid-90 text-center">{{subtitulo1}} </p>
<p class="h4-subtitulo text-gray-70 text-center">{{subtitulo2}} </p>
<p class="text-gray-70 text-center">{{subtitulo3}} </p>
<p class="text-gray-70 text-center">{{subtitulo4}} </p>
......
......@@ -38,6 +38,22 @@
</select>
</div>
</div>
<div class="row" v-if="!protocolodigitado">
<div class="col col-xs-12 col-sm-12 br-input">
<label for="entepublico">Ente Público</label>
<select
id="entepublico"
class="form-select br-select"
name="entepublico"
:="requermunicipio == 'true'"
:disabled="municipio == '' || buscando"
v-model="entepublico">
<option value="" v-text="textoEscolhaEnte"></option>
<option v-for="entepublico in entespublicos" v-text="entepublico.txt_ente_publico" :value="entepublico.id" :key="entepublico.id"></option>
</select>
</div>
</div>
<div class="row" v-if="!protocolodigitado">
<div class="column col-xs-12 col-md-6">
<label for="selecao">Seleção</label>
......@@ -100,11 +116,16 @@
municipios: '',
municipio:'',
textoEscolhaMunicipio: "Filtre o Estado",
textoEscolhaEnte:"Filtre o Município",
entespublicos: '',
entepublico:'',
selecoes: '',
selecao:'',
situacoesPropostas: '',
situacaoProposta:'',
recebidasSistema:''
recebidasSistema:'',
buscandoEnte: false,
buscando: false,
}
},
......@@ -131,9 +152,24 @@
}
},
onChangeMunicipio() {
if(this.municipio){
this.municipioselecionado = this.municipio;
}
this.textoEscolhaEnte = "Buscando...";
this.entepublico = '';
this.buscandoEnte = true;
if(this.municipio != '') {
//busca dados no banco de dados para carregar no componente
axios.get(this.url + '/api/ente_publico/municipio/' + this.municipio).then(resposta => {
this.textoEscolhaEnte = "Escolha um municipio:";
this.buscandoEnte = false;
this.entespublicos = resposta.data;
}).catch(error => {
console.log(error);
});
} else {
this.buscandoEnte = false;
this.entepublico = '';
this.textoEscolhaEnte = "Filtre o Município"
}
}
},
......
......@@ -26,10 +26,10 @@
<cabecalho-relatorios
:titulo="'{{$proposta->entePublico->txt_ente_publico}}'"
:subtitulo1="'{{$proposta->txt_protocolo}}'"
:subtitulo1="'Protocolo: {{$proposta->txt_protocolo}}'"
:subtitulo2="'{{$proposta->entePublico->municipio->txt_nome_sem_acento}} - {{$proposta->entePublico->municipio->uf->txt_sigla_uf}}'"
:subtitulo3="'{{$proposta->selecao->txt_selecao}} - Seleção nº {{$proposta->selecao->num_selecao}}'"
:subtitulo4="'@if($proposta->bln_propostas_recebidas_sistema) Cadastrada Via Sistema @else Cadastrada Via Forms @endif'"
:subtitulo4="'@if($proposta->bln_propostas_recebidas_sistema == true) Cadastrada Via Sistema @else Cadastrada Via Forms @endif'"
@if($proposta->usuario):subtitulo3="'Cadastrada por: {{$proposta->usuario->name}}'" @endif
@if($proposta->updated_at)
:dataatualizacao="'{{date('d/m/Y',strtotime($proposta->updated_at))}}'"
......@@ -57,6 +57,7 @@
@endif
</div>
......@@ -68,6 +69,7 @@
conforme modelo disponível no sítio eletrônico do Ministério das Cidades
(<a href="https://www.gov.br/cidades/pt-br/cadastramento/PS_Emendas_Discricionrias_4A_RP2_MOBILIDADE_rev3.pdf" target="_blank"> 7.1.1 do Manual disciplina rito para acesso aos recursos discricionários</a>).
</p>
<div class="form-group">
......
......@@ -37,6 +37,10 @@ Route::get('/acaoPrograma', 'ApiController@buscarAcaoPrograma');
Route::get('/oficios/ufs', 'ApiController@buscarUfsOficios');
Route::get('/oficios/municipios/{estado}', 'ApiController@buscarMunicipiosOficios');
Route::get('/ente_publico/municipio/{municipio}', 'ApiController@buscarEntePublico');
......
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