| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <title>通话时长</title>
- <!--[if lt IE 9]>
- <meta http-equiv="refresh" content="0;ie.html" />
- <![endif]-->
- <link href="../css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
- <link href="../css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
- <link href="../css/animate.min.css" rel="stylesheet">
- <link href="../css/style.min862f.css?v=4.1.0" rel="stylesheet">
- <link rel="stylesheet" href="../css/laydate/need/laydate.css" />
- <!--<link rel="stylesheet" href="./css/huTotal.css" />-->
- <link rel="stylesheet" href="../css/init.css" />
- <style>
- .clearfix:after {
- content: "";
- display: block;
- clear: both;
- }
-
- .th-top {
- background: #f3f3f4;
- height: 60px;
- padding: 10px 20px;
- }
-
- .topCon {
- float: right;
- margin-right: 45px;
- }
-
- .th-content h2 {
- font-size: 22px;
- /*margin-bottom: 20px;*/
- }
-
- .topCon input {
- width: 128px;
- padding: 2px 2PX 2PX 10PX;
- height: 28px;
- border: 1px solid #ebebeb;
- color: #1ab394;
- outline: none;
- vertical-align: middle;
- }
-
- .th-content {
- width: 90%;
- margin: 0 auto;
- }
-
- .th-table table thead tr td {
- background: #00a1cb;
- color: #fff;
- }
-
- .th-table {
- display: none;
- }
-
- #thead thead th {
- background: #00a0cd;
- color: #fff;
- }
-
- table thead,
- tbody tr {
- display: table;
- width: 100%;
- table-layout: fixed;
- }
-
- .table {
- margin-bottom: 0;
- }
- </style>
- </head>
- <body class="gray-bg" style="background: #fefefe;">
- <div class="thTime wrapper wrapper-content animated fadeInRight">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn><i class="syIcon"></i>位置:
- <a id="ReIndex" href="javaScript:;">首页</a>>
- <a href="javaScript:;">报表管理</a>>
- <a href="" class="nowPosition">通话时长统计</a>
- </sapn>
- </div>
- <div class="dhRight">
- <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
- </div>
- </div>
- <div class="toolBar clearfix">
- <div class="toolRight">
- 开始时间:
- <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
- <input type="text" class="laydate-icon" id="endTime" />
- <button class="btns sear">搜索</button>
- <a class="btns export">导出</a>
- </div>
- </div>
- <ul class="nav nav-tabs th-tab">
- <li role="presentation" class="active">
- <a href="javascript:;">图形</a>
- </li>
- <li role="presentation">
- <a href="javascript:;">表格</a>
- </li>
- </ul>
- <div class="th-content">
- <div class="th-tu" style="width: 100%;">
- <h2 style="text-align: center;">服务热线坐席通话时长统计</h2>
- <div id="tabtu" style="width: 100%; height: 600px;"></div>
- </div>
- <div class="th-table">
- <h2 style="text-align: center;">热线坐席通话时长统计</h2>
- <div style="width: 100%;padding: 10px;">
- <div class="table-head">
- <table id="thead" class="table table-hover table-striped table-bordered table-condensed">
- <colgroup>
- <col style="width: 80px;" />
- <col/>
- </colgroup>
- <thead>
- <tr>
- </tr>
- </thead>
- </table>
- </div>
- <div class="table-body">
- <table class="thTable table table-hover table-striped table-bordered table-condensed">
- <colgroup>
- <col style="width: 80px;" />
- <col/>
- </colgroup>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="../js/jquery.min.js?v=2.1.4"></script>
- <script src="../js/bootstrap.min.js?v=3.3.6"></script>
- <script src="../js/jquery.cookie.js"></script>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/echarts.common.min.js"></script>
- <!--<script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>-->
- <script>
- $(function() {
- var token = $.cookie("token");
- laydate.skin('blue');
- laydate({
- elem: '#startTime',
- event: 'focus',
- format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
- // festival: true, //显示节日
- choose: function(datas) { //选择日期完毕的回调
- // alert('得到:'+datas);
- }
- });
- laydate({
- elem: '#endTime',
- event: 'focus',
- format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
- });
- var stime, //开始时间
- endtime, //结束时间
- aa = true,
- tabtu,
- legend = [], //图例
- zxn, //坐席名称
- callIn, //呼入次数
- callInTime, //呼入时长
- callOut, //呼出次数
- callOutTime, //呼出时长
- hcNoCount, //呼出未接通次数
- zhenLing, //振铃时长
- total, //通话总时长
- pingjun; //平均通话时长
- //tab切换
- $('.th-tab li').click(function() {
- $(this).addClass('active')
- .siblings().removeClass('active');
- var index = $(this).index();
- $('.th-content >div').eq(index).show()
- .siblings().hide();
- })
- $(document).ready(function() {
- //图形
- tabtu = echarts.init(document.getElementById('tabtu'));
- option = {
- tooltip: {
- trigger: 'axis',
- },
- legend: {
- data: legend,
- bottom: 0
- },
- xAxis: [{
- type: 'category',
- data: zxn,
- axisPointer: {
- type: ''
- },
- axisLabel: {
-
- interval: 0,
- //rotate: 40
- //formatter: function (value) {
- // return value.split("").join("\n");
- //}
- }
- }],
- dataZoom: {
- show: true,
- realtime: true,
- y: 36,
- height: 20,
- start: 43,
- end: 57
- },
- yAxis: [{
- type: 'value',
- name: '通话次数(通)',
- nameLocation: 'middle',
- nameGap: 50,
- // min: 0,
- // max:200,
- // interval: 20,
- axisLabel: {
- formatter: '{value} '
- }
- },
- {
- type: 'value',
- name: '通话时长(分)',
- nameLocation: 'middle',
- nameGap: 50,
- // min: 0,
- // max: 100000,
- // interval: 5000,
- axisLabel: {
- rotate: -50,
- formatter: '{value} '
- }
- }
- ],
- series: [{
- type: 'bar',
- name: '呼入次数',
- data: callIn
- }, {
- type: 'line',
- name: '呼入时长',
- yAxisIndex: 1,
- data: callInTime
- },
- {
- type: 'bar',
- name: '呼出次数',
- data: callOut
- }, {
- type: 'line',
- name: '呼出时长',
- yAxisIndex: 1,
- data: callOutTime
- }, {
- type: 'bar',
- name: '呼出未接通次数',
- data: hcNoCount
- }, {
- type: 'line',
- name: '振铃时长',
- yAxisIndex: 1,
- data: zhenLing
- },
- {
- type: 'line',
- name: '通话总时长',
- yAxisIndex: 1,
- data: total
- },
- {
- type: 'line',
- name: '平均通话时长',
- yAxisIndex: 1,
- data: pingjun
- }
- ],
- color: ['#1ab394', '#fbbe5b', '#88ebc4', '#fa957f', '#cddc39', '#ff5722', '#e91e63', '#673ab7']
- };
- Ajax();
- tabtu.setOption(option);
- })
- //表头数据
- var con;
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "TalkTime/GetColumnList",
- async: false,
- dataType: 'json',
- data: {
- token: token
- },
- success: function(res) {
- con = res.data;
- $('#thead thead tr').html('');
- for(var i = 0; i < con.length; i++) {
- $('<th>' + con[i] + '</th>').appendTo('#thead thead tr')
- }
- return con
- }
- });
- legend = con;
- //搜索事件
- $(".sear").click(function() {
- $('.thTable tbody').html('');
- stime = $("#startTime").val();
- endtime = $("#endTime").val();
- Ajax(stime, endtime);
- tabtu.setOption(option);
- });
- //导出功能
- $('.export').click(function() {
- dcexcel(this);
- })
- function dcexcel(obj) {
- var url = huayi.config.callcenter_url + "TalkTime/ExptList?token=" + $.cookie("token");
- url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val();
- obj.href = url;
- }
- //表格数据
- function Ajax(stime, endtime) {
- var zx_name = [],
- huru = [],
- huruTime = [],
- huchu = [],
- huchuTime = [],
- hcNo = [],
- zlTime = [],
- allCall = [],
- averange = [];
- $.ajax({
- type: 'get',
- url: huayi.config.callcenter_url + 'TalkTime/GetDataList',
- async: false,
- dataType: 'json',
- data: {
- token: token,
- stime: stime,
- endtime: endtime
- },
- success: function(data) {
- var tbodyCon = data.data;
- $('.thTable tbody').html('');
- for(var j = 0; j < tbodyCon.length; j++) {
- $('<tr><td>' + tbodyCon[j].坐席名称 + '</td><td>' + tbodyCon[j].呼入次数 + '</td><td>' + studyTime(tbodyCon[j].呼入时长) + '</td><td>' + tbodyCon[j].呼出次数 + '</td><td>' + studyTime(tbodyCon[j].呼出时长) + '</td><td>' + tbodyCon[j].呼出未接通次数 + '</td><td>' + studyTime(tbodyCon[j].振铃时长) + '</td><td>' + studyTime(tbodyCon[j].通话总时长) + '</td><td>' + studyTime(tbodyCon[j].平均通话总时长) + '</td></tr>').appendTo('.thTable tbody')
- zx_name.push(tbodyCon[j].坐席名称);
- huru.push(tbodyCon[j].呼入次数)
- huruTime.push(((tbodyCon[j].呼入时长 / 60).toFixed(2)) * 1)
- huchu.push(tbodyCon[j].呼出次数)
- huchuTime.push(((tbodyCon[j].呼出时长 / 60).toFixed(2)) * 1)
- hcNo.push(tbodyCon[j].呼出未接通次数)
- zlTime.push(((tbodyCon[j].振铃时长 / 60).toFixed(2)) * 1)
- allCall.push(((tbodyCon[j].通话总时长 / 60).toFixed(2)) * 1)
- averange.push(((tbodyCon[j].平均通话总时长 / 60).toFixed(2)) * 1)
- }
- }
- });
- // console.log(leg);
- // legend=leg;//图例
- zxn = zx_name;
- callIn = huru; //呼入次数
- callInTime = huruTime; //呼入时长
- callOut = huchu; //呼出次数
- callOutTime = huchuTime; //呼出时长
- hcNoCount = hcNo; //呼出未接通次数
- zhenLing = zlTime; //振铃时长
- total = allCall; //通话总时长
- pingjun = averange; //平均通话时长
- //console.log(zxn);
- option.xAxis[0].data = zxn;
- option.series[0].data = callIn;
- option.series[1].data = callInTime;
- option.series[2].data = callOut;
- option.series[3].data = callOutTime;
- option.series[4].data = hcNoCount;
- option.series[5].data = zhenLing;
- option.series[6].data = total;
- option.series[7].data = pingjun;
- }
- })
- var hour = 0,
- minute = 0,
- second = 0;
- function studyTime(t) {
- console.log(t)
- hour = Math.floor(t / 60 / 60);
- minute = Math.floor(t / 60 % 60);
- second = Math.floor(t % 60);
- if(hour < 10) {
- hour = "0" + hour;
- }
- if(minute < 10) {
- minute = "0" + minute;
- }
- if(second < 10) {
- second = "0" + second;
- }
- return hour + ":" + minute + ":" + second;
- }
- </script>
- </body>
- </html>
|