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
6d167dff
Commit
6d167dff
authored
Jan 09, 2024
by
sandroresende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alteracao minhas demandas e correcao atualiza encaminhamento
parent
14905c04
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91006 additions
and
84146 deletions
+91006
-84146
DemandaController.php
app/Http/Controllers/Mod_codem/DemandaController.php
+127
-127
EncaminhamentoController.php
app/Http/Controllers/Mod_codem/EncaminhamentoController.php
+86
-91
EncaminhamentoDemanda.php
app/Mail/Mod_codem/EncaminhamentoDemanda.php
+3
-3
app.js
public/js/app.js
+90769
-83914
CadastroDemanda.vue
resources/assets/js/components/mod_codem/CadastroDemanda.vue
+1
-1
CadastroEncaminhamento.vue
...assets/js/components/mod_codem/CadastroEncaminhamento.vue
+1
-1
encaminhamento_demanda.blade.php
...iews/emails/modulo_codem/encaminhamento_demanda.blade.php
+1
-1
minhas_demandas.blade.php
resources/views/modulo_codem/minhas_demandas.blade.php
+18
-8
No files found.
app/Http/Controllers/Mod_codem/DemandaController.php
View file @
6d167dff
This diff is collapsed.
Click to expand it.
app/Http/Controllers/Mod_codem/EncaminhamentoController.php
View file @
6d167dff
...
...
@@ -36,7 +36,7 @@ class EncaminhamentoController extends Controller
*/
public
function
__construct
()
{
$this
->
middleware
(
'auth'
);
$this
->
middleware
(
'auth'
);
//$this->middleware('redirecionar');
...
...
@@ -47,157 +47,152 @@ class EncaminhamentoController extends Controller
*
* @return \Illuminate\Http\Response
*/
public
function
encaminhamentoNovo
(
Request
$request
){
public
function
encaminhamentoNovo
(
Request
$request
)
{
$demandaID
=
$request
->
demanda_id
;
return
view
(
'modulo_codem.cadastrar_encaminhamento'
,
compact
(
'demandaID'
));
}
return
view
(
'modulo_codem.cadastrar_encaminhamento'
,
compact
(
'demandaID'
));
}
public
function
salvarEncaminhamento
(
Request
$request
){
public
function
salvarEncaminhamento
(
Request
$request
)
{
//return $request->all();
$demandaID
=
$request
->
demanda_id
;
$encaminhamento
=
new
Encaminhamento
;
$encaminhamento
->
demanda_id
=
$request
->
demanda_id
;
$encaminhamento
->
usuario_id_demandado
=
$request
->
usuario
;
$encaminhamento
->
demanda_id
=
$request
->
demanda_id
;
$encaminhamento
->
usuario_id_demandado
=
$request
->
usuario
;
$usuario
=
Auth
::
user
();
$encaminhamento
->
user_id
=
$usuario
->
id
;
$encaminhamento
->
dte_encaminhamento
=
$request
->
dte_encaminhamento
;
$encaminhamento
->
dsc_encaminhamento
=
$request
->
dsc_encaminhamento
;
$encaminhamento
->
user_id
=
$usuario
->
id
;
$encaminhamento
->
dte_encaminhamento
=
$request
->
dte_encaminhamento
;
$encaminhamento
->
dsc_encaminhamento
=
$request
->
dsc_encaminhamento
;
$salvoSucesso
=
$encaminhamento
->
save
();
DB
::
beginTransaction
();
if
(
$salvoSucesso
){
if
(
$salvoSucesso
)
{
DB
::
commit
();
$ativarAba
=
'encaminhamento'
;
$usuarioDemandando
=
User
::
find
(
$request
->
usuario
);
Mail
::
to
(
$usuarioDemandando
->
email
)
->
send
(
new
EncaminhamentoDemanda
(
$encaminhamento
,
$usuarioDemandando
));
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento adicionado com sucesso!"
);
return
redirect
(
'codem/demanda/dados/'
.
$demandaID
.
'/'
.
$ativarAba
);
$ativarAba
=
'encaminhamento'
;
$usuarioDemandado
=
User
::
find
(
$request
->
usuario
);
Mail
::
to
(
$usuarioDemandado
->
email
)
->
send
(
new
EncaminhamentoDemanda
(
$encaminhamento
,
$usuarioDemandado
));
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento adicionado com sucesso!"
);
return
redirect
(
'codem/demanda/dados/'
.
$demandaID
.
'/'
.
$ativarAba
);
}
else
{
DB
::
rollBack
();
flash
()
->
erro
(
"Erro"
,
"Não foi possível adicionar o encaminhamento."
);
return
back
();
DB
::
rollBack
();
flash
()
->
erro
(
"Erro"
,
"Não foi possível adicionar o encaminhamento."
);
return
back
();
}
}
public
function
excluirEncaminhamento
(
$encaminhamento
){
public
function
excluirEncaminhamento
(
$encaminhamento
)
{
$encaminhamentoExcluido
=
Encaminhamento
::
where
(
'id'
,
$encaminhamento
)
->
get
();
$encaminhamentoExcluido
=
Encaminhamento
::
where
(
'id'
,
$encaminhamento
)
->
get
();
if
(
count
(
$encaminhamentoExcluido
)
==
0
)
{
flash
()
->
erro
(
"Erro"
,
"Não existe este encaminhamento."
);
return
back
();
}
if
(
count
(
$encaminhamentoExcluido
)
==
0
)
{
flash
()
->
erro
(
"Erro"
,
"Não existe este encaminhamento."
);
return
back
();
}
DB
::
beginTransaction
();
DB
::
beginTransaction
();
$encaminhamentoExcluido
=
Encaminhamento
::
find
(
$encaminhamento
);
$demandaId
=
$encaminhamentoExcluido
->
demanda_id
;
$encaminhamentoExcluido
=
Encaminhamento
::
find
(
$encaminhamento
);
$demandaId
=
$encaminhamentoExcluido
->
demanda_id
;
$encaminhamentoDeletado
=
$encaminhamentoExcluido
->
delete
();
if
(
$encaminhamentoDeletado
){
DB
::
commit
();
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento excluído com sucesso!"
);
$ativarAba
=
'encaminhamento'
;
if
(
$encaminhamentoDeletado
)
{
return
redirect
(
'codem/demanda/dados/'
.
$demandaId
.
'/'
.
$ativarAba
);
DB
::
commit
();
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento excluído com sucesso!"
);
$ativarAba
=
'encaminhamento'
;
return
redirect
(
'codem/demanda/dados/'
.
$demandaId
.
'/'
.
$ativarAba
);
}
else
{
DB
::
rollBack
();
flash
()
->
erro
(
"Erro"
,
"Não foi possível excluir o encaminhamento"
);
return
back
();
}
DB
::
rollBack
();
flash
()
->
erro
(
"Erro"
,
"Não foi possível excluir o encaminhamento"
);
return
back
();
}
}
public
function
dadosEncaminhamento
(
$encaminhamento
){
public
function
dadosEncaminhamento
(
$encaminhamento
)
{
$encaminhamentoVisualizado
=
Encaminhamento
::
find
(
$encaminhamento
);
if
(
!
$encaminhamentoVisualizado
->
bln_visualizado
)
{
if
(
!
$encaminhamentoVisualizado
->
bln_visualizado
)
{
$encaminhamentoVisualizado
->
bln_visualizado
=
true
;
$encaminhamentoVisualizado
->
dte_visualizacao
=
date
(
"Y-m-d h:i:s"
);
$encaminhamentoVisualizado
->
update
();
}
}
$encaminhamento
=
ViewEncaminhamentoDemanda
::
where
(
'id'
,
$encaminhamento
)
->
firstOrFail
();
$encaminhamento
=
ViewEncaminhamentoDemanda
::
where
(
'id'
,
$encaminhamento
)
->
firstOrFail
();
$demanda
=
Demanda
::
find
(
$encaminhamento
->
demanda_id
);
return
view
(
'modulo_codem.editar_encaminhamento'
,
compact
(
'encaminhamento'
,
'demanda'
));
return
view
(
'modulo_codem.editar_encaminhamento'
,
compact
(
'encaminhamento'
,
'demanda'
));
}
public
function
atualizarEncaminhamento
(
Request
$request
){
public
function
atualizarEncaminhamento
(
Request
$request
)
{
//return $request->all();
DB
::
beginTransaction
();
DB
::
beginTransaction
();
$demandaID
=
$request
->
demanda_id
;
$demandaID
=
$request
->
demanda_id
;
$encaminhamento
=
Encaminhamento
::
find
(
$request
->
encaminhamento_id
);
if
(
$request
->
usuario
)
{
$encaminhamento
->
email_usuario_demandado
=
$request
->
usuario
;
if
(
$request
->
usuario
!=
$encaminhamento
->
usuario_id_demandado
)
{
$encaminhamento
->
usuario_id_demandado
=
$request
->
usuario
;
}
if
(
$request
->
dsc_encaminhamento
){
$encaminhamento
->
dsc_encaminhamento
=
$request
->
dsc_encaminhamento
;
}
$encaminhamento
->
dsc_resposta_encaminhamento
=
$request
->
dsc_resposta_encaminhamento
;
$encaminhamento
->
bln_concluido
=
$request
->
bln_concluido
;
$encaminhamento
->
dte_resposta
=
$request
->
dte_resposta
;
if
(
$request
->
dsc_encaminhamento
)
{
$encaminhamento
->
dsc_encaminhamento
=
$request
->
dsc_encaminhamento
;
}
$salvoSucesso
=
$encaminhamento
->
update
();
$encaminhamento
->
dsc_resposta_encaminhamento
=
$request
->
dsc_resposta_encaminhamento
;
$encaminhamento
->
bln_concluido
=
$request
->
bln_concluido
;
$encaminhamento
->
dte_resposta
=
$request
->
dte_resposta
;
DB
::
beginTransaction
();
$salvoSucesso
=
$encaminhamento
->
update
();
if
(
$salvoSucesso
){
DB
::
commit
();
DB
::
beginTransaction
();
if
(
$encaminhamento
->
bln_concluido
){
$usuario
=
User
::
find
(
$encaminhamento
->
usuario_id_demandado
);
Mail
::
to
(
$usuario
->
email
)
->
send
(
new
RespostaEncaminhamento
(
$encaminhamento
,
$usuario
));
}
$ativarAba
=
'encaminhamento'
;
if
(
$salvoSucesso
)
{
DB
::
commit
();
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento atualizado com sucesso!"
);
return
redirect
(
'codem/demanda/dados/'
.
$demandaID
.
'/'
.
$ativarAba
);
}
else
{
DB
::
rollBack
();
flash
()
->
erro
(
"Erro"
,
"Não foi possível atualizar o encaminhamento."
);
return
back
();
}
if
(
$encaminhamento
->
bln_concluido
)
{
$usuario
=
User
::
find
(
$encaminhamento
->
usuario_id_demandado
);
Mail
::
to
(
$usuario
->
email
)
->
send
(
new
RespostaEncaminhamento
(
$encaminhamento
,
$usuario
));
}
$ativarAba
=
'encaminhamento'
;
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento atualizado com sucesso!"
);
return
redirect
(
'codem/demanda/dados/'
.
$demandaID
.
'/'
.
$ativarAba
);
}
else
{
DB
::
rollBack
();
flash
()
->
erro
(
"Erro"
,
"Não foi possível atualizar o encaminhamento."
);
return
back
();
}
}
}
app/Mail/Mod_codem/EncaminhamentoDemanda.php
View file @
6d167dff
...
...
@@ -13,18 +13,18 @@ class EncaminhamentoDemanda extends Mailable
public
$url
;
public
$encaminhamento
;
public
$usuarioDemanda
n
do
;
public
$usuarioDemandado
;
/**
* Create a new message instance.
*
* @return void
*/
public
function
__construct
(
$encaminhamento
,
$usuarioDemanda
n
do
)
public
function
__construct
(
$encaminhamento
,
$usuarioDemandado
)
{
$this
->
url
=
url
(
'/codem/demanda/encaminhamento/dados'
);
$this
->
encaminhamento
=
$encaminhamento
;
$this
->
usuarioDemanda
ndo
=
$usuarioDemandan
do
;
$this
->
usuarioDemanda
do
=
$usuarioDemanda
do
;
}
/**
...
...
public/js/app.js
View file @
6d167dff
This diff is collapsed.
Click to expand it.
resources/assets/js/components/mod_codem/CadastroDemanda.vue
View file @
6d167dff
...
...
@@ -113,7 +113,7 @@
</select>
</div>
<div
class=
"col col-xs-12 col-sm-3"
>
<label
for=
"usuario"
>
Demanda
n
do
</label>
<label
for=
"usuario"
>
Demandado
</label>
<select
id=
"usuario"
class=
"form-select br-select"
...
...
resources/assets/js/components/mod_codem/CadastroEncaminhamento.vue
View file @
6d167dff
...
...
@@ -47,7 +47,7 @@
</select>
</div>
<div
class=
"col col-xs-12 col-sm-3"
>
<label
for=
"usuario"
>
Demanda
n
do
</label>
<label
for=
"usuario"
>
Demandado
</label>
<select
id=
"usuario"
class=
"form-select br-select"
...
...
resources/views/emails/modulo_codem/encaminhamento_demanda.blade.php
View file @
6d167dff
@
component
(
'mail::message'
)
# Nova Demanda Encaminhada para sua Atenção - Demanda Nº {{$encaminhamento->demanda_id}}
<
p
>
Prezado
(
a
)
{{
$usuarioDemanda
n
do
->
name
}},
</
p
>
<
p
>
Prezado
(
a
)
{{
$usuarioDemandado
->
name
}},
</
p
>
<
br
>
<
br
>
<
p
>
...
...
resources/views/modulo_codem/minhas_demandas.blade.php
View file @
6d167dff
...
...
@@ -35,16 +35,18 @@
<tr class="
text
-
center
">
<th>#</th>
<th>ID</th>
<th>Secretaria Demandada</th>
<th>Departamento Demandado</th>
<th>Setor Demandado</th>
<th>Demandado</th>
<th>Tema</th>
<th>Subtema</th>
<th>Situação</th>
<th>Tipo Interessado</th>
<th>Data Solicitação</th>
<th>Prazo em dias</th>
<th>Previsão Conclusão</th>
<th>Atraso</th>
<th>Interessado (s)</th>
<th>Descrição</th>
<th class="
acao
">Ação</th>
</tr>
</thead>
...
...
@@ -64,15 +66,19 @@
@endif
</td>
<td>
{
{$demanda->demanda_id}
}
</td>
<td>
{
{$demanda->txt_nome_secretaria}
}
</td>
<td>
{
{$demanda->txt_sigla_departamento}
}
</td>
<td>
{
{$demanda->txt_sigla_setor}
}
</td>
<td>
{
{$demanda->nome_demandado}
}
</td>
<td>
{
{$demanda->txt_tema}
}
</td>
<td>
{
{$demanda->txt_sub_tema}
}
</td>
<td>
{
{$demanda->txt_situacao}
}
</td>
<td>
{
{$demanda->txt_tipo_interessado}
}
</td>
<td>{{(
$demanda->dte_solicitacao
) ? date('d/m/Y',strtotime(
$demanda->dte_solicitacao
)) : ''}}</td>
<td>
{
{$demanda->num_max_dias}
}
</td>
<td>{{(
$demanda->dte_previsao_conclusao
) ? date('d/m/Y',strtotime(
$demanda->dte_previsao_conclusao
)) : ''}}</td>
<td>{{(
$demanda->qtd_dias_atraso
)>0 ?
$demanda->qtd_dias_atraso
: 0}}</td>
<td>
{
{$demanda->txt_nome_interessado}
}
</td>
<td>
{
{$demanda->txt_descricao_demanda}
}
</td>
<td class="
acao
"><a class="
br
-
button
circle
primary
small
" href='{{ url("
codem
/
demanda
/
dados
/
$demanda
->
demanda_id
/
demanda
")}}'><i class="
fas
fa
-
eye
"></i></a></td>
</tr>
@endforeach
...
...
@@ -96,8 +102,10 @@
<th>#</th>
<th>ID</th>
<th>Data do encaminhamento</th>
<th>Usuário</th>
<th>Setor</th>
<th>Secretaria Demandante</th>
<th>Departamento Demandante</th>
<th>Setor Demandante</th>
<th>Demandante</th>
<th>Concluído?</th>
<th>Data da Resposta?</th>
<th colspan="
2
" class="
text
-
center
">Ação</th>
...
...
@@ -115,8 +123,10 @@
</td>
<td>
{
{$dados->id}
}
</td>
<td>
{
{date('d/m/Y',strtotime($dados->dte_encaminhamento))}
}
</td>
<td>
{
{$dados->email}
}
</td>
<td>
{
{$dados->txt_nome_secretaria}
}
</td>
<td>
{
{$dados->txt_sigla_departamento}
}
</td>
<td>
{
{$dados->txt_sigla_setor}
}
</td>
<td>
{
{$dados->nome_usuario_demandante}
}
</td>
<td>@if(
$dados->bln_concluido
) Sim @else Não @endif</td>
<td>@if(
$dados->dte_resposta
)
{
{date('d/m/Y',strtotime($dados->dte_resposta))}
}
@endif</td>
<td>
...
...
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