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.