<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
</head>
 <style type="text/css">
    body{min-width:180px;}
    	.btn{
    	  width: 100px;
    	}
    </style>
<body>
<div class="formbody">
		<input type="hidden" name="infoId" id="infoId" th:value="${infoId}" />
		<ul class="forminfo">
			<li>
				<label>新增数量:<b>*</b></label>
				<input type="number" id="num" class="dfinput fl" name="num"  value="1"/>
			</li>
			<li>
				<label>&nbsp;</label>
				<button type="submit" onclick="push_user();" class="btn">提交</button>
				<button type="button" class="btn" onclick="closeWin();">取消</button>
			</li>
		</ul>
</div>
</body>
<script type="text/javascript">

function push_user(){
	var content ="您确定要新增记录吗?";
	parent.layer.confirm(content, {
		icon: 4, btn: ['确定','关闭'] //按钮
	}, function(){
		var url="[[${sysUrl}]]/sys/lib/bookDetailSave";
		 var params ={
		            'infoId' : $("#infoId").val(),
		            'num' : $("#num").val()
		        };
		$.post(url,params,function(data){
			if(data.meta.success){
				parent.layer.msg("新增成功",{icon:1});
				closeWin();
			}else{
				parent.layer.msg(data.meta.message,{icon:11});
				closeWin();
			}
		});
	});
}
function closeWin(){
	parent.location.reload();
	parent.layer.close(parent.layer.getFrameIndex(window.name));
}
</script>
</html>