selectMgmUser.jsp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@taglib prefix="p" uri="http://www.test.com/jsp/permission" %>
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <%@ include file="../../common/head.jsp"%>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  9. <link href="../res/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
  10. <script src="../res/js/plugins/bootstrap-table/bootstrap-table.js"></script>
  11. <script src="../res/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
  12. <script src="../res/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
  13. <script>
  14. $(function(){
  15. $('#btnSearch').click(function () {
  16. $('#tab_user').bootstrapTable('refresh');
  17. });
  18. $('#clearHref').click(function () {
  19. $('#myform')[0].reset();
  20. });
  21. //btmAssign
  22. $('#btmAssign').click(function () {
  23. var data = getSelectedRow("tab_user");
  24. if(null == data){
  25. layer.alert('请选择销售人员', {icon: 6});
  26. return;
  27. }
  28. /*
  29. $.post('assignAction.cs',
  30. {"userId" : data.id,"orderId":"${orderId}"},
  31. "json",
  32. function(data) {
  33. layer.alert(data.msg);
  34. var index = parent.layer.getFrameIndex(window.name);
  35. parent.layer.close(index);
  36. });
  37. */
  38. $.ajax({
  39. type: 'POST',
  40. url: 'assignAction.cs',
  41. data: {"userId" : data.id,"orderId":"${orderId}"},
  42. success: function(data) {
  43. layer.confirm(data.msg, {
  44. btn: ['确定'] //可以无限个按钮
  45. }, function(index, layero){
  46. var index = parent.layer.getFrameIndex(window.name);
  47. parent.location.reload();
  48. parent.layer.close(index);
  49. });
  50. },
  51. dataType:"json"
  52. });
  53. });
  54. });
  55. function queryParams(params){
  56. var page = params.offset / params.limit + 1;
  57. var dataObj = new Object();
  58. //alert($("#search").val());
  59. dataObj.name=$("#name").val();
  60. return { page:page,
  61. pageSize:params.limit,
  62. search:JSON.stringify(dataObj),
  63. sort:params.sort,
  64. order:params.order,
  65. };
  66. }
  67. </script>
  68. </head>
  69. <body class="gray-bg">
  70. <div class="wrapper wrapper-content animated fadeInUp">
  71. <div class="row row-lg">
  72. <div class="col-sm-12">
  73. <div class="ibox-content m-b-sm border-bottom ">
  74. <form class="form-inline" id="myform">
  75. <div class="form-group col-sm-3"></div>
  76. <label>&nbsp;名称:</label><input id="name" name="name" class="form-control" type="text" value="">
  77. &nbsp;&nbsp;
  78. <button type="button" id="btnSearch" class="btn btn-w-m btn-success">搜索</button>
  79. <button type="button" id="clearHref" class="btn btn-w-m btn-primary"> 清除搜索条件</button>
  80. <button type="button" id="btmAssign" class="btn btn-w-m btn-danger">指派</button>
  81. </form>&nbsp;&nbsp;
  82. </div>
  83. <table id="tab_user"
  84. data-toggle="table"
  85. data-url="mgmUserList.cs"
  86. data-method="get"
  87. data-click-to-select="true"
  88. data-pagination="true"
  89. data-data-type="json"
  90. data-show-refresh="false"
  91. data-show-columns="false"
  92. data-show-toggle="false"
  93. data-search-on-enter-key="true"
  94. data-toolbar="#def_toolbar"
  95. data-side-pagination="server"
  96. data-query-params="queryParams"
  97. data-mobile-responsive="true"
  98. >
  99. <thead>
  100. <tr>
  101. <th data-radio="true" data-click-to-select="true"></th>
  102. <th data-field="id" data-visible="false">id</th>
  103. <th data-field="name">姓名</th>
  104. <th data-field="deptName">部门</th>
  105. <th data-field="phone">电话</th>
  106. <th data-field="post">职务</th>
  107. </tr>
  108. </thead>
  109. </table>
  110. </div>
  111. </div>
  112. </div>
  113. </body>
  114. </html>