<%
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}"+ data.body.targetUrl);
				}else{
				    jp.toastr_error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			});

	        $('#startTime').datetimepicker({
				 format:'Y-m-d H:i'
		    });
	        $('#endTime').datetimepicker({
				 format:'Y-m-d H:i'
		    });
		});
	</script>
<div class="white-box">
		<form id="inputForm"  action="${ctx}/test/activiti/testActivitiLeave/save" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${testActivitiLeave.id!}"/>
		<input type="hidden" name="act.taskId" value="${testActivitiLeave.act.taskId!}"/>
		<input type="hidden" name="act.taskName" value="${testActivitiLeave.act.taskName!}"/>
		<input type="hidden" name="act.taskDefKey" value="${testActivitiLeave.act.taskDefKey!}"/>
		<input type="hidden" name="act.procInsId" value="${testActivitiLeave.act.procInsId!}"/>
		<input type="hidden" name="act.procDefId" value="${testActivitiLeave.act.procDefId!}"/>
		<input type="hidden"id="flag"  name="act.flag" value="${testActivitiLeave.act.flag!}"/>
		<div class="form-group text-center">
			<h3> 请假申请</h3>
		</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>请假类型：</label>
					<div class="col-sm-10">
					<#radiobuttons path="leaveType" value="${testActivitiLeave.leaveType!}" items="${fn.getDictList('oa_leave_type')}" itemLabel="label" itemValue="value" class="required"/>
					</div>
				</div>
			<hr>
				<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="startTime" name="startTime"  placeholder="请选择日期" class="jp-calendar-picker-input jp-input   required"   value="${fn.formatDate(testActivitiLeave.startTime!, 'yyyy-MM-dd HH:mm:ss')}">
							<span class="jp-calendar-picker-icon"></span>
					</span>
					</div>
				</div>
			<hr>
				<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="endTime" name="endTime"  placeholder="请选择日期" class="jp-calendar-picker-input jp-input   required"   value="${fn.formatDate(testActivitiLeave.endTime!, 'yyyy-MM-dd HH:mm:ss')}">
							<span class="jp-calendar-picker-icon"></span>
					</span>
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>报销事由：</label>
					<div class="col-sm-10">
					<textarea name="reason" rows="4"    class="jp-input required">${testActivitiLeave.reason!}</textarea>
					</div>
				</div>
			<hr>
		<div class="form-group">
		<div class="col-lg-3"></div>
		<% if(testActivitiLeave.act.taskDefKey! != '' && !testActivitiLeave.act.finishTask! && testActivitiLeave.act.isNextGatewaty!){ %>
			<div class="col-sm-6">
				<div class="form-group text-center">
					<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="重新提交" onclick="$('#flag').val('yes')"/>&nbsp;
					<input id="reject" class="btn  btn-danger btn-lg btn-parsley" type="submit" value="销毁申请" onclick="$('#flag').val('no')"/>&nbsp;
				</div>
			</div>
		<% } %>
		<% if(testActivitiLeave.act.startTask!){ %>
		<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>
			<%if(isNotEmpty(testActivitiLeave.id!)){ %>
			<#flowChart procInsId="${testActivitiLeave.act.procInsId}"/>
			<#histoicFlow procInsId="${testActivitiLeave.act.procInsId}" />
		<% } %>
		</div>				
	</div>
	</div>
</div>
<% } %>