Aucune description

jthusuan.html 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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/init.css" />
  18. <style>
  19. .clearfix:after {
  20. content: "";
  21. display: block;
  22. clear: both;
  23. }
  24. .husun{
  25. font-size: 12px;
  26. }
  27. .th-top{
  28. background: #f3f3f4;
  29. height: 60px;
  30. padding: 10px 20px;
  31. }
  32. .topCon{
  33. float: right;
  34. margin-right: 45px;
  35. }
  36. .th-content h2{
  37. font-size: 18px;
  38. margin-bottom: 20px;
  39. }
  40. .topCon input{
  41. width: 128px;
  42. padding: 2px 2PX 2PX 10PX;
  43. height: 28px;
  44. border: 1px solid #ebebeb;
  45. color: #1ab394;
  46. outline: none;
  47. vertical-align: middle;
  48. }
  49. .th-content{
  50. width: 90%;
  51. margin: 0 auto;
  52. }
  53. .th-table table thead tr td {
  54. background: #1ab394;
  55. color: #fff;
  56. }
  57. .th-table{
  58. display: none;
  59. }
  60. </style>
  61. </head>
  62. <body class="gray-bg" style="background: #fefefe;">
  63. <div class="husun">
  64. <div class="daoHang clearfix">
  65. <div class="dhLeft">
  66. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表分析</a>&gt;<a href="javaScript:;">话务运营分析</a>&gt;<a href="" style="color: #000;">接通呼损统计</a></sapn>
  67. </div>
  68. <div class="dhRight">
  69. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  70. </div>
  71. </div>
  72. <div class="th-top clearfix">
  73. <div class="topCon">
  74. 开始时间:
  75. <input type="text" class="laydate-icon" id="startTime"/>
  76. 结束时间:
  77. <input type="text" class="laydate-icon" id="endTime"/>
  78. <button class="btns sear">搜索</button>
  79. <a class="btns export">导出</a>
  80. </div>
  81. </div>
  82. <ul class="nav nav-tabs th-tab">
  83. <li role="presentation" class="active"><a href="javascript:;">图形</a></li>
  84. <li role="presentation"><a href="javascript:;">表格</a></li>
  85. </ul>
  86. <div class="th-content">
  87. <div class="th-tu">
  88. <h2 style="text-align: center;">服务热线-接通率和呼损率统计</h2>
  89. <div id="tabtu" style="width: 100%; height: 600px;"></div>
  90. </div>
  91. <div class="th-table">
  92. <h2 style="text-align: center;">服务热线-接通率和呼损率统计</h2>
  93. <table class="table table-bordered text-center table-hover thTable" style="width: 100%;">
  94. <thead>
  95. <tr>
  96. </tr>
  97. </thead>
  98. <tbody class="tbody">
  99. </tbody>
  100. </table>
  101. </div>
  102. </div>
  103. </div>
  104. <script src="./js/jquery.min.js?v=2.1.4"></script>
  105. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  106. <script src="./js/jquery.cookie.js"></script>
  107. <script src="./css/laydate/laydate.js"></script>
  108. <script src="./js/echarts.common.min.js"></script>
  109. <script>
  110. $(function(){
  111. var token = $.cookie("token");
  112. var stime,//开始时间
  113. endtime,//结束时间
  114. tabtu,
  115. xzhou,
  116. jtCount,//接通次数
  117. hsCount,//呼损次数
  118. jtPercent,//接通率
  119. hsPercent;//呼损率
  120. laydate.skin('molv');
  121. laydate({
  122. elem: '#startTime',
  123. event: 'focus',
  124. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  125. // festival: true, //显示节日
  126. });
  127. laydate({
  128. elem: '#endTime',
  129. event: 'focus',
  130. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  131. // festival: true, //显示节日
  132. });
  133. //tab切换
  134. $('.th-tab li').click(function(){
  135. $(this).addClass('active')
  136. .siblings().removeClass('active');
  137. var index=$(this).index();
  138. $('.th-content >div').eq(index).show()
  139. .siblings().hide();
  140. })
  141. $(document).ready(function(){
  142. //图形
  143. tabtu = echarts.init(document.getElementById('tabtu'));
  144. option = {
  145. tooltip: {
  146. trigger: 'axis',
  147. },
  148. legend: {
  149. data: ['接通次数', '呼损次数', '接通率', '呼损率'],
  150. bottom: 0
  151. },
  152. xAxis: [{
  153. type: 'category',
  154. data: xzhou,
  155. axisPointer: {
  156. type: ''
  157. },
  158. axisLabel:{
  159. rotate: 30,
  160. interval:0
  161. }
  162. }],
  163. yAxis: [{
  164. type: 'value',
  165. name: '通话次数(通)',
  166. nameLocation:'middle',
  167. nameGap:40,
  168. // min: 0,
  169. // max:300,
  170. interval: 50,
  171. axisLabel: {
  172. formatter: '{value} '
  173. }
  174. },
  175. {
  176. type: 'value',
  177. name: '百分比(%)',
  178. nameLocation:'middle',
  179. nameGap:35,
  180. min: 0,
  181. max: 100,
  182. interval: 10,
  183. axisLabel: {
  184. formatter: '{value} '
  185. }
  186. }
  187. ],
  188. series: [{
  189. type: 'bar',
  190. name: '接通次数',
  191. data: jtCount
  192. },
  193. {
  194. type: 'bar',
  195. name: '呼损次数',
  196. data: hsCount
  197. },
  198. {
  199. type: 'line',
  200. name: '接通率',
  201. data: jtPercent,
  202. yAxisIndex: 1,
  203. },
  204. {
  205. type: 'line',
  206. name: '呼损率',
  207. data: hsPercent,
  208. yAxisIndex: 1,
  209. }
  210. ],
  211. color: ['#1ab394', '#fbbe5b', '#88ebc4', '#fa957f']
  212. };
  213. Ajax();
  214. tabtu.setOption(option);
  215. })
  216. //表头数据
  217. $.ajax({
  218. type:"get",
  219. url:huayi.config.callcenter_url+"SwitchedlossCall/GetColumnList",
  220. async:true,
  221. dataType:'json',
  222. data:{
  223. token:token
  224. },
  225. success:function(res){
  226. var con=res.data;
  227. console.log(con);
  228. for(var i=0;i<con.length;i++){
  229. $('<td>' + con[i]+ '</td>').appendTo('.thTable thead tr')
  230. }
  231. }
  232. });
  233. //搜索事件
  234. $(".sear").click(function(){
  235. $('.thTable tbody').html('');
  236. stime=$("#startTime").val();
  237. endtime=$("#endTime").val();
  238. Ajax(stime,endtime);
  239. tabtu.setOption(option);
  240. });
  241. //导出
  242. $('.export').click(function() {
  243. dcexcel(this);
  244. })
  245. function dcexcel(obj) {
  246. var url = huayi.config.callcenter_url + "SwitchedlossCall/ExptList?token=" + $.cookie("token");
  247. url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val();
  248. obj.href = url;
  249. }
  250. //表格数据
  251. function Ajax(stime,endtime){
  252. var jtshu=[],
  253. hsshu=[],
  254. jtlv=[],
  255. hslv=[],
  256. riqi=[];
  257. $.ajax({
  258. type:'get',
  259. url:huayi.config.callcenter_url+'SwitchedlossCall/GetDataList',
  260. async:false,
  261. dataType:'json',
  262. data:{
  263. token:token,
  264. stime:stime,
  265. endtime:endtime
  266. },
  267. success:function(data) {
  268. var tbodyCon=data.data;
  269. console.log(tbodyCon);
  270. for(var j=0;j<tbodyCon.length;j++){
  271. $('<tr><td>' + tbodyCon[j].日期+ '</td><td>' + tbodyCon[j].接通次数+ '</td><td>' + tbodyCon[j].呼损次数+ '</td><td>' + tbodyCon[j].接通率+ '</td><td>' + tbodyCon[j].呼损率+ '</td></tr>').appendTo('.thTable tbody');
  272. riqi.push(tbodyCon[j].日期)
  273. jtshu.push(tbodyCon[j].坐席名称);
  274. hsshu.push(tbodyCon[j].呼入次数);
  275. jtlv.push(tbodyCon[j].呼出次数);
  276. hslv.push(tbodyCon[j].通话总时长);
  277. }
  278. }
  279. });
  280. xzhou=riqi;
  281. jtCount=jtshu;
  282. hsCount=hsshu;
  283. jtPercent=jtlv;
  284. hsPercent=hslv;
  285. console.log(xzhou);
  286. option.xAxis[0].data=xzhou;
  287. option.series[0].data=jtCount;
  288. option.series[1].data=hsCount;
  289. option.series[2].data=jtPercent;
  290. option.series[3].data=hsPercent;
  291. }
  292. })
  293. </script>
  294. </body>
  295. </html>