<div class="container">
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
          <li class="breadcrumb-item active" aria-current="page">领卷查询</li>
        </ol>
    </nav>
  <div class="panel panel-default">
      <div class="panel-body ml-sm">
        <div class="row mb-2 form-inline" style="height:20%">
          <div class="col-lg-6" [hidden]="editShowType=='only'">
              <div class="input-group mr-1 input-group-sm">
                  <label class="ml-sm">&nbsp;考试批次：</label>
                      <flex-select [allowClear]="true"
                              [url]= "'pl/plExamTime/listtime.htm'"
                              respDataPath= "array"
                              optionValueField="id"
                              optionTextField="exam_year_month"
                              [(ngModel)]="query.examTimeId"
                              placeholder="请选择"
                              [ngModelOptions]="{standalone: true}"
                              width = "80"
                              noResultsFound = "无数据"
                      >
                  </flex-select>&nbsp;&nbsp;
                  <label class="ml-sm">&nbsp;评阅方式：</label>
                <select name="net_mark" style="width:100px;" [(ngModel)]="query.net_mark" frameDict [dictName]="'net_mark'" class="form-control">
                </select>
              </div>

              
          </div>
        </div>
        <div class="row" style="height:80%">
          <div class="col-lg-3" [hidden]="editShowType=='only'">
            <!--树形数据-->
            <div class="card card-default">
              <div class="card-header">
                  考区树形菜单
                <div class="mr-1" style="float: right;">
                  <a (click)="expandAllTreeToggle()">
                    <span *ngIf="expandAllTreeToggleFlag">
                        关闭
                    </span>
                    <span *ngIf="!expandAllTreeToggleFlag">
                        展开
                    </span>    
                  </a> 
                </div>

              </div>
              <div class="card-body">
                  <ul id="tree" class="ztree" ></ul>
              </div>
            </div>
          </div>
          <div class="col-lg-9" style="padding-left: 0px !important" [hidden]="editShowType=='only'">
              <div class="card card-default">
                  <div class="card-header">
                    <div *ngIf="ptreeNode"> <font style="color:green;font-size: 15px">[{{ptreeNode.name}}]</font> 领卷列表</div> 
                    <div *ngIf="!ptreeNode" style="color:red">请选择考区</div> 
                  </div>
                  <div class="card-body">
                    <div class="row mb-2">
                        <div class="col-lg-12">
                          <div class="pull-left" style="text-align: right;">
                            <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="receivePaperPdf();" title="打印">
                              <i class="fa icon-cloud-download"></i> 领卷PDF</button>&nbsp;&nbsp;
                            <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="distPaperPdf();" title="打印">
                              <i class="fa icon-cloud-download"></i> 分卷PDF</button>&nbsp;&nbsp;
                            <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="printPaperPdf();" title="打印">
                              <i class="fa icon-cloud-download"></i> 印卷统计PDF</button>&nbsp;&nbsp;
                            <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="exportFunc();" title="打印">
                                <i class="fa icon-cloud-download"></i> 分发总清单XLS</button>&nbsp;&nbsp;
                          </div>
                      </div>
                    </div>
                    <!-- 表格数据-->
                    <table class="table table-sm table-striped table-hover table-bordered bg-white" *ngIf="query.isOneUnitOneClassroom == 1">
                        <thead>
                        <tr>
                          
                          <th width="15%" >考点</th>
                          <th width="7%" >考场代码</th>
                          <th width="7%" align="center">课程代码</th>
                          <th width="26%" >课程名称</th>
                          <th width="6%" align="center">30份/袋</th>
                          <th width="6%" align="center">15份/袋</th>
                          <th width="5%" align="center">5份/袋</th>
                          <th width="10%" align="center">考试人数</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr *ngFor="let item of framePager.getRecords(); let i = index">
                         
                          <th >{{item.unit_name}}</th>
                          <td>{{item.room_code}}</td>
                          <td align="center">{{item.course_code}}</td>
                          <td >{{item.course_name}}</td>
                          <td align="right">{{item.bag_30}}</td>
                          <td align="right">{{item.bag_15}}</td>
                          <td align="right">{{item.bag_5}}</td>
                          <td align="right">{{item.stu_num}}</td>
                        </tr>
                        </tbody>
                    </table>
                    <table class="table table-sm table-striped table-hover table-bordered bg-white" *ngIf="query.isOneUnitOneClassroom != 1">
                      <thead>
                      <tr>
                        
                        <th width="7%" align="center">课程代码</th>
                        <th width="26%" >课程名称</th>
                        <th width="6%" align="right">30份/袋</th>
                        <th width="6%" align="right">15份/袋</th>
                        <th width="5%" align="right">5份/袋</th>
                        <th width="10%" align="right">合计</th>
                      </tr>
                      </thead>
                      <tbody>
                      <tr *ngFor="let item of framePager.getRecords(); let i = index">
                        
                        <td align="center">{{item.course_code}}</td>
                        <td >{{item.course_name}}</td>
                        <td align="right">{{item.bag_30}}</td>
                        <td align="right">{{item.bag_15}}</td>
                        <td align="right">{{item.bag_5}}</td>
                        <td align="right">{{item.djds}}</td>
                      </tr>
                      </tbody>
                  </table>
                    <div class="mt-2">
                      <frame-pager [url]="'kw/kwLayoutVolumeCourse/receivepaperlist.htm'" autoLoad="false" hasCheck="true" #framePager (preReqEvent)="searchParam($event)"></frame-pager>
                    </div>
                  </div>
                </div>
          </div>
        </div>
      </div>
  </div>
</div>

<!--*********************************分发清单-选择是否网评*********************************************-->
<ng-template #distTemplate>
  <div class="card card-default">
      <div class="card-body">
          <div class="form-inline" >
              <label>网评卷：</label>&nbsp;
              <select name="netMark" 
                  [(ngModel)]="query.netMark" 
                  [ngModelOptions]="{standalone: true}"
                  class="form-control">
                  <option value="">全部</option>
                  <option value="1">网评</option>
                  <option value="2">手工评卷</option>
              </select>
          </div>
      </div>
  </div>
</ng-template>
<!--分发模态窗口-->
<ng-template #distModal>
  <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]="distTemplate"></div>
      </div>
    
      <div class="modal-footer">
          <button class="btn btn-info" (click)="exportFunc()">
            <i class="fa fa-info-circle"> </i> 导出PDF
          </button>
      </div>
  </div>
</ng-template>

