790c6f8fc6fa9c930967086addfbab86588b9b67.svn-base 18.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
<%@ 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();
			
		});
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				var zced = "${zced}";
				if(zced == "1"){
					alert("此次幢修改不能选择新的宗地信息,其下属已有层信息存在!");
				}
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}
		
		function gobackzrzlist(){//DZ多幢
			var url = "${ctx}/reg/base/regBaseZrz/list?XMID=${XMID}&DZ=${DZ}";
			window.location = url;
		}
		
		function submitGenTable(){
			$(".error").remove();
			var genCount = $("#genCount").attr("value");
			var bj ="";
			//占地面积控制:当前项目所有幢信息种占地面积总和不能超过土地建筑面积 
			$.ajax({
				type:"POST",
				url:"${ctx}/reg/base/regBaseZrz/queryzdmjsum",
				cache: false,
				data:"zddm="+$("#zddmtext").val()+"&xmid=${XMID}&bsm="+$("#bsmtext").val(),
			    async : false,
				success:function(modelmap){
					var zrzdjmj = modelmap.zdmjsum;
					zrzdjmj = (parseFloat(zrzdjmj) + parseFloat($("#zzdmjtext").val())).toFixed(3);
					var zdmj = $("#zdjm").text();
					if(zdmj != undefined || zdmj != null || zdmj !=""){
						if(parseFloat(zrzdjmj) > parseFloat(zdmj)){
							alert("当前项目所有幢占地面积总和为"+zrzdjmj+",宗地面积为"+zdmj+",已超过宗地面积,请确认!");
							return;
						}else{
							bj ="0";
							document.inputForms.action = "${ctx}/reg/base/regBaseZrz/savebat?genCount="+ genCount+"&DZ=${DZ}";
						}
					}
				}
			});
			if($("#zddmtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zddmtext");
				return;
			}
			if($("#gzwmctext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#gzwmctext");
				return;
			}
// 			if($("#jgrqtext").val() == ""){
// 				$("<label for='name' class='error'>必填信息</label>").insertAfter("#jgrqtext");
// 				return;
// 			}
			if($("#zzdmjtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zzdmjtext");
				return;
			}
			if($("#scjzmjtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#scjzmjtext");
				return;
			}
			if(parseFloat($("#scjzmjtext").val()) == 0){
				$("<label for='name' class='error'>建筑面积必须大于0</label>").insertAfter("#scjzmjtext");
				return;
			}
			if($("#dscstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#dscstext");
				return;
			}
			if($("#dxcstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#dxcstext");
				return;
			}
			if($("#zcstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zcstext");
				return;
			}
			if($("#ghyttext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#ghyttext");
				return;
			}
			if($("#fwjgtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#fwjgtext");
				return;
			}
			if($("#zdftfstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zdftfstext");
				return;
			}
			/***
			if($("#jgrqtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#jgrqtext");
				return;
			}
			***/
			
			if(bj == '0'){
				//判断建筑物名称是否重复,重复的话不能提交 
				var xmid = "${XMID}";
				$.ajax({
					type:"POST",
					url:"${ctx}/reg/base/regBaseZrz/isgzwmc",
					cache: false,
					data:"gzwmc="+$("#gzwmctext").val()+"&xmid="+xmid,
				    async : false,
					success:function(modelmap){
						var ised = modelmap.data;
						if(ised == "1"){
							alert("已经存在此构筑物名称,请重新填写!");
							return;
						}else{
							if(document.getElementById("btnSubmit")){
								document.getElementById("btnSubmit").disabled="disabled";
							}
							if(document.getElementById("btnGenTable")){
								document.getElementById("btnGenTable").disabled="disabled";
							}
							document.inputForms.submit();
						}
					}
				});
			}
		}

		function submitZrz(){
			$(".error").remove();
			//占地面积控制:当前项目所有幢信息种占地面积总和不能超过土地建筑面积 
			$.ajax({
				type:"POST",
				url:"${ctx}/reg/base/regBaseZrz/queryzdmjsum",
				cache: false,
				data:"zddm="+$("#zddmtext").val()+"&xmid=${XMID}&bsm="+$("#bsmtext").val(),
			    async : false,
				success:function(modelmap){
					var zrzdjmj = modelmap.zdmjsum;
					zrzdjmj = (parseFloat(zrzdjmj) + parseFloat($("#zzdmjtext").val())).toFixed(3);
					var zdmj = $("#zdjm").text();
					if(zdmj != undefined || zdmj != null || zdmj !=""){
						if(parseFloat(zrzdjmj) > parseFloat(zdmj)){
							alert("当前项目所有幢占地面积总和为"+zrzdjmj+",宗地面积为"+zdmj+",已超过宗地面积,请确认!");
							return;
						}else{
							bj = "0";
							document.inputForms.action = "${ctx}/reg/base/regBaseZrz/save?DZ=${DZ}";
						}
					}
				}
			});
			if($("#gzwmctext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#gzwmctext");
				return;
			}
// 			if($("#jgrqtext").val() == ""){
// 				$("<label for='name' class='error'>必填信息</label>").insertAfter("#jgrqtext");
// 				return;
// 			}
			if($("#zzdmjtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zzdmjtext");
				return;
			}
			if($("#scjzmjtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#scjzmjtext");
				return;
			}
			if(parseFloat($("#scjzmjtext").val()) == 0){
				$("<label for='name' class='error'>建筑面积必须大于0</label>").insertAfter("#scjzmjtext");
				return;
			}
			if($("#dscstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#dscstext");
				return;
			}
			if($("#dxcstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#dxcstext");
				return;
			}
			if($("#zcstext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zcstext");
				return;
			} 
			/**
			if($("#jgrqtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#jgrqtext");
				return;
			}
			**/
			if($("#zcstext").val() <= 0){
				alert("总层数不能为零!");
				return;
			}
			if(bj == '0'){
				//判断建筑物名称是否重复,重复的话不能提交 
				var xmid = "${XMID}"; 
				$.ajax({
					type:"POST",
					url:"${ctx}/reg/base/regBaseZrz/isgzwmcupdate",
					cache: false,
					data:"gzwmc="+$("#gzwmctext").val()+"&xmid="+xmid+"&bdcdyh="+$("#bdcdyhtext").val(),
				    async : false,
					success:function(modelmap){
						var ised = modelmap.data;
						if(ised == "1"){
							alert("此构筑物名称已经存在于其他幢,请重新填写!");
							return;
						}else{
							if(document.getElementById("btnSubmit")){
								document.getElementById("btnSubmit").disabled="disabled";
							}
							if(document.getElementById("btnGenTable")){
								document.getElementById("btnGenTable").disabled="disabled";
							}
							document.inputForms.submit();
						}
					}
				});
			}
		}
		
		function winOpen() {
			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/regBaseZdjbxx/fwlinklist?YWH=${YWH}&CXMID=${XMID}","zddmwindow",
					"height="+ iHeight +",width="+ iWidth +",top="+ iTop +",left="+ iLeft +",toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");
			//window.open("${ctx}/reg/base/regBaseZdjbxx/form?YWH=${YWH}","zddmwindow", 
				//	"height="+ iHeight +",width="+ iWidth +",top="+ iTop +",left="+ iLeft +",toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");
		}
		function isUsed(zddm, xmid){
			$.ajax({
				type:"POST",
				url:"${ctx}/reg/base/regBaseZrz/isused",
				cache: false,
				data:"zddm="+zddm+"&xmid"+xmid,
			    async : false,
				success:function(modelmap){
					var issjed = modelmap.data;
					if(issjed == "1"){
						alert("已经添加过收件信息了!如需变动,请直接在列表记录里进行修改!");
						return;
					}
				}
			});
		}
		function isUseds(xmid){
			$.ajax({ 
				type:"POST",
				url:"${ctx}/reg/base/regBaseZrz/isused",
				cache: false,
				data:"zddm="+zddm+"&xmid"+xmid,
			    async : false,
				success:function(modelmap){
					var issjed = modelmap.data;
					if(issjed == "1"){
						alert("已经添加过收件信息了!如需变动,请直接在列表记录里进行修改!");
						return;
					}
				}
			});
		}
		function gbwz(){
			var dscs = parseInt($("#dscstext").val());
			var dxcs =	parseInt($("#dxcstext").val());
			$("#zcstext").val(dscs+dxcs);
		}
	
	</script>
	<style>
		.otable-form{width:100%;border-color:#dddddd;border:1px solid #ddd;}
		.otable-form,.table-form td{background-color:#fdfdfd;padding:2px;}
		.otable-form td.tit{background:#fafafa;text-align:right;padding-right:3px;white-space:nowrap;}
	</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/reg/base/regBaseZrz/list?XMID=${XMID}">自然幢信息列表</a></li>
		<li class="active"><a href="${ctx}/reg/base/regBaseZrz/form?id=${regBaseZrz.id}">自然幢信息<shiro:hasPermission name="reg:base:regBaseZrz:edit">${not empty regBaseZrz.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="reg:base:regBaseZrz:edit">查看</shiro:lacksPermission></a></li>
		<c:if test="${DZ ne 'DZ' }">
		<shiro:hasPermission name="reg:base:regBaseZrz:edit"><li><a href="${ctx}/reg/base/regBaseZrz/form?XMID=${XMID}&auto=auto">自然幢信息添加(自动)</a></li></shiro:hasPermission>
		</c:if>
	</ul><br/>
	<form:form id="inputForm" name="inputForms" modelAttribute="regBaseZrz" action="${ctx}/reg/base/regBaseZrz/save?DZ=${DZ}" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<input id="xmid" name="xmid" type="hidden" value="${XMID}" />
		
		<c:if test="${empty regBaseZrz.id}">
			<div class="current_fwinfo">
				宗地权利人【<span id="zdqlr"></span>】,宗地权利类型【<span id="zdqllx"></span>】,
				宗地面积【<span id="zdjm"></span>】 宗地坐落【<span id="zdzl"></span>
			</div>
		</c:if>
		<c:if test="${not empty regBaseZrz.id}">
			<div class="current_fwinfo">
				宗地权利人【<span id="zdqlr">${zdqlr}</span>】,宗地权利类型【<span id="zdqllx">${fns:getDictLabel(zdqllx, 'reg_bus_qllx', '')}</span>】,
				宗地面积【<span id="zdjm">${zdjm}</span>】 宗地坐落【<span id="zdzl">${zdzl}</span>
			</div>
		</c:if>
		<sys:message content="${message}"/>
		<table class="otable-form" >
			<tr>
				<td class="tit">标识码:</td>
				<td>
					<c:if test="${empty regBaseZrz.id}">
					<form:input path="bsm" htmlEscape="false" id="bsmtext" value="${BSM}" readOnly="true" class="input-small digits" maxlength="6"/>
					</c:if>
					<c:if test="${not empty regBaseZrz.id}">
					<form:input path="bsm" htmlEscape="false" id="bsmtext" readOnly="true" class="input-small digits" maxlength="6"/>
					</c:if>
				</td>
				<td class="tit">要素代码:</td>
				<td><form:input path="ysdm" value="2001030110" readOnly="true" htmlEscape="false" maxlength="10" class="input-small"/></td>
				<td class="tit">不动产单元号:</td>
				<td><form:input path="bdcdyh" id="bdcdyhtext" htmlEscape="false" readOnly="true" maxlength="28" class="input-small"/></td>
				<td class="tit">宗地代码:</td>
				<td><form:input path="zddm" id="zddmtext" 
							readOnly="true" htmlEscape="false"
						 maxlength="19" class="input-large required"/>
					<span class="help-inline"><font color="red">*</font> </span>
					<c:if test="${empty zced and empty regBaseZrz.zb}">
						<input id="btnChoice" class="btn btn-primary" type="button" value="请选择已发证的宗地" 
							onclick="javascript:winOpen();"/>
					</c:if>
				</td>
			</tr>
			<tr>
				<td class="tit">自然幢号:</td>
				<td><form:input path="zrzh" htmlEscape="false" value="${ZRZH}" readOnly="true" maxlength="24" class="input-small required"/>
				<span class="help-inline"><font color="red">*</font> </span></td>
				<td class="tit">项目名称:</td>
				<td><form:input path="xmmc"  readOnly="true" value="${regBaseXm.xmmc}" htmlEscape="false" maxlength="100" class="input-small "/></td>
				<td class="tit">建筑物名称:</td>
				<td><form:input path="gzwmc" id="gzwmctext" htmlEscape="false" maxlength="100" class="input-small required"/>
					<span class="help-inline"><font color="red">*</font> </span></td>
				<td class="tit">竣工日期:</td>
				<td><input name="jgrq" type="text" id="jgrqtext" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${regBaseZrz.jgrq}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
					 <span class="help-inline"><font color="red">*</font> </span> 
				</td>
			</tr>
			<tr>
				<td class="tit">建筑物高度:</td>
				<td><form:input path="jzwgd" htmlEscape="false" class="input-small  number"/><font size="3">m</font></td>
				<td class="tit">幢占地面积:</td>
				<td><form:input path="zzdmj" id="zzdmjtext" htmlEscape="false"  class="input-small  number required"/><font size="4"></font>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
				<td class="tit">幢用地面积:</td>
				<td><form:input path="zydmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				<%--
				<td class="tit">预测建筑面积:</td>
				<td><form:input path="ycjzmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				 --%>
				<td class="tit">状态:</td>
				<td><form:select path="zt" class="input-small ">
					<form:option value="1" label="有效"/>
					<form:options items="${fns:getDictList('reg_bus_bdcdyzt')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select></td>
			</tr>
			<tr>
				<td class="tit">建筑面积:</td>
				<td><form:input path="scjzmj" id="scjzmjtext" htmlEscape="false" class="input-small number required"/><font size="4"></font>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
				<td class="tit">总层数:</td>
				<td><form:input path="zcs" id="zcstext" htmlEscape="false" maxlength="4" readonly="true"  class="input-small digits required"/> 
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
				<td class="tit">地上层数:</td>
				<td><form:input path="dscs" id="dscstext" htmlEscape="false" onkeyup="gbwz()" maxlength="4" class="input-small digits required"/>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
				<td class="tit">地下层数:</td>
				<td><form:input path="dxcs" id="dxcstext" htmlEscape="false" maxlength="4" onkeyup="gbwz()" class="input-small digits required"/>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
			</tr>
			<tr>
				<td class="tit">规划用途:</td>
				<td><form:select path="ghyt" id="ghyttext" class="input-small required">
						<form:option value="" label=""/>
						<form:options items="${fns:getDictList('reg_bus_fwyt')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
				<td class="tit">房屋结构:</td>
				<td><form:select path="fwjg" id="fwjgtext" class="input-small required">
						<form:option value="" label=""/>
						<form:options items="${fns:getDictList('reg_bus_fwjg')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
				<td class="tit">总套数:</td>
				<td><form:input path="zts" htmlEscape="false" maxlength="6" class="input-small  digits"/></td>
				<td class="tit">宗地分摊方式:</td>
				<td><form:select path="zdftfs" id="zdftfstext" class="input-small required">
						<form:option value="" label=""/>
						<form:options items="${fns:getDictList('reg_bus_zdftfs')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
					<span class="help-inline"><font color="red">*</font> </span>
				</td>
			</tr>
			<tr>
				<td class="tit">建筑物基本用途:</td>
				<td><form:textarea path="jzwjbyt" htmlEscape="false" rows="2" maxlength="200" class="input-medium "/></td>
				<td class="tit">档案号:</td>
				<td><form:input path="dah" htmlEscape="false" maxlength="50" class="input-small "/></td>
				<td class="tit">备注:</td>
				<td colspan="3"><form:textarea path="bz" htmlEscape="false" rows="2" maxlength="200" class="input-xlarge "/></td>
			</tr>
			<!-- 
			<tr>
				<td class="tit">备注信息:</td>
				<td colspan="7"><form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-small "/></td>
			</tr>
			 -->
		</table>
		<!-- 
		<div id="user_ts"></div>
		<input id="btnGenTable" class="btn" type="button" value="新 增" onclick="javascript:genTables()"/>
		 -->
		<div class="form-actions">
			<c:if test="${empty VIEWS}">
				<c:if test="${not empty regBaseZrz.id}">
				<shiro:hasPermission name="reg:base:regBaseZrz:edit">
					<input id="btnSubmit" class="btn btn-primary" type="button" onclick="submitZrz();" value="保 存"/>&nbsp;&nbsp;&nbsp;&nbsp;
				</shiro:hasPermission>
				</c:if>
				<c:if test="${empty regBaseZrz.id}">
				<shiro:hasPermission name="reg:base:regBaseZrz:edit">
					<input id="btnGenTable" class="btn btn-primary" type="button" value="批量保存" onclick="submitGenTable()"/>
				</shiro:hasPermission>
				<input id="genCount" name="genCount" type="text" value="1" class="input-mini digits required"/>&nbsp;&nbsp;&nbsp;&nbsp;
				</c:if>
				<span class="help-inline"><font color="red">*</font> </span>
			</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="gobackzrzlist()"/>
		</div>
	</form:form>
</body>
</html>