<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<%@ include file="../common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/top.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/static/subjecthead/style/subjectheader-content.css">
</head>
<body class="easyui-layout">
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../common/menu.jsp"%>
	<div
		data-options="region:'center',title:'首页 -<a href=>【仲裁卷处理】</a>- 列表'">
		<div class="easyui-layout" data-options="fit:true,border:false">
			<div data-options="region:'north',border:false" class="domain">
			<form class="form-horizontal">
				<div id="tb" style="padding:5px;height:auto">  
				    <div>
		            	题目:   
				       <select id="blockId" name="blockId" style="width:100px;" class="easyui-combobox">
		     		        <option value="" >请选择...</option>
		     		        <c:forEach items="${bList }" var="block">
		     		        	<option value="${block.id}" >${block.title }</option>
		     		        </c:forEach>
		            	</select>  
		            	密号: <input id="paperNumber" name="paperNumber" class="easyui-numberbox" style="width:80px">
				        发生时间: <input id="startTime" name="startTime" class="easyui-datetimebox" style="width:80px">-<input id="endTime" name="endTime" class="easyui-datetimebox" style="width:80px">  
				        
				        <button type="submit" class="btn" id="searchButton"><i class="icon-search"></i> 搜索</button> 
				    </div>  
			    </div> 
			</form>
			</div>
			<div data-options="region:'center'"
				style="border-color: #ccc; border-left: none;">
				<table class="easyui-datagrid" id="dg"
					data-options="pagination:'true',url:'${ctx}/subjectheader/arbitration/list.json',rownumbers:true,singleSelect:true,fit:true,border:false,fitColumns:true,striped:true">
					<thead>
						<tr>
							<th width="25%"  data-options="field:'secretNo'"><strong>密号</strong></th>
							<th width="25%"  data-options="field:'blockId',title:'subjectiveBlock',formatter:block"><strong>题目</strong></th>
							<th width="25%"  data-options="field:'occurTime',formatter:occurTime"><strong>发生时间</strong></th>
							<th width="25%"  data-options="field:'operate',formatter:operate"><strong>操作</strong></th>
						</tr>
					</thead>
				</table>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	function operate(value, row, index) {
		if(row.status=="WAITING"){
			return '<button class="btn btn-success" onclick="view('
			+ row.id
			+ ')">仲裁</button>';
		}else{
			return "";
		} 
	}
	
	function block(value, row, index) {
		return row.subjectiveBlock.title;
	}
	
	
	
	function occurTime(value, row, index) {
		var date = new Date(value);
        return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
	}
	
	function view(id){
		window.location.href="${ctx}/subjectheader/arbitration/view/"+id;
	}
	
	
	$('.form-horizontal').submit(function(event) {
		event.preventDefault();
		var query = $('.form-horizontal').serializeJson();
		$('#dg').datagrid('load', query);
	});
	
</script>
</html>
