1
0

新增伸缩手拉旗,新增熨斗,限制鼠标垫尺寸

Este cometimento está contido em:
2026-03-28 11:47:08 +08:00
ascendente b2d74bf0f3
cometimento 7b2f033fe6
5 ficheiros modificados com 440 adições e 229 eliminações
+1 -1
Ver ficheiro
@@ -357,7 +357,7 @@ public class ProductController {
} }
String size = product.getSize(); String size = product.getSize();
if (("17".equals(product.getProTypeValue()) && "6".equals(product.getKindValue())) || "手拉旗".equals(product.getProTypeValue())) { if (("17".equals(product.getProTypeValue()) && "6".equals(product.getKindValue())) || ("手拉旗".equals(product.getProTypeValue()) && "常规".equals(product.getStickerKind()))) {
if (!StringUtils.isEmpty(size)) { if (!StringUtils.isEmpty(size)) {
String sizeList[] = size.split(","); String sizeList[] = size.split(",");
size = sizeList[0]; size = sizeList[0];
+41 -3
Ver ficheiro
@@ -251,7 +251,7 @@ public class ProductService {
String sizeList[] = size.split(","); String sizeList[] = size.split(",");
size = sizeList[0]; size = sizeList[0];
} }
} else if ("手拉旗".equals(proType)) { } else if (("手拉旗".equals(dto.getProTypeValue()) && "常规".equals(dto.getStickerKind()))) {
size += "*" + dto.getWidth(); size += "*" + dto.getWidth();
} }
int count = dto.getCount(); int count = dto.getCount();
@@ -2690,7 +2690,12 @@ public class ProductService {
} }
apprise = product.getPrice(); apprise = product.getPrice();
} }
if (craft_list.contains("熨斗")) {
dto.setPo_number(dto.getPo_number() == null ? 1 : dto.getPo_number());
for (Product product : priceList) {
product.setPrice(product.getPrice() + 40 * Math.max(dto.getPo_number(), 1));
}
}
return priceList; return priceList;
} }
if (length <= 2) { if (length <= 2) {
@@ -2705,6 +2710,7 @@ public class ProductService {
// 1006 1003 1005 1037 1058 1002 1033 1045 卓盛 航和 米笛儿 竹范 领淘文具 榆家 涛莱 拼多多uv单独报价 // 1006 1003 1005 1037 1058 1002 1033 1045 卓盛 航和 米笛儿 竹范 领淘文具 榆家 涛莱 拼多多uv单独报价
List<String> crafts = new ArrayList<>(dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft())); List<String> crafts = new ArrayList<>(dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()));
crafts.remove("刮板"); crafts.remove("刮板");
crafts.remove("熨斗");
crafts.remove("哑光"); crafts.remove("哑光");
if (crafts.size() > 0 && "烫金".equals(crafts.get(0))) { if (crafts.size() > 0 && "烫金".equals(crafts.get(0))) {
crafts.remove(0); crafts.remove(0);
@@ -2729,6 +2735,7 @@ public class ProductService {
product.setPrice(product.getPrice() + 2 * Math.max(dto.getPcount(), 1)); product.setPrice(product.getPrice() + 2 * Math.max(dto.getPcount(), 1));
} }
} }
if ("宠物转印贴".equals(dto.getKind())) { if ("宠物转印贴".equals(dto.getKind())) {
for (Product product : priceList) { for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() == 50 ? product.getPrice() : product.getPrice() * 1.3)); product.setPrice(Math.ceil(product.getPrice() == 50 ? product.getPrice() : product.getPrice() * 1.3));
@@ -4483,11 +4490,39 @@ public class ProductService {
/* /*
* if(kind.equals("1")) { if(length == 70 && width == 24) { priceList = new FgqPrice().getSlqSpeicPrice(count, priceList, 1); }else if(length == 50 && width == 17) { priceList = new FgqPrice().getSlqSpeicPrice(count, priceList, 2); }else { priceList = new FgqPrice().getSlqPrice(count, priceList); } }else { * if(kind.equals("1")) { if(length == 70 && width == 24) { priceList = new FgqPrice().getSlqSpeicPrice(count, priceList, 1); }else if(length == 50 && width == 17) { priceList = new FgqPrice().getSlqSpeicPrice(count, priceList, 2); }else { priceList = new FgqPrice().getSlqPrice(count, priceList); } }else {
*/ */
if ("常规".equals(dto.getStickerKind())) {
priceList = new FgqPrice().getSlqPrice(count, priceList); priceList = new FgqPrice().getSlqPrice(count, priceList);
}
if ("伸缩手拉旗".equals(dto.getStickerKind())) {
double base_price = 0;
if ((length == 24 && width == 70) || (length == 70 && width == 24)) {
base_price = 30;
}
if ((length == 24 && width == 50) || (length == 50 && width == 24)) {
base_price = 30;
}
if ((length == 24 && width == 100) || (length == 100 && width == 24)) {
base_price = 35;
}
if ((length == 17 && width == 70) || (length == 70 && width == 17)) {
base_price = 30;
}
if ((length == 17 && width == 50) || (length == 50 && width == 17)) {
base_price = 30;
}
if ((length == 17 && width == 100) || (length == 100 && width == 17)) {
base_price = 35;
}
Product product = new Product();
product.setCount(dto.getCount());
product.setNumber(number);
product.setPrice(Math.ceil(base_price * dto.getCount()));
priceList.add(product);
}
/* } */ /* } */
for (Product product : priceList) { for (Product product : priceList) {
product.setPrice(Math.floor(product.getPrice() * number)); product.setPrice(Math.floor(product.getPrice() * number));
product.setWeight(df.format(length * width * product.getCount() / 10000 * number * 0.075)); product.setWeight(df.format(length * width * product.getCount() / 10000 * number * 0.075));
} }
return priceList; return priceList;
@@ -5398,6 +5433,9 @@ public class ProductService {
pro.setWeight(df.format(width * length * 1.2 * count * 0.1 / 1000 * Double.parseDouble(kind))); pro.setWeight(df.format(width * length * 1.2 * count * 0.1 / 1000 * Double.parseDouble(kind)));
priceList.add(pro); priceList.add(pro);
} }
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() * number));
}
return priceList; return priceList;
} }
+42
Ver ficheiro
@@ -180,6 +180,16 @@
<input type="text" name="pcount" class="layui-input layui-inline" value="1"> <input type="text" name="pcount" class="layui-input layui-inline" value="1">
</div> </div>
</div> </div>
<span id="yundou">
<input type="checkbox" name="craft" lay-filter="craftZhuan" value="熨斗" title="熨斗"
class="craftZhuan">
<div class="layui-inline" id="yundouNumber" style="width: 80px;display: none">
<div style="display:flex;align-items: center">
<span style="flex-shrink: 0">数量:</span>
<input type="text" name="po_number" class="layui-input layui-inline" value="1">
</div>
</div>
</span>
</div> </div>
<div class="layui-input-block"> <div class="layui-input-block">
其他工艺: 其他工艺:
@@ -336,6 +346,11 @@
$("#sehu_number").hide(); $("#sehu_number").hide();
$(".tjselect select").prop("disabled", true); $(".tjselect select").prop("disabled", true);
$("#sehu_number select").prop("disabled", true); $("#sehu_number select").prop("disabled", true);
$("#guaban").hide();
$("#guaban").find(":input").attr("disabled", true);
$("#yundou").hide();
$("#yundouNumber").hide();
$("#yundou").find(":input").attr("disabled", true);
if (kindData.value == "金属标") { if (kindData.value == "金属标") {
// 切换为品种单选框 // 切换为品种单选框
$(".metal").show(); $(".metal").show();
@@ -368,10 +383,15 @@
if (craftChecked) { if (craftChecked) {
$(`input[name='craft'][value='冷转印']+div`).click(); $(`input[name='craft'][value='冷转印']+div`).click();
} }
craftChecked = $(`input[name='craft'][value='熨斗']`).is(":checked");
if (craftChecked) {
$(`input[name='craft'][value='熨斗']+div`).click();
}
if (kindData.value == "UV转印贴") { if (kindData.value == "UV转印贴") {
$(".zhuanuv").show(); $(".zhuanuv").show();
$(".zhuanuv").find(":input").attr("disabled", false); $(".zhuanuv").find(":input").attr("disabled", false);
} }
} }
form.render();//必须写 form.render();//必须写
@@ -415,12 +435,31 @@
layer.msg('[烫画,冷转印]不能选择刮板配件!', {offset: ['300px', '300px']}, {icon: 5}); layer.msg('[烫画,冷转印]不能选择刮板配件!', {offset: ['300px', '300px']}, {icon: 5});
return false; return false;
} }
if (craft_list.indexOf("烫画") > -1) {
$("#yundou").show();
} else {
$("#yundou").hide();
let craftChecked = $(`input[name='craft'][value='熨斗']`).is(":checked");
if (craftChecked) {
$(`input[name='craft'][value='熨斗']+div`).click();
}
}
let most = 1; let most = 1;
if (craft_list.indexOf("刮板") > -1) { if (craft_list.indexOf("刮板") > -1) {
most = 2; most = 2;
$("#guaban").show(); $("#guaban").show();
$("#guaban").find(":input").attr("disabled", false);
} else { } else {
$("#guaban").hide(); $("#guaban").hide();
$("#guaban").find(":input").attr("disabled", true);
}
if (craft_list.indexOf("熨斗") > -1) {
most = 2;
$("#yundouNumber").show();
$("#yundouNumber").find(":input").attr("disabled", false);
} else {
$("#yundouNumber").hide();
$("#yundouNumber").find(":input").attr("disabled", true);
} }
if (craftZhuan > most) { if (craftZhuan > most) {
@@ -470,6 +509,9 @@
} else if ($(this).val() == "刮板") { } else if ($(this).val() == "刮板") {
let co_count = $("input[name='pcount']").val(); let co_count = $("input[name='pcount']").val();
craftShua.push($(this).val() + co_count + "个"); craftShua.push($(this).val() + co_count + "个");
} else if ($(this).val() == "熨斗") {
let co_count = $("input[name='po_number']").val();
craftShua.push($(this).val() + co_count + "个");
} else { } else {
craftShua.push($(this).val()); craftShua.push($(this).val());
} }
+5
Ver ficheiro
@@ -259,6 +259,11 @@
}); });
return false; return false;
} }
if (Number.parseFloat(size.split("*")[0]) % 1 !== 0 || Number.parseFloat(size.split("*")[1]) % 1 !== 0) {
layer.msg('尺寸不能存在小数点!', {offset: ['300px', '300px']}, function () {
});
return false;
}
$("input:checkbox[name='craft']:checked").each(function (i) { $("input:checkbox[name='craft']:checked").each(function (i) {
// 没有被禁用的工艺加到arr中 // 没有被禁用的工艺加到arr中
if (!$(this).is(':disabled')) { if (!$(this).is(':disabled')) {
+135 -9
Ver ficheiro
@@ -8,6 +8,12 @@
<title>Insert title here</title> <title>Insert title here</title>
<%@include file="/views/common.jsp" %> <%@include file="/views/common.jsp" %>
</head> </head>
<style>
.craftItem .layui-form-select .layui-edge {
right: 20px;
}
</style>
<body> <body>
<div class="big_box"> <div class="big_box">
<div class="left_div"> <div class="left_div">
@@ -15,6 +21,11 @@
<hr> <hr>
<form class="layui-form"> <form class="layui-form">
<input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="手拉旗"/> <input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="手拉旗"/>
<div class="layui-form-item">
<input type="radio" lay-filter="stickerKind" name="stickerKind" value="常规" title="常规" checked>
<input type="radio" lay-filter="stickerKind" name="stickerKind" value="伸缩手拉旗" title="伸缩手拉旗">
</div>
<p> <p>
材质 材质
</p> </p>
@@ -25,6 +36,7 @@
<option value="2">贡缎布</option> <option value="2">贡缎布</option>
</select> </select>
</div> </div>
<div class="layui-form-item changgui">
<p> <p>
宽度 宽度
</p> </p>
@@ -40,6 +52,22 @@
<div class="layui-form-item"> <div class="layui-form-item">
<input type="text" placeholder="请输入长度" name="size" id="size" class="layui-input" autocomplete="off"> <input type="text" placeholder="请输入长度" name="size" id="size" class="layui-input" autocomplete="off">
</div> </div>
</div>
<div class="layui-form-item shensuo" style="display: none">
<p>
尺寸
</p>
<div class="layui-form-item">
<select name="size" id="shensuosize" class="select">
<option value="24*70">24*70cm</option>
<option value="24*50">24*50cm</option>
<option value="24*100">24*100cm</option>
<option value="17*70">17*70cm</option>
<option value="17*50">17*50cm</option>
<option value="17*100">17*100cm</option>
</select>
</div>
</div>
<p> <p>
数量(个) 数量(个)
</p> </p>
@@ -58,12 +86,35 @@
<div class="layui-form-item"> <div class="layui-form-item">
<input type="text" placeholder="请输入客户旺旺号" autocomplete="off" name="wangwang" id="wangwang" class="layui-input"> <input type="text" placeholder="请输入客户旺旺号" autocomplete="off" name="wangwang" id="wangwang" class="layui-input">
</div> </div>
<div class="layui-form-item craftItem" style="display: none">
<p>
工艺
</p>
<div class="layui-form-item">
<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>
<div id="ccolor" class="layui-inline" style="width: 90px">
<select name="shen_color" class="select">
<option value="黑色" selected>黑色</option>
<option value="灰色">灰色</option>
</select>
</div>
</div>
</div>
</div>
<hr> <hr>
<div class="layui-form-item"> <div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="acount_btn">计算</button> <button class="layui-btn" lay-submit="" lay-filter="acount_btn">计算</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div> </div>
<h2>计算结果-<button type="button" class="layui-btn layui-btn-primary layui-btn-sm copyResult" onclick="copyResult()">点击复制</button></h2> <h2>计算结果-
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm copyResult" onclick="copyResult()">点击复制</button>
</h2>
<div> <div>
<textarea rows="11" cols="75" id="span_result" readonly="readonly"></textarea> <textarea rows="11" cols="75" id="span_result" readonly="readonly"></textarea>
<%@include file="../acountExpressFee.jsp" %> <%@include file="../acountExpressFee.jsp" %>
@@ -89,8 +140,16 @@ layui.use(['table','form','carousel'], function(){
var carousel = layui.carousel; var carousel = layui.carousel;
var table = layui.table; var table = layui.table;
$(".shensuo").hide();
$(".shensuo select").attr("display", true);
form.render();
//建造实例 //建造实例
ins = carousel.render({}); ins = carousel.render({});
getImages();
function getImages() {
let stickerKind = $("input[name='stickerKind']:checked").val();
var html = " "; var html = " ";
var remark = " "; var remark = " ";
// 清空轮播图 // 清空轮播图
@@ -100,13 +159,13 @@ layui.use(['table','form','carousel'], function(){
url: "${pageContext.request.contextPath}/getImgs", url: "${pageContext.request.contextPath}/getImgs",
type: "GET", type: "GET",
data: { data: {
proTypeValue : $("#proTypeValue").val(), proTypeValue: $("#proTypeValue").val(), kindValue: stickerKind
}, },
success: function (result) { success: function (result) {
for (let i = 0; i < result.length; i++) { for (let i = 0; i < result.length; i++) {
// 只留一个remark // 只留一个remark
remark = ""; remark = "";
html += '<div><img style="width:'+result[0].imgWidth+'px" src="' +result[i].imgUrl+ '"></div>'; html += '<div><img style="width:100%;height: 100%;object-fit: contain" src="' + result[i].imgUrl + '"></div>';
remark += '<div><span>' + result[i].remark + '<span/></div>'; remark += '<div><span>' + result[i].remark + '<span/></div>';
} }
$("#carousel").append(html); $("#carousel").append(html);
@@ -127,6 +186,46 @@ layui.use(['table','form','carousel'], function(){
} }
} }
}); });
}
form.on("radio(stickerKind)", function (data) {
$(".shensuo").hide();
$(".changgui").hide();
$(".shensuo select").attr("disabled", true);
$(".changgui select").attr("disabled", true);
$(".changgui ").find("input").attr("disabled", true);
$(".craftItem").hide();
$(".craftItem").find("input").attr("disabled", true);
let html = '';
if (data.value == "常规") {
$(".changgui").show();
$(".changgui select").attr("disabled", false);
$(".changgui ").find("input").attr("disabled", false);
html = `<option value="1">春亚布</option>
<option value="2">贡缎布</option>`;
}
if (data.value == "伸缩手拉旗") {
$(".shensuo").show();
$(".shensuo select").attr("disabled", false);
$(".shensuo ").find("input").attr("disabled", false);
$(".craftItem").show();
$(".craftItem").find("input").attr("disabled", false);
html = `<option value="1">PET</option>`;
}
$("#kindValue").empty();
$("#kindValue").append(html);
getImages();
form.render();
})
form.on("checkbox(ui_craft)",function(data){
$(data.elem).prop("checked", true);
layer.msg("工艺无法取消", {offset: ['300px', '300px']}, function () {
});
form.render();
return false;
})
// 点击计算,计算价格 // 点击计算,计算价格
form.on('submit(acount_btn)', function (data) { form.on('submit(acount_btn)', function (data) {
@@ -135,33 +234,60 @@ layui.use(['table','form','carousel'], function(){
var width = $("#width option:selected").val(); var width = $("#width option:selected").val();
var count = $("#count").val(); var count = $("#count").val();
var kind = $("#kindValue option:selected").text(); var kind = $("#kindValue option:selected").text();
var craft = $("input[name='craft']:checked").val(); var size = $("#shensuosize option:selected").val();
let stickerKind = $("input[name='stickerKind']:checked").val();
if (stickerKind == "常规") {
if (!length) { if (!length) {
layer.msg('请填写长度!',{offset:['300px','300px']},function(){}); layer.msg('请填写长度!', {offset: ['300px', '300px']}, function () {
});
return false; return false;
} }
if (length > 100) { if (length > 100) {
layer.msg('最大长度100cm',{offset:['300px','300px']},function(){}); layer.msg('最大长度100cm', {offset: ['300px', '300px']}, function () {
});
return false; return false;
} }
}
if (!count) { if (!count) {
layer.msg('请填写数量!',{offset:['300px','300px']},function(){}); layer.msg('请填写数量!', {offset: ['300px', '300px']}, function () {
});
return false; return false;
} }
let craft_list = [];
$("input[name='craft']:checked").each(function () {
if (!$(this).is(':disabled')) {
if ($(this).val() == "手柄") {
craft_list.push($("#ccolor option:selected").val() + $(this).val());
} else {
craft_list.push($(this).val());
}
}
}
);
$.ajax({ $.ajax({
url: "${path}/getThanSum", url: "${path}/getThanSum",
type: "GET", type: "GET",
data: $(".big_box form").serialize(), data: $(".big_box form").serialize(),
success: function (result) { success: function (result) {
if (result.code == 100) { if (result.code == 100) {
layer.msg(result.msg,{offset:['300px','300px']},function(){}); layer.msg(result.msg, {offset: ['300px', '300px']}, function () {
});
return false; return false;
} }
var data = result.data.proList; var data = result.data.proList;
var span_result = '';
if (stickerKind == "常规") {
if ((length == 70 && width == 24) || (length == 50 && width == 17)) { if ((length == 70 && width == 24) || (length == 50 && width == 17)) {
kind += "(特价)"; kind += "(特价)";
} }
var span_result = '手拉旗 - ' + kind + '-' + length + '*' + width +' CM (同款内容)\n'; span_result = '手拉旗 - ' + kind + ' - ' + length + '*' + width + ' CM (同款内容)\n';
}
if (stickerKind == "伸缩手拉旗") {
span_result = '伸缩手拉旗 - ' + kind + ' - ' + size + ' CM (同款内容)\n';
span_result += "工艺:" + craft_list.join(",") + "\n";
}
if (number > 1) { if (number > 1) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n' span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n'