<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]="editShowType=='only'">
            <div class="card card-default">
                <div class="card-body">
                    <!--查询条件-->
                    <div class="row mb-3 ml-1" [hidden]="editShowType=='only'">
                        <div class="col-lg-12">
                            <form (ngSubmit)="framePager.goSearch()" class="form-inline">
                                <table><tr>
                                    <td>
                                <div class="input-group mr-1 input-group-sm">
                                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关键字：</label>
                                    <input name="keyword" [(ngModel)]="query.query" 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>
                                    <select name="status" [(ngModel)]="query.apply_status"class="form-control">
                                        <option value="">--请选择--</option>
                                        <option value="待提交">待提交</option>
                                        <option value="待考试院审核">待考试院审核</option>
                                        <option value="审核通过并归档">审核通过并归档</option>
                                        <option value="审核驳回">审核不通过</option>
                                    </select>
    
                                </div>
                            </td>
                            </tr>
                            <tr>
                                    <td>
                                <div class="input-group mr-1 input-group-sm">
                                        <label>主考学校：</label>
                                        <flex-select [allowClear]="true" [url]="SCHOOL_URL" respDataPath="array" optionValueField="id"
                                          optionTextField="org_name" [(ngModel)]="query.query_school_id" placeholder="请选择"
                                          [ngModelOptions]="{standalone: true}" width="160" noResultsFound="无数据">
                                        </flex-select>
    
                                  </div>
                                  </td>
                                  <td>
                                  <div class="input-group mr-1 input-group-sm">
                                        <label>衔接学校：</label>
                                        <flex-select [allowClear]="true" [(items)]="joinSchoolList" optionValueField="id"
                                        optionTextField="org_name" [(ngModel)]="query.query_join_school_id" placeholder="请选择"
                                        [ngModelOptions]="{standalone: true}" width="160" noResultsFound="无数据">
                                        </flex-select>
    
                                  </div>
    </td>
                                 
    <td>
                                <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>
                                </td>
                                </tr></table>
                                </form>
                        </div>
                    </div>
    
                    <!-- 工具栏 -->
                    <div class="row mb-2" [hidden]="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)="goEdit(editTemplateModal,'modal','modal-lg',null)" title="添加">
                                    <i class="fa fa-plus"></i> 添加</button>
                                    <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                                    (click)="callback()" title="撤回">
                                    <i class="fa fa-plus"></i> 撤回</button>
                                
                                
                                <!-- <button id="btnExport" class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip"
                                    data-placement="left" title="导出">
                                    <i class="fa fa-file-excel"></i> 导出</button> -->
                            </div>
    
                        </div>
                    </div>
    
                    <!--表格-->
                    <div class="row">
                        <div class="col-lg-12 ml-0" [hidden]="editShowType=='only'">
                            <table class="table table-sm table-striped table-hover table-bordered bg-white">
                                <thead>
                                    <tr>
                                        <th>
                                            <div class="checkbox c-checkbox">
                                                <label>
                                                    <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 align="center">申请时间</th>
                                        <th>审核类型</th>
                                        <th>审核人</th>
                                        <th>审批意见</th>
                                        
                                        
    
                                        <th style="width: 80px;" align="center">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let item of framePager.getRecords(); let i = index">
                                        <td>
                                            <div class="checkbox c-checkbox input-group-sm">
                                                <label>
                                                    <input type="checkbox" [value]="item.id" [(checked)]="item.isChecked"
                                                        [(ngModel)]="item.isChecked" />
                                                    <span class="fa fa-check"></span>
                                                </label>
                                            </div>
                                        </td>
                                        <td>{{framePager.pageStart+i}}</td>
                                        <td>{{item.apply_topic}}</td>
                                        <td>{{item.apply_remark}}</td>
                                        <td>{{item.apply_status}}</td>
                                        <td>{{item.apply_man_name}}</td>
                                        <td align="center">{{item.apply_date}}</td>
                                        <td>{{item.audit_type}}</td>
                                    
                                        <td>{{item.audit_man_name}}</td>
                                        <td>{{item.audit_remark}}</td>
                                       
                                       
                                        <td align="center">
    
                                            <a href="#" (click)="goEdit(editTemplateModal,'modal','modal-lg',item)"
                                                title="编辑"><em class="fa-lg fas fa-edit mr-1"></em></a>
                                            <a href="#" (click)="deleteApply(item)" title="删除"><em
                                                    class="fa-lg fas fa-trash mr-1" style="color:#F56D6D"></em></a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <!-- TODO -->
                            <frame-pager [url]="QUERY_URL" hideSearch="true" hasCheck="true" #framePager
                                (preReqEvent)="search($event)"></frame-pager>
                        </div>
    
                        <!-- 编辑页面 -->
                        <div class="col-lg-12" *ngIf="item && editShowType != null &&editShowType!='modal'">
                            <ng-container *ngTemplateOutlet="editTemplateModal">
                            </ng-container>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- only编辑页面-->
        <div class="col-lg-12" *ngIf="item && editShowType != null &&editShowType =='only'">
            <ng-container *ngTemplateOutlet="editTemplateModal">
            </ng-container>
        </div>
        <!--关联课程界面  -->
        <div class="col-lg-12" *ngIf="courseShowType">
            <ng-container *ngTemplateOutlet="courseTemplateModal">
            </ng-container>
        </div>
    </div>
    
    <div class="mt-5">
        <frame-uploader #uploader [silenceUpload]="true" [autoUpload]="true" [uploadUrl]="UPLOAD_URL"></frame-uploader>
    </div>
    
    <ng-template #editFormTemplate>
        <form [formGroup]="formModel" *ngIf="item" class="form-validate form-horizontal" novalidate="">
            <input type="hidden" class="form-control" formControlName="id" [(ngModel)]="item.id"
                [formControl]="formModel.controls['id']" />
            <div class="row mb-1">
    
                <label class="col-lg-2 col-form-label text-lg-right">申请主题</label>
                <div class="col-lg-10">
    
                    <input class="form-control" type="text" formControlName="apply_topic" maxlength="64"
                        [formControl]="formModel.get('apply_topic')" [(ngModel)]="item.apply_topic" />
    
                    <span class="text-danger"
                        *ngIf="formModel.get('apply_topic').hasError('required') && (formModel.get('apply_topic').dirty || formModel.get('apply_topic').touched)">请输入申请主题</span>
                </div>
    
                
            </div>
    
            <div class="row mb-1">
    
                   
        
                    <label class="col-lg-2 col-form-label text-lg-right">申请说明</label>
                    <div class="col-lg-10">
        
                            <textarea class="form-control" [(ngModel)]="item.apply_remark" rows="5"   maxlength="256"  formControlName="apply_remark"  [formControl]="formModel.get('apply_remark')"></textarea>
    
                        <span class="text-danger"
                            *ngIf="formModel.get('apply_remark').hasError('required') && (formModel.get('apply_remark').dirty || formModel.get('apply_remark').touched)">请输入申请说明</span>
                        
                    </div>
                </div>
            
        </form>
    </ng-template>
    
    <ng-template #editTemplateModal>
        <div class="modal-content" style="width: 1000px;">
            <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" style="width: 1000px;">
                <div [ngTemplateOutlet]="editFormTemplate"></div>
                <div [ngTemplateOutlet]="oldTemplate"></div>
                <div [ngTemplateOutlet]="newTemplate"></div>
                
                <div class="modal-footer" style="padding-top:2px;">
                        <!--
                    <button class="btn btn-info" (click)="addStd()" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                            <i class="fa fa-info-circle"> </i> 添加考生
                        </button>
                    -->
                        <button class="btn btn-info" (click)="this.item.apply_status='待提交';save()" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                            <i class="fa fa-info-circle"> </i> 保存
                        </button>
                        <button class="btn btn-info" (click)="this.item.apply_status='待考试院审核';save()" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                                <i class="fa fa-info-circle"> </i> 提交
                            </button>
                        <button class="btn btn-default" (click)="hideModal()">
                            <i class="icon-close"> </i> 取消
                        </button>
                    </div>
            </div>
    
            
        </div>
    </ng-template>
    
    
    
    <ng-template #oldTemplate>
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h4>原备案考生</h4>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <table class="table table-sm table-striped table-hover table-bordered bg-white">
                        <thead>
                            <tr>
                                    <th>序号</th>
                                <th>姓名</th>
                                <th align="center">准考证号</th>
                                <th>专业名称</th>
                                <th>主考学校</th>
                                <th>衔接学校</th>
                                
                            </tr>
                        </thead>
                        <tbody>
                            <tr *ngFor="let std of oldStds; let i = index">
                                    <td>{{i+1}}</td>
                                <td>{{std.std_name}}</td>
                                <td align="center">{{std.ticket_no}}</td>
                                <td  align="left">{{std.major_name}}</td>
                                <td>{{std.org_name}}</td>
                                <td>{{std.join_school_name === '()'  ? '' : std.join_school_name}}</td>
                                
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
    
        </div>
    </ng-template>
    
    <ng-template #newTemplate>
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h4>申请转学转专业的备案信息</h4>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <table class="table table-sm table-striped table-hover table-bordered bg-white">
                        <thead>
                                <tr>
                                        <th nowrap>序号</th>
                                        <th nowrap>姓名</th>
                                        <th nowrap align="center">准考证号</th>
                                        <th nowrap>专业名称</th>
                                        <th nowrap>主考学校</th>
                                        <th nowrap>衔接学校</th>
                                        <th nowrap align="center">操作</th>
                                    </tr>
                        </thead>
                        <tbody>
                                <tr *ngFor="let std of yesStds ; let i = index">
                                    <td nowrap>{{i+1}}</td>
                                    <td nowrap>{{std.std_name}}</td>
                                    <td nowrap align="center">{{std.ticket_no}}</td>
                                    
                                    <td align="left" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                                        <flex-select [allowClear]="false" [(items)]="majorList" optionValueField="major_code"
                                        optionTextField="major_full_name" [(ngModel)]="std.join_major_code" placeholder="请选择"
                                        [ngModelOptions]="{standalone: true}" width="150" noResultsFound="无数据">
                                        </flex-select>
                                    </td>
                                    <td align="left" style="color:red;" *ngIf="!(item && (item.apply_status=='待提交'||item.apply_status==null))">
                                            {{std.major_name}}
                                    </td>
                                    <td align="left" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                                           
                                            <flex-select disabled [allowClear]="false" [url]="SCHOOL_URL" respDataPath="array" optionValueField="id"
                                            optionTextField="org_name" [(ngModel)]="std.school_id" placeholder="请选择"
                                            [ngModelOptions]="{standalone: true}" width="150" noResultsFound="无数据">
                                          </flex-select>
                                            
        
                                        </td>
                                        <td align="left" style="color:red;" *ngIf="!(item && (item.apply_status=='待提交'||item.apply_status==null))">
                                                {{std.org_name}}
                                        </td>
        
                                        <td align="left" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                                              
                                            <flex-select disabled [allowClear]="false" [(items)]="joinSchoolList" optionValueField="id"
                                            optionTextField="org_name" [(ngModel)]="std.join_school_id" placeholder="请选择"
                                            [ngModelOptions]="{standalone: true}" width="150" noResultsFound="无数据">
                                            </flex-select>
            
                                            </td>
                                            <td align="left" style="color:red;" *ngIf="!(item && (item.apply_status=='待提交'||item.apply_status==null))">
                                                    {{std.join_school_name === '()'  ? '' : std.join_school_name}}
                                            </td>
        
                                    
                                    <td nowrap align="center">
                                        <a href="#" (click)="deleteStd(std)" title="删除" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)"><em
                                                class="fa-lg fas fa-trash mr-1" style="color:#F56D6D"></em></a>
                                    </td>
                                </tr>
                            </tbody>
                    </table>
                </div>
            </div>
    
            <div class="row" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                <div class="col-lg-12">
                    <h4>待添加转学转专业考生</h4>
                </div>
            </div>
    
            <div class="panel-body ml-sm" *ngIf="item && (item.apply_status=='待提交'||item.apply_status==null)">
                <div class="card card-default">
                    <div class="card-body">
                        <!--查询条件-->
                        <div class="row mb-3 ml-1">
                            <div class="col-lg-12">
                                <form (ngSubmit)="framePager2.goSearch()" class="form-inline">
    
                                    <div class="input-group mr-1 input-group-sm">
                                        <label>关键字：</label>
                                        <input name="keyword" [(ngModel)]="query.query" class="input-sm form-control"
                                            type="text" value="" maxlength="64" placeholder="请输入查询关键字">
    
                                    </div>
                                    <div class="input-group mr-1 input-group-sm">
                                        <label>备案批次：</label>
                                            <flex-select [allowClear]="true" [url]="YEAR_CODE_URL" respDataPath="array" optionValueField="year_code"
                                            optionTextField="year_code" [(ngModel)]="query.year_code" placeholder="请选择"
                                            [ngModelOptions]="{standalone: true}" width="80" noResultsFound="无数据" >
                                        </flex-select>
                                    </div>
    
                                    <div class="input-group mr-1 input-group-sm">
                                            <label>主考学校：</label>
                                            <flex-select [allowClear]="true" [url]="SCHOOL_URL" respDataPath="array" optionValueField="id"
                                              optionTextField="org_name" [(ngModel)]="query.school_id" placeholder="请选择"
                                              [ngModelOptions]="{standalone: true}" width="150" noResultsFound="无数据">
                                            </flex-select>
                                        </div>
    
                                    
                                   
                                    
                                    <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1"
                                        (click)="framePager2.goSearch()">
                                        <i class="fa fa-search"></i> 查询</button>
                                </form>
                            </div>
                        </div>
    
                        <!--表格-->
                        <div class="row">
                            <div class="col-lg-12 ml-0">
                                <table class="table table-sm table-striped table-hover table-bordered bg-white">
                                    <thead>
                                        <tr>
                                            <th>
                                                <div class="checkbox c-checkbox">
                                                    <label>
                                                        <!--<input type="checkbox"
                                                            (change)="framePager2.checkedMasterToggle($event)" />
                                                        <span class="fa fa-check"></span>
                                                        -->
                                                        &nbsp;
                                                    </label>
                                                </div>
                                            </th>
                                            <th>姓名</th>
                                            <th align="center">准考证号</th>
                                            <th align="center">备案类型</th>
                                            <th>专业名称</th>
                                            <th>主考学校</th>
                                            <th>衔接学校</th>
                                           
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr *ngFor="let item of framePager2.getRecords(); let i = index">
                                            <td>
                                                <div class="checkbox c-checkbox input-group-sm">
                                                    <label>
                                                        <input type="radio" [value]="item.id"
                                                        (change)="addOneStd($event,item)"
                                                            [(checked)]="item.isChecked" [(ngModel)]="item.isChecked" />
                                                        <span class="fa fa-check"></span>
                                                    </label>
                                                </div>
                                            </td>
    
                                            
                                            <td>{{item.std_name}}</td>
                                            <td align="center">{{item.ticket_no}}</td>
                                            <td align="center">{{item.std_type | frameDict : 'std_type'}}</td>
                                            <td>{{item.major_name}}</td>
                                            <td>{{item.org_name}}</td>
                                            <td>{{item.join_school_name === '()'  ? '' : item.join_school_name}}</td>
                                           
                                        </tr>
                                    </tbody>
                                </table>
                                <frame-pager [url]="STD_RECORD_PAGE_URL" hideSearch="true" pageLimit="5" hasCheck="true"
                                    #framePager2 (preReqEvent)="search2($event)"></frame-pager>
                            </div>
    
                        </div>
                    </div>
                </div>
            </div>
    
        </div>
    </ng-template>
    
      
    
    