From 57a7d12067e464b63160a872719a5dffc42c0dde Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Wed, 15 Dec 2021 18:16:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=AE=A1=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dtos/buildinghouse/BuildingHouseDTO.java | 20 ++ .../BuildingHouseUserDTO.java | 10 + .../vos/buildinghouse/BuildingHouseVO.java | 10 + .../BuildingHouseUserVO.java | 12 +- .../impl/BuildingHouseServiceImpl.java | 13 +- .../buildinghouse/building-house-mapper.xml | 9 + .../building-house-user-mapper.xml | 12 +- .../static/route/buildinghouse/list.html | 53 +++--- .../static/route/buildinghouse/save.html | 133 ++++++------- .../static/route/buildinghouse/update.html | 141 ++++++++++---- .../static/route/buildinghouseuser/list.html | 40 ++-- .../static/route/buildinghouseuser/save.html | 179 ++++++++++-------- .../route/buildinghouseuser/update.html | 179 ++++++++++-------- 13 files changed, 488 insertions(+), 323 deletions(-) diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouse/BuildingHouseDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouse/BuildingHouseDTO.java index f38616d..a705b5c 100644 --- a/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouse/BuildingHouseDTO.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouse/BuildingHouseDTO.java @@ -40,6 +40,10 @@ public class BuildingHouseDTO { private String longitude; @ApiModelProperty(name = "latitude", value = "纬度") private String latitude; + @ApiModelProperty(name = "rentalTime", value = "出租时间") + private String rentalTime; + @ApiModelProperty(name = "countMember", value = "家庭成员数量") + private String countMember; public String getBuildingHouseId() { return buildingHouseId == null ? "" : buildingHouseId.trim(); @@ -144,4 +148,20 @@ public class BuildingHouseDTO { public void setLatitude(String latitude) { this.latitude = latitude; } + + public String getRentalTime() { + return rentalTime; + } + + public void setRentalTime(String rentalTime) { + this.rentalTime = rentalTime; + } + + public String getCountMember() { + return countMember; + } + + public void setCountMember(String countMember) { + this.countMember = countMember; + } } diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouseuser/BuildingHouseUserDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouseuser/BuildingHouseUserDTO.java index 896a422..b7181ea 100644 --- a/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouseuser/BuildingHouseUserDTO.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/buildinghouseuser/BuildingHouseUserDTO.java @@ -32,6 +32,8 @@ public class BuildingHouseUserDTO { private String buildingHouseId; @ApiModelProperty(name = "userType", value = "人员类型") private String userType; + @ApiModelProperty(name = "relationship", value = "与户主关系") + private String relationship; public String getBuildingHouseUserId() { return buildingHouseUserId == null ? "" : buildingHouseUserId.trim(); @@ -104,4 +106,12 @@ public class BuildingHouseUserDTO { public void setUserType(String userType) { this.userType = userType; } + + public String getRelationship() { + return relationship; + } + + public void setRelationship(String relationship) { + this.relationship = relationship; + } } diff --git a/src/main/java/com/cm/systemcity/pojo/vos/buildinghouse/BuildingHouseVO.java b/src/main/java/com/cm/systemcity/pojo/vos/buildinghouse/BuildingHouseVO.java index 7181ef4..84bb224 100644 --- a/src/main/java/com/cm/systemcity/pojo/vos/buildinghouse/BuildingHouseVO.java +++ b/src/main/java/com/cm/systemcity/pojo/vos/buildinghouse/BuildingHouseVO.java @@ -44,6 +44,8 @@ public class BuildingHouseVO { private String longitude; @ApiModelProperty(name = "latitude", value = "纬度") private String latitude; + @ApiModelProperty(name = "rentalTime", value = "出租时间") + private String rentalTime; public String getCityBuildingId() { return cityBuildingId == null ? "" : cityBuildingId.trim(); @@ -156,4 +158,12 @@ public class BuildingHouseVO { public void setLatitude(String latitude) { this.latitude = latitude; } + + public String getRentalTime() { + return rentalTime; + } + + public void setRentalTime(String rentalTime) { + this.rentalTime = rentalTime; + } } diff --git a/src/main/java/com/cm/systemcity/pojo/vos/buildinghouseuser/BuildingHouseUserVO.java b/src/main/java/com/cm/systemcity/pojo/vos/buildinghouseuser/BuildingHouseUserVO.java index 2427a10..684d9f5 100644 --- a/src/main/java/com/cm/systemcity/pojo/vos/buildinghouseuser/BuildingHouseUserVO.java +++ b/src/main/java/com/cm/systemcity/pojo/vos/buildinghouseuser/BuildingHouseUserVO.java @@ -30,6 +30,8 @@ public class BuildingHouseUserVO { private String buildingHouseId; @ApiModelProperty(name = "userType", value = "人员类型") private String userType; + @ApiModelProperty(name = "relationship", value = "与户主关系") + private String relationship; public String getCardType() { return cardType == null ? "" : cardType.trim(); @@ -88,10 +90,18 @@ public class BuildingHouseUserVO { } public String getUserType() { - return userType; + return userType == null ? "" : userType.trim(); } public void setUserType(String userType) { this.userType = userType; } + + public String getRelationship() { + return relationship; + } + + public void setRelationship(String relationship) { + this.relationship = relationship; + } } diff --git a/src/main/java/com/cm/systemcity/service/buildinghouse/impl/BuildingHouseServiceImpl.java b/src/main/java/com/cm/systemcity/service/buildinghouse/impl/BuildingHouseServiceImpl.java index b462d45..1ad1391 100644 --- a/src/main/java/com/cm/systemcity/service/buildinghouse/impl/BuildingHouseServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/buildinghouse/impl/BuildingHouseServiceImpl.java @@ -9,6 +9,7 @@ import com.cm.systemcity.dao.buildinghouse.IBuildingHouseDao; import com.cm.systemcity.pojo.dtos.buildinghouse.BuildingHouseDTO; import com.cm.systemcity.pojo.vos.buildinghouse.BuildingHouseVO; import com.cm.systemcity.service.buildinghouse.IBuildingHouseService; +import com.cm.systemcity.service.buildinghouseuser.IBuildingHouseUserService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; @@ -28,6 +29,8 @@ public class BuildingHouseServiceImpl extends AbstractService implements IBuildi @Autowired private IBuildingHouseDao buildingHouseDao; + @Autowired + private IBuildingHouseUserService buildingHouseUserService; @Override public void save(BuildingHouseVO buildingHouseVO) throws Exception { @@ -113,7 +116,15 @@ public class BuildingHouseServiceImpl extends AbstractService implements IBuildi @Override public List list(Map params) { - return buildingHouseDao.list(params); + List list = buildingHouseDao.list(params); + if(null != list && list.size() > 0) { + for(BuildingHouseDTO buildingHouseDTO: list) { + params.put("buildingHouseId", buildingHouseDTO.getBuildingHouseId()); + Integer count = buildingHouseUserService.count(params); + buildingHouseDTO.setCountMember(count.toString()); + } + } + return list; } @Override diff --git a/src/main/resources/mybatis/mapper/buildinghouse/building-house-mapper.xml b/src/main/resources/mybatis/mapper/buildinghouse/building-house-mapper.xml index 75a0b76..063b90d 100644 --- a/src/main/resources/mybatis/mapper/buildinghouse/building-house-mapper.xml +++ b/src/main/resources/mybatis/mapper/buildinghouse/building-house-mapper.xml @@ -16,6 +16,7 @@ + @@ -34,6 +35,7 @@ owner_phone, longitude, latitude, + rental_time, creator, gmt_create, modifier, @@ -53,6 +55,7 @@ #{ownerPhone}, #{longitude}, #{latitude}, + #{rentalTime}, #{creator}, #{gmtCreate}, #{modifier}, @@ -138,6 +141,9 @@ latitude = #{latitude}, + + rental_time = #{rentalTime}, + house_number = replace(house_number, #{oldHouseNumber}, #{newHouseNumber}), @@ -174,6 +180,7 @@ t1.owner_phone, t1.longitude, t1.latitude, + t1.rental_time, t1.building_house_id FROM city_building_house t1 @@ -197,6 +204,7 @@ \ No newline at end of file diff --git a/src/main/resources/static/route/buildinghouse/list.html b/src/main/resources/static/route/buildinghouse/list.html index 712dfd6..f1a32c1 100644 --- a/src/main/resources/static/route/buildinghouse/list.html +++ b/src/main/resources/static/route/buildinghouse/list.html @@ -253,6 +253,16 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, + {field: 'countMember', event:'countMember', width: 180, title: '家庭成员数量', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + rowData = ''+rowData+''; + return rowData; + } + }, {field: 'cityBuildingName', width: 180, title: '楼宇名称', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -290,24 +300,6 @@ return rowData; } }, - {field: 'dataType', width: 180, title: '数据生成方式', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - if('1' == rowData) { - rowData = '自动生成'; - } - if('2' == rowData) { - rowData = '手动录入'; - } - if('3' == rowData) { - rowData = '批量导入'; - } - return rowData; - } - }, {field: 'ownerName', width: 180, title: '房主姓名', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -335,18 +327,18 @@ return rowData; } }, - {field: 'houseStatus', fixed: 'right', width: 150, title: '租房记录', align:'center', + {field: 'houseStatus', fixed: 'right', width: 150, title: '租住记录', align:'center', templet: function(row) { var rowData = '租住记录';; return rowData; } }, - {field: 'addUser', fixed: 'right', width: 150, title: '操作', align:'center', + /*{field: 'addUser', fixed: 'right', width: 150, title: '操作', align:'center', templet: function(row) { var rowData = '绑定人员'; return rowData; } - } + }*/ ] ], page: true, @@ -360,6 +352,7 @@ } }); } + // 重载表格 function reloadTable(currentPage) { table.reload('dataTable', { @@ -415,8 +408,8 @@ top.dialog.open({ url: top.restAjax.path('route/buildinghouseuser/list.html?buildingHouseId={buildingHouseId}', [data.buildingHouseId]), title: "房屋租住记录", - width: '80%', - height: '80%', + width: '98%', + height: '98%', onClose: function() { reloadTable(); } @@ -514,6 +507,18 @@ } }); + function countMemberFun(data) { + top.dialog.open({ + url: top.restAjax.path('route/buildinghouseuser/list.html?buildingHouseId={buildingHouseId}', [data.buildingHouseId]), + title: "房屋租住记录", + width: '98%', + height: '98%', + onClose: function() { + reloadTable(); + } + }); + } + //监听行单击事件 table.on('tool(dataTable)', function(obj){ var data = obj.data; @@ -522,6 +527,8 @@ }else if('addUser' == obj.event) { console.log(data) addUser(data); + }else if(obj.event === 'countMember'){ + countMemberFun(data); } }); }); diff --git a/src/main/resources/static/route/buildinghouse/save.html b/src/main/resources/static/route/buildinghouse/save.html index 2e1408d..541858f 100644 --- a/src/main/resources/static/route/buildinghouse/save.html +++ b/src/main/resources/static/route/buildinghouse/save.html @@ -35,39 +35,50 @@ -
- +
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ -
- -
- +
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- -
-
-
- -
- +
+ +
+ +
@@ -121,6 +132,15 @@ var viewerObj = {}; var selectedCommunities = []; + form.on('select(houseStatus)', function(data){ + if('出租房' == data.value) { + $('#rentalTimeDiv').show(); + initDate(); + }else { + $('#rentalTimeDiv').hide(); + } + }) + function initMap() { map = new BMap.Map("mapContainer", {enableMapClick: false,}); var point = new BMap.Point('109.85017859252311', '40.66017700460503'); @@ -197,59 +217,16 @@ parent.layer.close(parent.layer.getFrameIndex(window.name)); } - function refreshDownloadTemplet(fileName, file) { - var dataRander = {}; - dataRander[fileName] = file; - - laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { - document.getElementById(fileName +'FileBox').innerHTML = html; + function initDate() { + laydate.render({ + elem: '#rentalTime', + format: 'yyyy-MM-dd' }); } - // 初始化文件列表 - function initFileList(fileName, ids, callback) { - var dataForm = {}; - dataForm[fileName] = ids; - form.val('dataForm', dataForm); - - if(!ids) { - refreshDownloadTemplet(fileName, []); - if(callback) { - callback(fileName, []); - } - return; - } - - top.restAjax.get(top.restAjax.path('api/file/list', []), { - ids: ids - }, null, function(code, data) { - refreshDownloadTemplet(fileName, data); - if(callback) { - callback(fileName, data); - } - }, function(code, data) { - top.dialog.msg(data.msg); - }); - } - - // 初始化视频 - function initVideo(fileName, data) { - for(var i = 0, item; item = data[i++];) { - var player = new ckplayer({ - container: '#'+ fileName + i, - variable: 'player', - flashplayer: false, - video: { - file: 'route/file/download/true/'+ item.fileId, - type: 'video/mp4' - } - }); - } - } - - // 初始化内容 function initData() { + initDate(); } initData(); @@ -285,10 +262,6 @@ $('.close').on('click', function() { closeBox(); }); - - // 校验 - form.verify({ - }); }); diff --git a/src/main/resources/static/route/buildinghouse/update.html b/src/main/resources/static/route/buildinghouse/update.html index f828a73..e2269bf 100644 --- a/src/main/resources/static/route/buildinghouse/update.html +++ b/src/main/resources/static/route/buildinghouse/update.html @@ -35,39 +35,56 @@
-
- +
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- + +
+
@@ -123,6 +140,54 @@ var viewerObj = {}; var selectedCommunities = []; + // 点击小区名称选择输入框,弹出层方法 + $(document).on('click', '#countMember', function() { + rentalHis(); + }); + + function rentalHis(data) { + top.dialog.open({ + url: top.restAjax.path('route/buildinghouseuser/list.html?buildingHouseId={buildingHouseId}', [buildingHouseId]), + title: "房屋租住记录", + width: '98%', + height: '98%', + onClose: function() { + getUserCount(); + } + }); + } + + function getUserCount() { + var loadLayerIndex; + top.restAjax.get(top.restAjax.path('api/buildinghouseuser/count?buildingHouseId={buildingHouseId}', [buildingHouseId]), {}, null, function(code, data) { + console.log(data) + $('#countMemberSpan').html(data.data); + }, function(code, data) { + top.dialog.msg(data.msg); + }, function() { + loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3}); + }, function() { + top.dialog.close(loadLayerIndex); + }); + } + + form.on('select(houseStatus)', function(data){ + if('出租房' == data.value) { + $('#rentalTimeDiv').show(); + initDate(); + }else { + $('#rentalTimeDiv').hide(); + } + }) + + function initDate(value) { + laydate.render({ + elem: '#rentalTime', + format: 'yyyy-MM-dd', + value: value + }); + } + function initMap(longitude,latitude) { map = new BMap.Map("mapContainer", {enableMapClick: false,}); var point = new BMap.Point(longitude, latitude); @@ -211,15 +276,6 @@ parent.layer.close(parent.layer.getFrameIndex(window.name)); } - function refreshDownloadTemplet(fileName, file) { - var dataRander = {}; - dataRander[fileName] = file; - - laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { - document.getElementById(fileName +'FileBox').innerHTML = html; - }); - } - // 初始化内容 function initData() { var loadLayerIndex; @@ -232,8 +288,13 @@ id:data.districtId, name:data.districtName }); + getUserCount(); initMap(dataFormData['longitude'],dataFormData['latitude']); readonlyFun(data.dataType); + if(data.houseStatus == '出租房') { + $('#rentalTimeDiv').show(); + initDate(data.houseStatus) + } form.val('dataForm', dataFormData); form.render(null, 'dataForm'); }, function(code, data) { @@ -278,10 +339,6 @@ $('.close').on('click', function() { closeBox(); }); - - // 校验 - form.verify({ - }); }); diff --git a/src/main/resources/static/route/buildinghouseuser/list.html b/src/main/resources/static/route/buildinghouseuser/list.html index 5a12e70..1364369 100644 --- a/src/main/resources/static/route/buildinghouseuser/list.html +++ b/src/main/resources/static/route/buildinghouseuser/list.html @@ -31,6 +31,20 @@
-->
+ +
@@ -59,6 +73,7 @@ table.render({ elem: '#dataTable', id: 'dataTable', + toolbar: '#headerToolBar', url: top.restAjax.path(tableUrl, [buildingHouseId]), width: admin.screen() > 1 ? '100%' : '', height: $win.height() - 90, @@ -70,6 +85,7 @@ }, cols: [ [ + {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, {field: 'name', width: 180, title: '姓名', align:'center', templet: function(row) { @@ -98,15 +114,6 @@ return rowData; } }, - {field: 'cardTypeName', width: 180, title: '证件类型名称', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, {field: 'cardNumber', width: 180, title: '证件号码', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -115,7 +122,16 @@ } return rowData; } - } + }, + {field: 'relationship', width: 180, title: '与户主关系', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, ] ], page: true, @@ -132,7 +148,7 @@ // 重载表格 function reloadTable(currentPage) { table.reload('dataTable', { - url: top.restAjax.path(tableUrl, []), + url: top.restAjax.path(tableUrl, [buildingHouseId]), where: { keywords: $('#keywords').val(), startTime: $('#startTime').val(), @@ -204,7 +220,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/buildinghouseuser/save.html', []), + content: top.restAjax.path('route/buildinghouseuser/save.html?buildingHouseId={buildingHouseId}', [buildingHouseId]), end: function() { reloadTable(); } diff --git a/src/main/resources/static/route/buildinghouseuser/save.html b/src/main/resources/static/route/buildinghouseuser/save.html index f3acec3..b68ffba 100644 --- a/src/main/resources/static/route/buildinghouseuser/save.html +++ b/src/main/resources/static/route/buildinghouseuser/save.html @@ -22,46 +22,85 @@
-
+ -
+ -
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
- +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
@@ -93,62 +132,43 @@ var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; + var buildingHouseId = top.restAjax.params(window.location.href).buildingHouseId; + + $(document).on('click','#search',function(){ + queryBasePopulationInfo($('#idCardNumber').val()); + }); + + function queryBasePopulationInfo(idCardNumber){ + if(!idCardNumber){ + top.dialog.msg('请输入身份证号进行查询'); + return false; + } + var loadIndex = layer.load(0); + top.restAjax.get(top.restAjax.path('api/buildinghouseuser/userMsg/{idCard}', [idCardNumber]), + {}, null, function(code, data) { + console.log(data.data); + if(!data.data) { + $('#cardNumber').val(idCardNumber); + return false; + }else { + $('#name').val(data.data.name); + $('#sex').val(data.data.sex); + $('#phone').val(data.data.phone); + $('#cardNumber').val(idCardNumber); + } + }, function(code, data) { + top.dialog.msg(data.msg); + },function(){ + + },function () { + layer.close(loadIndex); + }); + } function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } - function refreshDownloadTemplet(fileName, file) { - var dataRander = {}; - dataRander[fileName] = file; - - laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { - document.getElementById(fileName +'FileBox').innerHTML = html; - }); - } - - // 初始化文件列表 - function initFileList(fileName, ids, callback) { - var dataForm = {}; - dataForm[fileName] = ids; - form.val('dataForm', dataForm); - - if(!ids) { - refreshDownloadTemplet(fileName, []); - if(callback) { - callback(fileName, []); - } - return; - } - - top.restAjax.get(top.restAjax.path('api/file/list', []), { - ids: ids - }, null, function(code, data) { - refreshDownloadTemplet(fileName, data); - if(callback) { - callback(fileName, data); - } - }, function(code, data) { - top.dialog.msg(data.msg); - }); - } - - // 初始化视频 - function initVideo(fileName, data) { - for(var i = 0, item; item = data[i++];) { - var player = new ckplayer({ - container: '#'+ fileName + i, - variable: 'player', - flashplayer: false, - video: { - file: 'route/file/download/true/'+ item.fileId, - type: 'video/mp4' - } - }); - } - } - - // 初始化内容 function initData() { } @@ -156,6 +176,7 @@ // 提交表单 form.on('submit(submitForm)', function(formData) { + formData.field['buildingHouseId'] = buildingHouseId; top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; @@ -186,10 +207,6 @@ $('.close').on('click', function() { closeBox(); }); - - // 校验 - form.verify({ - }); }); diff --git a/src/main/resources/static/route/buildinghouseuser/update.html b/src/main/resources/static/route/buildinghouseuser/update.html index 83cbd57..3e9a440 100644 --- a/src/main/resources/static/route/buildinghouseuser/update.html +++ b/src/main/resources/static/route/buildinghouseuser/update.html @@ -22,52 +22,91 @@
-
+ -
+ -
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
- +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
@@ -96,61 +135,41 @@ var wangEditorObj = {}; var viewerObj = {}; + $(document).on('click','#search',function(){ + queryBasePopulationInfo($('#idCardNumber').val()); + }); + + function queryBasePopulationInfo(idCardNumber){ + if(!idCardNumber){ + top.dialog.msg('请输入身份证号进行查询'); + return false; + } + var loadIndex = layer.load(0); + top.restAjax.get(top.restAjax.path('api/buildinghouseuser/userMsg/{idCard}', [idCardNumber]), + {}, null, function(code, data) { + console.log(data.data); + if(!data.data) { + $('#cardNumber').val(idCardNumber); + return false; + }else { + $('#name').val(data.data.name); + $('#sex').val(data.data.sex); + $('#phone').val(data.data.phone); + $('#cardNumber').val(idCardNumber); + } + }, function(code, data) { + top.dialog.msg(data.msg); + },function(){ + + },function () { + layer.close(loadIndex); + }); + } + function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } - function refreshDownloadTemplet(fileName, file) { - var dataRander = {}; - dataRander[fileName] = file; - - laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { - document.getElementById(fileName +'FileBox').innerHTML = html; - }); - } - - // 初始化文件列表 - function initFileList(fileName, ids, callback) { - var dataForm = {}; - dataForm[fileName] = ids; - form.val('dataForm', dataForm); - - if(!ids) { - refreshDownloadTemplet(fileName, []); - if(callback) { - callback(fileName, []); - } - return; - } - - top.restAjax.get(top.restAjax.path('api/file/list', []), { - ids: ids - }, null, function(code, data) { - refreshDownloadTemplet(fileName, data); - if(callback) { - callback(fileName, data); - } - }, function(code, data) { - top.dialog.msg(data.msg); - }); - } - - // 初始化视频 - function initVideo(fileName, data) { - for(var i = 0, item; item = data[i++];) { - var player = new ckplayer({ - container: '#'+ fileName + i, - variable: 'player', - flashplayer: false, - video: { - file: 'route/file/download/true/'+ item.fileId, - type: 'video/mp4' - } - }); - } - } - - // 初始化内容 function initData() { var loadLayerIndex; @@ -203,10 +222,6 @@ $('.close').on('click', function() { closeBox(); }); - - // 校验 - form.verify({ - }); });