b638803093cbfcf46dd204cb4565639e7eccdec5.svn-base 6.13 KB
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>人员信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("tbody > tr").bind("click",function(){
				$("tbody > tr").each(function(i){    
		             $(this).removeClass("trBgcolor");
		        });
				$(this).find('input:radio').prop('checked', true);
				$(this).addClass("trBgcolor");
			});
		});
		//初始化方法,改变已审核数据的颜色
		window.onload = function() { 
			//改变 已打印的 行颜色
			$("#contentTable > tbody").find("tr").each(function(){
				var ret = $(this).find('input:hidden').attr('id');
				if(ret == "2"){
					$(this).find("td").attr("style","background-color:#D2E9FF;");
				}
			});
		};
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		function winBack()
		{
			var checkedCount = $("input[type='radio']:checked").length;
			if(checkedCount == 0){
				alert("必须选择一条信息!");
				return;
			}
			//新建判断,如果还没有审核就不能被引用
			var isaudit = $("input[type='radio']:checked").val();
			if(isaudit == 0){
				alert("请先审核该条人员信息!");
				return;
			}
			var idValue = $("input[name='radio_person']:checked").attr("id");
			//获取需要返回的值 TODO 
			var checkedCount = $("input[type='radio']:checked").length;
			if(checkedCount == 0){
				alert("必须选择一条信息!");
				return;
			}
	    }
		function auditPerson(id){
			if(confirm('审核后数据将正式生效,并且不能删除和修改。确认要审核该信息吗?')){
				url = "${ctx}/reg/base/regBasePerson/auditedit?id="+id;
				window.location.href=url;
			}
		}
		function unauditPerson(id){
			if(confirm('反审核后数据恢复可删除和修改。确认要反审核该信息吗?')){
				$.ajax({
					type:"POST",
					url:"${ctx}/reg/base/regBasePerson/queryinfo",
					cache: false,
					data:"ids="+id,
				    async : false,
					success:function(modelmap){
						var msg = modelmap.msg;
						if(modelmap.success == 1){
							alert(msg);
							return;
						}
						if(modelmap.success == 0){
							url = "${ctx}/reg/base/regBasePerson/unauditedit?id="+id;
							window.location.href=url;
						}
					}
				});
			}
		}
		function deletePerson(id,isaudit){
			if(isaudit == '2'){
				alert("该人员信息已引用,不能删除!");
				return;
			}
			if(confirm('确认要删除该人员信息吗?')){
				url = "${ctx}/reg/base/regBasePerson/deleteedit?id="+id;
				window.location.href=url;
			}
		}
		function editPerson(id){
			url = "${ctx}/reg/base/regBasePerson/form?id="+id+"&fshbj=1";
			window.location.href=url;
		}
		
		function jcinfoPerson(id){
			var url = "${ctx}/reg/base/regBasePerson/jcinfoform?id="+id;
			window.location.href=url;
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="#">人员信息列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="regBasePerson" action="${ctx}/reg/base/regBasePerson/listedit" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>人员名称:</label>
				<form:input path="rymc" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>证件号:</label>
				<form:input path="zjh" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>人员编码:</label>
				<form:input path="pcode" htmlEscape="false" maxlength="10" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-bordered table-condensed">
		<thead>
			<tr>
				<th>人员编码</th>
				<th>人员名称</th>
				<th>证件种类</th>
				<th>证件号</th>
				<th>所属行业</th>
				<th>户籍所在省市</th>
				<th>电话</th>
				<th>地址</th>
				<th>更新时间</th> 
				<shiro:hasPermission name="reg:base:regBasePerson:edit"><c:if test="${empty VIEW}"><th>操作</th></c:if></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="regBasePerson">
			<tr>
				<td>
					${regBasePerson.pcode}
				</td>
				<td>
					<a class="rymc" href="${ctx}/reg/base/regBasePerson/form?id=${regBasePerson.id}&VIEWS=1">
						${regBasePerson.rymc}
					</a>
					<input type="hidden"  name="isaudit"  id="${regBasePerson.isaudit}"  value=""/>
				</td>
				<td>
					${fns:getDictLabel(regBasePerson.zjzl, 'reg_bus_zjlx', '')}
				</td>
				<td>
					${regBasePerson.zjh}
				</td>
				<td>
					${fns:getDictLabel(regBasePerson.sshy, 'reg_bus_sshy', '')}
				</td>
				<td>
					${regBasePerson.hjszss}
				</td>
				<td>
					${regBasePerson.dh}
				</td>
				<td>
					${regBasePerson.dz}
				</td>
				<td>
					<fmt:formatDate value="${regBasePerson.updateDate}" pattern="yyyy-MM-dd"/>
				</td> 
				<shiro:hasPermission name="reg:base:regBasePerson:edit">
					<td>
						<c:if test="${regBasePerson.isaudit eq '2'}">
	    					<a href="#">已引用</a>
	    					<a href="#" onclick="unauditPerson('${regBasePerson.id}');">反审核</a>
	    					<a href="#" onclick="jcinfoPerson('${regBasePerson.id}');">基础信息修改</a>
    					</c:if>
    					<c:if test="${regBasePerson.isaudit eq '0'}">
    						<a href="#" onclick="auditPerson('${regBasePerson.id}');">审核</a>		
    						<a href="#" onclick="editPerson('${regBasePerson.id}');">修改</a>
	    					<a href="#" onclick="deletePerson('${regBasePerson.id}','${regBasePerson.isaudit}');">删除</a>
    					</c:if>
    					<c:if test="${regBasePerson.isaudit eq '1'}">
    						<a href="#" onclick="unauditPerson('${regBasePerson.id}');">反审核</a>	
    					</c:if>
					</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>