|  |  | 
 |  |  |                                     <th>消费可得积分</th> | 
 |  |  |                                     <th>关联ERP产品</th> | 
 |  |  |                                     <th>排序</th> | 
 |  |  |                                     <th>自购返佣</th> | 
 |  |  |                                     <th>推广提成</th> | 
 |  |  |                                     <th>邀请提成</th> | 
 |  |  |                                     <th>兑换所需金额</th> | 
 |  |  | 
 |  |  |         <input autocomplete="off"   type="hidden" class="form-control" name="erpGoodsCode"> | 
 |  |  |     </div></td> | 
 |  |  |     <td><input autocomplete="off"   type="text" class="form-control" name=""></td> | 
 |  |  |         <td><input autocomplete="off"   type="text" class="form-control" name=""></td> | 
 |  |  |         <td><input autocomplete="off"   type="text" class="form-control" name=""></td> | 
 |  |  |         <td><input autocomplete="off"   type="text" class="form-control" name=""></td> | 
 |  |  |         <td><input autocomplete="off"   type="text" class="form-control" name=""></td> | 
 |  |  | 
 |  |  |             if (goodsName == null || typeof stockCode == 'undefined') { | 
 |  |  |                 goodsName = ""; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             var selfPrice = shopSkus[c].selfPrice; | 
 |  |  |             if (selfPrice == null || typeof selfPrice == 'undefined') { | 
 |  |  |                 selfPrice = ""; | 
 |  |  |             } | 
 |  |  |             var sealesPrice = shopSkus[c].sealesPrice; | 
 |  |  |             if (sealesPrice == null || typeof sealesPrice == 'undefined') { | 
 |  |  |                 sealesPrice = ""; | 
 |  |  | 
 |  |  |                 +'<td><div id="erpNoDiv"><button class="btn btn-info" onclick="selectProduct(\'shopIdValue\',\''+trId+'\')"><i class="fa fa-plus"></i></button>' | 
 |  |  |                 +'<p class="form-control-static erpGoodsName">'+ goodsName +'</p><input autocomplete="off" class="form-control" type="hidden"  value="'+stockCode+'" name="erpGoodsCode"></div></td>' | 
 |  |  |                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+sort+'" name=""></td>' | 
 |  |  |                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+selfPrice+'" name=""></td>' | 
 |  |  |                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+sealesPrice+'" name=""></td>' | 
 |  |  |                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+invitationPrice+'" name=""></td>' | 
 |  |  |                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+scorePrice+'" name=""></td>' | 
 |  |  | 
 |  |  |             if (i != 0) { | 
 |  |  |                 var tds = $(this).find("td"); | 
 |  |  |                 var length = tds.length - 1; | 
 |  |  |                 var id = tds.eq(length - 12).find("input").val(); | 
 |  |  |                 var id = tds.eq(length - 13).find("input").val(); | 
 |  |  |                 if(id == null){ | 
 |  |  |                     id =""; | 
 |  |  |                 } | 
 |  |  |                 sku.id = id; | 
 |  |  |  | 
 |  |  |                 //规格名称 | 
 |  |  |                 var name = tds.eq(length - 11).find("input").val(); | 
 |  |  |                 var name = tds.eq(length - 12).find("input").val(); | 
 |  |  |                 if(name == null){ | 
 |  |  |                     name = ""; | 
 |  |  |                 } | 
 |  |  |                 sku.name = name; | 
 |  |  |  | 
 |  |  |                 //图片地址 | 
 |  |  |                 var path = tds.eq(length - 10).find("img").attr("src"); | 
 |  |  |                 var path = tds.eq(length - 11).find("img").attr("src"); | 
 |  |  |                 if(path == null){ | 
 |  |  |                     path = ""; | 
 |  |  |                 } | 
 |  |  |                 sku.imgPath = path; | 
 |  |  |  | 
 |  |  |                 //库存 | 
 |  |  |                 var stock = tds.eq(length - 9).find("input").val(); | 
 |  |  |                 var stock = tds.eq(length - 10).find("input").val(); | 
 |  |  |                 if(stock == ""){ | 
 |  |  |                     stock = 0; | 
 |  |  |                 } | 
 |  |  |                 sku.stock = stock; | 
 |  |  |  | 
 |  |  |                 //价格 | 
 |  |  |                 var price = tds.eq(length -8).find("input").val(); | 
 |  |  |                 var price = tds.eq(length -9).find("input").val(); | 
 |  |  |                 if(price == ""){ | 
 |  |  |                     price =0; | 
 |  |  |                 } | 
 |  |  |                 sku.price = price; | 
 |  |  |  | 
 |  |  |                 //积分 | 
 |  |  |                 var score = tds.eq(length - 7).find("input").val(); | 
 |  |  |                 var score = tds.eq(length - 8).find("input").val(); | 
 |  |  |                 if(score == ""){ | 
 |  |  |                     score = 0; | 
 |  |  |                 } | 
 |  |  |                 sku.score = score; | 
 |  |  |  | 
 |  |  |                 //品种编码 | 
 |  |  |                 var stockCode = tds.eq(length - 6).find("input").val(); | 
 |  |  |                 var stockCode = tds.eq(length - 7).find("input").val(); | 
 |  |  |                 if(stockCode == null || typeof stockCode == 'undefined'){ | 
 |  |  |                     stockCode = ''; | 
 |  |  |                 } | 
 |  |  |                 sku.stockCode = stockCode; | 
 |  |  |  | 
 |  |  |                 //排序 | 
 |  |  |                 var sort = tds.eq(length - 5).find("input").val(); | 
 |  |  |                 var sort = tds.eq(length - 6).find("input").val(); | 
 |  |  |                 if(sort == ""){ | 
 |  |  |                     sort = 0; | 
 |  |  |                 } | 
 |  |  |                 sku.sort = sort; | 
 |  |  |  | 
 |  |  |                 //推广提成 | 
 |  |  |                 var selfPrice = tds.eq(length - 5).find("input").val(); | 
 |  |  |                 sku.selfPrice = selfPrice; | 
 |  |  |                 //推广提成 | 
 |  |  |                 var sealesPrice = tds.eq(length - 4).find("input").val(); | 
 |  |  |                 sku.sealesPrice = sealesPrice; | 
 |  |  | 
 |  |  |  | 
 |  |  |     /*验证sku表格中的参数*/ | 
 |  |  |     function getSkusValues() { | 
 |  |  |  | 
 |  |  |         var ableScorePay=$("#ableScorePay").val(); | 
 |  |  |         var ableSales=$("#ableSales").val(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         var flag = false; | 
 |  |  |         var reg = new RegExp("(^[1-9]([0-9]+)?(\\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\\.[0-9]([0-9])?$)"); | 
 |  |  |         $("#skutable tbody").find("tr").each(function(i) { | 
 |  |  | 
 |  |  |             if (i != 0) { | 
 |  |  |                 var tds = $(this).find("td"); | 
 |  |  |                 var length = tds.length - 1; | 
 |  |  |                 var name = tds.eq(length - 11).find("input").val(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 if(ableScorePay==1){ | 
 |  |  |                     //兑换所需金额 | 
 |  |  |                     var scorePrice = tds.eq(length - 2).find("input").val(); | 
 |  |  |                     //兑换所需积分 | 
 |  |  |                     var scoreCount = tds.eq(length - 1).find("input").val(); | 
 |  |  |                     if(scorePrice == ""||scoreCount==""){ | 
 |  |  |                         layer.msg("请填写兑换所需金额和积分",{ | 
 |  |  |                             icon : 2, | 
 |  |  |                             time : 2000 | 
 |  |  |                         }); | 
 |  |  |                         flag = true; | 
 |  |  |                         return false; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 var name = tds.eq(length - 12).find("input").val(); | 
 |  |  |                 if(name == ""){ | 
 |  |  |                     layer.msg("请填写规格名称",{ | 
 |  |  |                         icon : 2, | 
 |  |  | 
 |  |  |                     return false; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 var stock = tds.eq(length -9).find("input").val(); | 
 |  |  |                 var stock = tds.eq(length -10).find("input").val(); | 
 |  |  |                 if(stock == ""){ | 
 |  |  |                     layer.msg("请填写库存",{ | 
 |  |  |                         icon : 2, | 
 |  |  | 
 |  |  |                     flag = true; | 
 |  |  |                     return false; | 
 |  |  |                 } | 
 |  |  |                 var price = tds.eq(length - 8 ).find("input").val(); | 
 |  |  |                 var price = tds.eq(length - 9 ).find("input").val(); | 
 |  |  |                 if(price == ""){ | 
 |  |  |                     layer.msg("请填写价格",{ | 
 |  |  |                         icon : 2, |