Commit 1943bae7 authored by wangqinghua's avatar wangqinghua

color

parent cad007b2
......@@ -41,7 +41,8 @@ export class DutyApplyHandlePage {
switch (type){
case '1':{ //换班
this.navCtrl.push('SelectChangePersonPage',{
nowId:this.applyDetail.scheduleId
nowId:this.applyDetail.scheduleId,
date:this.personDetail.dutyDate
});
break;
}
......
......@@ -4,26 +4,27 @@
<ion-navbar>
<ion-title>选择换班人员</ion-title>
</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-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-item *ngFor="let item of list;" >
<div (click)="select(item)">
<span>{{item.dutyDate | date:'yyyy-MM-dd'}}</span>
<span>{{item.name}}</span>
</div>
</ion-item>
</ion-list>
</ion-content>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SelectChangePersonPage } from './select-change-person';
import { CalendarModule } from "ion2-calendar";
@NgModule({
declarations: [
SelectChangePersonPage,
],
imports: [
CalendarModule,
IonicPageModule.forChild(SelectChangePersonPage),
],
})
......
page-select-change-person {
.duty{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.duty div{
width: 50%;
text-align: center;
position: relative;
button[disabled]{
opacity: 1;
}
ion-calendar-month .primary button.days-btn small{
color: #474747;
transform: scale(0.8);
font-size: 12px;
}
.duty-title{
.calen-tab{
margin: 16px 16px 0px 16px;
padding-bottom: 10px;
border-bottom: 1px solid #dddddd;
}
.calen1,
.calen2,
.calen3,
.calen4{
position: relative;
color: #24bafc;
margin-left:1.8rem;
}
.duty-title::after{
.calen1::after,
.calen2::after,
.calen3::after,
.calen4::after{
content: '';
position: absolute;
width: 100%;
height: 2px;
background-color: #24bafc;
bottom: -8px;
left: 0px;
top: 23%;
left: -13px;
width:8px;
height:8px;
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';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {AppService} from "../../../service/appHttpService";
import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure";
/**
* Generated class for the SelectChangePersonPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
import {CalendarComponentOptions, DayConfig} from "ion2-calendar";
import {monthCh, weekDay} from "../../../app/main";
import { DatePipe } from "@angular/common";
@IonicPage()
@Component({
......@@ -17,27 +13,54 @@ import {ChangeApplySurePage} from "../change-apply-sure/change-apply-sure";
})
export class SelectChangePersonPage {
//日历
optionsMulti: CalendarComponentOptions;
newArr: DayConfig[] = [];
nowId;
date; //换班日期
list = [];
changeType = 0;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
public appService: AppService,public datePipe: DatePipe) {
}
ionViewDidLoad() {
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 = {
date:'2018/10/01',
date:year + '/' + month + '/01',
type:this.changeType
};
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleByMonthAndType',data)
.subscribe((res)=>{
this.list = res.json();
console.log(res.json())
let response = 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 {
change(type){
this.changeType = type;
this.getMonth();
// this.getMonth();
}
}
......@@ -15,14 +15,7 @@ export class CreatePage {
qType; //题目类型
temp; //问卷信息
titile; //标题
quesDescList = [ //选项
{
option_title: '', //选项文字
canFill: 2, // 1是 2否
isNeed: 1, // 1是 2否
index: 0 //序号
},
];
quesDescList = [];
set = { //设置
lastchange: '1',
morechange: '1',
......@@ -55,6 +48,22 @@ export class CreatePage {
submit() {
// 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 = [
{
questionId: this.temp.id,
......
......@@ -2,7 +2,7 @@
<ion-navbar>
<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>
<div class="pageMenuSlides">
<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