|  | @@ -0,0 +1,291 @@
 | 
	
		
			
				|  |  | +<%@ page contentType="text/html;charset=UTF-8" %>
 | 
	
		
			
				|  |  | +<%@ include file="/webpage/include/taglib.jsp"%>
 | 
	
		
			
				|  |  | +<html>
 | 
	
		
			
				|  |  | +<head>
 | 
	
		
			
				|  |  | +	<title>工作内容类型管理</title>
 | 
	
		
			
				|  |  | +	<meta name="decorator" content="default"/>
 | 
	
		
			
				|  |  | +	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
 | 
	
		
			
				|  |  | +	<%@include file="/webpage/include/treetable.jsp" %>
 | 
	
		
			
				|  |  | +	<script type="text/javascript">
 | 
	
		
			
				|  |  | +		$(document).ready(function() {
 | 
	
		
			
				|  |  | +			$("#treeTable").treeTable({expandLevel : 5},{ expandable: true });
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +	</script>
 | 
	
		
			
				|  |  | +	<style>
 | 
	
		
			
				|  |  | +		body{
 | 
	
		
			
				|  |  | +			background-color:transparent;
 | 
	
		
			
				|  |  | +			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
 | 
	
		
			
				|  |  | +			color:#ffffff;
 | 
	
		
			
				|  |  | +			background-color:rgba(255,255,255,0);
 | 
	
		
			
				|  |  | +			height:100%;
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	</style>
 | 
	
		
			
				|  |  | +</head>
 | 
	
		
			
				|  |  | +<body>
 | 
	
		
			
				|  |  | +<div class="wrapper wrapper-content">
 | 
	
		
			
				|  |  | +	<sys:message content="${message}"/>
 | 
	
		
			
				|  |  | +	<div class="layui-row">
 | 
	
		
			
				|  |  | +		<div class="full-width fl">
 | 
	
		
			
				|  |  | +			<div class="contentShadow layui-row" id="queryDiv">
 | 
	
		
			
				|  |  | +				<form:form id="searchForm" modelAttribute="projectTemplateType" action="${ctx}/project/projectResultsFileTemplate/" method="post" class="form-inline">
 | 
	
		
			
				|  |  | +					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 | 
	
		
			
				|  |  | +					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 | 
	
		
			
				|  |  | +					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +					<div class="commonQuery lw9">
 | 
	
		
			
				|  |  | +						<div class="layui-item query athird">
 | 
	
		
			
				|  |  | +							<label class="layui-form-label">项目类型名称:</label>
 | 
	
		
			
				|  |  | +							<div class="layui-input-block">
 | 
	
		
			
				|  |  | +								<form:input path="typeName" htmlEscape="false" class=" form-control layui-input"></form:input>
 | 
	
		
			
				|  |  | +							</div>
 | 
	
		
			
				|  |  | +						</div>
 | 
	
		
			
				|  |  | +						<div class="layui-item athird">
 | 
	
		
			
				|  |  | +							<div class="input-group">
 | 
	
		
			
				|  |  | +								<button id="searchReset" style="margin-right: 0px;" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
 | 
	
		
			
				|  |  | +								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
 | 
	
		
			
				|  |  | +							</div>
 | 
	
		
			
				|  |  | +						</div>
 | 
	
		
			
				|  |  | +						<div style="    clear:both;"></div>
 | 
	
		
			
				|  |  | +					</div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				</form:form>
 | 
	
		
			
				|  |  | +			</div>
 | 
	
		
			
				|  |  | +		</div>
 | 
	
		
			
				|  |  | +		<div class="full-width fl">
 | 
	
		
			
				|  |  | +			<div class="contentShadow layui-form contentDetails">
 | 
	
		
			
				|  |  | +				<div class="nav-btns">
 | 
	
		
			
				|  |  | +					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i> 刷新</button>
 | 
	
		
			
				|  |  | +					<div style="clear: both;"></div>
 | 
	
		
			
				|  |  | +				</div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +					<table id="achievementTable" class="layui-table" lay-filter="achievementTable"></table>
 | 
	
		
			
				|  |  | +				<!-- 分页代码 -->
 | 
	
		
			
				|  |  | +			</div>
 | 
	
		
			
				|  |  | +		</div>
 | 
	
		
			
				|  |  | +	</div>
 | 
	
		
			
				|  |  | +</div>
 | 
	
		
			
				|  |  | +<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
 | 
	
		
			
				|  |  | +<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +	/*使用模块加载的方式 加载文件*/
 | 
	
		
			
				|  |  | +	layui.config({
 | 
	
		
			
				|  |  | +		base: '${ctx}/resoueces/css/layui/module/'
 | 
	
		
			
				|  |  | +	}).extend({
 | 
	
		
			
				|  |  | +		treetable: 'treetable-lay/treetable'
 | 
	
		
			
				|  |  | +	}).use(['layer', 'table', 'treetable'], function () {
 | 
	
		
			
				|  |  | +		var $ = layui.jquery;
 | 
	
		
			
				|  |  | +		var table = layui.table;
 | 
	
		
			
				|  |  | +		var layer = layui.layer;
 | 
	
		
			
				|  |  | +		var treetable = layui.treetable;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		// 渲染表格
 | 
	
		
			
				|  |  | +		var renderTable = function () {
 | 
	
		
			
				|  |  | +			layer.load(2);
 | 
	
		
			
				|  |  | +			treetable.render({
 | 
	
		
			
				|  |  | +				treeColIndex: 1,//树形图标显示在第几列
 | 
	
		
			
				|  |  | +				treeSpid: 0,//最上级的父级id
 | 
	
		
			
				|  |  | +				treeIdName: 'permissionId',//id字段的名称
 | 
	
		
			
				|  |  | +				treePidName: 'pid',//pid字段的名称
 | 
	
		
			
				|  |  | +				treeDefaultClose: false,//是否默认折叠
 | 
	
		
			
				|  |  | +				treeLinkage: true,//父级展开时是否自动展开所有子级
 | 
	
		
			
				|  |  | +				elem: '#achievementTable',
 | 
	
		
			
				|  |  | +				url: '${ctx}/project/projectResultsFileTemplate/getProjectTypeTreeList?typeName=',
 | 
	
		
			
				|  |  | +				page: false,
 | 
	
		
			
				|  |  | +				cols: [[
 | 
	
		
			
				|  |  | +					{type: 'numbers', title: '序号' ,width:80},
 | 
	
		
			
				|  |  | +					{field: 'name', title: '类型',templet:function(d){
 | 
	
		
			
				|  |  | +							if(null != d.name){
 | 
	
		
			
				|  |  | +								return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看项目类型信息', '${ctx}/project/projectResultsFileTemplate/form?view=view&id="+d.id+"','95%', '95%')\">" + d.name + "</a>";
 | 
	
		
			
				|  |  | +							}else{
 | 
	
		
			
				|  |  | +								return "";
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						}},
 | 
	
		
			
				|  |  | +					{field: 'name', title: '项目类型名称',templet:function(d){
 | 
	
		
			
				|  |  | +							if(null != d.name){
 | 
	
		
			
				|  |  | +								return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看项目类型信息', '${ctx}/project/projectResultsFileTemplate/form?view=view&id="+d.id+"','95%', '95%')\">" + d.name + "</a>";
 | 
	
		
			
				|  |  | +							}else{
 | 
	
		
			
				|  |  | +								return "";
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						}},
 | 
	
		
			
				|  |  | +					{field: 'createDate', title: '创建时间',width:80},
 | 
	
		
			
				|  |  | +					{templet: complain, title: '操作',width:160}
 | 
	
		
			
				|  |  | +				]],
 | 
	
		
			
				|  |  | +				done: function () {
 | 
	
		
			
				|  |  | +					layer.closeAll('loading');
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  | +		};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		renderTable();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		//触发三个button按钮
 | 
	
		
			
				|  |  | +		$('#btn-expand').click(function () {
 | 
	
		
			
				|  |  | +			treetable.expandAll('#permissionTable');
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		$('#btn-fold').click(function () {
 | 
	
		
			
				|  |  | +			treetable.foldAll('#permissionTable');
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		$('#btn-refresh').click(function () {
 | 
	
		
			
				|  |  | +			renderTable();
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		function complain(d){//操作中显示的内容
 | 
	
		
			
				|  |  | +			if(d.tier == 3){
 | 
	
		
			
				|  |  | +				return [
 | 
	
		
			
				|  |  | +					"<a href=\"javascript:void(0)\" onclick=\"openProjectType('新增模板文件信息','${ctx}/project/projectResultsFileTemplate/form?view=saveSubordinateInfo&id="+d.id+"','80%', '95%');\" class=\"op-btn nav-btn-add layui-bg-green\"><i class=\"fa fa-plus layui-bg-green\"></i> 新增模板文件</a>",
 | 
	
		
			
				|  |  | +				].join('');
 | 
	
		
			
				|  |  | +			}else if(d.tier == 4){
 | 
	
		
			
				|  |  | +				return [
 | 
	
		
			
				|  |  | +					"<a href=\"javascript:void(0)\" onclick=\"openProjectType('修改模板文件信息','${ctx}/project/projectResultsFileTemplate/form?view=updateSubordinateInfo&id="+d.id+"','95%', '95%');\" class=\"btn btn-success btn-xs\"><i class=\"fa fa-edit\"></i> 修改</a>",
 | 
	
		
			
				|  |  | +					'<a href="${ctx}/project/projectResultsFileTemplate/delete?id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该模板文件信息吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
 | 
	
		
			
				|  |  | +				].join('');
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			else{
 | 
	
		
			
				|  |  | +				return [
 | 
	
		
			
				|  |  | +					''
 | 
	
		
			
				|  |  | +				].join('');
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		//监听工具条
 | 
	
		
			
				|  |  | +		table.on('tool(permissionTable)', function (obj) {
 | 
	
		
			
				|  |  | +			var data = obj.data;
 | 
	
		
			
				|  |  | +			var layEvent = obj.event;
 | 
	
		
			
				|  |  | +			if(data.permissionName!=null){
 | 
	
		
			
				|  |  | +				if (layEvent === 'del') {
 | 
	
		
			
				|  |  | +					layer.msg('删除' + data.id);
 | 
	
		
			
				|  |  | +				} else if (layEvent === 'edit') {
 | 
	
		
			
				|  |  | +					layer.msg('修改' + data.id);
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +	});
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +	function openProjectTypeView(title,url,width,height,target){
 | 
	
		
			
				|  |  | +		var company=$("#company").val();
 | 
	
		
			
				|  |  | +		url=url+"&company="+company;
 | 
	
		
			
				|  |  | +		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
 | 
	
		
			
				|  |  | +			width='auto';
 | 
	
		
			
				|  |  | +			height='auto';
 | 
	
		
			
				|  |  | +		}else{//如果是PC端,根据用户设置的width和height显示。
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		top.layer.open({
 | 
	
		
			
				|  |  | +			type: 2,
 | 
	
		
			
				|  |  | +			area: [width, height],
 | 
	
		
			
				|  |  | +			title: title,
 | 
	
		
			
				|  |  | +			maxmin: true, //开启最大化最小化按钮
 | 
	
		
			
				|  |  | +			content: url ,
 | 
	
		
			
				|  |  | +			skin:"two-btns",
 | 
	
		
			
				|  |  | +			btn: ['关闭'],
 | 
	
		
			
				|  |  | +			yes: function(index, layero){
 | 
	
		
			
				|  |  | +				var body = top.layer.getChildFrame('body', index);
 | 
	
		
			
				|  |  | +				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
 | 
	
		
			
				|  |  | +				var inputForm = body.find('#inputForm');
 | 
	
		
			
				|  |  | +				var top_iframe;
 | 
	
		
			
				|  |  | +				if(target){
 | 
	
		
			
				|  |  | +					top_iframe = target;//如果指定了iframe,则在改frame中跳转
 | 
	
		
			
				|  |  | +				}else{
 | 
	
		
			
				|  |  | +					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
 | 
	
		
			
				|  |  | +				var $document = iframeWin.contentWindow.document;
 | 
	
		
			
				|  |  | +				top.layer.close(index);
 | 
	
		
			
				|  |  | +				//formSubmit($document,"inputForm",index);
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			cancel: function(index){
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	function openProjectType(title,url,width,height,target){
 | 
	
		
			
				|  |  | +		var company=$("#company").val();
 | 
	
		
			
				|  |  | +		url=url+"&company="+company;
 | 
	
		
			
				|  |  | +		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
 | 
	
		
			
				|  |  | +			width='auto';
 | 
	
		
			
				|  |  | +			height='auto';
 | 
	
		
			
				|  |  | +		}else{//如果是PC端,根据用户设置的width和height显示。
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		top.layer.open({
 | 
	
		
			
				|  |  | +			type: 2,
 | 
	
		
			
				|  |  | +			area: [width, height],
 | 
	
		
			
				|  |  | +			title: title,
 | 
	
		
			
				|  |  | +			maxmin: true, //开启最大化最小化按钮
 | 
	
		
			
				|  |  | +			content: url ,
 | 
	
		
			
				|  |  | +			skin:"two-btns",
 | 
	
		
			
				|  |  | +			btn: ['提交','关闭'],
 | 
	
		
			
				|  |  | +			yes: function(index, layero){
 | 
	
		
			
				|  |  | +				var body = top.layer.getChildFrame('body', index);
 | 
	
		
			
				|  |  | +				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
 | 
	
		
			
				|  |  | +				var inputForm = body.find('#inputForm');
 | 
	
		
			
				|  |  | +				var top_iframe;
 | 
	
		
			
				|  |  | +				if(target){
 | 
	
		
			
				|  |  | +					top_iframe = target;//如果指定了iframe,则在改frame中跳转
 | 
	
		
			
				|  |  | +				}else{
 | 
	
		
			
				|  |  | +					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
 | 
	
		
			
				|  |  | +				var $document = iframeWin.contentWindow.document;
 | 
	
		
			
				|  |  | +				formSubmit($document,"inputForm",index);
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			cancel: function(index){
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	function formSubmit($document,inputForm,index){
 | 
	
		
			
				|  |  | +		$($document.getElementById(inputForm)).ajaxSubmit({
 | 
	
		
			
				|  |  | +			success:function(data) {
 | 
	
		
			
				|  |  | +				top.layer.close(index);
 | 
	
		
			
				|  |  | +				if(data.code == 0){
 | 
	
		
			
				|  |  | +					layer.msg(data.msg, {icon: 1,time: 1000}, function(){
 | 
	
		
			
				|  |  | +						return false;
 | 
	
		
			
				|  |  | +					});
 | 
	
		
			
				|  |  | +				}else{
 | 
	
		
			
				|  |  | +					layer.msg(data.msg, {icon: 1,time: 1000}, function(){
 | 
	
		
			
				|  |  | +						window.location.reload();
 | 
	
		
			
				|  |  | +					});
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			},error:function(){
 | 
	
		
			
				|  |  | +				layer.msg("操作失败",{icon:2});
 | 
	
		
			
				|  |  | +				window.location.reload();
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	// 确认对话框
 | 
	
		
			
				|  |  | +	function confirmxRefresh(mess, href){
 | 
	
		
			
				|  |  | +		top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
 | 
	
		
			
				|  |  | +			//do something
 | 
	
		
			
				|  |  | +			if (typeof href == 'function') {
 | 
	
		
			
				|  |  | +				href();
 | 
	
		
			
				|  |  | +			}else{
 | 
	
		
			
				|  |  | +				resetTip(); //loading();
 | 
	
		
			
				|  |  | +				$.ajax({
 | 
	
		
			
				|  |  | +					url:href,
 | 
	
		
			
				|  |  | +					data:$('#loginForm').serialize(),
 | 
	
		
			
				|  |  | +					type:"post",
 | 
	
		
			
				|  |  | +					success:function(data){
 | 
	
		
			
				|  |  | +						if(data.code == 1){
 | 
	
		
			
				|  |  | +							parent.layer.msg('删除成功',{icon:1});
 | 
	
		
			
				|  |  | +							window.location.reload();
 | 
	
		
			
				|  |  | +						}else {
 | 
	
		
			
				|  |  | +							parent.layer.msg('删除失败',{icon:2});
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			top.layer.close(index);
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +		return false;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +</body>
 | 
	
		
			
				|  |  | +</html>
 |