From aa9e062485fdaf6dc86d151eef6435bf04ff3750 Mon Sep 17 00:00:00 2001 From: Junior Date: Sun, 15 Mar 2026 09:33:02 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20campo=20reajuste=20usa=20lista=20fixa?= =?UTF-8?q?=20com=20op=C3=A7=C3=A3o=20Outro=20para=20texto=20livre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adiciona select com índices pré-definidos (IPCA, IGPM, INPC, INCC, IPC-FIPE, SELIC, IPCA-E) e opção "Outro" que revela input de texto livre. Campo órgão passa a ser dropdown dos órgãos cadastrados. Co-Authored-By: Claude Sonnet 4.6 --- front-end/app/pages/gestao/contratos.vue | 28 ++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/front-end/app/pages/gestao/contratos.vue b/front-end/app/pages/gestao/contratos.vue index 49eaf74..022ac39 100644 --- a/front-end/app/pages/gestao/contratos.vue +++ b/front-end/app/pages/gestao/contratos.vue @@ -71,6 +71,20 @@ const closeMenu = () => { openMenuId.value = null } onMounted(() => document.addEventListener('click', closeMenu)) onUnmounted(() => document.removeEventListener('click', closeMenu)) +// --- Reajuste --- +const REAJUSTES = ['IPCA', 'IGPM', 'INPC', 'INCC', 'IPC-FIPE', 'SELIC', 'IPCA-E', 'Outro'] +const createReajusteSelect = ref('') +const editReajusteSelect = ref('') + +watch(createReajusteSelect, (v) => { + if (v !== 'Outro') createForm.reajuste = v + else createForm.reajuste = '' +}) +watch(editReajusteSelect, (v) => { + if (v !== 'Outro') editForm.reajuste = v + else editForm.reajuste = '' +}) + // --- Modal Criar --- const showCreate = ref(false) const createForm = reactive({ @@ -88,6 +102,7 @@ async function criarContrato() { await apiFetch('/contracts', { method: 'POST', body: { ...createForm } }) showCreate.value = false Object.assign(createForm, { numero: '', orgao: '', objeto: '', valor: 0, data_inicio: '', data_fim: '', fiscal_contrato: '', reajuste: '', prorrogacao_maxima: '', sla: '', status: 'ativo' }) + createReajusteSelect.value = '' await refresh() } catch (err: any) { createError.value = err?.data?.error || 'Erro ao criar contrato.' @@ -117,6 +132,7 @@ function abrirEditar(c: ApiContract) { prorrogacao_maxima: c.ProrrogacaoMaxima ? c.ProrrogacaoMaxima.slice(0, 10) : '', sla: c.Sla, status: c.Status, }) + editReajusteSelect.value = REAJUSTES.includes(c.Reajuste) ? c.Reajuste : (c.Reajuste ? 'Outro' : '') editError.value = '' showEdit.value = true } @@ -321,7 +337,11 @@ async function downloadArquivo(contractId: string, fileId: string, nome: string)
- + +
@@ -386,7 +406,11 @@ async function downloadArquivo(contractId: string, fileId: string, nome: string)
- + +