周口人民医院呼叫中心前端

riTongHuaTime.html 6.2KB

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