| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- /**
- * 坐席工作报表
- * */
- $(function() {
- $('.tool_bars').authorizeButton();
- laydate.render({
- elem: '#chooseTime',
- theme: '#249fea',
- range: '~',
- });
-
- //部门下拉数据
- getDeptLists();
- getDataList();
- //搜索事件
- $("#sc_btns").click(function() {
- if($.trim($("#monthDays").val()) != ''){
- if (!regexs.phoneNum.test($.trim($("#monthDays").val()))) {
- layer.confirm('月工作天数必须是正整数!', {
- icon: 2,
- btn: ['确定'] //按钮
- });
- return;
- }
- }
- $('.thTable tbody').html('');
- getDataList();
- });
- $('#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');
- });
- })
- //导出
- function btn_export() {
- var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + $.cookie("token");
- var st = $('#chooseTime').val() && $('#chooseTime').val().split(' ~ ')[0];
- var et = $('#chooseTime').val() && $('#chooseTime').val().split(' ~ ')[1];
- url += "&stime=" + st + "&endtime=" + et + "&dpt=" + $("#department").val() + "&dayss=" + $("#monthDays").val();
- window.location.href = url;
- }
- //表头
- function getColumnList() {
- $.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 getDataList() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetDataList",
- async: true,
- dataType: 'json',
- data: {
- stime: $('#chooseTime').val() && $('#chooseTime').val().split(' ~ ')[0],
- endtime: $('#chooseTime').val() && $('#chooseTime').val().split(' ~ ')[1],
- dpt: $("#department").val(),
- dayss: $("#monthDays").val(),
- token: $.cookie("token")
- },
- success: function(res) {
- var result = res.data;
- if(result){
- 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><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/GetDeptList', {
- token: $.cookie("token")
- }, function (result) {
- 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: 'fa fa-folder-o',
- 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();
- });
- }
- })
- }
|