function showTools(a){ if($(a).find(".tooltips").css("display") == 'none') { $(a).find(".tooltips").show(); $(a).parents('tr').siblings().find(".tooltips").hide(); }else{ $(a).find(".tooltips").hide(); } } $(document).ready(function(){ laydate.render({ elem: '#time1', theme: '#00a1cb' }); laydate.render({ elem: '#time2', theme: '#00a1cb' }); laydate.render({ elem: '#time3', theme: '#00a1cb' }); // 工单状态part1 var jiedan = echarts.init(document.getElementById('jiedan1')); jiedan.setOption({ tooltip: { trigger: 'axis', axisPointer: { type: 'cross', label: { show: true, backgroundColor: '#333' } } }, legend: { bottom:'bottom', data: [], textStyle: { color: '#ccc' } }, xAxis: { name: '月份', data: [], axisLine: { lineStyle: { color: '#ccc' } } }, yAxis: { name: '数量', // min: 0, // max: 400, // interval: 50, splitLine: { show: false }, axisLine: { lineStyle: { color: '#ccc' } } }, series: [] }); function partOne(){ var index = layer.load(1, { shade: [0.5, '#030303'] //0.1透明度的白色背景 }); $.ajax({ type:"get", url: huayi.config.callcenter_url + "info/GetStateCountMonthByDate", async:true, dataType:'json', success:function(data){ if(data.state.toLowerCase()=='success'){ layer.close(index); var con=data.data; // var jieDans = result.data.a; var counts = con.counts; var sers = []; $(counts).each(function(i, n) { var obj = {}; obj.name = con.cols[i]; obj.type = "line"; obj.smooth = true; obj.showAllSymbol = true; obj.symbol = "emptyCircle"; obj.symbolSize = 10; obj.data = n; sers.push(obj) }); jiedan.setOption({ xAxis: { data: con.months }, legend: { data: con.cols }, series: sers }); } } }); } //受理渠道24小时统计 part2 var part2 = echarts.init(document.getElementById('timefb')); part2.setOption({ tooltip: { trigger: 'axis', axisPointer: { type: 'shadow', label: { show: true, backgroundColor: '#333' } }, formatter: function(datas) { var res = datas[0].name + '
', val; for(var i = 0, length = datas.length; i < length; i++) { val = (datas[i].value); res += datas[i].seriesName + ':' + val + '
'; } return res; } }, legend: { // top: 30, // orient: 'vertical', bottom:'bottom', data: ['受理工单数','处理工单数'], textStyle: { color: '#fff' } }, xAxis: { name: '时', data: [], axisLine: { lineStyle: { color: '#ccc' } }, }, yAxis: { name: '数量', splitLine: { show: false }, axisLine: { lineStyle: { color: '#ccc' } } }, series: [{ name: '受理工单数', type: 'bar', barWidth: '20%', itemStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{offset: 0, color: '#83bff6'}, {offset: 0.5, color: '#188df0'}, {offset: 1, color: '#188df0'} ] ) } }, label: { normal: { show: true, position: 'top', //顶部数据显示位置 formatter: '{c}' // 这里是数据展示的时候显示的数据 } }, data: [] },{ name: '处理工单数', type: 'bar', barWidth: '20%', itemStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: '#14c8d4' }, { offset: 1, color: '#43eec6' } ] ) } }, label: { normal: { show: true, position: 'top', //顶部数据显示位置 formatter: '{c}' // 这里是数据展示的时候显示的数据 } }, data: [] }] }); function partTwo(){ var index = layer.load(1, { shade: [0.5, '#030303'] //0.1透明度的白色背景 }); $.ajax({ type:"get", url: huayi.config.callcenter_url + "info/GetDealCount24ByDate", dataType: 'json', async: true, data:{ date:$('#time1').val(), }, success:function(data){ if(data.state.toLowerCase()=='success'){ layer.close(index); var con=data.data; // var qd_legend = []; // var qd_sers = []; // var ser_data = []; // var qd_label = { // normal: { // show: true, // position: 'inside', // formatter: '{c}%' // } // }; part2.setOption({ xAxis: { data:con.hours }, series: [{ data: con.acounts },{ data:con.fcounts }] }); } } }); } $('.part1Btn').click(function(){ partTwo(); }) //part 3 //部门下拉框 $.getJSON(huayi.config.callcenter_url + "info/GetDeptList ", function(result) { if(result.state.toLowerCase() == "success") { goodslist = result.data; bindseat($("#dep")); } }); //下拉框 function bindseat(obj) { obj.empty(); obj.append(''); $(goodslist).each(function(i, n) { obj.append(''); }) } partThree(); function partThree(){ var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景 }); $('.table1 tbody').html(''); $.ajax({ type:"get", url:huayi.config.callcenter_url + "info/GetDeptCountByDate", async:true, dataType:'json', data:{ start:$('#time2').val(), end:$('#time3').val(), deptid:$('#dep').val() }, success:function(data){ if(data.state.toLowerCase()=='success'){ layer.close(index); var con=data.data; $(con).each(function(i,n){ var html=""; // $(''+ // '1'+ // '' + n.AreaName + ''+ // '' + n.Count + ''+ // '').appendTo('.table1 tbody'); html = '' + '
' + n.AreaName + '
'+ '
'+ n.AreaName +'
' $(n.Item).each(function(j, m) { html += '

' + m.TypeName + ':' + m.Count + '

' }) html += '
' + '
' + '' + '' + n.Count + '' + ''; $('.table1 tbody').append(html); }) } } }); } $('.part3Btn').click(function(){ partThree(); }) Ajax(); function Ajax(){ partOne() partTwo(); partThree(); } setInterval(Ajax, huayi.config.indextime);//Ajax调用函数 })