Explorar el Código

裱冷板新增配件

zhuyiyi hace 2 meses
padre
commit
f9f42680be

+ 10 - 1
src/main/java/lingtao/net/service/ProductService.java

@@ -2799,7 +2799,7 @@ public class ProductService {
                             return null;
                         }
                         fixPrice = 60.0;
-                        zhang = 5;
+                        zhang = 8;
                         cutFee = 50;
                         if (!StringUtils.isEmpty(dto.getCraft()))
                             cutFee = 100;
@@ -3279,6 +3279,15 @@ public class ProductService {
                     // 裱板
                     if ("0".equals(kind)) {
                         priceList = new PosterPrice().acountPrice00(kind2, area, count, number);
+                        crafts_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
+                        for (Product product : priceList) {
+                            if (crafts_list.contains("铁架支架")) {
+                                product.setPrice(Math.ceil(product.getPrice() + 35 * dto.getZheye()));
+                            }
+                            if (crafts_list.contains("伸缩支架")) {
+                                product.setPrice(Math.ceil(product.getPrice() + 10 * dto.getYaheng()));
+                            }
+                        }
                     } else if ("1".equals(kind)) {// 室内写真
                         priceList = new PosterPrice().acountPrice01(kind2, area, count, number, width * 100, length * 100);
                     } else if ("2".equals(kind)) {// 户外写真

+ 35 - 1
src/main/webapp/views/product/poster.jsp

@@ -250,6 +250,17 @@
                     <input type="checkbox" name="craft" lay-filter="switch" class="pvcHide tang" value="模切" title="模切">
                     <input type="checkbox" name="craft" lay-filter="switch" class="pvcHide tang" value="打孔" title="打孔">
                 </div>
+                <div class="layui-form-item">
+                    配件:
+                    <input type="checkbox" name="craft" lay-filter="switch" value="铁架支架" title="铁架支架">
+                    <div class="layui-inline zheye-lay" style="width: 50px;display: none">
+                        <input type="text" value="1" name="zheye" class="layui-input">
+                    </div>
+                    <input type="checkbox" name="craft" lay-filter="switch" value="伸缩支架" title="伸缩支架">
+                    <div class="layui-inline yaheng-lay" style="width: 50px;display: none">
+                        <input type="text" value="1" name="yaheng" class="layui-input">
+                    </div>
+                </div>
             </div>
             <!-- 条幅 -->
             <div class="banner" style="display:none">
@@ -580,6 +591,23 @@
             }
         }
 
+        form.on('checkbox(switch)', function (data) {
+            if (data.value == "铁架支架") {
+                if (data.elem.checked) {
+                    $(".zheye-lay").show();
+                } else {
+                    $(".zheye-lay").hide();
+                }
+            }
+            if (data.value == "伸缩支架") {
+                if (data.elem.checked) {
+                    $(".yaheng-lay").show();
+                } else {
+                    $(".yaheng-lay").hide();
+                }
+            }
+
+        })
         // 根据类目获取产品名称
         form.on('radio(kindValue)', function (data) {
             kind = data.value;
@@ -1539,7 +1567,13 @@
                                 $("input:checkbox[name='craft']:checked").each(function (i) {
                                     // 没有被禁用的工艺加到arr中
                                     if (!$(this).is(':disabled')) {
-                                        arr.push($(this).val());
+                                        if ($(this).val() == "铁架支架") {
+                                            arr.push($("input[name='zheye']").val() + "个" + $(this).val());
+                                        } else if ($(this).val() == "伸缩支架") {
+                                            arr.push($("input[name='yaheng']").val() + "个" + $(this).val());
+                                        } else {
+                                            arr.push($(this).val());
+                                        }
                                     }
                                 });
                                 var craftBu = [$('input[name="craftBu"]:checked').val()];