$(function() {
	$("#submitBtn").click(function(){
		var roleId = $("#roleId").val();
		var roleName = $("#roleName").val();
		var state=$("#state").val();
		var roleSign = $("#roleSign").val(); // 角色编号
		var description = $("#description").val();

		var params ={
				roleId:roleId,
				roleName:roleName,
				state:state,
				roleSign:roleSign,
				description:description
		};

		var _URL = HttpRest+"system/role/save.shtml"; // 请求添加用户路径

		$.ajax({
			type: 'post', 
			url: _URL, 
			dataType: "json",
			data:$.toJSON(params),   
			contentType:"application/json",
			success: function(data) { 
				if(data.code=='01'){
					layer.confirm('添加成功！是否关闭窗口?', function(index) {
						parent.grid.loadData();
						parent.layer.close(parent.pageii);
						return false;
					});
				}else{
					layer.msg(data.msg,{icon: 5});
				}
			}
		});
	});
});

