d948040f1caf922ebda60c8bff30f8f3bd3ea01e.svn-base 7.65 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() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交,请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误,请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			views();
			if("${isReonly}" == "" || "${isReonly}" == undefined || "${isReonly}" == null){
				$("#qlxztext").attr("readOnly","true");
			}
		});
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}
		
		function clickjzmj(obj) {
			var jzmj = parseFloat($("#txtJzmj").val());
			var tnjzmj = parseFloat($("#txtTnjzmj").val());
			if (jzmj != "" && tnjzmj != "") {
				if (tnjzmj > jzmj) {
					alert("套内建筑面积不能大于建筑面积!");
					$("input[name='scjzmj']").val("");
					$("input[name='scftjzmj']").val("");
					return;
				}
				$("input[name='scftjzmj']").val((jzmj-tnjzmj).toFixed(2));
			}
		}
		function clicktnjzmj(obj) {
			var jzmj = parseFloat($("#txtJzmj").val());
			var tnjzmj = parseFloat($("#txtTnjzmj").val());
			if (jzmj != "" && tnjzmj != "") {
				if (tnjzmj > jzmj) {
					alert("套内建筑面积不能大于建筑面积!");
					$("input[name='sctnjzmj']").val("");
					$("input[name='scftjzmj']").val("");
					return;
				}else{
					$("input[name='scftjzmj']").val((jzmj-tnjzmj).toFixed(2));
				}
			}
		}
		
		function submitGenTable(){
			$(".error").remove(); 
			if($("#fwbmtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#fwbmtext");
				return;
			}
			if($("#chtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#chtext");
				return;
			}
			if($("#shbwtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#shbwtext");
				return;
			}
			if($("#txtJzmj").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#txtJzmj");
				return;
			}
			if($("#txtTnjzmj").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#txtTnjzmj");
				return;
			}
			if($("#hxText").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#hxText");
				return;
			}
			if($("#hxjgText").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#hxjgText");
				return;
			}
			if($("#fwxzText").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#fwxzText");
				return;
			}
			if($("#xypositiontext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#xypositiontext");
				return;
			}
			var hhStrList = "${hhStrList}";
			hhStrList = hhStrList.substring(1, hhStrList.length-1);
			var hhStrListArr = [];
			hhStrListArr = hhStrList.split(",");
			var sjc = "${SJC}";
			var xypositiontext = $('#xypositiontext').val();
			var xyposition = '${xyposition}';
			if(xypositiontext != xyposition){
				//负层时 
				if(parseInt(sjc) < 0){
					if(!isStrAndSixNum(xypositiontext)){
						return;
					}
				}else{
					if(!isSixNum(xypositiontext)){
						return;
					}
				} 
				//构造当前要生成的 
				var currentGenH = [];
				currentGenH.push($("#xypositiontext").attr("value"));
				//判断是否有重复,有重复时不能提交,直接返回 
				for(var i=0;i<hhStrListArr.length;i++){
					for(var j=0;j<currentGenH.length;j++){
						if(hhStrListArr[i].replace(" ","") == currentGenH[j]){
							alert("当前要生成的房屋【"+currentGenH+"】已部分存在于【"+hhStrListArr+"】,请选用空户位置进行添加补充!");
							return;
						}
					}
				}
			}
			document.inputForms.action = "${ctx}/reg/base/regBaseH/bgpropertysave?CID=${CID}&YWH=${YWH}&DJLX=${DJLX}&WO=${WO}&ids=${ids}&optype=${optype}&retur=${retur}&oldhid=${oldhid}&qsId=${qsId}"; 
			document.getElementById("btnGenTable").disabled="disabled";
			document.getElementById("btnCancel").disabled="disabled";
			document.inputForms.submit();
		}
		
		//判断是否为六位数字  
		function isSixNum(Str){
		   var reg = /^\d{6}$/;
		   if(reg.test(Str) === false){
			   $(".error").remove();
		 	   $("<label for='name' class='error'>请重新输入楼盘位置,{一层第一户形如 · 001001}!</label>").insertAfter("#xypositiontext");
		       return false;
		   }else{
			   return true;
		   }
		}
		
		//判断是否 - 六位数字
		function isStrAndSixNum(Str){
			var reg = /^-\d{6}$/;
		 	if(reg.test(Str) === false){
		 		$(".error").remove();
		 		$("<label for='name' class='error'>请重新输入楼盘位置,{负一层第一户形如 · -001001}!</label>").insertAfter("#xypositiontext");
		        return false;
		   }else{
			   return true;
		   }
		}
		
		function hxStr(a){
			var sx = "";
			if(parseInt(a) < 10){
				sx = "0"+a;
			}else{
				sx = a;
			}
			return sx;
		}
		
		function winOpenUpdateFdcq1(id,bdcdyh){
				window.location.href="${ctx}/reg/base/regBaseH/dzbgpropertyform?YWH=${YWH}&WO=1&DJLX=${DJLX}&HID="+id+"&bdcdyh="+bdcdyh+"&ids=${ids}";
			
		}
		
		function submitGenTable(){
			
			window.location.href = "${ctx}/reg/bus/regBusFdcq1/dznextHousePropertyForm?YWH=${YWH}&DJLX=${DJLX}&WO=${WO}&ids=${ids}&optype=${optype}&retur=${retur}&oldhid=${oldhid}&qsId=${qsId}&HID=${HID}"; 
			
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="#">户信息修改</a></li>
	</ul><br/>
	<div class="tab-pane" id="regBusFdList">
		<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>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${fwpage.list}" var="regBaseH">
			<tr>
				<td>
					${regBaseH.bdcdyh}
				</td>
				<td>
					${regBaseH.fwbm}
				</td>
				<td>
					${regBaseH.jgzwmc}
				</td>
				<td>
					${regBaseH.zl}
				</td>
				<td>
					${regBaseH.sjcs}
				</td> 
				<td>
					${regBaseH.shbw}
				</td>
				<td>
					${fns:getDictLabel(regBaseH.hxjg, 'reg_bus_hxjg', '')}
				</td>
				<td>
					${fns:getDictLabel(regBaseH.fwxz, 'reg_bus_fwxz', '')}
				</td>
				<td>
					${fns:getDictLabel(regBaseH.fwlx, 'reg_bus_fwlx', '')}
				</td>
				<td>
					${regBaseH.scjzmj}
				</td>
				<td>
					${regBaseH.fttdmj}
				</td>
				<td>
				    <c:if test="${regBaseH.rights eq '0' or regBaseH.rights eq '2' }">
						<a href="javascript:void(0);" onclick="winOpenUpdateFdcq1('${regBaseH.id}','${regBaseH.bdcdyh}');">变更</a>
					</c:if>
					<c:if test="${regBaseH.rights eq '3'}">
						<a href="javascript:void(0);" onclick="winOpenUpdateFdcq1('${regBaseH.id}','${regBaseH.bdcdyh}');">查看</a>
					</c:if>
					</td>
			</tr>
		</c:forEach>
		</tbody>
		</table>
		
		<input id="btnGenTable" class="btn btn-primary" type="button" value="下一步" onclick="submitGenTable()"/>
	</div>
	
</body>
</html>