Skip to content
change-apply-list.ts 1.7 KiB
Newer Older
wangqinghua's avatar
wangqinghua committed
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {DutyApplyHandlePage} from "../duty-apply-handle/duty-apply-handle";
import {DutyChangeDetailPage} from "../duty-change-detail/duty-change-detail";
import {AppService} from "../../../../service/http.service";

@IonicPage()
@Component({
    selector: 'page-change-apply-list',
    templateUrl: 'change-apply-list.html',
})
export class ChangeApplyListPage {

    menuList = [
        {name: '待处理'},
        {name: '已处理'},
    ];
    changeType = 1;
    noList = [];
    doneList = [];

    constructor(public navCtrl: NavController, public navParams: NavParams,
                public appService: AppService) {
    }

    ionViewDidEnter() {
        const len = this.navCtrl.length() - 2 - 1;
        this.navCtrl.remove(2, len);
        this.getList();
    }

    getList() {
        //0 未处理  1 已处理
        const data = {
            type: 0
        };
        this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/applyListOfType', data)
            .subscribe((res) => {
                    this.noList = res.json();
                }
            );

        const data1 = {
            type: 1
        };
        this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/applyListOfType', data1)
            .subscribe((res) => {
                    this.doneList = res.json();
                }
            );

    }

    change(type) {
        this.changeType = type;
    }

    goApplyDetail(item) {
        this.navCtrl.push('DutyApplyHandlePage', {'item': item});
    }

    goToDetail(item) {
        this.navCtrl.push('DutyChangeDetailPage', {'item': item});
    }

}