<div class="modal-header">
    <h4 class="modal-title pull-left">分发考生</h4>
  </div>
  <div class="modal-body" *ngIf="currStep == 'init'">
    <div class="card card-default">
      <div class="card-body">
        <div class="form-group row">
          <label class="col-lg-2 col-form-label text-lg-right">考场</label>
          <div class="col-lg-8 col-md-8">
            <input class="form-control" type="text" [readOnly]="true" [value]="room_name" />
          </div>
        </div>
        <div class="form-group row">
          <label class="col-lg-2 col-form-label text-lg-right">剩余数量</label>
          <div class="col-lg-8 col-md-8">
            <input class="form-control" type="text" [readOnly]="true" [value]="remainInfo" />
          </div>
        </div>
        <div class="form-group row">
          <label class="col-lg-2 col-form-label text-lg-right">性别限定</label>
          <div class="col-lg-8 col-md-8">
            <ngx-select [items]="'FrameSex' | frameDict" [(ngModel)]="ResponseEntity.std_sex" optionValueField="dict_value" optionTextField="dict_text"></ngx-select>
          </div>
        </div>
        <div class="form-group row">        
          <label class="col-lg-2 col-form-label text-lg-right">省份限定</label>
          <div class="col-lg-8 col-md-8">
            <ngx-select [items]="provinceArr" [(ngModel)]="ResponseEntity.std_province"  optionValueField="province_id" optionTextField="province_name" ></ngx-select>
          </div>        
        </div>
        <div class="form-group row" *ngIf="varietyArr && varietyArr.length>1">        
          <label class="col-lg-2 col-form-label text-lg-right">品种限定</label>
          <div class="col-lg-8 col-md-8">
            <button class="btn btn-primary" (click)="addVariety()"  *ngIf="!ResponseEntity.varietyArr || ResponseEntity.varietyArr.length==0">添加</button>
            <button class="btn btn-success" (click)="viewVariety()" *ngIf="ResponseEntity.varietyArr && ResponseEntity.varietyArr.length>0">查看</button>
          </div>
        </div>  
        <div class="form-group row">
          <label class="col-lg-2 col-form-label text-lg-right">追加考生数</label>
          <div class="col-lg-8 col-md-8">
            <input class="form-control" type="number" [(ngModel)]="ResponseEntity.std_num" [readonly]="ResponseEntity.varietyArr && ResponseEntity.varietyArr.length>0"  />
          </div>
     
        </div>
     
      </div>
  
    </div>
  </div>
  
  <div class="modal-body">
    <table class="table table-striped table-hover table-bordered" *ngIf="currStep === 'variety'">
        <thead>
            <tr>
              <th>品种名称</th>
              <th>任务总量</th>
              <th>剩余数量(男|女)</th>
              <th>剩余数量(内|外)</th>
              <th>考生数量</th>
              <th>性别</th>
              <th>省份</th>
              <th>序号</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let v of varietyArr; let i = index;">
                <td class="align-middle">{{v.variety_name}}</td>
                <td class="align-middle">{{v.all_std_total}}</td>
                <td class="align-middle">{{v.std_total}}({{v.male_total}}|{{v.female_total}})</td>
                <td class="align-middle">{{v.std_total}}({{v.in_province_total}}|{{v.out_province_total}})</td>
                <td class="align-middle">
                    <input class="form-control input-group-sm wd-sm" type="number" [(ngModel)]="v.real_std_total" />
                </td>
                <td class="align-middle">
                    <ngx-select [items]="'FrameSex' | frameDict"  optionValueField="dict_value" optionTextField="dict_text" [(ngModel)]="v.std_sex"></ngx-select>
                </td>
                <td class="align-middle">
                    <ngx-select [items]="provinceArr" optionValueField="province_id" optionTextField="province_name" [(ngModel)]="v.std_province"></ngx-select>
                </td>
                <td class="align-middle">
                    <input class="form-control input-group-sm wd-sm" type="number" [(ngModel)]="v.order_num" />
                </td>
            </tr>
        </tbody>
    </table>
  
  </div>
  
  <div class="modal-footer">
    <button class="btn btn-primary" type="button"  (click)="addTask()" *ngIf="currStep === 'init'" >追加
    </button>
    <button class="btn btn-secondary" type="button" (click)="closeWindow()" *ngIf="currStep === 'init'">关闭窗口</button>
    <button class="btn btn-primary ml-3" type="button" (click)="confirmVariety()" *ngIf="currStep === 'variety'">
      确认
  </button>
  <button class="btn btn-primary ml-3" type="button" (click)="currStep='init'" *ngIf="currStep === 'variety'">
      取消
  </button>
  </div>
  