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
import {Component, ViewChild} from '@angular/core';
import {IonicPage, NavController, NavParams, Slides} from 'ionic-angular';
import {Response} from '@angular/http';
import {AppService} from '../../../service/http.service';
import {OutGoingReportEditPage} from "../../home/report/outGoingReportEdit/outGoingReportEdit";
import {OutGoingReportViewPage} from "../../home/report/outGoingReportView/outGoingReportView";
import {Storage} from '@ionic/storage';
import {MinePage} from "../../tabs/mine/mine";
declare var Swiper;
@IonicPage()
@Component({
selector: 'page-myReport',
templateUrl: 'myReport.html',
})
export class MyReportPage {
swiperIndex = 0;
swiper: any;
allReport = [];
processingReport: Array<any> = [];
endReport: Array<any> = [];
//ViewChild传入一个字符串contentSlides,变量contentSlides接收。其它不变
@ViewChild('contentSlides') contentSlides: Slides;
menus: Array<string> = ['全部报备', '报备中', '已结束'];
constructor(public navCtrl: NavController,
public appService: AppService,
public storage: Storage) {
}
//初始化加载我的报备
ngOnInit(): void {
this.getAllMyReport();
}
//当页面加载的时候触发,只触发一次,当有缓存的的时候,打开页面时不在加载
ionViewDidLoad() {
}
//选择菜单
selectPageMenu(index) {
this.swiperIndex = index;
//切换页面
// this.contentSlides.slideTo(index);
}
//获取所有我的报备
getAllMyReport() {
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/getPremanagerByUser", null)
.subscribe((res: Response) => {
let data = res.json();
this.allReport = data;
this.allReport.forEach(element => {
if (!element["isOverTimeFlag"]) { //报备中
this.processingReport.push(element);
} else {
this.endReport.push(element); //已结束
}
});
}, error => {
}
);
}
//跳转到报备页面
goReport(report) {
if (report.isOverTimeFlag) {
return false;
}
this.storage.set("premanager", report);
this.navCtrl.push("OutGoingReportEditPage");
}
//跳转到报备查看详情页面
goDetail(report) {
this.navCtrl.push("OutGoingReportViewPage", {premanager: report});
}
goBack() {
this.navCtrl.popToRoot();
}
}