商丘12345 前端

zuoXiTable.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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. <!--[if lt IE 9]>
  8. <meta http-equiv="refresh" content="0;ie.html" />
  9. <![endif]-->
  10. <script src="../Script/Common/huayi.load.js"></script>
  11. <script src="../Script/Common/huayi.config.js"></script>
  12. <link href="../css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
  13. <link href="../css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  14. <link href="../css/animate.min.css" rel="stylesheet">
  15. <link href="../css/style.min862f.css?v=4.1.0" rel="stylesheet">
  16. <link rel="stylesheet" href="../css/laydate/need/laydate.css" />
  17. <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
  18. <link rel="stylesheet" href="../css/init.css" />
  19. <style>
  20. .clearfix:after {
  21. content: "";
  22. display: block;
  23. clear: both;
  24. }
  25. .zxt-top {
  26. background: #f3f3f4;
  27. height: 60px;
  28. padding: 10px 20px;
  29. }
  30. .topCon {
  31. float: right;
  32. margin-right: 45px;
  33. }
  34. .topCon select {
  35. padding: 2px;
  36. height: 28px;
  37. border: 1px solid #ebebeb;
  38. outline: none;
  39. vertical-align: middle;
  40. }
  41. .topCon input {
  42. width: 128px;
  43. padding: 2px 2PX 2PX 10PX;
  44. height: 28px;
  45. border: 1px solid #ebebeb;
  46. outline: none;
  47. vertical-align: middle;
  48. }
  49. .zxt-content {
  50. width: 95%;
  51. margin: 0 auto;
  52. }
  53. .zxt-table table {
  54. font-size: 12px;
  55. }
  56. .zxt-table table thead tr td {
  57. background: #00a1cb;
  58. color: #fff;
  59. }
  60. #thead thead th {
  61. background: #00a0cd;
  62. color: #fff;
  63. }
  64. table thead, tbody tr {
  65. display: table;
  66. width: 100%;
  67. table-layout: fixed;
  68. }
  69. .table {
  70. margin-bottom: 0;
  71. }
  72. </style>
  73. </head>
  74. <body class="gray-bg" style="background: #fefefe;">
  75. <div class="zxtable wrapper wrapper-content animated fadeInRight">
  76. <div class="daoHang clearfix">
  77. <div class="dhLeft">
  78. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表管理</a>&gt;<a href="" class="nowPosition">坐席工作报表</a></sapn>
  79. </div>
  80. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  81. </div>
  82. <div class="toolBar clearfix">
  83. <div class="toolRight">
  84. 部门:<select name="" id="bumen"></select>
  85. 开始时间:
  86. <input type="text" class="laydate-icon" id="startTime" />
  87. 结束时间:
  88. <input type="text" class="laydate-icon" id="endTime" />
  89. 月工作天数:
  90. <input type="text" id="dayss" style="width:150px;" />
  91. <button class="btns sear">搜索</button>
  92. <a class="btns export">导出</a>
  93. </div>
  94. </div>
  95. <!--<div class="zxt-top clearfix">
  96. <div class="topCon">
  97. </div>
  98. </div>-->
  99. <div class="zxt-content">
  100. <div class="zxt-table">
  101. <div style="width: 100%;padding: 10px;">
  102. <div class="table-head">
  103. <table id="thead" class="table table-hover table-striped table-bordered table-condensed">
  104. <colgroup>
  105. <col style="width: 150px;" />
  106. <col />
  107. </colgroup>
  108. <thead>
  109. <tr></tr>
  110. </thead>
  111. </table>
  112. </div>
  113. <div class="table-body">
  114. <table class="thTable table table-hover table-striped table-bordered table-condensed">
  115. <colgroup>
  116. <col style="width: 150px;" />
  117. <col />
  118. </colgroup>
  119. <tbody></tbody>
  120. </table>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <script src="../js/jquery.min.js?v=2.1.4"></script>
  127. <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  128. <script src="../js/jquery.cookie.js"></script>
  129. <script src="../css/laydate/laydate.js"></script>
  130. <script src="../js/select2/js/select2.min.js"></script>
  131. <script>
  132. $(function () {
  133. var token = $.cookie("token");
  134. laydate.skin('blue');
  135. laydate({
  136. elem: '#startTime',
  137. event: 'focus',
  138. format: 'YYYY-MM-DD' // 分隔符可以任意定义,该例子表示只显示年月
  139. });
  140. laydate({
  141. elem: '#endTime',
  142. event: 'focus',
  143. format: 'YYYY-MM-DD',// 分隔符可以任意定义,该例子表示只显示年月
  144. });
  145. var stime,//开始时间
  146. endtime,//结束时间
  147. dpt;//部门
  148. //部门下拉数据
  149. $("#bumen").select2({
  150. width: 'resolve',
  151. minimumResultsForSearch: -1,
  152. ajax: {
  153. type: "get",
  154. url: huayi.config.callcenter_url + "Department/GetDeptListtree",
  155. async: true,
  156. dataType: "json",
  157. data: function (params) {
  158. return {
  159. token: token,
  160. pid: params.id
  161. }
  162. },
  163. processResults: function (data) {
  164. return {
  165. results: data.data
  166. }
  167. },
  168. cache: true
  169. },
  170. placeholder: "请选择",
  171. });
  172. Ajax();
  173. //搜索事件
  174. $(".sear").click(function () {
  175. $('.thTable tbody').html('');
  176. stime = $('#startTime').val();//开始时间
  177. endtime = $('#endTime').val();//结束时间
  178. dpt = $('#bumen').val(); //部门
  179. if (stime != '' && endtime != '') {
  180. Ajax(stime, endtime, dpt);
  181. } else {
  182. Ajax();
  183. if (stime == '') {
  184. layer.confirm('请选择开始时间!', {
  185. btn: ['确定']
  186. });
  187. return;
  188. } else if (endtime == '') {
  189. layer.confirm('请选择结束时间!', {
  190. btn: ['确定']
  191. });
  192. return;
  193. }
  194. }
  195. });
  196. //导出
  197. $('.export').click(function () {
  198. stime = $('#startTime').val();//开始时间
  199. endtime = $('#endTime').val();//结束时间
  200. if (stime != '' && endtime != '') {
  201. dcexcel(this);
  202. } else {
  203. if (stime == '') {
  204. layer.confirm('请选择开始时间!', {
  205. btn: ['确定']
  206. });
  207. //return;
  208. } else if (endtime == '') {
  209. layer.confirm('请选择结束时间!', {
  210. btn: ['确定']
  211. });
  212. //return;
  213. }
  214. }
  215. })
  216. function dcexcel(obj) {
  217. var dpt = "";
  218. if ($("#bumen").val())
  219. dpt = $("#bumen").val();
  220. var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + $.cookie("token");
  221. url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val() + "&dpt=" + dpt + "&dayss=" + $("#dayss").val();
  222. obj.href = url;
  223. }
  224. //表头
  225. $.ajax({
  226. type: 'get',
  227. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetColumnList",
  228. async: true,
  229. dataType: 'json',
  230. data: {
  231. token: token
  232. },
  233. success: function (res) {
  234. $('#thead thead tr').html('');
  235. var con = res.data;
  236. // console.log(con);
  237. for (var i = 0; i < con.length; i++) {
  238. $('<th>' + con[i] + '</th>').appendTo('#thead thead tr')
  239. }
  240. }
  241. })
  242. //表内数据
  243. function Ajax(stime, endtime, dpt, dayss) {
  244. $.ajax({
  245. type: "get",
  246. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetDataList",
  247. async: true,
  248. dataType: 'json',
  249. data: {
  250. stime: stime,
  251. endtime: endtime,
  252. dpt: dpt,
  253. dayss: dayss,
  254. token: token
  255. },
  256. success: function (res) {
  257. var result = res.data;
  258. $('.thTable tbody').html('');
  259. for (var i = 0; i < result.length; i++) {
  260. //$('<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></tr>').appendTo('.thTable tbody')
  261. $('<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></tr>').appendTo('.thTable tbody')
  262. }
  263. }
  264. });
  265. }
  266. })
  267. </script>
  268. </body>
  269. </html>