<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>请假管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        var validateForm;
        var count = 0;
        $(document).ready(function() {
            validateForm = $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                rules:{
                },
                messages:{
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });

	</script>
	<style>
		/*超过5个汉字，调整label的长度，以下是配套的*/
		.layui-item .layui-form-label{
			width:90px;
		}
		.form-group .layui-item .layui-input-block,
		.query .layui-input-block {
			margin-left: 116px;
		}
	</style>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="leaveApply" action="${ctx}/leaveapply/leaveApply/backSave" method="post" class="form-horizontal" >
			<div class="form-group layui-row first">
				<div class="form-group-label"><h2>基础信息</h2></div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>姓名：</label>
					<div class="layui-input-block">
						<form:input id="name" path="basicInfo.name" htmlEscape="false" readonly="true"  class="form-control layui-input" />
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>工号：</label>
					<div class="layui-input-block">
						<form:input readonly="true" path="basicInfo.no" htmlEscape="false" class="form-control layui-input"/>
					</div>
				</div>

				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>部门：</label>
					<div class="layui-input-block">
						<form:input readonly="true" path="basicInfo.office.topCompany" htmlEscape="false" class="form-control layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>职级：</label>
					<div class="layui-input-block">
						<form:input  readonly="true" path="basicInfo.jobGrade.name" htmlEscape="false" class="form-control layui-input"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>累计天数：</label>
					<div class="layui-input-block">
						<form:input  readonly="true" path="sumDays" htmlEscape="false" class="form-control layui-input"/>
					</div>
				</div>
			<%--	<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>重置状态：</label>
					<div class="layui-input-block">
						<form:input  path="basicInfo.status" htmlEscape="false" readonly="true"  class="form-control layui-input" value="未重置"/>
					</div>
				</div>--%>
			</div>
			<div class="form-group layui-row">
				<div class="form-group-label"><h2>请假详情</h2></div>
				<div class="layui-item layui-col-xs12 form-table-container" >
					<table id="hisContentTable" class="table table-bordered table-condensed can-edit no-bottom-margin">
						<thead>
						<tr>
							<th width="200px">假期名称</th>
							<th width="200px">累计天数</th>
							<th width="200px">累计次数</th>
							<th width="200px">上限天数</th>
						</tr>
						</thead>
						<tbody id="hisLeaveDetailList">
						<c:if test="${not empty leaveApply.hisLeaveDetailList}">
							<c:forEach items="${leaveApply.hisLeaveDetailList}" var="leaveDetail" varStatus="index">
								<tr id="hisLeaveDetailList${index.index}">
									<td>
										<input id="hisLeaveDetailList${index.index}_1"  readonly="true"   type="text" value="${leaveDetail.name}"   class="form-control "/>
									</td>
									<td>
										<input id="hisLeaveDetailList${index.index}_2"  readonly="true"   type="text" value="${leaveDetail.sumDays}"   class="form-control "/>
									</td>
									<td>
									    <input id="hisLeaveDetailList${index.index}_3"   readonly="true" type="text" value="${leaveDetail.counts}"   class="form-control require"/>
								    </td>
									<td>
										<input id="hisLeaveDetailList${index.index}_4"   readonly="true" type="text" value="${leaveDetail.days}"   class="form-control require"/>
									</td>
								</tr>
							</c:forEach>
						</c:if>
						</tbody>
					</table>
				</div>
			</div>
			<div class="form-group layui-row page-end"></div>
		</form:form>
	</div>
</div>

</body>
</html>