<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>关键字：</label>
										<input name="keyword" [(ngModel)]="query.query" class="input-sm form-control" type="text"
													value="" maxlength="50" placeholder="请输入查询关键字" width="80">
									</div>
								</td>
								<td>
									<!--时间批次 -->                             
									<div class="input-group mr-1 input-group-sm">
										<label class="ml-sm">毕业批次：</label>
										<flex-select [allowClear]="true"
													[url]= "'pl/plExamTime/listPlExamTimeForBy.htm'"
													respDataPath= "array"
													optionValueField="id"
													optionTextField="exam_year_month"
													[(ngModel)]="query.examTimeId"
													placeholder="请选择"
													[ngModelOptions]="{standalone: true}"
													width = "100"
													noResultsFound = "无数据"
													>
										</flex-select>
									</div>
								</td>  	
								
								<td>
									<div class="input-group mr-1 input-group-sm">
										<label>开始时间：</label>
										<input class=" input-sm form-control"  name="startTime" type="date"  [(ngModel)]="query.startTime" >
									</div>
								</td>
								<td>
									<div class="input-group mr-1 input-group-sm">
										<label>结束时间：</label>
										<input class="input-sm form-control" name="endTime" type="date"  [(ngModel)]="query.endTime" />
									</div>	
								</td>
								
								<!-- <td>
										<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.masterSchoolId"
											   placeholder="请选择"
											   [ngModelOptions]="{standalone: true}"
											   width = "80"
											   noResultsFound = "无数据"
											   >
										   </flex-select>
									   </div>
								   </td>
								<td>
										<div class="input-group mr-1 input-group-sm">
											<label>受理单位：</label>
											<flex-select [allowClear]="true"
												[(items)] = "orgList"
												respDataPath= "array"
												optionValueField="id"
												optionTextField="org_name"
												[(ngModel)]="query.cityOrgId"
												placeholder="请选择"
												[ngModelOptions]="{standalone: true}"
												width = "80"
												noResultsFound = "无数据"
												>
											</flex-select>
										</div>
									</td>
								</tr>
								<tr>
								 <td>
										<div class="input-group mr-1 input-group-sm">
											<label>状态：</label>
											<select name="status" 
												style = "width: 70px;"
												[(ngModel)]="query.status" 
												frameDict [dictName]="'ByCertificate'" 
												[ngModelOptions]="{standalone: true}"
												class="form-control">
											</select>
										</div>
								</td>
									<td>
									<div class="input-group mr-1 input-group-sm">
										<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;专业：</label>
										<flex-select [allowClear]="true"
											[(items)] = "majorList"
											respDataPath= "page.recordes"
											optionValueField="id"
											optionTextField="major_full_name"
											[(ngModel)]="query.majorId"
											placeholder="请选择"
											[ngModelOptions]="{standalone: true}"
											width = "80"
											noResultsFound = "无数据"
											>
										</flex-select>
									</div>
								</td>
								<td>
										<div class="input-group mr-1 input-group-sm">
											<label>考生来源：</label>
											<select name="std_source" style="width: 80px;"
											[(ngModel)]="query.std_source" 
											[ngModelOptions]="{standalone: true}"
											class="form-control">
											<option value="">请选择</option>
											<option value="1">社会考生</option>
											<option value="3">助学考生</option>
										</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" (click)="getCertificatePdf()" data-toggle="tooltip"
										data-placement="left" title="选择查询记录下载毕业证明书">
										<i class="fa icon-cloud-download"></i> 毕业证明书下载</button>
										<button class="btn btn-primary mr-1 btn-sm" (click)="getAllCertificatePdf()" data-toggle="tooltip"
										data-placement="left" title="输入查询条件下载毕业证明书">
										<i class="fa icon-cloud-download"></i> 全量毕业证明书下载</button>
										<button class="btn btn-primary mr-1 btn-sm" (click)="getApplyTable();" data-toggle="tooltip"
										data-placement="left" title="毕业证明书申请表"><i class="fa fa-snowflake"></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 align="center">准考证</th>
											<th>身份证</th>
											<th>姓名</th>
											<th>毕业证书号</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>
														<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">{{item.ticket_no}}</td>
											<td>{{item.cert_no}}</td>
											<td>{{item.std_name}}</td>
											<td>{{item.diaplma_no}}</td>
											<td>{{item.major_name}}</td>
											<td>{{item.school_name}}</td>
											<!-- <td>{{item.org_code}}-{{item.org_name}}</td>
											<td>
													<div *ngIf="item.std_source==1" class="text-muted">
														社会考生</div>
														<div *ngIf="item.std_source==3" class="text-muted">
																助学考生</div>
												</td> -->
												<td [innerHTML]="item.status | frameDict:'ByCertificate'"></td>
												<td>{{item.remark}}</td>
										</tr>
										
									</tbody>
								</table>
						<!-- TODO -->
						<frame-pager [url]="QUERY_URL" hideSearch="true" [autoLoad]="false" 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>
<ng-template #editFormTemplate>
	
	</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" style="text-align: center">
			
			
			<button class="btn btn-default" (click)="hideModal()">
				<i class="icon-close"> </i> 关闭
			</button>
		</div>
	</div>
	</ng-template>
