<div class="panel panel-default">
  <!--标题-->
  <div class="panel-title">
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <!-- TODO -->
        <li class="breadcrumb-item">报考管理</li>
        <li class="breadcrumb-item active" aria-current="page">报考同步</li>
      </ol>
    </nav>
  </div>
  <div class="panel-body ml-sm" [hidden]="this.editShowType=='only'" >
    <div class="card card-default">
      <div class="card-body">
        <!--查询条件-->
        <div class="row mb-3 ml-1" [hidden]="this.editShowType=='only'" >
          <div class="col-lg-12" style="width:100%;">
            <form (ngSubmit)="framePager.goSearch()" class="form-inline" >
              <table  style="width:100%;">
              <!-- <div class="input-group mr-1 input-group-sm">
                <label>年度码：</label>
                <input name="keyword" [(ngModel)]="query.year_code" class="input-sm form-control" type="text" value="" maxlength="6" style="width:70px">

              </div> -->
              <tr>
               <td align="right">考期:</td>
                <td align="left">
                  <flex-select [allowClear]="true"
                      [url]= "'pl/plExamTime/list.htm'"
                      respDataPath= "array"
                      optionValueField="id"
                      optionTextField="year_code"
                      [(ngModel)]="query.exam_time_id"
                      placeholder="请选择"
                      width = "25"
                      noResultsFound = "无数据"
                      [ngModelOptions]="{standalone: true}"
                      >
                  </flex-select>
            </td>

            <td align="right">准考证:</td>
            <td align="left">
                <input name="keyword" [(ngModel)]="query.ticket_no" class="input-sm form-control" type="text" value="" maxlength="64" style="width:127px">

            </td>

            <td align="right">报考类型:</td>
            <td align="left">
                <select name="status" [(ngModel)]="query.enrol_type" frameDict [dictName]="'EnrolType'" class="form-control" style="width:120px">
                  </select>
            </td>

            <td align="right">报考考区:</td>
            <td  align="left">
                <flex-select 
                      [allowClear]="true"
                      [(items)] = "examAgentArray"
                      optionValueField="id"
                      optionTextField="org_name"
                      [(ngModel)]="query.enrol_agent_id"
                      placeholder="请选择"
                      [ngModelOptions]="{standalone: true}"
                      width = "100"
                      noResultsFound = "无数据"
                      >
                </flex-select>
            </td>
            
            </tr>
            <tr>
                <td align="right">场次:</td>
                <td  align="left">
                      <select name="exam_batch" [(ngModel)]="query.exam_batch" class="form-control" style="width: 117px;">
                        <option value="">请选择</option>
                        <option value="A">1</option>
                        <option value="B">2</option>
                        <option value="C">3</option>
                        <option value="D">4</option>
                        <option value="X">5</option>
                        <option value="Y">6</option>
                      </select>
                </td>

                <td align="right">特殊课程:</td>
                <td  align="left">
                  <select name="specialFlag" [(ngModel)]="query.special_flag" frameDict [dictName]="'YesOrNo'" class="form-control" style="width: 127px;">
                    </select>
              </td>
              
              <td align="right">报考状态:</td>
              <td  align="left">
                <select name="status" [(ngModel)]="query.status" frameDict [dictName]="'enrol_status'" class="form-control" style="width:120px">
                </select>
            </td>

            <td align="right">报考课程:</td>
              <td  align="left">
                  <flex-select 
                        [allowClear]="true"
                        [(items)] = "courseList"
                        optionValueField="id"
                        optionTextField="code_course_name"
                        [(ngModel)]="query.course_id"
                        placeholder="请选择"
                        [ngModelOptions]="{standalone: true}"
                        width = "100"
                        noResultsFound = "无数据"
                        >
                  </flex-select>
              </td>
            
            <td>
              <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" >
                <i class="fa fa-search"></i> 查询</button>
              <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="reset()">
                <i class="fa fa-undo"></i> 重置</button>
              <!-- <button type="submit">提交</button> -->
            </td>
            
            </tr>
            </table>
            </form>
          </div>
        </div>

        <!-- 工具栏 -->
        <div class="row mb-2" [hidden]="this.editShowType=='only'">
          <div class="col-lg-12">
            <div class="pull-left">
              <!-- <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="this.goEdit(editTemplateModal,'modal','modal-lg',null)" title="添加">
                <i class="fa fa-plus"></i> 添加</button>
            
              <button class="btn btn-primary mr-1 btn-sm" (click)="this.delete()" data-toggle="tooltip" data-placement="left" title="删除">
                <i class="fa fa-trash"> 删除</i>
              </button>-->
              <button id="btnExport" class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" title="导出" (click)="export()">
                <i class="fa icon-cloud-download"></i>  导出</button>
                  <button id="btnExport" class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" title="报考数据同步自考前置库" (click)="syn()">
                  <i class="fa icon-cloud-download"></i>报考数据同步前置库</button>
                  <button id="btnExport" class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" title="编排数据同步自考前置库" (click)="synKw()">
                    <i class="fa icon-cloud-download"></i>编排数据同步前置库</button>
            </div>
          </div>
        </div>

        <!--表格-->
        <div class="row">
          <div class="col-lg-12 ml-0" [hidden]="this.editShowType=='only'">
            <table class="table table-sm table-striped table-hover table-bordered bg-white">
              <thead>
                <tr>
                  <th>
                    <div class="checkbox c-checkbox">
                      <label class="nomargin">
                        <input type="checkbox" (change)="framePager.checkedMasterToggle($event)" />
                        <span class="fa fa-check"></span>
                      </label>
                    </div>
                  </th>
                  <th>考期</th>
                  <th>准考证</th>
                  
                  <th>报考专业</th>
                 
                  <th>报考课程</th>
                  <th>报考考区</th>
                  <th>场次</th>
                  <th>报考类型</th>
                  <th>报考时间</th>
                  <th>费用</th>
                  <th>报考状态</th>
                </tr>
              </thead>
              <tbody>
                <tr *ngFor="let item of framePager.getRecords(); let i = index">
                  <td>
                    <div class="checkbox c-checkbox input-group-sm">
                      <label nomargin>
                        <input type="checkbox" [value]="item.id" [(checked)]="item.isChecked" [(ngModel)]="item.isChecked" />
                        <span class="fa fa-check"></span>
                      </label>
                    </div>
                  </td>

                  <td>{{item.year_code}}</td>
                  <td>{{item.ticket_no}}</td>
                  
                  <td>{{item.major_code}}-{{item.major_name}}</td>
                  
                  <td>{{item.course_code}}-{{item.course_name}}</td>
                  <td>{{item.enrol_agent_name}}</td>
                  <td>
                    <div *ngIf="item.exam_batch=='A'">1</div>
                    <div *ngIf="item.exam_batch=='B'">2</div>
                    <div *ngIf="item.exam_batch=='C'">3</div>
                    <div *ngIf="item.exam_batch=='D'">4</div>
                    <div *ngIf="item.exam_batch=='X'">5</div>
                    <div *ngIf="item.exam_batch=='Y'">6</div>
                  </td>
                  <td>{{item.enrol_type | frameDict: 'EnrolType'}}</td>
                  <td>{{item.create_time}}</td>
                  <td>{{item.fee_price}}</td>
                  <td [innerHTML]="item.status | frameDict : 'enrol_status'"></td>
                </tr>
              </tbody>
            </table>
            <!-- TODO -->
            <frame-pager [url]="QUERY_URL" [autoLoad]="false" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="this.search($event)"></frame-pager>
          </div>

        </div>
      </div>
    </div>
  </div>
  <!-- only编辑页面 -->
</div>