<div class="panel panel-default" style="margin-bottom:0px;">
        <!--标题-->
        <div class="panel-title">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb"  style="margin-bottom:0px;">
                    <!-- TODO -->
                    
                    <li class="breadcrumb-item active" aria-current="page">沟通课程申报</li>
                </ol>
            </nav>
        </div>
    
        <div [hidden]="editShowType=='only'" class="panel-title panel-heading jf-org-tab" style="margin-top:0px;margin-bottom:-1px;">
                <div class="panel-control" style="float:left;">
                    <ul class="nav nav-tabs">
                        <li [class]='0 == isActive? "li-class-active" : "li-class" ' (click)="changeLi($event,0,1)">等待审核</li>
                        <li [class]='1 == isActive? "li-class-active" : "li-class" ' (click)="changeLi($event,1,2)">审核完成</li>
                       
        
                    </ul>
                </div>
            </div>
    
        <div class="panel-body ml-sm" [hidden]="editShowType=='only' || editShowType=='applyTimeFilter'">
            <div class="card card-default">
                <div class="card-body">
                    <!--查询条件-->
                    <div class="row mb-3 ml-1" [hidden]="editShowType=='only' || editShowType=='applyTimeFilter'">
                        <div class="col-lg-12">
                            <form (ngSubmit)="framePager.goSearch()" class="form-inline">
                                <!--
                                <div class="input-group mr-1 input-group-sm">
                                    <label>年度码：</label>
                                    <flex-select [allowClear]="true"
                                        [(items)] = "yearCodeList"
                                        respDataPath= "array"
                                        optionValueField="year_code"
                                        optionTextField="year_code"
                                        [(ngModel)]="query.yearCode"
                                        placeholder="请选择"
                                        [ngModelOptions]="{standalone: true}"
                                        width = "80"
                                        noResultsFound = "无数据"
                                        >
                                    </flex-select>
                                </div>&nbsp;&nbsp;
                            -->
                                <div class="input-group mr-1 input-group-sm" *ngIf="curOrg.org_type == 0">
                                    <label>主考学校：</label>
                                    <flex-select [allowClear]="true"
                                        [(items)] = "masterSchoolList"
                                        respDataPath= "array"
                                        optionValueField="id"
                                        optionTextField="org_name"
                                        [(ngModel)]="query.masterSchoolId"
                                        placeholder="请选择"
                                        [ngModelOptions]="{standalone: true}"
                                        width = "200"
                                        noResultsFound = "无数据"
                                        >
                                    </flex-select>
                                </div>&nbsp;&nbsp;

                                <div class="input-group mr-1 input-group-sm">
                                        <label>课程：</label>
                                        <flex-select [allowClear]="true"
                                            [(items)] = "courseList"
                                            respDataPath= "array"
                                            optionValueField="id"
                                            optionTextField="major_name"
                                            [(ngModel)]="query.majorId"
                                            placeholder="请选择"
                                            [ngModelOptions]="{standalone: true}"
                                            width = "200"
                                            noResultsFound = "无数据"
                                            >
                                        </flex-select>
                                </div>&nbsp;&nbsp;
                                <!-- <div class="input-group mr-1 input-group-sm">
                                    <label>申报学校：</label>
                                    <flex-select [allowClear]="true"
                                        [(items)] = "masterSchoolList"
                                        respDataPath= "array"
                                        optionValueField="id"
                                        optionTextField="org_name"
                                        [(ngModel)]="query.applySchoolId"
                                        placeholder="请选择"
                                        [ngModelOptions]="{standalone: true}"
                                        width = "40"
                                        noResultsFound = "无数据"
                                        >
                                    </flex-select>
                                </div> 
                                <div class="input-group mr-1 input-group-sm">
                                    <label>专业：</label>
                                    <flex-select [allowClear]="true"
                                        [(items)] = "majorList"
                                        respDataPath= "array"
                                        optionValueField="id"
                                        optionTextField="major_name"
                                        [(ngModel)]="query.majorId"
                                        placeholder="请选择"
                                        [ngModelOptions]="{standalone: true}"
                                        width = "40"
                                        noResultsFound = "无数据"
                                        >
                                    </flex-select>
                                </div>&nbsp;&nbsp;-->
                                <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)="resetQuery()">
                                    <i class="fa fa-undo"></i> 重置</button>
                            </form>
                        </div>
                    </div>
    
                    <!-- 工具栏 -->
                    <div class="row mb-2" [hidden]="editShowType=='only' || editShowType=='applyTimeFilter'">
                        <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)="toApply()" title="沟通课程申报">
                                    <i class="fa fa-plus"></i> 沟通课程申报</button>&nbsp;&nbsp;
                              <!-- 
                                    <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                                    (click)="submitApply();" title="提交申请">
                                    <i class="fa fa-plus"></i> 提交申请</button>&nbsp;&nbsp;
                                <button class="btn mr-1 btn-sm bg-danger" (click)="proxyDelete()" data-toggle="tooltip"
                                    data-placement="left" title="删除">
                                    <i class="fa fa-trash"></i>删除</button>&nbsp;&nbsp;
                              -->
                            </div>
                        </div>
                    </div>
    
                    <!--表格-->
                    <div class="row">
                        <div class="col-lg-12 ml-0" [hidden]="editShowType=='only' || editShowType=='applyTimeFilter'">
                            <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 align="center">申报形式</th>
                                        <th>主考院校</th>
                                        <th align="center">课程代码</th>
                                        <th>课程名称</th>

                                        <th align="center">申报日期</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 align="center" [innerHTML]="item.apply_form | frameDict:'apply_form'"></td>
                                        <td>{{item.master_school}}</td>
                                        <td align="center">{{item.course_code}}</td>
                                        <td>{{item.course_name}}</td>

                                        <td align="center">{{item.apply_date.substring(0,10)}}</td>
                                        <td>{{item.apply_no}}</td>
                                        <td [innerHTML]="item.status| frameDict:'MajorApplyStatus'"></td>
                                        <td align="center">
                                            <a href="#" (click)="proxyGoEdit(item)" title="编辑"><em
                                                class="fa-lg fas fa-edit mr-1"></em></a>                                        
                                            <a href="#" *ngIf="query.status==1" (click)="proxyDelete(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="editShowType != null && editShowType =='applyTimeFilter'">
            <ng-container *ngTemplateOutlet="applyTimeListModal">
            </ng-container>
        </div>        
    </div>
    <div class="row">
        <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-8">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>主考学校代码</th>
                                        <th>主考学校名称</th>
                                    </tr>
                                </thead>
                                <tbody>
                                   
                                    <tr *ngIf="!item.id">
                                        <td>{{curOrg.org_code_bz}}</td>
                                        <td>{{curOrg.org_name}}</td>
                                    </tr>
                                    <tr *ngIf="item.id">
                                        <td>{{item.masterSchool.org_code_bz}}</td>
                                        <td>{{item.masterSchool.org_name}}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                </div>
                <!--
                <div class="row mb-2">
                    <label class="col-lg-2 col-form-label text-lg-right">年度码</label>
                    <div class="col-lg-8">
                        <flex-select [allowClear]="true"
                            [(items)] = "yearCodeList"
                            optionValueField="year_code"
                            optionTextField="year_code"
                            [(ngModel)]="item.year_code"
                            placeholder="请选择"
                            formControlName="year_code" 
                            [formControl]="formModel.controls['year_code']" 
                            width = "250"
                            noResultsFound = "无数据"
                            >
                        </flex-select>
                        <span class="text-danger" *ngIf="formModel.get('year_code').hasError('required') && (formModel.get('year_code').dirty || formModel.get('year_code').touched)">请选择申报年度</span>
                    </div>
                </div>
                -->
                <!--<div class="row mb-2">
                    <label class="col-lg-2 col-form-label text-lg-right">专业层次</label>
                    <div class="col-lg-8">
                            <flex-select [allowClear]="true"
                            [(items)] = "eduLevelList"
                            respDataPath= "array"
                            optionValueField="key"
                            optionTextField="val"
                            [(ngModel)]="item.major_level"
                            placeholder="请选择"
                            formControlName="major_level" 
                            [formControl]="formModel.controls['major_level']" 
                            width = "100"
                            noResultsFound = "无数据"
                            >
                        </flex-select>
                        <span class="text-danger" *ngIf="formModel.get('major_level').hasError('required') && (formModel.get('major_level').dirty || formModel.get('major_level').touched)">请选择专业层次</span>
                    </div>
                </div>-->
                <div class="row mb-2" *ngIf="!item.id">
                        <label class="col-lg-2 col-form-label text-lg-right">申报专业</label>
                        <div class="col-lg-8  form-inline">
                            <flex-select [allowClear]="true"
                                [(items)] = "majorList"
                                respDataPath= "array"
                                optionValueField="id"
                                optionTextField="full_name"
                                [(ngModel)]="select_major_id"
                                placeholder="请选择"
                                [ngModelOptions]="{standalone: true}"
                                width = "250"
                                noResultsFound = "无数据"
                                (ngModelChange)="majorChane()"
                                >
                            </flex-select>
                          
                        </div>
                    </div>

                
                <div class="row mb-2" *ngIf="!item.id">
                    <label class="col-lg-2 col-form-label text-lg-right">申报课程</label>
                    <div class="col-lg-8  form-inline">
                        <flex-select [allowClear]="true"
                            [(items)] = "select_courseList"
                            respDataPath= "array"
                            optionValueField="course_id"
                            optionTextField="full_name"
                            [(ngModel)]="item.major_id"
                            placeholder="请选择"
                            formControlName="major_id" 
                            [formControl]="formModel.controls['major_id']" 
                            width = "250"
                            noResultsFound = "无数据"
                            >
                        </flex-select>
                        <span class="text-danger" *ngIf="formModel.get('major_id').hasError('required') && (formModel.get('major_id').dirty || formModel.get('major_id').touched)">请选择课程</span>&nbsp;&nbsp;
                        <!--
                        <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="addMultiMajor()" title="添加">
                            <i class="fa fa-plus"></i> 添加课程</button>
                            -->
                    </div>
                </div>
                <div class="row mb-2" *ngIf="item.id" [hidden]="isHiddenMajorFlag">
                        <label class="col-lg-2 col-form-label text-lg-right">申报课程</label>
                        <div class="col-lg-8">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th align="center">课程代码</th>
                                        <th>课程名称</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let key of getKeys(selectMajorMap)">
                                            <td align="center">{{selectMajorMap[key].major_code}}</td>
                                            <td>{{selectMajorMap[key].major_name}}</td>
                                           
                                           
                                        </tr>
                                </tbody>
    
                            </table>
                        </div>
                </div>

                 <!-- 审核记录查询 -->
        <div class="row mb-1">
            <!-- 审核流程列表 -->
            <label class="col-lg-2 col-form-label text-lg-right">审核记录</label>
            <div class="col-lg-8">
                <table class="table table-sm table-striped table-hover table-bordered bg-white">
                    <thead>
                        <tr>
                            <th>审核类型</th>
                            <th align="center">审核时间</th>
                            <th>审核人</th>
                            <th>审核意见</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let it of authList; let i = index">
                            <td>{{it.auth_type | frameDict:'MajorApplyAuthType'}}</td>
                            <td align="center">{{it.auth_time}}</td>
                            <td>{{it.optr_name}}</td>
                            <td>{{it.auth_remark}}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
               
                <div class="row mb-1">
                    <label class="col-lg-2 col-form-label text-lg-right">申报文书号</label>
                    <div class="col-lg-8">
                        <input class="form-control" formControlName="apply_no" type="text" [(ngModel)]="item.apply_no" 
                        [formControl]="formModel.controls['apply_no']" width="40"/>
                        <!--<span class="text-danger" *ngIf="formModel.get('apply_no').hasError('required') && (formModel.get('apply_no').dirty || formModel.get('apply_no').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-8 form-inline">
                        <button *ngIf="item.status != 2 && item.status != 3" class="btn btn-info" (click)="uploadFile()">
                            <i class="fa fa-info-circle"> </i> 上传
                        </button>&nbsp;&nbsp;&nbsp;&nbsp;
                        <span *ngIf="item.file_name && !item.id">{{item.file_name}}</span>
                        <span *ngIf="item.file_name && item.id"><a href="#" (click)="downloadApplyFile(item.id);">{{item.file_name}}</a></span>
                        <input type="hidden" class="form-control" [(ngModel)]="item.file_path"  formControlName="file_path" [formControl]="formModel.controls['file_path']"/>
                        <span class="text-danger" *ngIf="formModel.get('file_path').hasError('required') && (formModel.get('file_path').dirty || formModel.get('file_path').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-8">
                        <textarea class="form-control" formControlName="apply_remark" [formControl]="formModel.controls['apply_remark']" 
                            [(ngModel)]="item.apply_remark" rows="3" maxlength="256"></textarea>
                    </div>
                    <span class="text-danger" *ngIf="formModel.get('apply_remark').hasError('required') && (formModel.get('apply_remark').dirty || formModel.get('apply_remark').touched)">申报说明</span>
                </div>
        </form>
    </ng-template>
    
    <ng-template #editTemplateModal>
        <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]="editFormTemplate"></div>
            </div>
    
            <div class="modal-footer">
                <button class="btn btn-info" (click)="save()" *ngIf="!item.id">
                    <i class="fa fa-info-circle"> </i> 提交
                </button>
                <!--
                <button class="btn btn-info" (click)="save()" *ngIf="item.id && item.status==0">
                    <i class="fa fa-info-circle"> </i> 修改
                </button>
            -->
                <button class="btn btn-default" (click)="hideModal()">
                    <i class="icon-close"> </i> 关闭
                </button>
            </div>
        </div>
    </ng-template>
    
    <!--*********************************申请备案时间列表*********************************************-->
    <!-- 开考类型对应申报时间列表界面 -->
    <ng-template #applyTimeListModal>
        <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>
          
              <div class="modal-body">
                <div [ngTemplateOutlet]="applyTimeTemplate"></div>
              </div>
          
              <div class="modal-footer">
                <button class="btn btn-default" (click)="hideModal()">
                  <i class="icon-close"> </i> 关闭
                </button>
              </div>
        </div>
    </ng-template>
          
          
    <ng-template #applyTimeTemplate>
        <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 align="center">年度码</th>
                      <th align="center">申报形式</th>
                      <th align="center">申报时间范围</th>
                     
                      <th align="center">操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr *ngFor="let item of applyTimeList; let i = index">
                      <td>{{i+1}}</td>
                      <td align="center">{{item.year_code}}</td>
                      <td align="center">{{item.dict_text}}</td>
                      <td align="center">{{item.apply_start_time}} 到 {{item.apply_end_time}}</td>
                      
                      <td align="center">
                        <a href="#" (click)="enterApply(item.apply_form,item.year_code)" title="进入课程申报">进入课程申报</a>
                      </td>
                    </tr>
                  </tbody>
                </table>
            </div>
        </div>
    </ng-template>
    
    <!--****************************衔接学校维护-专本衔接才有***********************-->
    <ng-template #joinSchoolModal>
        <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)="hiderJoinModal()">×</button>
              </div>
          
              <div class="modal-body">
                <div [ngTemplateOutlet]="joinSchoolTemplate"></div>
              </div>
          
              <div class="modal-footer">
                <button class="btn btn-info" (click)="hiderJoinModal()">
                    <i class="fa fa-info-circle"> </i> 确定
                </button>&nbsp;&nbsp;
                <button class="btn btn-default" (click)="hiderJoinModal()">
                  <i class="icon-close"> </i> 关闭
                </button>
              </div>
        </div>
    </ng-template>
          
          
    <ng-template #joinSchoolTemplate>
        <div class="row mb-2">
                <label class="col-lg-2 col-form-label text-lg-right">衔接学校</label>
                <div class="col-lg-8 form-inline">
                    <flex-select [allowClear]="true"
                        [(items)]="joinSchoolList"
                        respDataPath= "array"
                        optionValueField="id"
                        optionTextField="org_name"
                        [(ngModel)]="joinQuery.orgId"
                        [ngModelOptions]="{standalone: true}"
                        placeholder="请选择"
                        width = "100"
                        noResultsFound = "无数据"
                        >
                    </flex-select>&nbsp;&nbsp;
                    <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="addMultiJoinSchool()" title="添加">
                            <i class="fa fa-plus"></i> 添加衔接学校</button>
                </div>
        </div>
        <div class="row mb-2">
            <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>衔接学校名称</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr *ngFor="let key of getKeys(currJoinSchoolMap); let i = index">
                      <td>{{i+1}}</td>
                      <td>{{currJoinSchoolMap[key].org_code}}</td>
                      <td>{{currJoinSchoolMap[key].org_name}}</td>
                      <td>
                        <a href="#" (click)="deleteJoinSchool(currJoinSchoolMap[key].id)" title="删除">
                            <em class="fa-lg fas fa-trash mr-1" style="color:#F56D6D"></em>
                        </a>
                      </td>
                    </tr>
                  </tbody>
                </table>
            </div>
        </div>
    </ng-template>