<ion-header>

    <ion-navbar>
        <ion-title>值班情况</ion-title>
    </ion-navbar>
    <div class="duty">
        <div class="dutyItem" (click)="change(1)">
            <span  class="{{changeType == 1?'duty-title':''}}">值班安排</span>
        </div>
        <div class="dutyItem"  (click)="change(2)">
            <span class="{{changeType == 2?'duty-title':''}}">我的值班</span>
        </div>
    </div>
</ion-header>


<ion-content>
    <ion-content direction="y" scrollbar-y="true" class="bgc-e7e8ed">
        <ng-container *ngIf="changeType == 1">
            <ion-calendar [(ngModel)]="date"
                          (onSelect)="onChange($event)"
                          [options]="optionsMulti"
                          [type]="type"
                          [format]="'YYYY-MM-DD'">
            </ion-calendar>
            <div>
                <ion-item>
                    <span></span>
                </ion-item>
            </div>
        </ng-container>
       <ng-container *ngIf="changeType == 2">
            <div class="duty-content">
                <ion-list>
                    <ion-item *ngFor="let item of nowDuty">
                        <div >
                            <span>{{item.dutyDate | date:'yyyy-MM-dd'}}</span>
                            <span *ngIf="item.type == 0">白班</span>
                            <span *ngIf="item.type == 1">夜班</span>
                        </div>
                        <div>
                            <span  (click)="dutyDetail(item)" *ngIf="item.applyId">申请详情</span>
                            <span (click)="dutyApply(item)" *ngIf="!item.applyId">换班申请</span>
                        </div>
                    </ion-item>
                </ion-list>
            </div>
       </ng-container>
    </ion-content>
</ion-content>

