diff --git a/src/main/java/com/cm/population/utils/IdCardVerifyUtil.java b/src/main/java/com/cm/population/utils/IdCardVerifyUtil.java index 09bfb3f..00711dd 100644 --- a/src/main/java/com/cm/population/utils/IdCardVerifyUtil.java +++ b/src/main/java/com/cm/population/utils/IdCardVerifyUtil.java @@ -1,6 +1,7 @@ package com.cm.population.utils; import com.cm.common.utils.DateUtil; +import com.cm.common.utils.UUIDUtil; import java.text.ParseException; import java.text.SimpleDateFormat; diff --git a/src/main/resources/templates/house/save.html b/src/main/resources/templates/house/save.html index 24df881..509b2d7 100644 --- a/src/main/resources/templates/house/save.html +++ b/src/main/resources/templates/house/save.html @@ -550,22 +550,25 @@ title: '人员选择', width: '80%', height: '80%', - onClose: function(data) { - var list = top.dialog.dialogData.populationinfoQueryMultiple; - // 判断是否已选择 - for(var i = 0 ; i < list.length ; i++){ - var exists = false; - for(var j = 0 ; j < cohabitArray.length ; j++) { - if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { - exists = true; - break; + onClose: function(data1) { + var data = window.sessionStorage.getItem("tempQueryMultiplePopulationInfo"); + if(data != null && data != undefined && data != 'null') { + var list = eval("(" + data + ")"); + // 判断是否已选择 + for(var i = 0 ; i < list.length ; i++){ + var exists = false; + for(var j = 0 ; j < cohabitArray.length ; j++) { + if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { + exists = true; + break; + } + } + if (!exists) { + cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"}); } } - if (!exists) { - cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"}); - } + reloadCohabit(); } - reloadCohabit(); } }); } diff --git a/src/main/resources/templates/house/update.html b/src/main/resources/templates/house/update.html index 8370134..518bd88 100644 --- a/src/main/resources/templates/house/update.html +++ b/src/main/resources/templates/house/update.html @@ -800,22 +800,25 @@ title: '人员选择', width: '80%', height: '80%', - onClose: function(data) { - var list = top.dialog.dialogData.populationinfoQueryMultiple; - // 判断是否已选择 - for(var i = 0 ; i < list.length ; i++){ - var exists = false; - for(var j = 0 ; j < cohabitArray.length ; j++) { - if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { - exists = true; - break; + onClose: function(data1) { + var data = window.sessionStorage.getItem("tempQueryMultiplePopulationInfo"); + if(data != null && data != undefined && data != 'null') { + var list = eval("(" + data + ")"); + // 判断是否已选择 + for(var i = 0 ; i < list.length ; i++){ + var exists = false; + for(var j = 0 ; j < cohabitArray.length ; j++) { + if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { + exists = true; + break; + } + } + if (!exists) { + cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"}); } } - if (!exists) { - cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"}); - } + reloadCohabit(); } - reloadCohabit(); } }); } diff --git a/src/main/resources/templates/population/list.html b/src/main/resources/templates/population/list.html index ca3c37f..3a4a25f 100644 --- a/src/main/resources/templates/population/list.html +++ b/src/main/resources/templates/population/list.html @@ -223,33 +223,35 @@ title: '人员选择', width: '80%', height: '80%', - onClose: function(data) { + onClose: function(data1) { var cohabitArray = new Array(); - var list = top.dialog.dialogData.populationinfoQueryMultiple; - // 判断是否已选择 - for(var i = 0 ; i < list.length ; i++){ - var exists = false; - for(var j = 0 ; j < cohabitArray.length ; j++) { - if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { - exists = true; - break; + var data = window.sessionStorage.getItem("tempQueryMultiplePopulationInfo"); + if(data != null && data != undefined && data != 'null') { + var list = eval("(" + data + ")"); + // 判断是否已选择 + for(var i = 0 ; i < list.length ; i++){ + var exists = false; + for(var j = 0 ; j < cohabitArray.length ; j++) { + if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { + exists = true; + break; + } } + cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"}); } - cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"}); + // 保存 + var loadLayerIndex; + top.restAjax.post(top.restAjax.path('api/population/save-all/{houseId}', [houseId]), cohabitArray, null, function(code, data) { + // 刷新列表 + window.location.reload(); + }, function(code, data) { + top.dialog.msg(data.msg); + }, function() { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function() { + top.dialog.close(loadLayerIndex); + }); } - // 保存 - var loadLayerIndex; - top.restAjax.post(top.restAjax.path('api/population/save-all/{houseId}', [houseId]), cohabitArray, null, function(code, data) { - // 刷新列表 - window.location.reload(); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); - }); - } }); } else if(layEvent === 'updateEvent') {