Нет описания

callTime.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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. <script src="Script/Common/huayi.load.js"></script>
  7. <script src="Script/Common/huayi.config.js"></script>
  8. <title>通话时长</title>
  9. <!--[if lt IE 9]>
  10. <meta http-equiv="refresh" content="0;ie.html" />
  11. <![endif]-->
  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="./css/huTotal.css" />-->
  18. <link rel="stylesheet" href="./css/init.css" />
  19. <style>
  20. .clearfix:after {
  21. content: "";
  22. display: block;
  23. clear: both;
  24. }
  25. .th-top{
  26. background: #f3f3f4;
  27. height: 60px;
  28. padding: 10px 20px;
  29. }
  30. .topCon{
  31. float: right;
  32. margin-right: 45px;
  33. }
  34. .th-content h2{
  35. font-size: 22px;
  36. /*margin-bottom: 20px;*/
  37. }
  38. .topCon input{
  39. width: 128px;
  40. padding: 2px 2PX 2PX 10PX;
  41. height: 28px;
  42. border: 1px solid #ebebeb;
  43. color: #1ab394;
  44. outline: none;
  45. vertical-align: middle;
  46. }
  47. .th-content{
  48. width: 90%;
  49. margin: 0 auto;
  50. }
  51. .th-table table thead tr td {
  52. background: #1ab394;
  53. color: #fff;
  54. }
  55. .th-table{
  56. display: none;
  57. }
  58. </style>
  59. </head>
  60. <body class="gray-bg" style="background: #fefefe;">
  61. <div class="thTime">
  62. <div class="daoHang clearfix">
  63. <div class="dhLeft">
  64. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表分析</a>&gt;<a href="javaScript:;">话务运营分析</a>&gt;<a href="" class="nowPosition">通话时长统计</a></sapn>
  65. </div>
  66. <div class="dhRight">
  67. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  68. </div>
  69. </div>
  70. <div class="th-top clearfix">
  71. <div class="topCon">
  72. 开始时间:
  73. <input type="text" class="laydate-icon" id="startTime"/>
  74. 结束时间:
  75. <input type="text" class="laydate-icon" id="endTime"/>
  76. <button class="btns sear">搜索</button>
  77. <a class="btns export">导出</a>
  78. </div>
  79. </div>
  80. <ul class="nav nav-tabs th-tab">
  81. <li role="presentation" class="active"><a href="javascript:;">图形</a></li>
  82. <li role="presentation"><a href="javascript:;">表格</a></li>
  83. </ul>
  84. <div class="th-content">
  85. <div class="th-tu" style="width: 100%;">
  86. <h2 style="text-align: center;">服务热线坐席通话时长统计</h2>
  87. <div id="tabtu" style="width: 100%; height: 500px;"></div>
  88. </div>
  89. <div class="th-table">
  90. <h2 style="text-align: center;">热线坐席通话时长统计</h2>
  91. <table class="table table-bordered text-center table-hover thTable" style="width: 100%;">
  92. <thead>
  93. <tr>
  94. <!--<td>坐席名称</td>
  95. <td>呼入次数</td>
  96. <td>呼出次数</td>
  97. <td>通话总时长</td>
  98. <td>平均通话时长</td>-->
  99. </tr>
  100. </thead>
  101. <tbody class="tbody">
  102. </tbody>
  103. </table>
  104. </div>
  105. </div>
  106. </div>
  107. <script src="./js/jquery.min.js?v=2.1.4"></script>
  108. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  109. <script src="./js/jquery.cookie.js"></script>
  110. <script src="./css/laydate/laydate.js"></script>
  111. <script src="./js/echarts.common.min.js"></script>
  112. <!--<script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>-->
  113. <script>
  114. $(function(){
  115. var token = $.cookie("token");
  116. laydate.skin('molv');
  117. laydate({
  118. elem: '#startTime',
  119. event: 'focus',
  120. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  121. // festival: true, //显示节日
  122. choose: function(datas){ //选择日期完毕的回调
  123. // alert('得到:'+datas);
  124. }
  125. });
  126. laydate({
  127. elem: '#endTime',
  128. event: 'focus',
  129. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  130. });
  131. var stime,//开始时间
  132. endtime,//结束时间
  133. aa=true,
  134. tabtu,
  135. legend=[],//图例
  136. zxn,//坐席名称
  137. callIn,//呼入次数
  138. callInTime,//呼入时长
  139. callOut,//呼出次数
  140. callOutTime,//呼出时长
  141. hcNoCount,//呼出未接通次数
  142. zhenLing,//振铃时长
  143. total,//通话总时长
  144. pingjun;//平均通话时长
  145. //tab切换
  146. $('.th-tab li').click(function(){
  147. $(this).addClass('active')
  148. .siblings().removeClass('active');
  149. var index=$(this).index();
  150. $('.th-content >div').eq(index).show()
  151. .siblings().hide();
  152. })
  153. $(document).ready(function(){
  154. //图形
  155. tabtu = echarts.init(document.getElementById('tabtu'));
  156. option = {
  157. tooltip: {
  158. trigger: 'axis',
  159. },
  160. legend: {
  161. data: legend,
  162. bottom: 0
  163. },
  164. xAxis: [{
  165. type: 'category',
  166. data: zxn,
  167. axisPointer: {
  168. type: ''
  169. }
  170. }],
  171. yAxis: [{
  172. type: 'value',
  173. name: '通话次数(通)',
  174. nameLocation:'middle',
  175. nameGap:35,
  176. // min: 0,
  177. // max:300,
  178. interval: 50,
  179. axisLabel: {
  180. formatter: '{value} '
  181. }
  182. },
  183. {
  184. type: 'value',
  185. name: '通话时长(s)',
  186. nameLocation:'middle',
  187. nameGap:35,
  188. // min: 0,
  189. // max: 150,
  190. interval: 100,
  191. axisLabel: {
  192. formatter: '{value} '
  193. }
  194. }
  195. ],
  196. series: [{
  197. type: 'bar',
  198. name: '呼入次数',
  199. data: callIn
  200. },{
  201. type: 'line',
  202. name: '呼入时长',
  203. yAxisIndex: 1,
  204. data: callInTime
  205. },
  206. {
  207. type: 'bar',
  208. name: '呼出次数',
  209. data: callOut
  210. },{
  211. type: 'line',
  212. name: '呼出时长',
  213. yAxisIndex: 1,
  214. data: callOutTime
  215. },{
  216. type: 'bar',
  217. name: '呼出未接通次数',
  218. data: hcNoCount
  219. },{
  220. type: 'line',
  221. name: '振铃时长',
  222. yAxisIndex: 1,
  223. data: zhenLing
  224. },
  225. {
  226. type: 'line',
  227. name: '通话总时长',
  228. yAxisIndex: 1,
  229. data: total
  230. },
  231. {
  232. type: 'line',
  233. name: '平均通话时长',
  234. yAxisIndex: 1,
  235. data: pingjun
  236. }
  237. ],
  238. color: ['#1ab394', '#fbbe5b', '#88ebc4', '#fa957f','#cddc39','#ff5722','#e91e63','#673ab7']
  239. };
  240. Ajax();
  241. tabtu.setOption(option);
  242. })
  243. //表头数据
  244. var con;
  245. $.ajax({
  246. type:"get",
  247. url:huayi.config.callcenter_url+"TalkTime/GetColumnList",
  248. async:false,
  249. dataType:'json',
  250. data:{
  251. token:token
  252. },
  253. success:function(res){
  254. con=res.data;
  255. //console.log(con);
  256. for(var i=0;i<con.length;i++){
  257. $('<td>' + con[i]+ '</td>').appendTo('.thTable thead tr')
  258. }
  259. return con
  260. }
  261. });
  262. legend=con;
  263. //搜索事件
  264. $(".sear").click(function(){
  265. $('.thTable tbody').html('');
  266. stime=$("#startTime").val();
  267. endtime=$("#endTime").val();
  268. Ajax(stime,endtime);
  269. tabtu.setOption(option);
  270. });
  271. //导出功能
  272. $('.export').click(function() {
  273. dcexcel(this);
  274. })
  275. function dcexcel(obj) {
  276. var url = huayi.config.callcenter_url + "TalkTime/ExptList?token=" + $.cookie("token");
  277. url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val();
  278. obj.href = url;
  279. }
  280. //表格数据
  281. function Ajax(stime,endtime){
  282. var zx_name=[],
  283. huru=[],
  284. huruTime=[],
  285. huchu=[],
  286. huchuTime=[],
  287. hcNo=[],
  288. zlTime=[],
  289. allCall=[],
  290. averange=[];
  291. $.ajax({
  292. type:'get',
  293. url:huayi.config.callcenter_url+'TalkTime/GetDataList',
  294. async:false,
  295. dataType:'json',
  296. data:{
  297. token:token,
  298. stime:stime,
  299. endtime:endtime
  300. },
  301. success:function(data) {
  302. var tbodyCon=data.data;
  303. console.log(tbodyCon);
  304. for(var j=0;j<tbodyCon.length;j++){
  305. $('<tr><td>' + tbodyCon[j].坐席名称+ '</td><td>' + tbodyCon[j].呼入次数+ '</td><td>' + tbodyCon[j].呼入时长+ '</td><td>' + tbodyCon[j].呼出次数+ '</td><td>' + tbodyCon[j].呼出时长+ '</td><td>' + tbodyCon[j].呼出未接通次数+ '</td><td>' + tbodyCon[j].振铃时长+ '</td><td>' + tbodyCon[j].通话总时长+ '</td><td>' + tbodyCon[j].平均通话总时长+ '</td></tr>').appendTo('.thTable tbody')
  306. zx_name.push(tbodyCon[j].坐席名称);
  307. huru.push(tbodyCon[j].呼入次数)
  308. huruTime.push(tbodyCon[j].呼入时长)
  309. huchu.push(tbodyCon[j].呼出次数)
  310. huchuTime.push(tbodyCon[j].呼出时长)
  311. hcNo.push(tbodyCon[j].呼出未接通次数)
  312. zlTime.push(tbodyCon[j].振铃时长)
  313. allCall.push(tbodyCon[j].通话总时长)
  314. averange.push(tbodyCon[j].平均通话总时长)
  315. }
  316. }
  317. });
  318. // console.log(leg);
  319. // legend=leg;//图例
  320. zxn=zx_name;
  321. callIn=huru;//呼入次数
  322. callInTime= huruTime;//呼入时长
  323. callOut=huchu;//呼出次数
  324. callOutTime=huchuTime;//呼出时长
  325. hcNoCount=hcNo;//呼出未接通次数
  326. zhenLing=zlTime;//振铃时长
  327. total=allCall;//通话总时长
  328. pingjun=averange;//平均通话时长
  329. //console.log(zxn);
  330. option.xAxis[0].data=zxn;
  331. option.series[0].data=callIn;
  332. option.series[1].data=callInTime;
  333. option.series[2].data=callOut;
  334. option.series[3].data=callOutTime;
  335. option.series[4].data=hcNoCount;
  336. option.series[5].data=zhenLing;
  337. option.series[6].data=total;
  338. option.series[7].data=pingjun;
  339. }
  340. })
  341. </script>
  342. </body>
  343. </html>