Commit 2bc39c58 authored by wangqinghua's avatar wangqinghua

日历

parent f834bc36
......@@ -11,7 +11,7 @@
<ion-list>
<ion-item>
<span>值班日期:</span>
<span>值班日期:</span>
<span>{{time | date:'yyyy-MM-dd'}}</span>
</ion-item>
<ion-item>
<span>换班原因:</span>
......
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { AppService } from "../../../service/appHttpService";
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {AppService} from "../../../service/appHttpService";
@IonicPage()
@Component({
selector: 'page-duty-detail',
templateUrl: 'duty-detail.html',
selector: 'page-duty-detail',
templateUrl: 'duty-detail.html',
})
export class DutyDetailPage {
time;
dutyDetail = {
reason:'',
id:''
reason: '',
id: ''
};
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidLoad() {
const id = this.navParams.get('id');
console.log(id);
this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/apply',{'id':id})
.subscribe((res)=>{
this.dutyDetail = res.json();
})
}
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
submitOrder(){
ionViewDidLoad() {
const id = this.navParams.get('id');
this.time = this.navParams.get('time');
this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/apply', {'id': id})
.subscribe((res) => {
this.dutyDetail = res.json();
})
}
submitOrder() {
console.log(this.dutyDetail);
const id = this.dutyDetail.id;
this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/deleteApply',{'id':id})
.subscribe((res)=>{
this.navCtrl.pop();
this.appService.ObserverHttpGetOption('/wisdomgroup/changeApply/app/deleteApply', {'id': id})
.subscribe((res) => {
this.navCtrl.pop();
// this.dutyDetail = res;
})
}
......
......@@ -124,7 +124,8 @@ export class DutyPage {
//申请详情
dutyDetail(item){
this.navCtrl.push('DutyDetailPage',{
"id":item.applyId
"id":item.applyId,
'time':item.dutyDate
})
}
......
......@@ -40,6 +40,7 @@ export class HomePage {
type: 'string';
optionsMulti: CalendarComponentOptions;
newArr: DayConfig[] = [];
//待出行
waitgoCount = '0';
......@@ -355,13 +356,14 @@ export class HomePage {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() +1;
console.log(month);
///schedule/app/getMyScheduleOnMonth
this.loadEvent(year,month);
}
loadEvent(year,month){
let date = new Date();
let newArr: DayConfig[] = [];
//1.每月的周末
let d = new Date(year,month,0).getDate();
for( let i = 1; i< d +1;i++ ){
date.setFullYear(year,month -1,i);
......@@ -372,18 +374,39 @@ export class HomePage {
disable: true,
cssClass: 'dayOff1'
};
newArr.push(data);
this.newArr.push(data);
}
}
this.optionsMulti = {
pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat:monthCh,
weekStart: 0,
disableWeeks:[0,1,2,3,4,5,6],
daysConfig:newArr
};
//2.获取每月值班信息
const data = {
date:year + '/' + month +'/01'
};
this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data)
.subscribe((res: Response) => {
let response = res.json();
for( let i = 0;i<response.length;i++ ){
const data = {
date: new Date(response[i].dutyDate),
disable: true,
cssClass: 'dayOff1 dayOff3'
};
this.newArr.push(data);
}
this.optionsMulti = {
pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat:monthCh,
weekStart: 0,
disableWeeks:[0,1,2,3,4,5,6],
daysConfig:this.newArr
};
console.log(this.optionsMulti);
}, error => {
this.appService.alert('网络异常!');
}
);
}
onChange(e){
......
This diff is collapsed.
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