|
@@ -637,12 +637,11 @@ function resetProductList(setData, ind) {
|
|
setProductList(data, false);
|
|
setProductList(data, false);
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- debugger;
|
|
|
|
- // if(ind){
|
|
|
|
- // productList.forEach(function (data) {
|
|
|
|
- // setProductList(data, false);
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
|
|
+ if (ind) {
|
|
|
|
+ productList.forEach(function (data) {
|
|
|
|
+ setProductList(data, false);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
var skuId;
|
|
var skuId;
|
|
if (setData.skuStr) {
|
|
if (setData.skuStr) {
|
|
@@ -1091,6 +1090,15 @@ function setGiftHtmlList(data, cmPromotion) {
|
|
$('.productTable tbody tr.gift_' + data.skuId).each(function (index, element) {
|
|
$('.productTable tbody tr.gift_' + data.skuId).each(function (index, element) {
|
|
$(this).remove();
|
|
$(this).remove();
|
|
});
|
|
});
|
|
|
|
+ debugger;
|
|
|
|
+ var skuStr = "赠品";
|
|
|
|
+ if (data.skuStr) {
|
|
|
|
+ var strings = data.skuStr.split("/");
|
|
|
|
+ var index = strings[1] * 1;
|
|
|
|
+ skuStr = data.skuList[index].unit;
|
|
|
|
+ } else {
|
|
|
|
+ skuStr = data.skuList[0].unit;
|
|
|
|
+ }
|
|
var present = JSON.parse(JSON.stringify(data));
|
|
var present = JSON.parse(JSON.stringify(data));
|
|
present.productType = 1;
|
|
present.productType = 1;
|
|
present.num = data.presentNum;
|
|
present.num = data.presentNum;
|
|
@@ -1101,26 +1109,27 @@ function setGiftHtmlList(data, cmPromotion) {
|
|
var giftStr = "<tr id='product_gift_" + present.productId + "' class='gift gift_" + present.productId +
|
|
var giftStr = "<tr id='product_gift_" + present.productId + "' class='gift gift_" + present.productId +
|
|
"' data-value='" + JSON.stringify(present) + "' data-index='" + product_index + "'>" +
|
|
"' data-value='" + JSON.stringify(present) + "' data-index='" + product_index + "'>" +
|
|
"<td>" + present.productId + "</td>" +
|
|
"<td>" + present.productId + "</td>" +
|
|
- "<td>" + 0 + "</td>" +
|
|
|
|
|
|
+ "<td>" + present.skuId + "</td>" +
|
|
"<td hidden><input type='hidden' name='orderProduct[" + product_index +
|
|
"<td hidden><input type='hidden' name='orderProduct[" + product_index +
|
|
"].enabledStatus' id='orderProduct" + product_index + ".enabledStatus' value='" + JSON.stringify(present) +
|
|
"].enabledStatus' id='orderProduct" + product_index + ".enabledStatus' value='" + JSON.stringify(present) +
|
|
"'/>" + present.shopId + "</td>" +
|
|
"'/>" + present.shopId + "</td>" +
|
|
"<td hidden>" + present.shopName + "</td>" +
|
|
"<td hidden>" + present.shopName + "</td>" +
|
|
"<td class='fix-width'><i class='red'>协商赠品:</i>" + present.name + "</td><td hidden></td>" +
|
|
"<td class='fix-width'><i class='red'>协商赠品:</i>" + present.name + "</td><td hidden></td>" +
|
|
- "<td>" + present.unit + "</td>"
|
|
|
|
- "<td>" + present.num + "</td>" +
|
|
|
|
- "<td>0</td>" +
|
|
|
|
- "<td>100</td>" +
|
|
|
|
- "<td>0</td>" +
|
|
|
|
- "<td>0</td>" +
|
|
|
|
- "<td>0</td>" +
|
|
|
|
- "<td>0</td>" +
|
|
|
|
- "<td>0</td>" +
|
|
|
|
- /*"<td>"+ Math.round(present.shopFee*100)/100 +"</td>"+*/
|
|
|
|
- "<td>否</td>" +
|
|
|
|
- "<td></td>" +
|
|
|
|
- "<td></td>" +
|
|
|
|
- "</tr>";
|
|
|
|
|
|
+ "<td>" + present.shopName + "</td>" +
|
|
|
|
+ "<td>" + skuStr + "</td>" +
|
|
|
|
+ "<td>" + present.num + "</td>" +
|
|
|
|
+ "<td>0</td>" +
|
|
|
|
+ "<td>100</td>" +
|
|
|
|
+ "<td>0</td>" +
|
|
|
|
+ "<td>0</td>" +
|
|
|
|
+ "<td>0</td>" +
|
|
|
|
+ "<td>0</td>" +
|
|
|
|
+ "<td>0</td>" +
|
|
|
|
+ /*"<td>"+ Math.round(present.shopFee*100)/100 +"</td>"+*/
|
|
|
|
+ "<td>否</td>" +
|
|
|
|
+ "<td></td>" +
|
|
|
|
+ "<td></td>" +
|
|
|
|
+ "</tr>";
|
|
product_index++;
|
|
product_index++;
|
|
appendGiftsList(present, giftStr, cmPromotion);
|
|
appendGiftsList(present, giftStr, cmPromotion);
|
|
}
|
|
}
|
|
@@ -1461,8 +1470,8 @@ function setLadderPrice(obj, numVal, index) {
|
|
$("#check-item" + index).parents("tr").find("#price" + index).val(ladderList[resultLadder]["buyPrice"]);
|
|
$("#check-item" + index).parents("tr").find("#price" + index).val(ladderList[resultLadder]["buyPrice"]);
|
|
$("#check-item" + index).parents("tr").find("#priceLabel" + index).text(ladderList[resultLadder]["buyPrice"]);
|
|
$("#check-item" + index).parents("tr").find("#priceLabel" + index).text(ladderList[resultLadder]["buyPrice"]);
|
|
$("#check-item" + index).parents("tr").find("#discountPrice" + index).val(ladderList[resultLadder]["buyPrice"]);
|
|
$("#check-item" + index).parents("tr").find("#discountPrice" + index).val(ladderList[resultLadder]["buyPrice"]);
|
|
- if(numVal<ladderList[0]["buyNum"]){
|
|
|
|
- var old=$("#oldPrice"+index).val();
|
|
|
|
|
|
+ if (numVal < ladderList[0]["buyNum"]) {
|
|
|
|
+ var old = $("#oldPrice" + index).val();
|
|
$("#check-item" + index).parents("tr").find("#price" + index).val(old);
|
|
$("#check-item" + index).parents("tr").find("#price" + index).val(old);
|
|
$("#check-item" + index).parents("tr").find("#priceLabel" + index).text(old);
|
|
$("#check-item" + index).parents("tr").find("#priceLabel" + index).text(old);
|
|
$("#check-item" + index).parents("tr").find("#discountPrice" + index).val(old);
|
|
$("#check-item" + index).parents("tr").find("#discountPrice" + index).val(old);
|