diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 03577f3..aad7a8c 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -434,7 +434,7 @@ public class ProductService { } } - if ("覆哑膜".equals(dto.getCraftMo())) { + if ("覆哑膜".equals(dto.getCraftMo()) && !"1".equals(kind)) { for (Product product : priceList) { product.setPrice(Math.ceil(product.getPrice() * 1.2)); } @@ -444,12 +444,6 @@ public class ProductService { priceList = priceList.subList(0, 3); } - if ("1".equals(kind) && dto.getCraftMo().equals("覆哑膜")) { - for (Product product : priceList) { - product.setPrice(Math.ceil(product.getPrice() * 1.2)); - } - } - if ("13".equals(oldKind)) { for (Product product : priceList) { product.setPrice(Math.ceil(product.getPrice() * 1.2)); @@ -919,6 +913,25 @@ public class ProductService { if (craft_list.contains("配弹力绳捆")) { carft_price += 10 * Math.ceil(product.getCount() * 20.0 / 5000); } + if (craft_list.contains("配弹力绳捆")) { + carft_price += 10 * Math.ceil(product.getCount() * 20.0 / 5000); + } + if (craft_list.contains("opp袋")) { + double carft_base_price = 0; + if ("8*5".equals(dto.getToothpick_size())) { + carft_base_price = 10; + } + if ("10*5".equals(dto.getToothpick_size())) { + carft_base_price = 12; + } + if ("12*5".equals(dto.getToothpick_size())) { + carft_base_price = 14; + } + if ("12*6".equals(dto.getToothpick_size())) { + carft_base_price = 15; + } + carft_price += carft_base_price * Math.ceil(product.getCount() / 1000.0); + } product.setPrice(Math.floor((product.getPrice() + carft_price) * number)); product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3 * 0.86)); } @@ -2755,6 +2768,7 @@ public class ProductService { } else { max = Math.max(Math.floor(l / length) * Math.floor(w / width), Math.floor(l / width) * Math.floor(w / length)); } + max = Math.max(max, 1); // 报的数量需要多少张大纸 // 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个 int num = (int) Math.ceil(count * number / max); @@ -4983,14 +4997,14 @@ public class ProductService { } if ("覆哑膜".equals(dto.getCraftMo())) { prices = new int[][]{ - {127, 127, 128, 129, 131, 132, 139, 139, 139, 258, 275, 357, 479, 1837, 1592, 2216, 3238}, - {132, 132, 133, 134, 136, 137, 144, 144, 144, 263, 280, 362, 484, 1842, 1597, 2221, 3243}, - {173, 173, 173, 173, 173, 173, 173, 192, 211, 323, 404, 522, 689, 1991, 2281, 3809, 4493}, - {218, 228, 235, 241, 247, 252, 276, 300, 324, 517, 725, 893, 1200, 3632, 4212, 7033, 8286}, - {304, 314, 322, 324, 327, 332, 346, 372, 392, 650, 886, 1050, 1420, 4407, 5622, 10374, 15555}, - {467, 467, 506, 506, 506, 506, 506, 568, 628, 1168, 1446, 1756, 2238, 6492, 9094, 16186, 19052}, - {715, 729, 738, 741, 744, 745, 755, 955, 1155, 1763, 2345, 2833, 3737, 11237, 17610, 32346, 38063}, - {1034, 1072, 1114, 1157, 1200, 1245, 1440, 1721, 2002, 3465, 4554, 5555, 7431, 22502, 35221, 60079, 69239}, + {125, 127, 127, 128, 129, 131, 132, 139, 139, 139, 258, 275, 357, 479, 1837, 1592, 2216, 3238}, + {130, 132, 132, 133, 134, 136, 137, 144, 144, 144, 263, 280, 362, 484, 1842, 1597, 2221, 3243}, + {172, 173, 173, 173, 173, 173, 173, 173, 192, 211, 323, 404, 522, 689, 1991, 2281, 3809, 4493}, + {206, 218, 228, 235, 241, 247, 252, 276, 300, 324, 517, 725, 893, 1200, 3632, 4212, 7033, 8286}, + {294, 304, 314, 322, 324, 327, 332, 346, 372, 392, 650, 886, 1050, 1420, 4407, 5622, 10374, 15555}, + {441, 467, 467, 506, 506, 506, 506, 506, 568, 628, 1168, 1446, 1756, 2238, 6492, 9094, 16186, 19052}, + {669, 715, 729, 738, 741, 744, 745, 755, 955, 1155, 1763, 2345, 2833, 3737, 11237, 17610, 32346, 38063}, + {997, 1034, 1072, 1114, 1157, 1200, 1245, 1440, 1721, 2002, 3465, 4554, 5555, 7431, 22502, 35221, 60079, 69239}, }; } int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000, 20000}; diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 9624007..0443833 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -158,6 +158,7 @@ +
@@ -228,6 +229,12 @@
+ @@ -630,8 +641,8 @@
常见工艺: -<%-- -<%-- title="压痕"/>--%> + <%-- + <%-- title="压痕"/>--%> + +
@@ -921,36 +943,34 @@ } - function z3Vice(val) { + function z3Vice(val, type) { $(".z3_vice input").prop("checked", false); - if (val == "16*7") { - $(".z3_vice .z_16").show(); - $(".z3_vice .z_19").hide(); - $(".z3_vice .z_15").hide(); - $(".z3_vice .z_13").hide(); - $(".z3_vice .z_16 input:first").prop("checked", true); + $(".z3_vice .z_16").hide(); + $(".z3_vice .z_19").hide(); + $(".z3_vice .z_15").hide(); + $(".z3_vice .z_13").hide(); + $(".z3_vice .z_45").hide(); + if (type == 0) { + if (val == "16*7") { + $(".z3_vice .z_16").show(); + $(".z3_vice .z_16 input:first").prop("checked", true); - } - if (val == "19*7") { - $(".z3_vice .z_16").hide(); - $(".z3_vice .z_19").show(); - $(".z3_vice .z_15").hide(); - $(".z3_vice .z_13").hide(); - $(".z3_vice .z_19 input:first").prop("checked", true); - } - if (val == "15*5") { - $(".z3_vice .z_16").hide(); - $(".z3_vice .z_19").hide(); - $(".z3_vice .z_15").show(); - $(".z3_vice .z_13").hide(); - $(".z3_vice .z_15 input:first").prop("checked", true); - } - if (val == "13*5") { - $(".z3_vice .z_16").hide(); - $(".z3_vice .z_19").hide(); - $(".z3_vice .z_15").hide(); - $(".z3_vice .z_13").show(); - $(".z3_vice .z_13 input:first").prop("checked", true); + } + if (val == "19*7") { + $(".z3_vice .z_19").show(); + $(".z3_vice .z_19 input:first").prop("checked", true); + } + if (val == "15*5") { + $(".z3_vice .z_15").show(); + $(".z3_vice .z_15 input:first").prop("checked", true); + } + if (val == "13*5") { + $(".z3_vice .z_13").show(); + $(".z3_vice .z_13 input:first").prop("checked", true); + } + } else if (type == 3) { + $(".z3_vice .z_45").show(); + $(".z3_vice .z_45 input:first").prop("checked", true); } form.render(); } @@ -966,14 +986,17 @@ $(".z3_craft_yh").show(); $(".z3_craft_bm").show(); $(".z3_craft_mq").hide(); + $("#3z_menpiao_size").hide(); + $("#3z_kapian_size").hide(); + $("#3z_yuan_size").hide(); + $("#3z_chuang_size").hide(); + $("#3z_menpiao_size select").attr("disabled", true) + $("#3z_kapian_size select").attr("disabled", true) + $("#3z_yuan_size select").attr("disabled", true) if (val == 0) { let menpiao_size = $("#3z_menpiao_size select option:selected").val(); $("#3z_menpiao_size").show(); - $("#3z_kapian_size").hide(); - $("#3z_yuan_size").hide(); $("#3z_menpiao_size select").attr("disabled", false) - $("#3z_kapian_size select").attr("disabled", true) - $("#3z_yuan_size select").attr("disabled", true) if (!$('input[name="switchz3Size"]:checked').val()) { $("#size").val(menpiao_size); } @@ -983,15 +1006,11 @@ $(".z3_craft_dk").hide(); $(".z3_craft_ssx").hide(); $(".z3_craft_yh").hide(); - z3Vice(menpiao_size) + z3Vice(menpiao_size, val) } if (val == 1) { - $("#3z_menpiao_size").hide(); $("#3z_kapian_size").show(); - $("#3z_yuan_size").hide(); - $("#3z_menpiao_size select").attr("disabled", true) $("#3z_kapian_size select").attr("disabled", false) - $("#3z_yuan_size select").attr("disabled", true) if (!$('input[name="switchz3Size"]:checked').val()) { $("#size").val($("#3z_kapian_size select option:selected").val()); } @@ -1001,16 +1020,25 @@ $(".z3_craft_yj").hide(); $(".z3_craft_zj").hide(); $(".z3_craft_bm").hide(); - $("#3z_menpiao_size").hide(); - $("#3z_kapian_size").hide(); $("#3z_yuan_size").show(); - $("#3z_menpiao_size select").attr("disabled", true) - $("#3z_kapian_size select").attr("disabled", true) $("#3z_yuan_size select").attr("disabled", false) if (!$('input[name="switchz3Size"]:checked').val()) { $("#size").val($("#3z_yuan_size select option:selected").val()); } } + if (val == 3) { + let menpiao_size = $("#3z_chuang_size select option:selected").val(); + $(".z3_vice").show(); + $(".z3_craft_yj").hide(); + $(".z3_craft_zj").hide(); + $(".z3_craft_bm").hide(); + $("#3z_chuang_size").show(); + $("#3z_chuang_size select").attr("disabled", false) + if (!$('input[name="switchz3Size"]:checked').val()) { + $("#size").val($("#3z_chuang_size select option:selected").val()); + } + z3Vice(menpiao_size, val) + } if ($('input[name="switchz3Size"]:checked').val()) { $(".z3_vice").hide(); } @@ -1067,8 +1095,14 @@ }); }); form.on("checkbox(z4PeiJian)", function (data) { - let peijiansize = $(".peijian:checked").length; - if (peijiansize > 1) { + let peijiansize = []; + $(".peijian:checked").each(function (i) { + // 没有被禁用的工艺加到arr中 + if (!$(this).is(':disabled') && $(this).val() != "opp袋") { + peijiansize.push($(this).val()); + } + }); + if (peijiansize.length > 1) { $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox"); $(data.elem).prop("checked", false); layer.msg('配件只能选择一种!', {offset: ['300px', '300px']}, {icon: 5}); @@ -1093,6 +1127,15 @@ $("#peijian_ui .tscolor").prop("disabled", true); } } + if (data.value == "opp袋") { + if ($(data.elem).is(":checked")) { + $("#peijian_ui .opp").show(); + $("#peijian_ui .opp").prop("disabled", false); + } else { + $("#peijian_ui .opp").hide(); + $("#peijian_ui .opp").prop("disabled", true); + } + } }); form.on("checkbox(lessz4PeiJian)", function (data) { let peijiansize = $(".lesspeijian:checked").length; @@ -2841,6 +2884,10 @@ arr.push(tscolor + "配弹力绳(15CM)"); return; } + if ($(this).val() == "opp袋") { + arr.push($("select[name='toothpick_size'] option:selected").text() + "opp袋"); + return; + } arr.push($(this).val()); } }); @@ -3385,9 +3432,12 @@ } else if (kindData[kind] == "种子纸") { let switchz3Size = $('input[name="switchz3Size"]:checked').val() var span_result = kindData[kind] + " -" + size + "厘米-(" + same + ")" - if ($('input[name="z3type"]:checked').val() == 0 && !switchz3Size) { + if (($('input[name="z3type"]:checked').val() == 0 || $('input[name="z3type"]:checked').val() == 3) && !switchz3Size) { span_result = span_result + " - " + $('input[name="3z_vice"]:checked')[0].title } + if ($('input[name="z3type"]:checked').val() == 3) { + arr.push("开窗") + } span_result = span_result + " \n" + "工艺 :" + arr + ",不覆膜" + "\n"; } else { if (couponKind == "少数量") { diff --git a/src/main/webapp/views/product/stickers.jsp b/src/main/webapp/views/product/stickers.jsp index 4ef576e..087090e 100644 --- a/src/main/webapp/views/product/stickers.jsp +++ b/src/main/webapp/views/product/stickers.jsp @@ -904,6 +904,14 @@ // PVC、透明没有覆哑膜 if (data.value == 1) { $(".nofm").find(":input").attr("disabled", true); + count_html = ` + + + + + + + `; } else { $(".nofm").find(":input").attr("disabled", true); $('input[class = liangmo]').prop('checked', true);