Edit.html 14 KB
<%include '../../common/__ui/header'%>
<div id="basicForm" role="<%type%>" data-action="<%action%>" class="form-horizontal form-bordered">
</div>
<script type="text/template" id="promotionCode-template">
    <div class="contentpanel">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">基本信息</h4>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">名称 <span class="red">*</span></label>
                                <div class="col-sm-8">
                                    <input type="text" id="name" placeholder="名称" class="form-control observe"
                                           required maxlength="15" value="[[name]]" data-field="name">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="limitTimes" class="col-sm-2 control-label">次数</label>
                                <div class="col-sm-8">
                                    <input type="text" id="limitTimes" placeholder="0 表示不限制"
                                           class="form-control observe"
                                           required pattern="^[0-9]+$" value="[[limitTimes]]" data-field="limitTimes">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="code" class="col-sm-2 control-label">码值<i class="red">*</i></label>
                                <div class="col-sm-8">
                                    <input type="text" id="code" placeholder="仅限数字,字母(不区分大小写),30字符内,多码值用英文逗号分隔"
                                           value='[[code]]'
                                           class="form-control observe" pattern="^[A-Za-z0-9]+$" maxlength="30" required
                                           data-field="code">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">店铺类型</label>
                                <div class="col-sm-3">
                                    <select class="form-control observe" value="[[department1]]"
                                            data-field="department1">
                                        <option value="零售部">零售部</option>
                                        <option value="市场部">市场部</option>
                                        <option value="会员部">会员部</option>
                                        <option value="品牌合作部">品牌合作部</option>
                                        <option value="潮流资源部">潮流资源部</option>
                                        <option value="其他">其他</option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <select class="form-control observe" value="[[department2]]"
                                            data-field="department2">
                                        <option value="营销策划">营销策划</option>
                                        <option value="类目运营">类目运营</option>
                                        <option value="店铺运营">店铺运营</option>
                                    </select>
                                </div>
                                <input type="hidden" class="observe" id="reqDepartment" value="[[reqDepartment]]"
                                       required data-field="reqDepartment">
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">营业期限<span class="red">*</span></label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control observe" jsaction="time:end:limitDateTo"
                                           id="limitDateFrom"
                                           placeholder="优惠开始时间" value="[[limitDateFrom]]" readonly required
                                           data-field="limitDateFrom">
                                </div>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control observe" jsaction="time:start:limitDateFrom"
                                           id="limitDateTo"
                                           placeholder="优惠结束时间" value="[[limitDateTo]]" readonly required
                                           data-field="limitDateTo">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">优惠码说明<i class="red">*</i></label>
                                <div class="col-sm-8">
                                    <textarea class="form-control observe" id="describe" placeholder="优惠码使用条件简介"
                                              data-field="describe" required>[[describe]]</textarea>
                                </div>
                            </div>
                        </div>
                    </div>


                    <div class="panel-heading">
                        <h4 class="panel-title">优惠详情</h4>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">优惠类型<i class="red">*</i></label>
                                <div class="col-sm-8 ">
                                    <input type="radio" name="promotionInfotype" class="observe"
                                           data-field="promotionInfotype" value="1">折扣(吊牌价)
                                    <input type="radio" name="promotionInfotype" class="observe"
                                           data-field="promotionInfotype" value="2">折扣(销售价)
                                    <input type="radio" name="promotionInfotype" class="observe"
                                           data-field="promotionInfotype" value="3">满减
                                </div>
                                <input type="hidden" id="promotionInfotype" value="[[promotionInfotype]]" for="radio"
                                       class="observe" data-field="promotionInfotype"
                                       placeholder="优惠类型" required/>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">优惠条件<i class="red">*</i></label>
                                <div class="col-sm-8">
                                    <div class="form-inline">
                                        <div class="form-group">
                                            >=
                                            <input type="text" class="form-control observe"
                                                   id="promotionInfo-condition-amount_at_least"
                                                   placeholder="0.00" value="[[amount_at_least]]" required
                                                   pattern="^[0-9]+(.\d{1,2})?$"
                                                   data-field="amount_at_least">
                                            ,
                                        </div>
                                        <div class="form-group">
                                            >=
                                            <input type="text" class="form-control observe"
                                                   id="promotionInfo-condition-count_at_least"
                                                   placeholder="1" value="[[count_at_least]]" required
                                                   pattern="^[1-9]+$"
                                                   data-field="count_at_least">
                                            
                                        </div>
                                    </div>
                                </div>

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">优惠结果<i class="red">*</i></label>
                                <div class="col-sm-8">

                                    <div class="form-inline">
                                        <div class="form-group" id="resultdiscount">
                                            
                                            <input type="text" class="form-control observe" placeholder="0.00"
                                                   id="discount"
                                                   value="[[discount]]" required pattern="^0(.\d{1,2})?$"
                                                   data-field="discount">
                                            ,
                                        </div>
                                        <div class="form-group">
                                            最高减
                                            <input type="text" class="form-control observe" placeholder="0"
                                                   id="discount_at_most"
                                                   value="[[discount_at_most]]"
                                                   required pattern="^[0-9]+(.\d{1,2})?$"
                                                   data-field="discount_at_most">
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <input type="hidden" id="promotionInfo" value="[[promotionInfo]]">
                        </div>
                    </div>

                    <div class="panel-heading">
                        <h4 class="panel-title">使用条件</h4>
                    </div>
                    <div class="form-group">
                        <label for="userSourceLimit" class="col-sm-2 control-label">用户来源<i class="red">*</i></label>
                        <div class="col-sm-8">
                            <label class="checkbox-inline">
                                <input type="checkbox" class="custom-1" value="1" name="userSourceLimit"> IOS
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" class="custom-2" value="2" name="userSourceLimit"> 安卓
                            </label>
                        </div>
                        <input type="hidden" value="[[userSourceLimit]]" id="userSourceLimit" for="checkbox" required>
                    </div>

                    <div class="form-group">
                        <label for="name" class="col-sm-2 control-label">用户身份<i class="red">*</i></label>
                        <div class="col-sm-8">
                            <label class="checkbox-inline">
                                <input type="checkbox" value="1" name="userTypeLimit"
                                       data-field="userTypeLimit"> 新注册
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" value="2" name="userTypeLimit"
                                       data-field="userTypeLimit"> 注册未购买
                            </label>
                        </div>
                        <input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" required>
                    </div>

                    <div class="form-group">
                        <label for="name" class="col-sm-2 control-label">限制次数<i class="red">*</i></label>
                        <div class="col-sm-8">
                            <input type="text" id="userUseLimit" placeholder="限制次数"
                                   class="form-control observe" value="[[userUseLimit]]" required pattern="^[1-9]+$"
                                   data-field="userUseLimit">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">申请人</label>
                        <div class="col-sm-8">
                            <input style="border: 0px" class="form-control observe" value="[[staff]]" id="staff"
                                   readonly data-field="staff">
                        </div>
                    </div>

                    <input type="hidden" value="[[id]]" id="id">
                    <input type="hidden" value="[[status]]" id="status">
                    <div class="panel-footer">
                        <div class="row">
                            <div class="col-sm-8 col-sm-offset-2">
                                <a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
                                <button id="save_brand" type="submit" data-loading-text="保存中..."
                                        class="btn btn-primary">保存
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>