From 425146d59afa3257f24bebdb0e9b32b0dd394e90 Mon Sep 17 00:00:00 2001
From: gabrielb
Date: Wed, 20 May 2026 12:57:55 -0300
Subject: [PATCH] =?UTF-8?q?feat(pagamentos):=20atualizar=20forma=20de=20pa?=
=?UTF-8?q?gamento=20e=20adicionar=20idContaCorrente=20nos=20mocks=20feat(?=
=?UTF-8?q?painel):=20modificar=20=C3=BAltimo=20pagamento=20para=20data=20?=
=?UTF-8?q?e=20adicionar=20formata=C3=A7=C3=A3o=20de=20data?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/portal/pagamentos.vue | 33 ++++++++++++++++++++-------------
src/pages/portal/painel.vue | 17 ++++++++++++++---
2 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/src/pages/portal/pagamentos.vue b/src/pages/portal/pagamentos.vue
index 5d2811b..450e5d6 100644
--- a/src/pages/portal/pagamentos.vue
+++ b/src/pages/portal/pagamentos.vue
@@ -12,26 +12,29 @@ const MOCK_ATIVO = true
const PAGAMENTOS_MOCK = [
{
id: 101,
+ idContaCorrente: 201,
descricao: 'IPTU 2024 — Parcela 1/3',
referencia: '202401',
dataPagamento: '2024-02-05',
- formaPagamento: 'BOLETO',
+ formaPagamento: 'GUIA',
valor: 382.50,
},
{
id: 102,
+ idContaCorrente: 202,
descricao: 'Taxa de Licença de Funcionamento',
referencia: '202403',
dataPagamento: '2024-03-20',
- formaPagamento: 'PIX',
+ formaPagamento: 'GUIA',
valor: 215.00,
},
{
id: 103,
+ idContaCorrente: null,
descricao: 'ISSQN 2023 — 4º Trimestre',
referencia: '202312',
dataPagamento: '2024-01-10',
- formaPagamento: 'BOLETO',
+ formaPagamento: 'DIRETO',
valor: 540.00,
},
]
@@ -70,15 +73,19 @@ async function carregar() {
async function baixarComprovante(pag) {
carregandoComprovante.value = pag.id
try {
- const buf = await portalService.getComprovante(pag.id)
- const url = URL.createObjectURL(new Blob([buf], { type: 'application/pdf' }))
- const a = document.createElement('a')
- a.href = url
- a.download = `comprovante-${pag.id}.pdf`
- a.click()
- URL.revokeObjectURL(url)
+ const buf = await portalService.getComprovante(pag.idContaCorrente)
+ const blob = new Blob([buf], { type: 'application/pdf' })
+ const url = URL.createObjectURL(blob)
+ const janela = window.open(url, '_blank')
+ if (!janela) {
+ const a = document.createElement('a')
+ a.href = url
+ a.download = `comprovante-${pag.idContaCorrente}.pdf`
+ a.click()
+ }
+ setTimeout(() => URL.revokeObjectURL(url), 60000)
} catch {
- mensagemErro.value = 'Erro ao baixar o comprovante.'
+ mensagemErro.value = 'Erro ao gerar o comprovante.'
} finally {
carregandoComprovante.value = null
}
@@ -170,12 +177,12 @@ const formaPagMap = {
diff --git a/src/pages/portal/painel.vue b/src/pages/portal/painel.vue
index be74bb5..6add2ca 100644
--- a/src/pages/portal/painel.vue
+++ b/src/pages/portal/painel.vue
@@ -19,7 +19,8 @@ const RESUMO_MOCK = {
totalDebitos: 1250.90,
certidoesAtivas: 2,
alvarasAndamento: 2,
- ultimoPagamento: 430.00,
+ ultimoPagamento: '2025-05-15',
+ valorUltimoPagamento: 430.00,
debitosVencidos: 1,
}
const ATIVIDADES_MOCK = [
@@ -72,6 +73,11 @@ function formatarMoeda(valor) {
return new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(Number.isNaN(n) ? 0 : n)
}
+function formatarData(data) {
+ if (!data) return ''
+ return new Date(data + 'T00:00:00').toLocaleDateString('pt-BR')
+}
+
const iconeAtividade = {
DEBITO: 'pi-receipt',
CERTIDAO: 'pi-file-check',
@@ -150,9 +156,14 @@ const iconeAtividade = {
- {{ formatarMoeda(resumo?.ultimoPagamento) }}
+ {{ formatarMoeda(resumo?.valorUltimoPagamento) }}
+
+
+ Último pagamento
+
+ · {{ formatarData(resumo.ultimoPagamento) }}
+
-
Último pagamento