<%@ 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(obj){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
              if(obj == 1){
                  $('#flag').val('yes');
              }else{
                  $('#flag').val('no');
              }
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
			$("#name").focus();
			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")%>);
            if (${requestScope.disabled eq 'false'}) {
                $("#leaveType").attr('disabled',true);
                $("#startTime").attr('disabled',true);
                $("#endTime").attr('disabled',true);
                $("#reason").attr('disabled',true);
			}
		});
	</script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
	<div class="ibox">
	<div class="ibox-title">
		<h5>审批详情</h5>
		<div class="ibox-tools">
			<a class="collapse-link">
				<i class="fa fa-chevron-up"></i>
			</a>
			<a class="dropdown-toggle" data-toggle="dropdown" href="javascript:void(0)">
				<i class="fa fa-wrench"></i>
			</a>
			<ul class="dropdown-menu dropdown-user">
				<li><a href="javascript:void(0)">选项1</a>
				</li>
				<li><a href="javascript:void(0)">选项2</a>
				</li>
			</ul>
			<a class="close-link">
				<i class="fa fa-times"></i>
			</a>
		</div>
	</div>
	<div class="ibox-content">
	<form:form id="inputForm" modelAttribute="oaPerformance" action="${ctx}/oaperformance/oaPerformance/saveAudit" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="home"/>
		<form:hidden path="act.taskId"/>
		<form:hidden path="act.taskName"/>
		<form:hidden path="act.taskDefKey"/>
		<form:hidden path="act.procInsId"/>
		<form:hidden path="act.procDefId"/>
		<form:hidden id="flag" path="act.flag"/>
		<sys:message content="${message}"/>
		<c:set var="status" value="${oaPerformance.act.status}" />

		<div class="control-group">
			<label class="control-label"><font color="red">*</font>上月工作任务：</label>
			<div class="controls">
					${oaPerformance.lastWork}
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><font color="red">*</font>实际完成任务：</label>
			<div class="controls">
					${oaPerformance.finishWork}
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><font color="red">*</font>任务达成率：</label>
			<div class="controls">
					${oaPerformance.finishRate}
				<span class="help-inline"></span>
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">上月工作自评：</label>
			<div class="controls" style="margin-top: 7px;">
				${oaPerformance.lastPerformance}
				<span class="help-inline"></span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label"><font color="red">*</font>本月工作任务：</label>
			<div class="controls">
					${oaPerformance.nowWork}
				<span class="help-inline"></span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">本月工作计划：</label>
			<div class="controls" style="margin-top: 7px;">
					${oaPerformance.nowPlan}
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group" id="comment">
			<label class="control-label">审批意见：</label>
			<div class="controls">
				<form:textarea path="act.comment" class="form-control" rows="5" maxlength="127"/>
			</div>
		</div>
		<%--<div class="form-actions">
				<c:if test="${oaPerformance.act.taskDefKey eq 'audit1'}">
					<input id="btnSubmit" class="btn btn-primary" type="submit" value="同 意" onclick="$('#flag').val('yes')"/>&nbsp;
					<input id="btnSubmit" class="btn btn-inverse" type="submit" value="驳 回" onclick="$('#flag').val('no')"/>&nbsp;
				</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>--%>
		<act:flowChart procInsId="${oaPerformance.act.procInsId}"/>
		<act:histoicFlow procInsId="${oaPerformance.act.procInsId}"/>
	</form:form>
</div>
	</div>
	</div>
</body>
</html>

