安图前端代码

riTongHuaTime.html 6.0KB

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. <!--[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="js/select2/css/select2.min.css" />
  17. <link rel="stylesheet" href="css/init.css" />
  18. <style>
  19. .clearfix:after {
  20. content: "";
  21. display: block;
  22. clear: both;
  23. }
  24. .zxt-top {
  25. background: #f3f3f4;
  26. height: 60px;
  27. padding: 10px 20px;
  28. }
  29. .topCon {
  30. float: right;
  31. margin-right: 45px;
  32. }
  33. .zxt-content {
  34. width: 95%;
  35. margin: 0 auto;
  36. }
  37. .zxt-table table {
  38. font-size: 12px;
  39. margin-top: 20px;
  40. }
  41. .zxt-table table thead tr td {
  42. background: #1ab394;
  43. color: #fff;
  44. }
  45. </style>
  46. </head>
  47. <body class="gray-bg" style="background: #fefefe;">
  48. <div class="zxtable">
  49. <div class="daoHang clearfix">
  50. <div class="dhLeft">
  51. <sapn><i class="syIcon"></i>位置:
  52. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  53. <a href="javaScript:;">报表分析</a>&gt;
  54. <a href="javaScript:;">员工考核分析</a>&gt;
  55. <a href="" class="nowPosition">日通话时长统计</a>
  56. </sapn>
  57. </div>
  58. <div class="dhRight">
  59. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  60. </div>
  61. </div>
  62. <div class="zxt-top clearfix">
  63. <div class="topCon">
  64. <div class="form-inline th-bar clearfix">
  65. <div class="time-box form-group" >
  66. <i class="tub fa fa-calendar"></i>
  67. <input class="form-control" type="text" id="startTime" placeholder="起始时间" style="width: 228px;">
  68. </div>
  69. <div class="time-box form-group" >
  70. <select name="" id="zuoxi" class="form-control"></select>
  71. </div>
  72. <div class="form-group tool_bars pull-right">
  73. <button class="btns sear">搜索</button>
  74. <a class="btns export">导出</a>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="zxt-content">
  80. <div class="zxt-table">
  81. <table class="table table-bordered text-center thTable table-hover" style="width: 100%;">
  82. <thead>
  83. <tr>
  84. </tr>
  85. </thead>
  86. <tbody class="tbody">
  87. </tbody>
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. <script src="js/jquery.min.js?v=2.1.4"></script>
  93. <script src="js/bootstrap.min.js?v=3.3.6"></script>
  94. <script src="js/jquery.cookie.js"></script>
  95. <script src="js/laydate/laydate.js"></script>
  96. <script src="js/select2/js/select2.min.js"></script>
  97. <script>
  98. $(function() {
  99. var token = $.cookie("token");
  100. var seatlist;
  101. //日期
  102. laydate.render({
  103. elem: '#startTime',
  104. range: '~',
  105. theme: '#00a1cb',
  106. });
  107. Ajax();
  108. //搜索事件
  109. $(".sear").click(function() {
  110. if($('#startTime').val()= '') {
  111. layer.confirm('请选择时间!', {
  112. btn: ['确定']
  113. });
  114. }
  115. Ajax();
  116. });
  117. //导出
  118. $('.export').click(function() {
  119. dcexcel(this);
  120. })
  121. function dcexcel(obj) {
  122. var url = huayi.config.callcenter_url + "DaysTalkTime/ExptList?token=" + $.cookie("token");
  123. url += "&stime=" + $('#startTime').val() && $('#startTime').val().split('~')[0] + "&endtime=" + $('#startTime').val() && $('#startTime').val().split('~')[1] + "&usercode=" + $("#zuoxi option:selected").val();
  124. obj.href = url;
  125. }
  126. //获取坐席
  127. $.getJSON(huayi.config.callcenter_url + "UserAccount/GetSeatList", {
  128. "token": token
  129. }, function(result) {
  130. if(result.state.toLowerCase() == "success") {
  131. seatlist = result.data;
  132. bindseat($("#zuoxi"));
  133. // bindseat($("#usercode"));
  134. }
  135. });
  136. //坐席列表
  137. function bindseat(obj) {
  138. obj.empty();
  139. obj.append('<option value="">请选择坐席</option>');
  140. $(seatlist).each(function(i, n) {
  141. obj.append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  142. })
  143. }
  144. //表头
  145. $.ajax({
  146. type: 'get',
  147. url: huayi.config.callcenter_url + "DaysTalkTime/GetColumnList",
  148. async: true,
  149. dataType: 'json',
  150. data: {
  151. token: token
  152. },
  153. success: function(res) {
  154. var con = res.data;
  155. $('.thTable thead tr').html('');
  156. if(res.state.toLowerCase() == "success") {
  157. for(var i = 0; i < con.length; i++) {
  158. $('<td>' + con[i] + '</td>').appendTo('.thTable thead tr')
  159. }
  160. }
  161. }
  162. })
  163. //表内数据
  164. function Ajax(stime, endtime, zuoxi) {
  165. $.ajax({
  166. type: "get",
  167. url: huayi.config.callcenter_url + "DaysTalkTime/GetDataList",
  168. async: true,
  169. dataType: 'json',
  170. data: {
  171. stime: $('#startTime').val() && $('#startTime').val().split('~')[0],
  172. endtime: $('#startTime').val() && $('#startTime').val().split('~')[1],
  173. usercode: $("#zuoxi option:selected").val(),
  174. token: $.cookie("token")
  175. },
  176. success: function(res) {
  177. var result = res.data;
  178. $('.thTable tbody').html('');
  179. if(res.state.toLowerCase() == "success") {
  180. for(var i = 0; i < result.length; i++) {
  181. $('<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 style="color:#e43926;font-weight: bold;">' + result[i].通话总时长 + '</td><td style="color:#e43926;font-weight: bold;">' + result[i].平均通话总时长 + '</td></tr>').appendTo('.thTable tbody')
  182. }
  183. }
  184. }
  185. });
  186. }
  187. })
  188. </script>
  189. </body>
  190. </html>