limitcode-edit.html 9.19 KB
<div class="contentpanel">
    <div class="row">
        <div class="col-md-12">
            <div id="basicForm" role="{{type}}" data-action="{{action}}" class="form-horizontal form-bordered">

            </div>
        </div>
    </div>
</div>

<script type="text/template" id="limitcodeEdit-template">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">基本信息</h4>
        </div><!-- panel-heading -->
        <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" placeholder="名称建议30字以内" prompt="名称" class="form-control observe noEdit" data-field="name" required maxlength="30" value="[[name]]">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">数量<i class="red">*</i></label>
                    <div class="col-sm-8">
                        <input type="text" placeholder="数量" class="form-control observe noEdit number" data-field="limitTimes" required onkeyup="value=value.replace(/[^1-9]/g,'')" value="[[limitTimes]]">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">申请部门</label>
                    <div class="col-sm-3">
                        <select value="[[reqDepartment[0] ]]" class="form-control observe noEdit" data-field="reqDepartment[0]">
                            <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 value="[[reqDepartment[1] ]]" class="form-control observe noEdit" data-field="reqDepartment[1]">
                            <option value="营销策划">营销策划</option>
                            <option value="类目运营">类目运营</option>
                            <option value="店铺运营">店铺运营</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">使用期限<span class="red">*</span></label>
                    <div class="col-sm-6">
                        <div class="col-sm-6">
                            <input type="text" class="form-control observe" data-field="limitDateFrom" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required>
                        </div>
                        <div class="col-sm-6">
                            <input type="text" class="form-control observe" data-field="limitDateTo" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required>
                        </div>
                    </div>
                    <input type="hidden" jsaction="time" id="limitDateCurr" value="[[currTime]]" readonly>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">限购码说明<i class="red">*</i></label>
                    <div class="col-sm-8">
                        <textarea class="form-control observe" prompt="限购码说明" data-field="describe" maxlength="100" placeholder="限购码使用条件简介,最多100个字" required>[[describe]]</textarea>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel-heading">
            <h4 class="panel-title">使用条件</h4>
        </div>

        <div class="form-group" hidden>
            <label class="col-sm-2 control-label">会员身份<i class="red">*</i></label>
            <div class="col-sm-10">
                <label class="checkbox-inline">
                    <input type="checkbox"  value="新注册" name="userTypeLimit" > 新注册
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox"  value="注册未购买" name="userTypeLimit"> 注册未购买
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox"  value="普通会员" name="userTypeLimit"> 普通会员
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox"  value="银卡会员" name="userTypeLimit"> 银卡会员
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox"  value="金卡会员" name="userTypeLimit"> 金卡会员
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox"  value="白金会员" name="userTypeLimit"> 白金会员
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox"  value="指定用户" name="userTypeLimit"> 指定用户
                </label>
            </div>

            <div class="col-sm-2">
                <input type="text" class="form-control observe noEdit" data-field="UID" value="[[UID]]" placeholder="UID">
            </div>

            <input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" required placeholder="会员身份">
        </div>
        <div class="form-group" hidden>
            <label class="col-sm-2 control-label">限用次数<i class="red">*</i></label>
            <div class="col-sm-8">
                <input type="text" prompt="限用次数" placeholder="0 表示不限制" class="form-control observe noEdit" data-field="userUseLimit" required pattern="^[0-9]+$" value="[[userUseLimit]]">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">指定商品<i class="red">*</i></label>
            <div class="col-sm-4">
                <div class="col-sm-10">
                    <input type="radio" class="limitProduct" value="N" name="skn_sku" checked />SKN
                    <input type="radio" class="limitProduct" value="U" name="skn_sku" />SKU
                    <input type="hidden" id="skn_sku" for="radio" value="[[limitCodeType]]"/><br>
                </div>
                <label class="col-sm-3 control-label">SKN值:</label>
                <div class="col-sm-4">
                    <input id="limitSkn" type="text" maxlength="8" placeholder="SKN" class="form-control observe number noEdit" data-field="limitSkn" value="[[limitSkn]]" [[limitCodeType=="N"?'':'required']]>
                </div><br>
                <div id="skus" class="col-sm-10" [[limitCodeType=="U"?"":"hidden"]]>
                    <table class="table table-bordered responsive dataTable no-footer">
                        [[each skusInfo as item index]]
                        <tr>
                            <td><input type="text" class="form-control observe skus number noEdit" placeholder="sku值" data-field="skusInfo.[[index]].sku" value="[[item.sku]]" [[limitCodeType=="N"?"":"required"]]></td>
                            <td><input type="text" class="form-control observe number noEdit" prompt="sku数量" placeholder="数量" data-field="skusInfo.[[index]].skuTimes" value="[[item.skuTimes]]" [[limitCodeType=="N"?"":"required"]]></td>
                            <td><a href="javascript:;" class="btn btn-danger btn-xs delSku noEdit" data-index="[[index]]">删除</a></td>
                        </tr>
                        [[/each]]
                        <tr>
                            <td>sku</td>
                            <td>数量</td>
                            <td><a href="javascript:;" class="btn btn-info btn-xs addSku" disabled>添加</a></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

        <input type="hidden" value="[[status]]">
        <input type="hidden" value="[[id]]">
        <input type="hidden" value="[[batchNo]]">

        <div class="form-group">
            <label class="col-sm-2 control-label">申请人</label>
            <div class="col-sm-8">
                <label  class="form-label control-label" id="creatorName">{{auth.name}}</label>
            </div>
        </div>
        <input id="auth_id" type="hidden" value="{{auth.uid}}">
        <input id="auth_name" type="hidden" value="{{auth.name}}">
        <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="button" data-loading-text="保存中..." class="btn btn-primary">保存</button>
                </div>
            </div>
        </div>
    </div>
</script>