|
@@ -90,7 +90,7 @@
|
|
|
return false;
|
|
|
}
|
|
|
var obj = {
|
|
|
- productId: $itemProductID,
|
|
|
+ skuId: $itemProductID,
|
|
|
number: $giftNumber
|
|
|
};
|
|
|
addGiftArray.push(obj)
|
|
@@ -220,43 +220,61 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function deleteProduct(obj, storeStatus,type) {
|
|
|
+ function deleteProduct(obj, type) {
|
|
|
//将该行数据取消勾选,若存在数据库中则将其删除
|
|
|
$(".check-item[value=" + obj + "]").prop("checked", false);
|
|
|
- var delShopIds = $("#delShopIds").val();
|
|
|
- var delGiftIds = $("#delGiftIds").val();
|
|
|
- if (storeStatus && type == 1) {
|
|
|
- if (delProductIds != '') {
|
|
|
- delProductIds = delProductIds + "," + obj;
|
|
|
- }else delProductIds = obj;
|
|
|
- }
|
|
|
- if (storeStatus && type == 2) {
|
|
|
- if (delGiftIds != '') {
|
|
|
- delGiftIds = delGiftIds + "," + obj;
|
|
|
- }else delGiftIds = obj;
|
|
|
+ if (type == 3) {
|
|
|
+ var shop=$('#shop'+obj);
|
|
|
+ $(shop).remove();
|
|
|
}
|
|
|
- if (storeStatus && type == 3) {
|
|
|
- if (delShopIds != '') {
|
|
|
- delShopIds = delShopIds + "," + obj;
|
|
|
- }else delShopIds = obj;
|
|
|
+ if (type == 2) {
|
|
|
+ var gift= $('#gift'+obj);
|
|
|
+ $(gift).remove();
|
|
|
}
|
|
|
- window.setTimeout(function () {
|
|
|
- var productItems = getCheckedItems(1);
|
|
|
- var giftItems = getCheckedItems(2);
|
|
|
- var mode = $("input[name='mode']:checked").val();
|
|
|
- var reducedPrice = $("#reducedPrice").val();
|
|
|
- var touchPrice2 = $("#touchPrice2").val();
|
|
|
- var touchPrice3 = $("#touchPrice3").val();
|
|
|
- var status = $("input[name='status']:checked").val();
|
|
|
- var beginTime = $("#beginTime").val();
|
|
|
- var endTime = $("#endTime").val();
|
|
|
- var delFlag1 = $("input[name='delFlag1']:checked").val();
|
|
|
- window.location.href = "${ctx}/product/cmPromotions/form?type=3&shopIds=" + productItems + "&giftIds=" + giftItems +
|
|
|
- "&delShopIds="+delShopIds+"&delGiftIds="+delGiftIds+ "&mode=" + mode +
|
|
|
- "&reducedPrice=" + reducedPrice + "&touchPrice2=" + touchPrice2 + "&touchPrice3=" + touchPrice3 +
|
|
|
- "&status=" + status + "&beginTime=" + beginTime + "&endTime=" + endTime + "&delFlag1=" + delFlag1 + "&id=${cmPromotion.id}"+
|
|
|
- "&searchDbFlag=0";
|
|
|
- },100)
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: "${ctx}/product/cmPromotions/delPromotion",
|
|
|
+ data: {"id":${cmPromotion.id},"skuId":obj},
|
|
|
+ type: "POST",
|
|
|
+ async: false,
|
|
|
+ success: function(data){
|
|
|
+ flag=data.success;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ <%--var delShopIds = $("#delShopIds").val();--%>
|
|
|
+ <%--var delGiftIds = $("#delGiftIds").val();--%>
|
|
|
+ <%--if (storeStatus && type == 1) {--%>
|
|
|
+ <%-- if (delProductIds != '') {--%>
|
|
|
+ <%-- delProductIds = delProductIds + "," + obj;--%>
|
|
|
+ <%-- }else delProductIds = obj;--%>
|
|
|
+ <%--}--%>
|
|
|
+ <%--if (storeStatus && type == 2) {--%>
|
|
|
+ <%-- if (delGiftIds != '') {--%>
|
|
|
+ <%-- delGiftIds = delGiftIds + "," + obj;--%>
|
|
|
+ <%-- }else delGiftIds = obj;--%>
|
|
|
+ <%--}--%>
|
|
|
+ <%--if (storeStatus && type == 3) {--%>
|
|
|
+ <%-- if (delShopIds != '') {--%>
|
|
|
+ <%-- delShopIds = delShopIds + "," + obj;--%>
|
|
|
+ <%-- }else delShopIds = obj;--%>
|
|
|
+ <%--}--%>
|
|
|
+ <%--window.setTimeout(function () {--%>
|
|
|
+ <%-- var productItems = getCheckedItems(1);--%>
|
|
|
+ <%-- var giftItems = getCheckedItems(2);--%>
|
|
|
+ <%-- var mode = $("input[name='mode']:checked").val();--%>
|
|
|
+ <%-- var reducedPrice = $("#reducedPrice").val();--%>
|
|
|
+ <%-- var touchPrice2 = $("#touchPrice2").val();--%>
|
|
|
+ <%-- var touchPrice3 = $("#touchPrice3").val();--%>
|
|
|
+ <%-- var status = $("input[name='status']:checked").val();--%>
|
|
|
+ <%-- var beginTime = $("#beginTime").val();--%>
|
|
|
+ <%-- var endTime = $("#endTime").val();--%>
|
|
|
+ <%-- var delFlag1 = $("input[name='delFlag1']:checked").val();--%>
|
|
|
+ <%-- window.location.href = "${ctx}/product/cmPromotions/form?type=3&shopIds=" + productItems + "&giftIds=" + giftItems +--%>
|
|
|
+ <%-- "&delShopIds="+delShopIds+"&delGiftIds="+delGiftIds+ "&mode=" + mode +--%>
|
|
|
+ <%-- "&reducedPrice=" + reducedPrice + "&touchPrice2=" + touchPrice2 + "&touchPrice3=" + touchPrice3 +--%>
|
|
|
+ <%-- "&status=" + status + "&beginTime=" + beginTime + "&endTime=" + endTime + "&delFlag1=" + delFlag1 + "&id=${cmPromotion.id}"+--%>
|
|
|
+ <%-- "&searchDbFlag=0";--%>
|
|
|
+ <%--},100)--%>
|
|
|
}
|
|
|
|
|
|
function getCheckedItems(type) {
|
|
@@ -299,7 +317,7 @@
|
|
|
</thead>
|
|
|
<tbody id="contentTbody">
|
|
|
<c:forEach items="${cmPromotion.promotionShops}" var="shop">
|
|
|
- <tr>
|
|
|
+ <tr id="shop${shop.shopID}">
|
|
|
<th class="hide"><input class="check-item" type="checkbox" id="productCheckItem"
|
|
|
name="info" ${shop.storeStatus?'':'checked'}
|
|
|
value='${shop.shopID}'/></th>
|
|
@@ -309,7 +327,7 @@
|
|
|
<td>${shop.contractMobile}</td>
|
|
|
<td>
|
|
|
<a href="javaScript:;"
|
|
|
- onclick="deleteProduct('${shop.shopID}',${shop.storeStatus},3)">删除</a>
|
|
|
+ onclick="deleteProduct('${shop.shopID}',3)">删除</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</c:forEach>
|
|
@@ -343,6 +361,7 @@
|
|
|
<th style="width:20px;" class="hide"></th>
|
|
|
<th></th>
|
|
|
<th>商品图片</th>
|
|
|
+ <th>skuId</th>
|
|
|
<th>商品名称</th>
|
|
|
<th>供应商</th>
|
|
|
<th>数量</th>
|
|
@@ -350,19 +369,20 @@
|
|
|
</thead>
|
|
|
<tbody id="contentTbody1">
|
|
|
<c:forEach items="${cmPromotion.giftProducts}" var="product">
|
|
|
- <tr>
|
|
|
+ <tr id="gift${product.skuId}">
|
|
|
<td>赠</td>
|
|
|
<th class="hide"><input class="check-item" type="checkbox" id="giftCheckItem"
|
|
|
name="gift" ${product.storeStatus?'':'checked'}
|
|
|
- value='${product.productID}'/></th>
|
|
|
+ value='${product.skuId}'/></th>
|
|
|
<td><img src="${product.mainImage}" width="50px" height="50px"></td>
|
|
|
+ <td>${product.skuId}</td>
|
|
|
<td>${product.name}</td>
|
|
|
<td>${product.shopName}</td>
|
|
|
<td><input id="actPrice1" name="giftNumber" style="width:50px;"
|
|
|
value="${product.giftNumber}" type="number" maxlength="7" step="1"></td>
|
|
|
<td>
|
|
|
<a href="javaScript:;"
|
|
|
- onclick="deleteProduct('${product.productID}',${product.storeStatus},2)">删除</a>
|
|
|
+ onclick="deleteProduct('${product.skuId}',2)">删除</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</c:forEach>
|