var j = 1;
if (rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
id += row.CommodityID + ","; //商品ID
var n = parseInt(db) * parseInt($("input[name='cminNum']").eq(row.Seq).val()); //最小数量
allnum = parseInt(allnum) + parseInt($("input[name='cminNum']").eq(row.Seq).val()); //总数量累计

// 金额
var s = parseInt(db) * parseInt($("td[field='Price']>div").eq(row.Seq + 1).html()) * n; //最小金额
allsum = parseInt(allsum) + parseInt($("td[field='Price']>div").eq(row.Seq + 1).html()) * n; //总金额累计


nums += n + ","; //每个商品数量分割
minnum = row.CommodityMinNum; //商品最小数量
maxnum = row.CommodityMaxNum; //商品最大数量

// 金额
minsum = row.CommodityMinSum; //商品最小金额
maxsum = row.CommodityMaxSum; //商品最大金额

j += i;
if (parseInt(row.Num) < parseInt(allnum)) {
alert(row.CommodityName + ":商品库存不足!");
}
}

posted on 2015-06-04 10:59  王洪洪  阅读(211)  评论(0编辑  收藏  举报