| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>坐席工作报表</title>
- <!--[if lt IE 9]>
- <meta http-equiv="refresh" content="0;ie.html" />
- <![endif]-->
- <script src="Script/Common/huayi.load.js"></script>
- <script src="Script/Common/huayi.config.js"></script>
- <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/init.css" />
- <link rel="stylesheet" type="text/css" href="./js/bootstrap-treeview/bootstrap-treeview.min.css" />
- <style>
- .clearfix:after {
- content: "";
- display: block;
- clear: both;
- }
-
- .zxt-top {
- background: #f3f3f4;
- height: 60px;
- padding: 10px 20px;
- }
-
- .topCon {
- float: right;
- margin-right: 45px;
- }
-
- .topCon select {
- padding: 2px;
- height: 28px;
- border: 1px solid #ebebeb;
- color: #1ab394;
- outline: none;
- vertical-align: middle;
- }
-
- .topCon input {
- width: 128px;
- padding: 2px 2PX 2PX 10PX;
- height: 28px;
- border: 1px solid #ebebeb;
- color: #1ab394;
- outline: none;
- vertical-align: middle;
- }
-
- .zxt-content {
- width: 95%;
- margin: 0 auto;
- }
-
- .zxt-table table {
- font-size: 12px;
- margin-top: 20px;
- }
-
- .zxt-table table thead tr td {
- background: #1ab394;
- color: #fff;
- }
-
- .drop_down {
- position: relative;
- display: inline-block;
- }
-
- .caret {
- margin: 0 7px 0 -23px;
- }
-
- #deptTreeView {
- width: 280px;
- max-height: 256px;
- overflow-y: auto;
- position: absolute;
- z-index: 2;
- top: 28px;
- left: 0px;
- background-color: #fff;
- }
- </style>
- </head>
- <body class="gray-bg" style="background: #fefefe;">
- <div class="zxtable">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn><i class="syIcon"></i>位置:
- <a id="ReIndex" href="javaScript:;">首页</a>>
- <a href="javaScript:;">报表分析</a>>
- <a href="javaScript:;">员工考核分析</a>>
- <a href="" style="color: #000;">坐席工作报表</a>
- </sapn>
- </div>
- </div>
- <div class="zxt-top clearfix">
- <div class="topCon">
- 部门:
- <div class="drop_down">
- <input type="text" class="" id="department" data-id="-1" placeholder="请选择部门" />
- <span class="caret"></span>
- <div id="deptTreeView" class="hidden"></div>
- </div>
- 工号:
- <input type="text" id="usercode" /> 固话号码:
- <input type="text" id="extensionnumber" /> 开始时间:
- <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
- <input type="text" class="laydate-icon" id="endTime" /> 月工作天数:
- <input type="text" id="dayss" style="width:50px;" />
- <button class="btns sear">搜索</button>
- <a class="btns export">导出</a>
- </div>
- </div>
- <div class="zxt-content">
- <div class="zxt-table">
- <table class="table table-bordered text-center thTable table-hover" style="width: 100%;">
- <thead>
- <tr></tr>
- </thead>
- <tbody class="tbody"></tbody>
- </table>
- </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/bootstrap-treeview/bootstrap-treeview.min.js"></script>
- <script>
- $(function() {
- var token = $.cookie("token");
- laydate.skin('molv');
- laydate({
- elem: '#startTime',
- event: 'focus',
- format: 'YYYY-MM-DD' // 分隔符可以任意定义,该例子表示只显示年月
- });
- laydate({
- elem: '#endTime',
- event: 'focus',
- format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
- });
- var stime, //开始时间
- endtime, //结束时间
- dpt; //部门
- //部门下拉数据
- getDeptLists();
- $('#department').on('focus click', function() {
- $('#deptTreeView').removeClass('hidden').addClass('show');
- });
- $('#department').on('keyup', function() {
- if($(this).val() == '') {
- $('deptTreeView').treeview('uncheckAll', {
- silent: true
- });
- $(this).attr('data-id', '-1');
- }
- });
- $('#department + .caret').on('click', function() {
- $('#deptTreeView').removeClass('hidden').addClass('show');
- });
- $('#deptTreeView').mouseleave(function() {
- $(this).removeClass('show').addClass('hidden');
- });
- Ajax();
- //搜索事件
- $(".sear").click(function() {
- $('.thTable tbody').html('');
- stime = $('#startTime').val(); //开始时间
- endtime = $('#endTime').val(); //结束时间
- dpt = $("#department").attr('data-id'); //部门
- if(stime == '') {
- layer.confirm('请选择开始时间!', {
- btn: ['确定']
- });
- return;
- } else if(endtime == '') {
- layer.confirm('请选择结束时间!', {
- btn: ['确定']
- });
- return;
- } else {
- Ajax(stime, endtime, dpt);
- }
- });
- //导出
- $('.export').click(function() {
- stime = $('#startTime').val(); //开始时间
- endtime = $('#endTime').val(); //结束时间
- dpt = $("#department").attr('data-id'); //部门
- if(dpt == null) {
- layer.confirm('请选择部门!', {
- btn: ['确定']
- });
- return;
- } else if(stime == '') {
- layer.confirm('请选择开始时间!', {
- btn: ['确定']
- });
- return;
- } else if(endtime == '') {
- layer.confirm('请选择结束时间!', {
- btn: ['确定']
- });
- return;
- } else {
- dcexcel(this);
- }
- })
- function dcexcel(obj) {
- var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + $.cookie("token");
- url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val() + "&dpt=" + $("#department").attr('data-id') + "&dayss=" + $("#dayss").val();
- obj.href = url;
- }
- //表头
- $.ajax({
- type: 'get',
- url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetColumnList",
- async: true,
- dataType: 'json',
- data: {
- token: token
- },
- success: function(res) {
- var con = res.data;
- // console.log(con);
- for(var i = 0; i < con.length; i++) {
- $('<td>' + con[i] + '</td>').appendTo('.thTable thead tr')
- }
- }
- })
- //表内数据
- function Ajax(stime, endtime, dpt, dayss) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetDataList",
- async: true,
- dataType: 'json',
- data: {
- stime: stime,
- endtime: endtime,
- dpt: dpt,
- dayss: dayss,
- usercode: $('#usercode').val(),
- extensionnumber: $("#extensionnumber").val(),
- token: token
- },
- success: function(res) {
- var result = res.data;
- for(var i = 0; i < result.length; i++) {
- $('<tr><td>' + result[i].公司 + '</td><td>' + result[i].部门 + '</td><td>' + result[i].坐席工号 + '</td><td>' + result[i].坐席姓名 + '</td><td>' + result[i].角色 + '</td><td>' + result[i].固话号码 + '</td><td>' + result[i].呼入电话数 + '</td><td>' + result[i].接通量 + '</td><td>' + result[i].接通率 + '</td><td>' + result[i].呼入通话分钟数 + '</td><td>' + result[i].呼出电话数 + '</td><td>' + result[i].呼通量 + '</td><td>' + result[i].呼通率 + '</td><td>' + result[i].呼出通话分钟数 + '</td><td>' + result[i].坐席登录次数 + '</td><td>' + result[i].登录时长分钟数 + '</td><td>' + result[i].工作时长分钟数 + '</td><td>' + result[i].平均每天工作小时数 + '</td><td>' + result[i].休息时长分钟数 + '</td><td>' + result[i].质检平均成绩 + '</td></tr>').appendTo('.thTable tbody')
- }
- }
- });
- }
- })
- //获取部门
- function getDeptLists() {
- $.getJSON(huayi.config.callcenter_url + 'Department/GetDeptListForReport', {
- token: $.cookie("token")
- }, function(result) {
- //debugger;
- if(result.state.toLowerCase() == "success") {
- var defaultDatas = result.data;
- var $sTree = $('#deptTreeView').treeview({
- color: "#428bca",
- expandIcon: 'glyphicon glyphicon-chevron-right',
- collapseIcon: 'glyphicon glyphicon-chevron-down',
- nodeIcon: 'glyphicon glyphicon-bookmark',
- data: defaultDatas,
- onNodeSelected: function(event, node) {
- $sTree.treeview('clearSearch');
- $('#department').val(node.text);
- $('#department').attr('data-id', node.id);
- $('#deptTreeView').removeClass('show').addClass('hidden');
- },
- onNodeUnselected: function(event, node) {
- $('#department').val('');
- $('#department').attr('data-id', '-1');
- }
- });
- var findSNodes = function() {
- return $sTree.treeview('search', [$('#department').val(), {
- ignoreCase: false,
- exactMatch: false
- }]);
- };
- $('#department').on('keyup', function(e) {
- var selectableNodes = findSNodes();
- });
- }
- })
- }
- </script>
- </body>
- </html>
|