bootstrap多模态框参考

<%@ 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() {
			//显示隐藏查询条件
			/* $("#btnSearch").click(function(e) {
				$("#searchFormDiv").toggle();
			}); */
			
			 $("#btnExport").click(function(){
				top.$.jBox.confirm('确认要导出数据吗?导出数据为查询结果集!', '系统提示', function(v,h,f){
					if (v == 'ok') {
						$("#searchForm").attr("action","${ctx}/project/project/exportFile?viewName=doneList");
						$("#searchForm").submit();
					}
					return true;
				});
			});  
		});
		
		
		
		/*模态框传值:将手机号码传到模态框中*/
		function sendValues(projectId,phoneNums){
			$("#projectId").val(projectId);
			if (phoneNums) {
				$("#phoneNums").val(phoneNums);
			}
		}
		
		/*发送短信*/
		function sendSms(){
			//校验手机号码及短信内容
			if ($("#phoneNums").val() == '') {
		    	top.$.jBox.tip("请输入手机号码!"); 
		        return false;
		    }
		    if ($("#smsContent").val() == '') {
		    	top.$.jBox.tip("请输入短信内容!"); 
		        return false;
		    }
		    //调用短信发送端口
		    $.ajax({  
		          url: ctx+'/project/smsSupervision/sendSms?projectId='+$("#projectId").val()+'&phone='+$("#phoneNums").val()+'&content='+$("#smsContent").val(),
		          type: 'POST', 
		          async : false,
		          success : function(data) {
		          	    if (data.code == "200") {
		          	    	$.jBox.tip("发送短信成功!","success");
						} else {
							top.$.jBox.tip('发送短信失败!');
						}
		          	  $("#smsModal").modal('hide');//关闭模态框
				}
		     });
		    
		}
		
		function resetSearch(){
			location.href = ctx+'/project/project/doneList';
		}
		
	</script>
	<style type="text/css">
		/*查询条件label大小*/
		.form-search .ul-form li label {width: 120px;text-align: right;}
		.text-center th{text-align:center;}
		td.align-center {text-align:center;}
	</style>
</head>
<body>
	<ul class="nav nav-tabs" style="display: none;">
		<li class="active"><a id="a_list_url" href="${ctx}/project/project/doneList">项目列表</a></li>
	</ul>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary" type="submit" onclick="return page();" value="查询"/>
				<!-- 导出Excel -->
				<input id="btnExport" class="btn btn-success" style="width: 100px;" type="button" value="导出Excel" />
				<input id="reset" class="btn" type="button" value="重置" onclick="resetSearch();"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<!-- 条件查询end -->
	
	<!-- 快速查询begin -->
	<!-- 快速查询end -->
	
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr class="text-center">
				<th width="2%">序号</th>
				<th width="12%">项目名称</th>
				<th width="4%">项目编号</th>
				<th width="4%">项目级别</th>
				<th width="10%">承建单位</th>
				<th width="8%">项目机构</th>
				<!-- <th>财政拨款(万元)</th>
				<th>自筹资金(万元)</th> -->
				<th width="4%">申报年度</th>
				<th width="4%">项目开始时间</th>
				<th width="4%">项目结束时间</th>
				<!-- <th>联系人</th>
				<th>联系电话</th>
				<th>负责人</th> -->
				<th width="10%">合作单位</th>
				<th width="5%">状态</th>
				<th width="13%">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="project" varStatus="st">
			<tr>
				<td class="align-center">${st.index+1}</td>
				<td>${project.name}</td>
				<td>${project.no}</td>
				<td class="align-center">
					${project.level}
				</td>
				<td>${project.constructionUnit}</td>
				<td>${project.type}</td>
				<%-- <td>${project.financeFunds}</td>
				<td>${project.selfFunds}</td> --%>
				<td class="align-center">${project.year}</td>
				<td class="align-center">
					<fmt:formatDate value="${project.startDate}" pattern="yyyy-MM-dd" />
				</td>
				<td class="align-center">
					<fmt:formatDate value="${project.endDate}" pattern="yyyy-MM-dd" />
				</td>
				<%-- <td>${project.linkman}</td>
				<td>${project.linkPhone}</td>
				<td>${project.principals}</td> --%>
				<td>${project.cooperateUnit}</td>
				<td  class="align-center">${project.linkName}</td>
				<td>
    				<a href="${ctx}/project/project/view?id=${project.id}">查看</a>
    				<!-- onclick事件实现传值 -->
    				<a href="#smsModal" data-toggle="modal" onclick="sendValues('${project.id}','${project.createUserMobile}');">短信发送</a>
    				<a href="#smsInfoModal" data-toggle="modal" onclick="showSmsInfo('${project.id}');">短信查看</a>
    				<!-- 按钮触发模态框 -->
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	<!-- 短信发送模态框及短信列表模态框 -->
	<%@include file="/WEB-INF/views/modules/project/smssupervision/smsModalInfo.jsp"%>
	
</body>
</html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!-- 模态框(Modal):短信发送 -->
<div class="modal fade" id="smsModal" tabindex="-1" role="dialog" aria-labelledby="smsModalLabel" aria-hidden="true" style="display:none;">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times; </button>
				<h4 class="modal-title" id="smsModalLabel"> 短信发送 </h4>
			</div>
			<div class="modal-body">
				<input id="projectId" type="hidden">
				<label style="width:170px;text-align: right;">手机号码(多个以","隔开): </label>
				<input style="width:60%;" id="phoneNums" type="text"  placeholder="请输入手机号码"><br>
				<label style="width:170px;text-align: right;">短信内容: </label>
				<textarea rows="3" style="width:60%;"  name="smsContent" id="smsContent" placeholder="请输入短信内容"></textarea>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-primary" onclick="sendSms();">发送</button>
			<button type="button" class="btn btn-default" data-dismiss="modal">关闭 </button>
		</div>
	</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>

<!-- 模态框(Modal):短信列表信息 -->
<div class="modal fade" id="smsInfoModal" tabindex="-1" role="dialog" aria-labelledby="smsInfoModalLabel" aria-hidden="true"   style="display:none;"
	style="width: 800px;margin-left: -400px;">
	<div class="modal-dialog">
		<div class="modal-content">
			<!-- 框头 -->
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times; </button>
				<h5 class="modal-title" id="smsInfoModalLabel">短信列表信息 </h5>
			</div>
			<!-- 框正文 -->
			<div class="modal-body">
				<table id="table" class="table table-striped table-bordered table-condensed">
					<thead>
						<tr class="text-center">
							<th width="12%">项目名称</th>
							<th width="12%">接收人</th>
							<th width="12%">手机号码</th>
							<th width="12%">短信内容</th>
							<th width="12%">发送人</th>
							<th width="12%">发送时间</th>
							<th width="12%">状态</th>
						</tr>
					</thead>
					<tbody id="tbody_tr">
					</tbody>
					</table>
			</div>
			<!-- 框尾 -->
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭 </button>
			</div>
		</div>
</div>
</div>

<script type="text/javascript">
	function showSmsInfo(projectId){
		$('#smsInfoModal').on('show.bs.modal', function () {
			$.ajax({  
		          url: ctx+'/project/smsSupervision/listByProjectId?projectId='+projectId,
		          type: 'POST', 
		          async : false,
		          success : function(data) {
		        	  if(data.code == "200"){
						  var list = data.list;
						  var html = [];
						  for(var i=0;i<list.length;i++){
							  	html.push("<tr>");
						   		html.push("<td width='3%'>"+list[i].projectName+"</td>");
						   		html.push("<td width='1%'>"+list[i].receiveMan+"</td>");
						   		html.push("<td width='1%'>"+list[i].phone+"</td>");
						   		html.push("<td width='2%'>"+list[i].content+"</td>");
						   		html.push("<td width='2%'>"+list[i].sendManId+"</td>"); 
						   		html.push("<td  width='2%'>"+list[i].sendTime+"</td>");
						   		//1 已发送、-1 发送失败
						   		if (list[i].status == '1') {
						   			html.push("<td width='1%'>已发送</td>");
						   		} else {
						   			html.push("<td width='1%'>发送失败</td>");
						   			
						   		}
						   		html.push("</tr>");
						   		
						  }
						 $("#tbody_tr").html(html);
					  }
				  }
		     });	
		});
	}
</script>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值