var whzl = whzl || {};
whzl.basePath = '<%=basePath%>';
$("#housefold").click(function(){
if($("div[name='house']").is(':hidden')){
$("div[name='house']").slideToggle();
$('#housefold1').toggleClass('fa-angle-double-down fa-angle-double-up');
}else{
$("div[name='house']").slideToggle();
$('#housefold1').toggleClass('fa-angle-double-up fa-angle-double-down');
}
});
$("#peoplefold").click(function(){
if($("div[name='people']").is(':hidden')){
$("div[name='people']").slideToggle();
$('#peoplefold1').toggleClass('fa-angle-double-down fa-angle-double-up');
}else{
$("div[name='people']").slideToggle();
$('#peoplefold1').toggleClass('fa-angle-double-up fa-angle-double-down');
}
});
var yaohaoId = null;
//人员属性
var securityPersonArray = null;
var securityPersonIndex = -1;
var currentIds = null;
var isJumps = false;
var yaohaoNos = null;
$(function() {
yaohaoId = $("#yaohaoId").val();
getSecurityPersonArray();
$('#yaohaoItemDataGrid').datagrid({
rownumbers:false,
border:false,
sortOrder:'desc',
url:'yaohaoAction_listYaohaoItemByYaohaoId?yaohaoItem.yaohao.id='+yaohaoId,
checkOnSelect:true,
selectOnCheck:false,
loadFilter:function(result){
if(result.success){
return result.obj;
}else{
$.messager.alert("提示",result.message);
return ;
}
}
});
});
/**房屋地址*/
var houseAddressFormatter = function(value , row , index){
if(row.house!=null){
return row.house.address;
}else{
return "";
}
};
/**人员姓名*/
var securityPersonNameFormatter = function(value , row , index){
if(row.securityPerson!=null){
return row.securityPerson.name;
}else{
return "";
}
};
/**人员IdCard*/
var securityPersonIdCardFormatter = function(value , row , index){
if(row.securityPerson!=null){
return row.securityPerson.idCard;
}else{
return "";
}
};
/**房屋摇号*/
var houseYaohaoFormatter = function(value , row , index){
if(row.house!=null){
return "";
}else{
return "房源摇号";
}
};
/**
* 房源摇号
* @param id
* @return
*/
var houseYaohao = function(securityPersonId,securityNum,securityPersonName){
var roomType = null;
if(securityNum >=3){
roomType = 2;
}else{
roomType = 1;
}
$.ajax({
type: "post",//使用post方法访问后台
dataType: "json",//返回json格式的数据
url: "yaohaoAction_listCommunityByYaohaoId",//要访问的后台地址
data:{"yaohaoId":yaohaoId ,"roomType" :roomType },
success: function(msg){//msg为返回的数据,在这里做数据绑定
if(msg.success){
communityArray = msg.obj.rows;
$("#communityList").children().remove();
$("#currentPersonName").text(securityPersonName);
if(securityNum >= 3){
$("#currentRoomType").text("二居室");
$("#currentRoomType1").text("二居室");
}else{
$("#currentRoomType").text("一居室");
$("#currentRoomType1").text("一居室");
}
for(i=0;i