商丘12345 前端

zuoXiTable.html 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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">
  85. </select>
  86. 开始时间:
  87. <input type="text" class="laydate-icon" id="startTime"/>
  88. 结束时间:
  89. <input type="text" class="laydate-icon" id="endTime" />
  90. 月工作天数:
  91. <input type="text" id="dayss" style="width:150px;" />
  92. <button class="btns sear">搜索</button>
  93. <a class="btns export">导出</a>
  94. </div>
  95. </div>
  96. <!--<div class="zxt-top clearfix">
  97. <div class="topCon">
  98. </div>
  99. </div>-->
  100. <div class="zxt-content">
  101. <div class="zxt-table">
  102. <div style="width: 100%;padding: 10px;">
  103. <div class="table-head">
  104. <table id="thead" class="table table-hover table-striped table-bordered table-condensed">
  105. <colgroup>
  106. <col style="width: 150px;"/>
  107. <col/>
  108. </colgroup>
  109. <thead>
  110. <tr>
  111. </tr>
  112. </thead>
  113. </table>
  114. </div>
  115. <div class="table-body">
  116. <table class="thTable table table-hover table-striped table-bordered table-condensed">
  117. <colgroup>
  118. <col style="width: 150px;"/>
  119. <col/>
  120. </colgroup>
  121. <tbody>
  122. </tbody>
  123. </table>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <script src="../js/jquery.min.js?v=2.1.4"></script>
  130. <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  131. <script src="../js/jquery.cookie.js"></script>
  132. <script src="../css/laydate/laydate.js"></script>
  133. <script src="../js/select2/js/select2.min.js"></script>
  134. <script>
  135. $(function(){
  136. var token = $.cookie("token");
  137. laydate.skin('blue');
  138. laydate({
  139. elem: '#startTime',
  140. event: 'focus',
  141. format: 'YYYY-MM-DD' // 分隔符可以任意定义,该例子表示只显示年月
  142. });
  143. laydate({
  144. elem: '#endTime',
  145. event: 'focus',
  146. format: 'YYYY-MM-DD',// 分隔符可以任意定义,该例子表示只显示年月
  147. });
  148. var stime,//开始时间
  149. endtime,//结束时间
  150. dpt;//部门
  151. //部门下拉数据
  152. $("#bumen").select2({
  153. width: 'resolve' ,
  154. minimumResultsForSearch: -1,
  155. ajax:{
  156. type:"get",
  157. url: huayi.config.callcenter_url + "Department/GetDeptListtree",
  158. async:true,
  159. dataType: "json",
  160. data:function(params){
  161. return{
  162. token:token,
  163. pid:params.id
  164. }
  165. },
  166. processResults:function(data){
  167. return{
  168. results:data.data
  169. }
  170. },
  171. cache: true
  172. },
  173. placeholder: "请选择",
  174. });
  175. Ajax();
  176. //搜索事件
  177. $(".sear").click(function(){
  178. $('.thTable tbody').html('');
  179. stime=$('#startTime').val();//开始时间
  180. endtime=$('#endTime').val();//结束时间
  181. dpt=$('#bumen').val(); //部门
  182. if(stime != '' && endtime != '') {
  183. Ajax(stime,endtime,dpt);
  184. }else{
  185. Ajax();
  186. if(stime==''){
  187. layer.confirm('请选择开始时间!', {
  188. btn: ['确定']
  189. });
  190. return;
  191. }else if(endtime ==''){
  192. layer.confirm('请选择结束时间!', {
  193. btn: ['确定']
  194. });
  195. return;
  196. }
  197. }
  198. });
  199. //导出
  200. $('.export').click(function() {
  201. stime=$('#startTime').val();//开始时间
  202. endtime=$('#endTime').val();//结束时间
  203. if(stime != '' && endtime != '') {
  204. dcexcel(this);
  205. }else{
  206. if(stime==''){
  207. layer.confirm('请选择开始时间!', {
  208. btn: ['确定']
  209. });
  210. //return;
  211. }else if(endtime ==''){
  212. layer.confirm('请选择结束时间!', {
  213. btn: ['确定']
  214. });
  215. //return;
  216. }
  217. }
  218. })
  219. function dcexcel(obj) {
  220. var dpt = "";
  221. if ($("#bumen").val())
  222. dpt = $("#bumen").val();
  223. var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + $.cookie("token");
  224. url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val() + "&dpt=" + dpt + "&dayss=" + $("#dayss").val();
  225. obj.href = url;
  226. }
  227. //表头
  228. $.ajax({
  229. type:'get',
  230. url:huayi.config.callcenter_url+"ZuoXiWorkTotal/GetColumnList",
  231. async:true,
  232. dataType:'json',
  233. data:{
  234. token:token
  235. },
  236. success:function(res){
  237. $('#thead thead tr').html('');
  238. var con=res.data;
  239. // console.log(con);
  240. for(var i=0;i<con.length;i++){
  241. $('<th>' + con[i]+ '</th>').appendTo('#thead thead tr')
  242. }
  243. }
  244. })
  245. //表内数据
  246. function Ajax(stime, endtime, dpt, dayss) {
  247. $.ajax({
  248. type:"get",
  249. url:huayi.config.callcenter_url+"ZuoXiWorkTotal/GetDataList",
  250. async:true,
  251. dataType:'json',
  252. data:{
  253. stime:stime,
  254. endtime: endtime,
  255. dpt: dpt,
  256. dayss: dayss,
  257. token:token
  258. },
  259. success:function(res){
  260. var result=res.data;
  261. $('.thTable tbody').html('');
  262. for(var i = 0; i < result.length; i++) {
  263. $('<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')
  264. }
  265. }
  266. });
  267. }
  268. })
  269. </script>
  270. </body>
  271. </html>