Newer
Older
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {CalendarComponentOptions} from "ion2-calendar";
import {AppService} from "../../../service/appHttpService";
import {DutyApplyPage} from "../duty-apply/duty-apply";
import {DutyDetailPage} from "../duty-detail/duty-detail";
declare var Swiper;
@IonicPage()
@Component({
selector: 'page-duty',
templateUrl: 'duty.html',
})
export class DutyPage {
menuList = [
{name:'值班安排'},
{name:'我的值班'},
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat:monthCh,
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
const date = new Date().toLocaleDateString();
this.getDuty(date);
this.myDuty();
this.selectPageMenu(0);
this.getSchedule()
}
selectPageMenu(index) {
this.swiperIndex = index;
//切换页面
// this.contentSlides.slideTo(index);
}
getSchedule(){
}
change(type){
this.changeType = type;
}
onChange(e){
this.getDuty(date);
}
getDuty(date){
//0 白班 1 夜班
const data = {
date:date,
type:0
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleInfo',data)
.subscribe((res)=>{
});
const data1 = {
date:date,
type:1
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleInfo',data1)
.subscribe((res)=>{
});
}
//我的值班
myDuty(){
const data = {
type:0
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/app/getMySchedule',data)
.subscribe((res)=>{
this.nowDuty = res.json();
});
const data1 = {
type:1
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/app/getMySchedule',data1)
.subscribe((res)=>{
this.historyDuty = res;
});
}