/**
 * 入驻历史
 * 2018/4/20 by liufang
 */
$(function(){
	var layer;
	var table;
	var ERROR_OK = 200;
	layui.use('layer', function(){
		   layer = layui.layer;  
	});
	var tpl = {
			"roomList": '<option value="">选择房间号</option><% for(var i=0;i<roomList.length;i++){%>\
				<option value="<%=roomList[i].roomInfo.id%>"><%=roomList[i].roomInfo.name%></option>\
			<%}%>'	,
			"floorsTpl":	  '<option value="">选择楼层</option><% for(var i=0;i<floorList.length;i++){%>\
				<option value="<%=floorList[i].id%>"><%=floorList[i].name%></option>\
				<%}%>',
				"datailTpl": '<div class="dialog-wp">\
					<div class="mask"></div>\
					<div class="dialog dialog-detail-con">\
						<div class="title-wp">\
							<span>入驻详情</span>\
							<span class="close-btn"></button>\
						</div>\
						<div class="dialog-detail-wp">\
							<div class="dialog-detail-header">\
								<div class="dialog-detail-top">\
									<h2 class="part-title">企业负责人信息</h2>\
									<div class="dialog-person-wp clearfloat">\
										<div class="dialog-person-item">\
											企业负责人1姓名：<%=remanName1%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人2姓名：<%=remanName2%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人1手机：<%=remanTel1%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人2手机：<%=remanTel2%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人1邮箱：<%=remanEmail1%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人2邮箱：<%=remanEmail2%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人1负责：<%if(isPushPower1==1){%> 账单推送 、 <%}%><%if(isReleasePower1==1){%>物品放行 <%}%>\
										</div>\
										<div class="dialog-person-item">\
											企业负责人2负责：<%if(isPushPower2==1){%> 账单推送 、<%}%><%if(isReleasePower2==1){%>物品放行 <%}%>\
										</div>\
									</div>\
								</div>\
								<div class="dialog-detail-middle">\
									<h2 class="part-title">企业证件信息</h2>\
									<div class="file-list clearfloat">\
										<div class="file-item">\
											<div class="file-item-img"><img class="img" src="<%=businessImageUrl%>"/></div>\
											<span class="file-item-name">营业执照</span>\
										</div>\
										<div class="file-item">\
											<div class="file-item-img"><img class="img" src="<%=powerAttorneyImageUrl%>"/></div>\
											<span class="file-item-name">法人代表授权委托书</span>\
										</div>\
										<div class="file-item">\
											<div class="file-item-img"><img class="img" src="<%=powerFaceImageUrl%>"/></div>\
											<span class="file-item-name">身份证人像面</span>\
										</div>\
										<div class="file-item">\
											<div class="file-item-img"><img class="img" src="<%=powerNationImageUrl%>"/></div>\
											<span class="file-item-name">身份证国徽面</span>\
										</div>\
									</div>\
								</div>\
								<div class="dialog-detail-bottom">\
									<div class="dialog-bill-type">账单推送方式：<%if(isWechat==1){%> 微信、 <%}%><%if(isMessage==1){%> 短信、 <%}%><%if(isEmail==1){%> 邮箱 <%}%></div>\
									<div class="dialog-remark-wp clearfloat">\
										<span class="tips">其他备注：</span>\
										<div class="remark-con"><%= otherRecord%></div>\
									</div>\
								</div>\
						   </div>\
							\
					   </div>		\
					</div>\
				</div>	',
				"repairTpl":  '<div class="dialog-wp">\
					<div class="mask"></div>\
					<div class="dialog dialog-repair-detail-con">\
						<div class="title-wp">\
							<span>维修详情</span>\
							<span class="close-btn"></button>\
						</div>\
						<div class="dialog-repair-detail-wp ">\
							<%if(data.length>0){%>\
								<% for(var i=0;i<data.length;i++){%>\
									<div class="dialog-repair-item clearfloat">\
										<div class="repair-num">维修单编号：<%=data[i].repairCode%></div>\
										<div class="repair-type">维修类型：<%=data[i].itemname%></div>\
									</div>\
								<%} %>\
							<%}else{%>\
								<div class="no-data">暂无维修详情</div>\
							<%}%>	\
					   </div>		\
					</div>\
				</div>	',
				"freeTpl":  '<div class="dialog-wp">\
					<div class="mask"></div>\
					<div class="dialog dialog-free-detail-con">\
						<div class="title-wp">\
							<span>水电信息</span>\
							<span class="close-btn"></button>\
						</div>\
						<div class="dialog-free-detail-wp ">\
								<div class="free-room-list clearfloat">\
									<% for(var i=0;i<floorAndRoomArr.length;i++){%>\
										<a href="javascript:void(0)" class="room-item <%if(i==0){%>active<%}%>" title="<%=floorAndRoomArr[i]%>"><%=floorAndRoomArr[i]%></a>\
									<%}%>  	\
								</div>\
							<%if(wateList.length>0){%>\
								<% for(var j=0;j<wateList.length;j++){%>\
									<div class="free-detail-list <%if(j==0){%> active <%}%>">\
										<div class="free-detail-item">\
											<div class="free-water-top">\
												<span class="tips">电表</span>\
												<span class="nums">电表读数：<%=wateList[j].materReading%></span>\
											</div>\
											<div class="free-water-img" >\
												<img class="img" src="<%=wateList[j].materImageUrl%>">\
											</div>\
										</div>\
										<div class="free-detail-item">\
											<div class="free-water-top">\
												<span class="tips">水表</span>\
												<span class="nums">水表读数：<%=wateList[j].wateReading%></span>\
											</div>\
											<div class="free-water-img">\
												<img class="img" src="<%=wateList[j].wateImageUrl%>">\
											</div>\
										</div>\
									</div>\
								<%}%>	\
							<%}else{ %>\
								<% for(var j=0;j<floorAndRoomArr.length;j++){%>\
									<div class="free-detail-list <%if(j==0){%> active <%}%>">\
										<div class="free-detail-item">\
											<div class="free-water-top">\
												<span class="tips">电表</span>\
												<span class="nums">电表读数：无</span>\
											</div>\
											\
										</div>\
										<div class="free-detail-item">\
											<div class="free-water-top">\
												<span class="tips">水表</span>\
												<span class="nums">水表读数：无</span>\
											</div>\
										</div>\
									</div>\
								<%}%>	\
						   <%} %>	\
					   </div>		\
					</div>\
				</div>	',
				"choosePersonTpl":  '<div class="dialog-wp">\
					<div class="mask"></div>\
					<div class="dialog dialog-choose-person-con">\
						<div class="title-wp">\
							<span>选择跟进客服</span>\
							<span class="close-btn"></button>\
						</div>\
						<div class="dialog-choose-person-wp ">\
							<div class="dialog-choose-person-header">\
								<h3 class="choose-person-title">客服</h3>\
								<div class="person-radio-list clearfloat">\
								<% for(var i=0;i<custlist.length;i++){%>\
									<div class="person-radio-item">\
										<div class="radio-wp" >\
											<span class="radio-input">\
												<input type="radio" id="person-<%=i%>"  class="radio-item"  data-id="<%=custlist[i].id%>"/>\
												<span class="radio-inner"></span>\
											</span>		\
											<label class="radio-con" for="person-<%=i%>"><%=custlist[i].name%></label>\
										</div>\
									</div>\
								<%}%>	\
								</div>\
							</div>\
							<div class="choose-person-footer">\
								<button class="btn-red sure-choose-person">确认</button>\
							</div>\
					   </div>		\
					</div>\
				</div>	',
				"chooseEngineerTpl":  '<div class="dialog-wp">\
					<div class="mask"></div>\
					<div class="dialog dialog-choose-person-con">\
						<div class="title-wp">\
							<span>选择跟进工程人员</span>\
							<span class="close-btn"></button>\
						</div>\
						<div class="dialog-choose-person-wp ">\
							<div class="dialog-choose-person-header">\
								<h3 class="choose-person-title">工程人员</h3>\
								<div class="person-radio-list clearfloat">\
								<% for(var i=0;i<data.length;i++){%>\
									<div class="person-radio-item">\
										<div class="radio-wp" >\
											<span class="radio-input">\
												<input type="radio" id="indate_<%=i%>" class="radio-item" data-id="<%=data[i].id%>"/>\
												<span class="radio-inner"></span>\
											</span>		\
											<label class="radio-con" for="indate_<%=i%>"><%=data[i].name%></label>\
										</div>\
									</div>\
								<%}%>	\
								</div>\
							</div>\
							<div class="choose-person-footer">\
								<button class="btn-red sure-choose-engineer">确认</button>\
							</div>\
					   </div>		\
					</div>\
				</div>	',
				"checkTpl":  '<div class="dialog-wp">\
					<div class="mask"></div>\
					<div class="dialog dialog-check-con">\
						<div class="title-wp">\
							<span>提示</span>\
							<span class="close-btn"></button>\
						</div>\
						<div class="dialog-check-wp ">\
							<div class="dialog-choose-person-header">\
								<h2 class="check-title">\
									<% if(type ==1){%>\
										通过入驻申请！\
									<% }else{ %>	\
										拒绝入驻申请！\
									<%}%>\
								</h2>\
								<div class="check-reason-wp clearfloat">\
									<span class="tips">\
										<% if(type ==1){%>\
											通过意见\
										<% }else{ %>	\
											拒绝意见\
										<%}%>\
									</span>\
									<textarea class="check-reason" placeholder="请输入意见"></textarea>\
								</div>\
							</div>\
							<div class="dialog-choose-person-footer">\
								<button class="btn-red sure-operate" data-type="<%=type%>">\
									<% if(type ==1){%>\
										确认通过\
									<% }else{ %>	\
										确认拒绝\
									<%}%>\
								</button>\
							</div>\
					   </div>		\
					</div>\
				</div>	'
	}
	var enterHistory = {
			init: function(){
				this.render();
				this.bindEvent();
			},
			render: function(){
				this.renderTable();
//				this.renderFloor(10);
			},
			bindEvent: function(){
				var _this = this;
				//查询
				$("#conditionform input[type='text']").on("keydown",function(event){
					if(event.keyCode == 13){
						$("#conditionform .search-btn").click();
					}
				});
				$("#conditionform .set-btn").on("click",function(){
					$("#conditionform select,#conditionform input").val("");
//					$("#conditionform .room-select ").html($("<option value=''>选择房间号</option>"))
				})
			},
			renderTable: function(){
				var _this = this;
				layui.use('table', function(){
					  table = layui.table;
					  
					  //方法级渲染
					  table.render({
					    elem: '#LAY_table_user',
					    method: 'post'
					    ,url: $("#contextPath").val()+ "/admin/enter/getEnterpriseList"
					    ,skin: 'nob' //行边框风格
				    		  ,even: true //开启隔行背景
				    		  ,size: 'lg' //小尺寸的表格
					    ,cols: [[
					      {
				    		   field:'enterNumber', 
				    		   title: '入驻单编号', 
				    		   minWidth: 200
				    	  },{
				    		  field:'createTime',
				    		  title: '申请时间',
				    		  minWidth: 200
			    		  },{
			    			  field:'virName', 
			    			  title: '公司名', 
			    			  minWidth: 200
		    			  },{
		    				  field:'applyName', 
		    				  title: '申请人',
		    				  minWidth: 200
		    				  
		  				  },{
		  					  field:'applyTel', 
		  					  title: '申请人手机',
		  					minWidth: 200
		  					 				 
		  				  },{
		  					  field:'roomNames', 
		  					  title: '申请房号',
		  						 minWidth: 200
		  					 
						  },{
							  field:'cutServiceName', 
							  title: '跟进客服',
							  minWidth: 200,
							  templet: function(data){
								  if(!data.cutServiceName){
									  return "无"
								  }else{
									  return data.cutServiceName
								  }
								 
							  }
							
						  },{
							  field:'engPersonName', 
							  title: '跟进工程人员',
							  minWidth: 200,
							  templet: function(data){
								  if(!data.engPersonName){
									  return "无"
								  }else{
									  return data.engPersonName
								  }
								  
							  }
							  
							
						  },{
							  field:'repairTypeName', 
							  title: '水电信息',
							  templet: function(data){
								  return "<span class='deep-blue-text check-water' data-id="+data.id+" >查看</span>"
							  }
							  
							
						  },{
							  field:'repairTypeName', 
							  title: '维修详情',
							  minWidth: 200,
							  templet: function(data){
								  return "<span class='deep-blue-text check-repair-detail'  data-id="+data.id+" >查看</span>"
							  }
							
						  },{
							  field:'repairTypeName', 
							  title: '入驻详情',
							  minWidth: 200,
							  templet: function(data){
								  return "<span class='deep-blue-text check-enter-detail'  data-id="+data.id+" >查看详情</span>"
							  }
							
						  },{
							  field:'id', 
							  title: '操作', 
							  minWidth: 200,
							  
							  templet: function(data){
								 if(data.status == 3){
									 return "<span class='light-black-text'>已通过</span>"
								 }else if(data.status == 4){
									 return "<span class='red-text'>已拒绝</span>"
								 }
							  }
						  }
						  ]]
						    ,id: 'testReload'
						    ,page: true,
						    response: {
						    	  statusName: 'code' //数据状态的字段名称，默认：code
						    	  ,statusCode: 200 //成功的状态码，默认：0
						    	  ,countName: "count"//数据总数的字段名称，默认：count
						    	  ,dataName: "data" //数据列表的字段名称，默认：data
						    	}   ,
						    	where: {
									virName: $("#conditionform .virName").val(),
									type: 1,//1企业迁入2企业迁出
									isHisList: 2 //1待处理2历史
								} ,
						    done: function(res, curr, count){
						        //如果是异步请求数据方式，res即为你接口返回的信息。
//						    	$(".layui-laypage-btn")[0].click(); 
						       //选择跟进客服
//						    	$(".choose-client").on("click",function(){
//						    		var id = $(this).data("id");
//						    		var type = $(this).data("type")
//						    		_this.showChooseClientDialog(id,type,function(){
//						    			$(".layui-laypage-btn")[0].click(); 
//						    		})
//						    	});
//						    	
//						    	//选择跟进工程人员
//						    	$(".choose-engineers").on("click",function(){
//						    		var id = $(this).data("id");
//						    		var type = $(this).data("type");
//						    		_this.showEngineerDialog(id,type,function(){
//						    			$(".layui-laypage-btn")[0].click(); 
//						    		})
//						    	});
						    	
						    	//查看水电信息
						    	$(".check-water").on("click",function(){
						    		var id = $(this).data("id");
						    		_this.showWaterDialog(id);
						    	});
						    	
						    	//查看维修详情
						    	$(".check-repair-detail").on("click",function(){
						    		var id = $(this).data("id");
						    		_this.showRepairDetailDialog(id);
						    	});
						    	//通过
						    	$(".t-publish-btn").on("click",function(){
						    		var id = $(this).data("id");
						    		var type = $(this).data("type");
						    		_this.showPassDialog(type,id)
						    	});
						    	//拒绝
						    	$(".t-reject-btn").on("click",function(){
						    		var id = $(this).data("id");
						    		var type = $(this).data("type");
						    		_this.showPassDialog(type,id)
						    	});
						    	//查看入驻详情
						    	$(".check-enter-detail").on("click",function(){
						    		var id = $(this).data("id");
						    		_this.showEnterDetailDialog(id)
						    	})
						      }
					  });
					  //查询
					  $('#conditionform  .search-btn').on('click', function(){
						  _this.againRenderTable();
					  });
					});
			},
			/*重新渲染table*/
			againRenderTable: function(){
				table.reload('testReload', {
					where: {
						virName: $("#conditionform .virName").val()
					} ,
					  page: {
					    curr: 1 //重新从第 1 页开始
					  }
				}); 
			},
			/**
			 * 获取客服人员
			 * @param enterId 入驻单id
			 * @param type 1跟进客服2跟进工程人员
			 * @param callback
			 */
//			showChooseClientDialog: function(enterId,type,callback){
//				var _this = this;
//				$.ajax({
//					   type: "post",
//					   url: $("#contextPath").val()+ "/admin/enter/getCustomerService", 
//					   data: {
//						   enterId: enterId,
//						   type: 2
//					   },
//					   success: function(data){
//						   if(data.code== ERROR_OK){
//							   $("body").append(template.render(tpl.choosePersonTpl)(data.data));
//							   $(".sure-choose-person").on("click",function(){
//								   var length = $(".dialog-wp ").find(".radio-item:checked").length;
//								   var pesonId = $(".dialog-wp ").find(".radio-item:checked").data("id");
//								   var $dom =  $(this).closest(".dialog-wp");
//								   if(length==0){
//									   layer.msg("请选择跟进客服")
//								   }else{
//									   _this.ajaxChoosePerson($dom,enterId,type,pesonId,callback)
//								   } 
//							   });
//							   $(".close-btn").on("click",function(){
//								   $(this).closest(".dialog-wp").remove();
//							   })
//						   }else{
//							   layer.msg(data.msg);
//						   }
//						  
//					   },
//					   error: function(){   
//					   }
//			   });
//			},
			/**
			 * 确定选择客服人员或者工程人员
			 * @param $dom 弹窗dom
			 * @param enterId
			 * @param type
			 * @param pesonId 客服人员id
			 * @param callback
			 */
//			ajaxChoosePerson($dom,enterId,type,pesonId,callback){
//				var _this = this;
//				$.ajax({
//					   type: "post",
//					   url: $("#contextPath").val()+ "/admin/enter/updateEnterPeson", 
//					   data: {
//						   enterId: enterId  ,
//						   type: type,
//						   pesonId: pesonId
//					   },
//					   success: function(data){
//						   if(data.code== ERROR_OK){
//							   $dom.remove();
//							  
//							   callback();
//							   if(type==1){
//								   layer.msg('选择跟进客服成功');
//							   }else{
//								   layer.msg('选择跟进工程人员成功');
//							   }
//							   
//						   }else{
//							   layer.msg(data.msg);
//						   }
//					   },
//					   error: function(){   
//					   }
//			   });
//			},
			/**
			 * 获取跟进维修人员
			 * @param enterId 入驻单id
			 * @param type 1跟进客服2跟进工程人员
			 * @param callback 
			 */
//			showEngineerDialog: function(enterId,type,callback){
//				var _this = this;
//				$.ajax({
//					   type: "post",
//					   url: $("#contextPath").val()+ "/admin/enter/getRepairTypeUser", 
//					   data: {
//						   enterId: enterId  
//					   },
//					   success: function(data){
//						   if(data.code== ERROR_OK){
//							   $("body").append(template.render(tpl.chooseEngineerTpl)(data));
//							   $(".sure-choose-engineer").on("click",function(){
//								   var length = $(".dialog-wp ").find(".radio-item:checked").length;
//								   var pesonId = $(".dialog-wp ").find(".radio-item:checked").data("id");
//								   var $dom =  $(this).closest(".dialog-wp");
//								   if(length==0){
//									   layer.msg("请选择跟进工程人员")
//								   }else{
//									   _this.ajaxChoosePerson($dom,enterId,type,pesonId,callback)
//								   } 
//							   });
//							   $(".close-btn").on("click",function(){
//								   $(this).closest(".dialog-wp").remove();
//							   })
//						   }else{
//							   layer.msg(data.msg);
//						   }
//					   },
//					   error: function(){   
//					   }
//			   });
//			},
			/**
			 * 获取水电信息
			 * @param enterId
			 */
			showWaterDialog: function(enterId){
				var _this = this;
				$.ajax({
					   type: "post",
					   url: $("#contextPath").val()+ "/admin/enter/getWaterList", 
					   data: {
						   enterId: enterId  
					   },
					   success: function(data){
						   if(data.code== ERROR_OK){
							   data.data.floorAndRoom = data.data.floorAndRoom.substring(0,data.data.floorAndRoom.length-1)
							   data.data.floorAndRoomArr = data.data.floorAndRoom.split("、")
							   $("body").append(template.render(tpl.freeTpl)(data.data));
							   $(".free-room-list .room-item").on("click",function(){
								   var index = $(this).index();
								   $(this).addClass("active").siblings().removeClass("active");
								   $(".free-detail-list").eq(index).addClass("active").siblings().removeClass("active");
							   })
							   $(".close-btn").on("click",function(){
								   $(this).closest(".dialog-wp").remove();
							   })
						   }else{
							   layer.msg(data.msg);
						   }
					   },
					   error: function(){   
					   }
			   });
			},
			/**
			 * 获取维修详情
			 * @param enterId
			 */
			showRepairDetailDialog: function(enterId){
				$.ajax({
					   type: "post",
					   url: $("#contextPath").val()+ "/admin/enter/getRepairNumberList", 
					   data: {
						   enterId: enterId  
					   },
					   success: function(data){
						   if(data.code== ERROR_OK){
							   $("body").append(template.render(tpl.repairTpl)(data));
							   $(".close-btn").on("click",function(){
								   $(this).closest(".dialog-wp").remove();
							   })
						   }else{
							   layer.msg(data.msg);
						   }   
					   },
					   error: function(){   
					   }
			   });
			},
			/**
			 * 是否显示通过和拒绝弹窗
			 * @param type 1通过0拒绝
			 * @param enterId
			 */
			showPassDialog: function(type,enterId){
				var _this = this;
				$.ajax({
					   type: "post",
					   url: $("#contextPath").val()+ "/admin/enter/isPowerButton", 
					   data: {
						   type: type,
						   enterId: enterId
					   },
					   success: function(data){
						   if(data.code== ERROR_OK){
							   if(data.data==2){
								   layer.alert("您暂无权限！")
							   }else{
								   $("body").append(template.render(tpl.checkTpl)({type: type}));
								   $(".close-btn").on("click",function(){
									   $(this).closest(".dialog-wp").remove();
								   });
								   $(".sure-operate").on("click",function(){
									   var $dom = $(this).closest(".dialog-wp")
									   _this.ajaxEnterReason($dom,type,enterId);
								   })
							   }
						   }else{
							   layer.msg(data.msg);
						   }   
					   },
					   error: function(){   
					   }
			   });
			},
			/**
			 * 发送拒绝或者通过原因
			 * @param $dom
			 * @param type
			 * @param enterId
			 */
			ajaxEnterReason: function($dom,type,enterId){
				var _this = this;
				var reason = $dom.find(".check-reason").val();
				if(!reason){
					layer.alert("请输入意见！");
					return false;
				}
				$.ajax({
					   type: "post",
					   url: $("#contextPath").val()+ "/admin/enter/setEnterReason", 
					   data: {
						   reason: reason,
						   enterId: enterId,
						   resonType: type
					   },
					   success: function(data){
						   if(data.code== ERROR_OK){
							   if(type==1){
								 layer.msg("通过成功！")  ;
							   }else{
								   layer.msg("拒绝成功！")
							   };
							   $dom.remove();
							   _this.againRenderTable();
						   }else{
							   layer.msg(data.msg);
						   }   
					   },
					   error: function(){   
					   }
			   });
			},
			/**
			 * 获取入驻详情
			 * @param id
			 */
			showEnterDetailDialog: function(enterId){
				$.ajax({
					   type: "post",
					   url: $("#contextPath").val()+ "/admin/enter/getEnterpriseInfo", 
					   data: {
						   enterId: enterId
					   },
					   success: function(data){
						   if(data.code== ERROR_OK){
							   $("body").append(template.render(tpl.datailTpl)(data.data));
							   $(".close-btn").on("click",function(){
								   $(this).closest(".dialog-wp").remove();
							   })
						   }else{
							   layer.msg(data.msg);
						   }   
					   },
					   error: function(){   
					   }
			   });
			}
			/**
			 * 渲染楼层列表
			 * @param id 楼栋id
			 */
//			renderFloor: function(id){
//				var _this = this;
//				 $.ajax({
//					   type: "post",
//					   url: $("#contextPath").val()+ "/admin/floor/getFloorList", 
//					   data: {
//						   "orgId": id
//					   },
//					   success: function(data){
//						   var result = JSON.parse(data);
//						   if(result.code == '200'){
//							   $(".floor-select").html(template.render(tpl.floorsTpl)({floorList: result.data}));
//							    //通过楼层筛选房间
//								$(".floor-select").on("change",function(e){
//									var floorId = $(this).val();
//									if(!floorId){
//										$(".room-select").html($("<option value=''>选择房间号<option>"))
//									}else{
//										_this.ajaxRoomList(floorId,$(".room-select"));
//									}
//								});
//						   }else{
//							   layer.alert(result.msg);
//						   }   
//					   },
//					   error: function(){   
//					   }
//				   });
//			},
//			/*
//			 * 请求房间信息 
//			 * @param floorId
//			 * @param $dom
//			 */
//			ajaxRoomList: function(floorId,$dom){
//				var _this = this;
//				 $.ajax({
//					   type: "post",
//					   url: $("#contextPath").val()+ "/admin/room/getRoomList", 
//					   data: {
//						   floorId: floorId
//					   },
//					   success: function(data){
//						   var data = JSON.parse(data);
//						   if(data.code == '200'){
//							   $dom.html(template.render(tpl.roomList)({roomList: data.data}));
//							  
//						   }   
//					   },
//					   error: function(){   
//					   }
//				   });
//			},
	};
	enterHistory.init();
})