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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams, AlertController, ToastController} from 'ionic-angular';
import {Http, Response} from '@angular/http';
import {Storage} from '@ionic/storage';
import {ReportSearchPage} from "../report-search/report-search";
import {AppService,AppGlobal} from "../../../../service/http.service";
@IonicPage()
@Component({
selector: 'page-reportDetail',
templateUrl: 'reportDetail.html',
})
export class ReportDetailPage {
items: object[] = [];
itemsOfNotReport: object[] = [];
itemsOfLeave: object[] = [];
itemsOfNotLeave: object[] = [];
title: string;
type: number;
id;
picture: string = AppGlobal.picture;
premanager; //报备信息
constructor(public navCtrl: NavController,
public navParams: NavParams,
public alertCtrl: AlertController,
public http: Http, public storage: Storage,
public appService: AppService, public toast: ToastController) {
}
ionViewDidLoad() {
this.premanager = this.navParams.get('item');
this.title = this.navParams.get("title");
this.id = this.navParams.get("id");
}
ionViewDidEnter() {
this.getUserAboutLeave(this.id);
this.getUserAboutNotLeave(this.id);
this.getUserAboutNotReport(this.id);
}
//获取处室下所有未报备人员
getUserAboutNotReport(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/getUserAboutNotReport", {id: id})
.subscribe((res: Response) => {
let data = res.json();
this.itemsOfNotReport = data;
this.items = data;
this.type = 1;
}, error => {
}
);
}
//获取处室下所有离沪报备人员
getUserAboutLeave(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/getUserAboutLeave", {id: id})
.subscribe((res: Response) => {
let data = res.json();
this.itemsOfLeave = data;
}, error => {
}
);
}
//获取处室下所有不离沪报备人员
getUserAboutNotLeave(id) {
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/getUserAboutNotLeave", {id: id})
.subscribe((res: Response) => {
let data = res.json();
this.itemsOfNotLeave = data;
}, error => {
}
);
}
//切换
change(type) {
if (type == 1) {
this.type = type;
this.items = this.itemsOfNotReport;
} else if (type == 2) {
this.type = type;
this.items = this.itemsOfLeave;
} else if (type == 3) {
this.type = type;
this.items = this.itemsOfNotLeave;
}
}
//协助报备
goReport(item) {
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
this.storage.remove("person");
this.storage.set('premanager', this.premanager);
this.storage.set('person', item);
this.navCtrl.push('OutGoingReportEditPage', {premanager: 'null'});
}
//修改报备
editReport(item){
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
this.storage.remove("person");
this.storage.set('premanager', this.premanager);
this.storage.set('person', item);
this.navCtrl.push('OutGoingReportEditPage', {premanager: 'null',userid:item.id});
}
search(){
this.navCtrl.push('ReportSearchPage',{id:this.id,'premanager':this.premanager});
}
}