mycompany.jsp 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport"
  9. content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  10. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  11. <!--[if lt IE 9]>
  12. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/html5shiv.js"></script>
  13. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/respond.min.js"></script>
  14. <![endif]-->
  15. <link rel="stylesheet" type="text/css"
  16. href="${pageContext.request.contextPath}/static/static/h-ui/css/H-ui.min.css"/>
  17. <link rel="stylesheet" type="text/css"
  18. href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/H-ui.admin.css"/>
  19. <link rel="stylesheet" type="text/css"
  20. href="${pageContext.request.contextPath}/static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
  21. <link rel="stylesheet" type="text/css"
  22. href="${pageContext.request.contextPath}/static/static/h-ui.admin/skin/default/skin.css" id="skin"/>
  23. <link rel="stylesheet" type="text/css"
  24. href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/style.css"/>
  25. <link rel="stylesheet" type="text/css"
  26. href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/page.css"/>
  27. <!--[if IE 6]>
  28. <script type="text/javascript"
  29. src="${pageContext.request.contextPath}/static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
  30. <script>DD_belatedPNG.fix('*');</script>
  31. <![endif]-->
  32. <title>品牌管理</title>
  33. </head>
  34. <body>
  35. <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 产品管理 <span
  36. class="c-gray en">&gt;</span> 品牌管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
  37. href="javascript:location.replace(location.href);" title="刷新"><i
  38. class="Hui-iconfont">&#xe68f;</i></a></nav>
  39. <div class="page-container">
  40. <div class="text-c">
  41. </div>
  42. <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><a href="javascript:;"
  43. class="btn btn-danger radius" id="delete"><i
  44. class="Hui-iconfont">&#xe6e2;</i> 批量删除</a></span>
  45. <a class="btn btn-primary radius" href="${pageContext.request.contextPath}/mycompany/mycompanyadd.html"><i
  46. class="Hui-iconfont">&#xe600;</i> 添加公司</a>
  47. <span class="r data_num">共有数据:<strong>${pageInfo.total }</strong> 条</span></div>
  48. <div class="mt-20">
  49. <table class="table table-border table-bordered table-bg table-sort">
  50. <thead>
  51. <tr class="text-c">
  52. <th width="25"><input type="checkbox" name="" value="" id="sltall"></th>
  53. <th width="70">公司ID</th>
  54. <th width="80">公司名称</th>
  55. <th width="200">公司地址</th>
  56. <th width="120">公司邮箱</th>
  57. <th width="200">公司电话</th>
  58. <th width="120">显示状态</th>
  59. <th width="100">操作</th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. <c:forEach items="${pageInfo.list}" var="itme">
  64. <tr class="text-c">
  65. <td><input name="allid" type="checkbox" value="${itme.id}"></td>
  66. <td>${itme.id}</td>
  67. <td>${itme.name}</td>
  68. <td>${itme.address}</td>
  69. <td>${itme.emil}</td>
  70. <td>${itme.phone}</td>
  71. <c:if test="${itme.shows == 0}">
  72. <td> 隐藏</td>
  73. </c:if>
  74. <c:if test="${itme.shows == 1}">
  75. <td> 显示</td>
  76. </c:if>
  77. <td class="td-manage">
  78. <a style="text-decoration:none" class="ml-5" onClick="article_edit(${itme.id})"
  79. href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
  80. <a style="text-decoration:none" class="ml-5" onClick="article_del(this,${itme.id})"
  81. href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
  82. </td>
  83. </tr>
  84. </c:forEach>
  85. </tbody>
  86. </table>
  87. </div>
  88. <div id="PageNum">
  89. <section>
  90. <div class="bd points-goods-list">
  91. <ul class="pages">
  92. <li><a href="mycompanylist.html?page=1&rows=${pageInfo.pageSize }">首页</a></li>
  93. <li class="prev"><a
  94. href="mycompanylist.html?page=${pageInfo.prePage}&rows=${pageInfo.pageSize }">上一页</a>
  95. </li>
  96. <c:forEach items="${pageInfo.navigatepageNums}" var="nav">
  97. <c:if test="${nav == pageInfo.pageNum}">
  98. <li><a href="mycompanylist.html?page=${nav}&rows=${pageInfo.pageSize }"
  99. class="active">${nav}</a></li>
  100. </c:if>
  101. <c:if test="${nav != pageInfo.pageNum}">
  102. <li>
  103. <a href="mycompanylist.html?page=${nav}&rows=${pageInfo.pageSize }">${nav}</a>
  104. </li>
  105. </c:if>
  106. </c:forEach>
  107. <li class="next"><a
  108. href="mycompanylist.html?page=${pageInfo.nextPage}&rows=${pageInfo.pageSize }">下一页</a>
  109. </li>
  110. <li>
  111. <a href="mycompanylist.html?page=${pageInfo.pages }&rows=${pageInfo.pageSize }">末页</a>
  112. </li>
  113. </ul>
  114. </div>
  115. </section>
  116. </div>
  117. </div>
  118. <!--_footer 作为公共模版分离出去-->
  119. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/jquery/1.9.1/jquery.min.js"></script>
  120. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layer/2.4/layer.js"></script>
  121. <script type="text/javascript" src="${pageContext.request.contextPath}/static/static/h-ui/js/H-ui.min.js"></script>
  122. <script type="text/javascript"
  123. src="${pageContext.request.contextPath}/static/static/h-ui.admin/js/H-ui.admin.js"></script>
  124. <!--/_footer 作为公共模版分离出去-->
  125. <!--请在下方写此页面业务相关的脚本-->
  126. <script type="text/javascript"
  127. src="${pageContext.request.contextPath}/static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  128. <!--
  129. <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
  130. <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
  131. -->
  132. <script type="text/javascript">
  133. //全选与反选
  134. $("#sltall").click(function () {
  135. if ($(this).prop("checked")) {
  136. $("[name='allid']").prop("checked", true);//全选
  137. } else {
  138. $("[name='allid']").prop("checked", false);//取消全选
  139. }
  140. });
  141. //单个删除
  142. function article_del(obj, id) {
  143. layer.confirm('确认要删除吗?', function (index) {
  144. $.post("${pageContext.request.contextPath}/mycompany/deletemycompany.html", {id: id + ","}, function (data) {
  145. if (data.is) {
  146. $(obj).parents("tr").remove();
  147. layer.msg(data.msg, {icon: 1, time: 1000});
  148. var counts = $("#count").html();
  149. $("#count").html(counts - 1);
  150. } else {
  151. layer.msg(data.msg, {icon: 2, time: 1000});
  152. }
  153. }, "json");
  154. });
  155. }
  156. //批量删除
  157. $("#delete").click(function () {
  158. //判断是否至少选择一项
  159. var checkedNum = $("input[name='allid']:checked").length;
  160. if (checkedNum == 0) {
  161. layer.msg("请至少选择一个!", {icon: 2, time: 1000});
  162. return;
  163. }
  164. var lengths = 0;
  165. layer.confirm('确认要删除所选项吗?', function (index) {
  166. var checkList = new Array();
  167. $("input[name='allid']:checked").each(function () {
  168. checkList.push($(this).val());
  169. var l = checkList.toString();
  170. lengths = l.length;
  171. });
  172. $.ajax({
  173. type: "POST",
  174. url: "${pageContext.request.contextPath}/mycompany/deletemycompany.html",
  175. data: {
  176. "id": checkList.toString()
  177. },
  178. dataType: "json",
  179. success: function (ajax) {
  180. if (ajax.is) {
  181. window.location.href = "${pageContext.request.contextPath}/mycompany/mycompanylist.html?page=1&rows=10";
  182. layer.msg(data.msg, {icon: 1, time: 1000});
  183. var counts = $("#count").html();
  184. $("#count").html(counts - lengths);
  185. lengths
  186. } else {
  187. layer.msg(data.msg, {icon: 2, time: 1000});
  188. }
  189. }
  190. })
  191. })
  192. });
  193. function article_edit(id) {
  194. window.location.href = "${pageContext.request.contextPath}/mycompany/getMycompany/" + id;
  195. }
  196. $('.table-sort').dataTable({
  197. "aaSorting": [[1, "desc"]],//默认第几个排序
  198. "bStateSave": true,//状态保存
  199. "aoColumnDefs": [
  200. //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
  201. {"orderable": false, "aTargets": [0, 6]}// 制定列不参与排序
  202. ]
  203. });
  204. </script>
  205. </body>
  206. </html>