新增包装纸
Цей коміт міститься в:
@@ -16,16 +16,18 @@
|
||||
</style>
|
||||
<div class="big_box">
|
||||
<div class="left_div">
|
||||
<h1 class="h1">方巾</h1> <span style="color:red;font-weight:700;"></span>
|
||||
<h1 class="h1">包装纸</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="方巾纸"/>
|
||||
<input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="包装纸"/>
|
||||
<p>
|
||||
材质
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<select name="kind" class="select" lay-search>
|
||||
<option value="1">15克木浆纸</option>
|
||||
<select name="kind" class="select" lay-search lay-filter="kind_filter">
|
||||
<option value="1">157克铜版纸</option>
|
||||
<option value="2">100克白牛皮</option>
|
||||
<option value="3">100克黄牛皮</option>
|
||||
</select>
|
||||
</div>
|
||||
<p>
|
||||
@@ -33,48 +35,12 @@
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<select name="size" class="layui-form-select" lay-filter="pcount_filter">
|
||||
<option value="22*22">22*22cm</option>
|
||||
<option value="23*23">23*23cm</option>
|
||||
<option value="27*27">27*27cm</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input type="radio" name="shen_color" lay-filter="colorType" title="单色" value="单色" checked>
|
||||
<span>
|
||||
<input type="radio" name="shen_color" lay-filter="colorType" title="双色" value="双色">
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
印刷颜色
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<select name="craft" class="layui-form-select">
|
||||
<option value="黑色">黑色</option>
|
||||
<option value="咖啡色">咖啡色</option>
|
||||
<option value="浅绿色">浅绿色</option>
|
||||
<option value="深绿色">深绿色</option>
|
||||
<option value="蓝色">蓝色</option>
|
||||
<option value="橘色">橘色</option>
|
||||
<option value="黄色">黄色</option>
|
||||
<option value="红色">红色</option>
|
||||
</select>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item" style="display: none">
|
||||
<select id="colorT" name="craft" class="layui-form-select" disabled>
|
||||
<option value="黑色">黑色</option>
|
||||
<option value="咖啡色">咖啡色</option>
|
||||
<option value="浅绿色">浅绿色</option>
|
||||
<option value="深绿色">深绿色</option>
|
||||
<option value="蓝色">蓝色</option>
|
||||
<option value="橘色">橘色</option>
|
||||
<option value="黄色">黄色</option>
|
||||
<option value="红色">红色</option>
|
||||
<option value="98*70">98*70cm</option>
|
||||
<option value="70*49">70*49cm</option>
|
||||
</select>
|
||||
</div>
|
||||
<p>
|
||||
数量(箱)
|
||||
数量
|
||||
</p>
|
||||
<div class="layui-form-item">
|
||||
<input type="text" name="count" id="count" class="layui-input">
|
||||
@@ -103,7 +69,23 @@
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
裁切工艺:
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="方形" title="方形" checked readonly>
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="直角裁切" title="直角裁切" checked readonly>
|
||||
</div>
|
||||
<div class="layui-input-block fumo">
|
||||
覆膜工艺:
|
||||
<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">
|
||||
配件:
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="双面胶" title="双面胶">
|
||||
<div class="layui-inline shuang" style="width: 100px;display: none">
|
||||
<input class="layui-input" name="maxian"/>
|
||||
</div>
|
||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="丝带" title="丝带">
|
||||
<div class="layui-inline sidai" style="width: 100px;display: none">
|
||||
<input class="layui-input" name="pcount"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -146,7 +128,7 @@
|
||||
ins = carousel.render({});
|
||||
var html = " ";
|
||||
var remark = " ";
|
||||
const carft_list1 = ["单面", "双面"];
|
||||
const carft_list1 = ["哑膜", "亮膜"];
|
||||
|
||||
// 清空轮播图
|
||||
$("#carousel").empty();
|
||||
@@ -185,41 +167,51 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on('select(pcount_filter)', function (data) {
|
||||
$("input[name='shen_color'][value='单色']").click();
|
||||
$("input[name='shen_color'][value='双色']").parent().show();
|
||||
$("input[name='shen_color'][value='双色']").attr("disabled", false);
|
||||
$("#colorT").parent().hide();
|
||||
$("#colorT").attr("disabled", true)
|
||||
if (data.value == '23*23') {
|
||||
$("input[name='shen_color'][value='双色']").parent().hide();
|
||||
$("input[name='shen_color'][value='双色']").attr("disabled", true);
|
||||
}
|
||||
form.render();
|
||||
})
|
||||
form.on("radio(colorType)", function (data) {
|
||||
$("#colorT").parent().hide();
|
||||
$("#colorT").attr("disabled", true)
|
||||
if (data.value == '双色') {
|
||||
$("#colorT").parent().show();
|
||||
$("#colorT").attr("disabled", false)
|
||||
|
||||
form.on("select(kind_filter)", function (data) {
|
||||
let html = ` <option value="98*70">98*70cm</option>
|
||||
<option value="70*49">70*49cm</option>`;
|
||||
$(".fumo").show();
|
||||
$(".fumo").find(":input").attr("disabled", false);
|
||||
|
||||
if (data.value != '1') {
|
||||
html = ` <option value="72*50">72*50cm</option>`;
|
||||
$(".fumo").hide();
|
||||
$(".fumo").find(":input").attr("disabled", true);
|
||||
}
|
||||
$("select[name='size']").empty();
|
||||
$("select[name='size']").append(html);
|
||||
form.render();
|
||||
})
|
||||
|
||||
form.on('checkbox(ui_craft)', function (data) {
|
||||
let craft_list = [];
|
||||
$(data.elem).prop("checked", true);
|
||||
layer.msg("工艺不能取消", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
form.render();
|
||||
return false;
|
||||
craft_list.push($("select[name='craft'] option:selected").val());
|
||||
|
||||
$("input[name='craft']:checked").each(function () {
|
||||
if (!$(this).is(':disabled')) {
|
||||
craft_list.push($(this).val());
|
||||
}
|
||||
}
|
||||
);
|
||||
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;
|
||||
}
|
||||
if (craft_list.includes("双面胶")) {
|
||||
$(".shuang").show();
|
||||
} else {
|
||||
$(".shuang").hide();
|
||||
}
|
||||
if (craft_list.includes("丝带")) {
|
||||
$(".sidai").show();
|
||||
} else {
|
||||
$(".sidai").hide();
|
||||
}
|
||||
form.render();
|
||||
})
|
||||
|
||||
// 点击计算,计算价格
|
||||
@@ -229,54 +221,20 @@
|
||||
var count = $("#count").val();
|
||||
var kind = $("select[name='kind'] option:selected").text();
|
||||
var craft = [];
|
||||
if (size == "") {
|
||||
layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$("select[name='craft']").each(function (i) {
|
||||
// 没有被禁用的工艺加到arr中
|
||||
if (!$(this).is(':disabled')) {
|
||||
craft.push($(this).find("option:selected").val());
|
||||
|
||||
}
|
||||
});
|
||||
$("input:checkbox[name='craft']:checked").each(function (i) {
|
||||
// 没有被禁用的工艺加到arr中
|
||||
if (!$(this).is(':disabled')) {
|
||||
|
||||
craft.push($(this).val());
|
||||
if ($(this).val() == "双面胶") {
|
||||
craft.push($("input[name='maxian']").val() + "个" + $(this).val());
|
||||
} else if ($(this).val() == "丝带") {
|
||||
craft.push($("input[name='pcount']").val() + "个" + $(this).val());
|
||||
} else {
|
||||
craft.push($(this).val());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const carft1 = carft_list1.filter(item => craft.includes(item));
|
||||
if (carft1.length == 0) {
|
||||
layer.msg("请选择印面工艺", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (size == "23*23") {
|
||||
if (count < 3) {
|
||||
layer.msg("23*23尺寸3箱起做", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (size == "27*27") {
|
||||
if (count < 5) {
|
||||
layer.msg("23*23尺寸5箱起做", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
let colorType = $("input[name='shen_color']:checked").val();
|
||||
|
||||
if (colorType == "双色" && count < 5) {
|
||||
layer.msg("双色5箱起做", {offset: ['300px', '300px']}, function () {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "${path}/getThanSum",
|
||||
type: "GET",
|
||||
@@ -289,18 +247,18 @@
|
||||
}
|
||||
var data = result.data.proList;
|
||||
|
||||
var span_result = '方巾 - ' + kind + ' - ' + size + ' CM (同款内容)\n';
|
||||
var span_result = '包装纸 - ' + kind + ' - ' + 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'
|
||||
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'
|
||||
span_result += number + '款 ' + data[i].count + "张,共" + data[i].price + "元" + '\n'
|
||||
data[i].number = number;
|
||||
}
|
||||
}
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача