<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" style="width:5%">批次:</td>
                <td align="left" style="width:10%">
                  <flex-select [allowClear]="true"
                      [url]= "'pl/plExamTime/list.htm'"
                      respDataPath= "array"
                      optionValueField="id"
                      optionTextField="examyearmonth"
                      [(ngModel)]="query.exam_time_id"
                      placeholder="请选择"
                      width = "60"
                      noResultsFound = "无数据"
                      [ngModelOptions]="{standalone: true}"
                      >
                  </flex-select>
            </td>

            <td align="right" style="width:5%"> 关键字:</td>
            <td align="left" style="width:10%">
                <input name="keyword" [(ngModel)]="query.query" class="input-sm form-control" type="text" value="" maxlength="64" style="width:180px">

            </td>

            <td align="right" style="width:5%"> 状态:</td>
            <td align="left" style="width:20%">
                <select name="status" [(ngModel)]="query.status"class="form-control"  style="width:180px">
                    <option value="">-请选择-</option>
                    <option value="受理中">受理中</option>
                    <option value="受理完成">受理完成</option>
                    <option value="受理完成">已冲红</option>
                   
                </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" style="text-align: right;">
              <!-- <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 class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" title="请在关键字中输入订单编号，再点击冲红发票按钮" (click)="canclePayinvoicing()">
                  <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)="buildPayinvoicing()">
                  <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 align="center">批次</th>
                  <th align="center">准考证号</th>
                  <th>考生姓名</th>
                  <th align="center">订单编号</th>
                 
                  <th align="center">订单金额</th>
                  <th align="center">订单生成时间</th>
                  <th>发票申请状态</th>
                  <th align="center">申请时间</th>
                  
                  <th align="center">操作</th>
                </tr>
              </thead>
              <tbody>
                <tr *ngFor="let item of framePager.getRecords(); let i = index">

                  <td align="center">{{item.exam_year_month}}</td>
                  <td align="center">{{item.ticket_no}}</td>
                  <td>{{item.std_name}}</td>
                  <td align="center">{{item.bill_no}}</td>
                  <td align="right">{{item.bill_amount}}</td>
                  <td align="center">{{item.bill_time}}</td>
                  <td>{{item.status}}</td>
                  <td align="center">{{item.create_time}}</td>
                 
                  <td align="center">
                    <a href="#" *ngIf="item.path" (click)="downTicket(item)" title="下载电子发票">
                      <i class="fa fa-download"></i>
                  </a>  
                  </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>