Commit e493940f authored by wangqinghua's avatar wangqinghua

color

parent fdc96cfd
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {AppService} from "../../../service/appHttpService";
import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure";
import {CalendarComponentOptions, DayConfig} from "ion2-calendar";
import {monthCh, weekDay} from "../../../app/main";
import { DatePipe } from "@angular/common";
import {DatePipe} from "@angular/common";
@IonicPage()
@Component({
......@@ -22,8 +22,9 @@ export class SelectChangePersonPage {
date; //换班日期
list = [];
type;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService,public datePipe: DatePipe) {
public appService: AppService, public datePipe: DatePipe) {
}
ionViewDidLoad() {
......@@ -31,16 +32,15 @@ export class SelectChangePersonPage {
this.getDetail();
}
getDetail(){
const year = this.datePipe.transform( this.navParams.get('date'),'yyyy' );
const month = this.datePipe.transform( this.navParams.get('date'),'MM' );
getDetail() {
const year = this.datePipe.transform(this.navParams.get('date'), 'yyyy');
const month = this.datePipe.transform(this.navParams.get('date'), 'MM');
const data = {
id:this.scheduleId
id: this.scheduleId
}
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleById',data).
subscribe((res)=>{
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleById', data).subscribe((res) => {
this.type = res.json().type;
this.getMonth(year,month);
this.getMonth(year, month);
})
}
......@@ -51,7 +51,7 @@ export class SelectChangePersonPage {
this.getMonth(e.newMonth.years, e.newMonth.months);
}
getMonth(year,month){
getMonth(year, month) {
let date = new Date();
//4.每月的周末
......@@ -68,18 +68,18 @@ export class SelectChangePersonPage {
// }
// }
const data = {
date:year + '/' + month + '/01',
type:this.type
date: year + '/' + month + '/01',
type: this.type
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonthAndType',data)
.subscribe((res)=>{
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonthAndType', data)
.subscribe((res) => {
let response = res.json();
response.forEach(event=>{
response.forEach(event => {
this.newArr.push({
date:new Date(event.dutyDate),
disable:false,
subTitle:event.name,
cssClass:event.id
date: new Date(event.dutyDate),
disable: false,
subTitle: event.name,
cssClass: event.id
})
});
this.optionsMulti = {
......@@ -94,26 +94,29 @@ export class SelectChangePersonPage {
}
onSelect(e){
onSelect(e) {
this.changeInfo = null;
console.log(e);
if (e.subTitle != '') {
this.changeInfo = e;
}
}
//换班
submit(){
if(!this.changeInfo){
this.appService.popToastView('请选择换班人员','middle',1500);
submit() {
if (!this.changeInfo) {
this.appService.popToastView('请选择换班人员', 'middle', 1500);
return false;
}
const item = {
name:this.changeInfo.subTitle,
time:this.changeInfo.time
name: this.changeInfo.subTitle,
time: this.changeInfo.time
};
this.navCtrl.push('ChangeApplySurePage',{
'changeId':this.changeInfo.cssClass,
'nowId':this.scheduleId,
'item':item,
'applyId':this.navParams.get('applyId'),
this.navCtrl.push('ChangeApplySurePage', {
'changeId': this.changeInfo.cssClass,
'nowId': this.scheduleId,
'item': item,
'applyId': this.navParams.get('applyId'),
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment