Browse Source

赠品相关bugfix

zhijiezhao 1 year ago
parent
commit
2c7acdfecc

+ 11 - 14
src/main/webapp/WEB-INF/views/modules/product-new/singlePromotionForm.jsp

@@ -283,20 +283,17 @@
                 if ($('#contentTbody tr').size() < 1) {
                     $("#productIds").val('');
                     $("#giftIds").val('');
-                    window.setTimeout(function () {
-                        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=1&mode=" + mode +
-                            "&reducedPrice=" + reducedPrice + "&touchPrice2=" + touchPrice2 + "&touchPrice3=" + touchPrice3 +
-                            "&status=" + status + "&beginTime=" + beginTime + "&endTime=" + endTime + "&delFlag1=" + delFlag1 + "&id=${cmPromotion.id}" +
-                            "&searchDbFlag=0";
-                    }, 100)
+                    var showSelectProductID = '';
+                    $('#contentTbody1 tr').each(function (index, item) {
+                        var $this = $(this);
+                        var $itemProductID = $this.find('input[name="gift"]').val();
+                        showSelectProductID += $itemProductID + ',';
+                    });
+                    $("#delGiftIds").val(showSelectProductID);
+                    var tbody = document.getElementById("contentTbody1");
+                    while (tbody.firstChild) {
+                        tbody.removeChild(tbody.firstChild);
+                    }
                 }
             } else if (2 === type) {
                 if (delGiftIds != '') {