Bladeren bron

价值优惠券

zhijiezhao 3 jaren geleden
bovenliggende
commit
4e026a8bcc

+ 18 - 0
src/main/java/com/caimei/modules/coupon/entity/CmCoupon.java

@@ -48,6 +48,8 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     private String couponDesc;        //描述
     private String redemptionCode;      //兑换码
     private CmCouponClub couponClub;
+    private Integer moneyCouponFlag; //是否是价值优惠券,1是,2不是
+    private Double moneyCouponPrice; //价值优惠券购买金额
     private NewCmShop shop;
     private List<Integer> productIdList;
 
@@ -62,6 +64,22 @@ public class CmCoupon extends DataEntity<CmCoupon> {
         super(id);
     }
 
+    public Integer getMoneyCouponFlag() {
+        return moneyCouponFlag;
+    }
+
+    public void setMoneyCouponFlag(Integer moneyCouponFlag) {
+        this.moneyCouponFlag = moneyCouponFlag;
+    }
+
+    public Double getMoneyCouponPrice() {
+        return moneyCouponPrice;
+    }
+
+    public void setMoneyCouponPrice(Double moneyCouponPrice) {
+        this.moneyCouponPrice = moneyCouponPrice;
+    }
+
     @Length(min = 0, max = 50, message = "活动主题长度必须介于 0 和 50 之间")
     public String getName() {
         return name;

+ 7 - 0
src/main/java/com/caimei/modules/coupon/service/CmCouponService.java

@@ -420,4 +420,11 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
             });
         }
     }
+
+    @Transactional(readOnly = false)
+    public void moneyCouponSave(CmCoupon cmCoupon) {
+        cmCoupon.setCouponsMode("0");
+        cmCoupon.setMoneyCouponFlag(1);
+        save(cmCoupon);
+    }
 }

+ 42 - 1
src/main/java/com/caimei/modules/coupon/web/CmCouponController.java

@@ -81,10 +81,14 @@ public class CmCouponController extends BaseController {
         } else if (3 == cmCoupon.getCouponType()) {
             //店铺券
             return "modules/coupon/couponShopList";
-        } else {
+        } else if(4 == cmCoupon.getCouponType()){
             //新用户券
             return "modules/coupon/couponNewUserList";
+        }else if (1 == cmCoupon.getMoneyCouponFlag()){
+            //价值优惠券
+            return "modules/coupon/cmMoneyCouponList";
         }
+        return null;
     }
 
     @RequiresPermissions("coupon:cmCoupon:view")
@@ -230,6 +234,30 @@ public class CmCouponController extends BaseController {
         return "/modules/coupon/redemptionCodeCouponForm";
     }
 
+    //价值优惠券
+    @RequestMapping("moneyCouponForm")
+    public String moneyCouponForm(CmCoupon cmCoupon, Model model) {
+        model.addAttribute("cmCoupon", cmCoupon);
+        if (cmCoupon != null && cmCoupon.getCouponType() != null) {
+            if (0 == cmCoupon.getCouponType()) {
+                List<CmCouponAssociate> associateList = new ArrayList<>();
+                if (StringUtils.isNotBlank(cmCoupon.getId()) && "2".equals(cmCoupon.getProductType())) {
+                    associateList = cmCouponService.findByProductType(cmCoupon);
+                }
+                model.addAttribute("associateList", associateList);
+            } else if (2 == cmCoupon.getCouponType()) {
+                CmUser cmUser = null;
+                if (cmCoupon.getUserId() != null) {
+                    cmUser = cmUserDao.get(cmCoupon.getUserId().toString());
+                    NewCmClub club = newCmClubDao.getclubByUserId(cmCoupon.getUserId());
+                    cmUser.setShortName(club.getSname());
+                }
+                model.addAttribute("cmUser", cmUser);
+            }
+        }
+        return "/modules/coupon/MoneyCouponForm";
+    }
+
     /**
      * 兑换码优惠券-保存
      */
@@ -240,6 +268,19 @@ public class CmCouponController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/codeCouponList";
     }
 
+    /**
+     * 价值优惠券保存
+     * @param cmCoupon
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("moneyCouponSave")
+    public String moneyCouponSave(CmCoupon cmCoupon, RedirectAttributes redirectAttributes) {
+        cmCouponService.moneyCouponSave(cmCoupon);
+        addMessage(redirectAttributes, "保存价值优惠券成功");
+        return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5";
+    }
+
     /**
      * 查看兑换码页面
      */

+ 12 - 2
src/main/resources/mappings/modules/coupon/CmCouponMapper.xml

@@ -22,6 +22,8 @@
 		a.appletsBanner AS "appletsBanner",
 		a.categoryType AS "categoryType",
 		a.couponsMode AS "couponsMode",
+		a.moneyCouponPrice AS "moneyCouponPrice",
+		a.moneyCouponFlag AS "moneyCouponFlag",
 		a.createDate AS "createDate",
 		a.delFlag AS "delFlag"
 	</sql>
@@ -49,9 +51,12 @@
 		<include refid="cmCouponJoins"/>
 		<where>
 			AND a.delFlag = 0 AND a.vipFlag != '1'
-			<if test="couponType != null">
+			<if test="couponType != null and couponType != 5">
 				AND a.couponType = #{couponType}
 			</if>
+		    <if test="moneyCouponFlag != null and moneyCouponFlag > 0">
+				AND a.moneyCouponFlag = #{moneyCouponFlag}
+			</if>
 			<if test="name != null and name != ''">
 				AND a.name LIKE 
 					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
@@ -152,6 +157,8 @@
 			categoryType,
 			couponsMode,
 			createDate,
+			moneyCouponPrice,
+			moneyCouponFlag,
 			delFlag
 		) VALUES (
 			#{name},
@@ -173,6 +180,8 @@
 			#{categoryType},
 			#{couponsMode},
 			#{createDate},
+		    #{moneyCouponPrice},
+		    #{moneyCouponFlag},
 			#{delFlag}
 		)
 	</insert>
@@ -196,7 +205,8 @@
 			pcBanner = #{pcBanner},
 			appletsBanner = #{appletsBanner},
 			categoryType = #{categoryType},
-			couponsMode = #{couponsMode}
+			couponsMode = #{couponsMode},
+			moneyCouponPrice = #{moneyCouponPrice}
 		WHERE id = #{id}
 	</update>
 	

+ 912 - 0
src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp

@@ -0,0 +1,912 @@
+<%@ page import="java.util.Date" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+    <title>优惠券管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#inputForm").validate({
+                submitHandler: function(form){
+                    if (imageList.length > 0) {
+                        var productInfo = JSON.stringify(imageList);
+                        $('#productInfo').val(productInfo);
+                    }
+                    var couponType = $("input[name='couponType']:checked").val();
+                    var productType = $("input[name='productType']:checked").val();
+                    if (couponType == 0 && productType == 2) {
+                        var pcBanner = $('#pcBanner').val();
+                        var appletsBanner = $('#appletsBanner').val();
+                        if (pcBanner == '' || appletsBanner == '') {
+                            alertx("请上传Banner图");
+                            return false;
+                        }
+                    }
+                    var couponAmount = $("#couponAmount").val()*1;
+                    var touchPrice = $("#touchPrice").val()*1;
+                    if (couponAmount >= touchPrice) {
+                        alertx("优惠券金额必须小于优惠条件金额");
+                        return false;
+                    }
+                    var startDate = $("#startDate").val();
+                    var endDate = $("#endDate").val();
+                    if (startDate >= endDate) {
+                        alertx("结束时间不能早于开始时间");
+                        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);
+                    }
+                }
+            });
+        });
+    </script>
+    <style>
+        .iconBox {
+            font-size: 0;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content-image {
+            margin-top: -70px;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) > div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+        .upload-content-image .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+        .cancel-upload-image {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+        .hide-pic-image {
+            display: none !important;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5">价值优惠券列表</a></li>
+    <li class="active"><a href="${ctx}/coupon/cmCoupon/moneyCouponForm?id=${cmCoupon.id}">${not empty cmCoupon.id?'编辑':'添加'}</a></li>
+</ul><br/>
+<form:form id="inputForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/moneyCouponSave" method="post" class="form-horizontal">
+    <form:hidden path="id"/>
+    <form:hidden path="productInfo" id="productInfo"/>
+    <sys:message content="${message}"/>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠券名称:</label>
+        <div class="controls">
+            <form:input path="name" htmlEscape="false" maxlength="30" placeholder="30个汉字以内" class="input-xlarge required"/>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠券金额:</label>
+        <div class="controls">
+            <input type="number" id="couponAmount" name="couponAmount" value="${cmCoupon.couponAmount}" min="0" required>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠条件:</label>
+        <div class="controls">
+            订单商品总额满&nbsp;&nbsp;&nbsp;&nbsp;<input type="number" name="touchPrice" id="touchPrice" value="${cmCoupon.touchPrice}" min="0" required>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>购买价格:</label>
+        <div class="controls">
+            <input type="number" id="moneyCouponPrice" name="moneyCouponPrice" value="${cmCoupon.moneyCouponPrice}" min="0" required>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
+        <div class="controls">
+            <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
+                   value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00',isShowClear:false});" onblur="dateShow()"/>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
+        <div class="controls">
+            <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
+                   value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59',isShowClear:false});" onblur="dateShow()"/>
+        </div>
+    </div>
+    <div class="control-group" style="display:none;">
+        <label class="control-label"><font color="red">*</font>状态:</label>
+        <div class="controls">
+            <label id="initializeShow">
+                <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">
+                    <font color="#800080">未生效</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 1}">
+                    <font color="#00CC66">已生效</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 2}">
+                    <font color="red">已关闭</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 3}">
+                    <font color="#FF6600">已失效</font>
+                </c:if>
+            </label>
+            <label id="closeShow" style="display: none">
+                <font color="red">已关闭</font>
+            </label>
+            <input type="hidden" id="hiddenStatus" name="status" value="">
+            <input type="checkbox" id="status" name="status" value="2" ${cmCoupon.status eq "2" ? "checked" : ""}
+                   onclick="statusShow()"/>关闭
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>购买期限:</label>
+        <div class="controls">
+            <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
+            <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
+            <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>使用期限:</label>
+        <div class="controls">
+            <input type="number" id="usePeriod" name="usePeriod" value="${cmCoupon.usePeriod}" min="1" required> 天
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠券类型:</label>
+        <div class="controls">
+            <form:radiobutton path="couponType" value="0" label="活动券" class="required" onclick="couponShow()"/>
+            <form:radiobutton path="couponType" value="1" label="品类券" class="required" onclick="couponShow()"/>
+            <form:radiobutton path="couponType" value="2" label="用户专享券" class="required" onclick="couponShow()"/>
+            <form:radiobutton path="couponType" value="3" label="店铺券" class="required" onclick="couponShow()"/>
+        </div>
+    </div>
+    <div id="eventVoucher" hidden="hidden">
+        <div class="control-group">
+            <label class="control-label"><font color="red">*</font>优惠商品:</label>
+            <div class="controls">
+                <form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}"/>
+                <form:radiobutton path="productType" value="2" label="指定商品" onclick="productShow()"/>
+            </div>
+        </div>
+        <div class="productData" hidden="hidden">
+            <div class="control-group">
+                <label class="control-label"><font color="red">*</font>网站活动页banner:</label>
+                <div class="controls upload-content-image iconBox">
+                    <div class="conList">
+                        <form:hidden id="pcBanner" path="pcBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                        <sys:ckfinder input="pcBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                        <br>
+                    </div>
+                </div>
+            </div>
+            <div class="control-group">
+                <label class="control-label"><font color="red">*</font>小程序活动页banner:</label>
+                <div class="controls upload-content-image iconBox">
+                    <div class="conList">
+                        <form:hidden id="appletsBanner" path="appletsBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                        <sys:ckfinder input="appletsBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                        <br>
+                    </div>
+                </div>
+            </div>
+            <div class="control-group">
+                <input class="btn" id="del" style="width: 50px" onclick="batchDeletion()" value="删除"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
+                <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct()" value="添加"/>
+                <br><br>
+                <table id="contentTableProduct" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                    <thead>
+                    <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>
+                    </thead>
+                    <tbody id="hotSearchProduct"></tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+    <div class="control-group" id="couponCategory" hidden="hidden">
+        <label class="control-label"><font color="red">*</font>优惠品类:</label>
+        <div class="controls">
+            <form:radiobutton path="categoryType" value="1" label="产品" checked ="${empty cmCoupon.categoryType ? true:false}"/>
+            <form:radiobutton path="categoryType" value="2" label="仪器"/>
+        </div>
+    </div>
+    <div class="control-group" id="couponClub" hidden="hidden">
+        <label class="control-label"><font color="red">*</font>机构:</label>
+        <div class="controls">
+            <a href="javascript:void(0);" onclick="showSelectClub()" id="chooseClub">请选择机构</a>
+            <input type="hidden" name="userId" id="userId" value="${cmCoupon.userId}">
+            <table id="contentTableClub" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th>机构名称</th>
+                    <th>机构简称</th>
+                    <th>联系人</th>
+                    <th>手机号</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearchClub"></tbody>
+            </table>
+        </div>
+    </div>
+    <div class="control-group" id="couponShop" hidden="hidden">
+        <label class="control-label"><font color="red">*</font>供应商:</label>
+        <div class="controls">
+            <a href="javascript:void(0);" onclick="showSelectShop()" id="chooseShop">请选择供应商</a>
+            <form:hidden path="shopId" id="shopId"/>
+            <table id="contentTableShop" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th>机构名称</th>
+                    <th>机构简称</th>
+                    <th>联系人</th>
+                    <th>手机号</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearchShop"></tbody>
+            </table>
+        </div>
+    </div>
+    <div class="form-actions">
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+    </div>
+</form:form>
+<script>
+    //图片初始化
+    $(function () {
+        $('.upload-content-image .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content-image .conList .btn:nth-of-type(2)').after('<img class="cancel-upload-image" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content-image .conList').find('.cancel-upload-image').hide();
+        var observeEleImage = document.getElementsByClassName('upload-content-image')[0];
+        var observeEleImage1 = document.getElementsByClassName('upload-content-image')[1];
+        var MutationObserverImage = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfigImage = {
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observerImage = new MutationObserverImage(function (mutations) {
+            $.each(mutations, function (index, item) {
+                if (item.type === 'childList') {
+                    // 在创建新的 element 时调用
+                    var target = $(item.target),
+                        thisWrapper = target.closest('.conList'),
+                        nextEle = thisWrapper.next();
+                    thisWrapper.find('li').css('z-index', 99);
+                    thisWrapper.find('.cancel-upload-image').show();
+                    if (nextEle.hasClass('hide-pic-image')) {
+                        nextEle.removeClass('hide-pic-image');
+                    }
+                }
+            })
+        });
+        observerImage.observe(observeEleImage, MutationObserverConfigImage);
+        observerImage.observe(observeEleImage1, MutationObserverConfigImage);
+
+        $('body').on('click', '.upload-content-image li', function () {
+            var index = $(this).closest('.conList').index() + 1,
+                str = 'remarkImage' + index + 'FinderOpen';
+            eval(str + '()');
+        });
+        $('body').on('click', '.cancel-upload-image', function () {
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index', '-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            wrapper.removeClass("hide-pic-image");
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function (i, ele) {
+                if ($(ele).find("input.input-xlarge").val()) {
+                    $(ele).next().removeClass("hide-pic-image")
+                }
+            })
+        });
+        $(window).on("load", function () {
+            setTimeout(function () {
+                var input = $("#pcBanner");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+                input = $("#appletsBanner");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+            }, 500);
+        });
+        productShow()
+    });
+
+    var productIds = '';
+    var imageList = [];
+
+    $(function () {
+        //活动券商品回显
+        <c:forEach items="${associateList}" var="associate" varStatus="index">
+        imageList.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 (imageList.length > 0) {
+            $('#contentTableProduct').show();
+            batchSaveSort();
+        }
+
+        //用户专享券机构回显
+        if (${not empty cmUser}){
+            var items = {
+                "userID": "${cmUser.userID}",
+                "name": "${cmUser.name}",
+                "shortName": "${cmUser.shortName}",
+                "linkMan": "${empty cmUser.userName ? '':cmUser.userName}",
+                "contractMobile": "${empty cmUser.bindMobile ? '':cmUser.bindMobile}"
+            };
+            insertHtmlClub(items);
+        }
+
+        //店铺券供应商回显
+        if (${not empty cmCoupon.shop}) {
+            var shop = {
+                "shopId": "${cmCoupon.shop.shopID}",
+                "name": "${cmCoupon.shop.name}",
+                "sname": "${cmCoupon.shop.sname}",
+                "linkMan": "${cmCoupon.shop.linkMan}",
+                "contractMobile": "${cmCoupon.shop.contractMobile}"
+            }
+            appendShopOrderHead(shop);
+        }
+
+        couponShow();
+    });
+
+    //点击添加商品
+    function showSelectProduct() {
+        var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=" + productIds;
+        var title = '';
+        title = "选择商品";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    console.log(items[0]);
+                    for (var i = 0; i < items.length; i++) {
+                        console.log(items[i]);
+                        imageList.push(items[i]);
+                        $('#contentTableProduct').show();
+                        $("#del").removeAttr("disabled");
+                        batchSaveSort();
+                    };
+                }
+                return true;
+            }
+        });
+    }
+
+    /**
+     * 一键排序
+     */
+    function batchSaveSort() {
+        imageList.sort(sort);
+        insertHtmlProduct(imageList);
+    }
+
+    //根据sort值 从小到大排序
+    function sort(a, b) {
+        return a.sort - b.sort;
+    }
+
+    //相关图片列表数据
+    function appendProductOrderHead(data, index) {
+        var html = '<tr id ="ai' + index + '">' +
+            '<td>' +
+            '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
+            '</td>' +
+            '<td>' +
+            '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
+            '</td>' +
+            '<td>' +
+            data.productName +
+            '</td>' +
+            '<td>' +
+            data.shopName +
+            '</td>' +
+            '<td>' +
+            (data.pcStatus == 1 ? (
+                '<font color="green">已启用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ');" >' +
+                '停用</a>'
+            ) : (
+                '<font color="red">已停用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ');">' +
+                '启用</a>'
+            )) +
+            '</td>' +
+            '<td>' +
+            (data.appletsStatus == 1 ? (
+                '<font color="green">已启用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ');" >' +
+                '停用</a>'
+            ) : (
+                '<font color="red">已停用</font>&nbsp;&nbsp;&nbsp;' +
+                '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ');">' +
+                '启用</a>'
+            )) +
+            '</td>' +
+            '<td>' +
+            '<input name="sort" style="width:50px;" value="' + data.sort + '"  onkeyup="onlynum(this)"  onchange="changeSort(' + index + ',this)"></td>' +
+            '</td>' +
+            '<td>' +
+            (data.addTime == '' ? (
+                '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
+            ) : (
+                data.addTime
+            )) +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="delect(' + index + ')">删除</a>' +
+            '</td>' +
+            '</tr>';
+        return html;
+    }
+
+    function insertHtmlProduct(list) {
+        var html = '';
+        productIds = '';
+        list.forEach(function (item, index) {
+            html += appendProductOrderHead(item, index);
+            productIds += "," + item.productId;
+        });
+        $("#hotSearchProduct").html(html);
+    }
+
+    function changeSort(index, sortThis) {
+        var sort = sortThis.value;
+        if (sort <= 0) {
+
+        }
+        var image = imageList[index];
+        image.sort = sort;
+    }
+
+    function updatePcStatus(status, index) {
+        var image = imageList[index];
+        confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
+            image.pcStatus = status;
+            batchSaveSort();
+        })
+    }
+
+    function updateAppletsStatus(status, index) {
+        var image = imageList[index];
+        confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
+            image.appletsStatus = status;
+            batchSaveSort();
+        })
+    }
+
+    function clickAllSelect(ckb) {
+        var isChecked = ckb.checked;
+        $(".check-item").attr('checked', isChecked);
+    }
+
+    /**
+     * 删除操作
+     */
+    function delect(index) {
+        return confirmx("确定删除吗?", function () {
+            var image = imageList[index];
+            if (image.productId != '') {
+                productIds = productIds.replace(image.productId,"");
+            }
+            imageList.splice(index, 1);
+            insertHtmlProduct(imageList);
+            if (imageList.length == 0) {
+                $('#contentTableProduct').hide();
+                $("#del").attr("disabled", "disabled");
+            }
+        });
+    }
+
+
+    /**
+     * 批量删除
+     */
+    function batchDeletion() {
+        var index = -1;
+        var i = 1;
+        return confirmx("确定删除吗?", function () {
+            $('input[name="info"]:checked').each(function () {
+                var thisIndex = $(this).val();
+                if (index >= 0 && index < thisIndex) {
+                    thisIndex = thisIndex - i;
+                    i++;
+                } else {
+                    index = thisIndex;
+                }
+                var image = imageList[thisIndex];
+                if (image.productId != '') {
+                    productIds = productIds.replace(image.productId, "");
+                }
+                imageList.splice(thisIndex, 1);
+                insertHtmlProduct(imageList);
+                if (imageList.length == 0) {
+                    $('#contentTableProduct').hide();
+                    $("#del").attr("disabled", "disabled");
+                }
+            });
+        });
+    }
+
+    function productShow() {
+        var  productType = $("input[name='productType']:checked").val();
+        if (productType == 2){
+            $(".productData").show();
+        }else {
+            $(".productData").hide();
+        }
+    }
+
+    function insertHtmlClub(data) {
+        var html = '<tr>' +
+            '<td>' +
+            data.name +
+            '</td>' +
+            '<td>' +
+            data.shortName +
+            '</td>' +
+            '<td>' +
+            data.linkMan +
+            '</td>' +
+            '<td>' +
+            data.contractMobile +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="deleteClub()">删除</a>' +
+            '</td>' +
+            '</tr>';
+        $("#contentTableClub").show();
+        $("#chooseClub").hide();
+        $("#hotSearchClub").html(html);
+        $("#userId").val(data.userID);
+    }
+
+    function deleteClub() {
+        $("#hotSearchClub").html("");
+        $("#contentTableClub").hide();
+        $("#chooseClub").show();
+        $("#userId").val("");
+    }
+
+    function statusShow() {
+        var status = $("input[name='status']:checked").val();
+        if (status == 2) {
+            $("#initializeShow").hide();
+            $("#closeShow").show();
+        } else {
+            $("#initializeShow").show();
+            $("#closeShow").hide();
+            $("#hiddenStatus").val(0);
+        }
+    }
+
+    function dateShow() {
+        var startDate = $("#startDate").val();
+        var startMs = new Date(startDate).getTime();
+        var endDate = $("#endDate").val();
+        var endMs = new Date(endDate).getTime();
+        var nowMs = new Date().getTime();
+        if (nowMs < startMs) {
+            $("#initializeShow").html("<font color=\"#800080\">未生效</font>");
+        } else if (nowMs > endMs) {
+            $("#initializeShow").html("<font color=\"#FF6600\">已失效</font>");
+        } else {
+            $("#initializeShow").html("<font color=\"#00CC66\">已生效</font>");
+        }
+    }
+
+    function showSelect(couponId) {
+        if (couponId == null){
+            alertx("暂未生成兑换码");
+            return false;
+        }
+        var url = "${ctx}/coupon/cmCoupon/redemptionCode?couponId=" + couponId;
+        var title = '';
+        title = "查看兑换码";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 750,
+            height: $(top.document).height() - 300,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1'}
+        });
+    }
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    //点击添加机构
+    function showSelectClub() {
+        var url = "${ctx}/coupon/cmCoupon/toAddClub";
+        var title = '';
+        title = "选择机构";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    insertHtmlClub(items);
+                }
+                return true;
+            }
+        });
+    }
+
+    function appendShopOrderHead(data) {
+        var html = '<tr>' +
+            '<td>' +
+            data.name +
+            '</td>' +
+            '<td>' +
+            data.sname +
+            '</td>' +
+            '<td>' +
+            data.linkMan +
+            '</td>' +
+            '<td>' +
+            data.contractMobile +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="delectShop()">删除</a>' +
+            '</td>' +
+            '</tr>';
+        $("#hotSearchShop").html(html);
+        $("#chooseShop").hide();
+        $('#contentTableShop').show();
+        $("#shopId").val(data.shopId);
+    }
+    function changeCondition(flag, name) {
+        var obj = $("#" + flag);
+        var val = obj.val();
+        if (val === '1') {
+            obj.val(0);
+            val = '0';
+        } else {
+            obj.val(1);
+            val = '1';
+        }
+        var inputObj = $("#" + name);
+        // 临时数据
+        var tempObj = $("#" + name + "Temp");
+        if (name.indexOf("Time") !== -1) {
+            //修改时间
+            if (val === '1') {
+                inputObj.attr('onclick', '');
+                inputObj.removeClass('required');
+            } else {
+                inputObj.attr('onclick', "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false})");
+                inputObj.addClass('required');
+            }
+        }else {
+            if (val === '1') {
+                inputObj.attr('readonly', true);
+                inputObj.attr('required', false);
+            } else {
+                inputObj.attr('readonly', false);
+                inputObj.attr('required', true);
+            }
+        }
+        if (val === '1') {
+            tempObj.val(inputObj.val());
+            inputObj.val('');
+        } else {
+            inputObj.val(tempObj.val());
+            tempObj.val('');
+        }
+    }
+
+    function changeCondition(flag, name) {
+        var obj = $("#" + flag);
+        var val = obj.val();
+        if (val === '1') {
+            obj.val(0);
+            val = '0';
+        } else {
+            obj.val(1);
+            val = '1';
+        }
+        var inputObj = $("#" + name);
+        // 临时数据
+        var tempObj = $("#" + name + "Temp");
+        if (name.indexOf("Time") !== -1) {
+            //修改时间
+            if (val === '1') {
+                inputObj.attr('onclick', '');
+                inputObj.removeClass('required');
+            } else {
+                inputObj.attr('onclick', "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false})");
+                inputObj.addClass('required');
+            }
+        }else {
+            if (val === '1') {
+                inputObj.attr('readonly', true);
+                inputObj.attr('required', false);
+            } else {
+                inputObj.attr('readonly', false);
+                inputObj.attr('required', true);
+            }
+        }
+        if (val === '1') {
+            tempObj.val(inputObj.val());
+            inputObj.val('');
+        } else {
+            inputObj.val(tempObj.val());
+            tempObj.val('');
+        }
+    }
+
+    //点击添加
+    function showSelectShop() {
+        var url = "${ctx}/coupon/cmCoupon/toAddShop";
+        var title = '';
+        title = "选择供应商";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    appendShopOrderHead(items);
+                }
+                return true;
+            }
+        });
+    }
+
+    /**
+     * 删除操作
+     */
+    function delectShop() {
+        return confirmx("确定删除吗?", function () {
+            $("#chooseShop").show();
+            $('#contentTableShop').hide();
+            $("#shopId").val("");
+        });
+    }
+
+    function couponShow() {
+        var couponType = $("input[name='couponType']:checked").val();
+        if (couponType == 0) {
+            $("#eventVoucher").show();
+            $("#couponCategory").hide();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+        } else if (couponType == 1) {
+            $("#eventVoucher").hide();
+            $("#couponCategory").show();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+        } else if (couponType == 2) {
+            $("#eventVoucher").hide();
+            $("#couponCategory").hide();
+            $("#couponClub").show();
+            $("#couponShop").hide();
+        } else if (couponType == 3) {
+            $("#eventVoucher").hide();
+            $("#couponCategory").hide();
+            $("#couponClub").hide();
+            $("#couponShop").show();
+        } else {
+            $("#eventVoucher").hide();
+            $("#couponCategory").hide();
+            $("#couponClub").hide();
+            $("#couponShop").hide();
+        }
+    }
+</script>
+</body>
+</html>

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/coupon/cmCouponForm.jsp

@@ -140,7 +140,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>开始时间:</label>
+			<label class="control-label"><font color="red">*</font>上架时间:</label>
 			<div class="controls">
 				<input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
 					value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -148,7 +148,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>结束时间:</label>
+			<label class="control-label"><font color="red">*</font>下架时间:</label>
 			<div class="controls">
 				<input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
 					value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -160,7 +160,7 @@
 			<div class="controls">
 				<input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
 				<input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-					${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+					${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
 				<input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
 			</div>
 		</div>
@@ -171,7 +171,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label"><font color="red">*</font>优惠状态:</label>
+			<label class="control-label"><font color="red">*</font>状态:</label>
 			<div class="controls">
 				<label id="initializeShow">
 					<c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 20 - 10
src/main/webapp/WEB-INF/views/modules/coupon/cmCouponList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -63,9 +63,11 @@
 				<th>活动主题</th>
 				<th>优惠券金额</th>
 				<th>优惠条件</th>
-				<th>优惠状态</th>
-				<th>开始时间</th>
-				<th>结束时间</th>
+				<th>上架时间</th>
+				<th>下架时间</th>
+				<th>领取期限</th>
+				<th>使用期限</th>
+				<th>状态</th>
 				<th>添加时间</th>
 				<th>操作</th>
 			</tr>
@@ -85,6 +87,20 @@
 				<td>
 					满${cmCoupon.touchPrice}
 				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+						<c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+				</td>
+				<td>
+					    <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+				</td>
 				<td>
 					<c:if test="${cmCoupon.status eq 0}">
 						<font color="#800080">待上架</font>
@@ -99,12 +115,6 @@
 						<font color="#FF6600">已下架</font>
 					</c:if>
 				</td>
-				<td>
-					<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-				</td>
-				<td>
-					<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-				</td>
 				<td>
 					<fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>

+ 139 - 0
src/main/webapp/WEB-INF/views/modules/coupon/cmMoneyCouponList.jsp

@@ -0,0 +1,139 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>优惠券管理列表</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5">价值优惠券列表</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmCoupon" action="${ctx}/coupon/cmCoupon/" method="post" class="breadcrumb form-search">
+		<input type="hidden" name="moneyCouponFlag" value="1"/>
+		<input type="hidden" name="couponType" value="5"/>
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			 <label>优惠券名称:</label>
+				<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
+			<label>状态:</label>
+			<form:select path="status" class="input-medium required">
+				<form:option value="" label="所有"/>
+				<form:option value="0" label="待上架"/>
+				<form:option value="1" label="已上架"/>
+				<form:option value="3" label="已下架"/>
+				<form:option value="2" label="已关闭"/>
+			</form:select>
+<%--			 <label>优惠时间:</label>--%>
+<%--				<input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"--%>
+<%--					value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"--%>
+<%--					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> ---%>
+<%--				<input name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"--%>
+<%--					value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"--%>
+<%--					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>--%>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<input class="btn btn-primary" style="width: 120px" onclick="window.location='${ctx}/coupon/cmCoupon/moneyCouponForm'" value="添加价值优惠券"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>ID</th>
+				<th>优惠券名称</th>
+				<th>优惠券金额</th>
+				<th>优惠条件</th>
+				<th>购买价格</th>
+				<th>上架时间</th>
+				<th>下架时间</th>
+				<th>领取期限</th>
+				<th>使用期限</th>
+				<th>状态</th>
+				<th>创建时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmCoupon">
+			<tr>
+				<td>
+					${cmCoupon.id}
+				</td>
+				<td>
+					${cmCoupon.name}
+				</td>
+				<td>
+					${cmCoupon.couponAmount}
+				</td>
+				<td>
+					满${cmCoupon.touchPrice}
+				</td>
+				<td>
+					${cmCoupon.moneyCouponPrice}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+						<c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+				</td>
+				<td>
+					    <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                        <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+				</td>
+				<td>
+					<c:if test="${cmCoupon.status eq 0}">
+						<font color="#800080">待上架</font>
+					</c:if>
+					<c:if test="${cmCoupon.status eq 1}">
+						<font color="#00CC66">已上架</font>
+					</c:if>
+					<c:if test="${cmCoupon.status eq 2}">
+						<font color="red">已关闭</font>
+					</c:if>
+					<c:if test="${cmCoupon.status eq 3}">
+						<font color="#FF6600">已下架</font>
+					</c:if>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					<a href="${ctx}/coupon/cmCoupon/moneyCouponForm?id=${cmCoupon.id}">编辑</a>
+<%--					<c:if test="${cmCoupon.status eq 2}">--%>
+<%--						<a href="${ctx}/coupon/cmCoupon/open?id=${cmCoupon.id}" onclick="return confirmx('确定开启该活动吗?', this.href)">开启</a>--%>
+<%--					</c:if>--%>
+<%--					<c:if test="${cmCoupon.status ne 2}">--%>
+<%--						<a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该活动吗?', this.href)">关闭</a>--%>
+<%--					</c:if>--%>
+					<a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
+					<a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=0">领取用户</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryForm.jsp

@@ -76,7 +76,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -84,7 +84,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -96,7 +96,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -107,7 +107,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 21 - 10
src/main/webapp/WEB-INF/views/modules/coupon/couponCategoryList.jsp

@@ -63,10 +63,12 @@
         <th>活动主题</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
         <th>优惠品类</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -86,6 +88,22 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+
+            <td>${cmCoupon.categoryType eq 1 ? "产品":"仪器"}</td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">待上架</font>
@@ -100,13 +118,6 @@
                     <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
-            <td>${cmCoupon.categoryType eq 1 ? "产品":"仪器"}</td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserForm.jsp

@@ -63,7 +63,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -71,7 +71,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -83,7 +83,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -94,7 +94,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 19 - 9
src/main/webapp/WEB-INF/views/modules/coupon/couponNewUserList.jsp

@@ -60,9 +60,11 @@
         <th>ID</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -79,6 +81,20 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">待上架</font>
@@ -93,12 +109,6 @@
                     <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/coupon/couponShopForm.jsp

@@ -95,7 +95,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -104,7 +104,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -117,7 +117,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -128,7 +128,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 19 - 9
src/main/webapp/WEB-INF/views/modules/coupon/couponShopList.jsp

@@ -66,9 +66,11 @@
         <th>供应商</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -91,6 +93,20 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
             <td>
                 <c:if test="${cmCoupon.status eq 0}">
                     <font color="#800080">待上架</font>
@@ -105,12 +121,6 @@
                     <font color="#FF6600">已下架</font>
                 </c:if>
             </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
-            <td>
-                <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
-            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveForm.jsp

@@ -92,7 +92,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -101,7 +101,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20"
                    class="input-medium Wdate "
@@ -114,7 +114,7 @@
         <div class="controls">
             <input type="number" id="receivePeriod" name="receivePeriod" onkeyup="onlynum(this)" value="${cmCoupon.receivePeriod}" min="1" required> 天
             <input type="checkbox" id="receiveFlag" name="receiveFlag" style="margin-left:20px !important" value="${cmCoupon.receiveFlag eq 1?1:0}"
-                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同活动开始-结束时间
+                ${cmCoupon.receiveFlag eq 1 ? "checked" : ""} onclick="changeCondition('receiveFlag','receivePeriod')" />同上下架时间
             <input id="receivePeriodTemp" type="hidden" value="${cmCoupon.receivePeriod}">
         </div>
     </div>
@@ -125,7 +125,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">

+ 27 - 17
src/main/webapp/WEB-INF/views/modules/coupon/couponUserExclusiveList.jsp

@@ -82,14 +82,16 @@
         <th>机构名称</th>
         <th>优惠券金额</th>
         <th>优惠条件</th>
-        <th>优惠状态</th>
         <th>领取状态</th>
         <th>领取渠道</th>
         <th>使用状态</th>
         <th>领取时间</th>
         <th>使用时间</th>
-        <th>开始时间</th>
-        <th>结束时间</th>
+        <th>上架时间</th>
+        <th>下架时间</th>
+        <th>领取期限</th>
+        <th>使用期限</th>
+        <th>状态</th>
         <th>添加时间</th>
         <th>操作</th>
     </tr>
@@ -109,20 +111,6 @@
             <td>
                 满${cmCoupon.touchPrice}
             </td>
-            <td>
-                <c:if test="${cmCoupon.status eq 0}">
-                    <font color="#800080">待上架</font>
-                </c:if>
-                <c:if test="${cmCoupon.status eq 1}">
-                    <font color="#00CC66">已上架</font>
-                </c:if>
-                <c:if test="${cmCoupon.status eq 2}">
-                    <font color="red">已关闭</font>
-                </c:if>
-                <c:if test="${cmCoupon.status eq 3}">
-                    <font color="#FF6600">已下架</font>
-                </c:if>
-            </td>
             <td>
                 <c:if test="${cmCoupon.claimStatus eq 1}">
                     <font color="red">未领取</font>
@@ -169,6 +157,28 @@
             <td>
                 <fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>
+            <td>
+                <c:if test="${cmCoupon.receivePeriod > 0}">${cmCoupon.receivePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.receivePeriod || cmCoupon.receivePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.usePeriod > 0}">${cmCoupon.usePeriod}天</c:if>
+                <c:if test="${empty cmCoupon.usePeriod || cmCoupon.usePeriod < 0}">--</c:if>
+            </td>
+            <td>
+                <c:if test="${cmCoupon.status eq 0}">
+                    <font color="#800080">待上架</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 1}">
+                    <font color="#00CC66">已上架</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 2}">
+                    <font color="red">已关闭</font>
+                </c:if>
+                <c:if test="${cmCoupon.status eq 3}">
+                    <font color="#FF6600">已下架</font>
+                </c:if>
+            </td>
             <td>
                 <fmt:formatDate value="${cmCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </td>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/coupon/redemptionCodeCouponForm.jsp

@@ -136,7 +136,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>开始时间:</label>
+        <label class="control-label"><font color="red">*</font>上架时间:</label>
         <div class="controls">
             <input name="startDate" id="startDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.startDate}" pattern="yyyy-MM-dd 00:00:00"/>"
@@ -144,7 +144,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>结束时间:</label>
+        <label class="control-label"><font color="red">*</font>下架时间:</label>
         <div class="controls">
             <input name="endDate" id="endDate" type="text" required readonly="readonly" maxlength="20" class="input-medium Wdate "
                    value="<fmt:formatDate value="${cmCoupon.endDate}" pattern="yyyy-MM-dd 23:59:59"/>"
@@ -158,7 +158,7 @@
         </div>
     </div>
     <div class="control-group">
-        <label class="control-label"><font color="red">*</font>优惠状态:</label>
+        <label class="control-label"><font color="red">*</font>状态:</label>
         <div class="controls">
             <label id="initializeShow">
                 <c:if test="${empty cmCoupon.status || cmCoupon.status eq 0}">