user_list.jsp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  4. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  5. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  6. <%
  7. String path = request.getContextPath();
  8. String basePath = request.getScheme() + "://"
  9. + request.getServerName() + ":" + request.getServerPort()
  10. + path + "/";
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <base href="<%=basePath%>">
  16. <!-- 下拉框 -->
  17. <link rel="stylesheet" href="static/ace/css/chosen.css" />
  18. <!-- jsp文件头和头部 -->
  19. <%@ include file="../index/top.jsp"%>
  20. <!-- 日期框 -->
  21. <link rel="stylesheet" href="static/ace/css/datepicker.css" />
  22. </head>
  23. <body class="no-skin">
  24. <!-- /section:basics/navbar.layout -->
  25. <div class="main-container" id="main-container">
  26. <!-- /section:basics/sidebar -->
  27. <div class="main-content">
  28. <div class="main-content-inner">
  29. <div class="page-content">
  30. <div class="row">
  31. <div class="col-xs-12">
  32. <!-- 检索 -->
  33. <form action="user/listUsers.do" method="post" name="userForm" id="userForm">
  34. <table style="margin-top:5px;">
  35. <tr>
  36. <td>
  37. <div class="nav-search">
  38. <span class="input-icon">
  39. <input class="nav-search-input" autocomplete="off" id="nav-search-input" type="text" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词" />
  40. <i class="ace-icon fa fa-search nav-search-icon"></i>
  41. </span>
  42. </div>
  43. </td>
  44. <td style="padding-left:2px;"><input class="span10 date-picker" name="lastLoginStart" id="lastLoginStart" value="${pd.lastLoginStart}" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="最近登录开始"/></td>
  45. <td style="padding-left:2px;"><input class="span10 date-picker" name="lastLoginEnd" name="lastLoginEnd" value="${pd.lastLoginEnd}" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="最近登录结束"/></td>
  46. <td style="vertical-align:top;padding-left:2px;">
  47. <select class="chosen-select form-control" name="ROLE_ID" id="role_id" data-placeholder="请选择角色" style="vertical-align:top;width: 120px;">
  48. <option value=""></option>
  49. <option value="">全部</option>
  50. <c:forEach items="${roleList}" var="role">
  51. <option value="${role.ROLE_ID }" <c:if test="${pd.ROLE_ID==role.ROLE_ID}">selected</c:if>>${role.ROLE_NAME }</option>
  52. </c:forEach>
  53. </select>
  54. </td>
  55. <c:if test="${QX.cha == 1 }">
  56. <td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="searchs();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
  57. <c:if test="${QX.toExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if>
  58. <c:if test="${QX.FromExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="fromExcel();" title="从EXCEL导入"><i id="nav-search-icon" class="ace-icon fa fa-cloud-upload bigger-110 nav-search-icon blue"></i></a></td></c:if>
  59. </c:if>
  60. </tr>
  61. </table>
  62. <!-- 检索 -->
  63. <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  64. <thead>
  65. <tr>
  66. <th class="center" style="width:35px;">
  67. <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
  68. </th>
  69. <th class="center" style="width:50px;">序号</th>
  70. <th class="center">编号</th>
  71. <th class="center">用户名</th>
  72. <th class="center">姓名</th>
  73. <th class="center">角色</th>
  74. <!-- <th class="center"><i class="ace-icon fa fa-envelope-o"></i>邮箱</th> -->
  75. <th class="center"><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>最近登录</th>
  76. <th class="center">公司</th>
  77. <th class="center">路段</th>
  78. <th class="center">操作</th>
  79. </tr>
  80. </thead>
  81. <tbody>
  82. <!-- 开始循环 -->
  83. <c:choose>
  84. <c:when test="${not empty userList}">
  85. <c:if test="${QX.cha == 1 }">
  86. <c:forEach items="${userList}" var="user" varStatus="vs">
  87. <tr>
  88. <td class='center' style="width: 30px;">
  89. <c:if test="${user.USERNAME != 'admin'}"><label><input type='checkbox' name='ids' value="${user.USER_ID }" id="${user.EMAIL }" alt="${user.PHONE }" title="${user.USERNAME }" class="ace"/><span class="lbl"></span></label></c:if>
  90. <c:if test="${user.USERNAME == 'admin'}"><label><input type='checkbox' disabled="disabled" class="ace" /><span class="lbl"></span></label></c:if>
  91. </td>
  92. <td class='center' style="width: 30px;">${page.showCount*(page.currentPage-1)+vs.index+1}</td>
  93. <td class="center">${user.NUMBER }</td>
  94. <td class="center"><a onclick="viewUser('${user.USERNAME}')" style="cursor:pointer;"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i>${user.USERNAME }</a></td>
  95. <td class="center">${user.NAME }</td>
  96. <td class="center">${user.ROLE_NAME }</td>
  97. <%-- <td class="center"><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" <c:if test="${QX.email == 1 }">onclick="sendEmail('${user.EMAIL }');"</c:if>>${user.EMAIL }&nbsp;<i class="ace-icon fa fa-envelope-o"></i></a></td> --%>
  98. <td class="center">${user.LAST_LOGIN}</td>
  99. <%-- <td class="center">${user.IP}</td> --%>
  100. <td class="center">${user.COMPANY}</td>
  101. <td class="center">${user.ROAD}</td>
  102. <td class="center">
  103. <c:if test="${QX.edit != 1 && QX.del != 1 }">
  104. <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  105. </c:if>
  106. <div class="hidden-sm hidden-xs btn-group">
  107. <%-- <c:if test="${QX.FHSMS == 1 }">
  108. <a class="btn btn-xs btn-info" title='发送站内信' onclick="sendFhsms('${user.USERNAME }');">
  109. <i class="ace-icon fa fa-envelope-o bigger-120" title="发送站内信"></i>
  110. </a>
  111. </c:if>
  112. <c:if test="${QX.sms == 1 }">
  113. <a class="btn btn-xs btn-warning" title='发送短信' onclick="sendSms('${user.PHONE }');">
  114. <i class="ace-icon fa fa-envelope-o bigger-120" title="发送短信"></i>
  115. </a>
  116. </c:if> --%>
  117. <c:if test="${QX.edit == 1 }">
  118. <a class="btn btn-xs btn-success" title="编辑" onclick="editUser('${user.USER_ID}');">
  119. <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
  120. </a>
  121. </c:if>
  122. <c:if test="${QX.del == 1 }">
  123. <a class="btn btn-xs btn-danger" onclick="delUser('${user.USER_ID }','${user.USERNAME }');">
  124. <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
  125. </a>
  126. </c:if>
  127. </div>
  128. <div class="hidden-md hidden-lg">
  129. <div class="inline pos-rel">
  130. <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
  131. <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
  132. </button>
  133. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  134. <c:if test="${QX.FHSMS == 1 }">
  135. <li>
  136. <a style="cursor:pointer;" onclick="sendFhsms('${user.USERNAME }');" class="tooltip-info" data-rel="tooltip" title="发送站内信">
  137. <span class="blue">
  138. <i class="ace-icon fa fa-envelope bigger-120"></i>
  139. </span>
  140. </a>
  141. </li>
  142. </c:if>
  143. <c:if test="${QX.sms == 1 }">
  144. <li>
  145. <a style="cursor:pointer;" onclick="sendSms('${user.PHONE }');" class="tooltip-success" data-rel="tooltip" title="发送短信">
  146. <span class="blue">
  147. <i class="ace-icon fa fa-envelope-o bigger-120"></i>
  148. </span>
  149. </a>
  150. </li>
  151. </c:if>
  152. <c:if test="${QX.edit == 1 }">
  153. <li>
  154. <a style="cursor:pointer;" onclick="editUser('${user.USER_ID}');" class="tooltip-success" data-rel="tooltip" title="修改">
  155. <span class="green">
  156. <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
  157. </span>
  158. </a>
  159. </li>
  160. </c:if>
  161. <c:if test="${QX.del == 1 }">
  162. <li>
  163. <a style="cursor:pointer;" onclick="delUser('${user.USER_ID }','${user.USERNAME }');" class="tooltip-error" data-rel="tooltip" title="删除">
  164. <span class="red">
  165. <i class="ace-icon fa fa-trash-o bigger-120"></i>
  166. </span>
  167. </a>
  168. </li>
  169. </c:if>
  170. </ul>
  171. </div>
  172. </div>
  173. </td>
  174. </tr>
  175. </c:forEach>
  176. </c:if>
  177. <c:if test="${QX.cha == 0 }">
  178. <tr>
  179. <td colspan="10" class="center">您无权查看</td>
  180. </tr>
  181. </c:if>
  182. </c:when>
  183. <c:otherwise>
  184. <tr class="main_info">
  185. <td colspan="10" class="center">没有相关数据</td>
  186. </tr>
  187. </c:otherwise>
  188. </c:choose>
  189. </tbody>
  190. </table>
  191. <div class="page-header position-relative">
  192. <table style="width:100%;">
  193. <tr>
  194. <td style="vertical-align:top;">
  195. <c:if test="${QX.add == 1 }">
  196. <a class="btn btn-mini btn-success" onclick="add();">新增</a>
  197. </c:if>
  198. <%-- <c:if test="${QX.FHSMS == 1 }"><a title="批量发送站内信" class="btn btn-mini btn-info" onclick="makeAll('确定要给选中的用户发送站内信吗?');"><i class="ace-icon fa fa-envelope-o bigger-120"></i></a></c:if>
  199. <c:if test="${QX.email == 1 }"><a title="批量发送电子邮件" class="btn btn-mini btn-primary" onclick="makeAll('确定要给选中的用户发送邮件吗?');"><i class="ace-icon fa fa-envelope bigger-120"></i></a></c:if>
  200. <c:if test="${QX.sms == 1 }"><a title="批量发送短信" class="btn btn-mini btn-warning" onclick="makeAll('确定要给选中的用户发送短信吗?');"><i class="ace-icon fa fa-envelope-o bigger-120"></i></a></c:if> --%>
  201. <c:if test="${QX.del == 1 }">
  202. <a title="批量删除" class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
  203. </c:if>
  204. </td>
  205. <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
  206. </tr>
  207. </table>
  208. </div>
  209. </form>
  210. </div>
  211. <!-- /.col -->
  212. </div>
  213. <!-- /.row -->
  214. </div>
  215. <!-- /.page-content -->
  216. </div>
  217. </div>
  218. <!-- /.main-content -->
  219. <!-- 返回顶部 -->
  220. <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  221. <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  222. </a>
  223. </div>
  224. <!-- /.main-container -->
  225. <!-- basic scripts -->
  226. <!-- 页面底部js¨ -->
  227. <%@ include file="../index/foot.jsp"%>
  228. <!-- 删除时确认窗口 -->
  229. <script src="static/ace/js/bootbox.js"></script>
  230. <!-- ace scripts -->
  231. <script src="static/ace/js/ace/ace.js"></script>
  232. <!-- 日期框 -->
  233. <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
  234. <!-- 下拉框 -->
  235. <script src="static/ace/js/chosen.jquery.js"></script>
  236. <!--提示框-->
  237. <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  238. </body>
  239. <script type="text/javascript">
  240. $(top.hangge());
  241. //检索
  242. function searchs(){
  243. top.jzts();
  244. $("#userForm").submit();
  245. }
  246. //删除
  247. function delUser(userId,msg){
  248. bootbox.confirm("确定要删除["+msg+"]吗?", function(result) {
  249. if(result) {
  250. top.jzts();
  251. var url = "<%=basePath%>user/deleteU.do?USER_ID="+userId+"&tm="+new Date().getTime();
  252. $.get(url,function(data){
  253. nextPage(${page.currentPage});
  254. });
  255. };
  256. });
  257. }
  258. //新增
  259. function add(){
  260. top.jzts();
  261. var diag = new top.Dialog();
  262. diag.Drag=true;
  263. diag.Title ="新增";
  264. diag.URL = '<%=basePath%>user/goAddU.do';
  265. diag.Width = 469;
  266. diag.Height = 580;
  267. diag.CancelEvent = function(){ //关闭事件
  268. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  269. if('${page.currentPage}' == '0'){
  270. top.jzts();
  271. setTimeout("self.location=self.location",100);
  272. }else{
  273. nextPage(${page.currentPage});
  274. }
  275. }
  276. diag.close();
  277. };
  278. diag.show();
  279. }
  280. //修改
  281. function editUser(user_id){
  282. top.jzts();
  283. var diag = new top.Dialog();
  284. diag.Drag=true;
  285. diag.Title ="资料";
  286. diag.URL = '<%=basePath%>user/goEditU.do?USER_ID='+user_id;
  287. diag.Width = 469;
  288. diag.Height = 580;
  289. diag.CancelEvent = function(){ //关闭事件
  290. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  291. nextPage(${page.currentPage});
  292. }
  293. diag.close();
  294. };
  295. diag.show();
  296. }
  297. //批量操作
  298. function makeAll(msg){
  299. bootbox.confirm(msg, function(result) {
  300. if(result) {
  301. var str = '';
  302. var emstr = '';
  303. var phones = '';
  304. var username = '';
  305. for(var i=0;i < document.getElementsByName('ids').length;i++)
  306. {
  307. if(document.getElementsByName('ids')[i].checked){
  308. if(str=='') str += document.getElementsByName('ids')[i].value;
  309. else str += ',' + document.getElementsByName('ids')[i].value;
  310. if(emstr=='') emstr += document.getElementsByName('ids')[i].id;
  311. else emstr += ';' + document.getElementsByName('ids')[i].id;
  312. if(phones=='') phones += document.getElementsByName('ids')[i].alt;
  313. else phones += ';' + document.getElementsByName('ids')[i].alt;
  314. if(username=='') username += document.getElementsByName('ids')[i].title;
  315. else username += ';' + document.getElementsByName('ids')[i].title;
  316. }
  317. }
  318. if(str==''){
  319. bootbox.dialog({
  320. message: "<span class='bigger-110'>您没有选择任何内容!</span>",
  321. buttons:
  322. { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
  323. });
  324. $("#zcheckbox").tips({
  325. side:3,
  326. msg:'点这里全选',
  327. bg:'#AE81FF',
  328. time:8
  329. });
  330. return;
  331. }else{
  332. if(msg == '确定要删除选中的数据吗?'){
  333. top.jzts();
  334. $.ajax({
  335. type: "POST",
  336. url: '<%=basePath%>user/deleteAllU.do?tm='+new Date().getTime(),
  337. data: {USER_IDS:str},
  338. dataType:'json',
  339. //beforeSend: validateData,
  340. cache: false,
  341. success: function(data){
  342. $.each(data.list, function(i, list){
  343. nextPage(${page.currentPage});
  344. });
  345. }
  346. });
  347. }else if(msg == '确定要给选中的用户发送邮件吗?'){
  348. sendEmail(emstr);
  349. }else if(msg == '确定要给选中的用户发送短信吗?'){
  350. sendSms(phones);
  351. }else if(msg == '确定要给选中的用户发送站内信吗?'){
  352. sendFhsms(username);
  353. }
  354. }
  355. }
  356. });
  357. }
  358. //去发送短信页面
  359. function sendSms(phone){
  360. top.jzts();
  361. var diag = new top.Dialog();
  362. diag.Drag=true;
  363. diag.Title ="发送短信";
  364. diag.URL = '<%=basePath%>head/goSendSms.do?PHONE='+phone+'&msg=appuser';
  365. diag.Width = 600;
  366. diag.Height = 265;
  367. diag.CancelEvent = function(){ //关闭事件
  368. diag.close();
  369. };
  370. diag.show();
  371. }
  372. //去发送电子邮件页面
  373. function sendEmail(EMAIL){
  374. top.jzts();
  375. var diag = new top.Dialog();
  376. diag.Drag=true;
  377. diag.Title ="发送电子邮件";
  378. diag.URL = '<%=basePath%>head/goSendEmail.do?EMAIL='+EMAIL;
  379. diag.Width = 660;
  380. diag.Height = 486;
  381. diag.CancelEvent = function(){ //关闭事件
  382. diag.close();
  383. };
  384. diag.show();
  385. }
  386. //发站内信
  387. function sendFhsms(username){
  388. top.jzts();
  389. var diag = new top.Dialog();
  390. diag.Drag=true;
  391. diag.Title ="站内信";
  392. diag.URL = '<%=basePath%>fhsms/goAdd.do?username='+username;
  393. diag.Width = 660;
  394. diag.Height = 444;
  395. diag.CancelEvent = function(){ //关闭事件
  396. diag.close();
  397. };
  398. diag.show();
  399. }
  400. $(function() {
  401. //日期框
  402. $('.date-picker').datepicker({autoclose: true,todayHighlight: true});
  403. //下拉框
  404. if(!ace.vars['touch']) {
  405. $('.chosen-select').chosen({allow_single_deselect:true});
  406. $(window)
  407. .off('resize.chosen')
  408. .on('resize.chosen', function() {
  409. $('.chosen-select').each(function() {
  410. var $this = $(this);
  411. $this.next().css({'width': $this.parent().width()});
  412. });
  413. }).trigger('resize.chosen');
  414. $(document).on('settings.ace.chosen', function(e, event_name, event_val) {
  415. if(event_name != 'sidebar_collapsed') return;
  416. $('.chosen-select').each(function() {
  417. var $this = $(this);
  418. $this.next().css({'width': $this.parent().width()});
  419. });
  420. });
  421. $('#chosen-multiple-style .btn').on('click', function(e){
  422. var target = $(this).find('input[type=radio]');
  423. var which = parseInt(target.val());
  424. if(which == 2) $('#form-field-select-4').addClass('tag-input-style');
  425. else $('#form-field-select-4').removeClass('tag-input-style');
  426. });
  427. }
  428. //复选框全选控制
  429. var active_class = 'active';
  430. $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
  431. var th_checked = this.checked;//checkbox inside "TH" table header
  432. $(this).closest('table').find('tbody > tr').each(function(){
  433. var row = this;
  434. if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
  435. else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
  436. });
  437. });
  438. });
  439. //导出excel
  440. function toExcel(){
  441. var keywords = $("#nav-search-input").val();
  442. var lastLoginStart = $("#lastLoginStart").val();
  443. var lastLoginEnd = $("#lastLoginEnd").val();
  444. var ROLE_ID = $("#role_id").val();
  445. window.location.href='<%=basePath%>user/excel.do?keywords='+keywords+'&lastLoginStart='+lastLoginStart+'&lastLoginEnd='+lastLoginEnd+'&ROLE_ID='+ROLE_ID;
  446. }
  447. //打开上传excel页面
  448. function fromExcel(){
  449. top.jzts();
  450. var diag = new top.Dialog();
  451. diag.Drag=true;
  452. diag.Title ="EXCEL 导入到数据库";
  453. diag.URL = '<%=basePath%>user/goUploadExcel.do';
  454. diag.Width = 300;
  455. diag.Height = 150;
  456. diag.CancelEvent = function(){ //关闭事件
  457. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  458. if('${page.currentPage}' == '0'){
  459. top.jzts();
  460. setTimeout("self.location.reload()",100);
  461. }else{
  462. nextPage(${page.currentPage});
  463. }
  464. }
  465. diag.close();
  466. };
  467. diag.show();
  468. }
  469. //查看用户
  470. function viewUser(USERNAME){
  471. if('admin' == USERNAME){
  472. bootbox.dialog({
  473. message: "<span class='bigger-110'>不能查看admin用户!</span>",
  474. buttons:
  475. { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
  476. });
  477. return;
  478. }
  479. top.jzts();
  480. var diag = new top.Dialog();
  481. diag.Drag=true;
  482. diag.Title ="资料";
  483. diag.URL = '<%=basePath%>user/view.do?USERNAME='+USERNAME;
  484. diag.Width = 469;
  485. diag.Height = 380;
  486. diag.CancelEvent = function(){ //关闭事件
  487. diag.close();
  488. };
  489. diag.show();
  490. }
  491. </script>
  492. </html>