Browse Source

修改工作报告

lulihong 6 years ago
parent
commit
a59f11e990
1 changed files with 29 additions and 25 deletions
  1. 29 25
      html/tuandui/js/gongzuobaogao.js

+ 29 - 25
html/tuandui/js/gongzuobaogao.js

@ -127,8 +127,8 @@ $(function() {
				if (me.type === 1) {
					me.monthData = ress;
				}
				console.error(JSON.stringify(ress))
				console.error(JSON.stringify(ress[3]))
//				console.error(JSON.stringify(ress))
//				console.error(JSON.stringify(ress[3]))
				me.setDateInPage();
				plus.nativeUI.closeWaiting();
			});
@ -171,7 +171,7 @@ $(function() {
			    zxtj = [],
			    jgnfw = [],
			    jmgzqs = [],
			    gzbhqs = [],
			    gzbhqs = {},
			    pjmyd = {dt:[],da:[]},
			    xqzq = {da1: [], da2: []},
			    dArr = $d.init(5);
@ -214,7 +214,26 @@ $(function() {
    				me.dateArr = d1.dt;
				}
		    }
		    gzbhqs = data[3].data;
			//处理关注变化趋势
			 if(data[3].status == 200){
			 	gzbhqs = data[3].data; 
			 	var concorn = gzbhqs[0].concorn//新增关注
				var cancel = gzbhqs[0].cancel;//取消关注
			 	concorn = me.getDataXY(concorn, 3);
				cancel = me.getDataXY(cancel, 4);
				if (me.type === 0) {
					concorn = $h.contrastDate(dArr, concorn, 'dt', 'da');
					cancel = $h.contrastDate(dArr, cancel, 'dt', 'da');
				}
				if (me.type === 1) {
					var d1 = $h.getWeeksData( concorn, 'dt', 'da');
					var d2 = $h.getWeeksData( cancel, 'dt', 'da');
					concorn = d1.da;
					cancel = d2.da;
    				me.dateArr = d1.dt;
				}
				gzbhqs = {concorn:concorn,cancel:cancel}
		    }
		    me.loadCharts(qy, zxtj, jgnfw, pjmyd, jmgzqs, gzbhqs);
		},
		loadCharts: function(qy, zxtj, jgnfw, pjmyd, jmgzqs, gzbhqs) {
@ -222,27 +241,12 @@ $(function() {
			var count = zxtj.onReyCount + zxtj.totalCount;
			var zx = count == 0 ? (1/2)*100 : 0;
			jgnfw.splice(1,2);//删除随访和代预约的值
			if (me.type === 0) {
				_.map(gzbhqs,function(item,idx){
					gzbhxAxisData.push(item.date.substring(5,10));
					gzbhSeriesData1.push(item.concernCount);
					gzbhSeriesData2.push(item.cancelCount);
				})
			}
			if (me.type === 1) {
				_.map(gzbhqs,function(item,idx){
					gzbhxAxisData.push("第"+item.date+"周");
					gzbhSeriesData1.push(item.concernCount);
					gzbhSeriesData2.push(item.cancelCount);
				})
			}
			
			//处理咨询统计
			var unreplay = zxtj.onReyCount, //未回复数
            total = zxtj.totalCount, 
            replay = parseInt(total) - parseInt(unreplay); //已回复咨询数
        	$("#totalCount").text(total);//总咨询数
			debugger
        	
			Promise.all([
				//咨询统计
				$ic.init({
@ -283,7 +287,7 @@ $(function() {
				//关注变化趋势
				$ic.init({
					el: me.$gzbhChart,
					xAxisData:  gzbhxAxisData,
					xAxisData: me.dateArr,
					legend: {
				        data:['新增关注','取消关注']
				    },
@ -291,13 +295,13 @@ $(function() {
									name:"新增关注",
									type: "line",
									symbol: "emptyCircle",
									data: gzbhSeriesData1
									data: gzbhqs.concorn
								},
								{
									name:"取消关注",
									type: "line",
									symbol: "emptyCircle",
									data: gzbhSeriesData2
									data: gzbhqs.cancel
								}],
					chartsType: 1
				}),
@ -308,14 +312,14 @@ $(function() {
			if (this.type == 0) {
				for (var i = 0, len = d.length; i< len; i++) {
					data.dt.push(t == 1 ? d[i].applyDate : t == 2 ?d[i].dateNo:d[i].applyDate);
					data.da.push(t == 1 ? d[i].signCount : t == 2 ?d[i].avgCount:d[i].concernCount);
					data.da.push(t == 1 ? d[i].signCount : t == 2 ?d[i].avgCount:t == 4?d[i].cancelCount:d[i].concernCount);
				}
				return data;
			}
			if (this.type == 1) {
				for (var i = 0, len = d.length; i< len; i++) {
					data.dt.push(t == 1 ? d[i].weekOfMonth : t == 2 ?d[i].weekNo:d[i].weekOfMonth);
					data.da.push(t == 1 ? d[i].signCount : t == 2 ?d[i].avgCount:d[i].concernCount);
					data.da.push(t == 1 ? d[i].signCount : t == 2 ?d[i].avgCount:t == 4?d[i].cancelCount:d[i].concernCount);
				}
				return data;
			}