<%
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");
				}
			});

		});
	</script>
<div class="white-box">
		<form id="inputForm"  action="${ctx}/test/activiti/testActivitiExpense/save" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${testActivitiExpense.id!}"/>
		<input type="hidden" name="act.taskId" value="${testActivitiExpense.act.taskId!}"/>
		<input type="hidden" name="act.taskName" value="${testActivitiExpense.act.taskName!}"/>
		<input type="hidden" name="act.taskDefKey" value="${testActivitiExpense.act.taskDefKey!}"/>
		<input type="hidden" name="act.procInsId" value="${testActivitiExpense.act.procInsId!}"/>
		<input type="hidden" name="act.procDefId" value="${testActivitiExpense.act.procDefId!}"/>
		<input type="hidden"id="flag"  name="act.flag" value="${testActivitiExpense.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">
					<#userselect id="user" name="user.id" value="${testActivitiExpense.user.id!}" labelName="user.name" labelValue="${testActivitiExpense.user.name!}"
						    class="jp-input 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">
					<input name="cost" value="${testActivitiExpense.cost!}"    class="jp-input required isFloatGtZero"/>
					</div>
				</div>
			<hr>
				<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="${testActivitiExpense.office.id!}" labelName="office.name" labelValue="${testActivitiExpense.office.name!}"
						title="部门" url="/sys/office/treeData?type=2" class="jp-input required" allowClear="true" notAllowSelectParent="true"/>
					</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">${testActivitiExpense.reason!}</textarea>
					</div>
				</div>
			<hr>
		<div class="form-group">
		<div class="col-lg-3"></div>
		<% if(testActivitiExpense.act.taskDefKey! != '' && !testActivitiExpense.act.finishTask! && testActivitiExpense.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(testActivitiExpense.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(testActivitiExpense.id!)){ %>
			<#flowChart procInsId="${testActivitiExpense.act.procInsId}"/>
			<#histoicFlow procInsId="${testActivitiExpense.act.procInsId}" />
		<% } %>
		</div>				
	</div>
	</div>
</div>
<% } %>