新增UV磁吸贴
This commit is contained in:
@@ -2881,6 +2881,78 @@ public class ProductService {
|
||||
dto2.setWeight(df.format(number * (length / 100) * (width / 100) * av_count * 0.3 * 0.86));
|
||||
dto2.setPrice(Math.ceil(price));
|
||||
priceList.add(dto2);
|
||||
} else if ("反转胶片".equals(dto.getKind())) {
|
||||
double unitPrice = 0;
|
||||
double base_price = 52;
|
||||
if ("0".equals(dto.getKindValue())) {
|
||||
if (count <= 10) {
|
||||
unitPrice = 300;
|
||||
unitPrice = new PriceUtils().calcByTargetN(10, 300, 10, 300, count);
|
||||
} else if (count <= 200) {
|
||||
unitPrice = 275;
|
||||
unitPrice = new PriceUtils().calcByTargetN(10, 300, 200, 275, count);
|
||||
} else if (count <= 500) {
|
||||
unitPrice = 250;
|
||||
unitPrice = new PriceUtils().calcByTargetN(200, 275, 500, 250, count);
|
||||
} else if (count <= 1000) {
|
||||
unitPrice = 220;
|
||||
unitPrice = new PriceUtils().calcByTargetN(500, 250, 1000, 220, count);
|
||||
} else if (count <= 5000) {
|
||||
unitPrice = 196;
|
||||
unitPrice = new PriceUtils().calcByTargetN(1000, 220, 5000, 196, count);
|
||||
} else if (count <= 10000) {
|
||||
unitPrice = 171;
|
||||
unitPrice = new PriceUtils().calcByTargetN(5000, 196, 10000, 171, count);
|
||||
} else if (count <= 30000) {
|
||||
unitPrice = 144;
|
||||
unitPrice = new PriceUtils().calcByTargetN(10000, 171, 30000, 144, count);
|
||||
} else if (count <= 50000) {
|
||||
unitPrice = 130;
|
||||
unitPrice = new PriceUtils().calcByTargetN(30000, 144, 50000, 130, count);
|
||||
} else {
|
||||
unitPrice = 122 * count;
|
||||
}
|
||||
} else {
|
||||
if (count <= 10) {
|
||||
unitPrice = 315;
|
||||
unitPrice = new PriceUtils().calcByTargetN(10, 315, 10, 315, count);
|
||||
} else if (count <= 200) {
|
||||
unitPrice = 290;
|
||||
unitPrice = new PriceUtils().calcByTargetN(10, 315, 200, 290, count);
|
||||
} else if (count <= 500) {
|
||||
unitPrice = 265;
|
||||
unitPrice = new PriceUtils().calcByTargetN(200, 290, 500, 265, count);
|
||||
} else if (count <= 1000) {
|
||||
unitPrice = 235;
|
||||
unitPrice = new PriceUtils().calcByTargetN(500, 265, 1000, 235, count);
|
||||
} else if (count <= 5000) {
|
||||
unitPrice = 210;
|
||||
unitPrice = new PriceUtils().calcByTargetN(1000, 235, 5000, 210, count);
|
||||
} else if (count <= 10000) {
|
||||
unitPrice = 185;
|
||||
unitPrice = new PriceUtils().calcByTargetN(5000, 210, 10000, 185, count);
|
||||
} else if (count <= 30000) {
|
||||
unitPrice = 169;
|
||||
unitPrice = new PriceUtils().calcByTargetN(10000, 185, 30000, 169, count);
|
||||
} else if (count <= 50000) {
|
||||
unitPrice = 145;
|
||||
unitPrice = new PriceUtils().calcByTargetN(30000, 169, 50000, 145, count);
|
||||
} else {
|
||||
unitPrice = 135 * count;
|
||||
}
|
||||
}
|
||||
double design_price = number * 8;
|
||||
double price = Math.ceil(Math.max(unitPrice * length * width / 10000 * number, base_price) + design_price);
|
||||
|
||||
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装OPP袋")) {
|
||||
price += Math.ceil(Math.max(count * 0.2 * number, 5));
|
||||
}
|
||||
|
||||
Product dto2 = new Product();
|
||||
dto2.setCount(count);
|
||||
dto2.setWeight(df.format(number * (length / 100) * (width / 100) * count * 0.3 * 0.86));
|
||||
dto2.setPrice(Math.ceil(price));
|
||||
priceList.add(dto2);
|
||||
} else if (!StringUtils.isEmpty(crafts) && crafts[crafts.length - 1].indexOf("烫金") > -1) {
|
||||
// 出血(一边2毫米)
|
||||
length = length * 10 + 4;
|
||||
@@ -3172,7 +3244,7 @@ public class ProductService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!"反转胶片".equals(dto.getKind())) {
|
||||
if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) {
|
||||
if (number > 1) {
|
||||
double designFee = 0;
|
||||
@@ -3230,6 +3302,7 @@ public class ProductService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return chucklePrice(role, priceList, dto);
|
||||
@@ -4542,12 +4615,106 @@ public class ProductService {
|
||||
case "木浆棉":
|
||||
priceList = getWoodPulpCottonPrice(dto, width, length);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "UV磁吸贴":
|
||||
priceList = getMagneticStickerPrice(dto, width, length);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getMagneticStickerPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
double basePrice = 0;
|
||||
int startN = 0;
|
||||
int endN = 0;
|
||||
double hightPrice = 0;
|
||||
double lowPrice = 0;
|
||||
|
||||
if (count <= 10) {
|
||||
startN = 10;
|
||||
endN = 10;
|
||||
hightPrice = 200;
|
||||
lowPrice = 200;
|
||||
} else if (count <= 20) {
|
||||
startN = 10;
|
||||
endN = 20;
|
||||
hightPrice = 200;
|
||||
lowPrice = 182;
|
||||
} else if (count <= 50) {
|
||||
startN = 20;
|
||||
endN = 50;
|
||||
hightPrice = 182;
|
||||
lowPrice = 166;
|
||||
} else if (count <= 100) {
|
||||
startN = 50;
|
||||
endN = 100;
|
||||
hightPrice = 166;
|
||||
lowPrice = 153;
|
||||
} else if (count <= 200) {
|
||||
startN = 100;
|
||||
endN = 200;
|
||||
hightPrice = 153;
|
||||
lowPrice = 145;
|
||||
} else if (count <= 500) {
|
||||
startN = 200;
|
||||
endN = 500;
|
||||
hightPrice = 145;
|
||||
lowPrice = 138;
|
||||
} else if (count <= 1000) {
|
||||
startN = 500;
|
||||
endN = 1000;
|
||||
hightPrice = 138;
|
||||
lowPrice = 132;
|
||||
} else if (count <= 2000) {
|
||||
startN = 1000;
|
||||
endN = 2000;
|
||||
hightPrice = 132;
|
||||
lowPrice = 126;
|
||||
} else if (count <= 5000) {
|
||||
startN = 2000;
|
||||
endN = 5000;
|
||||
hightPrice = 126;
|
||||
lowPrice = 120;
|
||||
} else if (count <= 10000) {
|
||||
startN = 5000;
|
||||
endN = 10000;
|
||||
hightPrice = 120;
|
||||
lowPrice = 116;
|
||||
} else if (count <= 20000) {
|
||||
startN = 10000;
|
||||
endN = 20000;
|
||||
hightPrice = 116;
|
||||
lowPrice = 111;
|
||||
} else if (count <= 50000) {
|
||||
startN = 20000;
|
||||
endN = 50000;
|
||||
hightPrice = 111;
|
||||
lowPrice = 103;
|
||||
}
|
||||
basePrice = new PriceUtils().calcByTargetN(startN, hightPrice, endN, lowPrice, count);
|
||||
if (count > 50000) {
|
||||
basePrice = 97 * count;
|
||||
}
|
||||
|
||||
if (craft_list.contains("模切")) {
|
||||
basePrice = basePrice * 1.2;
|
||||
}
|
||||
double design_price = Math.ceil((number) * 5);
|
||||
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setNumber(number);
|
||||
pro.setPrice(Math.ceil((Math.max(basePrice * width * length / 10000 * number, 25) + design_price)));
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getWoodPulpCottonPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
@@ -4555,42 +4722,55 @@ public class ProductService {
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
|
||||
double paperLength = 420;
|
||||
double paperWith = 297;
|
||||
|
||||
width = width * 10 + 4;
|
||||
length = length * 10 + 4;
|
||||
// 一张l/w 大的纸张能做多少个此类尺寸的产品
|
||||
double max = Math.max(Math.floor(paperLength / length) * Math.floor(paperWith / width), Math.floor(paperLength / width) * Math.floor(paperWith / length));
|
||||
// 报的数量需要多少张大纸
|
||||
// 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个
|
||||
int num = (int) Math.ceil(count * number / Math.max(max, 1));
|
||||
int num = count;
|
||||
double basePrice = 0;
|
||||
if (num <= 100) {
|
||||
basePrice = 40;
|
||||
basePrice = new PriceUtils().calcByTargetN(100, 40, 100, 40, num);
|
||||
} else if (num <= 300) {
|
||||
basePrice = 35;
|
||||
basePrice = new PriceUtils().calcByTargetN(100, 40, 300, 35, num);
|
||||
} else if (num <= 500) {
|
||||
basePrice = 30;
|
||||
basePrice = new PriceUtils().calcByTargetN(300, 35, 500, 30, num);
|
||||
} else if (num <= 1000) {
|
||||
basePrice = 28;
|
||||
basePrice = new PriceUtils().calcByTargetN(500, 35, 1000, 28, num);
|
||||
} else if (num <= 2000) {
|
||||
basePrice = 26;
|
||||
basePrice = new PriceUtils().calcByTargetN(1000, 28, 2000, 26, num);
|
||||
} else if (num <= 5000) {
|
||||
basePrice = 24;
|
||||
basePrice = new PriceUtils().calcByTargetN(2000, 26, 5000, 24, num);
|
||||
} else if (num <= 10000) {
|
||||
basePrice = 22;
|
||||
basePrice = new PriceUtils().calcByTargetN(5000, 24, 10000, 22, num);
|
||||
} else {
|
||||
basePrice = 20 * num;
|
||||
int startN = 0;
|
||||
int endN = 0;
|
||||
double hightPrice = 0;
|
||||
double lowPrice = 0;
|
||||
if (num < 100) {
|
||||
startN = 99;
|
||||
endN = 99;
|
||||
hightPrice = 500;
|
||||
lowPrice = 500;
|
||||
} else if (num < 200) {
|
||||
startN = 99;
|
||||
endN = 199;
|
||||
hightPrice = 500;
|
||||
lowPrice = 445;
|
||||
} else if (num < 500) {
|
||||
startN = 199;
|
||||
endN = 499;
|
||||
hightPrice = 445;
|
||||
lowPrice = 425;
|
||||
} else if (num < 1000) {
|
||||
startN = 499;
|
||||
endN = 999;
|
||||
hightPrice = 425;
|
||||
lowPrice = 360;
|
||||
} else if (num < 5000) {
|
||||
startN = 999;
|
||||
endN = 4999;
|
||||
hightPrice = 360;
|
||||
lowPrice = 320;
|
||||
} else if (num < 10000) {
|
||||
startN = 4999;
|
||||
endN = 9999;
|
||||
hightPrice = 320;
|
||||
lowPrice = 300;
|
||||
} else if (num < 50000) {
|
||||
startN = 9999;
|
||||
endN = 49999;
|
||||
hightPrice = 300;
|
||||
lowPrice = 280;
|
||||
}
|
||||
basePrice = new PriceUtils().calcByTargetN(startN, hightPrice, endN, lowPrice, num);
|
||||
if (num >= 50000) {
|
||||
basePrice = 260 * num;
|
||||
//basePrice = new PriceUtils().calcByTargetN(10000, 20, 10000, 20, num);
|
||||
}
|
||||
|
||||
double craftPrice = 0;
|
||||
double craftBasePrice = 0;
|
||||
double craftMiniPrice = 0;
|
||||
@@ -4611,10 +4791,12 @@ public class ProductService {
|
||||
craftBasePrice = 0.15;
|
||||
craftPrice += Math.max(craftBasePrice * count, 5);
|
||||
}
|
||||
|
||||
double design_price = Math.ceil((number) * 30);
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setNumber(number);
|
||||
pro.setPrice(Math.ceil((Math.max(basePrice, 80) + Math.max(craftPrice, craftMiniPrice) * number)));
|
||||
pro.setPrice(Math.ceil((Math.max(basePrice * width * length / 10000 * number, 60) + Math.max(craftPrice, craftMiniPrice) * number) + design_price));
|
||||
priceList.add(pro);
|
||||
|
||||
return priceList;
|
||||
@@ -4660,7 +4842,7 @@ public class ProductService {
|
||||
break;
|
||||
}
|
||||
int itemCount = priceList.size() == 0 ? count : counts[i];
|
||||
base_price = prices[area_index][Math.max(itemCount == count ? i - 1 : i, 0)];
|
||||
base_price = prices[area_index][Math.max(i, 0)];
|
||||
Product pro = new Product();
|
||||
pro.setCount(itemCount);
|
||||
pro.setNumber(dto.getNumber());
|
||||
@@ -5389,6 +5571,10 @@ public class ProductService {
|
||||
rate_item = 0.88;
|
||||
} else if (count <= 2000) {
|
||||
rate_item = 0.85;
|
||||
} else if (count <= 5000) {
|
||||
rate_item = 0.8;
|
||||
} else {
|
||||
rate_item = 0.75;
|
||||
}
|
||||
if ("18".equals(dto.getKindValue()) && count < 10) {
|
||||
price = 150;
|
||||
|
||||
@@ -43,7 +43,11 @@ public class SwzStickersPrice {
|
||||
|
||||
// 报的数量需要多少张大纸
|
||||
int num = (int) Math.ceil(count / max);
|
||||
price = 50 + (num - 1) * 5.5;
|
||||
double base_price = 5.5;
|
||||
if(num >50){
|
||||
base_price = 4;
|
||||
}
|
||||
price = 50 + (num - 1) * base_price;
|
||||
} else {//激凸、烫金工艺一样价格
|
||||
//20刀模费,20版费,5mm出血,7.5元/平方
|
||||
price = (length + 0.5) * (width + 0.5) * count / 10000 * 7.5 + 40;
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
<input type="radio" lay-filter="kind" name="kind" value="特种纸名片" title="特种纸名片">
|
||||
<input type="radio" lay-filter="kind" name="kind" value="婚礼卡" title="婚礼卡">
|
||||
<input type="radio" lay-filter="kind" name="kind" value="种子纸" title="种子纸">
|
||||
<input type="radio" lay-filter="kind" name="kind" value="反转胶片" title="反转胶片">
|
||||
</span>
|
||||
</div>
|
||||
<div id="doorList" style="display: none">
|
||||
@@ -149,6 +150,12 @@
|
||||
checked="checked">
|
||||
<input type="radio" name="kindValue7" lay-filter="kindValue7" value="8" title="250克牛皮纸">
|
||||
</div>
|
||||
<div class="kindValue8" style="display:none">
|
||||
<input type="radio" name="kindValue" lay-filter="kindValue8" value="0" title="700克对裱铜版纸" checked="checked">
|
||||
<input type="radio" name="kindValue" lay-filter="kindValue8" value="1" title="700克对裱白卡纸">
|
||||
<input type="radio" name="kindValue" lay-filter="kindValue8" value="2" title="700克对裱珠光纸">
|
||||
<input type="radio" name="kindValue" lay-filter="kindValue8" value="3" title="700克对裱棉纸">
|
||||
</div>
|
||||
<div class="ui_sdk" style="display:none">
|
||||
<input type="radio" name="ui_sdk_cz" value="1" title="700克白卡纸" checked>
|
||||
</div>
|
||||
@@ -169,7 +176,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" lay-filter="z3type" name="z3type" value="5" title="奖牌">--%>
|
||||
<%-- <input type="radio" lay-filter="z3type" name="z3type" value="5" title="奖牌">--%>
|
||||
<input type="radio" name="z3type" lay-filter="z3type" value="4" title="自定义">
|
||||
</div>
|
||||
<p>材质</p>
|
||||
@@ -906,6 +913,30 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ui_fzjp" style="display: none;">
|
||||
<form class="layui-form">
|
||||
<p>
|
||||
工艺
|
||||
</p>
|
||||
<div class="layui-input-block">
|
||||
<div>
|
||||
印面工艺:
|
||||
<input type="checkbox" name="craft" value="单面" lay-filter="kindValue8" title="单面" checked>
|
||||
<input type="checkbox" name="craft" value="双面" lay-filter="kindValue8" title="双面">
|
||||
</div>
|
||||
<div>
|
||||
裁切工艺:
|
||||
<input type="checkbox" name="craft" value="直角裁切" lay-filter="kindValue8" title="直角裁切" checked>
|
||||
<input type="checkbox" name="craft" value="模切" lay-filter="kindValue8" title="模切">
|
||||
</div>
|
||||
<div>
|
||||
配件:
|
||||
<input type="checkbox" name="craft" value="装OPP袋" lay-filter="kindValue8" title="装OPP袋" checked>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
@@ -1403,11 +1434,11 @@
|
||||
$('input[class = mq]').prop('checked', false);
|
||||
}
|
||||
}
|
||||
if (type == "少数量" && type1 != "种子纸") {
|
||||
if (type == "少数量" && type1 != "种子纸" && type1 != "反转胶片") {
|
||||
$("#lesspeijian").show();
|
||||
$("#lesspeijian").find(":input").attr("disabled", false);
|
||||
}
|
||||
if (type == "少数量" && type1 != "种子纸" && (s.split("*")[0] > 42 || s.split("*")[1] > 28.5) && (s.split("*")[0] > 28.5 || s.split("*")[1] > 42)) {
|
||||
if (type == "少数量" && type1 != "种子纸" && type1 != "反转胶片" && (s.split("*")[0] > 42 || s.split("*")[1] > 28.5) && (s.split("*")[0] > 28.5 || s.split("*")[1] > 42)) {
|
||||
$("#lesspeijian input").prop("checked", false);
|
||||
$("#lesspeijian").hide();
|
||||
$("#lesspeijian").find(":input").attr("disabled", true);
|
||||
@@ -1805,8 +1836,10 @@
|
||||
$(".ui_fm_l").show();
|
||||
$('.ui_fm_l').find(":input").attr("disabled", false);
|
||||
$('.ui_fm_l').find(":input").prop('checked', false);
|
||||
|
||||
$("#peijian_ui form")[0].reset();
|
||||
peijianuiHide()
|
||||
|
||||
if (data.value == '直角卡片' || data.value == '异形卡片' || data.value == '贺卡' || data.value == '特种纸名片') {
|
||||
if (data.elem.checked) {
|
||||
$("#lesspeijian").show();
|
||||
@@ -1831,7 +1864,8 @@
|
||||
$("#specialCard").find(":input").attr("disabled", true);
|
||||
$(".doublefumo").find(":input").prop("checked", false);
|
||||
}
|
||||
|
||||
$(".ui_fzjp").hide();
|
||||
$(".ui_fzjp").find(":input").attr("disabled", true);
|
||||
if (data.value == 10 && $("input[name='kindValue7']:checked").val() == 8) {
|
||||
$(".ui_xgt").show();
|
||||
$(".ui_xgt").attr("disabled", false);
|
||||
@@ -2389,8 +2423,12 @@
|
||||
$(".ui_menu_size").find(":input").attr("disabled", true);
|
||||
$(".ui_tzmp").hide();
|
||||
$(".ui_tzmp").find(":input").attr("disabled", true);
|
||||
$(".ui_fzjp").hide();
|
||||
$(".ui_fzjp").find(":input").attr("disabled", true);
|
||||
$(".kindValue6").hide();
|
||||
$(".kindValue6").find(":input").attr("disabled", true);
|
||||
$(".kindValue8").hide();
|
||||
$(".kindValue8").find(":input").attr("disabled", true);
|
||||
if ($("#number").val() > 1) {
|
||||
$("#ui_des").show();
|
||||
}
|
||||
@@ -2498,6 +2536,18 @@
|
||||
$('input[name="switchz3Size"]').prop('checked', false);
|
||||
$(".size-tip-z3").show();
|
||||
$(".size-tip-other").hide();
|
||||
} else if (data.value == "反转胶片") {
|
||||
|
||||
$(".kindValue8").show();
|
||||
$(".kindValue8").find(":input").attr("disabled", false);
|
||||
$(".kindValue2").hide();
|
||||
$(".kindValue2").find(":input").attr("disabled", true);
|
||||
$(".lessCountHideCraft").hide();
|
||||
$(".lessCountHideCraft").find(":input").attr("disabled", true);
|
||||
$(".ui_fzjp").show();
|
||||
$(".ui_fzjp").find(":input").attr("disabled", false);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
@@ -3376,7 +3426,33 @@
|
||||
$(".n_mq_input input").prop("disabled", true);
|
||||
}
|
||||
})
|
||||
|
||||
form.on("checkbox(kindValue8)", function (data) {
|
||||
let craft_list = [];
|
||||
$("input:checkbox[name='craft']:checked").each(function (i) {
|
||||
// 没有被禁用的工艺加到arr中
|
||||
if (!$(this).is(':disabled')) {
|
||||
craft_list.push($(this).val());
|
||||
}
|
||||
});
|
||||
const craft_arr = ["单面", "双面"];
|
||||
const craft1 = craft_arr.filter(craft => craft_list.includes(craft));
|
||||
if (craft1.length > 1) {
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg("印面工艺不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
const craft_arr1 = ["直角裁切", "模切"];
|
||||
const craft2 = craft_arr1.filter(craft => craft_list.includes(craft));
|
||||
if (craft2.length > 1) {
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg("裁切工艺不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
//点击计算,计算价格
|
||||
form.on('submit(acount_btn)', function (data) {
|
||||
/* var wangwang = $("#wangwang").val();
|
||||
@@ -3470,7 +3546,8 @@
|
||||
"菜单": "菜单",
|
||||
"婚礼报纸": "婚礼报纸",
|
||||
"特种纸名片": "特种纸名片",
|
||||
"种子纸": "种子纸"
|
||||
"种子纸": "种子纸",
|
||||
"反转胶片": "反转胶片"
|
||||
}, kindValueData = {
|
||||
0: "157克铜版纸",
|
||||
1: "200克铜版纸",
|
||||
@@ -3881,6 +3958,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
} else if (kind == "反转胶片") {
|
||||
if ((size.split("*")[0] < 5 || size.split("*")[1] < 5)) {
|
||||
layer.msg("反转胶片尺寸最小5*5CM", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if ((size.split("*")[0] > 20 || size.split("*")[1] > 30) && (size.split("*")[0] > 30 || size.split("*")[1] > 20)) {
|
||||
layer.msg("尺寸超过 20.0*30.cm 无法报价", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else if (kind != "异形卡片") {
|
||||
if ((size.split("*")[0] > 70 || size.split("*")[1] > 70)) {
|
||||
if ($("#count").val() != 1 && $("#count").val() != 5 && $("#count").val() % 10 != 0) {
|
||||
@@ -3977,7 +4065,7 @@
|
||||
// arr.push("双面不覆膜")
|
||||
// }
|
||||
} else {
|
||||
if (kind != "种子纸") {
|
||||
if (kind != "种子纸" && kind != "反转胶片") {
|
||||
arr.push($('input[name="craftShua"]:checked').val())
|
||||
}
|
||||
let shengz = $(".shengz:checked").length;
|
||||
@@ -4193,6 +4281,10 @@
|
||||
arr.push($("#kaichuang select option:selected").val());
|
||||
}
|
||||
span_result = span_result + " \n" + "工艺 :" + arr + ",不覆膜" + "\n";
|
||||
} else if (kindData[kind] == "反转胶片") {
|
||||
var span_result = kindData[kind] + " -" + size + "厘米-(" + same + ")"
|
||||
|
||||
span_result = span_result + " \n" + "工艺 :" + arr + "\n";
|
||||
} else {
|
||||
if (couponKind == "少数量") {
|
||||
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" %>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
<%@include file="/views/common.jsp" %>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
#z4_craft .layui-form-select .layui-edge {
|
||||
right: 20px;
|
||||
}
|
||||
</style>
|
||||
<div class="big_box">
|
||||
<div class="left_div">
|
||||
<h1 class="h1">UV磁吸贴</h1> <span style="color:red;font-weight:700;"></span>
|
||||
<hr>
|
||||
<form class="layui-form">
|
||||
<input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="UV磁吸贴"/>
|
||||
<p>
|
||||
材质
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<select name="kind" class="select" lay-search lay-filter="kind">
|
||||
<option value="1">UV磁吸贴</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
尺寸(CM/厘米)
|
||||
</p>
|
||||
<div class="layui-form-item" id="ui_size">
|
||||
<input type="text" name="size" placeholder="格式:长*宽" id="size" class="layui-input" autocomplete="off">
|
||||
</div>
|
||||
<p>
|
||||
数量(个)
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<input type="text" name="count" id="diyCount" placeholder="请输入整数" class="layui-input" autocomplete="off">
|
||||
</div>
|
||||
<p>
|
||||
款数
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<input type="text" placeholder="请输入整数" autocomplete="off" name="number" id="number" value="1"
|
||||
class="layui-input" lay-verify="number">
|
||||
</div>
|
||||
<p>
|
||||
客户旺旺
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<input type="text" placeholder="请输入客户旺旺号" autocomplete="off" name="wangwang" id="wangwang"
|
||||
class="layui-input">
|
||||
</div>
|
||||
<p>
|
||||
工艺
|
||||
</p>
|
||||
<div class="layui-form-item" id='z4_craft'>
|
||||
<div class="layui-input-block ">
|
||||
印面:
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="单面" title="单面" checked>
|
||||
</div>
|
||||
<div class="layui-input-block ">
|
||||
裁切工艺:
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="直角裁切" title="直角裁切" checked>
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="模切" title="模切">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="抠图" title="抠图">
|
||||
<div class="layui-inline crop" style="display:none;width: 80px">
|
||||
<input class="layui-input" type="text" name="cropNumber">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="acount_btn">计算</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
<h2>计算结果-
|
||||
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm copyResult"
|
||||
onclick="copyResult()">点击复制
|
||||
</button>
|
||||
</h2>
|
||||
<div>
|
||||
<textarea rows="11" cols="75" id="span_result" readonly="readonly"></textarea>
|
||||
<%@include file="../acountExpressFee.jsp" %>
|
||||
</div>
|
||||
<div>
|
||||
<table class="layui-hide" id="priceTable" lay-filter="priceTable"></table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="right_div" style="margin-left:50px;">
|
||||
<div class="layui-carousel" id="test1">
|
||||
<div carousel-item id="carousel"></div>
|
||||
<br>
|
||||
<div id="remark" style="font-size:20px;color:red"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<%@include file="/views/copyResult.jsp" %>
|
||||
<script>
|
||||
layui.use(['table', 'form', 'carousel'], function () {
|
||||
var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
||||
var carousel = layui.carousel;
|
||||
var table = layui.table;
|
||||
|
||||
//建造实例
|
||||
ins = carousel.render({});
|
||||
var html = " ";
|
||||
var remark = " ";
|
||||
|
||||
// 清空轮播图
|
||||
$("#carousel").empty();
|
||||
$("#remark").empty();
|
||||
|
||||
$.ajax({
|
||||
url: "${pageContext.request.contextPath}/getImgs",
|
||||
type: "GET",
|
||||
data: {
|
||||
proTypeValue: $("#proTypeValue").val(),
|
||||
kindValue: $('input[name="kindValue"]').val()
|
||||
},
|
||||
success: function (result) {
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
// 只留一个remark
|
||||
remark = "";
|
||||
html += '<div><img style="width:100%;height: 100%;object-fit: contain" src="' + result[i].imgUrl + '"></div>';
|
||||
remark += '<div><span>' + result[i].remark + '<span/></div>';
|
||||
}
|
||||
$("#carousel").append(html);
|
||||
// 如果没有说明,就不显示null
|
||||
if (remark.indexOf("null") < 0) {
|
||||
$("#remark").append(remark);
|
||||
}
|
||||
// 如果没有轮播图就隐藏
|
||||
if (result.length == 0) {
|
||||
document.getElementById("test1").style.display = "none"; //隐藏
|
||||
} else {
|
||||
document.getElementById("test1").style.display = "block"; //显示
|
||||
ins.reload({
|
||||
elem: '#test1',
|
||||
width: result[0].imgWidth, //设置容器宽度
|
||||
height: result[0].imgHeight
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
form.on('checkbox(ui_craft)', function (data) {
|
||||
let craft_list = [];
|
||||
$("input[name='craft']:checked").each(function () {
|
||||
if (!$(this).is(':disabled')) {
|
||||
craft_list.push($(this).val());
|
||||
}
|
||||
}
|
||||
);
|
||||
const carft_list1 = ["直角裁切", "模切"];
|
||||
|
||||
const carft1 = carft_list1.filter(craft => craft_list.includes(craft));
|
||||
if (carft1.length > 1) {
|
||||
$(data.elem).prop("checked", false);
|
||||
layer.msg("裁切工艺不能同时选择", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
}
|
||||
form.render();
|
||||
})
|
||||
|
||||
// 点击计算,计算价格
|
||||
form.on('submit(acount_btn)', function (data) {
|
||||
var number = $("#number").val();
|
||||
var size = $("#size").val();
|
||||
var count = $("#diyCount").val();
|
||||
var kind = $("select[name='kind'] option:selected").text();
|
||||
var kindValue = $("select[name='kindValue'] option:selected").text();
|
||||
var craft = [];
|
||||
|
||||
if (size == "") {
|
||||
layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$("input:checkbox[name='craft']:checked").each(function (i) {
|
||||
// 没有被禁用的工艺加到arr中
|
||||
if (!$(this).is(':disabled')) {
|
||||
if ($(this).val() == "抠图") {
|
||||
craft.push($(this).val() + $("input[name='cropNumber']").val());
|
||||
return;
|
||||
} else {
|
||||
craft.push($(this).val());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ((size.split("*")[0] < 5 || size.split("*")[1] < 5)) {
|
||||
layer.msg("最小尺寸不能小于5*5", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if ((size.split("*")[0] > 120 || size.split("*")[1] > 1200) && (size.split("*")[0] > 1200 || size.split("*")[1] > 120)) {
|
||||
layer.msg("最大尺寸不能超过120*1200", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "${path}/getThanSum",
|
||||
type: "GET",
|
||||
data: $(".big_box form").serialize(),
|
||||
success: function (result) {
|
||||
if (result.code == 100) {
|
||||
layer.msg(result.msg, {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var data = result.data.proList;
|
||||
|
||||
var span_result = 'UV磁吸贴 - ' + size + ' cm (同款内容)\n';
|
||||
|
||||
span_result += `工艺:` + craft.join(",") + '\n';
|
||||
|
||||
if (number > 1) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n'
|
||||
data[i].number = number;
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
span_result += number + '款 ' + data[i].count + "个,共" + data[i].price + "元" + '\n'
|
||||
data[i].number = number;
|
||||
}
|
||||
}
|
||||
|
||||
span_result += '包邮,免费设计呢~(偏远地区需补邮费)'
|
||||
if (window.parent.system_isGai) {
|
||||
span_result += "\n\n亲 现在下单可以参加淘宝活动8.5折折扣哦!"
|
||||
}
|
||||
addLog(span_result);
|
||||
$("#span_result").val(span_result);
|
||||
|
||||
//计算完自动复制文本
|
||||
var e = document.getElementById("span_result");//对象是content
|
||||
if (e.value != "") {
|
||||
e.select();//选择对象
|
||||
document.execCommand("Copy");//执行浏览器复制命令
|
||||
}
|
||||
|
||||
//生成表格
|
||||
table.render({
|
||||
elem: '#priceTable',
|
||||
even: true, //隔行变色
|
||||
data: data, // 赋值已知数据
|
||||
width: 500,
|
||||
cols: [[
|
||||
{
|
||||
field: 'number',
|
||||
width: '12%',
|
||||
align: "center",
|
||||
title: '款数'
|
||||
}, {
|
||||
field: 'count',
|
||||
width: '16%',
|
||||
align: "center",
|
||||
title: '数量'
|
||||
}, {
|
||||
field: 'price',
|
||||
width: '16%',
|
||||
align: "center",
|
||||
title: '报价'
|
||||
}, {
|
||||
field: 'wangwang',
|
||||
align: "center",
|
||||
width: '16%',
|
||||
title: '折扣价'
|
||||
}, {
|
||||
field: 'wangwang',
|
||||
align: "center",
|
||||
width: '19%',
|
||||
title: '跳楼价'
|
||||
}, {
|
||||
field: 'weight',
|
||||
width: '21%',
|
||||
align: "center",
|
||||
title: '重量(kg)'
|
||||
}
|
||||
]],
|
||||
done: function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -62,7 +62,7 @@
|
||||
<div class="layui-input-block ">
|
||||
印面:
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="单面" title="单面" checked>
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="双面" title="双面">
|
||||
<%-- <input type="checkbox" name="craft" lay-filter="ui_craft" value="双面" title="双面">--%>
|
||||
</div>
|
||||
<div class="layui-input-block ">
|
||||
裁切工艺:
|
||||
|
||||
Reference in New Issue
Block a user