heheAddProduct.jsp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>选择商品</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table td i {
  9. margin: 0 2px;
  10. }
  11. </style>
  12. <script type="text/javascript">
  13. $(document).ready(function () {
  14. $("#searchForm").validate({
  15. submitHandler: function (form) {
  16. var isSubMitFlag = true;
  17. var productID = $("#productID").val();
  18. if (isNaN(productID) || productID.indexOf('0') == 0 ) {
  19. alertx("请输入正确的商品ID");
  20. isSubMitFlag = false;
  21. return false;
  22. }
  23. if (isSubMitFlag) {
  24. form.submit();
  25. }
  26. }
  27. })
  28. });
  29. </script>
  30. </head>
  31. <body>
  32. <form:form id="searchForm" modelAttribute="product" action="${ctx}/hehe/cmHeheProduct/findProductPage" method="post"
  33. class="breadcrumb form-search">
  34. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  35. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  36. <div class="ul-form">
  37. <label>商品ID:</label>
  38. <form:input path="productID" id="productID" htmlEscape="false" maxlength="8" class="input-mini" onkeyup="onlynum(this)"/>
  39. <label>商品名称:</label>
  40. <form:input path="name" htmlEscape="false" class="input-medium" maxlength="20"/>
  41. <label>供应商名称:</label>
  42. <form:input path="shopName" htmlEscape="false" class="input-medium" maxlength="20"/>
  43. &nbsp;&nbsp; <input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
  44. <div class="clearfix"></div>
  45. </div>
  46. </form:form>
  47. <sys:message content="${message}"/>
  48. <table class="table table-striped table-bordered table-condensed table-hover">
  49. <tr>
  50. <th style="width:20px;"></th>
  51. <th>商品ID</th>
  52. <th>商品图片</th>
  53. <th>商品名称</th>
  54. <th>供应商名称</th>
  55. </tr>
  56. <tbody>
  57. <c:if test="${not empty page.list}">
  58. <c:forEach items="${page.list}" var="item">
  59. <tr id="${item.productID}" class="itemtr">
  60. <th>
  61. <input class="check-item" type="radio" name="info" value='${item.productID}'/>
  62. </th>
  63. <td>${item.productID}</td>
  64. <td><img class="mainImage" src="${item.mainImage}" width="50px" height="50px"></td>
  65. <td class="name">${item.name}</td>
  66. <td id="shopName">${item.shopName}</td>
  67. <input type="hidden" value="${item.price1}" id="price">
  68. <input type="hidden" value="${item.includedTax}" id="includedTax">
  69. <input type="hidden" value="${item.invoiceType}" id="invoiceType">
  70. <input type="hidden" value="${item.taxPoint}" id="clubTaxPoint">
  71. <input type="hidden" value="${item.supplierTaxPoint}" id="shopTaxPoint">
  72. <input type="hidden" value="${item.costCheckFlag}" id="costType">
  73. <input type="hidden" value="${item.costPrice}" id="costPrice">
  74. <input type="hidden" value="${item.costProportional}" id="costProportional">
  75. </tr>
  76. </c:forEach>
  77. </c:if>
  78. </tbody>
  79. </table>
  80. <c:if test="${empty page.list}">
  81. <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
  82. </c:if>
  83. <div class="pagination">${page}</div>
  84. <script type="text/javascript">
  85. $(document).ready(function () {
  86. //弹出框去滚动条
  87. top.$('#jbox-content').css("overflow-y", "hidden");
  88. show_title(30);
  89. });
  90. function page(n, s) {
  91. $("#pageNo").val(n);
  92. $("#pageSize").val(s);
  93. $("#searchForm").submit();
  94. return false;
  95. }
  96. function getCheckedItems() {
  97. var items = new Array();
  98. var $items = $('.check-item:checked');
  99. $items.each(function () {
  100. items.push({
  101. productId: $(this).val(),
  102. mainImage: $(this).parents(".itemtr").find(".mainImage").attr("src"),
  103. name: $(this).parents(".itemtr").find(".name").text(),
  104. shopName: $(this).parents(".itemtr").find("#shopName").text(),
  105. price: $(this).parents(".itemtr").find("#price").val(),
  106. includedTax: $(this).parents(".itemtr").find("#includedTax").val(),
  107. invoiceType: $(this).parents(".itemtr").find("#invoiceType").val(),
  108. clubTaxPoint: $(this).parents(".itemtr").find("#clubTaxPoint").val(),
  109. shopTaxPoint: $(this).parents(".itemtr").find("#shopTaxPoint").val(),
  110. costType: $(this).parents(".itemtr").find("#costType").val(),
  111. costPrice: $(this).parents(".itemtr").find("#costPrice").val(),
  112. costProportional: $(this).parents(".itemtr").find("#costProportional").val()
  113. })
  114. });
  115. return items;
  116. }
  117. function clickAllSelect(ckb) {
  118. var isChecked = ckb.checked;
  119. $(".check-item").attr('checked', isChecked);
  120. }
  121. /**
  122. * @param obj
  123. * jquery控制input只能输入数字
  124. */
  125. function onlynum(obj) {
  126. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  127. }
  128. </script>
  129. </body>
  130. </html>