<%@ 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;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				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>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="workAttendanceInfo" action="${ctx}/workattendance/workAttendanceInfo/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<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="userTable2" class="table table-bordered table-condensed details">
						<thead>
						<tr>
							<th>日期</th>
							<th>上午/下午</th>
							<th>考勤类型</th>
							<th>假期名称</th>
							<th width="120px">是否计算出勤</th>
							<th>是否计算补助</th>
							<th>考勤方式</th>
							<th>是否迟到/早退</th>
							<th>迟到早退时长</th>
							<th>外勤出差是否有效</th>
						</tr>
						</thead>
						<tbody id="workAttendanceInfos">
						<c:if test="${not empty workAttendanceInfos}">
							<c:forEach items="${workAttendanceInfos}" var="workAttendanceInfo" varStatus="index">
								<tr id="workAttendanceInfos${index.index}">
									<td>
										<c:choose>
											<c:when test="${not empty home}">
												<a  href="javascript:void(0)" onclick="openDialogView('考勤详情-${fns:getDictLabel(workAttendanceInfo.morningAfternoon, 'am_pm', '')}', '${ctx}/workattendance/workAttendanceInfo/form?id=${workAttendanceInfo.id}&home=${home}','80%', '80%')">
													<fmt:formatDate value="${workAttendanceInfo.attendanceDate}" pattern="yyyy-MM-dd"/>
												</a>
											</c:when>
											<c:otherwise>
												<a  href="javascript:void(0)" onclick="openDialogView('考勤详情-${fns:getDictLabel(workAttendanceInfo.morningAfternoon, 'am_pm', '')}', '${ctx}/workattendance/workAttendanceInfo/form?id=${workAttendanceInfo.id}&home=${home}','80%', '80%')">
													<fmt:formatDate value="${workAttendanceInfo.attendanceDate}" pattern="yyyy-MM-dd"/>
												</a>
											</c:otherwise>
										</c:choose>

									</td>
									<td>
											${fns:getDictLabel(workAttendanceInfo.morningAfternoon, 'am_pm', '')}
									</td>
			
									<td>
											${fns:getDictLabel(workAttendanceInfo.attendanceType, 'attendance_info_type', '')}
									</td>
									<td>
											${workAttendanceInfo.leaveTypeName}
									</td>
									<td>
											${fns:getDictLabel(workAttendanceInfo.isCalculateAttendance, 'yes_no', '')}
									</td>
									<td>
											${fns:getDictLabel(workAttendanceInfo.isCalculateSubsidies, 'yes_no', '')}
									</td>
									<td>
											${fns:getDictLabel(workAttendanceInfo.type, 'attendance_type', '')}
									</td>
									<td>
											${fns:getDictLabel(workAttendanceInfo.lateEarly, 'lateEarly', '')}
									</td>
									<td>
											${workAttendanceInfo.lateEarlyTime}
									</td>
									<td>
											${fns:getDictLabel(workAttendanceInfo.isValid, 'yes_no', '')}
									</td>

								</tr>
							</c:forEach>
						</c:if>
						</tbody>
					</table>
				</div>
			</div>
		</form:form>
	</div>
</div>
</body>
</html>