<div class="modal-header">
  <h4 class="modal-title pull-left">视频任务分发</h4>
</div>

<div class="modal-body">
  <table class="table table-striped table-hover table-bordered" *ngIf="currStep === 'init'">
    <thead>
    <tr>
      <th>考试项目</th>
      <th>总任务数量</th>
      <th>剩余任务数</th>
      <th>考场数量</th>
      <th>分配任务数</th>
      <th>考生数(男)</th>
      <th>考生数(女)</th>
      <th>考生数(省外)</th>
      <th>考生数(省内)</th>
    </tr>
    </thead>
    <tbody>
    <ng-container *ngFor="let v of groupArray; let i = index">
      <tr *ngIf="v.nolayout_total >0">
        <td class="align-middle">{{v.show_aspect_name}}</td>
        <td class="align-middle">{{v.upload_total}}</td>
        <td class="align-middle">{{v.nolayout_total}}</td>
        <td class="align-middle"><input class="form-control input-group-sm wd-xs" type="number"
                                        [(ngModel)]="v.room_total"/></td>
        <td class="align-middle"><input class="form-control input-group-sm wd-sm" type="number"
                                        [(ngModel)]="v.exam_seconds"/></td>
        <td class="align-middle">{{v.male_total}}</td>
        <td class="align-middle">{{v.female_total}}</td>
        <td class="align-middle">{{v.out_province_total}}</td>
        <td class="align-middle">{{v.in_province_total}}</td>                              
      </tr>
    </ng-container>
    </tbody>

  </table>

  <table class="table table-striped table-hover table-bordered" *ngIf="currStep === 'room'">
    <thead>
    <tr>
      <th>考试项目</th>
      <th>分配任务数</th>
      <th>考生数量<br>（男）</th>
      <th>考生数量<br>（女）</th>
      <th>考生数量<br>（省外）</th>
      <th>考生数量<br>（省内）</th>
      <th>考场名称</th>
      <th>考生数量</th>
      <th>性别限定</th>
      <th>省份限定</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let v of currGroupArray; let i = index">
      <td class="align-middle" [rowSpan]="v.rowspan" *ngIf="v.room_seq === 1">{{v.show_aspect_name}}</td>
      <td class="align-middle" [rowSpan]="v.rowspan" *ngIf="v.room_seq === 1">{{v.exam_seconds}}</td>
      <td class="align-middle" [rowSpan]="v.rowspan" *ngIf="v.room_seq === 1">{{v.male_total}}</td>
      <td class="align-middle" [rowSpan]="v.rowspan" *ngIf="v.room_seq === 1">{{v.female_total}}</td>
      <td class="align-middle" [rowSpan]="v.rowspan" *ngIf="v.room_seq === 1">{{v.out_province_total}}</td>
      <td class="align-middle" [rowSpan]="v.rowspan" *ngIf="v.room_seq === 1">{{v.in_province_total}}</td>
      <td class="align-middle">{{v.room_addr}}</td>
      <td class="align-middle"><input class="form-control input-group-sm wd-sm" type="number"
                                      [(ngModel)]="v.ly_std_total" (ngModelChange)="totalRoomStd(v)"/></td>
      <td class="align-middle">
        <ngx-select [items]="'FrameSex' | frameDict" [(ngModel)]="v.std_sex" optionValueField="dict_value" optionTextField="dict_text"></ngx-select>
      </td>
      <td class="align-middle">
        <ngx-select [items]="provinceArr" [(ngModel)]="v.std_province"  optionValueField="province_id" optionTextField="province_name" ></ngx-select>
      </td>                                  
    </tr>
    </tbody>

  </table>
</div>

<div class="modal-footer justify-content-between">
  <div>
    <div class="row" *ngIf="currStep === 'room'">
      <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)]="exam_date" maxlength="11" id="exam_dates" (click)="getDate()"/>
      </div>
    </div>
  </div>
  <div>
    <button class="btn btn-primary" type="button" (click)="confirmTotal()" *ngIf="currStep === 'init'">
      确认分发数量
    </button>
    <button class="btn btn-info" type="button" (click)="currStep = 'init'" *ngIf="currStep === 'room'">
      重新设置考场
    </button>
    <button class="btn btn-primary ml-3" type="button" (click)="confirmRoom()" *ngIf="currStep === 'room'">
      确认考场并分发
    </button>
    <button class="btn btn-secondary ml-3" type="button" (click)="closeWindow()">关闭窗口</button>
  </div>
</div>
