            mui.init();
            var uRLs = API.API_URL();
			var pageNo = 1;
			var pageNo2 = 1;
			var pageNo3 = 1;
			var pageNo4 = 1;
			var self1;
			var self2;
			var self3;
			var self4;
			(function($) {
				//初始化单页的区域滚动
				mui('.mui-scroll-wrapper').scroll();
				//阻尼系数
				var deceleration = mui.os.ios ? 0.003 : 0.0009;
				$('.mui-scroll-wrapper').scroll({
					bounce: false,
					indicators: true, //是否显示滚动条
					deceleration: deceleration
				});
                mui('.mui-slider').slider().stopped = true;
				mui.plusReady(function() {
					var self = plus.webview.currentWebview();
					id = self.universalid;

					$.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
						$(pullRefreshEl).pullToRefresh({
							//container: '.list_item',
							down: {
								callback: function() {
									var self = this;
									setTimeout(function() {
										var ul = self.element.querySelector('.mui-table-view');
										reloadNews(ul, self);
										self.endPullDownToRefresh();
									}, 1000); //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
								}
							},
							up: {
								height: 50, //可选.默认50.触发上拉加载拖动距离
								auto: true, //可选,默认false.自动上拉加载一次
								contentrefresh: "正在加载...", //可选，正在加载状态时，上拉加载控件上显示的标题内容
								contentnomore: '没有更多数据了', //可选，请求完毕若没有更多数据时显示的提醒内容；
								callback: function() {

									var self = this;
									setTimeout(function() {
										var ul = self.element.querySelector('.mui-table-view');
										console.log(pullRefreshEl.id);
										pullupRefresh(ul, self);
										self.endPullUpToRefresh();
									}, 1000);
								}
							}
						});
					});
				});
			})(mui);

			var vmA = new Vue({
				el: '#pullrefresh',
				data: {
					item1: [] //列表信息流数据
				}
			});

			var vmB = new Vue({
				el: '#items2',
				data: {
					item2: [] //列表信息流数据
				}
			});

			var vmC = new Vue({
				el: '#items3',
				data: {
					item3: [] //列表信息流数据
				}
			});

			var vmD = new Vue({
				el: '#items4',
				data: {
					item4: [] //列表信息流数据
				}
			});

			/**
			 * 下拉刷新具体业务实现
			 */
			function reloadNews(ul, self) {
				/*vmA.item1 = [];
				addData();*/
				var dataType = self.element.id;
				if("pullrefresh" == dataType) {
					pageNo = 1;
					vmA.item1 = [];
					addData(ul, self);
				} else if("pullrefresh2" == dataType) {
					pageNo2= 1;
					vmB.item2 = [];
					addData2(ul, self);
				} else if("pullrefresh3" == dataType) {
					pageNo3 = 1;
					vmC.item3 = [];
					addData3(ul, self);
				} else if("pullrefresh4" == dataType) {
					pageNo4 = 1;
					vmD.item4 = [];
					addData4(ul, self);
				}
			}

			/**
			 * 上拉加载具体业务实现
			 */
			function pullupRefresh(ul, self) {
				var dataType = self.element.id;
				if("pullrefresh" == dataType) {
					self1=self;
					addData(ul, self);
				} else if("pullrefresh2" == dataType) {
					self2=self;
					addData2(ul, self);
				} else if("pullrefresh3" == dataType) {
					self3=self;
					addData3(ul, self);
				} else if("pullrefresh4" == dataType) {
					self4=self;
					addData4(ul, self);
				}
			}

			function addData(ul, self) {
				var url = API.API_URL();
				var serviceId = "oa_2018V06ScheduleListByCompleteAction";
				var state = app.getState(); //获取登陆信息
				var userId = state.user.useId;
				var theNum = "1"; //日程完成状态类型
				var obj = {
					userId: userId,
					pSize: APP.PageSize,
					p: pageNo,
					theNum: theNum
				};
				app.ajax(serviceId, obj, function(data) {
					//服务器返回响应
					console.log(JSON.stringify(data));
					var totalRow = data.total;
					var totalPage = Math.ceil(totalRow / APP.PageSize);
					var list = data.list;
					console.log(list.length);
					if(list.length > 0) {
						vmA.item1 = vmA.item1.concat(convert(list, self));
					}
					self.endPullUpToRefresh(totalPage <= pageNo); //参数为true代表没有更多数据了。
					if(pageNo == 1 && totalPage > 1)
						self.refresh(true); //调用.refresh(true)方法，可重置上拉加载控件,注意：refresh()中需传入true
					pageNo = pageNo + 1;
				});
			}

			function addData2(ul, self) {
				var url = API.API_URL();
				var serviceId = "oa_2018V06ScheduleListByCompleteAction";
				var state = app.getState(); //获取登陆信息
				var userId = state.user.useId;
				var theNum = "2"; //日程完成状态类型
				var obj = {
					userId: userId,
					pSize: APP.PageSize,
					p: pageNo2,
					theNum: theNum
				};
				app.ajax(serviceId, obj, function(data) {
					//服务器返回响应
					console.log(JSON.stringify(data))
					var totalRow = data.total;
					var totalPage = Math.ceil(totalRow / APP.PageSize);
					var list = data.list;
					console.log(list.length);
					if(list.length > 0) {
						vmB.item2 = vmB.item2.concat(convert(list, self));
					}
					self.endPullUpToRefresh(totalPage <= pageNo2); //参数为true代表没有更多数据了。//参数为true代表没有更多数据了。
					if(pageNo2 == 1 && totalPage > 1)
						self.refresh(true); //调用.refresh(true)方法，可重置上拉加载控件,注意：refresh()中需传入true
					pageNo2 = pageNo2 + 1;
				});
			}

			function addData3(ul, self) {
				var url = API.API_URL();
				var serviceId = "oa_2018V06ScheduleListByCompleteAction";
				var state = app.getState(); //获取登陆信息
				var userId = state.user.useId;
				var theNum = "3"; //日程完成状态类型
				var obj = {
					userId: userId,
					pSize: APP.PageSize,
					p: pageNo3,
					theNum: theNum
				};
				app.ajax(serviceId, obj, function(data) {
					//服务器返回响应
					console.log(JSON.stringify(data))
					var totalRow = data.total;
					var totalPage = Math.ceil(totalRow / APP.PageSize);
					var list = data.list;

					console.log(list.length);
					if(list.length > 0) {
						vmC.item3 = vmC.item3.concat(convert(list, self));
					}
					self.endPullUpToRefresh(totalPage <= pageNo3); //参数为true代表没有更多数据了。
					if(pageNo3 == 1 && totalPage > 1)
						self.refresh(true); //调用.refresh(true)方法，可重置上拉加载控件,注意：refresh()中需传入true
					pageNo3 = pageNo3 + 1;
				});
			}

			function addData4(ul, self) {
				var url = API.API_URL();
				var serviceId = "oa_2018V06ScheduleListByCompleteAction";
				var state = app.getState(); //获取登陆信息
				var userId = state.user.useId;
				var theNum = "4"; //日程完成状态类型
				var obj = {
					userId: userId,
					pSize: APP.PageSize,
					p: pageNo4,
					theNum: theNum
				};
				app.ajax(serviceId, obj, function(data) {
					//服务器返回响应
					console.log(JSON.stringify(data))
					var totalRow = data.total;
					var totalPage = Math.ceil(totalRow / APP.PageSize);
					var list = data.list;
					console.log(list.length);
					if(list.length > 0) {
						vmD.item4 = vmD.item4.concat(convert(list, self));
					}
					self.endPullUpToRefresh(totalPage <= pageNo4); //参数为true代表没有更多数据了。
					if(pageNo4 == 1 && totalPage > 1)
						self.refresh(true); //调用.refresh(true)方法，可重置上拉加载控件,注意：refresh()中需传入true
					pageNo4 = pageNo4 + 1;
				});
			}

			/**
			 * 1、将服务端返回数据，转换成前端需要的格式
			 * 2、若服务端返回格式和前端所需格式相同，则不需要改功能
			 * 
			 * @param {Array} item1 
			 */
			function convert(items, self) {
				var newItems = [];
				items.forEach(function(item) {
					
					var _startD=item.schedule_start_date.split(" ");
					var _endD=item.schedule_end_date.split(" ");
					var schedule_typeN;
					var schedule_levelN;
					if(item.schedule_type==1){
						schedule_typeN="工作事务";
					}else if(item.schedule_type==2){
						schedule_typeN="个人事务";
					}
					if(item.schedule_level==0){
			            schedule_levelN="未指定";
			        }else if(item.schedule_level==1){
			            schedule_levelN="重要/紧急";
			        }else if(item.schedule_level==2){
			            schedule_levelN="重要/不紧急";
			        }else if(item.schedule_level==3){
			            schedule_levelN="不重要/紧急";
			        }else if(item.schedule_level==4){
			             schedule_levelN="不重要/不紧急";	
			        }
					newItems.push({
						universalid: item.universalid,
						schedule_title: item.schedule_title,
						schedule_detail: item.schedule_detail,
						schedule_level: item.schedule_level,
						alarm_time: item.alarm_time,
						schedule_start_date: item.schedule_start_date,
						schedule_end_date: item.schedule_end_date,
						schedule_type: item.schedule_type,
						alarm_type1: item.alarm_type1,
						alarm_type2: item.alarm_type2,
						startD:_startD[0],
						endD:_endD[0],
						startH:_startD[1],
						endH:_endD[1],
						allDay: item.allday,
						typeNs:schedule_typeN,
						levelNs:schedule_levelN,
						self: self,
						complete: item.complete
					});
                    
				});

				return newItems;
			}

			/**
			 * 打开我的日程详情
			 * 
			 * @param {Object} item 当前点击的督办对象
			 */
			function open_detail(item) {
				    var uRl="";
					var id="";
					if(item.complete==0){
						uRl= "../../page/schedule/scheduleInfo.html";
					    id= "scheduleInfo.html";
					}else{
						uRl= "../../page/schedule/scheduleEdit.html";
					    id= "scheduleEdit.html";
					}
				mui.openWindow({
					url:uRl,
					id: id,
					extras: {
						universalid: item.universalid,
						schedule_title: item.schedule_title,
						schedule_detail: item.schedule_detail,
						schedule_level: item.schedule_level,
						alarm_time: item.alarm_time,
						schedule_start_date: item.schedule_start_date,
						schedule_end_date: item.schedule_end_date,
						schedule_type: item.schedule_type,
						alarm_type1: item.alarm_type1,
						alarm_type2: item.alarm_type2,
						allDay: item.allDay,
						complete: item.complete
					}
					
					
				})
			}

			//修改日程完成情况
			function editSchedul(item) {
				var uRL = API.API_URL();
				var isNum = item.theNum;
				var btnArray = ['取消', '确认'];
				mui.confirm('确定完成？', '警告', btnArray, function(e) {
					if(e.index == 1) {
						var url = API.API_URL();
						var serviceId = "oa_2017V01ScheduleEdit";
						var state = app.getState(); //获取登陆信息
						var start_date = item.schedule_start_date + ":00";
						var end_date = item.schedule_end_date + ":00";
						var alarm_time = item.alarm_time + ":00";
						var allDay=item.allDay+"";
						var obj = {
							universalid: item.universalid,
						schedule_title: item.schedule_title,
						schedule_detail: item.schedule_detail,
						schedule_level: item.schedule_level,
						alarm_time: item.alarm_time,
						schedule_start_date: item.schedule_start_date,
						schedule_end_date: item.schedule_end_date,
						schedule_type: item.schedule_type,
						alarm_type1: item.alarm_type1,
						alarm_type2: item.alarm_type2,
						allDay: allDay,
						complete: 0

						};
						app.ajax(serviceId, obj, function(data) {
							//服务器返回响应
							reloadNews(uRL, self1);
							reloadNews(uRL, self2);
							reloadNews(uRL, self3);
							reloadNews(uRL, self4);
						});
					} else {

					}
				})
			}
			//删除我的日程
			function delSchedul(item) {
				var uRL = API.API_URL();
				var isNum = item.theNum;
				var btnArray = ['取消', '确认'];
				mui.confirm('确定要删除吗', '警告', btnArray, function(e) {
					if(e.index == 1) {
						var url = API.API_URL();
						var serviceId = "oa_2017V01ScheduleDelete";
						var state = app.getState(); //获取登陆信息
						var obj = {
							id: item.universalid,
						};
						app.ajax(serviceId, obj, function(data) {
							//服务器返回响应
							reloadNews(uRL, item.self);
							mui.toast('删除成功');
						});
					} else {

					}
				})
			}
			window.addEventListener('refreshE', function(e) {
             //在父页面中添加监听事件，刷新页面
                reloadNews(uRLs, self1);
			    reloadNews(uRLs, self2);
			    reloadNews(uRLs, self3);
				reloadNews(uRLs, self4); 
         });
          