<%@ 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);
					}
				}
			});
            //只做查看时，禁用掉以下标签
            $('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);
		});
	</script>
</head>
<body class="hideScroll">
		<form:form id="inputForm" modelAttribute="oaAttendanceRule" action="${ctx}/oa/oaAttendanceRule/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right">公司：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${!disabled}">
								<sys:treeselect id="company" name="company.id" value="${oaAttendanceRule.company.id}" labelName="company.name" labelValue="${oaAttendanceRule.company.name}"
												title="部门" url="/sys/office/treeData?type=2" cssClass="form-control " allowClear="true" notAllowSelectParent="true"/>
							</c:when>
							<c:otherwise>
								${oaAttendanceRule.company.name}
							</c:otherwise>
						</c:choose>
					</td>
					<td class="width-15 active"><label class="pull-right">上班时间：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${!disabled}">
								<form:input path="startTime" htmlEscape="false"    class="form-control "/></c:when>
							<c:otherwise>
								${oaAttendanceRule.startTime}
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">下班时间：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${!disabled}">
								<form:input path="endTime" htmlEscape="false"    class="form-control "/></c:when>
							<c:otherwise>
								${oaAttendanceRule.endTime}
							</c:otherwise>
						</c:choose>
					</td>
					<td class="width-15 active"><label class="pull-right">工作日：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${!disabled}">
								<form:input path="workdays" htmlEscape="false"    class="form-control "/></c:when>
							<c:otherwise>
								${oaAttendanceRule.workdays}
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">考勤地点：</label></td>
					<td class="width-35">
						<%--<form:input path="place" htmlEscape="false"    class="form-control "/>--%>
						${rule_place}
					</td>
					<td class="width-15 active"><label class="pull-right">考勤WIFI：</label></td>
					<td class="width-35">
						<%--<form:input path="wifi" htmlEscape="false"    class="form-control "/>--%>
						${rule_wifi_name} &nbsp;&nbsp;&nbsp;${rule_wifi}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">备注信息：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${!disabled}">
								<form:input path="remarks" htmlEscape="false"    class="form-control "/></c:when>
							<c:otherwise>
								${oaAttendanceRule.remarks}
							</c:otherwise>
						</c:choose>
					</td>
					<td class="width-15 active"><label class="pull-right">名称：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${!disabled}">
								<form:input path="name" htmlEscape="false"    class="form-control "/></c:when>
							<c:otherwise>
								${oaAttendanceRule.name}
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
		 	</tbody>
		</table>
	</form:form>
</body>
</html>