diff --git a/src/main/java/com/cm/population/controller/api/house/HouseController.java b/src/main/java/com/cm/population/controller/api/house/HouseController.java index 0188357..880bf08 100644 --- a/src/main/java/com/cm/population/controller/api/house/HouseController.java +++ b/src/main/java/com/cm/population/controller/api/house/HouseController.java @@ -1,5 +1,6 @@ package com.cm.population.controller.api.house; +import com.alibaba.excel.EasyExcel; import com.cm.common.annotation.CheckRequestBodyAnnotation; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; @@ -18,6 +19,10 @@ import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -151,4 +156,50 @@ public class HouseController extends AbstractController { return new SuccessResult(); } + @ApiOperation(value = "导出excel", notes = "导出excel接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("export") + public void excelPersonScore(HttpServletResponse response) throws Exception { + Map params = requestParams(); + + String excelName = "房屋数据"; + String fileName = URLEncoder.encode(excelName, "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + + String [] headers = {"街道名称","社区名称","小区名称","楼/排名称","所在单元/列","所在层/院","门牌号","房主名称","证件号码","联系电话", + "托管人姓名","证件号码","联系电话","与房主关系","自住","出租","空房"}; + List> listHeader = new ArrayList<>(); + for(String item : headers) { + List title = new ArrayList<>(); + title.add(item); + listHeader.add(title); + } + + List list = list(); + List> listData = new ArrayList<>(); + for (HouseDTO dto : list) { + List data = new ArrayList<>(); + data.add(dto.getStreetName()); + data.add(dto.getCommunityName()); + data.add(dto.getResidentialName()); + data.add(dto.getBuildingName()); + data.add(dto.getAffiliationUnit()); + data.add(dto.getAffiliationFloors()); + data.add(dto.getHouseNum()); + data.add(dto.getHomeowner()); + data.add(dto.getDocumentNum()); + data.add(dto.getPhone()); + data.add(dto.getCustodian()); + data.add(dto.getCustodianDocumentNum()); + data.add(dto.getCustodianPhone()); + data.add(dto.getRelationshipHomeowner()); + data.add((dto.getIsSelf() != null && dto.getIsSelf() == 1) ? "是": "否"); + data.add((dto.getIsRental() != null && dto.getIsRental() == 1) ? "是": "否"); + data.add((dto.getIsVacant() != null && dto.getIsVacant() == 1) ? "是": "否"); + listData.add(data); + } + + EasyExcel.write(response.getOutputStream()).sheet("房屋数据").head(listHeader).doWrite(listData); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java b/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java index 2456dde..1129e19 100644 --- a/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java @@ -1,5 +1,6 @@ package com.cm.population.pojo.dtos.house; +import com.cm.common.annotation.CheckNumberAnnotation; import com.cm.population.pojo.dtos.population.PopulationDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -131,6 +132,12 @@ public class HouseDTO { private List populationDTOList; @ApiModelProperty(name = "count", value = "房屋人员") private Integer count; + @ApiModelProperty(name = "isSelf", value = "是否自住房") + private Integer isSelf; + @ApiModelProperty(name = "ownerPopulationId", value = "房主人口ID") + private String ownerPopulationId; + @ApiModelProperty(name = "custodianPopulationId", value = "托管人人口ID") + private String custodianPopulationId; public String getHouseId() { return houseId; @@ -587,4 +594,28 @@ public class HouseDTO { public void setCount(Integer count) { this.count = count; } + + public Integer getIsSelf() { + return isSelf; + } + + public void setIsSelf(Integer isSelf) { + this.isSelf = isSelf; + } + + public String getOwnerPopulationId() { + return ownerPopulationId; + } + + public void setOwnerPopulationId(String ownerPopulationId) { + this.ownerPopulationId = ownerPopulationId; + } + + public String getCustodianPopulationId() { + return custodianPopulationId; + } + + public void setCustodianPopulationId(String custodianPopulationId) { + this.custodianPopulationId = custodianPopulationId; + } } diff --git a/src/main/java/com/cm/population/pojo/vos/house/HouseVO.java b/src/main/java/com/cm/population/pojo/vos/house/HouseVO.java index 6a28045..0662ec1 100644 --- a/src/main/java/com/cm/population/pojo/vos/house/HouseVO.java +++ b/src/main/java/com/cm/population/pojo/vos/house/HouseVO.java @@ -119,6 +119,13 @@ public class HouseVO { private String streetName; @ApiModelProperty(name = "populationVOList", value = "同住人信息") private List populationVOList; + @ApiModelProperty(name = "isSelf", value = "是否自住房") + @CheckNumberAnnotation(name = "是否自住房") + private Integer isSelf; + @ApiModelProperty(name = "ownerPopulationId", value = "房主人口ID") + private String ownerPopulationId; + @ApiModelProperty(name = "custodianPopulationId", value = "托管人人口ID") + private String custodianPopulationId; public String getCommunity() { return community == null ? "" : community.trim(); @@ -495,4 +502,28 @@ public class HouseVO { public void setPopulationVOList(List populationVOList) { this.populationVOList = populationVOList; } + + public Integer getIsSelf() { + return isSelf; + } + + public void setIsSelf(Integer isSelf) { + this.isSelf = isSelf; + } + + public String getOwnerPopulationId() { + return ownerPopulationId; + } + + public void setOwnerPopulationId(String ownerPopulationId) { + this.ownerPopulationId = ownerPopulationId; + } + + public String getCustodianPopulationId() { + return custodianPopulationId; + } + + public void setCustodianPopulationId(String custodianPopulationId) { + this.custodianPopulationId = custodianPopulationId; + } } diff --git a/src/main/resources/mybatis/mapper/house/house-mapper.xml b/src/main/resources/mybatis/mapper/house/house-mapper.xml index e386425..db2348f 100644 --- a/src/main/resources/mybatis/mapper/house/house-mapper.xml +++ b/src/main/resources/mybatis/mapper/house/house-mapper.xml @@ -58,6 +58,9 @@ + + + @@ -220,14 +223,17 @@ affiliated_unit, is_rental, is_vacant, + is_self, lodge_type_id, lodge_type_name, rental_purposes, + owner_population_id, homeowner, document_id, document_name, document_num, phone, + custodian_population_id, custodian, custodian_document_id, custodian_document_name, @@ -272,14 +278,17 @@ #{affiliatedUnit}, #{isRental}, #{isVacant}, + #{isSelf}, #{lodgeTypeId}, #{lodgeTypeName}, #{rentalPurposes}, + #{ownerPopulationId}, #{homeowner}, #{documentId}, #{documentName}, #{documentNum}, #{phone}, + #{custodianPopulationId}, #{custodian}, #{custodianDocumentId}, #{custodianDocumentName}, @@ -420,6 +429,9 @@ is_vacant = #{isVacant}, + + is_self = #{isSelf}, + lodge_type_id = #{lodgeTypeId}, @@ -429,6 +441,9 @@ rental_purposes = #{rentalPurposes}, + + owner_population_id = #{ownerPopulationId}, + homeowner = #{homeowner}, @@ -444,6 +459,9 @@ phone = #{phone}, + + custodian_population_id = #{custodianPopulationId}, + custodian = #{custodian}, @@ -504,14 +522,17 @@ t1.affiliated_unit, t1.is_rental, t1.is_vacant, + t1.is_self, t1.lodge_type_id, t1.lodge_type_name, t1.rental_purposes, + t1.owner_population_id, t1.homeowner, t1.document_id, t1.document_name, t1.document_num, t1.phone, + t1.custodian_population_id, t1.custodian, t1.custodian_document_id, t1.custodian_document_name, @@ -696,14 +717,17 @@ t1.affiliated_unit, t1.is_rental, t1.is_vacant, + t1.is_self, t1.lodge_type_id, t1.lodge_type_name, t1.rental_purposes, + t1.owner_population_id, t1.homeowner, t1.document_id, t1.document_name, t1.document_num, t1.phone, + t1.owner_population_id, t1.custodian, t1.custodian_document_id, t1.custodian_document_name, @@ -762,6 +786,9 @@ AND is_vacant = #{isVacant} + + AND is_self = #{isSelf} + AND ( t1.house_num LIKE CONCAT('%', #{keywords}, '%') diff --git a/src/main/resources/templates/house/list.html b/src/main/resources/templates/house/list.html index e4604ae..e44888a 100644 --- a/src/main/resources/templates/house/list.html +++ b/src/main/resources/templates/house/list.html @@ -5,37 +5,188 @@ - + @@ -75,19 +226,43 @@
-
- -
- 新增时间 -
- -
-
- -
- +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ + + + +
@@ -96,10 +271,12 @@ - -
@@ -116,7 +293,7 @@ base: 'assets/layuiadmin/' }).extend({ index: 'lib/index' - }).use(['index', 'table', 'laydate', 'common', 'select'], function() { + }).use(['index', 'table', 'laydate', 'common', 'select'], function () { var $ = layui.$; var $win = $(window); var table = layui.table; @@ -125,9 +302,38 @@ var common = layui.common; var resizeTimeout = null; var select = layui.select; + var form = layui.form; var tableUrl = 'api/house/listpage'; - var event = function() { + $(document).on('click', '#excel', function() { + excel(); + }); + + function excel(){ + var street = selectedRelation.street; + var community = selectedRelation.community; + var residentialId = selectedRelation.housingEstate; + var buildingId = selectedRelation.buildingId; + var isSelf = $('#isSelf').val(); + var isVacant = $('#isVacant').val(); + var isRental = $('#isRental').val(); + + + + top.dialog.msg('确定要导出数据吗?', { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function (index) { + top.dialog.close(index); + window.open(top.restAjax.path('api/house/export?street={street}&community={community}&residentialId={residentialId}&' + + 'buildingId={buildingId}&isSelf={isSelf}&isVacant={isVacant}&isRental={isRental}', + [street, community, residentialId, buildingId, isSelf, isVacant, isRental])); + } + }); + } + + var event = function () { $(document).on('click', '#treeBody ul li', function () { var $lis = $('#treeBody ul li'); $lis.filter('.active').removeClass('active'); @@ -171,7 +377,7 @@ data: [] } - var initStreetSelect = function() { + var initStreetSelect = function () { select.dataDynamic({ url: 'api/residential/getStreetList', name: 'streetId', @@ -181,9 +387,9 @@ where: {}, selectedValue: '', optionDatasetKeyArray: [], - onSelect: function(data, option) { + onSelect: function (data, option) { selectedRelation.street = data.value; - if(data.value) { + if (data.value) { $('#streetName').val(option.innerHTML); } else { $('#streetName').val(''); @@ -195,10 +401,10 @@ }) } - var initCommunitySelect = function() { + var initCommunitySelect = function () { selectedRelation.community = ''; var $communityBox = $('#communityBox'); - if(!selectedRelation.street) { + if (!selectedRelation.street) { $communityBox.hide(); return; } @@ -212,9 +418,9 @@ where: {areaId: selectedRelation.street}, selectedValue: '', optionDatasetKeyArray: [], - onSelect: function(data, option) { + onSelect: function (data, option) { selectedRelation.community = data.value; - if(data.value) { + if (data.value) { $('#communityName').val(option.innerHTML); } else { $('#communityName').val(''); @@ -227,10 +433,10 @@ }) } - var initHousingEstateSelect = function() { + var initHousingEstateSelect = function () { selectedRelation.housingEstate = ''; var $housingEstateBox = $('#housingEstateBox'); - if(!selectedRelation.community) { + if (!selectedRelation.community) { $housingEstateBox.hide(); return; } @@ -244,9 +450,9 @@ where: {street: selectedRelation.street, community: selectedRelation.community}, selectedValue: '', optionDatasetKeyArray: [], - onSelect: function(data, option) { + onSelect: function (data, option) { selectedRelation.housingEstate = data.value; - if(data.value) { + if (data.value) { $('#housingEstateName').val(option.innerHTML); } else { $('#housingEstateName').val(''); @@ -259,7 +465,7 @@ }) } - var initBuilding = function() { + var initBuilding = function () { selectedRelation.buildingId = ''; top.restAjax.get(top.restAjax.path('api/building/listpage', []), { page: buildingPager.currentPage, @@ -267,35 +473,35 @@ street: selectedRelation.street, community: selectedRelation.community, residentialId: selectedRelation.housingEstate - }, null, function(code, data) { + }, null, function (code, data) { buildingPager.currentPage = data.page; buildingPager.datas = data.rows; buildingPager.total = data.total; - buildingPager.totalPage = buildingPager.total % buildingPager.rows === 0? buildingPager.total / buildingPager.rows : Math.floor(buildingPager.total / buildingPager.rows) + 1; + buildingPager.totalPage = buildingPager.total % buildingPager.rows === 0 ? buildingPager.total / buildingPager.rows : Math.floor(buildingPager.total / buildingPager.rows) + 1; renderBuilding(); - }, function(code, data) { + }, function (code, data) { top.dialog.msg(data.msg); }) } - var renderBuilding = function() { - var renderBuildingLise = function() { + var renderBuilding = function () { + var renderBuildingLise = function () { var lis = ''; - $.each(buildingPager.datas, function(index, item) { + $.each(buildingPager.datas, function (index, item) { lis += `
  • ${item.name}
  • `; }); var $treeBody = $('#treeBody'); $treeBody.empty(); - if(lis) { + if (lis) { $treeBody.append(`楼/排列表
      ${lis}
    `); } else { $treeBody.append('
    暂无数据
    ') } } - var renderPageBtn = function() { + var renderPageBtn = function () { var $buildingPageBtnGroup = $('#buildingPageBtnGroup'); - if(buildingPager.totalPage > 1) { + if (buildingPager.totalPage > 1) { $buildingPageBtnGroup.show(); } else { $buildingPageBtnGroup.hide(); @@ -306,7 +512,7 @@ renderPageBtn(); } - var newInitTableResidential = function(url) { + var newInitTableResidential = function (url) { table.render({ elem: '#dataTable', id: 'dataTable', @@ -322,297 +528,337 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, - {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'communityName', width: 180, title: '社区名称', align:'center', - templet: function(row) { + {type: 'checkbox', fixed: 'left'}, + { + field: 'rowNum', + width: 80, + title: '序号', + fixed: 'left', + align: 'center', + templet: '{{d.LAY_INDEX}}' + }, + { + field: 'communityName', width: 180, title: '社区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'residentialName', width: 180, title: '小区名称', align:'center', - templet: function(row) { + { + field: 'residentialName', width: 180, title: '小区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingName', width: 180, title: '楼/排名称', align:'center', - templet: function(row) { + { + field: 'buildingName', width: 180, title: '楼/排名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationUnit', width: 180, title: '所在单元/列', align:'center', - templet: function(row) { + { + field: 'affiliationUnit', width: 180, title: '所在单元/列', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationFloors', width: 180, title: '所在层/院', align:'center', - templet: function(row) { + { + field: 'affiliationFloors', width: 180, title: '所在层/院', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseNum', width: 180, title: '门牌号', align:'center', - templet: function(row) { + { + field: 'houseNum', width: 180, title: '门牌号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'categoryName', width: 180, title: '房屋类别', align:'center', - templet: function(row) { + { + field: 'categoryName', width: 180, title: '房屋类别', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'natureName', width: 180, title: '房屋性质', align:'center', - templet: function(row) { + { + field: 'natureName', width: 180, title: '房屋性质', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'typeName', width: 180, title: '房屋种类', align:'center', - templet: function(row) { + { + field: 'typeName', width: 180, title: '房屋种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'structureName', width: 180, title: '房屋结构', align:'center', - templet: function(row) { + { + field: 'structureName', width: 180, title: '房屋结构', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingPurposeName', width: 180, title: '建筑用途', align:'center', - templet: function(row) { + { + field: 'buildingPurposeName', width: 180, title: '建筑用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomNum', width: 180, title: '房间数量', align:'center', - templet: function(row) { + { + field: 'roomNum', width: 180, title: '房间数量', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomArea', width: 180, title: '房屋面积', align:'center', - templet: function(row) { + { + field: 'roomArea', width: 180, title: '房屋面积', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomUseName', width: 180, title: '房屋用途', align:'center', - templet: function(row) { + { + field: 'roomUseName', width: 180, title: '房屋用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'dangerName', width: 180, title: '隐患类型', align:'center', - templet: function(row) { + { + field: 'dangerName', width: 180, title: '隐患类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'certificateNum', width: 180, title: '产权证号', align:'center', - templet: function(row) { + { + field: 'certificateNum', width: 180, title: '产权证号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'registrationDate', width: 180, title: '登记日期', align:'center', - templet: function(row) { + { + field: 'registrationDate', width: 180, title: '登记日期', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliatedUnit', width: 180, title: '所属单位', align:'center', - templet: function(row) { + { + field: 'affiliatedUnit', width: 180, title: '所属单位', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isRental', width: 180, title: '是否出租屋', align:'center', - templet: function(row) { + { + field: 'isRental', width: 180, title: '是否出租屋', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isVacant', width: 180, title: '是否空置房', align:'center', - templet: function(row) { + { + field: 'isVacant', width: 180, title: '是否空置房', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'lodgeTypeName', width: 180, title: '租住类型', align:'center', - templet: function(row) { + { + field: 'lodgeTypeName', width: 180, title: '租住类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'rentalPurposes', width: 180, title: '出租用途', align:'center', - templet: function(row) { + { + field: 'rentalPurposes', width: 180, title: '出租用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'homeowner', width: 180, title: '房主名称', align:'center', - templet: function(row) { + { + field: 'homeowner', width: 180, title: '房主名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'documentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'documentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'phone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'phone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodian', width: 180, title: '托管人姓名', align:'center', - templet: function(row) { + { + field: 'custodian', width: 180, title: '托管人姓名', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'custodianDocumentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'custodianDocumentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianPhone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'custodianPhone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'relationshipHomeowner', width: 180, title: '与房主关系', align:'center', - templet: function(row) { + { + field: 'relationshipHomeowner', width: 180, title: '与房主关系', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align:'center', - templet: function(row) { - var rowData = '入住人员';; + { + field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align: 'center', + templet: function (row) { + var rowData = '入住人员'; + ; return rowData; } } ] ], page: true, - parseData: function(data) { + parseData: function (data) { return { 'code': 0, 'msg': '', @@ -623,7 +869,7 @@ }); } - var newInitTableStreet = function(url) { + var newInitTableStreet = function (url) { table.render({ elem: '#dataTable', id: 'dataTable', @@ -639,297 +885,337 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, - {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'communityName', width: 180, title: '社区名称', align:'center', - templet: function(row) { + {type: 'checkbox', fixed: 'left'}, + { + field: 'rowNum', + width: 80, + title: '序号', + fixed: 'left', + align: 'center', + templet: '{{d.LAY_INDEX}}' + }, + { + field: 'communityName', width: 180, title: '社区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'residentialName', width: 180, title: '小区名称', align:'center', - templet: function(row) { + { + field: 'residentialName', width: 180, title: '小区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingName', width: 180, title: '楼/排名称', align:'center', - templet: function(row) { + { + field: 'buildingName', width: 180, title: '楼/排名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationUnit', width: 180, title: '所在单元/列', align:'center', - templet: function(row) { + { + field: 'affiliationUnit', width: 180, title: '所在单元/列', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationFloors', width: 180, title: '所在层/院', align:'center', - templet: function(row) { + { + field: 'affiliationFloors', width: 180, title: '所在层/院', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseNum', width: 180, title: '门牌号', align:'center', - templet: function(row) { + { + field: 'houseNum', width: 180, title: '门牌号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'categoryName', width: 180, title: '房屋类别', align:'center', - templet: function(row) { + { + field: 'categoryName', width: 180, title: '房屋类别', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'natureName', width: 180, title: '房屋性质', align:'center', - templet: function(row) { + { + field: 'natureName', width: 180, title: '房屋性质', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'typeName', width: 180, title: '房屋种类', align:'center', - templet: function(row) { + { + field: 'typeName', width: 180, title: '房屋种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'structureName', width: 180, title: '房屋结构', align:'center', - templet: function(row) { + { + field: 'structureName', width: 180, title: '房屋结构', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingPurposeName', width: 180, title: '建筑用途', align:'center', - templet: function(row) { + { + field: 'buildingPurposeName', width: 180, title: '建筑用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomNum', width: 180, title: '房间数量', align:'center', - templet: function(row) { + { + field: 'roomNum', width: 180, title: '房间数量', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomArea', width: 180, title: '房屋面积', align:'center', - templet: function(row) { + { + field: 'roomArea', width: 180, title: '房屋面积', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomUseName', width: 180, title: '房屋用途', align:'center', - templet: function(row) { + { + field: 'roomUseName', width: 180, title: '房屋用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'dangerName', width: 180, title: '隐患类型', align:'center', - templet: function(row) { + { + field: 'dangerName', width: 180, title: '隐患类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'certificateNum', width: 180, title: '产权证号', align:'center', - templet: function(row) { + { + field: 'certificateNum', width: 180, title: '产权证号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'registrationDate', width: 180, title: '登记日期', align:'center', - templet: function(row) { + { + field: 'registrationDate', width: 180, title: '登记日期', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliatedUnit', width: 180, title: '所属单位', align:'center', - templet: function(row) { + { + field: 'affiliatedUnit', width: 180, title: '所属单位', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isRental', width: 180, title: '是否出租屋', align:'center', - templet: function(row) { + { + field: 'isRental', width: 180, title: '是否出租屋', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isVacant', width: 180, title: '是否空置房', align:'center', - templet: function(row) { + { + field: 'isVacant', width: 180, title: '是否空置房', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'lodgeTypeName', width: 180, title: '租住类型', align:'center', - templet: function(row) { + { + field: 'lodgeTypeName', width: 180, title: '租住类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'rentalPurposes', width: 180, title: '出租用途', align:'center', - templet: function(row) { + { + field: 'rentalPurposes', width: 180, title: '出租用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'homeowner', width: 180, title: '房主名称', align:'center', - templet: function(row) { + { + field: 'homeowner', width: 180, title: '房主名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'documentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'documentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'phone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'phone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodian', width: 180, title: '托管人姓名', align:'center', - templet: function(row) { + { + field: 'custodian', width: 180, title: '托管人姓名', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'custodianDocumentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'custodianDocumentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianPhone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'custodianPhone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'relationshipHomeowner', width: 180, title: '与房主关系', align:'center', - templet: function(row) { + { + field: 'relationshipHomeowner', width: 180, title: '与房主关系', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align:'center', - templet: function(row) { - var rowData = '入住人员';; + { + field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align: 'center', + templet: function (row) { + var rowData = '入住人员'; + ; return rowData; } } ] ], page: true, - parseData: function(data) { + parseData: function (data) { return { 'code': 0, 'msg': '', @@ -940,7 +1226,7 @@ }); } - var newInitTableCommunity = function(url) { + var newInitTableCommunity = function (url) { table.render({ elem: '#dataTable', id: 'dataTable', @@ -956,297 +1242,337 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, - {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'communityName', width: 180, title: '社区名称', align:'center', - templet: function(row) { + {type: 'checkbox', fixed: 'left'}, + { + field: 'rowNum', + width: 80, + title: '序号', + fixed: 'left', + align: 'center', + templet: '{{d.LAY_INDEX}}' + }, + { + field: 'communityName', width: 180, title: '社区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'residentialName', width: 180, title: '小区名称', align:'center', - templet: function(row) { + { + field: 'residentialName', width: 180, title: '小区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingName', width: 180, title: '楼/排名称', align:'center', - templet: function(row) { + { + field: 'buildingName', width: 180, title: '楼/排名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationUnit', width: 180, title: '所在单元/列', align:'center', - templet: function(row) { + { + field: 'affiliationUnit', width: 180, title: '所在单元/列', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationFloors', width: 180, title: '所在层/院', align:'center', - templet: function(row) { + { + field: 'affiliationFloors', width: 180, title: '所在层/院', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseNum', width: 180, title: '门牌号', align:'center', - templet: function(row) { + { + field: 'houseNum', width: 180, title: '门牌号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'categoryName', width: 180, title: '房屋类别', align:'center', - templet: function(row) { + { + field: 'categoryName', width: 180, title: '房屋类别', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'natureName', width: 180, title: '房屋性质', align:'center', - templet: function(row) { + { + field: 'natureName', width: 180, title: '房屋性质', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'typeName', width: 180, title: '房屋种类', align:'center', - templet: function(row) { + { + field: 'typeName', width: 180, title: '房屋种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'structureName', width: 180, title: '房屋结构', align:'center', - templet: function(row) { + { + field: 'structureName', width: 180, title: '房屋结构', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingPurposeName', width: 180, title: '建筑用途', align:'center', - templet: function(row) { + { + field: 'buildingPurposeName', width: 180, title: '建筑用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomNum', width: 180, title: '房间数量', align:'center', - templet: function(row) { + { + field: 'roomNum', width: 180, title: '房间数量', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomArea', width: 180, title: '房屋面积', align:'center', - templet: function(row) { + { + field: 'roomArea', width: 180, title: '房屋面积', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomUseName', width: 180, title: '房屋用途', align:'center', - templet: function(row) { + { + field: 'roomUseName', width: 180, title: '房屋用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'dangerName', width: 180, title: '隐患类型', align:'center', - templet: function(row) { + { + field: 'dangerName', width: 180, title: '隐患类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'certificateNum', width: 180, title: '产权证号', align:'center', - templet: function(row) { + { + field: 'certificateNum', width: 180, title: '产权证号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'registrationDate', width: 180, title: '登记日期', align:'center', - templet: function(row) { + { + field: 'registrationDate', width: 180, title: '登记日期', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliatedUnit', width: 180, title: '所属单位', align:'center', - templet: function(row) { + { + field: 'affiliatedUnit', width: 180, title: '所属单位', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isRental', width: 180, title: '是否出租屋', align:'center', - templet: function(row) { + { + field: 'isRental', width: 180, title: '是否出租屋', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isVacant', width: 180, title: '是否空置房', align:'center', - templet: function(row) { + { + field: 'isVacant', width: 180, title: '是否空置房', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'lodgeTypeName', width: 180, title: '租住类型', align:'center', - templet: function(row) { + { + field: 'lodgeTypeName', width: 180, title: '租住类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'rentalPurposes', width: 180, title: '出租用途', align:'center', - templet: function(row) { + { + field: 'rentalPurposes', width: 180, title: '出租用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'homeowner', width: 180, title: '房主名称', align:'center', - templet: function(row) { + { + field: 'homeowner', width: 180, title: '房主名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'documentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'documentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'phone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'phone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodian', width: 180, title: '托管人姓名', align:'center', - templet: function(row) { + { + field: 'custodian', width: 180, title: '托管人姓名', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'custodianDocumentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'custodianDocumentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianPhone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'custodianPhone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'relationshipHomeowner', width: 180, title: '与房主关系', align:'center', - templet: function(row) { + { + field: 'relationshipHomeowner', width: 180, title: '与房主关系', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align:'center', - templet: function(row) { - var rowData = '入住人员';; + { + field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align: 'center', + templet: function (row) { + var rowData = '入住人员'; + ; return rowData; } } ] ], page: true, - parseData: function(data) { + parseData: function (data) { return { 'code': 0, 'msg': '', @@ -1257,7 +1583,7 @@ }); } - var newInitTableBuilding = function(url) { + var newInitTableBuilding = function (url) { table.render({ elem: '#dataTable', id: 'dataTable', @@ -1273,297 +1599,337 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, - {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'communityName', width: 180, title: '社区名称', align:'center', - templet: function(row) { + {type: 'checkbox', fixed: 'left'}, + { + field: 'rowNum', + width: 80, + title: '序号', + fixed: 'left', + align: 'center', + templet: '{{d.LAY_INDEX}}' + }, + { + field: 'communityName', width: 180, title: '社区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'residentialName', width: 180, title: '小区名称', align:'center', - templet: function(row) { + { + field: 'residentialName', width: 180, title: '小区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingName', width: 180, title: '楼/排名称', align:'center', - templet: function(row) { + { + field: 'buildingName', width: 180, title: '楼/排名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationUnit', width: 180, title: '所在单元/列', align:'center', - templet: function(row) { + { + field: 'affiliationUnit', width: 180, title: '所在单元/列', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationFloors', width: 180, title: '所在层/院', align:'center', - templet: function(row) { + { + field: 'affiliationFloors', width: 180, title: '所在层/院', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseNum', width: 180, title: '门牌号', align:'center', - templet: function(row) { + { + field: 'houseNum', width: 180, title: '门牌号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'categoryName', width: 180, title: '房屋类别', align:'center', - templet: function(row) { + { + field: 'categoryName', width: 180, title: '房屋类别', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'natureName', width: 180, title: '房屋性质', align:'center', - templet: function(row) { + { + field: 'natureName', width: 180, title: '房屋性质', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'typeName', width: 180, title: '房屋种类', align:'center', - templet: function(row) { + { + field: 'typeName', width: 180, title: '房屋种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'structureName', width: 180, title: '房屋结构', align:'center', - templet: function(row) { + { + field: 'structureName', width: 180, title: '房屋结构', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingPurposeName', width: 180, title: '建筑用途', align:'center', - templet: function(row) { + { + field: 'buildingPurposeName', width: 180, title: '建筑用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomNum', width: 180, title: '房间数量', align:'center', - templet: function(row) { + { + field: 'roomNum', width: 180, title: '房间数量', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomArea', width: 180, title: '房屋面积', align:'center', - templet: function(row) { + { + field: 'roomArea', width: 180, title: '房屋面积', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomUseName', width: 180, title: '房屋用途', align:'center', - templet: function(row) { + { + field: 'roomUseName', width: 180, title: '房屋用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'dangerName', width: 180, title: '隐患类型', align:'center', - templet: function(row) { + { + field: 'dangerName', width: 180, title: '隐患类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'certificateNum', width: 180, title: '产权证号', align:'center', - templet: function(row) { + { + field: 'certificateNum', width: 180, title: '产权证号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'registrationDate', width: 180, title: '登记日期', align:'center', - templet: function(row) { + { + field: 'registrationDate', width: 180, title: '登记日期', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliatedUnit', width: 180, title: '所属单位', align:'center', - templet: function(row) { + { + field: 'affiliatedUnit', width: 180, title: '所属单位', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isRental', width: 180, title: '是否出租屋', align:'center', - templet: function(row) { + { + field: 'isRental', width: 180, title: '是否出租屋', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isVacant', width: 180, title: '是否空置房', align:'center', - templet: function(row) { + { + field: 'isVacant', width: 180, title: '是否空置房', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'lodgeTypeName', width: 180, title: '租住类型', align:'center', - templet: function(row) { + { + field: 'lodgeTypeName', width: 180, title: '租住类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'rentalPurposes', width: 180, title: '出租用途', align:'center', - templet: function(row) { + { + field: 'rentalPurposes', width: 180, title: '出租用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'homeowner', width: 180, title: '房主名称', align:'center', - templet: function(row) { + { + field: 'homeowner', width: 180, title: '房主名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'documentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'documentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'phone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'phone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodian', width: 180, title: '托管人姓名', align:'center', - templet: function(row) { + { + field: 'custodian', width: 180, title: '托管人姓名', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'custodianDocumentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'custodianDocumentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianPhone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'custodianPhone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'relationshipHomeowner', width: 180, title: '与房主关系', align:'center', - templet: function(row) { + { + field: 'relationshipHomeowner', width: 180, title: '与房主关系', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align:'center', - templet: function(row) { - var rowData = '入住人员';; + { + field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align: 'center', + templet: function (row) { + var rowData = '入住人员'; + ; return rowData; } } ] ], page: true, - parseData: function(data) { + parseData: function (data) { return { 'code': 0, 'msg': '', @@ -1591,297 +1957,337 @@ }, cols: [ [ - {type:'checkbox', fixed: 'left'}, - {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'communityName', width: 180, title: '社区名称', align:'center', - templet: function(row) { + {type: 'checkbox', fixed: 'left'}, + { + field: 'rowNum', + width: 80, + title: '序号', + fixed: 'left', + align: 'center', + templet: '{{d.LAY_INDEX}}' + }, + { + field: 'communityName', width: 180, title: '社区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'residentialName', width: 180, title: '小区名称', align:'center', - templet: function(row) { + { + field: 'residentialName', width: 180, title: '小区名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingName', width: 180, title: '楼/排名称', align:'center', - templet: function(row) { + { + field: 'buildingName', width: 180, title: '楼/排名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationUnit', width: 180, title: '所在单元/列', align:'center', - templet: function(row) { + { + field: 'affiliationUnit', width: 180, title: '所在单元/列', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliationFloors', width: 180, title: '所在层/院', align:'center', - templet: function(row) { + { + field: 'affiliationFloors', width: 180, title: '所在层/院', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseNum', width: 180, title: '门牌号', align:'center', - templet: function(row) { + { + field: 'houseNum', width: 180, title: '门牌号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'categoryName', width: 180, title: '房屋类别', align:'center', - templet: function(row) { + { + field: 'categoryName', width: 180, title: '房屋类别', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'natureName', width: 180, title: '房屋性质', align:'center', - templet: function(row) { + { + field: 'natureName', width: 180, title: '房屋性质', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'typeName', width: 180, title: '房屋种类', align:'center', - templet: function(row) { + { + field: 'typeName', width: 180, title: '房屋种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'structureName', width: 180, title: '房屋结构', align:'center', - templet: function(row) { + { + field: 'structureName', width: 180, title: '房屋结构', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'buildingPurposeName', width: 180, title: '建筑用途', align:'center', - templet: function(row) { + { + field: 'buildingPurposeName', width: 180, title: '建筑用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomNum', width: 180, title: '房间数量', align:'center', - templet: function(row) { + { + field: 'roomNum', width: 180, title: '房间数量', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomArea', width: 180, title: '房屋面积', align:'center', - templet: function(row) { + { + field: 'roomArea', width: 180, title: '房屋面积', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'roomUseName', width: 180, title: '房屋用途', align:'center', - templet: function(row) { + { + field: 'roomUseName', width: 180, title: '房屋用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'dangerName', width: 180, title: '隐患类型', align:'center', - templet: function(row) { + { + field: 'dangerName', width: 180, title: '隐患类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'certificateNum', width: 180, title: '产权证号', align:'center', - templet: function(row) { + { + field: 'certificateNum', width: 180, title: '产权证号', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'registrationDate', width: 180, title: '登记日期', align:'center', - templet: function(row) { + { + field: 'registrationDate', width: 180, title: '登记日期', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'affiliatedUnit', width: 180, title: '所属单位', align:'center', - templet: function(row) { + { + field: 'affiliatedUnit', width: 180, title: '所属单位', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isRental', width: 180, title: '是否出租屋', align:'center', - templet: function(row) { + { + field: 'isRental', width: 180, title: '是否出租屋', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'isVacant', width: 180, title: '是否空置房', align:'center', - templet: function(row) { + { + field: 'isVacant', width: 180, title: '是否空置房', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'lodgeTypeName', width: 180, title: '租住类型', align:'center', - templet: function(row) { + { + field: 'lodgeTypeName', width: 180, title: '租住类型', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'rentalPurposes', width: 180, title: '出租用途', align:'center', - templet: function(row) { + { + field: 'rentalPurposes', width: 180, title: '出租用途', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'homeowner', width: 180, title: '房主名称', align:'center', - templet: function(row) { + { + field: 'homeowner', width: 180, title: '房主名称', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'documentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'documentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'documentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'phone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'phone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodian', width: 180, title: '托管人姓名', align:'center', - templet: function(row) { + { + field: 'custodian', width: 180, title: '托管人姓名', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentName', width: 180, title: '证件种类', align:'center', - templet: function(row) { + { + field: 'custodianDocumentName', width: 180, title: '证件种类', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianDocumentNum', width: 180, title: '证件号码', align:'center', - templet: function(row) { + { + field: 'custodianDocumentNum', width: 180, title: '证件号码', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'custodianPhone', width: 180, title: '联系电话', align:'center', - templet: function(row) { + { + field: 'custodianPhone', width: 180, title: '联系电话', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'relationshipHomeowner', width: 180, title: '与房主关系', align:'center', - templet: function(row) { + { + field: 'relationshipHomeowner', width: 180, title: '与房主关系', align: 'center', + templet: function (row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } return rowData; } }, - {field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align:'center', - templet: function(row) { - var rowData = '入住人员';; + { + field: 'houseStatus', fixed: 'right', width: 150, title: '入住人员', align: 'center', + templet: function (row) { + var rowData = '入住人员'; + ; return rowData; } } ] ], page: true, - parseData: function(data) { + parseData: function (data) { return { 'code': 0, 'msg': '', @@ -1900,16 +2306,16 @@ title: "房屋人员列表", width: '80%', height: '90%', - onClose: function() { + onClose: function () { reloadTable(); } }); } //监听行单击事件 - table.on('tool(dataTable)', function(obj){ + table.on('tool(dataTable)', function (obj) { var data = obj.data; - if('rentalHis' == obj.event) { + if ('rentalHis' == obj.event) { rentalHis(data); } }); @@ -1918,15 +2324,16 @@ function reloadTable(currentPage) { table.reload('dataTable', { where: { - keywords: $('#keywords').val(), - startTime: $('#startTime').val(), - endTime: $('#endTime').val() + isSelf: $('#isSelf').val(), + isVacant: $('#isVacant').val(), + isRental: $('#isRental').val() }, page: { curr: currentPage }, }); } + // 初始化日期 function initDate() { // 日期选择 @@ -1939,6 +2346,7 @@ format: 'yyyy-MM-dd' }); } + // 删除 function removeData(ids) { top.dialog.msg(top.dataMessage.delete, { @@ -1961,25 +2369,26 @@ } }); } + initTable(); initDate(); // 事件 - 页面变化 - $win.on('resize', function() { + $win.on('resize', function () { clearTimeout(resizeTimeout); - resizeTimeout = setTimeout(function() { + resizeTimeout = setTimeout(function () { reloadTable(); }, 500); }); // 事件 - 搜索 - $(document).on('click', '#search', function() { + $(document).on('click', '#search', function () { reloadTable(1); }); // 事件 - 增删改 - table.on('toolbar(dataTable)', function(obj) { + table.on('toolbar(dataTable)', function (obj) { var layEvent = obj.event; var checkStatus = table.checkStatus('dataTable'); var checkDatas = checkStatus.data; - if(layEvent === 'saveEvent') { + if (layEvent === 'saveEvent') { layer.open({ type: 2, title: false, @@ -1989,14 +2398,14 @@ shadeClose: true, anim: 2, content: top.restAjax.path('route/house/save', []), - end: function() { + end: function () { reloadTable(); } }); - } else if(layEvent === 'updateEvent') { - if(checkDatas.length === 0) { + } else if (layEvent === 'updateEvent') { + if (checkDatas.length === 0) { top.dialog.msg(top.dataMessage.table.selectEdit); - } else if(checkDatas.length > 1) { + } else if (checkDatas.length > 1) { top.dialog.msg(top.dataMessage.table.selectOneEdit); } else { layer.open({ @@ -2008,18 +2417,18 @@ shadeClose: true, anim: 2, content: top.restAjax.path('route/house/update?houseId={houseId}', [checkDatas[0].houseId]), - end: function() { + end: function () { reloadTable(); } }); } - } else if(layEvent === 'removeEvent') { - if(checkDatas.length === 0) { + } else if (layEvent === 'removeEvent') { + if (checkDatas.length === 0) { top.dialog.msg(top.dataMessage.table.selectDelete); } else { var ids = ''; - for(var i = 0, item; item = checkDatas[i++];) { - if(i > 1) { + for (var i = 0, item; item = checkDatas[i++];) { + if (i > 1) { ids += '_'; } ids += item['houseId']; @@ -2029,10 +2438,11 @@ } }); - var init = function(){ + var init = function () { initStreetSelect(); initCommunitySelect(); event(); + form.render(); } init(); diff --git a/src/main/resources/templates/house/save.html b/src/main/resources/templates/house/save.html index 2f36cd0..530704d 100644 --- a/src/main/resources/templates/house/save.html +++ b/src/main/resources/templates/house/save.html @@ -228,20 +228,27 @@
    -
    +
    -
    +
    +
    + +
    + + +
    +
    @@ -283,6 +290,7 @@
    +
    @@ -329,6 +337,7 @@
    +
    diff --git a/src/main/resources/templates/house/update.html b/src/main/resources/templates/house/update.html index dd8216c..b670d49 100644 --- a/src/main/resources/templates/house/update.html +++ b/src/main/resources/templates/house/update.html @@ -228,20 +228,27 @@
    -
    +
    -
    +
    +
    + +
    + + +
    +
    @@ -283,6 +290,7 @@
    +
    @@ -329,6 +337,7 @@
    +