regBusSlsqSfForm.jsp 10.4 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();
		});
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}
		
		function addRow(list, idx, tpl, row, isnew){
			$(list).append(Mustache.render(tpl, {
				idx: idx, delBtn: true, row: row
			}));
			$(list+idx+"_sfkmmc").each(function(){
				$(this).change(function(){
					var sfxmcode = $(this).children('option:selected').val();
					//alert(sfxmcode);
					//应收金额赋值 
					if(sfxmcode == "1"){
						$(list+idx+"_ysje").val(80);
						$(list+idx+"_ssje").val(80);
					}else if(sfxmcode == "2"){
						$(list+idx+"_ysje").val(550);
						$(list+idx+"_ssje").val(550);
					}else if(sfxmcode == "3"){
						$(list+idx+"_ysje").val(40);
						$(list+idx+"_ssje").val(40);
					}else if(sfxmcode == "4"){
						$(list+idx+"_ysje").val(275);
						$(list+idx+"_ssje").val(275);
					}else if(sfxmcode == "5"){
						$(list+idx+"_ysje").val(10);
						$(list+idx+"_ssje").val(10);
					}
				});
				$(this).val($(this).attr("data-value"));
			});
			
			$(list+idx).find("input[type='text']").each(function(){
				if(isnew == "1"){
					$(this).val(1);
					$(list+idx+"_ysje").val(80);
					$(list+idx+"_ssje").val(80);
				}
			});
			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
				var ss = $(this).attr("data-value").split(',');
				for (var i=0; i<ss.length; i++){
					if($(this).val() == ss[i]){
						$(this).attr("checked","checked");
					}
				}
			});
		}
		function delRow(obj, prefix){
			var id = $(prefix+"_id");
			var delFlag = $(prefix+"_delFlag");
			if (id.val() == ""){
				$(obj).parent().parent().remove();
			}else if(delFlag.val() == "0"){
				delFlag.val("1");
				$(obj).html("撤销删除").attr("title", "撤销删除");
				$(obj).parent().parent().addClass("error");
			}else if(delFlag.val() == "1"){
				delFlag.val("0");
				$(obj).html("删    除").attr("title", "删除");
				$(obj).parent().parent().removeClass("error");
			}
		}
	</script>
</head>
<body>
	<ul id="regBusSfFrom" class="nav nav-tabs">
		<li><a href="${ctx}/reg/bus/regBusSf/"  data-toggle="tab">收费信息列表</a></li>
		<li class="active"><a href="#" data-toggle="tab">收费信息${not empty regBusSf.id?'修改':'添加'}</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="regBusSf" action="${ctx}/reg/bus/regBusSf/save?slsq=${slsq}&tzrxm=${tzrxm}&djlx=${djlx}" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<iframe id="sfframe" name="sfframe"
		 src="${ctx}/reg/bus/regBusSf/sfwhCkChoiceForm?YWH=${ywh}&djlx=${djlx}"
	 			width="100%" height="320" frameborder="no" border="0" marginwidth="0" marginheight="0" 
	 			scrolling="no" allowtransparency="yes">
	 	</iframe>
		<fieldset>
		<legend>收件信息</legend>
			<table class="table-form">
				<tr>
					<td class="tit">业务号</td>
					<td><form:input path="ywh" htmlEscape="false" readonly="true" value="${YWH}" maxlength="20" class="input-xlarge "/></td>
					<td class="tit">要素代码</td>
					<td><form:input path="ysdm" htmlEscape="false" readonly="true" value="6004040000" maxlength="20" class="input-xlarge "/></td>
					<td class="tit">计费日期</td>
					<td>
						<!-- 更新 -->
						<c:if test="${not empty regBusSf.id}">
							<input name="jfrq" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
								value="<fmt:formatDate value="${regBusSf.jfrq}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
						</c:if>
						<!-- 新增 -->
						<c:if test="${empty regBusSf.id}">
							<input name="jfrq" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
								value="${fns:getDate('yyyy-MM-dd')}"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
						</c:if>
						<span class="help-inline"><font color="red">*</font> </span>
					</td>
				</tr>
				<tr>
					<td class="tit">计费人员</td>
					<td>
						<form:input path="jfry" value="${NAME }" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
						<span class="help-inline"><font color="red">*</font> </span>
					</td>
					<td class="tit">收费人员1</td>
					<td><form:input path="sfry" value="${NAME }" htmlEscape="false" maxlength="50" class="input-xlarge required"/></td>
					<td class="tit">收费日期</td>
					<td>
						<!-- 更新 -->
						<c:if test="${not empty regBusSf.id}">
							<input name="sfrq" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
								value="<fmt:formatDate value="${regBusSf.sfrq}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
						</c:if>
						<!-- 新增 -->
						<c:if test="${empty regBusSf.id}">
							<input name="sfrq" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
								value="${fns:getDate('yyyy-MM-dd')}"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
						</c:if>
						<span class="help-inline"><font color="red">*</font> </span>
					</td>
				</tr> 
				<tr>
					<td class="tit">付费方</td>
					<td>
						<form:select path="fff" class="input-xlarge " >
							<form:option value="2" label="乙方"/>
							<form:options items="${fns:getDictList('reg_bus_fffs')}" itemLabel="label" itemValue="value" htmlEscape="false" />
						</form:select>
					</td>
					<td class="tit">实际付费人</td>
					<td>
						<form:input path="sjffr" value="${tzrxm }" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
						<span class="help-inline"><font color="red">*</font> </span>
					</td>
					<td class="tit">收费单位</td>
					<td>
						<form:input path="sfdw" value="不动产登记交易服务中心" readonly="true" htmlEscape="false" maxlength="50" class="input-xlarge "/>
					</td>
				</tr>
				<tr>
					<td class="tit">备注信息</td>
					<td colspan="5">
						<form:textarea path="remarks" htmlEscape="false" rows="2" maxlength="255" class="input-xxlarge "/>
					</td>
				</tr>   
			</table>
		</fieldset>
		<fieldset>
			<legend>收费详细信息</legend>
		<br> 
		<div class="controls">
			<table id="contentTable" class="table table-striped table-bordered table-condensed">
				<thead>
					<tr>
						<th class="hide"></th>
						<th>收费科目名称</th> 
						<th>收费基数</th>
						<th>收费类型</th>
						<th>应收金额</th> 
						<th>实收金额</th>
						<th width="10">&nbsp;</th>
					</tr>
				</thead>
				<tbody id="regBusSfSubList">
				</tbody>
				<tfoot>
					<tr><td colspan="10"><a href="javascript:" onclick="addRow('#regBusSfSubList', regBusSfSubRowIdx, regBusSfSubTpl, null,'1');regBusSfSubRowIdx = regBusSfSubRowIdx + 1;" class="btn">新增</a></td></tr>
				</tfoot>
			</table>
			<script type="text/template" id="regBusSfSubTpl">//<!--
						<tr id="regBusSfSubList{{idx}}">
							<td class="hide">
								<input id="regBusSfSubList{{idx}}_id" name="regBusSfSubList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="regBusSfSubList{{idx}}_delFlag" name="regBusSfSubList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td width="430">
								<select id="regBusSfSubList{{idx}}_sfkmmc" name="regBusSfSubList[{{idx}}].sfkmmc" style="width:430px" data-value="{{row.sfkmmc}}" class="input-small ">
									<option value="1">${fns:getDictLabel('1', 'reg_bus_sfxm', '')}</option>
									<c:forEach items="${fns:getDictList('reg_bus_sfxm')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td width="70">
								<input id="regBusSfSubList{{idx}}_sfjs" name="regBusSfSubList[{{idx}}].sfjs" style="width:50px" type="text" value="{{row.sfjs}}" class="input-small number required"/>
							</td>
							<td width="110">
								<select id="regBusSfSubList{{idx}}_sflx" name="regBusSfSubList[{{idx}}].sflx" data-value="{{row.sflx}}" class="input-small ">
									<option value="1">${fns:getDictLabel('1', 'reg_bus_sflx', '')}</option>
									<c:forEach items="${fns:getDictList('reg_bus_sflx')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td width="70">
								<input id="regBusSfSubList{{idx}}_ysje" name="regBusSfSubList[{{idx}}].ysje" style="width:50px" type="text" value="{{row.ysje}}" class="input-small number required"/>
							</td>
							<td width="70">
								<input id="regBusSfSubList{{idx}}_ssje" name="regBusSfSubList[{{idx}}].ssje" style="width:50px" type="text" value="{{row.ssje}}" class="input-small number required"/>
							</td>
							<td class="text-center" width="60">
								{{#delBtn}}<a class="btn btn-primary" onclick="delRow(this, '#regBusSfSubList{{idx}}')" title="删除">    </a>{{/delBtn}}
							</td>
						</tr>//-->
					</script>
			<script type="text/javascript">
				var regBusSfSubRowIdx = 0, regBusSfSubTpl = $("#regBusSfSubTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
				$(document).ready(function() {
					var data = ${fns:toJson(regBusSf.regBusSfSubList)};
					for (var i=0; i<data.length; i++){
						addRow('#regBusSfSubList', regBusSfSubRowIdx, regBusSfSubTpl, data[i]);
						regBusSfSubRowIdx = regBusSfSubRowIdx + 1;
					}
				});
			</script>
		</div>
		</fieldset>
		<div class="form-actions">
			<c:if test="${empty VIEWS}">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
 	<script>
	   $(function () {
	      $('#regBusSfFrom li:eq(1) a').tab('show');
	   });
	</script>
</body>
</html>