<%@ 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(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
            //初始化加载
            var processKey = "${workActivityMenu.processKey}";
            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);
                    }
                }
            });
            if(processKey){
                showlink(processKey);
            }
		});
		function showlink(obj) {
            if(obj==1){
                $("#tr1").show();$("#tr2").hide();$("#tr3").hide();$("#tr4").hide();$("#tr5").hide();
                $("#tr6").hide();$("#tr7").hide();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").hide();$("#tr3a").hide();$("#tr4a").hide();$("#tr5a").hide();
                $("#tr6a").hide();$("#tr7a").hide();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==2){
                $("#tr1").show();$("#tr2").show();$("#tr3").hide();$("#tr4").hide();$("#tr5").hide();
                $("#tr6").hide();$("#tr7").hide();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").hide();$("#tr4a").hide();$("#tr5a").hide();
                $("#tr6a").hide();$("#tr7a").hide();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==3){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").hide();$("#tr5").hide();
                $("#tr6").hide();$("#tr7").hide();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").hide();$("#tr5a").hide();
                $("#tr6a").hide();$("#tr7a").hide();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==4){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").hide();
                $("#tr6").hide();$("#tr7").hide();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").hide();
                $("#tr6a").hide();$("#tr7a").hide();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==5){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").show();
                $("#tr6").hide();$("#tr7").hide();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").show();
                $("#tr6a").hide();$("#tr7a").hide();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==6){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").show();
                $("#tr6").show();$("#tr7").hide();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").show();
                $("#tr6a").show();$("#tr7a").hide();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==7){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").show();
                $("#tr6").show();$("#tr7").show();$("#tr8").hide(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").show();
                $("#tr6a").show();$("#tr7a").show();$("#tr8a").hide(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==8){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").show();
                $("#tr6").show();$("#tr7").show();$("#tr8").show(); $("#tr9").hide();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").show();
                $("#tr6a").show();$("#tr7a").show();$("#tr8a").show(); $("#tr9a").hide();$("#tr10a").hide();
            }else if (obj==9){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").show();
                $("#tr6").show();$("#tr7").show();$("#tr8").show(); $("#tr9").show();$("#tr10").hide();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").show();
                $("#tr6a").show();$("#tr7a").show();$("#tr8a").show(); $("#tr9a").show();$("#tr10a").hide();
            }else if (obj==10){
                $("#tr1").show();$("#tr2").show();$("#tr3").show();$("#tr4").show();$("#tr5").show();
                $("#tr6").show();$("#tr7").show();$("#tr8").show(); $("#tr9").show();$("#tr10").show();
                $("#tr1a").show();$("#tr2a").show();$("#tr3a").show();$("#tr4a").show();$("#tr5a").show();
                $("#tr6a").show();$("#tr7a").show();$("#tr8a").show(); $("#tr9a").show();$("#tr10a").show();
            }else {
                parent.layer.msg('请输入1-10之间的流程个数!',{icon:2});
            }
        }
        function showUser(obj) {
            if(obj == 0){
                $("#tda1").show(); $("#tdb1").show(); $("#tdc1").show(); $("#tdd1").show(); $("#tde1").show(); $("#tdf1").show(); $("#tdg1").show(); $("#tdh1").show(); $("#tdi1").show(); $("#tdj1").show();
                $("#tda2").show(); $("#tdb2").show(); $("#tdc2").show(); $("#tdd2").show(); $("#tde2").show(); $("#tdf2").show(); $("#tdg2").show(); $("#tdh2").show(); $("#tdi2").show(); $("#tdj2").show();
                $("#tda3").hide(); $("#tdb3").hide(); $("#tdc3").hide(); $("#tdd3").hide(); $("#tde3").hide(); $("#tdf3").hide(); $("#tdg3").hide(); $("#tdh3").hide(); $("#tdi3").hide(); $("#tdj3").hide();
                $("#tda4").hide(); $("#tdb4").hide(); $("#tdc4").hide(); $("#tdd4").hide(); $("#tde4").hide(); $("#tdf4").hide(); $("#tdg4").hide(); $("#tdh4").hide(); $("#tdi4").hide(); $("#tdj4").hide();
            }else{
                $("#tda1").hide(); $("#tdb1").hide(); $("#tdc1").hide(); $("#tdd1").hide(); $("#tde1").hide(); $("#tdf1").hide(); $("#tdg1").hide(); $("#tdh1").hide(); $("#tdi1").hide(); $("#tdj1").hide();
                $("#tda2").hide(); $("#tdb2").hide(); $("#tdc2").hide(); $("#tdd2").hide(); $("#tde2").hide(); $("#tdf2").hide(); $("#tdg2").hide(); $("#tdh2").hide(); $("#tdi2").hide(); $("#tdj2").hide();
                $("#tda3").show(); $("#tdb3").show(); $("#tdc3").show(); $("#tdd3").show(); $("#tde3").show(); $("#tdf3").show(); $("#tdg3").show(); $("#tdh3").show(); $("#tdi3").show(); $("#tdj3").show();
                $("#tda4").show(); $("#tdb4").show(); $("#tdc4").show(); $("#tdd4").show(); $("#tde4").show(); $("#tdf4").show(); $("#tdg4").show(); $("#tdh4").show(); $("#tdi4").show(); $("#tdj4").show();
            }
        }

	</script>
</head>
<body class="hideScroll">
	<form:form id="inputForm" modelAttribute="workActivityMenu" action="${ctx}/workactivitymenu/workActivityMenu/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
			<tbody>
			<tr>
				<td  class="width-15 active"><label class="pull-right">选择任务模块:</label></td>
				<td class="width-35">
						${workActivityMenu.parent.name}
				</td>
				<td class="width-15 active"><label class="pull-right">所属公司/部门：</label></td>
				<td class="width-25">
						${workActivityMenu.officeName}
				</td>
			</tr>
			<tr>
				<td  class="width-15 active"><label class="pull-right">模块名称:</label></td>
				<td  class="width-35" >
						${workActivityMenu.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">功能名称</label></td>
				<td  class="width-35" >
						${workActivityMenu.functionalName}
				</td>
			</tr>
			<tr>
				<td  class="width-15 active"><label class="pull-right">自定义流程个数</label></td>
				<td  class="width-35" >
						${workActivityMenu.processKey}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否使用模板</label></td>
				<td  class="width-35" >
					<c:choose>
						<c:when test="${workActivityMenu.isExt ne 0}">
							否
						</c:when>
						<c:otherwise>
							是
						</c:otherwise>
					</c:choose>
				</td>
				<%--<td  class="width-15 active"><label class="pull-right"><font color="red">*</font>排序</label></td>
				<td  class="width-35" ><form:input path="sort" htmlEscape="false" maxlength="50" class="form-control required"/></td>
			--%>
			</tr>
			<tr id="tr1" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务一:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[0].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[0].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr1a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[0].role.name}
				</td>
				<td  class="width-15 active" ><label class="pull-right">执行人:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[0].user.name}
				</td>
			</tr>
			<tr id="tr2" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务二:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[1].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[1].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr2a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[1].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[1].user.name}
				</td>
			</tr>
			<tr id="tr3" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务三:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[2].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[2].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr3a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[2].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[2].user.name}
				</td>
			</tr>
			<tr id="tr4" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务四:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[3].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[3].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr4a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[3].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[3].user.name}
				</td>
			</tr>
			<tr id="tr5" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务五:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[4].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[4].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr5a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[4].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[4].user.name}
				</td>
			</tr>
			<tr id="tr6" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务六:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[5].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[5].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr6a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[5].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[5].user.name}
				</td>
			</tr>
			<tr id="tr7" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务七:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[6].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[6].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr7a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[6].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[6].user.name}
				</td>
			</tr>
			<tr id="tr8" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务八:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[7].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[7].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr8a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[7].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[7].user.name}
				</td>
			</tr>
			<tr id="tr9" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务九:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[8].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[8].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr9a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[8].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[8].user.name}
				</td>
			</tr>
			<tr id="tr10" hidden="hidden">
				<td  class="width-15 active"><label class="pull-right">任务十:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[9].name}
				</td>
				<td  class="width-15 active"><label class="pull-right">是否允许撤回:</label></td>
				<td  class="width-35" >
						${fns:getDictLabel(workActivityMenu.activities[9].returnBack, 'activity_return_back', '')}
				</td>
			</tr>
			<tr id="tr10a" hidden="hidden">
				<td  class="width-15 active" ><label class="pull-right">执行角色:</label></td>
				<td  class="width-35" >
						${workActivityMenu.activities[9].role.name}
				</td>
				<td  class="width-15 active"><label class="pull-right">执行人:</label></td>
				<td  class="width-35">
						${workActivityMenu.activities[9].user.name}
				</td>
			</tr>
			<tr >
				<td  class="width-15 active"><label class="pull-right">备注:</label></td>
				<td class="width-35" colspan="3">
						${workActivityMenu.remarks}
				</td>
			</tr>
			</tbody>
		</table>
	</form:form>
</body>
</html>