activitySelectProduct.jsp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: Administrator
  4. Date: 2020/4/9
  5. Time: 19:54
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" %>
  9. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  10. <html>
  11. <head>
  12. <title>选择商品</title>
  13. <meta name="decorator" content="default"/>
  14. <style type="text/css">
  15. .table td i {
  16. margin: 0 2px;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <form:form id="searchForm" modelAttribute="product" action="${ctx}/newhome/newActivity/findProductPage" method="post"
  22. class="breadcrumb form-search">
  23. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  24. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  25. <div class="ul-form">
  26. <label>商品ID:</label>
  27. <form:input path="productID" htmlEscape="false" maxlength="11" class="input-mini" onkeyup="onlynum(this)"/>
  28. <label>商品名称:</label>
  29. <form:input path="name" htmlEscape="false" class="input-medium" maxlength="20"/>
  30. <label>供应商名称:</label>
  31. <form:input path="shopName" htmlEscape="false" class="input-medium" maxlength="20"/>
  32. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
  33. <div class="clearfix"></div>
  34. </div>
  35. </form:form>
  36. <sys:message content="${message}"/>
  37. <table class="table table-striped table-bordered table-condensed table-hover">
  38. <tr>
  39. <th style="width:20px;"></th>
  40. <th>商品ID</th>
  41. <th>商品图片</th>
  42. <th>商品名称</th>
  43. <th>供应商名称</th>
  44. </tr>
  45. <tbody>
  46. <c:if test="${not empty page.list}">
  47. <c:forEach items="${page.list}" var="item">
  48. <tr id="${item.productID}" class="itemtr">
  49. <th>
  50. <input class="check-item" type="radio" name="info" value='${item.productID}'/>
  51. </th>
  52. <td>${item.productID}</td>
  53. <td><img src="${item.mainImage}" width="50px" height="50px"></td>
  54. <td>${item.name}</td>
  55. <td>${item.shopName}</td>
  56. </tr>
  57. </c:forEach>
  58. </c:if>
  59. </tbody>
  60. </table>
  61. <c:if test="${empty page.list}">
  62. <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
  63. </c:if>
  64. <div class="pagination">${page}</div>
  65. <script type="text/javascript">
  66. $(document).ready(function () {
  67. //弹出框去滚动条
  68. top.$('#jbox-content').css("overflow-y", "hidden");
  69. show_title(30);
  70. });
  71. function page(n, s) {
  72. $("#pageNo").val(n);
  73. $("#pageSize").val(s);
  74. $("#searchForm").submit();
  75. return false;
  76. }
  77. function getCheckedItems() {
  78. var items = new Array();
  79. var $items = $('.check-item:checked');
  80. $items.each(function () {
  81. items.push($(this).val());
  82. });
  83. return items;
  84. }
  85. function clickAllSelect(ckb){
  86. var isChecked = ckb.checked;
  87. $(".check-item").attr('checked', isChecked);
  88. }
  89. /**
  90. * @param obj
  91. * jquery控制input只能输入数字
  92. */
  93. function onlynum(obj) {
  94. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  95. }
  96. </script>
  97. </body>
  98. </html>