$(function() {
	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动画
			},
		}
	})
	oneSel(sd,ed);
	laydate.render({
					elem: '#time1',
					range: '~',
					format: 'yyyy-MM-dd',
					theme: '#114a97',
						done: function(value, date) {
						oneSel(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
					}
				});
	laydate.render({
					elem: '#time2',
					range: '~',
					format: 'yyyy-MM-dd',
					theme: '#114a97',
						done: function(value, date) {
							partpaat(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
					}
				});
	laydate.render({
					elem: '#time3',
					range: '~',
					format: 'yyyy-MM-dd',
					theme: '#114a97',
					done: function(value) {
						gettraffic(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
						getAgentData(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
					}
			});
})
var myDate = new Date();
var typeSelc;
var oneType;
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 oneSel(sd,ed){
		$.ajax({
			type: "get",
			url: huayi.config.callcenter_url + 'Business/GetFeedbacklList',
			async: true,
			dataType: 'json',
			data: {
				stime: sd,
				endtime: ed
			},
			success: function(data) {
				
				if(data.state == "success") {
					var sorceData=data.rows;
					// 总计
					$(".total_title").html(sorceData[0].name);
					$(".total_problem_1").html(sorceData[0].daynumber);
					$(".total_problem_2").html(sorceData[0].mounthnumber);
					$(".total_problem_3").html(sorceData[0].Totalnumber);
					$(".total_problem_4").html(sorceData[0].Proportion);
					// B
					$(".b_title").html(sorceData[1].name);
					$(".b_problem_1").html(sorceData[1].daynumber);
					$(".b_problem_2").html(sorceData[1].mounthnumber);
					$(".b_problem_3").html(sorceData[1].Totalnumber);
					$(".b_problem_4").html(sorceData[1].Proportion);
					// ZBM
					$(".zbm_title").html(sorceData[2].name);
					$(".zbm_problem_1").html(sorceData[2].daynumber);
					$(".zbm_problem_2").html(sorceData[2].mounthnumber);
					$(".zbm_problem_3").html(sorceData[2].Totalnumber);
					$(".zbm_problem_4").html(sorceData[2].Proportion);
					// P
					$(".p_title").html(sorceData[3].name);
					$(".p_problem_1").html(sorceData[3].daynumber);
					$(".p_problem_2").html(sorceData[3].mounthnumber);
					$(".p_problem_3").html(sorceData[3].Totalnumber);
					$(".p_problem_4").html(sorceData[3].Proportion);
					// Q
					$(".q_title").html(sorceData[4].name);
					$(".q_problem_1").html(sorceData[4].daynumber);
					$(".q_problem_2").html(sorceData[4].mounthnumber);
					$(".q_problem_3").html(sorceData[4].Totalnumber);
					$(".q_problem_4").html(sorceData[4].Proportion);
					// ZCY
					$(".zcy_title").html(sorceData[5].name);
					$(".zcy_problem_1").html(sorceData[5].daynumber);
					$(".zcy_problem_2").html(sorceData[5].mounthnumber);
					$(".zcy_problem_3").html(sorceData[5].Totalnumber);
					$(".zcy_problem_4").html(sorceData[5].Proportion);
					// ZTF
					$(".ztf_title").html(sorceData[6].name);
					$(".ztf_problem_1").html(sorceData[6].daynumber);
					$(".ztf_problem_2").html(sorceData[6].mounthnumber);
					$(".ztf_problem_3").html(sorceData[6].Totalnumber);
					$(".ztf_problem_4").html(sorceData[6].Proportion);
					// ZQT
					$(".zqt_title").html(sorceData[7].name);
					$(".zqt_problem_1").html(sorceData[7].daynumber);
					$(".zqt_problem_2").html(sorceData[7].mounthnumber);
					$(".zqt_problem_3").html(sorceData[7].Totalnumber);
					$(".zqt_problem_4").html(sorceData[7].Proportion);
					// QSZ
					$(".qsz_title").html(sorceData[8].name);
					$(".qsz_problem_1").html(sorceData[8].daynumber);
					$(".qsz_problem_2").html(sorceData[8].mounthnumber);
					$(".qsz_problem_3").html(sorceData[8].Totalnumber);
					$(".qsz_problem_4").html(sorceData[8].Proportion);
					// QJT
					$(".qjt_title").html(sorceData[9].name);
					$(".qjt_problem_1").html(sorceData[9].daynumber);
					$(".qjt_problem_2").html(sorceData[9].mounthnumber);
					$(".qjt_problem_3").html(sorceData[9].Totalnumber);
					$(".qjt_problem_4").html(sorceData[9].Proportion);
				}
			}
		})
	}
	$(window).load(function(){
        $(".content>div").eq(0).show().siblings().hide();
		 // $(".tabItems>span").remove();
     })
	 $(".tabItems>li").click(function () {
		 // alert('我被点击了')
        $(this).addClass("active").siblings().removeClass("active");
        var index = $(this).index();
		// $(this).css("cursor","pointer");
        $(".content>div").eq(index).show().siblings().hide();
     })
