0ea1e8fb7ceeafb8a1ca86e4ef487018866bef24.svn-base 7.69 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();
			var sjctext = $("#sjctext").val();
			if(sjctext == "0"){
				 $("#sjctext").val(1);
			}
		});
		
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}
		
		function gobackclist(){
			var url = "${ctx}/reg/base/regBaseC/list?ZID=${ZID}&XMMC=${XMMC}&XMID=${XMID}&DZ=${DZ}";
			window.location = url;
		}

		function submitGenTable(){
			var genCount = $("#genCount").attr("value");//本次添加的层数
			var isnegativelayer = $("#isnegativelayertext").val();
			var zxzdcs = "${ZZDCS}";//地上总层数 
			var zdxzcs = "${ZDXCS}";//底下总层数 
			var currentCCount = "${currentCCount}";//当前已添加的层数
			var currentCDXCount = "${ZCDXCS}";//当前已添加的fu层数
			//alert(currentCCount+"|"+zxzdcs+"|"+genCount+"|"+zdxzcs+"|"+currentCDXCount);
			if(isnegativelayer == "0"){
				if(parseInt(currentCCount)+parseInt(genCount)>parseInt(zxzdcs)){
					alert("正向生成情况下,不能超过幢信息里的最大正层数!请重新填写参数!");
					return;
				}
				if(parseInt(currentCCount)>0){
					if((parseInt(currentCCount)+parseInt(genCount))>zxzdcs){
						alert("正向生成情况下,当前最大的层数不能超过幢信息里的最大正层数!请重新填写参数!");
						return;
					}
				}else{
					//正层的情况下,最大的层数不能超过幢信息里的最大正层数 
					if(parseInt(genCount) > parseInt(zxzdcs)){
						alert("正向生成情况下,当前最大的层数不能超过幢信息里的最大正层数!请重新填写参数!");
						return;
					}
				}
			}else{
				//负层情况 
				if(parseInt(currentCDXCount)+parseInt(genCount)>parseInt(zdxzcs)){
					alert("负向生成情况下,不能超过幢信息里的最大负层数!请重新填写参数!");
					return;
				}
			}
			if(document.getElementById("btnSubmit")){
				document.getElementById("btnSubmit").disabled="disabled";
			}
			if(document.getElementById("btnGenTable")){
				document.getElementById("btnGenTable").disabled="disabled";
			}
			if(genCount == 1){
				document.inputForms.action = "${ctx}/reg/base/regBaseC/save?DZ=${DZ}";
			}else{
				document.inputForms.action = "${ctx}/reg/base/regBaseC/savebat?genCount="+ genCount+"&DZ=${DZ}";
			}
			document.inputForms.submit();
		}
		
		function clicksjcch(obj){
			var sjc = $("#sjctext").val();
			$("input[name='ch']").val(hxStr(sjc));
		}
		
		function hxStr(a){
			var sx = "";
			if(parseInt(a) < 10){
				sx = "000"+a;
			}else if(parseInt(a) < 100){
				sx = "00"+a;
			}else if(parseInt(a) < 1000){
				sx = "0"+a;
			}else{
				sx = a;
			}
			return sx;
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/reg/base/regBaseC/list?ZID=${ZID}&DZ=${DZ}">层信息列表</a></li>
		<li class="active"><a href="#">层信息<shiro:hasPermission name="reg:base:regBaseC:edit">${not empty regBaseC.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="reg:base:regBaseC:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" name="inputForms" modelAttribute="regBaseC" action="${ctx}/reg/base/regBaseC/save?DZ=${DZ}" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<input id="zid" name="zid" type="hidden" value="${ZID}" />
		<sys:message content="${message}"/>
		<table class="otable-form" >
			<tr>
				<td class="tit">层号:</td>
				<td>
					<form:input path="ch"   htmlEscape="false" readonly="true" maxlength="20" class="input-small"/>
				</td>
				<td class="tit">自然幢号:</td>
				<td><form:input path="zrzh" value="${ZH }" htmlEscape="false" 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="ysdm" value="2001030130" htmlEscape="false" readonly="true" maxlength="10" class="input-small "/></td>
				<td class="tit">实际层:</td>
				<td><form:input path="sjc" id="sjctext" htmlEscape="false" maxlength="3" onblur="clicksjcch(this)" class="input-small digits"/></td>
			</tr>
			<tr>
				<!-- 
				<td class="tit">名义层:</td>
				<td><form:input path="myc" htmlEscape="false" maxlength="50" class="input-small "/></td>
				 -->
				<td class="tit">层建筑面积:</td>
				<td>
					<form:input path="cjzmj" htmlEscape="false" class="input-small  number"/>
					<font size="4"></font>
				</td>
				<td class="tit">层套内建筑面积:</td>
				<td><form:input path="ctnjzmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				<td class="tit">层阳台面积:</td>
				<td><form:input path="cytmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				<td class="tit">水平投影面积:</td>
				<td><form:input path="sptymj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
			</tr>
			<tr>
				<td class="tit">层共有建筑面积:</td>
				<td><form:input path="cgyjzmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				<td class="tit">层分摊建筑面积:</td>
				<td><form:input path="cftjzmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				<td class="tit">层半墙面积:</td>
				<td><form:input path="cbqmj" htmlEscape="false" class="input-small  number"/><font size="4"></font></td>
				<td class="tit">层高:</td>
				<td><form:input path="cg" htmlEscape="false" class="input-small  number"/><font size="3">m </font></td>
			</tr>
			<tr>
				<td class="tit">是否负层:</td>
				<td colspan="5">
					<form:select path="isnegativelayer" id="isnegativelayertext" class="input-small ">
						<form:option value="0" label="否"/>
						<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</td>
			</tr>
		</table>
		<div class="form-actions">
			<c:if test="${empty VIEWS}">
				<c:if test="${not empty regBaseC.id}">
				<shiro:hasPermission name="reg:base:regBaseC:edit">
					<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;&nbsp;&nbsp;&nbsp;
				</shiro:hasPermission>
				</c:if>
				<c:if test="${empty regBaseC.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>
				<span style="font-weight:700;">单户时,按照实际填写生成&nbsp;&nbsp;&nbsp;&nbsp;</span>
			</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="gobackclist()"/>
		</div>
	</form:form>
</body>
</html>