Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RELEASE DE NATAL #106

Draft
wants to merge 6 commits into
base: homol
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions backend/src/etapa/etapa.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export class EtapaService {
if (!prismaCtx) await this.lockCronograma(basicSelf.cronograma_id);

this.logger.log(`atualizando etapa id=${id}: ${JSON.stringify(dto)}`);
const responsaveis = dto.responsaveis === null ? [] : dto.responsaveis;
const geolocalizacao = dto.geolocalizacao;
delete dto.geolocalizacao;

Expand Down Expand Up @@ -438,6 +437,8 @@ export class EtapaService {
relacionamentoId
);
}
// não há responsáveis para PS no sistema legado, então limpa tudo
await this.updateResponsaveis([], self, prismaTx);
} else {
await this.updateResponsaveis(dto.responsaveis, self, prismaTx);
}
Expand Down Expand Up @@ -520,8 +521,6 @@ export class EtapaService {
}
}

await this.updateResponsaveis(responsaveis, self, prismaTx);

// apaga tudo por enquanto, não só as que têm algum crono dessa meta
// isso aqui pq tem q cruzar com atv->ini-> chegar na meta
await prismaTx.statusMetaCicloFisico.deleteMany();
Expand Down
2 changes: 1 addition & 1 deletion backend/src/pp/portfolio/portfolio.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class PortfolioService {
this.logger.debug(
`Filtro Projeto.administrador_no_orgao/ProjetoMDO.administrador_no_orgao: orgao_id=${orgao_id}`
);
} else {
} else if (!user.hasSomeRoles(['Projeto.administrador', 'ProjetoMDO.administrador'])) {
// ...
const projetoRows = await this.prisma.projeto.groupBy({
by: ['portfolio_id'],
Expand Down
2 changes: 1 addition & 1 deletion backend/src/variavel/variavel.ciclo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class VariavelCicloService {
AND: [...this.variavelService.getVariavelWhereSet(filters), { tipo: 'Global' }],
});

if (user.hasSomeRoles(['CadastroVariavelGlobal.administrador_no_orgao'])) {
if (!isRoot && user.hasSomeRoles(['CadastroVariavelGlobal.administrador_no_orgao'])) {
const orgao_id = user.orgao_id;
if (!orgao_id) throw new BadRequestException('Usuário sem órgão associado');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
Data de vigência
</th>
<th>Nome</th>
<th>Último Status</th>
<th />
</tr>
</thead>
Expand All @@ -51,6 +52,9 @@
<td>
{{ item.nome || '-' }}
</td>
<td>
{{ obterUltimoStatus(item.historico_status) }}
</td>
<td class="tr">
<SmaeLink
class="like-a__text"
Expand Down Expand Up @@ -194,6 +198,16 @@ async function iniciar() {
distribuicaoRecursos.buscarTudo({ transferencia_id: params.transferenciaId });
}

function obterUltimoStatus(historico = []) {
const ultimoStatus = historico.at(-1);

if (!ultimoStatus) {
return '-';
}

return ultimoStatus.status_base.nome;
}

iniciar();

onUnmounted(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from 'pinia';
import { defineAsyncComponent, ref } from 'vue';
import { computed, defineAsyncComponent, ref } from 'vue';
import LoadingComponent from '@/components/LoadingComponent.vue';
import SmallModal from '@/components/SmallModal.vue';
import ListaDeDistribuicaoItem from '@/components/transferencia/ListaDeDistribuicaoItem.vue';
Expand Down Expand Up @@ -44,6 +44,26 @@ const { temPermissãoPara } = storeToRefs(authStore);

const ConfigurarWorkflow = ref(false);

const recursoFinanceiroValores = computed(() => {
if (!transferenciaEmFoco.value) {
return [
{ label: 'Valor', valor: '-' },
{ label: 'Valor contrapartida', valor: '-' },
{ label: 'Custeio', valor: '-' },
{ label: 'Investimento', valor: '-' },
{ label: 'Valor total', valor: '-' },
];
}

return [
{ label: 'Valor', valor: dinheiro(transferenciaEmFoco.value.valor) },
{ label: 'Valor contrapartida', valor: dinheiro(transferenciaEmFoco.value.valor_contrapartida) },
{ label: 'Custeio', valor: dinheiro(transferenciaEmFoco.value.custeio) },
{ label: 'Investimento', valor: dinheiro(transferenciaEmFoco.value.investimento) },
{ label: 'Valor total', valor: dinheiro(transferenciaEmFoco.value.valor_total) },
];
});

function deletarWorkflow() {
alertStore.confirmAction('Tem certeza?', async () => {
if (await workflowAndamento.deletarWorklow()) {
Expand Down Expand Up @@ -357,7 +377,9 @@ distribuicaoRecursos.buscarTudo({ transferencia_id: props.transferenciaId });
<svg
width="20"
height="20"
><use xlink:href="#i_edit" /></svg>
>
<use xlink:href="#i_edit" />
</svg>
Editar
</SmaeLink>
</div>
Expand Down Expand Up @@ -640,62 +662,93 @@ distribuicaoRecursos.buscarTudo({ transferencia_id: props.transferenciaId });
</div>
</div>

<div class="flex g2 center mt3 mb2">
<h3 class="w700 tc600 t20 mb0">
Recurso Financeiro
</h3>
<hr class="f1">
<SmaeLink
:to="{ name: 'RegistroDeTransferenciaEditar' }"
title="Editar recursos financeiros"
class="btn with-icon bgnone tcprimary p0"
>
<svg
width="20"
height="20"
><use xlink:href="#i_edit" /></svg>
Editar
</SmaeLink>
</div>
<section class="recurso-financeiro">
<div class="flex g2 center mt3 mb2">
<h3 class="w700 tc600 t20 mb0">
Recurso Financeiro
</h3>

<div class="flex flexwrap g2 mb3">
<div class="f1">
<dl class="mb2">
<dt class="t16 w700 mb05 tamarelo">
Empenho
</dt>
<dd>
{{ transferenciaEmFoco?.empenho ? 'Sim' : 'Não' }}
</dd>
</dl>
<dl class="mb2">
<dt class="t16 w700 mb05 tamarelo">
Ordenador de despesas
</dt>
<dd>
{{ transferenciaEmFoco?.ordenador_despesa || '-' }}
</dd>
</dl>
<dl class="mb2">
<dt class="t16 w700 mb05 tamarelo">
Gestor municipal do contrato
</dt>
<dd>
{{ transferenciaEmFoco?.gestor_contrato || '-' }}
</dd>
</dl>
<hr class="f1">

<SmaeLink
:to="{ name: 'RegistroDeTransferenciaEditar' }"
title="Editar recursos financeiros"
class="btn with-icon bgnone tcprimary p0"
>
<svg
width="20"
height="20"
>
<use xlink:href="#i_edit" />
</svg>
Editar
</SmaeLink>
</div>
<div class="grid f1">
<dl class="mb1">
<dt class="t16 w700 mb05 tamarelo">
Dotação
</dt>
<dd>
{{ transferenciaEmFoco?.dotacao || '-' }}
</dd>
</dl>

<div class="flex flexwrap g4 mb3">
<div class="f1">
<div class="recurso-financeiro-valores">
<div
v-for="(valorItem, valorItemIndex) in recursoFinanceiroValores"
:key="`recurso-financeiro-valores--${valorItemIndex}`"
class="recurso-financeiro-valores__item flex f1 spacebetween center p1"
>
<div class="t16 w700 tamarelo">
{{ valorItem.label }}
</div>

<div>
{{ valorItem.valor }}
</div>
</div>
</div>
</div>

<div class="flex column g4 p1 f1">
<div>
<div class="t16 w700 mb05 tamarelo">
Empenho
</div>

<div>
{{ transferenciaEmFoco?.empenho ? 'Sim' : 'Não' }}
</div>
</div>

<div>
<div class="t16 w700 mb05 tamarelo">
Ordenador de despesas
</div>

<div>
{{ transferenciaEmFoco?.ordenador_despesa ?? '-' }}
</div>
</div>
</div>

<div class="flex column g4 p1 f1">
<div>
<div class="t16 w700 mb05 tamarelo">
Dotação
</div>

<div>
{{ transferenciaEmFoco?.dotacao ?? '-' }}
</div>
</div>

<div>
<div class="t16 w700 mb05 tamarelo">
Gestor municipal do contrato
</div>

<div>
{{ transferenciaEmFoco?.gestor_contrato ?? '-' }}
</div>
</div>
</div>
</div>
</div>
</section>

<div class="flex g2 center mt3 mb2">
<h3 class="w700 tc600 t20 mb0">
Expand Down Expand Up @@ -778,7 +831,9 @@ distribuicaoRecursos.buscarTudo({ transferencia_id: props.transferenciaId });
<svg
width="20"
height="20"
><use xlink:href="#i_edit" /></svg>
>
<use xlink:href="#i_edit" />
</svg>
Editar
</SmaeLink>
</div>
Expand All @@ -790,6 +845,7 @@ distribuicaoRecursos.buscarTudo({ transferencia_id: props.transferenciaId });
class="mb2 card-shadow p2"
/>
</template>

<style scoped lang="less">
.parlamentares{
padding: 20px;
Expand Down Expand Up @@ -841,4 +897,8 @@ section + section {
.transferencia-sei-body__item--lido {
width: 55px;
}

.recurso-financeiro-valores__item {
border-bottom: 1px solid #E3E5E8;
}
</style>