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 = {

- + +

+

+ Último pagamento +

-

Último pagamento