Commit 2bc39c58 authored by wangqinghua's avatar wangqinghua

日历

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