| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176 |
- var newData=[] //数据倒序
- var floag=true
- WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
- // 开启flash的websocket debug
- WEB_SOCKET_DEBUG = true;
- var ws, n = 0,
- timer;
- var lockReconnect = false; //避免重复连接
- var obj = {};
- var Statess;
- var cls = 0;
- var lasttime = new Date().getTime();
- var cons;
- var person='';
- // var areaOneVal = helper.cookies.get("areaOneVal");
- // var areaOneText = helper.cookies.get("areaOneText");
- // if (areaOneVal) {
- // var areaOneVal = helper.cookies.get("areaOneVal");
-
- // } else{
- // var areaOneVal="sqs12345"
-
- // }
- //创建scoket连接
- createWebSocket()
- function createWebSocket() {
- try {
- Connect();
- } catch (e) {
- reconnect();
- }
- }
- //连接
- function Connect() {
- ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
- ws.onopen = function () {
- console.log(new Date() + " " + "建立连接");
- //心跳检测重置
- heartCheck.reset().start();
- cls = 0;
- lasttime = new Date().getTime();
-
- join()
- SayBusy()
-
- };
- //接收到消息的回调方法
- ws.onmessage = function (evt) {
- //如果获取到消息,心跳检测重置
- //拿到任何消息都说明当前连接是正常的
- heartCheck.reset().start();
- var myDate = new Date();
- console.log(myDate + " receive " + evt.data);
- var data = JSON.parse(evt.data)[0];
- if (data) {
- var rlt = data.Result;
- var type = data.Type;
- if (rlt == true) {
-
- switch (type.toLowerCase()) {
- case "login":
- LoginBack();
- break; //签入
- }
-
- } else {
- if (rlt == false) {
-
- $(".hwzt").text('操作失败!');
-
- } else {
- $(".hwzt").text(rlt);
- if(type.toLowerCase()=='waitcount') {
- backstageQueue(data);
- }
- }
- }
- }
- };
-
- //连接关闭的回调方法
- ws.onclose = function (evt) {
- if (cls == 0) {
- cls = 1;
- $(".hwzt").text('连接关闭!');
- $("#top-search li i").removeClass("active");
- reconnect();
- }
- };
- //连接发生错误的回调方法
- ws.onerror = function (evt) {
- //产生异常
- $(".hwzt").text('连接出现异常!');
- console.log(ws);
- if (ws == null || ws.readyState != ws.OPEN) {
- console.log(new Date() + "开始重连");
- reconnect();
- }
-
- };
- }
- //重连
- function reconnect() {
-
- if (lockReconnect) return;
- lockReconnect = true;
- //没连接上会一直重连,设置延迟避免请求过多
- setTimeout(function () {
- console.log(new Date() + " " + "重连中……");
- createWebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
- lockReconnect = false;
- SayBusy()
- }, 2000);
- }
-
- //发送
- function Send() {
- if (ws.readyState != ws.OPEN) {
- reconnect();
- }
- if (ws.readyState == ws.OPEN) {
- console.log(new Date() + " send " + JSON.stringify(obj));
- ws.send(JSON.stringify(obj));
- }
- }
- //心跳检测
- var heartCheck = {
- timeout: 25000, //25秒
- timeoutObj: null,
- serverTimeoutObj: null,
- reset: function () {
- clearTimeout(this.timeoutObj);
- clearTimeout(this.serverTimeoutObj);
- return this;
- },
- start: function () {
- var self = this;
- this.timeoutObj = setTimeout(function () {
- //这里发送一个心跳,后端收到后,返回一个心跳消息,
- //onmessage拿到返回的心跳就说明连接正常
- obj.Type = "Heart";
- Send();
- self.serverTimeoutObj = setTimeout(function () { //如果超过一定时间还没重置,说明后端主动断开了
- ws.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
- }, self.timeout)
- }, this.timeout)
- }
- }
- // 签入
- function SayBusy() {
- obj.Type = "SayBusy";
- Send();
- console.log('置忙')
- }
-
- //签入
- function LoginBack() {
- obj.Type = "SayBusy";
- Send();
- console.log('置忙')
- }
- // 点击签入
- function join(){
- obj.Type ='Login',
- obj.AgentID='9898',
- obj.AgentExten='1015',
- obj.AgentType='0',
- obj.AgentGroup='364'
- // console.log(scoketDatas)
- Send()
- }
- //监测
- function SubScribeBack() {
- var obj = $("iframe:visible")
- if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
- window.frames[obj.attr("name")].Start();
- }
- if (obj.attr("data-id") == "./TelCall/zxKong.html") {
- window.frames[obj.attr("name")].Start();
- }
- }
- //取消监测
- function SubScribeCancelBack() {
- $('.yuan_one').addClass("lx")
- $('.yuan_two').addClass("lx")
- }
-
- //后台排队
- function backstageQueue(data) {
- person=data.WaitCount
- console.log(person)
- }
- $(function() {
-
- loginTimeLimit(); //登录
- var mySwiper = new Swiper('.swiper-container', {
- pagination: { /* 分页器*/
- el: '.swiper-pagination',
- clickable: true,
- },
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- on: {
- init: function() {
- swiperAnimateCache(this); //隐藏动画元素
- swiperAnimate(this); //初始化完成开始动画
- },
- transitionEnd: function() {
- swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
- },
- }
- })
- // 跳轉
- $(".nav_middle").click(function(){
- window.open('index.html','_self')
- })
- $("#department").click(function(){
- window.open('receiptDepartment.html','_self')
- })
- $("#sourceChannel").click(function(){
- window.open('sourceChannel.html','_self')
- })
- $("#call").click(function(){
- window.open('TelephoneDetails.html','_self')
- })
- $("#complaint").click(function(){
- window.open('complaintsReport.html','_self')
- })
- // 選項卡
- $(".smallimg").click(function ()
- {
- //获取点击的元素给其添加样式,讲其兄弟元素的样式移除
- $(this).addClass("activeBox").siblings().removeClass("activeBox");
- //获取选中元素的下标
- var index = $(this).index();
- $(".slideCon_bg").eq(index).addClass("slideCon_bg_block")
- .siblings().removeClass("slideCon_bg_block");
- });
- Ajax();
- deprtment();// 第五屏部门下拉
- laydate.render({
- elem: '#time1',
- range: '~',
- format: 'yyyy-MM-dd',
- theme: '#114a97',
- done: function(value, date) {
- oneScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
- }
- });
- laydate.render({
- elem: '#time2',
- range: '~',
- format: 'yyyy-MM-dd',
- theme: '#114a97',
- done: function(value, date) {
- twoScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
- satisfaction(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
- }
- });
- laydate.render({
- elem: '#time3',
- format: 'yyyy-MM-dd',
- theme: '#114a97',
- done: function(value) {
- threeScreen(value,$(".areaThree").val())
- }
- });
- laydate.render({
- elem: '#test6',
- range: '~',
- format: 'yyyy-MM-dd',
- theme: '#114a97',
- done: function(value, date) {
- fiveScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaFive").val())
- }
- });
- })
- var cityObj = {
- ele1: "sqs_count",
- ele2: "syq_count",
- ele3: "lyq_count",
- ele4: "ycs_count",
- ele5: "mqx_count",
- ele6: "sx_count",
- ele7: "nlx_count",
- ele8: "zcx_count",
- ele9: "ycx_count",
- ele10: "xyx_count",
- ele11: "cxyt_count",
- ele12: "lhpz_count",
- ele13: "saz_count",
- ele14: "djbl_count"
- }
- var vars = {};
- getCountUp(cityObj)
- function getCountUp(obj1) {
- var options = {
- useEasing: true,
- useGrouping: true,
- separator: ',',
- decimal: '.',
- };
- $.each(obj1, function(k, v) {
- new CountUp(v, 0, 0, 0, 2, options).start()
- vars[v] = new CountUp(v, 0, 0, 0, 2, options)
- })
- }
-
- var myDate = new Date();
- function turn(aa) {
- if(aa < 10) {
- aa = "0" + aa;
- }
- return aa
- }
- // 第三屏 第四屏 发光外框 定时
- (function() {
- var i = 0;
- var length = $(".orderState_ul >li").length;
- var j = 0;
- var length_1 = $(".orderTtype_Con li").length;
- setInterval(function() {
- if(i == length) {
- i = 0;
- $(".orderState_ul >li").removeClass('active');
- }
- $(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
- if(i == 5) {
- $(".orderState_ul >li").eq(4).removeClass('active');
- }
- i++;
- if(j == length_1) {
- j = 0;
- }
- $(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
- j++;
- }, 2000);
- })();
- //对数组进行排序
- function compare(property) {
- return (firstobj, secondobj) => {
- const firstValue = firstobj[property];
- const secondValue = secondobj[property];
- return secondValue - firstValue; //降序
- };
- }
- //第一屏幕 开始
- function oneScreen(sd,ed) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "/info/GetAreaCountByDateNew",
- async: true,
- dataType: 'json',
- data: {
- start: sd,
- end: ed,
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- var con = data.data;
- newData = con.sort(compare("SLCount"));
- console.log(1)
- $(newData).each(function(i, n) {
- if(n.AreaName=='安阳市'){
- n.AreaName="市区"
- }
- // if(n.AreaName.indexOf('安阳市') != -1) {
- // $(".AY_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('文峰区') != -1) {
- // $(".WFQ_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('北关区') != -1) {
- // $(".BGQ_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('殷都区') != -1) {
- // $(".YDQ_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('龙安区') != -1) {
- // $(".LAQ_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('安阳县') != -1) {
- // $(".AYX_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('汤阴县') != -1) {
- // $(".TYX_num").text(n.SLCount)
- // }
- // if(n.AreaName.indexOf('内黄县') != -1) {
- // $(".NHX_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('滑县') != -1) {
- // $(".HX_num").html(n.SLCount)
- // }
- // if(n.AreaName.indexOf('林州市') != -1) {
- // $(".LZS_num").html(n.SLCount)
- // }
- if(floag==true){
- $("#det_ult").html('')
- $(newData).each(function(i, n) {
- if(i<10){
- var str=' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>'+n.AreaName+'</span><span class="AY_num">'+n.SLCount+'</span></p></li>';
- var a=$(str)
- a.appendTo($("#det_ult"))
- }
- })
- floag=false
- }
- if(n.AreaName.indexOf('总计') != -1) {
- $(".allSLCount").html(n.SLCount); //受理量
- $(".allJACount").html(n.JACount); //结案量
- //$(".allJARate").html(n.JARate); //结案量
- $(".allJARate").html("93%"); //结案量
- $(".allMYRate").html('94.09%'); //满意度
- }
- })
- }
- }
- });
- }
- function aa(){
-
-
- }
- //第二屏
- function twoScreen(start, end, areaTwoVal) {
- // if(!areaTwoVal) {
- // areaTwoVal = "sqs12345"
- // }
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetSourceByDateNew",
- async: true,
- dataType: 'json',
- data: {
- start: start,
- end: end,
- branchcode: areaTwoVal
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- //layer.close(index);
- $('.orderSource ul li .rectangle').remove();
- var con = data.data;
- var obj=con[0];
- var con_list=[];
- con_list=con.shift();
- con.splice(3,0,obj);
- var Percent;
- $(con).each(function(i, n) {
- // if(n.Source.indexOf('信箱') != -1) {
- // n.Source = '市长信箱'
- // }
- // if(n.Source.indexOf('APP') != -1) {
- // n.Source = 'APP'
- // }
- // if(n.Source.indexOf('政务') != -1) {
- // n.Source = '政务网'
- // }
- var str = '<div class="source_kuang rectangle">' +
- '<div class="pbout">' +
- '<div class="percent_box">' +
- '<div class="percent_out"></div> ' +
- ' <div class="percent_in"></div>' +
- ' <div class="percent_word"><p>' + n.Rate.split('%')[0] + '%' +'</p><p style="margin-top: 30px;">占总量</p>' +
- '</div>' +
- '</div>' +
- '</div>' +
- '<p class="num_word nw">' +
- '<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
- '</p>' +
- '</div>'
- $('.orderSource ul li').eq(i).prepend(str)
- })
- }
- }
- });
- }
- //第三屏
- function threeScreen(sd,areaTwoVal) {
- //alert(sd)
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
- async: true,
- dataType: 'json',
- data: {
- date: sd,
- branchcode: areaTwoVal
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- $('.orderTtype_Con ul').html('');
- // layer.close(index);
- var newDatas =data.data ;
- var con =newDatas.sort(compare("TotalCount"))
- var img_name = '';
- $(con).each(function(i, n) {
- if(n.TypeName.indexOf('咨询') != -1) {
- img_name = 'order_ZX.png'
- }
- if(n.TypeName.indexOf('求助') != -1) {
- img_name = 'order_QZ.png'
- }
- if(n.TypeName.indexOf('投诉') != -1) {
- img_name = 'order_TS.png'
- }
- if(n.TypeName.indexOf('建议') != -1) {
- img_name = 'order_JY.png'
- }
- if(n.TypeName.indexOf('表扬') != -1) {
- img_name = 'order_BY.png'
- }
- if(n.TypeName.indexOf('其他') != -1) {
- img_name = 'order_QT.png'
- }
- $('<li>' +
- '<div class="typeWord">' + n.TypeName + '</div>' +
- '<img src="img/' + img_name + '" alt="" />' +
- '<p class="typeWord_line">数据展示</p>' +
- '<p class="order_count">' + n.DayCount + '</p>' +
- '<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
- '<p class="order_count">' + n.MonthCount + '</p>' +
- '<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
- '<p class="order_count">' + n.TotalCount + '</p>' +
- '<p class="typeWord_line">' + n.TypeName + '总量</p>' +
- '<div class="persent_box">' +
- '<div class="persent_kuang">' + n.Percent + '</div>' +
- '</div>' +
- '<p class="persent_word">总量占比</p>' +
- '</li>').appendTo('.orderTtype_Con ul');
- })
- }
- }
- });
- }
- //第五屏js
- function fiveScreen(sd,ed,areaTwoVal) {
- // if(!sd){
- // sd="2019-11-01"
- // }if(!ed){
- // ed="2019-11-30"
- // }
- keyWord(sd, ed,areaTwoVal);
- }
- $(".depart").change(function() {
- keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
- })
- // 第二屏
- $(".areaTwo").change(function() {
- var areaTwoVal=$(this).val();
- twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaTwoVal);
- satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaTwoVal)
- });
- //第三屏
- $(".areaThree").change(function() {
- var areaTwoVal=$(this).val();
- threeScreen($('#time3').val(),areaTwoVal);
- });
- //第五屏
- $(".areaFive").change(function() {
- var areaTwoVal=$(this).val();
- fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],areaTwoVal);
- deprtment ()
- });
- //部门下拉框
- function deprtment () {
- $.getJSON( huayi.config.callcenter_url +"info/GetDeptList",
- {
- branchcode: $(".areaFive").val()
- },
- function(result) {
- if(result.state.toLowerCase() == "success") {
- goodslist = result.data;
- $(".depart").empty();
- $('<option value="">请选择部门</option>').appendTo($(".depart"));
- $(goodslist).each(function(i, n) {
- $('<option value="' + n.F_DeptId
- + '">' + n.F_DeptName
- + '</option>').appendTo($(".depart"));
- })
- }
- });
- }
- //区县筛选
- //areaSelect ();
- function areaSelect () {
- $.getJSON( huayi.config.callcenter_url +"CountyBranch/GetBranchListS", function(result) {
- if(result.state.toLowerCase() == "success") {
- goodslist = result.data;
- // 第五屏
- $(".areaFive").empty();
- $(goodslist).each(function(i, n) {
- $('<option value="' + n.F_Code
- + '">' + n.F_Name
- + '</option>').appendTo($(".areaFive"));
- });
- //第3屏
- $(".areaThree").empty();
- $(goodslist).each(function(i, n) {
- $('<option value="' + n.F_Code
- + '">' + n.F_Name
- + '</option>').appendTo($(".areaThree"));
- });
- //第2屏
- $(".areaTwo").empty();
- $(goodslist).each(function(i, n) {
- $('<option value="' + n.F_Code
- + '">' + n.F_Name
- + '</option>').appendTo($(".areaTwo"));
- });
- }
- });
- }
- // 左侧关键词
- function keyWord(sd, ed,areaTwoVal) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetKeyCountRankByDate",
- async: true,
- dataType: 'json',
- data: {
- start: sd,
- end: ed,
- branchcode: areaTwoVal
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- var con = data.data.reverse();
- if (con.length>0) {
- // $(".keyW_t").text(con[0].TypeName)
- $('.tagcloud').html('');
- $(con).each(function(k, j) {
- if(k < 19) {
- var strs = '<div index="'+j.Id+'" class="tagcloud_bj">' +
- '<p class="tag_title">' + j.TypeName + '</p>' +
- '<p class="imgs">' + j.Count + '</p>' +
- '</div>'
- $('.tagcloud').append(strs);
- }
- })
- $(".tagcloud div:first-child").removeClass("tagcloud_bj");
- $(".tagcloud div:first-child").addClass("tagcloud_bjShine");
- keyWordDetail(sd, ed,areaTwoVal);
- }else{
- $('.tagcloud').html('');
- }
-
- }
- }
- });
- }
-
- // 右侧部门
- function keyWordDetail(sd, ed,areaTwoVal) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetDeptKeyCountByDateNew",
- async: true,
- dataType: 'json',
- data: {
- start: sd,
- end: ed,
- branchcode: areaTwoVal,
- deptid: $('.depart').val(),
- keyid: $(".tagcloud_bjShine").eq(0).attr("index")
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- $('.scroll_table tbody').html('');
- var con = data.data;
- $(con).each(function (j, n) {
- var rate = '';
- if (n.rate) { rate = n.rate;}
- var str = '<tr><td>' + n.deptname + '</td><td>' + n.acceptcount + '</td><td>' + rate + '</td></tr>'
- $('.scroll_table tbody').append(str);
- })
- $(".scroll_table").Scroll({
- line: 1,
- speed: 500,
- timer: 2000
- });
- }
- }
- });
- }
- $(".tagcloud").on("click","div",function(){
- $(".tagcloud div").addClass("tagcloud_bj");
- $(".tagcloud div").removeClass("tagcloud_bjShine");
- $(this).removeClass("tagcloud_bj");
- $(this).addClass("tagcloud_bjShine");
- keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
- });
- function Ajax() {
-
- oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1])
- twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
- satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
- threeScreen($('#time3').val(),$(".areaThree").val());
- fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val())
- //第五 屏 渠道来源
- var areaOneVal = helper.cookies.get("areaOneVal");
- var areaOneText = helper.cookies.get("areaOneText");
- partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal)
- // 接单 部门
- partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1],areaOneVal);
- // 话务数量
- parthuawu($('#time3').val(),areaOneVal);
- // 投诉举报
- partcomplain($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal)
- }
- function loginTimeLimit(){
- $.ajax({
- type:"get",
- url: huayi.config.callcenter_url + "Login/GetAuAuthDate",
- async:false,
- success:function(res){
- var res=$.parseJSON(res)
- if(res.state== "success") {
- } else {
- layer.confirm(res.message, {
- icon: 2,
- btn: ['确定'],
- yes: function(index, layero) {
- $("#wrap").hide()
- $(".timeLimit-wrapper").show()
- $(".nav_middle ul a").attr('href', '#')
- layer.close(index)
- },
- });
- }
- }
- });
- }
- // 渠道来源
- var part3 = echarts.init(document.getElementById('part3'));
- part3.setOption({
- color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e', '#7d55ba', '#ce5aba', '#355cdd', '#44c1c6', '#ceba5e', '#c64444'],
- title: {
- text: '各班组占比',
- x: 'center',
- y: '45%',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- color: '#fff'
- }
- },
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: ['安阳县','北关区','林州市','龙安区','内黄县','市区','汤阴县','安阳县','文峰区','殷都区','滑县'],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: ['30%', '60%'],
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal: {
- label: {
- show: true,
- // formatter: '{b} : {c} ({d}%)'
- formatter: '{d}%'
- },
- labelLine: {
- show: true
- }
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
- function partThree(start, end,areaOneVal) {
- // var index = layer.load(1, {
- // shade: [0.5, '#030303'] //0.1透明度的白色背景
- // });
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
- async: true,
- dataType: 'json',
- data: {
- start: start,
- end: end,
- branchcode:areaOneVal
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- // layer.close(index);
- $('.complaint_typeL').html('');
- $('.complaint_typeR').html('');
- var con = data.data;
- var part_1_legend = [];
- var part_1_ser = [];
- $(con).each(function(i, n) {
- part_1_legend.push(n.AreaName)
- var part_1_obj = {};
- part_1_obj.value = n.Count;
- part_1_obj.name = n.AreaName;
- part_1_ser.push(part_1_obj)
- if(n.AreaName.indexOf('城乡一体') != -1) {
- n.AreaName = "城乡示范"
- }
- var str = '<li>' +
- '<span class="type_name">' + n.AreaName + '</span> <span class="type_count">' + n.Count + '</span>' +
- '</li>'
- if(i <= 5) {
- $(str).appendTo('.complaint_typeL');
- } else if(i <= 11&&i >5){
- $(str).appendTo('.complaint_typeR');
- }
- })
- part3.setOption({
- // legend: {
- // selected: {
- // '当即办理': false
- // }
- // },
- series: [{
- data: part_1_ser
- }]
- })
- }
- }
- });
- }
- // 接单部门
- //表格滚动
- var area = document.getElementById('scroll_table');
- var iliHeight = 34; //单行滚动的高度
- var speed = 20; //滚动的速度
- var time;
- var delay = 1000;
- area.scrollTop = 0;
- area.innerHTML += area.innerHTML; //克隆一份一样的内容
- function startScroll() {
- time = setInterval("scrollUp()", speed);
- area.scrollTop++;
- console.log(area.scrollTop);
- }
- function scrollUp() {
- if(area.scrollTop % iliHeight == 0) {
- clearInterval(time);
- setTimeout(startScroll, delay);
- } else {
- area.scrollTop++;
- if(area.scrollTop >= area.scrollHeight / 2) {
- area.scrollTop = 0;
- }
- }
- }
- setTimeout(startScroll, delay)
- function partTwo() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "/equipmentapi/api/worepairbase/gettjlists",
- dataType: 'json',
- async: true,
- headers: {
- "content-type": "application/json;charset=utf-8",
- "Authorization": "Bearer " + window.localStorage.getItem('token')
- }, //请求头类型
- data: {
- daytype: $('#timeType').val(),
- isdjtype: '动态',
- Jwocode: $('#bzdatas').val(),
- stime: $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], //开始时间
- etime: $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1], //结束时间
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- $('.thead_six tr').html('');
- $('#scroll_table tbody').html('');
- var con = data.data;
- var thead_six = con[0];
- console.log(thead_six)
- $.each(thead_six, function(k, val) {
-
- $('<td >' + k + '</td>').appendTo('.thead_six tr');
- })
- $(con).each(function(j, n) {
- var str = '<tr>'
- $.each(thead_six, function(j, m) {
- $.each(n, function(k, val) {
- if(j == k) {
- if(val == '') {
- val = 0;
- }
- str += '<td ">' + val + '</td>'
- }
- })
- })
- str += '</tr>';
- $('#scroll_table tbody').append(str);
- })
- }
- }
- });
- }
- // 话务数量
- //part3
- var todyPhoneCount = echarts.init(document.getElementById('todyPhoneCount'));
- todyPhoneCount.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: false,
- label: {
- show: true,
- backgroundColor: '#030917'
- }
- },
- },
- xAxis: {
- name: '类型',
- data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)","排队人数"],
- axisLine: {
- lineStyle: {
- color: '#3061a2'
- }
- },
- axisTick: {
- alignWithLabel: true,
- show: false
- },
- axisLabel: { //横轴字体颜色
- show: true,
- textStyle: {
- color: '#ffffff'
- }
- }
- },
- yAxis: {
- name: '数量',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#3061a2'
- }
- },
- axisLabel: { //横轴字体颜色
- show: true,
- textStyle: {
- color: '#eff0f4'
- }
- }
- },
- series: [{
- name: '数量',
- type: 'bar',
- barWidth: 18,
- itemStyle: {
- normal: {
- color: function(params) {
- // build a color map as your need.
- var colorList = [
- '#368cab', '#54b793', '#4b6ab0', '#2531a9','#a93d19'
- ];
- return colorList[params.dataIndex]
- }
- }
- },
- label: {
- normal: {
- show: true,
- position: 'top', //顶部数据显示位置
- textStyle: {
- color: '#fff' //顶部数据颜色
- },
- formatter: '{c}' // 这里是数据展示的时候显示的数据
- }
- },
- data: []
- }]
- });
- function parthuawu(dates,areaOneVal) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetTelCountByDate",
- async: true,
- dataType: "json",
- data: {
- date: dates,
- branchcode:areaOneVal
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var con = data.data;
- con.person=person
- todyPhoneCount.setOption({
- series: [{
- data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes,con.person]
- }]
- })
- }
- }
- });
- }
-
-
- // 投诉举报
- var partcom = echarts.init(document.getElementById('partcom'));
- partcom.setOption({
- color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e'],
- title: {
- text: '各类型占比',
- x: '28%',
- y: '45%',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- color: '#fff'
-
- }
- },
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: ['表扬','建议','投诉','举报','其他','求助','咨询'],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: ['30%', '60%'],
- center: ['40%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal: {
- label: {
- show: true,
- // formatter: '{b} : {c} ({d}%)'
- formatter: '{d}%'
- },
- labelLine: {
- show: true
- }
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
-
- function partcomplain(start, end,areaOneVal) {
- // var index = layer.load(1, {
- // shade: [0.5, '#030303'] //0.1透明度的白色背景
- // });
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetTypeCountByDate",
- async: true,
- dataType: 'json',
- data: {
- start: start,
- end: end,
- branchcode:areaOneVal
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- // layer.close(index);
- $('.complaint_type').html('');
- var con = data.data;
- var part_1_legend = [];
- var part_1_ser = [];
- $(con).each(function(i, n) {
- part_1_legend.push(n.TypeName)
- var part_1_obj = {};
- part_1_obj.value = n.Count;
- part_1_obj.name = n.TypeName;
- part_1_ser.push(part_1_obj)
- $('<li>' +
- '<span class="type_name">' + n.TypeName + '</span> <span class="type_count">' + n.Count + '</span>' +
- '</li>').appendTo('.complaint_type')
- })
- partcom.setOption({
- // legend: {
- // data: part_1_legend
- // },
- series: [{
- data: part_1_ser
- }]
- })
-
- }
- }
- });
- }
-
|