<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;}
       .select1{
   		    width:100%;
		    height: 32px;
		    line-height: 32px;
		    border-top: solid 1px #a7b5bc;
		    border-left: solid 1px #a7b5bc;
		    border-right: solid 1px #ced9df;
		    border-bottom: solid 1px #ced9df;
		    opacity:1;
	        margin-bottom: 10px;
    	}
    	.btn{
    	  width: 100px;
    	}
     label.control-label-error {color: Red;}	
    </style>
<body>
<div class="formbody">
		<ul class="forminfo">
			<li>
				<label>新增团购原价：<b>*</b></label>
				<input type="number" id="price" class="dfinput fl" name="price"  value="1"/>
			</li>
			<li>
				<label>新增团人数：<b>*</b></label>
				<input type="number" id="number" class="dfinput fl" name="number"  value="1"/>
			</li>
			<li>
				<label>新增团折扣：<b>*</b></label>
				<input type="number" id="discount" class="dfinput fl" name="discount"  value="1"/>
			</li>
			<!-- <li>
				<label>会员卡类型</label>
				<div class="vocation" style="margin-right: 5px; width: 200px">
					<select name="level" id="level" class="select1"> 
						<option value="1" >会员卡</option>
						<option value="5" >尊享卡</option>
					</select>
				</div>
			</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">
var libId='[[${param.libId}]]';
function push_user(){
	var content ="您确定要新增记录吗?";
	parent.layer.confirm(content, {
		icon: 4, btn: ['确定','关闭'] //按钮
	}, function(){
		var url="[[${sysUrl}]]/sys/group/salesGroupSave";
		 var params ={
		            'number' : $("#number").val(),
		            'discount' : $("#discount").val(),
		            'price' : $("#price").val(),
		            'libId':libId	
		        };
		$.post(url,params,function(data){
			if(data.meta.success){
				parent.layer.msg("新增成功",{icon:1});
				url="[[${sysUrl}]]/sys/group/geCode"	
				params ={
				           'discount' : $("#discount").val(),
				           'libId':libId,
				           'num':100
				        };
				$.post(url,params,function(data){
					
				});
				closeWin();
			}else{
				parent.layer.msg(data.meta.message,{icon:11});
				closeWin();
			}
		});
	});
}
function closeWin(){
	parent.location.href='[[${sysUrl}]]/sys/group/salesGroupPriceList.html?libId='+libId;
	//parent.layer.close(parent.layer.getFrameIndex(window.name));
}
</script>
</html>