<div class="panel panel-default">
  <div>
    <!--标题-->
    <div class="panel-title">
      <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
          <li class="breadcrumb-item">毕业管理</li>
          <li class="breadcrumb-item active" aria-current="page">毕业预测</li>
        </ol>
      </nav>
    </div>
  </div>

  <div class="panel-body ml-sm " [hidden]="editShowType=='only'">
    <!--查询条件-->
    <div class="row mb-3 ml-1" [hidden]="editShowType=='only'">
      <div class="col-lg-12">
        <form  class="form-inline">
          <table>
            <tr>
              <td>
          <div class="input-group mr-1 input-group-sm">
            <label>专业：</label>
            <flex-select [allowClear]="true"
                [(items)] = "majorList"
                respDataPath= "array"
                optionValueField="id"
                optionTextField="major_full_name"
                [(ngModel)]="query.majorId"
                placeholder="请选择"
                [ngModelOptions]="{standalone: true}"
                width = "200"
                noResultsFound = "无数据"
                >
            </flex-select>
           
          </div>
        </td>
        <td>
          <div class="input-group mr-1 input-group-sm">
            <label>准考证号：</label>
            <input name="ticket_no" [(ngModel)]="query.ticket_no" class="input-sm form-control" type="text" value="" maxlength="64"
              placeholder="请输入考生准考证号">
          </div>
        </td>
        <td></td>
        </tr>
        <tr>
            <td>
          <div class="input-group mr-1 input-group-sm">
            <label>姓名：</label>
            <input name="old_ticket_no" [(ngModel)]="query.std_name" class="input-sm form-control" type="text" value="" maxlength="64"
              placeholder="请输入姓名">
          </div>
        </td>
        <td>
          <div class="input-group mr-1 input-group-sm">
            <label>身份证号：</label>
            <input name="cert_no" [(ngModel)]="query.cert_no" class="input-sm form-control" type="text" value="" maxlength="64"
              placeholder="请输入考生身份证号">
          </div>
        </td>
        <td align="right">
          <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="searchStdScore()">
            <i class="fa fa-search"></i> 查询</button>&nbsp;
          <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="reset()">
                <i class="fa fa-undo"></i> 重置</button>
          <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="showByPredictionExportModal(byPredictionExportModal,'modal-lg')">
            <i class="fa icon-cloud-download"></i> 导出预毕业考生</button>

           </td>
          </tr>
          </table>        
        </form>
      </div>
    </div>


    <!--表格-->
    <div class="row" [hidden]="editShowType=='only'">
      <div class="col-sm-12 ml-0">
        <table class="table table-sm table-striped table-hover table-bordered bg-white">
          <thead>
            <tr align="center">
              <th>序号</th>
              <th  align="center">考试年月</th>
              <th>考生姓名</th>
              <th  align="center">准考证号</th>
              <th>身份证</th>
              <th  align="center">课程代码</th>
              <th>课程名称</th>
              <th  align="center">成绩</th>
               <!--<th>状态</th> -->
              <th>成绩来源</th>
              <th>成绩性质</th>
              <th>专业</th>
              <th>主考学校</th> 
              <th>所属专业</th> 
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let item of historyScore; let i = index" align="center">
              <td title="红色表示课程成绩未合格" *ngIf="item.id != null"><font *ngIf="item.remark == 'red'" color="red">{{item.id}}</font><font *ngIf="item.remark != 'red'">{{item.id}}</font></td>
              <td title="红色表示课程成绩未合格" *ngIf="item.id == null"><font *ngIf="item.remark == 'red'" color="red">{{i+1}}</font><font *ngIf="item.remark != 'red'">{{i+1}}</font></td>
              <td  align="center" title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.year_code}}</font><font *ngIf="item.remark != 'red'">{{item.year_code}}</font></td>
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.std_name}}</font><font *ngIf="item.remark != 'red'">{{item.std_name}}</font></td>
              <td  align="center" title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.ticket_no}}</font><font *ngIf="item.remark != 'red'">{{item.ticket_no}}</font></td>
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.cert_no}}</font><font *ngIf="item.remark != 'red'">{{item.cert_no}}</font></td>
              <td  align="center" title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.course_code}}</font><font *ngIf="item.remark != 'red'">{{item.course_code}}</font></td>
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.course_name}}</font><font *ngIf="item.remark != 'red'">{{item.course_name}}</font></td>
              <td  align="right" title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.final_score}}</font><font *ngIf="item.remark != 'red'">{{item.final_score}}</font></td>
               <!--<td>{{item.status_name}}</td> -->
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.score_source_name}}</font><font *ngIf="item.remark != 'red'">{{item.score_source_name}}</font></td>
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.score_type_name}}</font><font *ngIf="item.remark != 'red'">{{item.score_type_name}}</font></td>
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.major_name}}</font><font *ngIf="item.remark != 'red'">{{item.major_name}}</font></td>
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.org_name}}</font><font *ngIf="item.remark != 'red'">{{item.org_name}}</font></td> 
              <td title="红色表示课程成绩未合格"><font *ngIf="item.remark == 'red'" color="red">{{item.org_name}}</font><font *ngIf="item.remark != 'red'">{{item.out_remark}}</font></td> 

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

</div>


<!--*********************************毕业预测导出*********************************************-->
<ng-template #byPredictionExportTemplate>
    <div class="row mb-1">
        <label class="col-md-3 col-form-label text-md-right">最多不及格科目数</label>
        <div class="col-md-3">
            <input class="form-control" [(ngModel)]="export_query.course_count" style="width: 200px;" type="number" value="4"/>
        </div>
    </div>

  <div class="row mb-1">
      <label class="col-md-3 col-form-label text-md-right">专业</label>
      <div class="col-md-3">
        <flex-select [allowClear]="true"
            [(items)] = "majorList"
            respDataPath= "array"
            optionValueField="major_code"
            optionTextField="major_full_name"
            [(ngModel)]="export_query.major_code"
            placeholder="请选择"
            [ngModelOptions]="{standalone: true}"
            width = "200"
            noResultsFound = "无数据"
            >
        </flex-select>
      </div>
  </div>
  
</ng-template>
<!--驳回模态窗口-->
<ng-template #byPredictionExportModal>
  <div class="modal-content">
      <div class="modal-header info-success-qm">
          <div class="pull-left">
              <em class="fa-lg fas fa-edit "></em>导出预毕业考生
          </div>
          <button type="button" class="close" (click)="hideModal();">×</button>
      </div>

      <!-- 1@3 -->
      <div class="modal-body">
          <div [ngTemplateOutlet]="byPredictionExportTemplate"></div>
      </div>

      <div class="modal-footer">
          <button class="btn btn-info" (click)="byPredictionExport()">
              <i class="fa fa-info-circle"> </i> 导出预毕业考生
          </button>
      </div>
  </div>
</ng-template>

