Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sistema_mcid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marcio neto
sistema_mcid
Commits
67c32cf3
Commit
67c32cf3
authored
Oct 25, 2023
by
sandroresende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filtro usuário por tipo e modulo
parent
a63cd95a
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
727 additions
and
95 deletions
+727
-95
UsuariosController.php
app/Http/Controllers/UsuariosController.php
+9
-2
app.js
public/js/app.js
+556
-89
app.js
resources/assets/js/app.js
+1
-0
FiltroUsuarios.vue
...assets/js/components/mod_sistema/admin/FiltroUsuarios.vue
+159
-0
filtroUsuarios.blade.php
...urces/views/modulo_sistema/admin/filtroUsuarios.blade.php
+2
-4
No files found.
app/Http/Controllers/UsuariosController.php
View file @
67c32cf3
...
...
@@ -166,8 +166,15 @@ class UsuariosController extends Controller
$subtitulo1
=
trim
(
$municipio
->
ds_municipio
)
.
'/'
.
$estado
->
txt_sigla_uf
;
}
$where
[]
=
[
'modulo_sistema_id'
,
2
];
// $where[] = ['tipo_usuario_id',9];
if
(
$request
->
tipoUsuario
){
$where
[]
=
[
'tipo_usuario_id'
,
$request
->
tipoUsuario
];
}
if
(
$request
->
moduloSistema
){
$where
[]
=
[
'modulo_sistema_id'
,
$request
->
moduloSistema
];
}
$usuarios
=
User
::
leftjoin
(
'opc_tipo_usuario'
,
'users.tipo_usuario_id'
,
'='
,
'opc_tipo_usuario.id'
)
->
leftjoin
(
'opc_status_usuario'
,
'users.status_usuario_id'
,
'='
,
'opc_status_usuario.id'
)
...
...
public/js/app.js
View file @
67c32cf3
This diff is collapsed.
Click to expand it.
resources/assets/js/app.js
View file @
67c32cf3
...
...
@@ -36,6 +36,7 @@ Vue.component('tabela-relatorios', require('./components/gerais/TabelaRelatorios
Vue
.
component
(
'filtro-oficio'
,
require
(
'./components/mod_sistema/admin/arquivos/FiltroOficio.vue'
));
Vue
.
component
(
'valida-oficio'
,
require
(
'./components/mod_sistema/admin/arquivos/ValidaOficio.vue'
));
Vue
.
component
(
'tabela-oficios'
,
require
(
'./components/mod_sistema/admin/arquivos/TabelaOficios.vue'
));
Vue
.
component
(
'filtro-usuarios'
,
require
(
'./components/mod_sistema/admin/FiltroUsuarios.vue'
));
///mod propostas
...
...
resources/assets/js/components/mod_sistema/admin/FiltroUsuarios.vue
0 → 100644
View file @
67c32cf3
<
template
>
<div
class=
"form-group"
>
<div
class=
"row"
>
<div
class=
"column col-xs-12 col-md-4"
>
<label
for=
"uf"
>
UF
</label>
<select
id=
"estado"
class=
"form-select br-select"
name=
"estado"
:required=
"requeruf == 'true'"
@
change=
"onChangeEstado"
v-model=
"estado"
>
<option
value=
""
>
Escolha um Estado:
</option>
<option
v-for=
"estado in estados"
v-text=
"estado.txt_uf"
:value=
"estado.id"
:key=
"estado.id"
></option>
</select>
</div>
<div
class=
"column col-xs-12 col-md-8"
>
<!-- municipio -->
<label
v-if=
"!complementonomelabelmun"
for=
"municipio"
>
Município
</label>
<label
v-if=
"complementonomelabelmun"
for=
"municipio"
>
Município
{{
complementonomelabelmun
}}
</label>
<select
id=
"municipio"
class=
"form-select br-select"
name=
"municipio"
:required=
"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.id"
:key=
"municipio.id"
></option>
</select>
</div>
</div>
<div
class=
"row"
>
<div
class=
"column col-xs-12 col-md-4"
>
<label
for=
"tipoUsuario"
>
Tipo Usuário
</label>
<select
id=
"tipoUsuario"
class=
"form-select br-select"
name=
"tipoUsuario"
v-model=
"tipoUsuario"
>
<option
value=
""
>
Escolha um tipo de usuário:
</option>
<option
v-for=
"tipoUsuario in tipoUsuarios"
v-text=
"tipoUsuario.txt_tipo_usuario"
:value=
"tipoUsuario.id"
:key=
"tipoUsuario.id"
></option>
</select>
</div>
<div
class=
"column col-xs-12 col-md-8"
>
<!-- municipio -->
<label
for=
"moduloSistema"
>
Módulo Sistema
</label>
<select
id=
"moduloSistema"
class=
"form-select br-select"
name=
"moduloSistema"
v-model=
"moduloSistema"
>
<option
value=
""
>
Escolha um módulo
</option>
<option
v-for=
"moduloSistema in moduloSistemas"
v-text=
"moduloSistema.txt_modulo_sistema"
:value=
"moduloSistema.id"
:key=
"moduloSistema.id"
></option>
</select>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:[
'url'
,
'municipioselecionado'
,
'ufselecionada'
,
'requermunicipio'
,
'requeruf'
,
'complementonomelabelmun'
],
data
(){
return
{
estados
:
''
,
estado
:
''
,
municipios
:
''
,
municipio
:
''
,
textoEscolhaMunicipio
:
'Filtre o Estado'
,
buscando
:
false
,
tipoUsuarios
:
''
,
tipoUsuario
:
''
,
moduloSistemas
:
''
,
moduloSistema
:
''
,
// requeruf:'true',
// requermunicipio:'true'
}
},
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
;
}).
catch
(
erro
=>
{
console
.
log
(
erro
);
});
axios
.
get
(
this
.
url
+
'/api/tipo_usuario'
).
then
(
resposta
=>
{
//console.log(resposta.data);
this
.
tipoUsuarios
=
resposta
.
data
;
}).
catch
(
erro
=>
{
console
.
log
(
erro
);
});
axios
.
get
(
this
.
url
+
'/api/modulo_sistema'
).
then
(
resposta
=>
{
//console.log(resposta.data);
this
.
moduloSistemas
=
resposta
.
data
;
}).
catch
(
erro
=>
{
console
.
log
(
erro
);
});
this
.
estado
=
''
;
this
.
municipio
=
''
;
if
(
this
.
municipioselecionado
||
this
.
municipio
){
axios
.
get
(
this
.
url
+
'/api/municipio/estado/'
+
this
.
municipioselecionado
).
then
(
resposta
=>
{
this
.
estado
=
resposta
.
data
;
this
.
onChangeEstado
();
this
.
municipio
=
this
.
municipioselecionado
;
}).
catch
(
error
=>
{
console
.
log
(
error
);
});
}
else
{
this
.
estado
=
''
;
this
.
municipio
=
''
;
}
if
(
this
.
ufselecionada
){
this
.
estado
=
this
.
ufselecionada
;
this
.
onChangeEstado
();
document
.
getElementById
(
"estado"
).
disabled
=
true
;
}
}
}
</
script
>
resources/views/modulo_sistema/admin/filtroUsuarios.blade.php
View file @
67c32cf3
...
...
@@ -32,11 +32,9 @@
@csrf
<div class="
well
">
<div class="
box
">
<select-uf-municipio
coluf="
column
col
-
xs
-
12
col
-
sm
-
6
"
colmun="
column
col
-
xs
-
12
col
-
sm
-
6
"
<filtro-usuarios
:url="
'{{ url('
/
') }}'
">
</
select-uf-municipio
>
</
filtro-usuarios
>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment