From 8d513d215c1d7e4edb9946e9bdc82fbb6af542cb Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Wed, 26 Nov 2025 19:48:09 -0600 Subject: [PATCH] =?UTF-8?q?MOD:=20mejorar=20la=20gesti=C3=B3n=20del=20form?= =?UTF-8?q?ulario=20en=20ConceptSection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/App/ConceptSection.vue | 30 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/components/App/ConceptSection.vue b/src/components/App/ConceptSection.vue index 0269f14..2f7ede8 100644 --- a/src/components/App/ConceptSection.vue +++ b/src/components/App/ConceptSection.vue @@ -26,6 +26,23 @@ const form = useForm({ charge_type: null, }); +const resetForm = () => { + form.direction_id = null; + form.unit_id = null; + form.short_name = ""; + form.name = ""; + form.legal_instrument = ""; + form.article = ""; + form.content = ""; + form.min_amount_uma = ""; + form.max_amount_uma = ""; + form.min_amount_peso = ""; + form.max_amount_peso = ""; + form.unit_cost_uma = ""; + form.unit_cost_peso = ""; + form.charge_type = null; +}; + const addresses = ref([]); const units = ref([]); @@ -36,8 +53,8 @@ const chargeTypeId = computed(() => { }); const chargeTypesOptions = ref([ - { id: 'uma_range', name: 'UMA Range' }, - { id: 'peso_range', name: 'Peso Range' }, + { id: 'uma_range', name: 'Rango en UMA' }, + { id: 'peso_range', name: 'Rango en Peso' }, { id: 'uma_fixed', name: 'UMA unitario' }, { id: 'peso_fixed', name: 'Peso unitario' }, ]); @@ -76,8 +93,8 @@ onMounted(async () => { /** Métodos */ const handleSubmit = () => { const baseData = { - direction_id: typeof form.direction === 'object' ? form.direction.id : Number(form.direction_id), - unit_id: form.unit ? (typeof form.unit === 'object' ? form.unit.id : Number(form.unit)) : null, + direction_id: typeof form.direction_id === 'object' ? form.direction_id.id : Number(form.direction_id), + unit_id: typeof form.unit_id === 'object' ? form.unit_id.id : Number(form.unit_id), short_name: form.short_name, name: form.name, legal_instrument: form.legal_instrument, @@ -106,6 +123,7 @@ const handleSubmit = () => { } emit('concept-created', baseData); + resetForm(); }; @@ -118,7 +136,7 @@ const handleSubmit = () => {
{ />