import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {AppService} from "../../../service/appHttpService";
import {SelectChangePersonPage} from "../select-change-person/select-change-person";
import {SelectRelayPersonPage} from "../select-relay-person/select-relay-person";

@IonicPage()
@Component({
  selector: 'page-duty-apply-handle',
  templateUrl: 'duty-apply-handle.html',
})
export class DutyApplyHandlePage {

    applyDetail = {
      reason:''
    };
    personDetail = {
        id:'',
        name:'',
        phoneNumber:'',
        dutyDate:''
    };
  constructor(public navCtrl: NavController, public navParams: NavParams,
              public appService: AppService) {
  }

  ionViewDidLoad() {

    this.personDetail = this.navParams.get('item');
    console.log(this.personDetail);
      this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/apply',{'id': this.personDetail.id})
          .subscribe((res)=>{
             this.applyDetail = res.json();
          })
  }

    submit(type){
      switch (type){
          case '1':{
            this.navCtrl.push('SelectChangePersonPage');
            break;
          }
          case '2':{
              this.navCtrl.push('SelectRelayPersonPage');
              break;
          }
          case '3':{

              break;
          }
      }
    }

}
