From 104e2e327e29593e0edb8e6c71ac58b482010c73 Mon Sep 17 00:00:00 2001 From: Rubi Almora Date: Fri, 6 Mar 2026 11:44:15 -0600 Subject: [PATCH] =?UTF-8?q?FIX:Errores=20en=20creaci=C3=B3n=20de=20concept?= =?UTF-8?q?os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/App/ConceptSection.vue | 81 ++++++++++++------- src/components/App/PhotoUpload.vue | 31 ++++++++ src/lang/es.js | 5 ++ src/pages/App/Concept/Modal/Edit.vue | 82 ++++++++++---------- src/pages/App/Membership/Create.vue | 48 ++++-------- src/pages/App/Membership/Form.vue | 107 ++++++++++++++------------ 6 files changed, 203 insertions(+), 151 deletions(-) create mode 100644 src/components/App/PhotoUpload.vue diff --git a/src/components/App/ConceptSection.vue b/src/components/App/ConceptSection.vue index 9e1909b..63bc2cd 100644 --- a/src/components/App/ConceptSection.vue +++ b/src/components/App/ConceptSection.vue @@ -17,6 +17,7 @@ const form = useForm({ legal_instrument: "", article: "", content: "", + motivation: "", min_amount_uma: "", max_amount_uma: "", min_amount_peso: "", @@ -35,6 +36,7 @@ const resetForm = () => { form.legal_instrument = ""; form.article = ""; form.content = ""; + form.motivation = ""; form.min_amount_uma = ""; form.max_amount_uma = ""; form.min_amount_peso = ""; @@ -91,6 +93,14 @@ const isFixedType = computed(() => { ); }); +const conceptTypeId = computed(() => { + return typeof form.concept_type === "object" && form.concept_type?.id + ? form.concept_type.id + : form.concept_type; +}); + +const isFineConcept = computed(() => conceptTypeId.value === "fine"); + /** Cargar cosas */ onMounted(async () => { api.get(apiURL("directions"), { @@ -114,16 +124,23 @@ const handleSubmit = () => { ? form.direction_id.id : Number(form.direction_id), unit_id: - typeof form.unit_id === "object" ? form.unit_id.id : Number(form.unit_id), + form.unit_id != null + ? typeof form.unit_id === "object" + ? form.unit_id.id + : Number(form.unit_id) + : null, concept_type: typeof form.concept_type === "object" ? form.concept_type.id : String(form.concept_type), short_name: form.short_name, name: form.name, - legal_instrument: form.legal_instrument, - article: form.article, - content: form.content, + ...(isFineConcept.value && { + legal_instrument: form.legal_instrument, + article: form.article, + content: form.content, + motivation: form.motivation, + }), charge_type: chargeTypeId.value, }; @@ -218,29 +235,39 @@ const handleSubmit = () => { required /> -
- - -
-