Newer
Older
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {CalendarComponentOptions} from "ion2-calendar";
import {monthCh, weekDay} from "../../../app/main";
import {ServeService} from "../serve.service";
import {DatePipe} from "@angular/common";
import {RoomApplyPage} from "../meet-room/room-apply/room-apply";
import {AppGlobal} from "../../../service/http.service";
import {CommonService} from "../../../provide/common.service";
import {CarApplyPage} from "./car-apply/car-apply";
changeType = 1;
date = new Date();
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat: monthCh,
pickMode: 'single',
color: 'danger'
};
pageNumber = 1;
pageSize = AppGlobal.pageCount;
total;
isLoad = true;
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public datePipe: DatePipe,
private commonSer: CommonService, private appMainSer: AppMainService) {
}
this.selectDate = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply();
//获取权限
this.appMainSer.role.subscribe(value => {
this.role = value;
}
);
//获取个人信息
this.appMainSer.mineInfo.subscribe(value => {
this.mineInfo = value;
})
this.checkObj.checkedApplyList = res.data.checkedApplyList;
this.checkObj.uncheckApplyist = res.data.uncheckApplyist;
getDate(e) {
this.selectDate = e;
this.getApply();
}
//我的预定
myApply() {
const data = {
P_pageNumber: this.pageNumber,
P_pageSize: this.pageSize,
(res) => {
if (res.errcode == 1000) {
this.commonSer.toast('取消预定成功');
this.myApply();
} else {
this.commonSer.toast(res.errmsg);
}
}
)
}
if (this.changeType == 1) this.getApply();
if (this.changeType == 2) this.myApply();
}
//新增申请
goApply() {
this.navCtrl.push(RoomApplyPage);
}