<!DOCTYPE html>
<html lang=zh-cn>
<head>
	<meta charset=utf-8>
	<title>纵横计量支付系统</title>
	<meta name=description content=计量支付>
	<meta name=copyright content=smartcost.com.cn>
	<link rel=stylesheet href={{rootUrl}}global/css/bootstrap.css>
	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
	<script src={{rootUrl}}global/js/bootstrap.js></script>
	<script src={{rootUrl}}global/js/jl.js></script>
</head>
<body>
<div class="wrapHeader">
	<h1 class="mainLogo" title="纵横计量支付"></h1>
	<div class="sysTools"><a title="返回首页" href="index.html"><i class="icon-circle-arrow-left icon-white"></i></a>&nbsp;&nbsp;&nbsp;<a
			title="纵横官网" target="_blank" href="http://smartcost.com.cn"><i class="icon-home icon-white"></i></a></div>
</div>
<!-- include "top" -->
<div class="warpAdmin">
	<!-- include "menu" -->
	<div class="adminMain">
		<form class="form-horizontal">
			<fieldset>
				<legend>中间计量草图</legend>
				<!--软件生成报表-->
				<div class="form-group">
					<label class="col-sm-2 control-label">中间计量草图功能</label>
					<div class="col-sm-3">
						<!-- if {{imediateswitch}} == 0 -->
						<div class="btn-group">
							<button class="btn btn-default" data-status="on" title="开启中间计量草图">开启</button>
							<button class="btn btn-danger disabled" data-status="off" disabled="disabled">已关闭</button>
						</div>
						<!-- else -->
						<div class="btn-group">
							<button class="btn btn-success disabled" data-status="on"  disabled="disabled">已开启</button>
							<button class="btn btn-default" data-status="off" title="关闭">关闭</button>
						</div>
						<!-- endif -->
						<a data-toggle="modal" href="#help1">帮助</a>
					</div>
				</div>
			</fieldset>
		</form>
	</div>
</div>
</div>
<!-- 帮助1弹出 -->
<div id="help1" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-body">
				<div class="alert alert-info">
					此开关用于开启关闭中间计量草图功能入口
				</div>
				<div>
					<img src="{{rootUrl}}global/images/intermediate-help1.png">
					<img src="{{rootUrl}}global/images/intermediate-help2.png">
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">autoFlashHeight();</script>
<script>
	$(function(){
		$('.form-group .btn').on('click',function(){
			var status = $(this).attr('data-status').split("_");
			if(!$(this).hasClass('disabled')){
				if(status[0] == 'on'){
					$(this).addClass('btn-success').removeClass('btn-default').text('已开启');
					$(this).siblings('button').removeClass('btn-danger').addClass('btn-default').text('关闭');
				}else{
					$(this).addClass('btn-danger').removeClass('btn-default').text('已关闭');
					$(this).siblings('button').removeClass('btn-success').addClass('btn-default').text('开启');
				}
				$(this).addClass('disabled').attr('disabled', true);
				$(this).siblings('button').removeClass('disabled').attr('disabled',false);
			}
			$.ajax({
				type: 'post',
				url: '/manage/sys/intermediate/switch',
				data:{switch:status[0]},
				dataType: 'json',
				success: function(result){

				}
			});
			return false;
		})
	})
</script>
</body>