Нет описания

riTongHuaTime.html 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. <link rel="stylesheet" href="js/select2/css/select2.min.css" />
  11. <script src="Script/Common/huayi.load.js"></script>
  12. <script src="Script/Common/huayi.config.js"></script>
  13. <link rel="stylesheet" href="./js/layui/css/layui.css" />
  14. <link rel="stylesheet" href="css/init.css" />
  15. <style>
  16. .zxt-top {
  17. background: #f3f3f4;
  18. height: 60px;
  19. padding: 10px 20px;
  20. }
  21. .topCon {
  22. float: right;
  23. margin-right: 45px;
  24. }
  25. .zxt-content {
  26. width: 95%;
  27. margin: 0 auto;
  28. }
  29. </style>
  30. </head>
  31. <body class="gray-bg" style="background: #fefefe;">
  32. <div class="zxtable">
  33. <div class="daoHang clearfix">
  34. <div class="dhLeft">
  35. <sapn><i class="syIcon"></i>位置:
  36. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  37. <a href="javaScript:;">报表分析</a>&gt;
  38. <a href="javaScript:;">话务运营分析</a>&gt;
  39. <a href="" class="nowPosition">日通话时长统计</a>
  40. </sapn>
  41. </div>
  42. <div class="dhRight">
  43. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  44. </div>
  45. </div>
  46. <div class="zxt-top clearfix">
  47. <div class="topCon">
  48. <div class="form-inline th-bar clearfix">
  49. <div class="time-box form-group">
  50. <i class="tub fa fa-calendar"></i>
  51. <input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
  52. </div>
  53. <!--<div class="time-box form-group">
  54. 部门:
  55. <select id="bumen">
  56. <option value="">请选择</option>
  57. </select>
  58. </div>-->
  59. <div class="time-box form-group">
  60. <select name="" id="zuoxi" class="form-control"></select>
  61. </div>
  62. <div class="form-group tool_bars pull-right">
  63. <button class="btns sear">搜索</button>
  64. <a class="btns export">导出</a>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="zxt-content">
  70. <table class="layui-hide" id="t_callTotal"></table>
  71. </div>
  72. </div>
  73. <script src="js/layui/layui.js"></script>
  74. <script src="./js/select2/js/select2.min.js"></script>
  75. <script>
  76. var token = $.cookie("token");
  77. $(function() {
  78. bindseat(); //获取坐席
  79. layui.use('laydate', function() {
  80. var laydate = layui.laydate;
  81. //日期
  82. laydate.render({
  83. elem: '#startTime',
  84. range: '~',
  85. theme: '#1ab394',
  86. calendar: 'true'
  87. });
  88. });
  89. //helper.getDropList.getDept($('#bumen'));//获取部门
  90. getTableDataList(); //获取表格数据
  91. //搜索事件
  92. $(".sear").click(function() {
  93. getTableDataList();
  94. });
  95. document.onkeydown = function (e) { // 回车提交表单
  96. var theEvent = window.event || e;
  97. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  98. if (code == 13) {
  99. getTableDataList();
  100. }
  101. }
  102. //导出
  103. $('.export').click(function() {
  104. dcexcel(this);
  105. })
  106. })
  107. //加载表格
  108. function getTableDataList() {
  109. var loadindex = layer.load();
  110. layui.use('table', function() {
  111. var table = layui.table;
  112. //方法级渲染
  113. table.render({
  114. elem: '#t_callTotal',
  115. url: huayi.config.callcenter_url + "DaysTalkTime/GetDataList",
  116. method: 'get', //如果无需自定义HTTP类型,可不加该参数
  117. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  118. even: true, //开启隔行背景
  119. size: 'lg', //sm,lg尺寸的表格
  120. where: {
  121. stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0],
  122. etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1],
  123. //dpt: $('#bumen').val(),
  124. usercode: $("#zuoxi option:selected").val(),
  125. token: token
  126. }, //如果无需传递额外参数,可不加该参数
  127. //request: {}, //如果无需自定义请求参数,可不加该参数
  128. response: {
  129. statusName: 'state', //数据状态的字段名称,默认:code
  130. statusCode: 'success', //成功的状态码,默认:0
  131. msgName: 'message', //状态信息的字段名称,默认:msg
  132. //countName: 'total', //数据总数的字段名称,默认:count
  133. //dataName: 'rows', //数据列表的字段名称,默认:data
  134. }, //如果无需自定义数据响应名称,可不加该参数
  135. cols: [
  136. [{
  137. field: '日期',
  138. title: '日期',
  139. align: 'center',
  140. fixed: true,
  141. sort: true,
  142. width: 150,
  143. }, {
  144. field: '呼入次数',
  145. title: '呼入次数',
  146. align: 'center',
  147. width: '',
  148. },
  149. {
  150. field: '呼入时长',
  151. title: '呼入时长',
  152. align: 'center',
  153. width: '',
  154. },
  155. {
  156. field: '呼出次数',
  157. title: '呼出次数',
  158. align: 'center',
  159. width: '',
  160. },
  161. {
  162. field: '呼出时长',
  163. title: '呼出时长',
  164. align: 'center',
  165. width: '',
  166. },
  167. {
  168. field: '呼出未接通次数',
  169. title: '呼出未接通次数',
  170. align: 'center',
  171. width: '',
  172. },
  173. {
  174. field: '振铃时长',
  175. title: '振铃时长',
  176. align: 'center',
  177. width: '',
  178. },
  179. {
  180. field: '通话总时长',
  181. title: '通话总时长',
  182. align: 'center',
  183. templet: '<div><span class="color_73926">{{d.通话总时长}}</span></div>',
  184. width: '',
  185. },
  186. {
  187. field: '平均通话总时长',
  188. title: '平均通话总时长',
  189. align: 'center',
  190. templet: '<div><span class="color_73926">{{d.平均通话总时长}}</span></div>',
  191. width: '',
  192. },
  193. ]
  194. ],
  195. height: 'full-150',
  196. done:function(){
  197. layer.close(loadindex);
  198. }
  199. });
  200. });
  201. }
  202. //获取坐席
  203. function bindseat() {
  204. $.getJSON(huayi.config.callcenter_url + "UserAccount/GetSeatList", {
  205. token: token
  206. }, function(result) {
  207. if(result.state.toLowerCase() == "success") {
  208. seatlist = result.data;
  209. $("#zuoxi").empty();
  210. $("#zuoxi").append('<option value="">请选择坐席</option>');
  211. $(seatlist).each(function(i, n) {
  212. $("#zuoxi").append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  213. })
  214. }
  215. });
  216. }
  217. function dcexcel(obj) {
  218. var stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  219. var etime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  220. var url = huayi.config.callcenter_url + "DaysTalkTime/ExptList?token=" + token;
  221. url += "&stime=" + stime + "&etime=" + etime + "&usercode=" + $("#zuoxi option:selected").val();
  222. obj.href = url;
  223. }
  224. </script>
  225. </body>
  226. </html>