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
69
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {ChangeApplyListPage} from "../change-apply-list/change-apply-list";
import {AppService} from "../../../../service/http.service";
@IonicPage()
@Component({
selector: 'page-change-apply-sure',
templateUrl: 'change-apply-sure.html',
})
export class ChangeApplySurePage {
item; //替班人信息or换班人信息
applyDetail; //申请信息
applyType; //申请类型
changeId; // 换班Id
personId; //替班人id
nowId; //申请id
applyId;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidLoad() {
this.item = this.navParams.get('item');
this.applyId = this.navParams.get('applyId');
this.personId = this.navParams.get('personId');
this.nowId = this.navParams.get('nowId');
this.changeId = this.navParams.get('changeId');
if (this.personId) {
this.applyType = 'replace'; //值班
} else {
this.applyType = 'change'; //替班
}
this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/apply',{'id': this.applyId})
.subscribe((res)=>{
this.applyDetail = res.json();
})
}
//替班
replace() {
const data = {
id: this.nowId, //值班记录id
personId: this.personId //替班人id
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/replace', data)
.subscribe((res) => {
this.appService.popToastView('处理成功!','middle',1000);
this.navCtrl.push('ChangeApplyListPage');
})
}
//换班
change() {
const data = {
nowId: this.nowId, //值班记录id
changeId: this.changeId //互换的值班ID
};
// this.navCtrl.pop();
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/change',data)
.subscribe((res) => {
this.appService.popToastView('处理成功!','middle',1000);
this.navCtrl.push('ChangeApplyListPage');
})
}
}