Commit 1943bae7 authored by wangqinghua's avatar wangqinghua

color

parent cad007b2
...@@ -41,7 +41,8 @@ export class DutyApplyHandlePage { ...@@ -41,7 +41,8 @@ export class DutyApplyHandlePage {
switch (type){ switch (type){
case '1':{ //换班 case '1':{ //换班
this.navCtrl.push('SelectChangePersonPage',{ this.navCtrl.push('SelectChangePersonPage',{
nowId:this.applyDetail.scheduleId nowId:this.applyDetail.scheduleId,
date:this.personDetail.dutyDate
}); });
break; break;
} }
......
...@@ -4,26 +4,27 @@ ...@@ -4,26 +4,27 @@
<ion-navbar> <ion-navbar>
<ion-title>选择换班人员</ion-title> <ion-title>选择换班人员</ion-title>
</ion-navbar> </ion-navbar>
<div class="duty">
<div class="dutyItem" (click)="change(0)">
<span class="{{changeType == 0?'duty-title':''}}">白班</span>
</div>
<div class="dutyItem" (click)="change(1)">
<span class="{{changeType == 1?'duty-title':''}}">夜班</span>
</div>
</div>
</ion-header> </ion-header>
<ion-content padding> <ion-content class="bgc-e7e8ed">
<div class="calen-tab">
日程表:<span class="calen1">休息日</span>
</div>
<ion-calendar
[(ngModel)]="date"
(onChange)="onChange($event)"
(monthChange)="monChange($event)"
[options]="optionsMulti"
type="'js-date'"
[format]="'YYYY-MM-DD'">
</ion-calendar>
<ion-list> <ion-list>
<ion-item *ngFor="let item of list;" > <ion-item *ngFor="let item of list;" >
<div (click)="select(item)"> <div (click)="select(item)">
<span>{{item.dutyDate | date:'yyyy-MM-dd'}}</span> <span>{{item.dutyDate | date:'yyyy-MM-dd'}}</span>
<span>{{item.name}}</span> <span>{{item.name}}</span>
</div> </div>
</ion-item> </ion-item>
</ion-list> </ion-list>
</ion-content> </ion-content>
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular'; import { IonicPageModule } from 'ionic-angular';
import { SelectChangePersonPage } from './select-change-person'; import { SelectChangePersonPage } from './select-change-person';
import { CalendarModule } from "ion2-calendar";
@NgModule({ @NgModule({
declarations: [ declarations: [
SelectChangePersonPage, SelectChangePersonPage,
], ],
imports: [ imports: [
CalendarModule,
IonicPageModule.forChild(SelectChangePersonPage), IonicPageModule.forChild(SelectChangePersonPage),
], ],
}) })
......
page-select-change-person { page-select-change-person {
.duty{ button[disabled]{
display: flex; opacity: 1;
flex-direction: row; }
align-items: center; ion-calendar-month .primary button.days-btn small{
justify-content: center; color: #474747;
} transform: scale(0.8);
.duty div{ font-size: 12px;
width: 50%;
text-align: center;
position: relative;
} }
.duty-title{
.calen-tab{
margin: 16px 16px 0px 16px;
padding-bottom: 10px;
border-bottom: 1px solid #dddddd;
}
.calen1,
.calen2,
.calen3,
.calen4{
position: relative; position: relative;
color: #24bafc; margin-left:1.8rem;
} }
.duty-title::after{ .calen1::after,
.calen2::after,
.calen3::after,
.calen4::after{
content: ''; content: '';
position: absolute; position: absolute;
width: 100%; top: 23%;
height: 2px; left: -13px;
background-color: #24bafc; width:8px;
bottom: -8px; height:8px;
left: 0px; border-radius:50%;
}
.calen1::after{
border:1px solid #ddd;
}
.calen2::after{
background-color: #41afef;
}
.calen3::after{
background-color: #f53d3d;
}
.calen4::after{
background-color: #f7ce53;
} }
} }
...@@ -2,13 +2,9 @@ import { Component } from '@angular/core'; ...@@ -2,13 +2,9 @@ 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";
import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure"; import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure";
import {CalendarComponentOptions, DayConfig} from "ion2-calendar";
/** import {monthCh, weekDay} from "../../../app/main";
* Generated class for the SelectChangePersonPage page. import { DatePipe } from "@angular/common";
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -17,27 +13,54 @@ import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure"; ...@@ -17,27 +13,54 @@ import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure";
}) })
export class SelectChangePersonPage { export class SelectChangePersonPage {
//日历
optionsMulti: CalendarComponentOptions;
newArr: DayConfig[] = [];
nowId; nowId;
date; //换班日期
list = []; list = [];
changeType = 0; changeType = 0;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) { public appService: AppService,public datePipe: DatePipe) {
} }
ionViewDidLoad() { ionViewDidLoad() {
this.nowId = this.navParams.get('nowId'); this.nowId = this.navParams.get('nowId');
this.getMonth(); const year = this.datePipe.transform( this.navParams.get('date'),'yyyy' );
const month = this.datePipe.transform( this.navParams.get('date'),'MM' );
this.getMonth(year,month);
} }
getMonth(){ //选择月份
//月份改变
monChange(e) {
this.getMonth(e.newMonth.years, e.newMonth.months);
}
getMonth(year,month){
const data = { const data = {
date:'2018/10/01', date:year + '/' + month + '/01',
type:this.changeType type:this.changeType
}; };
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonthAndType',data) this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonthAndType',data)
.subscribe((res)=>{ .subscribe((res)=>{
this.list = res.json(); let response = res.json();
console.log(res.json()) response.forEach(event=>{
this.newArr.push({
date:new Date(event.dutyDate),
subTitle:event.name,
})
});
this.optionsMulti = {
pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat: monthCh,
weekStart: 0,
disableWeeks: [0, 1, 2, 3, 4, 5, 6],
daysConfig: this.newArr
};
}) })
} }
...@@ -51,7 +74,7 @@ export class SelectChangePersonPage { ...@@ -51,7 +74,7 @@ export class SelectChangePersonPage {
change(type){ change(type){
this.changeType = type; this.changeType = type;
this.getMonth(); // this.getMonth();
} }
} }
...@@ -15,14 +15,7 @@ export class CreatePage { ...@@ -15,14 +15,7 @@ export class CreatePage {
qType; //题目类型 qType; //题目类型
temp; //问卷信息 temp; //问卷信息
titile; //标题 titile; //标题
quesDescList = [ //选项 quesDescList = [];
{
option_title: '', //选项文字
canFill: 2, // 1是 2否
isNeed: 1, // 1是 2否
index: 0 //序号
},
];
set = { //设置 set = { //设置
lastchange: '1', lastchange: '1',
morechange: '1', morechange: '1',
...@@ -55,6 +48,22 @@ export class CreatePage { ...@@ -55,6 +48,22 @@ export class CreatePage {
submit() { submit() {
// this.navCtrl.push('EditPage'); // this.navCtrl.push('EditPage');
if( this.qType == 1 ){
const option1 = {
option_title: '是', //选项文字
canFill: 2, // 1是 2否
isNeed: 1, // 1是 2否
index: 0
}; //序号
const option2 = {
option_title: '否', //选项文字
canFill: 2, // 1是 2否
isNeed: 1, // 1是 2否
index: 0
}; //序号
this.quesDescList.push(option1);
this.quesDescList.push(option2);
}
const arr = [ const arr = [
{ {
questionId: this.temp.id, questionId: this.temp.id,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ion-navbar> <ion-navbar>
<ion-title>问卷管理</ion-title> <ion-title>问卷管理</ion-title>
<span (click)="create()" float-right class="margin-right-10 color-999">创建</span> <span (click)="create()" float-right class="margin-right-10 color-fff">创建</span>
</ion-navbar> </ion-navbar>
<div class="pageMenuSlides"> <div class="pageMenuSlides">
<div class="swiper-container"> <div class="swiper-container">
......
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