index.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>客服列表</title>
  7. <link rel="shortcut icon" href="favicon.ico">
  8. <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
  9. <link href="__CSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">
  10. <link href="__CSS__/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
  11. <link href="__CSS__/animate.min.css" rel="stylesheet">
  12. <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
  13. <link href="__JS__/layui/css/myLayui.css" rel="stylesheet">
  14. </head>
  15. <style>
  16. dl dd{
  17. height: 30px;
  18. }
  19. input.layui-input.layui-unselect {
  20. height: 30px;
  21. }
  22. </style>
  23. <body class="gray-bg">
  24. <div class="wrapper wrapper-content animated fadeInRight">
  25. <!-- Panel Other -->
  26. <div class="ibox float-e-margins">
  27. <div class="ibox-title">
  28. <h5>客服列表</h5>
  29. </div>
  30. <div class="ibox-content">
  31. <a href="/admin/users/adduser.html">
  32. <button class="btn btn-primary btn-sm" type="button" style="margin-top:5px">新增
  33. </button>
  34. </a>
  35. <!--搜索框开始-->
  36. <form id='commentForm' role="form" method="post" class="form-inline pull-right">
  37. <div class="content clearfix m-b">
  38. <div class="form-group">
  39. <div class="input-group col-sm-4 layui-form" style="width: 120px;">
  40. <input type="hidden" id="group_id" value="0"/>
  41. {$groupsoption}
  42. </div>
  43. </div>
  44. <div class="form-group" style="margin-left: 10px">
  45. <div class="input-group col-sm-4 layui-form" style="width: 70px;">
  46. <input type="hidden" id="user" value="user_account"/>
  47. <select lay-verify="required" lay-filter="user">
  48. <option value="user_account">账号</option>
  49. <option value="user_name">名称</option>
  50. </select>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <!--<label>客服名:</label>-->
  55. <input type="text" class="form-control" id="username" name="user_name" style="height: 30px;">
  56. </div>
  57. <div class="form-group">
  58. <button class="btn btn-primary btn-sm" type="button" style="margin-top:5px" id="search">搜索</button>
  59. </div>
  60. </div>
  61. </form>
  62. <!--搜索框结束-->
  63. <div class="example-wrap">
  64. <div class="example">
  65. <table id="cusTable">
  66. <thead>
  67. <th data-field="user_account">客服账号</th>
  68. <th data-field="user_name">客服昵称</th>
  69. <th data-field="user_job_number">客服工号</th>
  70. <th data-field="user_email">客服邮箱</th>
  71. <th data-field="user_avatar">客服头像</th>
  72. <th data-field="phone">客服电话</th>
  73. <th data-field="fullname">真实姓名</th>
  74. <th data-field="group">所属组别</th>
  75. <th data-field="status">账号状态</th>
  76. <th data-field="user_overview">会话总览</th>
  77. <!--<th data-field="online">是否在线</th>-->
  78. <th data-field="operate">操作</th>
  79. </thead>
  80. </table>
  81. </div>
  82. </div>
  83. <!-- End Example Pagination -->
  84. </div>
  85. </div>
  86. </div>
  87. <!-- End Panel Other -->
  88. <script src="__JS__/jquery.min.js?v=2.1.4"></script>
  89. <script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
  90. <script src="__JS__/content.min.js?v=1.0.0"></script>
  91. <script src="__JS__/plugins/bootstrap-table/bootstrap-table.min.js"></script>
  92. <script src="__JS__/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
  93. <script src="__JS__/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
  94. <script src="__JS__/plugins/layer/layer.min.js"></script>
  95. <script src="__JS__/layui/layui.js"></script>
  96. <script type="text/javascript">
  97. layui.use(['form', 'upload'], function(){
  98. var form = layui.form;
  99. form.on('select(group)', function(value){
  100. $("#group_id").val(value.value);
  101. onSearch()
  102. });
  103. form.on('select(user)', function(value){
  104. $("#user").val(value.value);
  105. onSearch()
  106. });
  107. });
  108. </script>
  109. <script type="text/javascript">
  110. function initTable() {
  111. //先销毁表格
  112. $('#cusTable').bootstrapTable('destroy');
  113. //初始化表格,动态从服务器加载数据
  114. $("#cusTable").bootstrapTable({
  115. method: "get", //使用get请求到服务器获取数据
  116. url: "{:url('users/index')}", //获取数据的地址
  117. striped: true, //表格显示条纹
  118. pagination: true, //启动分页
  119. pageSize: 50, //每页显示的记录数
  120. pageNumber:1, //当前第几页
  121. pageList: [20, 50], //记录数可选列表
  122. sidePagination: "server", //表示服务端请求
  123. paginationFirstText: "首页",
  124. paginationPreText: "上一页",
  125. paginationNextText: "下一页",
  126. paginationLastText: "尾页",
  127. queryParamsType : "undefined",
  128. queryParams: function queryParams(params) { //设置查询参数
  129. var param = {
  130. pageNumber: params.pageNumber,
  131. pageSize: params.pageSize,
  132. group_id:$('#group_id').val(),
  133. searchText:$('#username').val(),
  134. user:$('#user').val()
  135. };
  136. return param;
  137. },
  138. onLoadSuccess: function(res){ //加载成功时执行
  139. if(111 == res.code){
  140. window.location.reload();
  141. }
  142. layer.msg("加载成功", {time : 1000});
  143. },
  144. onLoadError: function(){ //加载失败时执行
  145. layer.msg("加载数据失败");
  146. }
  147. });
  148. }
  149. $(document).ready(function () {
  150. //调用函数,初始化表格
  151. initTable();
  152. //当点击查询按钮的时候执行
  153. $("#search").bind("click", initTable);
  154. });
  155. function userDel(id){
  156. layer.confirm('确认删除此客服?', {icon: 3, title:'提示'}, function(index){
  157. //do something
  158. $.getJSON("{:url('users/delUser')}", {'id' : id}, function(res){
  159. if(1 == res.code){
  160. layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
  161. initTable();
  162. });
  163. }else if(111 == res.code){
  164. window.location.reload();
  165. }else{
  166. layer.alert(res.msg, {title: '友情提示', icon: 2});
  167. }
  168. });
  169. layer.close(index);
  170. })
  171. }
  172. function resetPwd(id){
  173. layer.confirm('确认重置密码?', {icon: 3, title:'提示'}, function(index){
  174. //do something
  175. $.getJSON("{:url('users/resetPwd')}", {'id' : id}, function(res){
  176. if(1 == res.code){
  177. layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
  178. initTable();
  179. });
  180. }else if(111 == res.code){
  181. window.location.reload();
  182. }else{
  183. layer.alert(res.msg, {title: '友情提示', icon: 2});
  184. }
  185. });
  186. layer.close(index);
  187. })
  188. }
  189. </script>
  190. </body>
  191. </html>