58aefba6853d7656857f4cd198ecc941b3d19ac3.svn-base 5.09 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() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function winOpenSj(id){
			//弹出窗口的宽度; 
			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/bus/regBusSjmain/form?id="+ id +"&VIEWS=1&DJLX=${DJLX}","newwindow",
					"height="+ iHeight +",width="+ iWidth +",top="+ iTop +",left="+ iLeft +",toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");
		}
		
		function winOpenUpdateSj(id){
			//弹出窗口的宽度; 
			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/bus/regBusSjmain/form?id="+ id+"&ywh=${regBusSjmain.ywh}&DJLX=${DJLX}","newwindow",
					"height="+ iHeight +",width="+ iWidth +",top="+ iTop +",left="+ iLeft +",toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");
		}
		
		function reloadSj(){
			var optype = "${optype}";
		    if(window.opener) {
		    	//新增 
		    	if(optype == undefined || optype == null || optype ==""){
	    			window.opener.document.sjframe.location.reload();
		    	}else{ //更新 
 		    		window.opener.parent.document.sjframe.location.reload();
		    	}
		    	window.close();
		    }
		}
		
		function deletesj(id, ywh){
			var url = "${ctx}/reg/bus/regBusSjmain/delete?id="+id+"&ywh="+ywh;
			if(confirm("确认要删除该收件信息吗?")){
				//发一个请求看当前是否已经添加过子信息了 
				$.ajax({ 
					type:"POST", 
					url:"${ctx}/reg/bus/regBusSjmain/issjsubed", 
					cache: false,
					data:"id="+id,
				    async : false,
					success:function(modelmap){
						var issjed = modelmap.data;
						if(issjed == "1"){
							alert("已存在收件资料!不能删除!可以通过修改先删除已添加的收件名称!");
							return;
						}else{
							window.location = url;
						}
					}
				});
			}
		}
		

	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="javascript:void(0);">收件信息列表</a></li>
		<!-- 
		<shiro:hasPermission name="reg:bus:regBusSjmain:edit"><li><a href="${ctx}/reg/bus/regBusSjmain/form">收件信息添加</a></li></shiro:hasPermission>
		 -->
	</ul>
	<!-- 
	<form:form id="searchForm" modelAttribute="regBusSjmain" action="${ctx}/reg/bus/regBusSjmain/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		
		<ul class="ul-form">
			<li><label>业务号:</label>
				<form:input path="ywh" htmlEscape="false" maxlength="20" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
		 
	</form:form>
	-->
	<c:if test="${not empty WO}">
		<br>
		<input id="reLoadSj" class="btn btn-primary" type="button" onclick="reloadSj();" value="退出列表"/>
		<br><br>
	</c:if>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<c:if test="${empty WO}">
					<th>业务号</th>
				</c:if> 
				<th>收件时间</th>
				<th>备注</th>
				<th>更新时间</th>
				<c:if test="${empty LISTVIEWS}">
				<shiro:hasPermission name="reg:bus:regBusSjmain:edit"><th>操作</th></shiro:hasPermission>
				</c:if>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="regBusSjmain">
			<tr>
				<c:if test="${empty WO}">
					<td>
					<shiro:hasPermission name="reg:bus:regBusQlr:view">
						<a href="javascript:void(0);" onclick="winOpenSj('${regBusSjmain.id}');">
							${regBusSjmain.ywh}
						</a>
					</shiro:hasPermission>
					</td>
				</c:if> 
				<td>
					<fmt:formatDate value="${regBusSjmain.sjsj}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${regBusSjmain.bz}
				</td>
				<td>
					<fmt:formatDate value="${regBusSjmain.updateDate}" pattern="yyyy-MM-dd"/>
				</td>
				<c:if test="${empty LISTVIEWS}">
				<shiro:hasPermission name="reg:bus:regBusSjmain:edit"><td>
					<a href="javascript:void(0);" onclick="winOpenUpdateSj('${regBusSjmain.id}');">修改</a>
					<a href="javascript:void(0);" onclick="deletesj('${regBusSjmain.id}', '${regBusSjmain.ywh}');">删除</a>
				</td></shiro:hasPermission>
				</c:if>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<!-- 
	<div class="pagination">${page}</div>
	 -->
</body>
</html>