新增淋膜纸尺寸

This commit is contained in:
2026-01-12 16:38:03 +08:00
parent ba14bb9f0d
commit 79c764ad78
2 changed files with 49 additions and 10 deletions
@@ -5718,16 +5718,17 @@ public class ProductService {
private List<Product> getLingmoPrice(Product dto, Double width, Double length) {
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
String[] sizes = {"21*29", "36*24", "36*26", "42*28.5"};
double[][] prices = new double[][]{
{1150, 1950, 2350, 3300, 6150},
{1350, 2050, 2550, 4050, 7200},
{1450, 2100, 2650, 4250, 7500},
{1700, 2750, 3600, 6000, 11000},
};
int count_list[] = {10000, 20000, 30000, 50000, 100000};
int current_int = Arrays.binarySearch(sizes, dto.getSize());
double[] prices_list = prices[current_int];
double[] prices_list = {1150, 1950, 2350, 3300, 6150};
if ((width <= 21 && length <= 29) || (length <= 21 && width <= 29)) {
} else if ((width <= 36 && length <= 24) || (length <= 36 && width <= 24)) {
prices_list = new double[]{1350, 2050, 2550, 4050, 7200};
} else if ((width <= 36 && length <= 26) || (length <= 36 && width <= 26)) {
prices_list = new double[]{1450, 2100, 2650, 4250, 7500};
} else if ((width <= 42 && length <= 28.5) || (length <= 42 && width <= 28.5)) {
prices_list = new double[]{1700, 2750, 3600, 6000, 11000};
}
List<Product> list = new ArrayList<>();
for (int i = 0; i < count_list.length; i++) {
double price = prices_list[i];
+39 -1
View File
@@ -31,6 +31,9 @@
</div>
<p>
尺寸(CM/厘米)
<span>
<input type="checkbox" name="switchSize" lay-filter="switchSize" title="自定义尺寸">
</span>
</p>
<div class="layui-form-item" id="ui_size">
<select name="size" class="select" id="size">
@@ -40,7 +43,9 @@
<option value="42*28.5">42*28.5</option>
</select>
</div>
<div class="layui-form-item" style="display: none">
<input type="text" name="size" id="diySize" placeholder="格式:长*宽" class="layui-input" autocomplete="off">
</div>
<p>
数量(个)
</p>
@@ -193,6 +198,20 @@
return false;
}
})
form.on('checkbox(switchSize)', function (data) {
$("#diySize").parent().hide()
$("#size").parent().show()
$("#size").attr("disabled", false);
$("#diySize").attr("disabled", true);
if (data.elem.checked) {
$("#diySize").parent().show()
$("#size").parent().hide()
$("#size").attr("disabled", true);
$("#diySize").attr("disabled", false);
}
form.render();
})
// 点击计算,计算价格
form.on('submit(acount_btn)', function (data) {
@@ -202,9 +221,28 @@
var kind = $("#ui_bq_name option:selected").text();
var craft = [];
let coNumber = $("select[name='co_number'] option:selected").val()
if ($("input[name='switchSize']").is(":checked")) {
size = $("#diySize").val();
}
if(coNumber == ""){
layer.msg("请选择印色数量", {offset: ['300px', '300px']}, function () {
});
return false;
}
if (size == "") {
layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
});
return false;
}
if ((size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[1] > 42 || size.split("*")[0] > 28.5)) {
layer.msg('最大尺寸42*28.5cm', {offset: ['300px', '300px']}, function () {
});
return false;
}
if ((size.split("*")[0] < 21 || size.split("*")[1] < 14)&&(size.split("*")[0] < 14 || size.split("*")[1] < 21)) {
layer.msg('最小尺寸21*14cm', {offset: ['300px', '300px']}, function () {
});
return false;
}
$("input:checkbox[name='craft']:checked").each(function (i) {
// 没有被禁用的工艺加到arr中