openPrintViewBdcqd.jsp 7.88 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 language="javascript" src="${ctxStatic}/lodop/LodopFuncs.js" type="text/javascript"></script>
	<object id="LODOP_OB"  classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"  width=0  height=0>
		<embed id="LODOP_EM"  type="application/x-print-lodop"  width=0  height=0></embed>
	</object>
	<script type="text/javascript">
		var selItems = new Array();
		$(document).ready(function() {
			
		});
		var fwts = parseInt(${fwts});
		var ys = parseInt(${ys});
		var ybdcqzhFlag = "${ybdcqzhFlag}";
		window.onload = function() { 
			showView();
		};
	
		var LODOP; //声明为全局变量
		
		//显示第一页
		function showView(){
			$("#myTabContent").hide();
			var listmap = ${fns:toJson(listmap)};
			var $v=$(document.getElementById("contentTable")); //转化为jQuery对象 
			if(ybdcqzhFlag == 'no'){
				var innerInfo = "<thead>"+"<tr>"
								+"<th width='18%'>项目名称</th>"
								+"<th width='10%'>栋号</th>"
								+"<th width='8%'>房号</th>"
								+"<th width='22%'>不动产单元号</th>"
								+"<th width='12%'>业务编号</th>"
								+"<th width='12%'>面积(㎡)</th>"
								+"<th width='18%'>用途</th>"
								+"</tr>"+"</thead>";
				for(var j = 0; j < listmap.length; j++){
				var innerInfo1 = "<tbody>"
								+"<td width='18%'>"+listmap[j].xmmc+"</td>"
								+"<td width='10%'>"+listmap[j].zrzh+"</td>"
								+"<td width='8%'>"+listmap[j].shbw+"</td>"
								+"<td width='22%'>"+listmap[j].bdcdyh+"</td>"
								+"<td width='12%'>"+listmap[j].ywh+"</td>"
								+"<td width='12%'>"+listmap[j].mj+"</td>"
								+"<td width='18%'>"+listmap[j].yt+"</td>"
								+"</tbody>";
				$v.append(innerInfo1);
				}
			}else{
				var innerInfo = "<thead>"+"<tr>"
								+"<th width='18%'>项目名称</th>"
								+"<th width='8%'>栋号</th>"
								+"<th width='8%'>房号</th>"
								+"<th width='22%'>不动产单元号</th>"
								+"<th width='12%'>业务编号</th>"
								+"<th width='12%'>面积(㎡)</th>"
								+"<th width='20%'>不动产权证书号</th>"
								+"</tr>"+"</thead>";
				for(var j = 0; j < listmap.length; j++){
				var innerInfo1 = "<tbody>"
								+"<td width='18%'>"+listmap[j].xmmc+"</td>"
								+"<td width='8%'>"+listmap[j].zrzh+"</td>"
								+"<td width='8%'>"+listmap[j].shbw+"</td>"
								+"<td width='22%'>"+listmap[j].bdcdyh+"</td>"
								+"<td width='12%'>"+listmap[j].ywh+"</td>"
								+"<td width='12%'>"+listmap[j].mj+"</td>"
								+"<td width='20%'>"+listmap[j].ybdcqzh+"</td>"
								+"</tbody>";
				$v.append(innerInfo1);
				}
			}
			$v.append(innerInfo);
	
			for(var i = 0 ;i < ys;i++){
				if(ybdcqzhFlag == 'no'){
					var innerInfo = "<div id='myTabContent"+i+"' class='tab-content'>"
								+"<div><table width='750'>"
								+"<tr><td style='font-size:18px; font-weight: bold'><div align='center'> 不动产登记清单</div></td></tr>"
								+"</table></div>"
								+"<div><table width='750'><tr>"
								+"<td style='font-size:14px; font-weight: bold' width='15%'><div align='left'>业务编号:</div></td>"
								+"<td width='15%'>${ywh}</td><td width='40%'></td>"
								+"<td style='font-size:14px; font-weight: bold' width='10%'>共 "+ys+" 页 / </td>"
								+"<td style='font-size:14px; font-weight: bold' width='10%'>第 "+(i+1)+" 页</td></tr>"
								+"</table></div>"
								+"<div><table width='750'>"
								+"<tr><td style='font-size:14px; font-weight: bold' width='15%'><div align='left'> 项目名称:</div></td>"
								+"<td width='15%'>${xmmc}</td><td width='30%'></td><td width='30%'></td></tr>"
								+"</table></div>"
								+"<div><table width='750'>"
								+"<tr><td style='font-size:14px; font-weight: bold' width='15%'><div align='left'>合计:</div></td>"
								+"<td width='15%'>共 ${fwts} 套</td><td width='40%'></td><td width='20%'>共 ${sumMj} ㎡</td></tr>"
								+"</table></div>"
								+"<table border='1' id='contentTable"+i+"'>"
								+"<thead>"+"<tr>"
									+"<th width='10%'>栋号</th>"
									+"<th width='10%'>房号</th>"
									+"<th width='20%'>不动产单元号</th>"
									+"<th width='8%'>面积(㎡)</th>"
									+"<th width='24%'>用途</th>"
								+"</tr>"+"</thead>"+"<tbody>";
				}else{
					var innerInfo = "<div id='myTabContent"+i+"' class='tab-content'>"
								+"<div><table width='750'>"
								+"<tr><td style='font-size:18px; font-weight: bold'><div align='center'> 不动产登记清单</div></td></tr>"
								+"</table></div>"
								+"<div><table width='750'><tr>"
								+"<td style='font-size:14px; font-weight: bold' width='15%'><div align='left'>业务编号:</div></td>"
								+"<td width='15%'>${ywh}</td><td width='40%'></td>"
								+"<td style='font-size:14px; font-weight: bold' width='10%'>共 "+ys+" 页 / </td>"
								+"<td style='font-size:14px; font-weight: bold' width='10%'>第 "+(i+1)+" 页</td></tr>"
								+"</table></div>"
								+"<div><table width='750'>"
								+"<tr><td style='font-size:14px; font-weight: bold' width='15%'><div align='left'> 项目名称:</div></td>"
								+"<td width='15%'>${xmmc}</td><td width='30%'></td><td width='30%'></td></tr>"
								+"</table></div>"
								+"<div><table width='750'>"
								+"<tr><td style='font-size:14px; font-weight: bold' width='15%'><div align='left'>合计:</div></td>"
								+"<td width='15%'>共 ${fwts} 套</td><td width='40%'></td><td width='20%'>共 ${sumMj} ㎡</td></tr>"
								+"</table></div>"
								+"<table border='1' id='contentTable"+i+"'>"
								+"<thead>"+"<tr>"
									+"<th width='8%'>栋号</th>"
									+"<th width='11%'>房号</th>"
									+"<th width='20%'>不动产单元号</th>"
									+"<th width='7%'>面积(㎡)</th>"
									+"<th width='26%'>不动产权证书号</th>"
								+"</tr>"+"</thead>"+"<tbody>";
				}
				var $v=$("#contentTable"+i); //转化为jQuery对象
				var innerInfo0 = "";
				var b = listmap.length-(i+1)*35;//总条数-起始页至当前页的数据条数
				if(b < 0){
					b = listmap.length;
				}else{
					b = (i+1)*35;
				}
				for(var j = i*35; j < b; j++){
					if(ybdcqzhFlag == 'no'){
						var innerInfo1 = "<tr>"
									+"<td  style='font-size:15px;' width='10%'>"+listmap[j].zrzh+"</td>"
									+"<td  style='font-size:15px;' width='10%'>"+listmap[j].shbw+"</td>"
									+"<td  style='font-size:15px;' width='20%'>"+listmap[j].bdcdyh+"</td>"
									+"<td  style='font-size:15px;' width='8%'>"+listmap[j].mj+"</td>"
									+"<td  style='font-size:15px;' width='24%'>"+listmap[j].yt+"</td>"
									+"</tr>";
					}else{
						var innerInfo1 = "<tr>"
									+"<td width='8%'>"+listmap[j].zrzh+"</td>"
									+"<td width='11%'>"+listmap[j].shbw+"</td>"
									+"<td width='20%'>"+listmap[j].bdcdyh+"</td>"
									+"<td width='7%'>"+listmap[j].mj+"</td>"
									+"<td width='26%'>"+listmap[j].ybdcqzh+"</td>"
									+"</tr>";
					}
					innerInfo0 += innerInfo1;
				}
				var innerInfoend = "</tbody>"+"</table>"+"</div>";
				$("#myTabContent").append(innerInfo+innerInfo0+innerInfoend);
			}
		}
		
		//打印预览
		function preview() {		
			LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
			for(var i = 0;i < ys;i++){
				LODOP.ADD_PRINT_HTM(20, 20, 750, 2000,$("#myTabContent"+i).html());
				LODOP.NewPage();
			}
				LODOP.PREVIEW();
		};		
		
	</script>
</head>
<body>
	<div id="myTabContent" class="tab-content">
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed"></table>
	<div align="center" style="font-size: 2px;  font-weight: bold" style="font-family:宋体">
		<h5>共 ${fwts} 套</h5>
	</div><br/>
	<div class="control-group"  style="height: 25px;padding-top: 5px;" align="center">
		<input id="btnPreview" class="btn btn-primary"  type="button"  onclick="preview();"  value="打印预览"/>
	</div>
</body>
</html>