<%
layout("/include/_container.html", {title:"表单", parent:"请假表单"}){
%>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.toastr_success(data.msg);
				    jp.unblock("#inputForm", 0);//立即清除loading层
				    jp.go("${ctx}/test/one/form/leaveForm2");
				}else{
				    jp.toastr_error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			})

	        $('#beginDate').datetimepicker({
				 format:'Y-m-d H:i'
		    });
	        $('#endDate').datetimepicker({
				 format:'Y-m-d H:i'
		    });
		});
		
	</script>
<div class="white-box">
		<form id="inputForm"  action="${ctx}/test/one/form/leaveForm2/save" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${leaveForm2.id!}"/>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>归属部门：</label>
					<div class="col-sm-10">
					<#treeselect id="office" name="office.id" value="${leaveForm2.office.id!}" labelName="office.name" labelValue="${leaveForm2.office.name!}"
						title="部门" url="/sys/office/treeData?type=2" class="jp-input required" allowClear="true" notAllowSelectParent="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>员工：</label>
					<div class="col-sm-10">
					<#userselect id="tuser" name="tuser.id" value="${leaveForm2.tuser.id!}" labelName="tuser.name" labelValue="${leaveForm2.tuser.name!}"
						    class="jp-input required"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">归属区域：</label>
					<div class="col-sm-10">
			<div class=" input-group" style=" width: 100%;">
				  <input name="area"  value="${leaveForm2.area!}"  class="" data-toggle="city-picker" style="height: 34px;"/>
			</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>请假开始日期：</label>
					<div class="col-sm-10">
		             <span class="jp-calendar-picker">
							<input readonly=""  id="beginDate" name="beginDate"  placeholder="请选择日期" class="jp-calendar-picker-input jp-input   required"   value="${fn.formatDate(leaveForm2.beginDate!, 'yyyy-MM-dd HH:mm:ss')}">
							<span class="jp-calendar-picker-icon"></span>
					</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>请假结束日期：</label>
					<div class="col-sm-10">
		             <span class="jp-calendar-picker">
							<input readonly=""  id="endDate" name="endDate"  placeholder="请选择日期" class="jp-calendar-picker-input jp-input   required"   value="${fn.formatDate(leaveForm2.endDate!, 'yyyy-MM-dd HH:mm:ss')}">
							<span class="jp-calendar-picker-icon"></span>
					</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注信息：</label>
					<div class="col-sm-10">
					<textarea name="remarks" rows="4"    class="jp-input ">${leaveForm2.remarks!}</textarea>
					</div>
				</div>
		<% if(mode == "add" || mode == "edit"){ %>
		<div class="form-group">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <button class="jp-btn jp-btn-primary jp-btn-lg  btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		        </div>
		</div>
		<% } %>
		</form>
</div>
<% } %>