Sin descripción

zuoXiTable.html 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
  10. <link rel="stylesheet" href="../css/init.css" />
  11. <style>
  12. .zxt-top {
  13. background: #f3f3f4;
  14. padding: 10px 20px;
  15. }
  16. .topCon {
  17. float: right;
  18. margin-right: 45px;
  19. }
  20. .topCon select {
  21. color: #1ab394;
  22. }
  23. .zxt-content {
  24. width: 95%;
  25. margin: 0 auto;
  26. }
  27. .zxt-table table {
  28. font-size: 12px;
  29. margin-top: 20px;
  30. }
  31. .zxt-table table thead tr td {
  32. background: #1ab394;
  33. color: #fff;
  34. }
  35. </style>
  36. </head>
  37. <body class="gray-bg">
  38. <div class="zxtable">
  39. <div class="daoHang clearfix">
  40. <div class="dhLeft">
  41. <sapn><i class="syIcon"></i>位置:
  42. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  43. <a href="javaScript:;">报表分析</a>&gt;
  44. <a href="javaScript:;">员工考核分析</a>&gt;
  45. <a href="" style="color: #000;">坐席工作报表</a>
  46. </sapn>
  47. </div>
  48. </div>
  49. <div class="zxt-top clearfix form-inline">
  50. <div class="topCon">
  51. 部门:
  52. <select class="form-control" id="bumen">
  53. </select>
  54. 选择日期:
  55. <input type="text" class="form-control" id="startTime" /> 月工作天数:
  56. <input type="text" id="dayss" style="width:50px;" class="form-control" />
  57. <button class="btns sear">搜索</button>
  58. <a class="btns export">导出</a>
  59. </div>
  60. </div>
  61. <div class="zxt-content">
  62. <div class="zxt-table">
  63. <table class="table table-bordered text-center thTable table-hover" style="width: 100%;">
  64. <thead>
  65. <tr>
  66. </tr>
  67. </thead>
  68. <tbody class="tbody">
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. </div>
  74. <script src="../js/laydate/laydate.js"></script>
  75. <script src="../js/select2/js/select2.min.js"></script>
  76. <script>
  77. var token = $.cookie("token"),
  78. endtime = helper.DateFormat.getNowDate(), //结束时间
  79. stime = helper.DateFormat.getPreMonth(endtime), //开始时间
  80. dayss = $('#dayss').val(), //月工作天数
  81. dpt = $('#bumen').val(); //部门
  82. $(function() {
  83. laydate.render({
  84. elem: '#startTime',
  85. range: '~',
  86. value: stime + ' ~ ' + endtime,
  87. theme: '#1ab394',
  88. calendar: 'true'
  89. });
  90. //部门下拉数据
  91. getDeptList();
  92. getColumnList();
  93. Ajax();
  94. //搜索事件
  95. $(".sear").click(function() {
  96. if($('#startTime').val() == "") {
  97. layer.confirm('请选择日期!', {
  98. btn: ['确定']
  99. });
  100. return;
  101. }
  102. $('.thTable tbody').html('');
  103. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0]; //开始时间
  104. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1]; //结束时间
  105. Ajax();
  106. });
  107. //导出
  108. $('.export').click(function() {
  109. if($('#startTime').val() == "") {
  110. layer.confirm('请选择日期!', {
  111. btn: ['确定']
  112. });
  113. return;
  114. }
  115. dcexcel(this);
  116. })
  117. }); //表头
  118. function getColumnList() {
  119. $.ajax({
  120. type: 'get',
  121. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetColumnList",
  122. async: true,
  123. dataType: 'json',
  124. data: {
  125. token: token
  126. },
  127. success: function(res) {
  128. var con = res.data;
  129. for(var i = 0; i < con.length; i++) {
  130. $('<td>' + con[i] + '</td>').appendTo('.thTable thead tr')
  131. }
  132. }
  133. })
  134. }
  135. //表内数据
  136. function Ajax() {
  137. $.ajax({
  138. type: "get",
  139. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetDataList",
  140. async: true,
  141. dataType: 'json',
  142. data: {
  143. stime: stime,
  144. endtime: endtime,
  145. dpt: dpt,
  146. dayss: dayss,
  147. token: token
  148. },
  149. success: function(res) {
  150. var result = res.data;
  151. for(var i = 0; i < result.length; i++) {
  152. $('<tr><td>' + result[i].部门 + '</td><td>' + result[i].坐席 + '</td><td>' + result[i].坐席工号 + '</td><td>' + result[i].呼入量 + '</td><td>' + result[i].呼入接通量 + '</td><td>' + result[i].呼损量 + '</td><td>' + result[i].接通率 + '</td><td>' + result[i].呼损率 + '</td><td>' + result[i].平均排队时间 + '</td><td>' + result[i].总通话次数 + '</td><td>' + result[i].通话分钟数 + '</td><td>' + result[i].通话秒数 + '</td><td>' + result[i].平均接听通话秒数 + '</td><td>' + result[i].平均振铃秒数 + '</td><td>' + result[i].呼入占有率 + '</td><td>' + result[i].用户评价 + '</td><td>' + result[i].坐席登录次数 + '</td><td>' + result[i].登录时长分钟数 + '</td><td>' + result[i].工作时长分钟数 + '</td><td>' + result[i].平均每天工作时长 + '</td><td>' + result[i].平均操作分钟数 + '</td><td>' + result[i].置忙次数 + '</td><td>' + result[i].休息时长分钟数 + '</td><td>' + result[i].平均每天休息时长 + '</td><td>' + result[i].置忙平均休息分钟数 + '</td><td>' + result[i].质检平均成绩 + '</td></tr>').appendTo('.thTable tbody')
  153. }
  154. }
  155. });
  156. }
  157. //导出
  158. function dcexcel(obj) {
  159. var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + token;
  160. url += "&stime=" + stime + "&endtime=" + endtime + "&dpt=" + dpt + "&dayss=" + dayss;
  161. obj.href = url;
  162. }
  163. //部门下拉
  164. function getDeptList() {
  165. $("#bumen").select2({
  166. width: 'resolve',
  167. minimumResultsForSearch: -1,
  168. ajax: {
  169. type: "get",
  170. url: huayi.config.callcenter_url + "Department/GetDeptList",
  171. async: true,
  172. dataType: "json",
  173. data: function(params) {
  174. return {
  175. token: token,
  176. pid: params.id
  177. }
  178. },
  179. processResults: function(data) {
  180. return {
  181. results: data.data
  182. }
  183. },
  184. cache: true
  185. },
  186. placeholder: "请选择",
  187. });
  188. }
  189. </script>
  190. </body>
  191. </html>