4ab46ca9ba316ccbf4a131004130397581df65a5.svn-base 20.5 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);
					}
				}
			});
			//readonly有个问题就是下拉框控制不了;disabled可以满足当前页面要求 
			views();
		});
		function addRow(list, idx, tpl, row, isnew){
			$(list).append(Mustache.render(tpl, {
				idx: idx, delBtn: true, row: row
			}));
			$(list+idx).find("select").each(function(){
				$(this).val($(this).attr("data-value"));
			});
			$(list+idx).find("input[type='text']").each(function(){
				if(isnew == '1'){
					$(this).val(1);
				}
			});
			for(var i=0;i<150;i++){
				$("#regBusSjchildList"+i+"_sort").val(i+1);
			}
			$(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");
			}
		}

		//readonly有个问题就是下拉框控制不了;disabled可以满足当前页面要求 
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}

	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<!-- 
		<li><a href="${ctx}/reg/bus/regBusSjmain/">收件信息列表</a></li>
		 -->
		<li class="active"><a href="#">收件信息<shiro:hasPermission name="reg:bus:regBusSjmain:edit">${not empty regBusSjmain.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="reg:bus:regBusSjmain:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="regBusSjmain" action="${ctx}/reg/bus/regBusSjmain/save?YWH=${YWH}&optype=${regBusSjmain.id}" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<fieldset>
			<table class="table-form">
				<tr>
					<td class="tit">业务号</td>
					<td><form:input path="ywh" htmlEscape="false" value="${YWH}" readonly="true" 
						maxlength="20" class="input-xlarge "/></td>
					<td class="tit">要素代码</td>
					<td><form:input path="ysdm" htmlEscape="false" value="2004020000" readonly="true" 
						 maxlength="20" class="input-xlarge "/></td>
					<td class="tit">收件时间</td>
					<td>
						<!-- 更新 -->
						<c:if test="${not empty regBusSjmain.id}">
							<input name="sjsj" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
								value="<fmt:formatDate value="${regBusSjmain.sjsj}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>
						</c:if>
						<!-- 新增 -->
						<c:if test="${empty regBusSjmain.id}">
							<input name="sjsj" 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 colspan="5">
						<form:textarea path="bz" htmlEscape="false" rows="1" maxlength="300" cssStyle="width:800px" class="input-xxlarge "/>
					</td>
				</tr>
			</table>
		</fieldset>
		<fieldset>
			<legend>收件详细信息</legend>
			<div class="">
			<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>附件</th>
						
					</tr>
				</thead>
				<tbody id="regBusSjchildList">
				</tbody>
			</table>
			<script type="text/template" id="regBusSjchildTpl">//<!--
						<tr id="regBusSjchildList{{idx}}">	
							<td class="hide">
								<input id="regBusSjchildList{{idx}}_id" name="regBusSjchildList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="regBusSjchildList{{idx}}_delFlag" name="regBusSjchildList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td width="40">
								<input id="regBusSjchildList{{idx}}_sort" name="regBusSjchildList[{{idx}}].sort" style="width:30px" type="text" value="{{row.sort}}" class="input-small "/>
							</td>
							<td width="100">
								<select id="regBusSjchildList{{idx}}_sjlx" name="regBusSjchildList[{{idx}}].sjlx" data-value="{{row.sjlx}}" class="input-small ">
									<option value="2">${fns:getDictLabel('2', 'reg_bus_sjlxyf', '')}</option>
									<c:forEach items="${fns:getDictList('reg_bus_sjlxyf')}" var="dict">
										<option value="${dict.value}">${dict.label}</option>
									</c:forEach>
								</select>
							</td>
							<td width="470">
								<c:if test="${DJLX ne '207' and DJLX ne '209' and DJLX ne '430' and DJLX ne '605'
									 and DJLX ne '213'  and DJLX ne '427' and DJLX ne '428' and DJLX ne '431' and DJLX ne '606' and DJLX ne '316' and DJLX ne '220'
									 and DJLX ne '214' and DJLX ne '215' and DJLX ne '433' and DJLX ne '422' and DJLX ne '317' and DJLX ne '318' and DJLX ne '608'
									 and DJLX ne '432' and DJLX ne '819' and DJLX ne '607' and DJLX ne '818' and DJLX ne '811' and DJLX ne '812'  and DJLX ne '609'
									 and  DJLX ne '302' and  DJLX ne '305' and  DJLX ne '306' and  DJLX ne '307' and  DJLX ne '315' and DJLX ne '512' 
									 and  DJLX ne '402' and  DJLX ne '403' and  DJLX ne '404' and  DJLX ne '416' and  DJLX ne '429' and DJLX ne '904'
									 and  DJLX ne '509' and DJLX ne '510' and  DJLX ne '513' and DJLX ne '515' and DJLX ne '507' and DJLX ne '511'
									 and  DJLX ne '604' and DJLX ne '905' and DJLX ne '906'  and DJLX ne '907' and DJLX ne '908'  and DJLX ne '901' 
									 and DJLX ne '803' and DJLX ne '804' and  DJLX ne '806' and DJLX ne '807' and DJLX ne '810' 
						   			 and  DJLX ne '905'  and DJLX ne '1003' and  DJLX ne '1004'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_sjmc', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_sjmc')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '810'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_ygfg', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_ygfg')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '811'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_yghb', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_yghb')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '812' or DJLX eq '609'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_ygbg', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_ygbg')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '507'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_tdsjmc_tddyzx', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_tdsjmc_tddyzx')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '402' or DJLX eq '403' or DJLX eq '404'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_fwjzwsyqbg', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_fwjzwsyqbg')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '307'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_tdsjmc_zjdsyqzy', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_tdsjmc_zjdsyqzy')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '306'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_tdsjmc_jtjssyqzy', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_tdsjmc_jtjssyqzy')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '305'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_tdsjmc_gyjssyqzy', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_tdsjmc_gyjssyqzy')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '207' or DJLX eq '220'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_cs', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_cs')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '209' or DJLX eq '430' or DJLX eq '315' or DJLX eq '605'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_tdsjmc_tddy', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_tdsjmc_tddy')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '511' or DJLX eq '512'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_ygzx', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_ygzx')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '213' or DJLX eq '427' or DJLX eq '428' or DJLX eq '431' or DJLX eq '606' or DJLX eq '316'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">											
										<option value="3">${fns:getDictLabel('3', 'reg_bus_fwsjmc_zjgc', '')}</option>	
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_zjgc')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '302'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_zy', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_zy')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '416'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_bg_sjmc', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_bg_sjmc')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '429'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_qzxbg_sjmc', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_qzxbg_sjmc')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '1003' or DJLX eq '1004'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_bhz', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_bhz')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '905' or DJLX eq '906'  or DJLX eq '907'  or DJLX eq '908'  or DJLX eq '901'  or DJLX eq '904'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_cf', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_cf')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '604'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_gz', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_gz')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '803'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_ygyg', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_ygyg')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '804' or DJLX eq '807' or DJLX eq '432' or DJLX eq '819' or DJLX eq '607' or DJLX eq '818'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_ygdyyg', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_ygdyyg')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '806'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_zyyg', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_zyyg')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if> 
								<c:if test="${DJLX eq '214' or DJLX eq '215' or DJLX eq '433' or DJLX eq '422' or DJLX eq '317' or DJLX eq '318' or DJLX eq '608'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_ybzgedy', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_ybzgedy')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
								<c:if test="${DJLX eq '509' or DJLX eq '510' or DJLX eq '513' or DJLX eq '515'}">
									<select id="regBusSjchildList{{idx}}_sjmc" name="regBusSjchildList[{{idx}}].sjmc" style="width:460px" data-value="{{row.sjmc}}" class="input-small ">
										<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_dyzx', '')}</option>
										<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_dyzx')}" var="dict">
											<option value="${dict.value}">${dict.label}</option>
										</c:forEach>
									</select>
								</c:if>
							</td>
							<td width="50">
								<input id="regBusSjchildList{{idx}}_sjsl" name="regBusSjchildList[{{idx}}].sjsl" type="text" style="width:40px" value="{{row.sjsl}}" maxlength="4" class=""/>
							</td>
							<td width="40">
								<input id="regBusSjchildList{{idx}}_ys" name="regBusSjchildList[{{idx}}].ys" type="text" style="width:30px" value="{{row.ys}}" maxlength="4" class=""/>
							</td>
							<td>
								<input id="regBusSjchildList{{idx}}_sjfj" name="regBusSjchildList[{{idx}}].sjfj" type="hidden" value="{{row.sjfj}}" maxlength="100"/>
								<sys:ckfinder input="regBusSjchildList{{idx}}_sjfj" type="files" readonly="true" uploadPath="/reg/bus/regBusSjmain/${YEAR}/${MONTH}/${YWH}" selectMultiple="true"/>
							</td>
							
							
						</tr>//-->
					</script>
			<script type="text/javascript">
				var regBusSjchildRowIdx = 0, regBusSjchildTpl = $("#regBusSjchildTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
				$(document).ready(function() {
					var data = ${fns:toJson(regBusSjmain.regBusSjchildList)};
					for (var i=0; i<data.length; i++){
						addRow('#regBusSjchildList', regBusSjchildRowIdx, regBusSjchildTpl, data[i], '0');
						regBusSjchildRowIdx = regBusSjchildRowIdx + 1;
					}
				});
			</script>
			</div>
		</fieldset>
		<div class="form-actions">
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="javascript:window.close();"/>
		</div>
	</form:form>

</body>
</html>