| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502 |
- $(function() {
- getdepartments()
- laydate.render({
- elem: '#startTime',
- range: '~',
- theme: '#114a97',
- done: function(value, date) {
- partOne();
- }
- });
- laydate.render({
- elem: '#phone_time',
- range: '~',
- theme: '#114a97',
- done: function(value, date) {
- partTwo();
- }
- });
- // laydate.render({
- // elem: '#tody_time',
- // theme: '#114a97',
- // done: function(value, date) {
- // partOne();
- // }
- // });
- Ajax();
- $(".areaOne").change(function() {
- var areaOneVal = $(this).val();
- var areaOneText = $(".areaOne").find("option:selected").text();
- helper.cookies.set("areaOneVal", areaOneVal, 7);
- helper.cookies.set("areaOneText", areaOneText, 7);
- partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $(
- 'phone_time').val().split(' ~ ')[1], areaOneVal);
- partThree($('#tody_time').val(), areaOneVal);
- });
- $(".depart").change(function() {
- var areaOneVal = helper.cookies.get("areaOneVal");
- partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $(
- '#phone_time').val().split(' ~ ')[1], areaOneVal);
- })
- })
- // 获取班组
- function getdepartments() {
- $("#bzdatas").html('');
- equipmentdata = []
- $("#bzdatas").append('<option value="">请选择班组</option>');
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "equipmentapi/api/WoRepairBase/getallbzcount",
- async: true,
- headers: {
- "content-type": "application/json;charset=utf-8",
- "Authorization": "Bearer " + window.localStorage.getItem('token')
- }, //请求头类型
- success: function(data) {
- var leveldata = []
- console.log(JSON.parse(data))
- if (JSON.parse(data).state.toLowerCase() == 'success') {
- leveldata = JSON.parse(data).data
- $(leveldata).each(function(q, p) {
- console.log(p)
- $("<option value='" + p.role_name + "'>" + p.role_name + "</option>").appendTo("#bzdatas");
- // $("#bzdatas").selectpicker('refresh');
- });
- } else {
- $("#bzdatas").empty();
- // $("#bzdatas").selectpicker('refresh');
- }
- }
- });
- }
- $("#bzdatas").change(function() {
- partTwo()
- partThree()
- })
- // 跳轉
- $(".index").click(function() {
- window.open('detail.html', '_self')
- })
- $(".second").click(function() {
- window.open('second.html', '_self')
- })
- $(".third").click(function() {
- window.open('third.html', '_self')
- })
- $(".fourth").click(function() {
- window.open('fourth.html', '_self')
- })
- $(".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')
- })
- //part 1 //工单状态统计 对接完毕
- var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
- phoneTimeCount.setOption({
- color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- }
- },
- grid: {
- left: '2%',
- right: '5%',
- bottom: '6%',
- containLabel: true
- },
- legend: {
- top: 'top',
- left: '180px',
- data: [],
- textStyle: {
- color: '#00e9ff'
- }
- },
- xAxis: {
- name: '月份',
- data: [],
- axisLine: {
- lineStyle: {
- color: '#3061a2'
- }
- },
- axisTick: {
- alignWithLabel: true,
- show: false
- },
- axisLabel: { //横轴字体颜色
- show: true,
- textStyle: {
- color: '#eff0f4'
- }
- }
- },
- yAxis: {
- name: '(数量)',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#3061a2'
- }
- },
- axisLabel: { //横轴字体颜色
- show: true,
- textStyle: {
- color: '#eff0f4'
- }
- }
- },
- series: []
- });
- function partOne() {
- // var index = layer.load(1, {
- // shade: [0.5, '#030303'] //0.1透明度的白色背景
- // });
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/getlistsbypages",
- async: true,
- headers: {
- "content-type": "application/json;charset=utf-8",
- "Authorization": "Bearer " + window.localStorage.getItem('token')
- }, //请求头类型
- data: {
- // pageindex:1,
- // pagesize:10,
- // state:'',
- stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0], //开始时间
- etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1], //结束时间
- },
- dataType: 'json',
- success: function(data) {
- if (data.state.toLowerCase() == 'success') {
- // layer.close(index);
- // console.log(data)
- 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)
- });
- phoneTimeCount.setOption({
- xAxis: {
- data: con.months
- },
- legend: {
- data: con.cols
- },
- series: sers
- });
- }
- }
- });
- }
- //part 2 //各部门工单情况
- 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 tr').html('');
- $('#scroll_table tbody').html('');
- var con = data.data;
- // console.log(con)
- var thead = con[0];
- $.each(thead, function(k, val) {
- // console.log(k)
- $('<td>' + k + '</td>').appendTo('.thead tr');
- })
- $(con).each(function(j, n) {
- var str = '<tr>'
- $.each(thead, 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);
- })
- }
- }
- });
- }
- $("#timeType").change(function() {
- partTwo()
- partThree()
- })
- // part3 工单处理时间分布
- var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
- sitProportion.setOption({
- color: ['#4ab7c7', '#2484d9', '#2e39c1'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- },
- formatter: function(datas) {
- var res = datas[0].name + '<br/>',
- val;
- for (var i = 0, length = datas.length; i < length; i++) {
- // val = (datas[i].value) + '%';
- val = (datas[i].value);
- res += datas[i].seriesName + ':' + val + '<br/>';
- }
- return res;
- }
- },
- legend: {
- top: 'top',
- left: '165px',
- data: ['完结单率', '满意度'],
- textStyle: {
- color: '#00e9ff'
- }
- },
- grid: {
- left: '2%',
- right: '5%',
- bottom: '5%',
- containLabel: true
- },
- xAxis: {
- name: '班组',
- data: [],
- axisLine: {
- lineStyle: {
- color: '#3061a2',
-
- },
- },
-
- axisTick: {
- alignWithLabel: true,
- show: false
- },
- axisLabel: { //横轴字体颜色
- show: true,
- interval: '0',
- rotate: 20,
- textStyle: {
- color: '#65ABE7'
- }
- },
-
- },
- grid: {
- left: '15',
- right: '40',
- bottom: '30',
- containLabel: true
- },
- yAxis: {
- name: '(百分比)',
- nameTextStyle: {
- color: "#65ABE7",
- fontSize: 12,
- },
- splitLine: {
- show: false
- },
- type: 'value',
- axisLabel: {
- show: true,
- interval: 'auto',
- textStyle: {
- color: '#65ABE7', //字体颜色
- fontSize: 12 //字体大小
- },
- formatter: '{value} %'
- },
- show: true
- },
- series: [{
- name: '完结单率',
- type: 'bar',
- data: []
- }, {
- name: '满意度',
- type: 'bar',
- data: []
- }],
- });
- // 跳轉
- $(".index").click(function() {
- window.open('detail.html', '_self')
- })
- $(".second").click(function() {
- window.open('second.html', '_self')
- })
- $(".third").click(function() {
- window.open('third.html', '_self')
- })
- $(".fourth").click(function() {
- window.open('fourth.html', '_self')
- })
- $(".nav_middle").click(function() {
- window.open('index.html', '_self')
- })
- function partThree() {
- $.ajax({
- type: "get",
- headers: {
- "content-type": "application/json;charset=utf-8",
- "Authorization": "Bearer " + window.localStorage.getItem('token')
- }, //请求头类型
- url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/gettjliststh",
- dataType: 'json',
- async: true,
- 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') {
- var con = data.data;
- var xdatas = []
- var xdatas2 = []
- for (var i = 0; i < con.finishwodlv.length; i++) {
- xdatas.push(con.finishwodlv[i].slice(0, -1))
- }
- for (var i = 0; i < con.mydlv.length; i++) {
- xdatas2.push(con.mydlv[i].slice(0, -1))
- }
- sitProportion.setOption({
- xAxis: {
- data: con.bzname
- },
- series: [{
- data: xdatas
- }, {
- data: xdatas2
- }],
- });
- }
- }
- });
- }
- //表格滚动
- 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++;
- }
- 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 Ajax() {
- partOne()
- partTwo();
- partThree();
- }
|