destroy_routes.html 2.14 KB
<!-- 批量撤销选项 -->
<div class="modal fade" id="delete_select_modal" tabindex="-1"
	role="basic" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true"></button>
				<h4 class="modal-title">
					批量撤销选项
				</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" action="/" method="post"
					id="formBootbox" role="form">
					<div class="form-group">
						<label class="col-md-3 control-label">撤销选项:</label>
						<div class="col-md-9">
							<div class="icheck-list">
								<label>
									<input type="radio" name="deleteOptions" value="0" checked> 批量撤销站点
								</label>
								<label >
									<input type="radio" name="deleteOptions" value="1" > 批量撤销路段
								</label>
							</div>
						</div>
					 </div>			 
				</form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary"
						id="deleteSelectnextButton">下一步</button>
				<button type="button" class="btn default" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$('#delete_select_modal').on('modal.show',function(event) {
		$('#delete_select_modal').modal({
			show : true,
			backdrop : 'static',
			keyboard : false
			});
		var form = $('#formBootbox');
		$('#deleteSelectnextButton').on('click', function() {
			deleteOptions = $("input[name='deleteOptions']:checked").val();
			form.submit();
		});
		form.validate({
			submitHandler : function(f) {
				if(deleteOptions == 0) {
					// 撤销站点路由
					$('#delete_select_modal').modal('hide');
					$.get('destroy_stationroute.html', function(m){
						$(pjaxContainer).append(m);
						$('#delete_station_modal').trigger('modal.show');
					});
				} else if(deleteOptions == 1) {
					// 撤销路段路由
					$('#delete_select_modal').modal('hide');
					$.get('destroy_sectionroute.html', function(m){
						$(pjaxContainer).append(m);
						$('#delete_section_modal').trigger('modal.show');
					});
				}
				
			}
		});
	});
</script>