04c9380367c0e75a706c5869a2fc255b52adbc47.svn-base 7.52 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() {
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function gobackz(){
			var url = "${ctx}/reg/base/regBaseZrz/list?repage&XMID=${XMID}&DZ=${DZ}";
			window.location = url;
		}
		
		function auditC(id, zid){
			if(confirm('审核后数据将正式生效,并且不能删除和修改。确认要审核该信息吗?')){
				url = "${ctx}/reg/base/regBaseC/audit?id="+id+"&ZID="+zid+"&DZ=${DZ}"; 
				window.location.href=url;
			}
		}
		function unauditC(id, zid){
			$.ajax({ 
				type:"POST", 
				url:"${ctx}/reg/base/regBaseZrz/isnounaudit", 
				cache: false,
				data:"id="+id+"&bj=2&zid="+zid,
			    async : false,
				success:function(modelmap){
					if(modelmap.success == 0){
						if(confirm('反审核后数据恢复可删除和修改。确认要反审核该信息吗?')){
							url = "${ctx}/reg/base/regBaseC/unaudit?id="+id+"&ZID="+zid+"&DZ=${DZ}";
							window.location.href=url;
						}
					}else{
						alert(modelmap.msg);
						return;
					}
				}
			});
		}
		
		function batAuditC(){
			if(confirm('批量审核当前幢包含所有层后,数据将正式生效,并且不能删除和修改。确认要审核该信息吗?')){
				url = "${ctx}/reg/base/regBaseC/batAudit?ZID=${ZID}&DZ=${DZ}";
				window.location.href=url;
			}
		}
		
		function deleteclink(id, zid){
			if(confirm('确认后,将会删除该层以及层下的所有户信息,确定删除吗?')){
				//先发送ajax请求看当前项目下有没有已经引用的户信息 
				$.ajax({ 
					type:"POST", 
					url:"${ctx}/reg/base/regBaseC/isdelete", 
					cache: false,
					data:"id="+id,
				    async : false,
					success:function(modelmap){
						var isdelete = modelmap.data;
						var bj = modelmap.bj;
						if(isdelete == "1"){ //不可以删除,其中有已被引用的户信息 
							alert("当前层不可以删除,其下属有已被引用的户信息!");
							return;
						}else if(bj == "1"){
							alert("请从最高层删除 !");
							return;
						}else{
							url = "${ctx}/reg/base/regBaseC/delete?id="+id+"&ZID="+zid+"&DZ=${DZ}";
							window.location.href=url;
						}
					}
				});
			}
		}
		
		function cQuery(){
			$(".cerror").remove();
			var sjc = $("#sjctext").attr("value");
			document.searchForm.action = "${ctx}/reg/base/regBaseC/list?&DZ=${DZ}";
			if($("#zddmtext").val() == ""){
				$("<span class='cerror'>实际层必须填写为整数!</span>").insertAfter("#sjctext");
				return;
			}
			if(!isInteger(sjc)){
				return;
			}
			document.searchForm.submit();
		}
		
		//整数 
		function isInteger(Code){
			var reg = /^-?[0-9]\d*$/;
		 	if(reg.test(Code) === false){
		 		$(".cerror").remove();
		 		$("<span class='cerror'>实际层必须填写为整数!</span>").insertAfter("#sjctext");
		        return false;
		   }else{
			   return true;
		   }
		}
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/reg/base/regBaseC/list?ZID=${ZID}&DZ=${DZ}">层信息列表</a></li>
		<!--<shiro:hasPermission name="reg:base:regBaseC:edit"><li><a href="${ctx}/reg/base/regBaseC/form?ZID=${ZID}&XMID=${XMID}&DZ=${DZ}">层信息添加</a></li></shiro:hasPermission>-->
	</ul>
	<form:form id="searchForm" name="searchForm" modelAttribute="regBaseC" action="${ctx}/reg/base/regBaseC/list?&DZ=${DZ}" 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}"/>
		<input id="zid" name="ZID" type="hidden" value="${ZID}" />
		<ul class="ul-form">
			<li><label>实际层:</label>
				<form:input path="sjc" id="sjctext" htmlEscape="false" maxlength="20" class="input-mini"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="button"  onclick="cQuery()" value="查询"/></li>
			<li class="btns"><input id="btnCancel" class="btn" type="button" value="返回幢" onclick="gobackz()"/></li>
			<li class="btns"><input id="btnBatAduit" class="btn btn-primary" type="button" value="层批量审核" onclick="batAuditC();"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<div class="current_fwinfo">当前项目【${XMMC}】,建筑物【${JZWMC}】,一共包含【${cCount}】层</div>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>层号</th>
				<th>自然幢号</th>
				<th>实际层</th> 
				<th>层建筑面积</th>
				<th>层阳台面积</th>
				<%--
				<th>层套内建筑面积</th>
				<th>层共有建筑面积</th>
				<th>层分摊建筑面积</th>
				<th>层半墙面积</th>
				 --%>
				<th>层高</th>
				<th>水平投影面积</th>
				<shiro:hasPermission name="reg:base:regBaseC:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="regBaseC">
			<tr>
				<td>
				<!-- 
				<c:if test="${regBaseC.isnegativelayer eq '0'}">
					<a href="${ctx}/reg/base/regBaseC/form?id=${regBaseC.id}&VIEWS=1">
						${regBaseC.ch}
					</a>
				</c:if>
				<c:if test="${regBaseC.isnegativelayer eq '1'}">
					<a href="${ctx}/reg/base/regBaseC/form?id=${regBaseC.id}&VIEWS=1">
						-${regBaseC.ch}
					</a>
				</c:if>
				 -->
				 	<a href="${ctx}/reg/base/regBaseC/form?id=${regBaseC.id}&VIEWS=1&ZID=${ZID}&xg=1&DZ=${DZ}">
						${regBaseC.ch}
					</a>
				</td>
				<td>
					${regBaseC.zrzh}#
				</td>
				<td>
					${regBaseC.sjc}
				</td>
				<td>
					${regBaseC.cjzmj}
				</td>
				<td>
					${regBaseC.cytmj}
				</td>
				<%--
				<td>
					${regBaseC.ctnjzmj}
				</td>
				
				<td>
					${regBaseC.cgyjzmj}
				</td>
				<td>
					${regBaseC.cftjzmj}
				</td>
				<td>
					${regBaseC.cbqmj}
				</td>
				--%>
				<td>
					${regBaseC.cg}
				</td>
				<td>
					${regBaseC.sptymj}
				</td>
				<shiro:hasPermission name="reg:base:regBaseC:edit">
				<td>
					<c:if test="${regBaseC.isaudit ne '2'}">
	    				<c:if test="${regBaseC.isaudit eq '0'}">
	    					<!--<a href="#" onclick="auditC('${regBaseC.id}', '${ZID}');">审核</a>
	    					<a href="${ctx}/reg/base/regBaseC/form?id=${regBaseC.id}&ZID=${ZID}&xg=1&DZ=${DZ}">修改</a>
							<a href="#" onclick="deleteclink('${regBaseC.id}', '${ZID}')">删除</a>-->
	    				</c:if>
	    				<c:if test="${regBaseC.isaudit eq '1'}">
	    					<a href="${ctx}/reg/base/regBaseH/list?CID=${regBaseC.id}&XMMC=${XMMC}&ZID=${ZID}&XMID=${XMID}&DZ=${DZ}">户信息</a>
	    					<!--<a href="#" onclick="unauditC('${regBaseC.id}', '${ZID}');">反审核</a>-->
	    				</c:if>
	    				<c:if test="${regBaseC.isaudit ne '0' and regBaseC.isaudit ne '1'}">
	    					<!--<a href="#" onclick="auditC('${regBaseC.id}', '${ZID}');">审核</a>
	    					<a href="${ctx}/reg/base/regBaseC/form?id=${regBaseC.id}&ZID=${ZID}&xg=1&DZ=${DZ}">修改</a>
							<a href="#" onclick="deleteclink('${regBaseC.id}', '${ZID}')">删除</a>-->
	    				</c:if>
					</c:if>
					<c:if test="${regBaseC.isaudit eq '2'}">
						<a href="${ctx}/reg/base/regBaseH/list?CID=${regBaseC.id}&XMMC=${XMMC}&ZID=${ZID}&XMID=${XMID}&DZ=${DZ}">户信息</a>
						<a href="#">已引用</a>
					</c:if>
				</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>