<div class="modal-header">
  <h4 class="modal-title pull-left">面试项目编排明细 - {{currentEntity.group_name}}</h4>
</div>
<div class="modal-body mb-1" *ngIf="ResponseMap">
  <div class="card card-default">
  <div class="card-header">
      <span *ngIf="currentEntity.province_flag === 'InActive'">混排：共【{{currentEntity.group_std_total}}】考生，已安排【
        <span
          [ngClass]="{'text-success': ResponseMap['GroupTotal'].country_total === currentEntity.group_std_total, 'text-warning': ResponseMap['GroupTotal'].country_total > currentEntity.group_std_total ,'text-danger': ResponseMap['GroupTotal'].country_total < currentEntity.group_std_total}">{{ResponseMap['GroupTotal'].country_total}}</span>】
        <span *ngIf="ResponseMap['GroupTotal'].country_total > currentEntity.group_std_total">，溢出【<span class="text-warning">{{ResponseMap['GroupTotal'].country_total - currentEntity.group_std_total}}</span>】</span>
        <span *ngIf="ResponseMap['GroupTotal'].country_total < currentEntity.group_std_total">，还差【<span class="text-danger">{{currentEntity.group_std_total - ResponseMap['GroupTotal'].country_total}}</span>】</span>

      </span>
    <span *ngIf="currentEntity.province_flag === 'Active'">
        <span>省内：【{{currentEntity.province_std_total}}】，已排【
        <span
          [ngClass]="{'text-success': ResponseMap['GroupTotal'].province_total === currentEntity.province_std_total, 'text-warning': ResponseMap['GroupTotal'].province_total > currentEntity.province_std_total ,'text-danger': ResponseMap['GroupTotal'].province_total < currentEntity.province_std_total}">{{ResponseMap['GroupTotal'].province_total}}</span>】
        <span *ngIf="ResponseMap['GroupTotal'].province_total > currentEntity.province_std_total">，溢出【<span class="text-warning">{{ResponseMap['GroupTotal'].province_total - currentEntity.province_std_total}}</span>】</span>
        <span *ngIf="ResponseMap['GroupTotal'].province_total < currentEntity.province_std_total">，还差【<span class="text-danger">{{currentEntity.province_std_total - ResponseMap['GroupTotal'].province_total}}</span>】</span>
      </span>；
        <span>外省：【{{currentEntity.outside_std_total}}】，已排【
        <span
          [ngClass]="{'text-success': ResponseMap['GroupTotal'].outside_total === currentEntity.outside_std_total, 'text-warning': ResponseMap['GroupTotal'].outside_total > currentEntity.outside_std_total ,'text-danger': ResponseMap['GroupTotal'].outside_total < currentEntity.outside_std_total}">{{ResponseMap['GroupTotal'].outside_total}}</span>】
        <span *ngIf="ResponseMap['GroupTotal'].outside_total > currentEntity.outside_std_total">，溢出【<span class="text-warning">{{ResponseMap['GroupTotal'].outside_total - currentEntity.outside_std_total}}</span>】</span>
        <span *ngIf="ResponseMap['GroupTotal'].outside_total < currentEntity.outside_std_total">，还差【<span class="text-danger">{{currentEntity.outside_std_total - ResponseMap['GroupTotal'].outside_total}}</span>】</span>
      </span>
       </span>
  </div>
  </div>

  <tabset class="bg-white p-0" justified="true">
    <tab *ngFor="let date of ResponseMap['DateArray']">
      <ng-template tabHeading>
        <em class="far fa-clock fa-fw"></em> {{date.ly_exam_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)="fullTime(date.ly_group_id,date.ly_exam_date)">
                增加时段
              </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 *ngIf="currentEntity.province_flag === 'InActive'" class="wd-sm">考生数</th>
                <th *ngIf="currentEntity.province_flag === 'Active'" class="wd-sm">省内考生</th>
                <th *ngIf="currentEntity.province_flag === 'Active'" class="wd-sm">外省考生</th>
                <th class="tb-b-1"></th>
              </tr>
              </thead>
              <tbody>
              <tr *ngFor="let v of ResponseMap.TimeMap[date.ly_exam_date]; let i = index">
                <td>{{i+1}}</td>
                <td>{{date.ly_exam_date}} {{v.group_time.exam_start_time}} - {{v.group_time.exam_end_time}}</td>
                <td>{{v.group_time.exam_minutes}}</td>
                <td *ngIf="currentEntity.province_flag === 'InActive'">
                  <input class="form-control form-control-sm wd-sm" type="number" [(ngModel)]="v.country_total"
                         (keyup)="calArrangeTotal()" (ngModelChange)="calArrangeTotal()"/>
                </td>
                <td *ngIf="currentEntity.province_flag === 'Active'">
                  <input class="form-control form-control-sm wd-sm"
                         type="number" (keyup)="calArrangeTotal()"  (ngModelChange)="calArrangeTotal()"
                         [(ngModel)]="v.province_total"/>
                </td>
                <td *ngIf="currentEntity.province_flag === 'Active'">
                  <input class="form-control form-control-sm wd-sm" type="number"  (keyup)="calArrangeTotal()"  (ngModelChange)="calArrangeTotal()" [(ngModel)]="v.outside_total"/>
                </td>
                <td>
                  <span class="table-button text-danger"
                        (click)="deleteAppointment(v)"><em
                    class="fa-lg fas fa-trash-alt "></em></span>
                </td>

              </tbody>
            </table>
          </div>
        </div>

        <div class="card card-default">
          <div class="card-header bg-primary"><span class="ml-2">考场安排</span></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-sd">状态</th>
              </tr>
              </thead>
              <tbody>
              <tr *ngFor="let v of  ResponseMap.RoomMap[date.ly_exam_date]; let i = index">
                <td>{{v.room_order}}</td>
                <td>{{v.room_addr}}</td>
                <td>{{v.room_waiting_addr}}</td>
                <td [innerHTML]="v.room_status | frameStatus"></td>

              </tbody>
            </table>
          </div>
        </div>

      </div>
    </tab>
  </tabset>
</div>

<div class="modal-footer justify-content-between">
  <div>
    <button class="btn btn-primary" type="button" (click)="addDate()">
      增加考试日期
    </button>
  </div>
  <div>
    <button class="btn btn-primary" type="button" (click)="saveGroup()">
      确定编排信息
    </button>
    <button class="btn btn-secondary ml-2" type="button" (click)="closeWindow()">关闭窗口</button>
  </div>
</div>
