<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">
                        <form (ngSubmit)="framePager.goSearch()" class="form-inline">

                            <div class="input-group mr-1 input-group-sm">
                                <label>姓名：</label>
                                <input name="keyword" [(ngModel)]="query.std_name" class="input-sm form-control" type="text" value="" maxlength="64">

                            </div>
                            <div class="input-group mr-1 input-group-sm">
                                <label>身份证：</label>
                                <input name="keyword" [(ngModel)]="query.std_cert_no" class="input-sm form-control" type="text" value="" maxlength="64">

                            </div>
                            <div class="input-group mr-1 input-group-sm">
                                <label>证件类型：</label>
                                <!-- TODO -->
                                <select class="input-sm form-control" [ngModelOptions]="{standalone: true}"   [(ngModel)]="query.cert_type_id">
                     
                                    <option value="">请选择</option>
                                    <option *ngFor="let item of certTypeList" [value]="item.id">
                                        {{item.cert_code}}-{{item.cert_name}}
                                    </option>
                                </select>


                            </div>
                            <div class="input-group mr-1 input-group-sm">
                                <label>证件编号：</label>
                                <input name="keyword" [(ngModel)]="query.cert_no" class="input-sm form-control" type="text" value="" maxlength="64">

                            </div>

                            <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="framePager.goSearch()">
                                <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> -->
                        </form>
                    </div>
                </div>

                <!-- 工具栏 -->
                <div class="row mb-2" [hidden]="this.editShowType=='only'">
                    <div class="col-lg-12">
                        <div class="pull-left">
                            <button class="btn mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="goVerify(shouModalWin_verify)"
                                title="审批">
                                <i class="fa icon-note"></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>
                                </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.std_name}}</td>
                                    <td>{{item.std_cert_no}}</td>
                                    <td>{{item.cert_name}}</td>
                                    <td>{{item.source_unit}}</td>
                                    <td>{{item.cert_no}}</td>
                                    <td>{{item.out_school_date}}</td>
                                    <td>{{item.status_text}}</td>
                
                                </tr>
                            </tbody>
                        </table>
                        <!-- TODO -->
                        <frame-pager [url]="QUERY_URL" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="this.search($event)"></frame-pager>
                    </div>

                    <!-- 编辑页面 -->
                    <div class="col-lg-12" *ngIf="this.item && this.editShowType != null &&this.editShowType!='modal'">
                        <ng-container *ngTemplateOutlet="editTemplateModal">
                        </ng-container>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- only编辑页面 -->
    <div class="col-lg-12" *ngIf="this.item && this.editShowType != null && this.editShowType =='only'">
        <ng-container *ngTemplateOutlet="shouModalWin_verify">
        </ng-container>
    </div>
</div>

<ng-template #editFormTemplate>
    <h4>申请信息</h4>
    <table style="width:100%" class="table table-sm table-striped table-hover table-bordered bg-white">
        <thead>
            <tr>
                <td>注册身份证</td>
                <td>注册姓名</td>
                <td>录入姓名</td>
                <td>录入身份证</td>
                <td>录入毕业学校</td>
                <td>学历类型</td>
                <td>证书编号</td>
                <td>录入毕业专业</td>
                <td>入学时间</td>
                <td>毕业时间</td>
                <td>专业</td>
                <td>学历证书分类</td>
            </tr>
        </thead>
        <tr>
            <td>{{item.cert_no}}</td>
            <td>{{item.std_name}}</td>
            <td>{{item.input_cert_no}}</td>
            <td>{{item.input_std_name}}</td>
            <td>{{item.source_unit}}</td>
            <td>{{item.edu_type}}</td>
            <td>{{item.cert_no}}</td>
            <td>{{item.major_name}}</td>
            <td>{{item.in_school_date}}</td>
            <td>{{item.out_school_date}}</td>
            <td>{{item.major_name}}</td>
            <td>{{item.cert_name}}</td>
      
        </tr>
    </table>

    <h4>相关附件</h4>
    <table style="width:100%" class="table table-sm table-striped table-hover table-bordered bg-white">
        <thead>
            <tr>
                <td>学历证书（原件照片）</td>
                <!-- <td>学历认证报告（原件照片）</td> -->
                <td>身份证（原件照片）</td>
                <!-- <td>户口本材料</td>
                <td>公正处证明材料</td> -->
        
            </tr>
        </thead>
        <tr>
            <td><img  [src]="item.edu_cert_file_path" style="width: 400;height: 400px"></td>
            <td><img  [src]="item.std_cert_file_path" style="width: 400;height: 400px"></td>
            <!-- <td><img src="" style="width: 400;height: 400px"></td>
            <td><img src="" style="width: 400;height: 400px"></td>
            <td><img src="" style="width: 400;height: 400px"></td> -->
           
      
        </tr>
    </table>
    <div class="mt-2">
        初审结果：
        <label class="radio-inline c-radio">
            <input type="radio" name="status" value="1" [(ngModel)]="item.status" />
            <span class="fa fa-circle"></span>通过
        </label>
        <label class="radio-inline c-radio">
            <input type="radio" name="status" value="0" [(ngModel)]="item.status" />
            <span class="fa fa-circle"></span>不通过
        </label>
    </div>
    <div class="mt-2" style="vertical-align: top;">
        初审意见：
        <textarea [(ngModel)]="item.verify1_remark" rows="3" cols="100"></textarea>
    </div>
</ng-template>

<ng-template #shouModalWin_verify>
    <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)="this.hideModal()">×</button>
        </div>

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

        <div class="modal-footer">
            <button class="btn btn-info" (click)="this.saveVerify()">
                <i class="fa fa-info-circle"> </i> 保存
            </button>
            <button class="btn btn-default" (click)="this.hideModal()">
                <i class="icon-close"> </i> 取消
            </button>
        </div>
    </div>
</ng-template>