06195df9a5837aecc12f4e10133c558657024f14.svn-base 12.3 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 src="${ctxStatic}/gis/js/init.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/lib/OpenLayers.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/lib/zdclient.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/lib/jquery.orbit-1.2.3.js" type="text/javascript"></script>    
    <script src="${ctxStatic}/gis/js/global.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/js/config.js" type="text/javascript"></script>
     <link href="${ctxStatic}/gis/lib/jqueryEasyui/easyui.css" rel="stylesheet" type="text/css" />
    <link href="${ctxStatic}/gis/lib/jqueryEasyui/icon.css" rel="stylesheet" type="text/css" />
    <script src="${ctxStatic}/gis/lib/jqueryEasyui/jquery.easyui.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	    var regBaseChxxData;
	    var TempTUceng;
	    var zid,xmid,cid;
		$(document).ready(function() {
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        
		function gobackx(){
			var url = "${ctx}/reg/base/regBaseXm/?repage";
			window.location = url;
		}

		//初始化方法,改变已审核数据的颜色
		window.onload = function() { 
			$.ajax({ 
				type:"POST", 
				url:"${ctx}/reg/base/regBaseZrz/isauditinfo", 
				cache: false,
				data:"xmid="+"${XMID}",
			    async : false,
				success:function(modelmap){
					var arr = modelmap.bsbm;
					for(var i=0;i<arr.length;i++){
						var t = arr[i];
						var bsm_q = t.substr(0,6);
						var bsm_h = t.substr(7,1);
						$("#contentTable > tbody").find("tr").each(function(){
							var ret = $(this).find("td").attr('id');
							if(bsm_h =="1" && ret == bsm_q){
								$(this).find("td").attr("style","background-color:#D2E9FF;");
							}
						});
					}
				}
			});
		}

		function winOpenZCHView(zid){
			//弹出窗口的宽度; 
			var iWidth=1100; 
			//弹出窗口的高度;
	       	var iHeight=600;
	       	//获得窗口的垂直位置
	       	var iTop = (window.screen.height - 30 - iHeight) / 2;
	       	//获得窗口的水平位置 
	       	var iLeft = (window.screen.width - 10 - iWidth) / 2;
			window.open("${ctx}/reg/base/regBaseC/zchListView?ZID="+zid+"&XMID=${XMID}&XMMC=${regBaseXmmc}","楼盘立体展示",
					"height="+ iHeight +",width="+ iWidth +",top="+ iTop +",left="+ iLeft +",toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");
		}
		
		function auditZrz(id, xmid){
			if(confirm('审核后数据将正式生效,并且不能删除和修改。确认要审核该信息吗?')){
				url = "${ctx}/reg/base/regBaseZrz/audit?id="+id+"&XMID="+xmid;
				window.location.href=url;
			}
		}
		
		function unauditZrz(id, xmid){
			if(confirm('反审核后数据恢复可删除和修改。确认要反审核该信息吗?')){
				url = "${ctx}/reg/base/regBaseZrz/unaudit?id="+id+"&XMID="+xmid;
				window.location.href=url;
			}
		}
        //有关坐标
        function zbguanli(id,xmid){
    		url = "${ctx}/reg/base/regBaseZrz/zzbmanage?id="+id+"&XMID="+xmid+"&guanli=1";
    		window.location.href=url;
            }
		
		function deletezrzlink(id,xmid,cid){
			zid = id;
			xmid = xmid;
			cid =cid;
			if(confirm('确认后,将会删除该幢以及幢下的所有层、户以及测绘信息,确定删除吗?')){
				//先发送ajax请求看当前幢下有没有已经引用的户信息 
				$.ajax({ 
					type:"POST", 
					url:"${ctx}/reg/base/regBaseZrz/isdelete", 
					cache: false,
					data:"id="+zid,
				    async : false,
					success:function(modelmap){
						var isdelete = modelmap.data;
						regBaseZrzchxxData = modelmap.regBaseZrzchxx;
						if(isdelete == "1"){ //不可以删除,其中有已被引用的户信息 
							alert("当前幢不可以删除,其下属有已被引用的户信息!");
							return;
						}else{
							if(regBaseZrzchxxData == ""){
								var url = "${ctx}/reg/base/regBaseZrz/delete?id="+zid+"&XMID="+xmid;
								 window.location.href=url;
								}else{
									deleteZrzChxx(regBaseZrzchxxData.id);
									}
							
							/* url = "${ctx}/reg/base/regBaseZrz/delete?id="+id+"&XMID="+xmid+"&cid="+cid;
							window.location.href=url; */
						}
					}
				});
			}
		}
      function deleteZrzChxx(chid) {
 				var queryStruct=new Zondy.Service.QueryFeatureStruct();
 				queryStruct.IncludeGeometry=true;
 				TempTUceng=actualSvrcfg.ZRZ;
 				var str="CHID='"+chid +"'";
 				var queryParam=new Zondy.Service.QueryByLayerParameter(TempTUceng,{ 
 	                   // geometry: line,
 	                   resultFormat: "json",
 	                   struct:queryStruct,
 	                   where :  str
 	                   });
 				var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
 						{
 					ip: actualSvrcfg.ip,        //IP地址
 					port: actualSvrcfg.port ,   //端口号
 					requestType:"POST"
 					});
 				queryService.query(queryquerydataSuccess);
 				//------------------------------------	  			
 				//url = "${ctx}/reg/base/regBaseChxx/delete?id="+TempID;
		        //window.location.href=url;
	    }
	    function queryquerydataSuccess(data)
		{
			console.log(data);
			 var chaxunvalue=data;
			 if(chaxunvalue.TotalCount>0)
			 {
				 var editDocFeature = new Zondy.Service.EditLayerFeature(TempTUceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });			   
				 editDocFeature.deletes(chaxunvalue.SFEleArray[0].FID, deleteonSuccess);			 
			 }
			 /*else
			 {
				 url = "${ctx}/reg/base/regBaseChxx/delete?id="+TempID;
		         window.location.href=url;
			 }*/
			 
		}
	    function deleteonSuccess(data)
		{ 
			if (data == true) {
	         alert("已删除!");
	         var url = "${ctx}/reg/base/regBaseZrz/delete?id="+zid+"&XMID="+xmid+"&flag=true";
			 window.location.href=url;
	          }
	        else {
	         alert("删除失败,请检查参数是否填写完整!");
	        }		 
		}

		/* function deleteChxx(zid){
			
			$.ajax({ 
				type:"POST", 
				url:"${ctx}/reg/base/regBaseZrz/chxxdelete", 
				cache: false,
				data:"id="+zid,
			    async : false,
				success:function(modelmap){
                    var zrzchxx = modelmap.regBaseZrzchxx;
                    xmid  = modelmap.xmid;
                    console.log(modelmap);
                    deleteZrzchxx(zrzchxx.id);
					}
			})
			}
		function deleteZrzchxx(chid) {
				var queryStruct=new Zondy.Service.QueryFeatureStruct();
				queryStruct.IncludeGeometry=true;
				TempTUceng=actualSvrcfg.ZRZ;
				var str="CHID='"+chid +"'";
				var queryParam=new Zondy.Service.QueryByLayerParameter(TempTUceng,{ 
	                   // geometry: line,
	                   resultFormat: "json",
	                   struct:queryStruct,
	                   where :  str
	                   });
				var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
						{
					ip: actualSvrcfg.ip,        //IP地址
					port: actualSvrcfg.port ,   //端口号
					requestType:"POST"
					});
				queryService.query(querydataSuccess);
				
    }
    function querydataSuccess(data)
	{
		
		 if(data.TotalCount>0)
		 {
			 var editDocFeature = new Zondy.Service.EditLayerFeature(TempTUceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });			   
			 editDocFeature.deletes(data.SFEleArray[0].FID, deleteSuccess);			 
		 }
	}
    function deleteSuccess(data)
	{ 
		if (data == true) {
         alert("坐标已删除!");
         var url = "${ctx}/reg/base/regBaseZrz/list?repage&XMID="+ xmid;
		 window.location.href=url;
          }
        else {
         alert("删除失败,请检查参数是否填写完整!");
        }		 
	} */
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/reg/base/regBaseZrz/list?XMID=${XMID}">自然幢信息列表</a></li>
		<shiro:hasPermission name="reg:base:regBaseZrz:edit"><li><a href="${ctx}/reg/base/regBaseZrz/form?XMID=${XMID}">自然幢信息添加</a></li></shiro:hasPermission>
		<shiro:hasPermission name="reg:base:regBaseZrz:edit"><li><a href="${ctx}/reg/base/regBaseZrz/form?XMID=${XMID}&auto=auto">自然幢信息添加(自动)</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="regBaseZrz" action="${ctx}/reg/base/regBaseZrz/" 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="xmid" name="XMID" type="hidden" value="${XMID}" />
		<ul class="ul-form">
			<li>&nbsp;&nbsp;&nbsp;不动产单元号:
				<form:input path="bdcdyh" htmlEscape="false" maxlength="28" class="input-medium"/>
			</li> 
			<li><label>标识码:</label>
				<form:input path="bsm" htmlEscape="false" maxlength="6" class="input-medium"/>
			</li>
			<li><label style="width:100px;">建筑物名称:</label>
				<form:input path="gzwmc" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="btns"><input id="btnCancel" class="btn" type="button" value="返回项目" onclick="gobackx()"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<div class="current_fwinfo">当前项目【${regBaseXmmc}】,一共包含【${zCount}】幢楼</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>标识码</th>
				<th>不动产单元号</th>
				<th>项目名称</th> 
				<th>建筑物名称</th>
				<th>宗地代码</th>
				<th hidden="hidden">自然幢号</th>
				<th>建筑面积</th>
				<th>占地面积</th>
				<th>总层数</th>
				<th>最后修改人</th>
				<th>最后修改时间</th>
				<shiro:hasPermission name="reg:base:regBaseZrz:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="regBaseZrz">
			<tr>
				<td id="${regBaseZrz.bsm}" >
					${regBaseZrz.bsm}
				</td>
				<td><a href="${ctx}/reg/base/regBaseZrz/form?id=${regBaseZrz.id}&VIEWS=1&XMID=${XMID}">
					${regBaseZrz.bdcdyh}
				</a></td>
				<td>
					${regBaseZrz.xmmc}
				</td> 
				<td>
					${regBaseZrz.gzwmc}
				</td>
				<td>
					${regBaseZrz.zddm}
				</td>
				<td hidden="hidden">
					${regBaseZrz.zrzh}#
				</td>
				<td>
					${regBaseZrz.scjzmj}
				</td>
				<td>
					${regBaseZrz.zzdmj}
				</td>
				<td>
					${regBaseZrz.zcs}
				</td>
				<td>
					${regBaseZrz.updater}
				</td>
				<td>
					<fmt:formatDate value="${regBaseZrz.updateDate}" pattern="yyyy-MM-dd"/>
				</td>
				<shiro:hasPermission name="reg:base:regBaseZrz:edit"><td>
					<a href="javascript:void(0);" onclick="winOpenZCHView('${regBaseZrz.id}');">立体展示</a>
    				<c:if test="${regBaseZrz.isaudit ne '2'}">
	    				<c:if test="${regBaseZrz.isaudit eq '0'}">
	    					<a href="#" onclick="auditZrz('${regBaseZrz.id}', '${XMID}');">审核</a>
	    					<a href="${ctx}/reg/base/regBaseZrz/form?id=${regBaseZrz.id}&XMID=${XMID}">修改</a>
                           
							<a href="#" onclick="deletezrzlink('${regBaseZrz.id}','${XMID}','${regBaseZrz.id}')">删除</a>
	    				</c:if>
	    				<c:if test="${regBaseZrz.isaudit eq '1'}">
	    					<a href="${ctx}/reg/base/regBaseC/list?ZID=${regBaseZrz.id}&XMMC=${regBaseXmmc}&XMID=${XMID}">层信息</a>
	    					<a href="#" onclick="unauditZrz('${regBaseZrz.id}', '${XMID}');">反审核</a>
	    				</c:if>
	    				<c:if test="${regBaseZrz.isaudit ne '0' and regBaseZrz.isaudit ne '1'}">
	    					<a href="#" onclick="auditZrz('${regBaseZrz.id}', '${XMID}');">审核</a>
	    					<a href="${ctx}/reg/base/regBaseZrz/form?id=${regBaseZrz.id}&XMID=${XMID}">修改</a>
							<a href="#" onclick="deletezrzlink('${regBaseZrz.id}','${XMID}','${regBaseZrz.id}')">删除</a>
	    				</c:if>
					</c:if>
					<c:if test="${regBaseZrz.isaudit eq '2'}">
						<a href="${ctx}/reg/base/regBaseC/list?ZID=${regBaseZrz.id}&XMMC=${regBaseXmmc}&XMID=${XMID}">层信息</a>
						<a href="${ctx}/reg/base/regBaseZrz/form?id=${regBaseZrz.id}&XMID=${XMID}">修改</a>
						<a href="#">已引用</a>
					</c:if>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>