|
@@ -22,7 +22,7 @@
|
|
|
<li class="active"><a href="${ctx}/vip/cmCoupon/form?id=${cmVipCoupon.id}">${not empty cmVipCoupon.id?'编辑':'添加'}</a>
|
|
|
</li>
|
|
|
</ul><br>
|
|
|
-<form:form id="inputForm" modelAttribute="svipcouponForm" action="${ctx}/vip/cmCoupon/save?couponId1=${svipcouponForm.couponId1}" method="post" class="form-horizontal">
|
|
|
+<form:form id="inputForm" modelAttribute="svipcouponForm" action="${ctx}/vip/cmCoupon/save" method="post" class="form-horizontal">
|
|
|
<sys:message content="${message}"/>
|
|
|
<form:hidden path="id" value="${cmVipCoupon.id}"/>
|
|
|
<div class="control-group">
|
|
@@ -69,14 +69,14 @@
|
|
|
<div class="control-group coupon-line l3" ${svipcouponForm.couponType1 ne '1' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="categoryType1" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType1" value="1" label="产品"/>
|
|
|
<form:radiobutton path="categoryType1" value="2" label="仪器"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group coupon-line l4" ${svipcouponForm.couponType1 ne '0' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="productType1" value="1" label="全商城商品" onclick="productShow(value,1)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType1" value="1" label="全商城商品" onclick="productShow(value,1)"/>
|
|
|
<form:radiobutton path="productType1" value="2" label="指定商品" onclick="productShow(value,1)"/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -131,14 +131,14 @@
|
|
|
<div class="control-group coupon-line l3" ${svipcouponForm.couponType2 ne '1' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="categoryType2" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType2" value="1" label="产品"/>
|
|
|
<form:radiobutton path="categoryType2" value="2" label="仪器"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group coupon-line l4" ${svipcouponForm.couponType2 ne '0' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="productType2" value="1" label="全商城商品" onclick="productShow(value,2)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType2" value="1" label="全商城商品" onclick="productShow(value,2)"/>
|
|
|
<form:radiobutton path="productType2" value="2" label="指定商品" onclick="productShow(value,2)"/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -193,14 +193,14 @@
|
|
|
<div class="control-group coupon-line l3" ${svipcouponForm.couponType3 ne '1' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="categoryType3" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType3" value="1" label="产品"/>
|
|
|
<form:radiobutton path="categoryType3" value="2" label="仪器"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group coupon-line l4" ${svipcouponForm.couponType3 ne '0' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="productType3" value="1" label="全商城商品" onclick="productShow(value,3)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType3" value="1" label="全商城商品" onclick="productShow(value,3)"/>
|
|
|
<form:radiobutton path="productType3" value="2" label="指定商品" onclick="productShow(value,3)"/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -255,14 +255,14 @@
|
|
|
<div class="control-group coupon-line l3" ${svipcouponForm.couponType4 ne '1' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="categoryType4" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType4" value="1" label="产品"/>
|
|
|
<form:radiobutton path="categoryType4" value="2" label="仪器"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group coupon-line l4" ${svipcouponForm.couponType4 ne '0' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="productType4" value="1" label="全商城商品" onclick="productShow(value,4)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType4" value="1" label="全商城商品" onclick="productShow(value,4)"/>
|
|
|
<form:radiobutton path="productType4" value="2" label="指定商品" onclick="productShow(value,4)"/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -286,114 +286,142 @@
|
|
|
</form:form>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
- $(document).ready(function () {
|
|
|
- $("#inputForm").validate({
|
|
|
- submitHandler: function (form) {
|
|
|
- if (imageList1.length > 0) {
|
|
|
- var productInfo1 = JSON.stringify(imageList1);
|
|
|
- $('#productInfo1').val(productInfo1);
|
|
|
- }
|
|
|
- if (imageList2.length > 0) {
|
|
|
- var productInfo2 = JSON.stringify(imageList2);
|
|
|
- $('#productInfo2').val(productInfo2);
|
|
|
- }
|
|
|
- if (imageList3.length > 0) {
|
|
|
- var productInfo3 = JSON.stringify(imageList3);
|
|
|
- $('#productInfo3').val(productInfo3);
|
|
|
- }
|
|
|
- if (imageList4.length > 0) {
|
|
|
- var productInfo4 = JSON.stringify(imageList4);
|
|
|
- $('#productInfo4').val(productInfo4);
|
|
|
- }
|
|
|
- var couponType1 = $("#couponType1").val();
|
|
|
- var shopId1 = $("#shopId1").val();
|
|
|
- if (couponType1 == 3) {
|
|
|
- if (shopId1 == "" || shopId1 == null) {
|
|
|
- alert("店铺券供应商不能为空 !");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- var month = $("#month").val();
|
|
|
- // 判断月份 ...
|
|
|
- if (month == null || month == "") {
|
|
|
- alert("请选择生效时间! ");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount1 = $("#couponAmount1").val() * 1;
|
|
|
- var touchPrice1 = $("#touchPrice1").val() * 1;
|
|
|
- if (couponAmount1 == "") {
|
|
|
- alertx("【优惠券1】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice1 == "") {
|
|
|
- alertx("【优惠券1】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount1 >= touchPrice1) {
|
|
|
- alertx("【优惠券1】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount2 = $("#couponAmount2").val() * 1;
|
|
|
- var touchPrice2 = $("#touchPrice2").val() * 1;
|
|
|
- if (couponAmount2 == "") {
|
|
|
- alertx("【优惠券2】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice2 == "") {
|
|
|
- alertx("【优惠券2】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount2 >= touchPrice2) {
|
|
|
- alertx("【优惠券2】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount3 = $("#couponAmount3").val() * 1;
|
|
|
- var touchPrice3 = $("#touchPrice3").val() * 1;
|
|
|
- if (couponAmount3 == "") {
|
|
|
- alertx("【优惠券3】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice3 == "") {
|
|
|
- alertx("【优惠券3】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount3 >= touchPrice3) {
|
|
|
- alertx("【优惠券3】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount4 = $("#couponAmount4").val() * 1;
|
|
|
- var touchPrice4 = $("#touchPrice4").val() * 1;
|
|
|
- if (couponAmount4 == "") {
|
|
|
- alertx("【优惠券4】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice4 == "") {
|
|
|
- alertx("【优惠券4】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount4 >= touchPrice4) {
|
|
|
- alertx("【优惠券4】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- loading('正在提交,请稍等...');
|
|
|
- form.submit();
|
|
|
- },
|
|
|
- errorContainer: "#messageBox",
|
|
|
- errorPlacement: function (error, element) {
|
|
|
- $("#messageBox").text("输入有误,请先更正。");
|
|
|
- if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
|
|
|
- error.appendTo(element.parent().parent());
|
|
|
- } else {
|
|
|
- error.insertAfter(element);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
$(".contentTableShop thead").html('<tr><th>机构名称</th><th>机构简称</th><th>联系人</th><th>手机号</th><th>操作</th></tr>');
|
|
|
$(".contentTableProduct thead").html('<tr><th style="width:20px;"><input class="check-all" type="checkbox" onclick="clickAllSelect(this)"/>全选</th>' +
|
|
|
'<th>商品图片</th><th>商品名称</th><th>供应商</th><th>网站状态</th><th>小程序状态</th><th>排序</th><th>添加时间</th><th>操作</th></tr>');
|
|
|
|
|
|
+ var productIds1 = '';
|
|
|
+ var productIds2 = '';
|
|
|
+ var productIds3 = '';
|
|
|
+ var productIds4 = '';
|
|
|
+ var imageList1 = [];
|
|
|
+ var imageList2 = [];
|
|
|
+ var imageList3 = [];
|
|
|
+ var imageList4 = [];
|
|
|
+
|
|
|
+ //店铺券供应商回显
|
|
|
+ if (${not empty svipcouponForm.shop1}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop1.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop1.name}",
|
|
|
+ "sname": "${svipcouponForm.shop1.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop1.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop1.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 1);
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.shop2}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop2.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop2.name}",
|
|
|
+ "sname": "${svipcouponForm.shop2.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop2.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop2.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 2);
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.shop3}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop3.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop3.name}",
|
|
|
+ "sname": "${svipcouponForm.shop3.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop3.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop3.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 3);
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.shop4}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop4.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop4.name}",
|
|
|
+ "sname": "${svipcouponForm.shop4.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop4.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop4.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 4);
|
|
|
+ }
|
|
|
+ //产品回显
|
|
|
+ if (${not empty svipcouponForm.associateList1}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList1}" var="associate" varStatus="index">
|
|
|
+ imageList1.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList1.length > 0) {
|
|
|
+ $('#couponWrap1').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(1);
|
|
|
+ productShow(2,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.associateList2}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList2}" var="associate" varStatus="index">
|
|
|
+ imageList2.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList2.length > 0) {
|
|
|
+ $('#couponWrap2').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(2);
|
|
|
+ productShow(2,2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.associateList3}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList3}" var="associate" varStatus="index">
|
|
|
+ imageList3.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList3.length > 0) {
|
|
|
+ $('#couponWrap3').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(3);
|
|
|
+ productShow(2,3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.associateList4}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList4}" var="associate" varStatus="index">
|
|
|
+ imageList4.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList4.length > 0) {
|
|
|
+ $('#couponWrap4').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(4);
|
|
|
+ productShow(2,4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$("body").on("change", ".couponType", function () {
|
|
|
var value = $(this).parent().find('input.couponType:checked').val() * 1;
|
|
|
$(this).parents(".coupon-wrap").find(".coupon-line").hide();
|
|
@@ -442,131 +470,6 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- $(function () {
|
|
|
- //店铺券供应商回显
|
|
|
- if (${not empty svipcouponForm.shop1}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop1.shopID}",
|
|
|
- "name": "${svipcouponForm.shop1.name}",
|
|
|
- "sname": "${svipcouponForm.shop1.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop1.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop1.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 1);
|
|
|
- }
|
|
|
- if (${not empty svipcouponForm.shop2}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop2.shopID}",
|
|
|
- "name": "${svipcouponForm.shop2.name}",
|
|
|
- "sname": "${svipcouponForm.shop2.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop2.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop2.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 2);
|
|
|
- }
|
|
|
- if (${not empty svipcouponForm.shop3}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop3.shopID}",
|
|
|
- "name": "${svipcouponForm.shop3.name}",
|
|
|
- "sname": "${svipcouponForm.shop3.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop3.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop3.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 3);
|
|
|
- }
|
|
|
- if (${not empty svipcouponForm.shop4}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop4.shopID}",
|
|
|
- "name": "${svipcouponForm.shop4.name}",
|
|
|
- "sname": "${svipcouponForm.shop4.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop4.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop4.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 4);
|
|
|
- }
|
|
|
- //产品回显
|
|
|
- if (${not empty svipcouponForm.associateList1}) {
|
|
|
- <c:forEach items="${svipcouponForm.associateList1}" var="associate" varStatus="index">
|
|
|
- imageList1.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
- if (imageList1.length > 0) {
|
|
|
- $('#couponWrap1').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(1);
|
|
|
- showSelectProduct(1);
|
|
|
- }
|
|
|
- }
|
|
|
- if (${not empty svipcouponForm.associateList2}) {
|
|
|
- <c:forEach items="${svipcouponForm.associateList2}" var="associate" varStatus="index">
|
|
|
- imageList2.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
- if (imageList2.length > 0) {
|
|
|
- $('#couponWrap2').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(2);
|
|
|
- showSelectProduct(2);
|
|
|
- }
|
|
|
- }
|
|
|
- if (${not empty svipcouponForm.associateList3}) {
|
|
|
- <c:forEach items="${svipcouponForm.associateList3}" var="associate" varStatus="index">
|
|
|
- imageList3.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
- if (imageList3.length > 0) {
|
|
|
- $('#couponWrap3').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(3);
|
|
|
- showSelectProduct(3);
|
|
|
- }
|
|
|
- }
|
|
|
- if (${not empty svipcouponForm.associateList4}) {
|
|
|
- <c:forEach items="${svipcouponForm.associateList4}" var="associate" varStatus="index">
|
|
|
- imageList4.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
- if (imageList4.length > 0) {
|
|
|
- $('#couponWrap4').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(4);
|
|
|
- showSelectProduct(4);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
function productShow(value, id) {
|
|
|
if (value == 2) {
|
|
|
$(".productData" + id).show();
|
|
@@ -575,15 +478,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var productIds1 = '';
|
|
|
- var productIds2 = '';
|
|
|
- var productIds3 = '';
|
|
|
- var productIds4 = '';
|
|
|
- var imageList1 = [];
|
|
|
- var imageList2 = [];
|
|
|
- var imageList3 = [];
|
|
|
- var imageList4 = [];
|
|
|
-
|
|
|
//点击添加
|
|
|
function showSelectProduct(id) {
|
|
|
var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=";
|
|
@@ -972,10 +866,94 @@
|
|
|
}
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
- //$("#name").focus();
|
|
|
$("#inputForm").validate({
|
|
|
submitHandler: function (form) {
|
|
|
-
|
|
|
+ if (imageList1.length > 0) {
|
|
|
+ var productInfo1 = JSON.stringify(imageList1);
|
|
|
+ $('#productInfo1').val(productInfo1);
|
|
|
+ }
|
|
|
+ if (imageList2.length > 0) {
|
|
|
+ var productInfo2 = JSON.stringify(imageList2);
|
|
|
+ $('#productInfo2').val(productInfo2);
|
|
|
+ }
|
|
|
+ if (imageList3.length > 0) {
|
|
|
+ var productInfo3 = JSON.stringify(imageList3);
|
|
|
+ $('#productInfo3').val(productInfo3);
|
|
|
+ }
|
|
|
+ if (imageList4.length > 0) {
|
|
|
+ var productInfo4 = JSON.stringify(imageList4);
|
|
|
+ $('#productInfo4').val(productInfo4);
|
|
|
+ }
|
|
|
+ var couponType1 = $("#couponType1").val();
|
|
|
+ var shopId1 = $("#shopId1").val();
|
|
|
+ if (couponType1 == 3) {
|
|
|
+ if (shopId1 == "" || shopId1 == null) {
|
|
|
+ alert("店铺券供应商不能为空 !");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var month = $("#month").val();
|
|
|
+ // 判断月份 ...
|
|
|
+ if (month == null || month == "") {
|
|
|
+ alert("请选择生效时间! ");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount1 = $("#couponAmount1").val() * 1;
|
|
|
+ var touchPrice1 = $("#touchPrice1").val() * 1;
|
|
|
+ if (couponAmount1 == "") {
|
|
|
+ alertx("【优惠券1】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice1 == "") {
|
|
|
+ alertx("【优惠券1】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount1 >= touchPrice1) {
|
|
|
+ alertx("【优惠券1】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount2 = $("#couponAmount2").val() * 1;
|
|
|
+ var touchPrice2 = $("#touchPrice2").val() * 1;
|
|
|
+ if (couponAmount2 == "") {
|
|
|
+ alertx("【优惠券2】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice2 == "") {
|
|
|
+ alertx("【优惠券2】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount2 >= touchPrice2) {
|
|
|
+ alertx("【优惠券2】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount3 = $("#couponAmount3").val() * 1;
|
|
|
+ var touchPrice3 = $("#touchPrice3").val() * 1;
|
|
|
+ if (couponAmount3 == "") {
|
|
|
+ alertx("【优惠券3】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice3 == "") {
|
|
|
+ alertx("【优惠券3】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount3 >= touchPrice3) {
|
|
|
+ alertx("【优惠券3】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount4 = $("#couponAmount4").val() * 1;
|
|
|
+ var touchPrice4 = $("#touchPrice4").val() * 1;
|
|
|
+ if (couponAmount4 == "") {
|
|
|
+ alertx("【优惠券4】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice4 == "") {
|
|
|
+ alertx("【优惠券4】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount4 >= touchPrice4) {
|
|
|
+ alertx("【优惠券4】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
loading('正在提交,请稍等...');
|
|
|
form.submit();
|
|
|
},
|
|
@@ -990,8 +968,6 @@
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|