toAddCouponUser.jsp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <%@ page import="java.util.Date" %>
  2. <%@ page contentType="text/html;charset=UTF-8" %>
  3. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  4. <html>
  5. <head>
  6. <title>选择用户</title>
  7. <meta name="decorator" content="default"/>
  8. <style type="text/css">
  9. .table td i{margin:0 2px;}
  10. </style>
  11. <script type="text/javascript">
  12. $(document).ready(function() {
  13. //弹出框去滚动条
  14. top.$('#jbox-content').css("overflow-y","hidden");
  15. show_title(30);
  16. // 反选
  17. $('body').on('click','input[name="info"]',function() {
  18. var allInputLength = $('input[name="info"]').length - $('input[name="info"]:disabled').length,
  19. allInputCheckedLength = $('input[name="info"]:checked').length,
  20. checkAllEle= $('.check-all');
  21. // 判断选中长度和总长度,如果相等就是全选否则取消全选
  22. if(allInputLength === allInputCheckedLength) {
  23. checkAllEle.attr('checked', true);
  24. } else {
  25. checkAllEle.attr('checked', false);
  26. }
  27. })
  28. });
  29. function page(n,s){
  30. $("#pageNo").val(n);
  31. $("#pageSize").val(s);
  32. $("#searchForm").submit();
  33. return false;
  34. }
  35. function getCheckedItems(){
  36. var items = [];
  37. var $items = $('.check-item:checked');
  38. $items.each(function(){
  39. var user = JSON.parse($(this).val());
  40. items.push({
  41. "id": '',
  42. "userId": user.userID,
  43. "nickName": user.nickName,
  44. "mobile": user.mobile,
  45. "userIdentity": user.userIdentity,
  46. "openId": user.openID,
  47. "addTime": ''
  48. })
  49. });
  50. return items;
  51. }
  52. function allCkbfun(ckb){
  53. var isChecked = ckb.checked;
  54. $(".check-item").each2(function () {
  55. var attr = $(this).attr("disabled");
  56. if (attr != 'disabled') {
  57. $(this).attr('checked', isChecked);
  58. }
  59. });
  60. }
  61. /**
  62. * @param obj
  63. * jquery控制input只能输入数字
  64. */
  65. function onlynum(obj) {
  66. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  67. }
  68. /**
  69. * @param obj
  70. * jquery控制input只能输入数字和两位小数(金额)
  71. */
  72. function num(obj) {
  73. obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
  74. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
  75. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
  76. obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  77. obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  78. }
  79. </script>
  80. </head>
  81. <body>
  82. <form:form id="searchForm" modelAttribute="cmUser" action="${ctx}/hehe/cmHeheCoupon/toAddUser?userIds=${userIds}" method="post" class="breadcrumb form-search">
  83. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  84. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  85. <div class="ul-form">
  86. <label>微信昵称:</label>
  87. <form:input path="nickName" htmlEscape="false" maxlength="30" class="input-mini"/>
  88. <label>手机号:</label>
  89. <form:input path="mobile" htmlEscape="false" class="input-medium" maxlength="15"/>
  90. <label>身份:</label>
  91. <form:select path="userIdentity" class="input-small">
  92. <form:option value="" label="请选择"/>
  93. <form:option value="1" label="普通用户"/>
  94. <form:option value="2" label="分销者"/>
  95. </form:select>
  96. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
  97. <div class="clearfix"></div>
  98. </div>
  99. </form:form>
  100. <sys:message content="${message}"/>
  101. <table class="table table-striped table-bordered table-condensed table-hover">
  102. <tr>
  103. <th style="width:20px;"><input class="check-all" type="checkbox" onclick="allCkbfun(this);"/></th>
  104. <th>微信昵称</th>
  105. <th>手机号</th>
  106. <th>身份</th>
  107. <th>openID</th>
  108. </tr>
  109. <tbody>
  110. <c:if test="${not empty page.list}">
  111. <c:forEach items="${page.list}" var="item">
  112. <tr id="${item.userID}" class="itemtr">
  113. <%--已过滤添加过的商品和未上架的商品--%>
  114. <th>
  115. <input class="check-item" ${item.storeStatus ? "disabled" : ""} type="checkbox" name="info" value='${fns:toJson(item)}'/>
  116. </th>
  117. <td>${item.nickName}</td>
  118. <td>${item.mobile}</td>
  119. <td>${item.userIdentity eq 1?"普通用户" : "分销者"}</td>
  120. <td>${item.openID}</td>
  121. </tr>
  122. </c:forEach>
  123. </c:if>
  124. </tbody>
  125. </table>
  126. <c:if test="${empty page.list}">
  127. <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
  128. </c:if>
  129. <div class="pagination">${page}</div>
  130. </body>
  131. </html>