<div class="modal-header">
    <h4 class="modal-title pull-left">编辑-报考预约容量-【{{currentEntity.aspect_name}}】</h4>
</div>
  <div class="modal-body mb-1">

    <tabset class="bg-white p-0" justified="true" *ngIf="appointmentArr != undefined 
    &&  appointmentArr.length>0 && appointmentArr[0].appointment_date">
      <tab *ngFor="let item of appointmentArr" >
        <ng-template tabHeading>
          <em class="far fa-clock fa-fw"></em> {{item.appointment_date}}
        </ng-template>
        <div>
          <div class="card card-default">
            <div class="card-header bg-info"><span class="ml-2">容量安排</span>
              <div class="float-right">
                <button class="btn btn-primary mr-2" type="button" (click)="addTime(item)">
                  增加时段
                </button>
              </div>
            </div>
            <div class="card-body">
              <table class="table table-striped table-hover table-bordered">
                <thead>
                <tr>
                  <th class="th-index">#</th>
                  <th>开始时间</th>
                  <th>结束时间</th>
                  <th class="wd-sm">考生数</th>
                  <th class="tb-b-1"></th>
                </tr>
                </thead>
                <tbody>
                <tr *ngFor="let v of item.appointments; let i = index">
                  <td>{{i+1}}</td>
                  <td><input class="form-control" type="text" [(ngModel)]="v.start_time" /></td>
                  <td><input class="form-control" type="text" [(ngModel)]="v.end_time" /></td>
                  <td>
                    <input class="form-control form-control-sm wd-sm" type="number" [(ngModel)]="v.appointment_capacity" />
                  </td>
                  <td>
                    <span class="table-button text-danger" (click)="deleteTime(item,v, i)">
                       <em class="fa-lg fas fa-trash-alt "></em></span>
                  </td>
                </tr>
                </tbody>
              </table>
            </div>
          </div>
         
  
        </div>
      </tab>
    </tabset>
  </div>
  
  <div class="modal-footer justify-content-between">
    <div>
      <div class="row">
        <label class="col-lg-5 col-form-label text-lg-right text-right">预约日期：</label>
        <div class="col-lg-3 col-md-3">
          <input class="form-control wd-sm" type="text" [(ngModel)]="appointment_date" maxlength="11"/>
        </div>
      </div>
    </div>
    <div>
      <button class="btn btn-primary" type="button" (click)="addDate()">
        增加预约日期
      </button>
      <button class="btn btn-primary ml-2" type="button" (click)="saveAppointment()">
        保存容量
      </button>
      <button class="btn btn-secondary ml-2" type="button" (click)="closeWindow()">关闭窗口</button>
    </div>
  </div>
