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',
...@@ -31,9 +32,9 @@ declare var Swiper; ...@@ -31,9 +32,9 @@ declare var Swiper;
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;
...@@ -68,11 +69,9 @@ export class HomePage { ...@@ -68,11 +69,9 @@ export class HomePage {
weekNo; 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) {
} }
...@@ -93,7 +92,7 @@ export class HomePage { ...@@ -93,7 +92,7 @@ export class HomePage {
}); });
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('系统错误!');
}); });
...@@ -138,22 +137,23 @@ export class HomePage { ...@@ -138,22 +137,23 @@ export class HomePage {
goMyActivity() { goMyActivity() {
this.navCtrl.push("MyActivityListPage"); this.navCtrl.push("MyActivityListPage");
} }
goMyNotice() { goMyNotice() {
this.navCtrl.push("AnnouncementPage"); 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");
} }
...@@ -180,7 +180,7 @@ export class HomePage { ...@@ -180,7 +180,7 @@ export class HomePage {
//获取活动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();
...@@ -197,7 +197,7 @@ export class HomePage { ...@@ -197,7 +197,7 @@ export class HomePage {
//获取报备 //获取报备
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();
...@@ -213,7 +213,7 @@ export class HomePage { ...@@ -213,7 +213,7 @@ export class HomePage {
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});
}); });
} }
...@@ -226,7 +226,7 @@ export class HomePage { ...@@ -226,7 +226,7 @@ export class HomePage {
if (flag) { if (flag) {
this.appService.toast("您已经报名该活动,请在我的活动中查看!"); this.appService.toast("您已经报名该活动,请在我的活动中查看!");
} else { } else {
this.navCtrl.push("ActivityApplyPage", { item: item }); this.navCtrl.push("ActivityApplyPage", {item: item});
} }
}); });
...@@ -240,7 +240,7 @@ export class HomePage { ...@@ -240,7 +240,7 @@ export class HomePage {
} }
findMyOrderByOrderId(orderid, callback?) { findMyOrderByOrderId(orderid, callback?) {
let order = this.appService.ObserverHttpPost("/wisdomgroup/modules/order/findMyOrderByOrderId", { "orderid": orderid }) let order = this.appService.ObserverHttpPost("/wisdomgroup/modules/order/findMyOrderByOrderId", {"orderid": orderid})
.subscribe((res: Response) => { .subscribe((res: Response) => {
let data = res.json(); let data = res.json();
callback(data == null ? "[]" : data); callback(data == null ? "[]" : data);
...@@ -262,10 +262,8 @@ export class HomePage { ...@@ -262,10 +262,8 @@ export class HomePage {
} }
//消息通知 //消息通知
gotoNotice(){ gotoNotice() {
this.navCtrl.setRoot(NoticePage); this.navCtrl.setRoot(NoticePage);
this.navCtrl.parent.select(2); this.navCtrl.parent.select(2);
} }
...@@ -282,16 +280,16 @@ export class HomePage { ...@@ -282,16 +280,16 @@ export class HomePage {
} }
//问卷调查 //问卷调查
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')
} }
...@@ -303,7 +301,7 @@ export class HomePage { ...@@ -303,7 +301,7 @@ export class HomePage {
} }
//获取是否有新的活动 //获取是否有新的活动
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();
...@@ -315,7 +313,7 @@ export class HomePage { ...@@ -315,7 +313,7 @@ export class HomePage {
} }
//获取是否有新的公告 //获取是否有新的公告
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();
...@@ -327,7 +325,7 @@ export class HomePage { ...@@ -327,7 +325,7 @@ export class HomePage {
} }
//获取是否有新的报备 //获取是否有新的报备
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();
...@@ -338,13 +336,13 @@ export class HomePage { ...@@ -338,13 +336,13 @@ export class HomePage {
); );
} }
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();
} }
}) })
...@@ -352,25 +350,25 @@ export class HomePage { ...@@ -352,25 +350,25 @@ export class HomePage {
//日历 //日历
ionViewDidLoad(){ ionViewDidLoad() {
let date = new Date(); let date = new Date();
let year = date.getFullYear(); let year = date.getFullYear();
let month = date.getMonth() +1; let month = date.getMonth() + 1;
///schedule/app/getMyScheduleOnMonth ///schedule/app/getMyScheduleOnMonth
this.loadEvent(year,month); this.loadEvent(year, month);
} }
loadEvent(year,month){ loadEvent(year, month) {
let date = new Date(); let date = new Date();
//1.每月的周末 //1.每月的周末
let d = new Date(year,month,0).getDate(); let d = new Date(year, month, 0).getDate();
for( let i = 1; i< d +1;i++ ){ for (let i = 1; i < d + 1; i++) {
date.setFullYear(year,month -1,i); date.setFullYear(year, month - 1, i);
let day = date.getDay(); let day = date.getDay();
if(day == 6 || day ==0){ if (day == 6 || day == 0) {
const data = { const data = {
date: new Date(year,month -1,i), date: new Date(year, month - 1, i),
disable: true, disable: true,
cssClass: 'dayOff1' cssClass: 'dayOff1'
}; };
...@@ -379,46 +377,83 @@ export class HomePage { ...@@ -379,46 +377,83 @@ export class HomePage {
} }
//2.获取每月值班信息 //2.获取每月值班信息
const data = { const data = {
date:year + '/' + month +'/01' date: year + '/' + month + '/01'
}; };
this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data) this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data)
.subscribe((res: Response) => { .subscribe((res: Response) => {
let response = res.json(); let response = res.json();
for( let i = 0;i<response.length;i++ ){ for (let i = 0; i < response.length; i++) {
const data = { const data = {
date: new Date(response[i].dutyDate), date: new Date(response[i].dutyDate),
disable: true, disable: true,
cssClass: 'dayOff1 dayOff3' cssClass: 'dayOff3'
}; };
this.newArr.push(data); this.newArr.push(data);
} }
//3.参加活动日期
this.appService.ObserverHttpGetOption("/wisdomgroup/modules/order/appOrderCal", null)
.subscribe((res: Response) => {
let response = res.json();
response.forEach(event => {
this.newArr.push({
date: new Date(event.batch.batchGoDate),
disable: true,
cssClass: 'dayOff2'
})
});
//4.离沪日期
this.appService.ObserverHttpGetOption("/wisdomgroup/modules/userpre/appPreCal", null)
.subscribe((res: Response) => {
let response = res.json();
response.forEach(event => {
this.newArr.push({
date: new Date(event.formshTime),
disable: true,
cssClass: 'dayOff4'
})
});
console.log(this.newArr);
this.optionsMulti = { this.optionsMulti = {
pickMode: 'multi', pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ', monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay, weekdays: weekDay,
monthPickerFormat:monthCh, monthPickerFormat: monthCh,
weekStart: 0, weekStart: 0,
disableWeeks:[0,1,2,3,4,5,6], disableWeeks: [0, 1, 2, 3, 4, 5, 6],
daysConfig:this.newArr daysConfig: this.newArr
}; };
console.log(this.optionsMulti); console.log(this.optionsMulti);
}, error => { }, error => {
this.appService.alert('网络异常!'); this.appService.alert('网络异常!');
} }
); );
}, error => {
this.appService.alert('网络异常!');
} }
);
onChange(e){ }, error => {
this.appService.alert('网络异常!');
}
);
}
onChange(e) {
console.log(e); console.log(e);
} }
//月份改变 //月份改变
monChange(e){ monChange(e) {
this.loadEvent(e.newMonth.years,e.newMonth.months); this.loadEvent(e.newMonth.years, e.newMonth.months);
} }
} }
//定义星期实体 //定义星期实体
export class Week { export class Week {
id: number; id: number;
......
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