Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

292
Vistas
Can't trigger a function in Vue js

This is my JS code

 getItemData:function(e){
            var id = e.target.getAttribute('data-id');
            var uom = e.target.options[e.target.options.selectedIndex].dataset.uom;
            var uomId = e.target.options[e.target.options.selectedIndex].dataset.uomid;
            
            if(uomId == null || uom == null){
                $('#uom_item'+id).html('<option value="" selected></option>');
            }
            this.GetItemTotalAmount(id);
            this.getItemGroupUOM(id);
            this.getVatStructure(id);
        },
getVatStructure:function (id)
        {
            var trans_sub_type = $('#trans_sub_type').val();
            var prod_type = $('#product_type').val();
            var hsCode = $('#hs_code'+id).val()
            var defaultVatRate = $('#default_vat_rate_id'+id).val()
            $.ajax({
                url:'get-vat-structure-by/item',
                method:'get',
                data:{'tranSubType':trans_sub_type,'prod_type':prod_type,'hs_code':hsCode,'defaultVatRate':defaultVatRate},
                success:function(res){
                    // console.log(res);
                    $('#vat_structure_rate'+id).html(res.result);
                    if (!res.isTrue)
                    {
                        $('#vat_item'+id).val(null);
                        $('#vat_amount_item'+id).val(null);
                    }
                    $('#vat_structure_rate'+id).trigger("change");
                    console.log('trg');


                },
                error:function(err){
                    console.log(err);
                }
            });
        },
        getVatData:function (e)
        {
            console.log('inside');
            var id = e.target.getAttribute('data-id');
            var vat = e.target.options[e.target.options.selectedIndex].dataset.vat;
            $('#vat_item'+id).val(vat);
            this.GetItemTotalAmount(id);
        }

I want to trigger getVatData() which is an on change function declared in HTML as @change="getVatData" function from getVatStructure function. How can I do that. I have tried the following but now working.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda