$(function() {

	$("#submitBtn").click(function(){
		var _request = HttpRest+"user/save.shtml";
		var adminId = $("#adminId").val();
		var name = $("#name").val();
		var status=$("#status").val();
		var roleIds = $("#txtGroupsSelect").val(); // 角色编号
		var email = $("#email").val();
		var phone = $("#phone").val();

		var params ={
				adminId:adminId,
				name:name,
				status:status,
				roleIds:roleIds,
				email:email,
				phone:phone
		};
		$.ajax({
			type: 'post', 
			url: _request, 
			dataType: "json",
			data:$.toJSON(params),   
			contentType:"application/json",
			success: function(data) { 
				if(data.code=='01'){
					//layer.msg('修改成功！',{icon: 1});
					layer.confirm('修改成功！是否关闭窗口?', function(index) {
						parent.grid.loadData();
						parent.layer.close(parent.pageii);
						return false;
					});
				}else{
					layer.msg('更新失败！',{icon: 5});
				}
			}
		});
	});

});
