Selaa lähdekoodia

新增贺卡opp袋

zhuyiyi 4 kuukautta sitten
vanhempi
sitoutus
6cc98d7f16

+ 29 - 15
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};

+ 97 - 47
src/main/webapp/views/product/coupon.jsp

@@ -158,6 +158,7 @@
                     <input type="radio" lay-filter="z3type" name="z3type" value="0" title="门票入场" checked>
                     <input type="radio" lay-filter="z3type" name="z3type" value="1" title="卡片">
                     <input type="radio" lay-filter="z3type" name="z3type" value="2" title="圆形">
+                    <input type="radio" lay-filter="z3type" name="z3type" value="3" title="开窗">
                 </div>
             </form>
             <div class="tagOther">
@@ -228,6 +229,12 @@
                                 <option value="9*9">9*9 cm</option>
                             </select>
                         </div>
+                        <div id="3z_chuang_size" style="display: none">
+                            <select name="z3size1" lay-filter="z3size1" class="select">
+                                <option value="16*7">16*7 cm</option>
+                                <option value="19*7">19*7 cm</option>
+                            </select>
+                        </div>
                     </div>
                     <div class="z3_vice" style="display: none;">
                         <div class="z_16">
@@ -250,6 +257,10 @@
                             <input type="radio" name="3z_vice" value="圆角+手撕线+缺口(副券4.5cm)"
                                    title="圆角+手撕线+缺口(副券4.5cm)">
                         </div>
+                        <div class="z_45">
+                            <input type="radio" name="3z_vice" value="圆角+手撕线+缺口(副券4.5cm)"
+                                   title="圆角+手撕线+缺口(副券4.5cm)">
+                        </div>
 
 
                     </div>
@@ -630,8 +641,8 @@
                     </div>
                     <div class="layui-input-block">
                         常见工艺:
-<%--                        <input type="checkbox" name="craft" class="nomq" lay-filter="switchCrafts" value="压痕"--%>
-<%--                               title="压痕"/>--%>
+                        <%--                        <input type="checkbox" name="craft" class="nomq" lay-filter="switchCrafts" value="压痕"--%>
+                        <%--                               title="压痕"/>--%>
                         <div class="layui-inline yahenghide" style="width:60px;display:none">
                             <select name="yaheng" class="select yadianxian">
                                 <option value="1" selected>1</option>
@@ -711,6 +722,7 @@
             </div>
             <div class="peijian_ui" id="peijian_ui" style="display: none;">
                 <form class="layui-form">
+                    <span style="font-size:12px;color:red">opp袋:规格尺寸长度包含胶边2厘米(如8*5厘米规格,含胶边2厘米实际可装尺寸6*5厘米)</span>
                     <div class="layui-input-block">
                         配件:
                         <input type="checkbox" class="peijian" name="craft" lay-filter="z4PeiJian" value="配葫芦针"
@@ -740,6 +752,16 @@
                                 <option value="银色绳子">银色绳子</option>
                             </select>
                         </div>
+                        <input type="checkbox" class="peijian" name="craft" lay-filter="z4PeiJian" value="opp袋"
+                               title="opp袋">
+                        <div class="layui-inline opp" style="width: 110px;display: none">
+                            <select class="select" name="toothpick_size">
+                                <option value="8*5">8*5CM</option>
+                                <option value="10*5">10*5CM</option>
+                                <option value="12*5">12*5CM</option>
+                                <option value="12*6">12*6CM</option>
+                            </select>
+                        </div>
                     </div>
                 </form>
             </div>
@@ -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);
-
-                }
-                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);
+                $(".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_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 == "少数量") {

+ 8 - 0
src/main/webapp/views/product/stickers.jsp

@@ -904,6 +904,14 @@
             // PVC、透明没有覆哑膜
             if (data.value == 1) {
                 $(".nofm").find(":input").attr("disabled", true);
+                count_html = `<option value="200">200</option>
+                        <option value="500">500</option>
+                        <option value="1000">1000</option>
+                        <option value="2000">2000</option>
+                        <option value="3000">3000</option>
+                        <option value="5000">5000</option>
+                        <option value="10000">10000</option>
+                        <option value="20000">20000</option>`;
             } else {
                 $(".nofm").find(":input").attr("disabled", true);
                 $('input[class = liangmo]').prop('checked', true);