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


            $("#agree").click(function () {
                jp.prompt("同意, 审批意见", function (message) {
                    jp.post("${ctx}/act/task/audit",
                        {
                            "taskId":"${testActivitiAudit.act.taskId}",
                            "taskName":"${testActivitiAudit.act.taskName}",
                            "taskDefKey":"${testActivitiAudit.act.taskDefKey}",
                            "procInsId":"${testActivitiAudit.act.procInsId}",
                            "procDefId":"${testActivitiAudit.act.procDefId}",
                            "flag":"yes",
                            "comment":message

                        },
                        function (data) {
								if(data.success){
									jp.success(data.msg);
									jp.go("${ctx}/act/task/todo")
								}
                        })
                })
            })


            $("#reject").click(function () {
                jp.prompt("驳回, 审批意见", function (message) {
                    jp.post("${ctx}/act/task/audit",
                        {
                            "taskId":"${testActivitiAudit.act.taskId}",
                            "taskName":"${testActivitiAudit.act.taskName}",
                            "taskDefKey":"${testActivitiAudit.act.taskDefKey}",
                            "procInsId":"${testActivitiAudit.act.procInsId}",
                            "procDefId":"${testActivitiAudit.act.procDefId}",
                            "flag":"no",
                            "comment":message

                        },
                        function (data) {

                            if(data.success){
								jp.success(data.msg);
								jp.go("${ctx}/act/task/todo")
                            }


                        })
                })
            })


	        $('#exeDate').datetimepicker({
				 format:'Y-m-d H:i'
		    });
		});
	</script>
<div class="white-box">
	
		<div class="form-group text-center">
			<h3>${testActivitiAudit.act.taskName}</h3>
		</div>
		<form id="inputForm" action="${ctx}/test/activiti/testActivitiAudit/save" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${testActivitiAudit.id!}"/>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>变动用户：</label>
					<div class="col-sm-10">
					${testActivitiAudit.user.name!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>归属部门：</label>
					<div class="col-sm-10">
					${testActivitiAudit.office.name!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">岗位：</label>
					<div class="col-sm-10">
					${testActivitiAudit.post!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">性别：</label>
					<div class="col-sm-10">
			 		${fn.getDictLabel(testActivitiAudit.sex!, 'sex', '')}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">学历：</label>
					<div class="col-sm-10">
					${testActivitiAudit.edu!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>调整原因：</label>
					<div class="col-sm-10">
					${testActivitiAudit.content!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">现行标准 薪酬档级：</label>
					<div class="col-sm-10">
					${testActivitiAudit.olda!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>现行标准 月工资额：</label>
					<div class="col-sm-10">
					${testActivitiAudit.oldb!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">现行标准 年薪总额：</label>
					<div class="col-sm-10">
					${testActivitiAudit.oldc!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">调整后标准 薪酬档级：</label>
					<div class="col-sm-10">
					${testActivitiAudit.newa!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>调整后标准 月工资额：</label>
					<div class="col-sm-10">
					${testActivitiAudit.newb!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">调整后标准 年薪总额：</label>
					<div class="col-sm-10">
					${testActivitiAudit.newc!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>月增资：</label>
					<div class="col-sm-10">
					${testActivitiAudit.addNum!}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>执行时间：</label>
					<div class="col-sm-10">
					${fn.formatDate(testActivitiAudit.exeDate!, 'yyyy-MM-dd HH:mm:ss')}
					</div>
				</div>
			<hr>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注信息：</label>
					<div class="col-sm-10">
					${testActivitiAudit.remarks!}
					</div>
				</div>
			<hr>
		</form>

		
			<% if(testActivitiAudit.act.taskDefKey! != '' && !testActivitiAudit.act.finishTask! && testActivitiAudit.act.isNextGatewaty!){ %>
			<div class="row">
				<div class="col-sm-3"></div>
				<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="同 意" />&nbsp;
						<input id="reject" class="btn  btn-danger btn-lg btn-parsley" type="submit" value="驳 回" />&nbsp;
					</div>
				</div>
			</div>
			<% } %>
			<% if(testActivitiAudit.act.taskDefKey! != '' && !testActivitiAudit.act.finishTask! && !testActivitiAudit.act.isNextGatewaty!){ %>
			<div class="row">
				<div class="col-sm-3"></div>
				<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="办 理" />&nbsp;
					</div>
				</div>
			</div>
			<% } %>

			<%if(isNotEmpty(testActivitiAudit.id!)){ %>
				<#flowChart procInsId="${testActivitiAudit.act.procInsId!}"/>
				<#histoicFlow procInsId="${testActivitiAudit.act.procInsId!}" />
			<% } %>

		</div>				
	</div>
	</div>
</div>
<% } %>