商品金额及数量的计算

标题商品金额及数量的计算

function backMoneyShow() {
                // debugger
                var tableBak = table.cache.table_productTwo;
                if (tableBak==undefined){
                    tableBak=[];
                }
                var backMoneySum=parseFloat(0);
                var backMoneyNo=parseFloat(0);
                for (var i=0;i<tableBak.length;i++){
                    if (tableBak[i].sj!=undefined && tableBak[i].goodsAmount!=undefined){
                        backMoneySum+=parseFloat(tableBak[i].sj) * parseFloat(tableBak[i].goodsAmount);
                        backMoneyNo+=parseFloat(tableBak[i].goodsAmount);
                    }
                }
                $("#txtSearch_CentershowBackMoney").text(backMoneySum.toFixed(2));
                $("#txtSearch_CentershowBackSum").text(backMoneyNo);
                // $("#txtSearch_CentershowBackMoney").style.color='red';
                // $("#txtSearch_CentershowBackSum").style.color='red';
            }

你可能感兴趣的:(layui,JavaScript,前端)