Commit 4ce0d73d authored by wangqinghua's avatar wangqinghua

日历

parent 2bc39c58
......@@ -9,21 +9,21 @@
</div>
<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-count">{{notSign}}人</span>
<span class="item-count">{{allPerson}}人</span>
</div>
<div class="content-box-item {{type == '2'?'bgc-34b4fc':''}}" (click)="noSign()">
<span class="item-title">未报名</span>
<span class="item-count">{{waitgoOrder}}人</span>
<span class="item-count">{{notSign}}人</span>
</div>
<div class="content-box-item {{type == '3'?'bgc-34b4fc':''}}" (click)="sign()">
<span class="item-title">已报名</span>
<span class="item-count">{{waitSureOrder}}人</span>
<span class="item-count">{{signUp}}人</span>
</div>
<div class="content-box-item {{type == '4'?'bgc-34b4fc':''}}" (click)="notJoin()">
<span class="item-title">不参加</span>
<span class="item-count">{{waitSureOrder}}人</span>
<span class="item-count">{{noJoin}}人</span>
</div>
</div>
......
......@@ -25,14 +25,12 @@ export class JoinDetailPage {
acitivityName: string;
type = '1';
//待出行
waitgoOrder: number;
//待确认
waitSureOrder: number;
//未出行
notgoOrder: number;
//已出行
hasgoOrder: number;
//全部
allPerson: number;
//已报名
signUp: number;
//不参加
noJoin: number;
//未报名
notSign: number;
......@@ -42,9 +40,7 @@ export class JoinDetailPage {
public http: Http,
public appService: AppService,
public toast: ToastController,
public activityStatisticService: ActivityStatisticService) {
}
public activityStatisticService: ActivityStatisticService) {}
ionViewDidEnter() {
/** 订单状态 (1.待出行(已报名)、2.待确认(已报名未确认)、3.报名未出行、4.已完成 (3,4均为确认状态))*/
......@@ -52,80 +48,21 @@ export class JoinDetailPage {
this.acitivityName = this.navParams.get("name"); //活动名称
//初始化加载未报备
this.items = [];
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('网络异常!');
}
);
this.signAll();
}
conmon(state_value) {
this.isNoSignFlag = true;
this.items = [];
this.appService.ObserverHttpPost("/wisdomgroup/modules/order/orderWaitGoWithActivityid", {
id: this.acitivityid,
state: state_value
})
//全部
signAll(){
this.type = '1';
this.appService.ObserverHttpGetAdd("/wisdomgroup/modules/activity/signAll/", this.acitivityid)
.subscribe((res: Response) => {
let resultback = res.json();
this.items = resultback;
this.allPerson = this.items.length;
}, error => {
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 {
.subscribe((res: Response) => {
let resultback = res.json();
this.items = resultback;
this.notSign = this.items.length;
}, error => {
this.appService.alert('网络异常!');
}
......@@ -152,6 +90,21 @@ export class JoinDetailPage {
.subscribe((res: Response) => {
let resultback = res.json();
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 => {
this.appService.alert('网络异常!');
}
......
......@@ -13,15 +13,11 @@
<div class="margin-5-0">
<label class="item1-title">{{activity?.activityName}}</label>
<div class="item1-content-box">
<ion-icon name="md-contact" class="item1-icon"></ion-icon>
<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>
<span class="item-type">不想参加</span>
</div>
</div>
<div class="item1-introduction">
<!-- {{activity.activityIntro}} -->
{{activity.activityIntro}}
<button class="btn-introduce" (click)="show()">具体介绍</button>
</div>
......
import { Component, ViewChild } from '@angular/core';
import { NavController, IonicPage, Slides } from 'ionic-angular';
import { ActivityListPage } from '../../activity/activityList/activityList';
import { Http, Response } from '@angular/http';
import { ActivityStatisticService } from '../../../service/activityStatisticService';
import { MyActivityListPage } from '../../myActivityList/myActivityList';
import { AppService, AppGlobal } from '../../../service/appHttpService';
import { Calendar } from '@ionic-native/calendar';
import { ActivityApplyPage } from '../../activity/activityApply/activityApply'
import { ActivityConfirmPage } from '../../activity/activityConfirm/activityConfirm';
import { OutGoingReportPage } from '../../report/outGoingReport/outGoingReport';
import { OperationListPage } from '../../operation-list/operation-list';
import { AnnouncementPage } from '../../announcement/announcement';
import { Storage } from '@ionic/storage';
import { OutGoingReportEditPage } from '../../report/outGoingReportEdit/outGoingReportEdit';
import { AnnouncementViewPage } from '../../announcementView/announcementView';
import {Component, ViewChild} from '@angular/core';
import {NavController, IonicPage, Slides} from 'ionic-angular';
import {ActivityListPage} from '../../activity/activityList/activityList';
import {Http, Response} from '@angular/http';
import {ActivityStatisticService} from '../../../service/activityStatisticService';
import {MyActivityListPage} from '../../myActivityList/myActivityList';
import {AppService, AppGlobal} from '../../../service/appHttpService';
import {Calendar} from '@ionic-native/calendar';
import {ActivityApplyPage} from '../../activity/activityApply/activityApply'
import {ActivityConfirmPage} from '../../activity/activityConfirm/activityConfirm';
import {OutGoingReportPage} from '../../report/outGoingReport/outGoingReport';
import {OperationListPage} from '../../operation-list/operation-list';
import {AnnouncementPage} from '../../announcement/announcement';
import {Storage} from '@ionic/storage';
import {OutGoingReportEditPage} from '../../report/outGoingReportEdit/outGoingReportEdit';
import {AnnouncementViewPage} from '../../announcementView/announcementView';
import {MoreAppPage} from "../../home/more-app/more-app";
import {ReportTrackPage} from "../../report/reportTrack/reportTrack";
import {CalendarComponentOptions, DayConfig} from "ion2-calendar";
import {NoticePage} from "../notice/notice";
import {monthCh, weekDay} from "../../../app/main";
import { Badge } from '@ionic-native/badge';
import {Badge} from '@ionic-native/badge';
declare var Swiper;
@IonicPage()
@Component({
selector: 'page-home',
......@@ -31,9 +32,9 @@ declare var Swiper;
export class HomePage {
@ViewChild(Slides) slides: Slides;
hasNewActivity:number = 0;
hasNewNotice:number = 0;
hasNewPremanager:number = 0;
hasNewActivity: number = 0;
hasNewNotice: number = 0;
hasNewPremanager: number = 0;
//日历
date: string;
......@@ -68,11 +69,9 @@ export class HomePage {
weekNo;
constructor(public navCtrl: NavController, public activityStatisticService: ActivityStatisticService,
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 {
});
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 => {
this.appService.alert('系统错误!');
});
......@@ -138,22 +137,23 @@ export class HomePage {
goMyActivity() {
this.navCtrl.push("MyActivityListPage");
}
goMyNotice() {
this.navCtrl.push("AnnouncementPage");
}
//问卷调查
goToSurveyManage(){
goToSurveyManage() {
this.navCtrl.push('ListPage');
}
//活动跟踪
goActivityTrack(){
goActivityTrack() {
this.navCtrl.push("ActivityTrackPage");
}
//报备跟踪
goReportTrack(){
goReportTrack() {
this.navCtrl.push("ReportTrackPage");
}
......@@ -180,7 +180,7 @@ export class HomePage {
//获取活动ById
getActivity(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/activity/appFindById", { id: id })
this.appService.ObserverHttpPost("/wisdomgroup/modules/activity/appFindById", {id: id})
.toPromise()
.then(res => {
let activity = res.json();
......@@ -197,7 +197,7 @@ export class HomePage {
//获取报备
getPremanager(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/findById", { id: id })
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/findById", {id: id})
.toPromise()
.then(res => {
let premanager = res.json();
......@@ -213,7 +213,7 @@ export class HomePage {
let orderid = item.orderList[0]["orderid"];
this.findMyOrderByOrderId(orderid, result => {
let order = result;
this.navCtrl.push("ActivityConfirmPage", { lookOrderDetails: order });
this.navCtrl.push("ActivityConfirmPage", {lookOrderDetails: order});
});
}
......@@ -226,7 +226,7 @@ export class HomePage {
if (flag) {
this.appService.toast("您已经报名该活动,请在我的活动中查看!");
} else {
this.navCtrl.push("ActivityApplyPage", { item: item });
this.navCtrl.push("ActivityApplyPage", {item: item});
}
});
......@@ -240,7 +240,7 @@ export class HomePage {
}
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) => {
let data = res.json();
callback(data == null ? "[]" : data);
......@@ -262,10 +262,8 @@ export class HomePage {
}
//消息通知
gotoNotice(){
gotoNotice() {
this.navCtrl.setRoot(NoticePage);
this.navCtrl.parent.select(2);
}
......@@ -282,16 +280,16 @@ export class HomePage {
}
//问卷调查
goToMySurvey(){
goToMySurvey() {
this.navCtrl.push('MySurveyPage');
}
goDuty(){
goDuty() {
this.navCtrl.push("DutyPage");
}
//更多应用
gotoMore(){
gotoMore() {
this.navCtrl.push('MoreAppPage')
}
......@@ -303,7 +301,7 @@ export class HomePage {
}
//获取是否有新的活动
getHasNewActivity(){
getHasNewActivity() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/hasNewActivity", null)
.subscribe((res: Response) => {
let data = res.json();
......@@ -315,7 +313,7 @@ export class HomePage {
}
//获取是否有新的公告
getHasNewNotice(){
getHasNewNotice() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/notice/hasNewNotice", null)
.subscribe((res: Response) => {
let data = res.json();
......@@ -327,7 +325,7 @@ export class HomePage {
}
//获取是否有新的报备
getHasNewPremanager(){
getHasNewPremanager() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/premanager/hasNewPremanager", null)
.subscribe((res: Response) => {
let data = res.json();
......@@ -338,13 +336,13 @@ export class HomePage {
);
}
getNewCount(){
this.appService.ObserverHttpGetData('/wisdomgroup/modules/activity/hasNewCount',null)
.subscribe((res)=>{
getNewCount() {
this.appService.ObserverHttpGetData('/wisdomgroup/modules/activity/hasNewCount', null)
.subscribe((res) => {
let data = Number(res.json());
if( data > 0 ){
if (data > 0) {
this.badge.set(data);
}else{
} else {
this.badge.clear();
}
})
......@@ -352,25 +350,25 @@ export class HomePage {
//日历
ionViewDidLoad(){
ionViewDidLoad() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() +1;
let month = date.getMonth() + 1;
///schedule/app/getMyScheduleOnMonth
this.loadEvent(year,month);
this.loadEvent(year, month);
}
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 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){
if (day == 6 || day == 0) {
const data = {
date: new Date(year,month -1,i),
date: new Date(year, month - 1, i),
disable: true,
cssClass: 'dayOff1'
};
......@@ -379,46 +377,83 @@ export class HomePage {
}
//2.获取每月值班信息
const data = {
date:year + '/' + month +'/01'
date: year + '/' + month + '/01'
};
this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data)
.subscribe((res: Response) => {
let response = res.json();
for( let i = 0;i<response.length;i++ ){
for (let i = 0; i < response.length; i++) {
const data = {
date: new Date(response[i].dutyDate),
disable: true,
cssClass: 'dayOff1 dayOff3'
cssClass: 'dayOff3'
};
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 = {
pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat:monthCh,
monthPickerFormat: monthCh,
weekStart: 0,
disableWeeks:[0,1,2,3,4,5,6],
daysConfig:this.newArr
disableWeeks: [0, 1, 2, 3, 4, 5, 6],
daysConfig: this.newArr
};
console.log(this.optionsMulti);
}, error => {
this.appService.alert('网络异常!');
}
);
}, error => {
this.appService.alert('网络异常!');
}
);
onChange(e){
}, error => {
this.appService.alert('网络异常!');
}
);
}
onChange(e) {
console.log(e);
}
//月份改变
monChange(e){
this.loadEvent(e.newMonth.years,e.newMonth.months);
monChange(e) {
this.loadEvent(e.newMonth.years, e.newMonth.months);
}
}
//定义星期实体
export class Week {
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