Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {AppService} from "../../../service/http.service";
@IonicPage()
@Component({
selector: 'page-my-duty',
templateUrl: 'my-duty.html',
})
export class MyDutyPage {
changeType = 1;
nowDuty = [];
historyDuty = [];
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidLoad() {
this.getDuty();
}
change(type){
this.changeType = type;
}
getDuty(){
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.json();
});
}
//提交申请
dutyApply(item){
let nowTime = new Date().getTime();
if(nowTime > item.dutyDate){
this.appService.popToastView('该条值班已过期','middle',1500);
return false;
}
this.navCtrl.push('DutyApplyPage',{
id:item.id,
date:item.dutyDate
})
}
//申请详情
dutyDetail(item){
this.navCtrl.push('DutyDetailPage',{
"id":item.applyId,
'time':item.dutyDate
})
}
}