No Description

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