<div ng-controller="InstorageScanCtrl">
	<div class="panel panel-default">
		<div class="panel-body">
			<form class="form-horizontal" name="form" novalidate ng-submit="submit()">
				<div class="form-group">
					<label for="" class="col-lg-4 control-label">试卷编码<span class="req">*</span></label>
					<div class="col-lg-3">
						<input type="text" class="form-control" ng-model="model.code" placeholder="试卷编码" ng-required="true" focus-me='true'>
					</div>
					<button type="submit" ng-disabled='form.$invalid' class="btn btn-primary">确认入库</button>
				</div>
			</form>
			
			<div class="row">
				
				<div class="col-lg-8">
					<p class="help-block">扫描结果列表：</p>
					<table class="table table-striped" style="table-layout: fixed;">
						<thead>
							<tr>
								<th width="5%">#</th>
								<th>试卷编号</th>
								<th>扫描结果</th>
								<th>错误消息</th>
							</tr>
							<tr>
								<th></th>
								<th><input type="text" placeholder="试卷代码" class="input-sm form-control" ng-model="search.code" /></th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="row in scanHistories | filter:search" class="{{!row.result && 'text-danger'}}">
								<td>{{$index+1}}</td>
								<td>{{row.code}}</td>
								<td>{{row.result | successOrFailed}}</td>
								<td>{{row.msg}}</td>
							</tr>
						</tbody>
					</table>
				</div>
				
				<div class="col-lg-4">
					<p class="help-block">最近扫描的试卷信息：</p>
					<table class="table table-striped" style="table-layout: fixed;">
						<thead>
							<tr>
								<th width="30%">试卷编号</th>
								<th>{{paper.code}}</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<th>课程代码</th>
								<td>{{paper.courseCode}}</td>
							</tr>
							<tr>
								<th>课程名称</th>
								<td>{{paper.courseName}}</td>
							</tr>
							<tr>
								<th>教材名称</th>
								<td>{{paper.bookName}}</td>
							</tr>
							<tr>
								<th>编者</th>
								<td>{{paper.bookAuthor}}</td>
							</tr>
							<tr>
								<th>出版社</th>
								<td>{{paper.bookPress}}</td>
							</tr>
							<tr>
								<th>版次</th>
								<td>{{paper.bookPressYear}}</td>
							</tr>
							<!-- 
							<tr>
								<th>试卷文档</th>
								<td class="{{paper.paperPath != null && paper.paperPath != ''  ? 'text-success' : 'text-danger'}} font-bold">{{paper.paperPath != null && paper.paperPath != ''  ? '&radic;' : 'X'}} </td>
							</tr>
							 -->
							<tr>
								<th>网评卷文档</th>
								<td class="{{paper.wPaperPath != null && paper.wPaperPath != '' ? 'text-success' : 'text-danger'}} font-bold">{{paper.wPaperPath != null && paper.wPaperPath != '' ? '&radic;' : 'X'}}</td>
							</tr>
							<tr>
								<th>标答文档</th>
								<td class="{{paper.standardAnswerPath != null && paper.standardAnswerPath != '' ? 'text-success' : 'text-danger'}} font-bold">{{paper.standardAnswerPath != null && paper.standardAnswerPath != '' ? '&radic;' : 'X'}}</td>
							</tr>
							<tr>
								<th>分卷文档</th>
								<td class="{{paper.separatePaperPath != null && paper.separatePaperPath != '' ? 'text-success' : 'text-warning'}} font-bold">{{paper.separatePaperPath != null && paper.separatePaperPath != '' ? '&radic;' : '-'}}</td>
							</tr>
							<tr>
								<th>专卡文档</th>
								<td class="{{paper.answerSheetPath != null && paper.answerSheetPath != '' ? 'text-success' : 'text-warning'}} font-bold">{{paper.answerSheetPath != null && paper.answerSheetPath != '' ? '&radic;' : '-'}}</td>
							</tr>
							<tr>
								<th>转印说明</th>
								<td class="{{paper.zyPath != null && paper.zyPath != '' ? 'text-success' : 'text-warning'}} font-bold">{{paper.zyPath != null && paper.zyPath != '' ? '&radic;' : '-'}}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>