Răsfoiți Sursa

宠物uv新增内部裁切

zhuyiyi 3 săptămâni în urmă
părinte
comite
929ee2b0b1

+ 15 - 2
src/main/java/lingtao/net/service/ProductService.java

@@ -2716,7 +2716,9 @@ public class ProductService {
                         }
                         double apprise = 0;
                         for (Product product : priceList) {
+
                             product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
+
                             product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
                             if (product.getPrice() < apprise) {
                                 product.setPrice(apprise);
@@ -2745,6 +2747,7 @@ public class ProductService {
                     crafts.remove("刮板");
                     crafts.remove("熨斗");
                     crafts.remove("哑光");
+                    crafts.remove("内部裁切");
                     if (crafts.size() > 0 && "烫金".equals(crafts.get(0))) {
                         crafts.remove(0);
                     }
@@ -2772,6 +2775,16 @@ public class ProductService {
                     if ("宠物转印贴".equals(dto.getKind())) {
                         for (Product product : priceList) {
                             product.setPrice(Math.ceil(product.getPrice() == 50 ? product.getPrice() : product.getPrice() * 1.3));
+                            double number_price = 0;
+                            double number_price_base = 3;
+                            for (int i = 0; i < number; i++) {
+                                number_price += Math.max(1, number_price_base);
+                                number_price_base--;
+                            }
+                            if ("宠物转印贴".equals(dto.getKind()) && craft_list.contains("内部裁切")) {
+                                product.setPrice(Math.ceil(product.getPrice() + 5 * dto.getN_mq_num()));
+                            }
+                            product.setPrice(Math.ceil(product.getPrice() + number_price));
                         }
                     }
 //                    double base = number < 6 && number > 1 ? 5 : 0;
@@ -2826,7 +2839,7 @@ public class ProductService {
                     priceList.add(dto2);
                 } else if (dto.getProTypeLabel().equals("种子纸")) {
                     int av_count = count;
-                    if (!StringUtils.isEmpty(dto.getSwitchz3Size()) || "2".equals(dto.getZ3type())) {
+                    if ("4".equals(dto.getZ3type()) || "2".equals(dto.getZ3type())) {
                         count = Math.max(count, 300);
                     }
                     double price = Math.ceil((length * width * count * 200) / 10000);//价格计算尺寸*数量*200/10000
@@ -2851,7 +2864,7 @@ public class ProductService {
                         price += Math.ceil(Math.max(count * 0.15 * number, 5));
                     }
 
-                    if (!StringUtils.isEmpty(dto.getSwitchz3Size())) {
+                    if ("4".equals(dto.getZ3type())) {
                         price += 100;
                     }
                     craft_list = crafts != null ? Arrays.asList(crafts) : new ArrayList<>();

+ 30 - 34
src/main/webapp/views/product/coupon.jsp

@@ -163,6 +163,7 @@
                     <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="开窗">
+                    <input type="radio" name="z3type" lay-filter="z3type" value="4" title="自定义">
                 </div>
             </form>
             <div class="tagOther">
@@ -180,9 +181,7 @@
                         尺寸(CM/厘米) <span style="font-size:14px;color:red">输入格式: 长 * 宽</span>
                         &nbsp;<span style="font-size:14px;color:red">最小尺寸5*8cm,最大尺寸20*30cm</span>
                     </p>
-                    <span class="switchz3Size" style="display: none">
-                        <input type="checkbox" name="switchz3Size" lay-filter="switchz3Size" title="自定义尺寸">
-                    </span>
+
                     <div class="qt">
                         <input type="text" name="size" placeholder="格式:长*宽" id="size" class="layui-input"
                                autocomplete="off">
@@ -663,12 +662,12 @@
                         <span class="z3_craft_dk">
                             <input type="checkbox" name="craft" lay-filter="z3Crafts" value="打孔" title="打孔"/>
                         </span>
-                        <%--                        <span class="z3_craft_ssx">--%>
-                        <%--                            <input type="checkbox" name="craft" lay-filter="z3Crafts" value="手撕线" title="手撕线"/>--%>
-                        <%--                        </span>--%>
-                        <%--                        <span class="z3_craft_yh">--%>
-                        <%--                            <input type="checkbox" name="craft" lay-filter="z3Crafts" value="压痕" title="压痕"/>--%>
-                        <%--                        </span>--%>
+                        <span class="z3_craft_ssx">
+                            <input type="checkbox" name="craft" lay-filter="z3Crafts" value="打点线" title="打点线"/>
+                        </span>
+                        <span class="z3_craft_yh">
+                            <input type="checkbox" name="craft" lay-filter="z3Crafts" value="压痕" title="压痕"/>
+                        </span>
                         <span class="z3_craft_bm">
                             <input type="checkbox" name="craft" lay-filter="z3Crafts" value="编码" title="编码"/>
                         </span>
@@ -1108,10 +1107,19 @@
                 $("#3z_kapian_size").hide();
                 $("#3z_yuan_size").hide();
                 $("#3z_chuang_size").hide();
+                $(".z3_craft_ssx").hide();
+                $(".z3_craft_yh").hide();
                 $("#3z_menpiao_size select").attr("disabled", true)
                 $("#3z_kapian_size select").attr("disabled", true)
                 $("#3z_yuan_size select").attr("disabled", true)
                 $("#3z_chuang_size select").attr("disabled", true)
+                $(".z3_craft input[name='craft']").prop("checked", false);
+                $(".z3_craft input[name='craft']").prop("disabled", false);
+                $("#3z_size").show();
+                $("#size").val($('select[name="z3size1"]:not(:disabled) option:checked').val());//尺寸重新赋值
+                $(".qt").hide()
+                $("#3zValueForm").show();
+
                 if (val == 0) {
                     let menpiao_size = $("#3z_menpiao_size select option:selected").val();
                     $("#3z_menpiao_size").show();
@@ -1161,8 +1169,18 @@
                     $("#kaichuang select").attr("disabled", false);
                     z3Vice(menpiao_size, val)
                 }
-                if ($('input[name="switchz3Size"]:checked').val()) {
+                if (val == 4) {
+                    $("#3z_size").hide();
+                    $(".qt").show();
                     $(".z3_vice").hide();
+                    $("#size").val('');
+                    $(".z3_craft_yj").show();
+                    $(".z3_craft_zj").show();
+                    $(".z3_craft_dk").show();
+                    $(".z3_craft_ssx").show();
+                    $(".z3_craft_yh").show();
+                    $(".z3_craft_bm").show();
+                    $(".z3_craft_mq").show();
                 }
                 form.render();
             }
@@ -1365,7 +1383,7 @@
                 }
                 if (data.value == "配流苏") {
                     if ($(data.elem).is(":checked")) {
-                        $("#lesspeijian .liusu").css("display","flex");
+                        $("#lesspeijian .liusu").css("display", "flex");
                         $("#lesspeijian .liusu").prop("disabled", false);
                     } else {
                         $("#lesspeijian .liusu").hide();
@@ -2380,29 +2398,7 @@
                 $("#size").val(data.value);
             })
             form.on('checkbox(switchz3Size)', (data) => {
-                $(".z3_craft input[name='craft']").prop("checked", false);
-                $(".z3_craft input[name='craft']").prop("disabled", false);
-                if (data.elem.checked) {
-                    $("#3z_size").hide();
-                    $(".qt").show();
-                    $(".z3_vice").hide();
-                    $("#size").val('');
-                    $("#3zValueForm").hide();
-                    $(".z3_craft_yj").show();
-                    $(".z3_craft_zj").show();
-                    $(".z3_craft_dk").show();
-                    $(".z3_craft_ssx").show();
-                    $(".z3_craft_yh").show();
-                    $(".z3_craft_bm").show();
-                    $(".z3_craft_mq").show();
-                } else {
-                    $("#3z_size").show();
-                    $("#size").val($('select[name="z3size1"]:not(:disabled) option:checked').val());//尺寸重新赋值
-                    $(".qt").hide()
-                    z3Select($('input[name="z3type"]:checked').val());
-                    $("#3zValueForm").show();
-                }
-                form.render();
+
             })
             form.on('radio(kindValue7)', function (xgtData) {
                 if (xgtData.value == 2) {

+ 101 - 23
src/main/webapp/views/product/metal.jsp

@@ -211,18 +211,33 @@
                         </span>
 
                         <span id="sehu_number" style="display:none">
-                        <span>色数:</span>
-                        <div class="layui-inline" style="width:60px;">
-                            <select name="co_number" class="select">
-                                <option value="1" selected>1</option>
-                                <option value="2">2</option>
-                                <option value="3">3</option>
-                                <option value="4">4</option>
-                                <option value="5">5</option>
-                                <option value="6">6</option>
-                            </select>
+                            <span>色数:</span>
+                            <div class="layui-inline" style="width:60px;">
+                                <select name="co_number" class="select">
+                                    <option value="1" selected>1</option>
+                                    <option value="2">2</option>
+                                    <option value="3">3</option>
+                                    <option value="4">4</option>
+                                    <option value="5">5</option>
+                                    <option value="6">6</option>
+                                </select>
+                            </div>
+                        </span>
+                    </div>
+                    <div class="layui-input-block nbcq" style="display: none">
+                        特殊工艺:
+                        <div class="layui-form-item n_mq" style="display: flex">
+                            <input type="checkbox" value="内部裁切" id="nmq" title="内部裁切" lay-filter="craftZhuan" name="craft">
+                            <span class="n_mq_input" style="display: none">
+                                <span style="margin-top:12px;flex-shrink: 0">个数 : </span>
+                                <input type="text" placeholder="请输入整数" autocomplete="off" name="n_mq_num" value="0"
+                                       class="layui-input" style="width: 70px">
+                                 <span style="margin-top:12px;flex-shrink: 0">尺寸(CM/厘米) <span
+                                         style="font-size:14px;color:red">输入格式: 长 * 宽</span>  </span>
+                                <input type="text" placeholder="尺寸" autocomplete="off" name="n_mq_size"
+                                       class="layui-input">
+                            </span>
                         </div>
-                    </span>
                     </div>
                 </div>
             </div>
@@ -363,18 +378,6 @@
                 $(".count").find(":input").attr("disabled", true);
             } else {
                 // 少数量、专版打印的时候,切换为品种下拉框
-                $(".UVSticker").show();
-                $(".UVSticker input").attr("disabled", false);
-                $(".count").show();
-                $(".count").find(":input").attr("disabled", false);
-                $(".metal").hide();
-                $(".metal").find(":input").attr("disabled", true);
-                $("input[name='craft']").prop("checked", false);
-                if ($("#number").val() > 1) {
-                    // $("#ui_des").show();
-                }
-                $(".zhuanuv").hide();
-                $(".zhuanuv").find(":input").attr("disabled", true);
                 let craftChecked = $(`input[name='craft'][value='烫画']`).is(":checked");
                 if (craftChecked) {
                     $(`input[name='craft'][value='烫画']+div`).click();
@@ -387,12 +390,35 @@
                 if (craftChecked) {
                     $(`input[name='craft'][value='熨斗']+div`).click();
                 }
+                craftChecked = $(`input[name='craft'][value='内部裁切']`).is(":checked");
+                if (craftChecked) {
+                    $(`input[name='craft'][value='内部裁切']+div`).click();
+                }
+                $(".UVSticker").show();
+                $(".UVSticker input").attr("disabled", false);
+                $(".count").show();
+                $(".count").find(":input").attr("disabled", false);
+                $(".metal").hide();
+                $(".metal").find(":input").attr("disabled", true);
+                $("input[name='craft']").prop("checked", false);
+                if ($("#number").val() > 1) {
+                    // $("#ui_des").show();
+                }
+                $(".zhuanuv").hide();
+                $(".zhuanuv").find(":input").attr("disabled", true);
+                $(".nbcq").hide();
+                $(".nbcq").find(":input").attr("disabled", true);
 
                 if (kindData.value == "UV转印贴") {
                     $(".zhuanuv").show();
                     $(".zhuanuv").find(":input").attr("disabled", false);
 
                 }
+                if (kindData.value == "宠物转印贴") {
+                    $(".nbcq").show();
+                    $(".nbcq").find(":input").attr("disabled", false);
+
+                }
             }
             form.render();//必须写
         })
@@ -461,6 +487,19 @@
                 $("#yundouNumber").hide();
                 $("#yundouNumber").find(":input").attr("disabled", true);
             }
+            if (craft_list.indexOf("内部裁切") > -1 && craftZhuan >= most) {
+                $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox");
+                $(data.elem).prop("checked", false);
+                layer.msg('[内部裁切]不能选择其他工艺!', {offset: ['300px', '300px']}, {icon: 5});
+                return false;
+            }
+            if (craft_list.indexOf("内部裁切") > -1) {
+                $(".n_mq_input").css("display", "flex")
+                $(".n_mq_input input").prop("disabled", false);
+            } else {
+                $(".n_mq_input").hide()
+                $(".n_mq_input input").prop("disabled", true);
+            }
 
             if (craftZhuan > most) {
                 $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox");
@@ -494,6 +533,9 @@
             var kind = $('input[name="kind"]:checked').val()
             var number = $("#number").val();
             var craftMo = $("input[name='craftMo']:checked").val();
+            let n_moq_num = $('input[name="n_mq_num"]').val()
+            let n_moq_size = $("input[name='n_mq_size']").val()
+            let nmq = $("#nmq:checked").val();
             if (kind == '金属标') {
                 var size = $("#size").val();
                 var color = $("#color").val();
@@ -512,6 +554,10 @@
                         } else if ($(this).val() == "熨斗") {
                             let co_count = $("input[name='po_number']").val();
                             craftShua.push($(this).val() + co_count + "个");
+                        } else if ($(this).val() == "内部裁切") {
+                            if (nmq == '内部裁切' && n_moq_num > 0) {
+                                craftShua.push("内部裁切:" + n_moq_num + "/" + n_moq_size)
+                            }
                         } else {
                             craftShua.push($(this).val());
                         }
@@ -528,6 +574,37 @@
                 });
                 return false;
             }
+
+            if (nmq == '内部裁切' && n_moq_num == 0) {
+                layer.msg('请输入裁切切个数!', {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            if (nmq == '内部裁切' && n_moq_num > 0 && n_moq_size == "") {
+                layer.msg('请输入内裁切尺寸!', {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            if (nmq == '内部裁切' && n_moq_num > 0 && n_moq_size.indexOf("*") == -1) {
+                layer.msg('请输入内裁切正确尺寸!', {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            // if (n_moq_num > 0 && ($('input[name="craft"]:checked').length > 0 || $('input[name="craftPai"]:checked').val() || $('input[name="aotu"]:checked').val() || $('input[name="craftTang"]:checked').val() || $('input[name="yinbai"]:checked').val() != "不印白")) {
+            //     layer.msg('内模切只能有覆膜工艺!', {offset: ['300px', '300px']}, function () {
+            //     });
+            //     return false;
+            // }
+            if (nmq == '内部裁切' && n_moq_num > 0) {
+                let main_size = size.split("*");
+                let moq_size = n_moq_size.split("*");
+
+                let max_number = Math.max(Math.floor(main_size[0] * 10 / (moq_size[0] * 10 + 2)) * Math.floor(main_size[1] * 10 / (moq_size[1] * 10 + 2)), Math.floor(main_size[1] * 10 / (moq_size[0] * 10 + 2)) * Math.floor(main_size[0] * 10 / (moq_size[1] * 10 + 2)))
+                if (max_number < n_moq_num) {
+                    layer.msg('内裁切尺寸超出范围!', {offset: ['300px', '300px']})
+                    return false;
+                }
+            }
             // 选中‘自定义数量’
             /* if($('input[name="switchCount"]:checked').length != 0){
                 if ($("#count").val() > 10) {
@@ -573,6 +650,7 @@
                     return false;
                 }
             }
+
             $.ajax({
                 url: "${path}/getThanSum",
                 type: "GET",