睢县12345_前端

dayHuaWu.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>话务受理日周月报表</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../css/init.css" rel="stylesheet" />
  8. <!--<link href="../css/Table/table1.css" rel="stylesheet" />-->
  9. <script src="../Script/Common/huayi.load.js"></script>
  10. <script src="../Script/Common/huayi.config.js"></script>
  11. <script src="../My97DatePicker/WdatePicker.js"></script>
  12. <script src="../js/laydate/laydate.js"></script>
  13. <style>
  14. body {
  15. font-family: "微软雅黑";
  16. font-size: 14px;
  17. }
  18. ul li {
  19. list-style: none;
  20. float: left;
  21. }
  22. .fr {
  23. float: right;
  24. }
  25. #list thead tr th{
  26. background: #01a1cb;
  27. color: #fff;
  28. }
  29. </style>
  30. </head>
  31. <body class="gray-bg">
  32. <div class="daoHang clearfix">
  33. <div class="dhLeft">
  34. <sapn><i class="syIcon"></i>位置:<a href="javaScript:;" id="ReIndex">首页</a>&gt;<a href="javaScript:;">报表管理</a>&gt;<a href="" class="nowPosition">话务受理日周月报表</a></sapn>
  35. </div>
  36. <div class="dhRight">
  37. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  38. </div>
  39. </div>
  40. <div class="wrapper wrapper-content">
  41. <div class="th-top clearfix">
  42. <div class="form-inline th-bar clearfix">
  43. <div class="time-box form-group" >
  44. <i class="tub fa fa-calendar"></i>
  45. <input class="form-control" type="text" id="startTime" placeholder="起始时间" style="width: 220px;">
  46. </div>
  47. <div class="time-box form-group" >
  48. <select class="select_ dataType form-control">
  49. <option value="">请选择时间类型</option>
  50. <option value="0" selected="selected">日</option>
  51. <option value="1">周</option>
  52. <option value="2">月</option>
  53. </select>
  54. </div>
  55. <div class="form-group tool_bars pull-right">
  56. <button class="btns search">搜索</button>
  57. <a class="btns export">导出</a>
  58. </div>
  59. </div>
  60. </div>
  61. <div style="width: 100%;padding: 10px;">
  62. <table id="list" class="table table-hover table-striped table-bordered table-condensed">
  63. <thead>
  64. <tr>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. </tbody>
  69. </table>
  70. <!--高级搜索框-->
  71. </div>
  72. </div>
  73. <script>
  74. $(document).ready(function () {
  75. var usercode;//工号
  76. laydate.render({
  77. elem: '#startTime',
  78. range: '~',
  79. theme: '#00a1cb',
  80. });
  81. tableHead();//表头数据
  82. tableAjax();//表格数据
  83. $('.search').click(function(){
  84. tableAjax()
  85. })
  86. $('.export').click(function(){
  87. dcexcel(this);
  88. })
  89. })
  90. //表头数据
  91. function tableHead(){
  92. //表头
  93. $.ajax({
  94. type:"get",
  95. url:huayi.config.callcenter_url +"TelWOReport/GetColumnList",
  96. async:true,
  97. dataType:'json',
  98. data:{
  99. token:$.cookie("token")
  100. },
  101. success:function(data){
  102. var con=data.data;
  103. if(data.state.toLowerCase()=='success'){
  104. $(con).each(function(i,n){
  105. $('<th>'+n +'</th>').appendTo('#list thead tr')
  106. })
  107. }
  108. }
  109. });
  110. }
  111. //表内数据
  112. function tableAjax(){
  113. $('#list tbody').html('');
  114. $.ajax({
  115. type:"get",
  116. url:huayi.config.callcenter_url +"TelWOReport/GetTrafficReport",
  117. async:true,
  118. dataType:'json',
  119. data:{
  120. token:$.cookie("token"),
  121. btime:$('#startTime').val() && $('#startTime').val().split('~')[0],
  122. etime:$('#startTime').val() && $('#startTime').val().split('~')[1],
  123. type:$('.dataType').val()
  124. // usercode:usercode
  125. },
  126. success:function(data){
  127. var con=data.data;
  128. if(data.state.toLowerCase()=='success'){
  129. $(con).each(function(i,n){
  130. $('<tr><td>' + n.日期 + '</td><td>' + n.接听来电 + '</td><td>' + n.有效来电 + '</td><td>' + n.受理 + '</td><td>' + n.在线办结 + '</td><td>' + n.转派工单 + '</td><td>' + n.办结 + '</td></tr>').appendTo('#list tbody')
  131. })
  132. }
  133. }
  134. });
  135. }
  136. //导出
  137. function dcexcel(obj) {
  138. var url = huayi.config.callcenter_url + "TelWOReport/ExptList?token=" + $.cookie("token");
  139. url += "&btime=" + ($('#startTime').val() ? $('#startTime').val().split('~')[0] : '') + "&etime=" + ($('#startTime').val() ? $('#startTime').val().split('~')[1] : '')+ "&type=" + $(".dataType").val();
  140. obj.href = url;
  141. }
  142. </script>
  143. </body>
  144. </html>