|   | 
|   | 
|   | 
|   | 
|   | 
|   | 
| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> | 
| <head> | 
| <meta charset="utf-8"> | 
| <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
| <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
| <meta name="viewport" | 
|     content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 
| <meta http-equiv="Cache-Control" content="no-siteapp" /> | 
| <LINK rel="Bookmark" href="../images/favicon.ico"> | 
| <!-- 本框架基本脚本和样式 --> | 
| <script type="text/javascript" | 
|     th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
| <script type="text/javascript" | 
|     th:src="@{/js/systools/MBase.js}"></script> | 
|   | 
|   | 
| <title></title> | 
| </head> | 
| <th:block th:if="${obj ne null}"> | 
|     <center> | 
|         <b><h2>您已经拥有了一张有效的会员卡,不能办理新卡!</h2></b> | 
|     </center> | 
| </th:block> | 
| <th:block th:if="${obj eq null}"> | 
|     <div class="ibox-content"> | 
|         <form class="form-horizontal" id="dataform" | 
|             onsubmit="javascripr:return false;"> | 
|   | 
|             <div class="form-group"> | 
|                 <label class="col-sm-2 control-label">会员编号</label> | 
|                 <div class="col-sm-4"> | 
|                     <input autocomplete="off"   type="text" class="form-control" name="vipNo" | 
|                         datatype="*1-16" th:value="${vipInfo.vipNo }" nullmsg="会员编号不能为空" > | 
|                     <div class="Validform_checktip"></div> | 
|                 </div> | 
|                 <label class="col-sm-2 control-label">会员卡号</label> | 
|                 <div class="col-sm-4"> | 
|                     <input autocomplete="off"   type="text" class="form-control" name="cardNo" | 
|                         datatype="*1-16" nullmsg="会员卡号不能为空"> | 
|                     <div class="Validform_checktip"></div> | 
|                 </div> | 
|   | 
|             </div> | 
|          | 
|             <div class="form-group"> | 
|                 <label class="col-sm-2 control-label">密码</label> | 
|                 <div class="col-sm-4"> | 
|                     <input autocomplete="off"   type="text" class="form-control" name="passWord" | 
|                         datatype="*3-16" nullmsg="密码不能为空" errormsg="密码必须为3到16位"> | 
|                     <div class="Validform_checktip"></div> | 
|                 </div> | 
|                 <label class="col-sm-2 control-label">充值余额</label> | 
|                 <div class="col-sm-4"> | 
|                     <input autocomplete="off"   type="text" class="form-control" name="bal" id="bal" readonly="readonly" | 
|                         datatype="/^(([0-9]\d{0,9})|0)(\.\d{1,2})?$/" nullmsg="余额不能为空"> | 
|                     <div class="Validform_checktip"></div> | 
|                 </div> | 
|   | 
|             </div> | 
|   | 
|             <div class="form-group"> | 
|                 <label class="col-sm-2 control-label">会员卡等级</label> | 
|                 <div class="col-sm-4"> | 
|                     <select class="form-control autoFull" | 
|                         th:data-url="@{/admin/vipInfo/showVipLevel}" id="vipLevelId" | 
|                         name="vipLevelId" data-filed="levelName" | 
|                         onchange="changeVipLevel(this)"> | 
|                         <option value="">请选择会员卡等级</option> | 
|                     </select> | 
|                 </div> | 
|                  | 
|                 <label class="col-sm-2 control-label">开卡日期</label> | 
|                 <div class="col-sm-4"> | 
|                     <input autocomplete="off"   name="createTimeVo" type="text" | 
|                     th:value="${#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd hh:mm:ss')}" | 
|                         class="form-control  datetimepicker" style="display: inline;"> | 
|                     <div class="Validform_checktip"></div> | 
|                 </div> | 
|             </div> | 
|             <div class="form-group" id="lytable" hidden="hidden"> | 
|                 <table id="mgrid"> | 
|                     <thead> | 
|                         <tr> | 
|                             <th data-formatter="MGrid.indexfn" data-align="center" | 
|                                 data-width="30px">序号</th> | 
|                             <th data-field="courInfo.courName" data-sortable="true">礼遇名称</th> | 
|                             <th data-field="courInfo.courType">礼遇类型</th> | 
|                             <th data-field="isenjoin">是否享受</th> | 
|                             <th data-field="discount">折扣</th> | 
|                             <th data-field="amount">数量(单位:张/次)</th> | 
|                         </tr> | 
|                     </thead> | 
|                 </table> | 
|                 <input autocomplete="off"   type="hidden" id="minBal" th:value="${level.fundMin}" /> | 
|             </div> | 
|   | 
|             <div class="form-group "> | 
|                 <div class="col-sm-12 text-center"> | 
|                     <a href="javascript:;" onclick="myForm.submit()" | 
|                         class="btn btn-success radius">保存</a>      | 
|                     <button onclick="MTools.closeForm()" class="btn btn-danger radius" | 
|                         type="button">取消</button> | 
|                 </div> | 
|             </div> | 
|         </form> | 
|         <form class="form-inline" id="serchform"> | 
|             <input autocomplete="off"   type="hidden" name="id" id="leaveId"> | 
|         </form> | 
|     </div> | 
| </th:block> | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> | 
| var myGrid; | 
| var minBal; | 
| MTools.ininDatetimepicker(); | 
|   | 
|     MTools.autoFullSelect(); | 
|     function changeVipLevel(node) { | 
|   | 
|         $("#leaveId").val($(node).val()); | 
|         $("#lytable").show(); | 
|         if (myGrid == null) { | 
|             myGrid = MGrid.initGrid({ | 
|                 url : basePath+"/admin/projService/showVipCourtesy", | 
|                 height : 300, | 
|             }); | 
|         } else { | 
|             myGrid.serchData(); | 
|         }  | 
|         setMinBal($(node).val()); | 
|     } | 
|      | 
|     function setMinBal(_id){ | 
|         $.AjaxProxy({ | 
|             p : { | 
|                 id : _id, | 
|             }, | 
|             a:false | 
|         }).invoke(basePath+"/admin/moneyCardUse/fundMin", function(loj) { | 
|             minBal = loj.getString(0, "fundMin"); | 
|         }); | 
|         $("#bal").val(minBal); | 
|   | 
|     } | 
|     var myForm = MForm.initForm({ | 
|         invokeUrl : basePath+"/admin/projService/bk", | 
|         beforeSubmit : function() { | 
|             var bal = parseFloat($("#bal").val()); | 
|             if (bal < minBal) { | 
|                 layer.msg('您充值的金额不足,无法办理该等级会员卡!', { | 
|                     icon : 5 | 
|                 }); | 
|                 return false; | 
|             } | 
|         }, | 
|         afterSubmit : function() { | 
|             parent.selectByKey(); | 
|         }, | 
|     }); | 
| </script> | 
| </body> | 
| </html> |