我想使用 javascript 获取多个账单的嵌套数组。下面我粘贴了我们得到的输入样本
var out = [{"tax":"CGST@9%","percent":"106.78"},{"tax":"SGST@9%","percent":"106.78"},{"tax":"[email protected]%","percent":3.57},{"tax":"[email protected]%","percent":3.57}];
var name = Sarath H;
var mobile = 9916751978;
var payment = Paytm;
var products = [{"product_code":"AMO-73","item":"AM VG Credit-5","quantity":"1","price":"1000","price_display":"847.46","tax":"18","taxgroup_name":"GST@18%","tax_linked":",25,26"},{"product_code":"AMO-77","item":"Roller coaster","quantity":2,"price":"200","price_display":"169.49","tax":"18","taxgroup_name":"GST@18%","tax_linked":",25,26"},{"product_code":"AMO-78","item":"Dancing car","quantity":"1","price":"150","price_display":"142.86","tax":"5","taxgroup_name":"GST@5%","tax_linked":",29,30"}];
var tax = [{"tax":"CGST@9%","percent":"76.27"},{"tax":"SGST@9%","percent":"76.27"},{"tax":"CGST@9%","percent":"30.51"},{"tax":"SGST@9%","percent":"30.51"},{"tax":"[email protected]%","percent":"3.57"},{"tax":"[email protected]%","percent":"3.57"}]
var total = 1550.00;
您可以创建对象数组,例如
var bills = [
{
address: 'bil1',
billdate: '',
....
data_product: [
{
adssd: 'asdas'
....
}
....
],
.....
}, {
address: 'bil2',
billdate: '',
....
data_product: [
{
adssd: 'asdas'
}
],
...
}
]
这是你需要的吗?否则提供更多描述
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句