Commit 4ce0d73d authored by wangqinghua's avatar wangqinghua

日历

parent 2bc39c58
...@@ -9,21 +9,21 @@ ...@@ -9,21 +9,21 @@
</div> </div>
<div class="content-box"> <div class="content-box">
<div class="content-box-item {{type == '1'?'bgc-34b4fc':''}} " (click)="noSign()"> <div class="content-box-item {{type == '1'?'bgc-34b4fc':''}} " (click)="signAll()">
<span class="item-title">全部</span> <span class="item-title">全部</span>
<span class="item-count">{{notSign}}人</span> <span class="item-count">{{allPerson}}人</span>
</div> </div>
<div class="content-box-item {{type == '2'?'bgc-34b4fc':''}}" (click)="noSign()"> <div class="content-box-item {{type == '2'?'bgc-34b4fc':''}}" (click)="noSign()">
<span class="item-title">未报名</span> <span class="item-title">未报名</span>
<span class="item-count">{{waitgoOrder}}人</span> <span class="item-count">{{notSign}}人</span>
</div> </div>
<div class="content-box-item {{type == '3'?'bgc-34b4fc':''}}" (click)="sign()"> <div class="content-box-item {{type == '3'?'bgc-34b4fc':''}}" (click)="sign()">
<span class="item-title">已报名</span> <span class="item-title">已报名</span>
<span class="item-count">{{waitSureOrder}}人</span> <span class="item-count">{{signUp}}人</span>
</div> </div>
<div class="content-box-item {{type == '4'?'bgc-34b4fc':''}}" (click)="notJoin()"> <div class="content-box-item {{type == '4'?'bgc-34b4fc':''}}" (click)="notJoin()">
<span class="item-title">不参加</span> <span class="item-title">不参加</span>
<span class="item-count">{{waitSureOrder}}人</span> <span class="item-count">{{noJoin}}人</span>
</div> </div>
</div> </div>
......
...@@ -25,14 +25,12 @@ export class JoinDetailPage { ...@@ -25,14 +25,12 @@ export class JoinDetailPage {
acitivityName: string; acitivityName: string;
type = '1'; type = '1';
//待出行 //全部
waitgoOrder: number; allPerson: number;
//待确认 //已报名
waitSureOrder: number; signUp: number;
//未出行 //不参加
notgoOrder: number; noJoin: number;
//已出行
hasgoOrder: number;
//未报名 //未报名
notSign: number; notSign: number;
...@@ -42,9 +40,7 @@ export class JoinDetailPage { ...@@ -42,9 +40,7 @@ export class JoinDetailPage {
public http: Http, public http: Http,
public appService: AppService, public appService: AppService,
public toast: ToastController, public toast: ToastController,
public activityStatisticService: ActivityStatisticService) { public activityStatisticService: ActivityStatisticService) {}
}
ionViewDidEnter() { ionViewDidEnter() {
/** 订单状态 (1.待出行(已报名)、2.待确认(已报名未确认)、3.报名未出行、4.已完成 (3,4均为确认状态))*/ /** 订单状态 (1.待出行(已报名)、2.待确认(已报名未确认)、3.报名未出行、4.已完成 (3,4均为确认状态))*/
...@@ -52,80 +48,21 @@ export class JoinDetailPage { ...@@ -52,80 +48,21 @@ export class JoinDetailPage {
this.acitivityName = this.navParams.get("name"); //活动名称 this.acitivityName = this.navParams.get("name"); //活动名称
//初始化加载未报备 //初始化加载未报备
this.items = []; this.items = [];
this.signAll();
this.activityStatisticService.activityOrderCount(this.acitivityid, (data) => {
this.waitgoOrder = data["waitgoOrder"];
this.waitSureOrder = data["waitSureOrder"];
this.notgoOrder = data["notgoOrder"];
this.hasgoOrder = data["hasgoOrder"];
});
this.appService.ObserverHttpGetAdd("/wisdomgroup/modules/activity/signAll/", this.acitivityid)
.subscribe((res: Response) => {
let resultback = res.json();
this.items = resultback;
this.notSign = this.items.length;
}, error => {
this.appService.alert('网络异常!');
}
);
} }
//全部
conmon(state_value) { signAll(){
this.type = '1';
this.isNoSignFlag = true; this.appService.ObserverHttpGetAdd("/wisdomgroup/modules/activity/signAll/", this.acitivityid)
this.items = [];
this.appService.ObserverHttpPost("/wisdomgroup/modules/order/orderWaitGoWithActivityid", {
id: this.acitivityid,
state: state_value
})
.subscribe((res: Response) => { .subscribe((res: Response) => {
let resultback = res.json(); let resultback = res.json();
this.items = resultback; this.items = resultback;
this.allPerson = this.items.length;
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
); );
}
//报名待出行
hasSign() {
this.type = '2';
this.conmon(1);
}
//待确认
waitSure() {
this.type = '3';
this.conmon(2);
}
//不参加
notJoin() {
this.isNoSignFlag = true;
this.type = '4';
this.appService.ObserverHttpGet("/wisdomgroup/modules/activityNon", null)
.subscribe((res: Response) => {
this.items = res.json().data;
}, error => {
this.appService.alert('网络异常!');
}
);
}
//已确认未出行
notgo() {
this.type = '5';
this.conmon(3);
}
//已确认出行
hasgo() {
this.type = '4';
this.conmon(4);
} }
//未报名 //未报名
...@@ -137,6 +74,7 @@ export class JoinDetailPage { ...@@ -137,6 +74,7 @@ export class JoinDetailPage {
.subscribe((res: Response) => { .subscribe((res: Response) => {
let resultback = res.json(); let resultback = res.json();
this.items = resultback; this.items = resultback;
this.notSign = this.items.length;
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
...@@ -152,6 +90,21 @@ export class JoinDetailPage { ...@@ -152,6 +90,21 @@ export class JoinDetailPage {
.subscribe((res: Response) => { .subscribe((res: Response) => {
let resultback = res.json(); let resultback = res.json();
this.items = resultback; this.items = resultback;
this.signUp = this.items.length;
}, error => {
this.appService.alert('网络异常!');
}
);
}
//不参加
notJoin() {
this.isNoSignFlag = true;
this.type = '4';
this.appService.ObserverHttpGet("/wisdomgroup/modules/activityNon", null)
.subscribe((res: Response) => {
this.items = res.json().data;
this.noJoin = this.items.length;
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
......
...@@ -13,15 +13,11 @@ ...@@ -13,15 +13,11 @@
<div class="margin-5-0"> <div class="margin-5-0">
<label class="item1-title">{{activity?.activityName}}</label> <label class="item1-title">{{activity?.activityName}}</label>
<div class="item1-content-box"> <div class="item1-content-box">
<ion-icon name="md-contact" class="item1-icon"></ion-icon> <span class="item-type">不想参加</span>
<span class="item-type" *ngIf="activity?.activityType =='1'">体检</span>
<span class="item-type" *ngIf="activity?.activityType =='2'">疗养</span>
<span class="item-type" *ngIf="activity?.activityType =='3'">培训</span>
<span class="item-type" *ngIf="activity?.activityType =='4'">工会活动</span>
</div> </div>
</div> </div>
<div class="item1-introduction"> <div class="item1-introduction">
<!-- {{activity.activityIntro}} -->
{{activity.activityIntro}} {{activity.activityIntro}}
<button class="btn-introduce" (click)="show()">具体介绍</button> <button class="btn-introduce" (click)="show()">具体介绍</button>
</div> </div>
......
import { Component, ViewChild } from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import { NavController, IonicPage, Slides } from 'ionic-angular'; import {NavController, IonicPage, Slides} from 'ionic-angular';
import { ActivityListPage } from '../../activity/activityList/activityList'; import {ActivityListPage} from '../../activity/activityList/activityList';
import { Http, Response } from '@angular/http'; import {Http, Response} from '@angular/http';
import { ActivityStatisticService } from '../../../service/activityStatisticService'; import {ActivityStatisticService} from '../../../service/activityStatisticService';
import { MyActivityListPage } from '../../myActivityList/myActivityList'; import {MyActivityListPage} from '../../myActivityList/myActivityList';
import { AppService, AppGlobal } from '../../../service/appHttpService'; import {AppService, AppGlobal} from '../../../service/appHttpService';
import { Calendar } from '@ionic-native/calendar'; import {Calendar} from '@ionic-native/calendar';
import { ActivityApplyPage } from '../../activity/activityApply/activityApply' import {ActivityApplyPage} from '../../activity/activityApply/activityApply'
import { ActivityConfirmPage } from '../../activity/activityConfirm/activityConfirm'; import {ActivityConfirmPage} from '../../activity/activityConfirm/activityConfirm';
import { OutGoingReportPage } from '../../report/outGoingReport/outGoingReport'; import {OutGoingReportPage} from '../../report/outGoingReport/outGoingReport';
import { OperationListPage } from '../../operation-list/operation-list'; import {OperationListPage} from '../../operation-list/operation-list';
import { AnnouncementPage } from '../../announcement/announcement'; import {AnnouncementPage} from '../../announcement/announcement';
import { Storage } from '@ionic/storage'; import {Storage} from '@ionic/storage';
import { OutGoingReportEditPage } from '../../report/outGoingReportEdit/outGoingReportEdit'; import {OutGoingReportEditPage} from '../../report/outGoingReportEdit/outGoingReportEdit';
import { AnnouncementViewPage } from '../../announcementView/announcementView'; import {AnnouncementViewPage} from '../../announcementView/announcementView';
import {MoreAppPage} from "../../home/more-app/more-app"; import {MoreAppPage} from "../../home/more-app/more-app";
import {ReportTrackPage} from "../../report/reportTrack/reportTrack"; import {ReportTrackPage} from "../../report/reportTrack/reportTrack";
import {CalendarComponentOptions, DayConfig} from "ion2-calendar"; import {CalendarComponentOptions, DayConfig} from "ion2-calendar";
import {NoticePage} from "../notice/notice"; import {NoticePage} from "../notice/notice";
import {monthCh, weekDay} from "../../../app/main"; import {monthCh, weekDay} from "../../../app/main";
import { Badge } from '@ionic-native/badge'; import {Badge} from '@ionic-native/badge';
declare var Swiper; declare var Swiper;
@IonicPage() @IonicPage()
@Component({ @Component({
selector: 'page-home', selector: 'page-home',
templateUrl: 'home.html' templateUrl: 'home.html'
}) })
export class HomePage { export class HomePage {
@ViewChild(Slides) slides: Slides; @ViewChild(Slides) slides: Slides;
hasNewActivity:number = 0; hasNewActivity: number = 0;
hasNewNotice:number = 0; hasNewNotice: number = 0;
hasNewPremanager:number = 0; hasNewPremanager: number = 0;
//日历 //日历
date: string; date: string;
type: 'string'; type: 'string';
optionsMulti: CalendarComponentOptions; optionsMulti: CalendarComponentOptions;
newArr: DayConfig[] = []; newArr: DayConfig[] = [];
//待出行 //待出行
waitgoCount = '0'; waitgoCount = '0';
//待确认 //待确认
waitsureCount = '0'; waitsureCount = '0';
//未读通知 //未读通知
NoticeNotreadCount = '0'; NoticeNotreadCount = '0';
//尚未报备 //尚未报备
PremanagerNotdoCount = '0'; PremanagerNotdoCount = '0';
//是否显示正在开发中 //是否显示正在开发中
isWait: boolean = false; isWait: boolean = false;
slidersItems = [];
noticeList = [];
picture: string = AppGlobal.picture;
operations: Array<string>; slidersItems = [];
noticeList = [];
//当前年份 picture: string = AppGlobal.picture;
year;
//当前月份
month;
//当前第几周
weekNo;
operations: Array<string>;
//当前年份
year;
//当前月份
month;
//当前第几周
weekNo;
constructor(public navCtrl: NavController, public activityStatisticService: ActivityStatisticService, constructor(public navCtrl: NavController, public activityStatisticService: ActivityStatisticService,
public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage, public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage,
public badge:Badge) { public badge: Badge) {
} }
goActivity() { goActivity() {
this.navCtrl.push('ActivityListPage', {}); this.navCtrl.push('ActivityListPage', {});
} }
goAnnouncement() { goAnnouncement() {
this.navCtrl.push("AnnouncementPage"); this.navCtrl.push("AnnouncementPage");
} }
ngOnInit(): void { ngOnInit(): void {
this.appService.ObserverHttpGet("/wisdomgroup/modules/common/file/getBanner", {}).subscribe((res: Response) => { this.appService.ObserverHttpGet("/wisdomgroup/modules/common/file/getBanner", {}).subscribe((res: Response) => {
this.slidersItems = res.json(); this.slidersItems = res.json();
}, error => { }, error => {
this.appService.alert('系统错误!'); this.appService.alert('系统错误!');
}); });
this.appService.ObserverHttpGet("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null).subscribe((res: Response) => { this.appService.ObserverHttpGet("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null).subscribe((res: Response) => {
this.noticeList = res.json().slice(0,2); this.noticeList = res.json().slice(0, 2);
}, error => { }, error => {
this.appService.alert('系统错误!'); this.appService.alert('系统错误!');
});
}
ionViewDidEnter() {
//获取消息数量
this.getNewCount();
}
ionViewWillEnter() {
//初始化日期
this.getHasNewActivity();
this.getHasNewNotice();
this.getHasNewPremanager();
//统计待进行和待确认活动数目
this.activityStatisticService.myActivityOrderCount((data) => {
this.waitgoCount = data.waitgoOrder;
this.waitsureCount = data.waitSureOrder;
});
this.appService.ObserverHttpGet("/wisdomgroup/modules/common/file/getBanner", {}).subscribe((res: Response) => {
this.slidersItems = res.json();
}, error => {
this.appService.alert('网络异常!');
})
//初始化统计未读通知
this.activityStatisticService.myNoticeNotreadCount((data) => {
this.NoticeNotreadCount = data;
});
//初始化统计尚未报备
this.activityStatisticService.myNotdoPremanagerCount((data) => {
this.PremanagerNotdoCount = data;
}); });
//初始化操作记录
}
} goMyActivity() {
this.navCtrl.push("MyActivityListPage");
ionViewDidEnter() { }
//获取消息数量
this.getNewCount(); goMyNotice() {
} this.navCtrl.push("AnnouncementPage");
}
ionViewWillEnter() {
//初始化日期
this.getHasNewActivity();
this.getHasNewNotice();
this.getHasNewPremanager();
//统计待进行和待确认活动数目
this.activityStatisticService.myActivityOrderCount((data) => {
this.waitgoCount = data.waitgoOrder;
this.waitsureCount = data.waitSureOrder;
});
this.appService.ObserverHttpGet("/wisdomgroup/modules/common/file/getBanner", {}).subscribe((res: Response) => {
this.slidersItems = res.json();
}, error => {
this.appService.alert('网络异常!');
})
//初始化统计未读通知
this.activityStatisticService.myNoticeNotreadCount((data) => {
this.NoticeNotreadCount = data;
});
//初始化统计尚未报备
this.activityStatisticService.myNotdoPremanagerCount((data) => {
this.PremanagerNotdoCount = data;
});
//初始化操作记录
}
goMyActivity() {
this.navCtrl.push("MyActivityListPage");
}
goMyNotice() {
this.navCtrl.push("AnnouncementPage");
}
//问卷调查 //问卷调查
goToSurveyManage(){ goToSurveyManage() {
this.navCtrl.push('ListPage'); this.navCtrl.push('ListPage');
} }
//活动跟踪 //活动跟踪
goActivityTrack(){ goActivityTrack() {
this.navCtrl.push("ActivityTrackPage"); this.navCtrl.push("ActivityTrackPage");
} }
//报备跟踪 //报备跟踪
goReportTrack(){ goReportTrack() {
this.navCtrl.push("ReportTrackPage"); this.navCtrl.push("ReportTrackPage");
} }
wait() { wait() {
this.isWait = true; this.isWait = true;
} }
cancleWait() { cancleWait() {
this.isWait = false; this.isWait = false;
} }
go(item) { go(item) {
if (item.type == 1) { if (item.type == 1) {
this.getActivity(item.id); this.getActivity(item.id);
} else if (item.type == 2) { } else if (item.type == 2) {
this.getPremanager(item.id); this.getPremanager(item.id);
} else if (item.type == 3) { } else if (item.type == 3) {
this.navCtrl.push("AnnouncementViewPage", { this.navCtrl.push("AnnouncementViewPage", {
id: item.id id: item.id
}); });
}
} }
}
//获取活动ById //获取活动ById
getActivity(id) { getActivity(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/activity/appFindById", { id: id }) this.appService.ObserverHttpPost("/wisdomgroup/modules/activity/appFindById", {id: id})
.toPromise() .toPromise()
.then(res => { .then(res => {
let activity = res.json(); let activity = res.json();
if (activity.orderList.length == 0) { if (activity.orderList.length == 0) {
this.goApply(activity); this.goApply(activity);
} else { } else {
this.goDetail(activity); this.goDetail(activity);
} }
}) })
.catch(error => { .catch(error => {
}); });
} }
//获取报备 //获取报备
getPremanager(id) { getPremanager(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/findById", { id: id }) this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/findById", {id: id})
.toPromise() .toPromise()
.then(res => { .then(res => {
let premanager = res.json(); let premanager = res.json();
this.storage.set("premanager", premanager); this.storage.set("premanager", premanager);
this.navCtrl.push("OutGoingReportEditPage"); this.navCtrl.push("OutGoingReportEditPage");
}) })
.catch(error => { .catch(error => {
}); });
} }
//查看详情 //查看详情
goDetail(item) { goDetail(item) {
let orderid = item.orderList[0]["orderid"]; let orderid = item.orderList[0]["orderid"];
this.findMyOrderByOrderId(orderid, result => { this.findMyOrderByOrderId(orderid, result => {
let order = result; let order = result;
this.navCtrl.push("ActivityConfirmPage", { lookOrderDetails: order }); this.navCtrl.push("ActivityConfirmPage", {lookOrderDetails: order});
}); });
} }
//报名按钮 //报名按钮
goApply(item) { //活动状态:1:待发布(不可报名),2:发布中(可报名)3:已完成(报名截止) goApply(item) { //活动状态:1:待发布(不可报名),2:发布中(可报名)3:已完成(报名截止)
if (item.activityState == 2) { if (item.activityState == 2) {
let flag = false; let flag = false;
this.isExitOrderWithActivity(item, result => { this.isExitOrderWithActivity(item, result => {
flag = result; flag = result;
if (flag) { if (flag) {
this.appService.toast("您已经报名该活动,请在我的活动中查看!"); this.appService.toast("您已经报名该活动,请在我的活动中查看!");
} else {
this.navCtrl.push("ActivityApplyPage", {item: item});
}
});
} else { } else {
this.navCtrl.push("ActivityApplyPage", { item: item }); if (item.activityState == 1) {
this.appService.toast("报名暂未开通!");
} else {
this.appService.toast("活动已完成!");
}
} }
}); }
} else { findMyOrderByOrderId(orderid, callback?) {
if (item.activityState == 1) { let order = this.appService.ObserverHttpPost("/wisdomgroup/modules/order/findMyOrderByOrderId", {"orderid": orderid})
this.appService.toast("报名暂未开通!"); .subscribe((res: Response) => {
} else { let data = res.json();
this.appService.toast("活动已完成!"); callback(data == null ? "[]" : data);
} }, error => {
} this.appService.alert('网络异常!');
} }
);
findMyOrderByOrderId(orderid, callback?) { }
let order = this.appService.ObserverHttpPost("/wisdomgroup/modules/order/findMyOrderByOrderId", { "orderid": orderid })
.subscribe((res: Response) => { isExitOrderWithActivity(activity, callback?): any {
let data = res.json(); this.appService.ObserverHttpPost("/wisdomgroup/modules/order/isExitOrderWithActivity", activity)
callback(data == null ? "[]" : data); .toPromise()
}, error => { .then(res => {
this.appService.alert('网络异常!'); var data = res.json();
} callback(data == null ? "[]" : data);
); })
} .catch(error => {
});
isExitOrderWithActivity(activity, callback?): any { }
this.appService.ObserverHttpPost("/wisdomgroup/modules/order/isExitOrderWithActivity", activity)
.toPromise()
.then(res => { //消息通知
var data = res.json(); gotoNotice() {
callback(data == null ? "[]" : data);
})
.catch(error => {
});
}
//消息通知
gotoNotice(){
this.navCtrl.setRoot(NoticePage); this.navCtrl.setRoot(NoticePage);
this.navCtrl.parent.select(2); this.navCtrl.parent.select(2);
} }
goOperationListPage() { goOperationListPage() {
this.navCtrl.push("OperationListPage"); this.navCtrl.push("OperationListPage");
} }
//外出报备跳转 //外出报备跳转
goOutGoingReportAboutAll() { goOutGoingReportAboutAll() {
this.navCtrl.push("OutGoingReportPage", { this.navCtrl.push("OutGoingReportPage", {
type: 1 type: 1
}); });
} }
//问卷调查 //问卷调查
goToMySurvey(){ goToMySurvey() {
this.navCtrl.push('MySurveyPage'); this.navCtrl.push('MySurveyPage');
} }
goDuty(){ goDuty() {
this.navCtrl.push("DutyPage"); this.navCtrl.push("DutyPage");
} }
//更多应用 //更多应用
gotoMore(){ gotoMore() {
this.navCtrl.push('MoreAppPage') this.navCtrl.push('MoreAppPage')
} }
//尚未报备跳转 //尚未报备跳转
goOutGoingReportAboutNot() { goOutGoingReportAboutNot() {
this.navCtrl.push("OutGoingReportPage", { this.navCtrl.push("OutGoingReportPage", {
type: 2 type: 2
}); });
} }
//获取是否有新的活动 //获取是否有新的活动
getHasNewActivity(){ getHasNewActivity() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/hasNewActivity", null) this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/hasNewActivity", null)
.subscribe((res: Response) => { .subscribe((res: Response) => {
let data = res.json(); let data = res.json();
this.hasNewActivity = data; this.hasNewActivity = data;
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
); );
} }
//获取是否有新的公告 //获取是否有新的公告
getHasNewNotice(){ getHasNewNotice() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/notice/hasNewNotice", null) this.appService.ObserverHttpGet("/wisdomgroup/modules/notice/hasNewNotice", null)
.subscribe((res: Response) => { .subscribe((res: Response) => {
let data = res.json(); let data = res.json();
this.hasNewNotice = data; this.hasNewNotice = data;
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
); );
} }
//获取是否有新的报备 //获取是否有新的报备
getHasNewPremanager(){ getHasNewPremanager() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/premanager/hasNewPremanager", null) this.appService.ObserverHttpGet("/wisdomgroup/modules/premanager/hasNewPremanager", null)
.subscribe((res: Response) => { .subscribe((res: Response) => {
let data = res.json(); let data = res.json();
this.hasNewPremanager = data; this.hasNewPremanager = data;
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
); );
} }
getNewCount(){ getNewCount() {
this.appService.ObserverHttpGetData('/wisdomgroup/modules/activity/hasNewCount',null) this.appService.ObserverHttpGetData('/wisdomgroup/modules/activity/hasNewCount', null)
.subscribe((res)=>{ .subscribe((res) => {
let data = Number(res.json()); let data = Number(res.json());
if( data > 0 ){ if (data > 0) {
this.badge.set(data); this.badge.set(data);
}else{ } else {
this.badge.clear(); this.badge.clear();
}
})
}
//日历
ionViewDidLoad() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
///schedule/app/getMyScheduleOnMonth
this.loadEvent(year, month);
}
loadEvent(year, month) {
let date = new Date();
//1.每月的周末
let d = new Date(year, month, 0).getDate();
for (let i = 1; i < d + 1; i++) {
date.setFullYear(year, month - 1, i);
let day = date.getDay();
if (day == 6 || day == 0) {
const data = {
date: new Date(year, month - 1, i),
disable: true,
cssClass: 'dayOff1'
};
this.newArr.push(data);
} }
}) }
} //2.获取每月值班信息
const data = {
//日历 date: year + '/' + month + '/01'
};
ionViewDidLoad(){ this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data)
let date = new Date(); .subscribe((res: Response) => {
let year = date.getFullYear(); let response = res.json();
let month = date.getMonth() +1; for (let i = 0; i < response.length; i++) {
///schedule/app/getMyScheduleOnMonth const data = {
this.loadEvent(year,month); date: new Date(response[i].dutyDate),
} disable: true,
cssClass: 'dayOff3'
loadEvent(year,month){ };
let date = new Date(); this.newArr.push(data);
}
//1.每月的周末
let d = new Date(year,month,0).getDate(); //3.参加活动日期
for( let i = 1; i< d +1;i++ ){ this.appService.ObserverHttpGetOption("/wisdomgroup/modules/order/appOrderCal", null)
date.setFullYear(year,month -1,i); .subscribe((res: Response) => {
let day = date.getDay(); let response = res.json();
if(day == 6 || day ==0){ response.forEach(event => {
const data = { this.newArr.push({
date: new Date(year,month -1,i), date: new Date(event.batch.batchGoDate),
disable: true, disable: true,
cssClass: 'dayOff1' cssClass: 'dayOff2'
}; })
this.newArr.push(data); });
}
} //4.离沪日期
//2.获取每月值班信息 this.appService.ObserverHttpGetOption("/wisdomgroup/modules/userpre/appPreCal", null)
const data = { .subscribe((res: Response) => {
date:year + '/' + month +'/01' let response = res.json();
}; response.forEach(event => {
this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data) this.newArr.push({
.subscribe((res: Response) => { date: new Date(event.formshTime),
let response = res.json(); disable: true,
for( let i = 0;i<response.length;i++ ){ cssClass: 'dayOff4'
const data = { })
date: new Date(response[i].dutyDate), });
disable: true, console.log(this.newArr);
cssClass: 'dayOff1 dayOff3' this.optionsMulti = {
}; pickMode: 'multi',
this.newArr.push(data); monthFormat: 'YYYY 年 MM 月 ',
} weekdays: weekDay,
this.optionsMulti = { monthPickerFormat: monthCh,
pickMode: 'multi', weekStart: 0,
monthFormat: 'YYYY 年 MM 月 ', disableWeeks: [0, 1, 2, 3, 4, 5, 6],
weekdays: weekDay, daysConfig: this.newArr
monthPickerFormat:monthCh, };
weekStart: 0, console.log(this.optionsMulti);
disableWeeks:[0,1,2,3,4,5,6],
daysConfig:this.newArr }, error => {
}; this.appService.alert('网络异常!');
console.log(this.optionsMulti); }
}, error => { );
this.appService.alert('网络异常!');
} }, error => {
); this.appService.alert('网络异常!');
}
} );
onChange(e){ }, error => {
console.log(e); this.appService.alert('网络异常!');
} }
);
//月份改变
monChange(e){ }
this.loadEvent(e.newMonth.years,e.newMonth.months);
} onChange(e) {
console.log(e);
}
//月份改变
monChange(e) {
this.loadEvent(e.newMonth.years, e.newMonth.months);
}
} }
//定义星期实体 //定义星期实体
export class Week { export class Week {
id: number; id: number;
title: string; title: string;
date: number; date: number;
isToday: boolean = false; isToday: boolean = false;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment