人口基本信息- 修改人员选择页面

This commit is contained in:
java_cuibaocheng@163.com 2023-12-01 17:41:24 +08:00
parent 1f2e5853af
commit 2d2b7ea14f
4 changed files with 58 additions and 49 deletions

View File

@ -1,6 +1,7 @@
package com.cm.population.utils; package com.cm.population.utils;
import com.cm.common.utils.DateUtil; import com.cm.common.utils.DateUtil;
import com.cm.common.utils.UUIDUtil;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

View File

@ -550,22 +550,25 @@
title: '人员选择', title: '人员选择',
width: '80%', width: '80%',
height: '80%', height: '80%',
onClose: function(data) { onClose: function(data1) {
var list = top.dialog.dialogData.populationinfoQueryMultiple; var data = window.sessionStorage.getItem("tempQueryMultiplePopulationInfo");
// 判断是否已选择 if(data != null && data != undefined && data != 'null') {
for(var i = 0 ; i < list.length ; i++){ var list = eval("(" + data + ")");
var exists = false; // 判断是否已选择
for(var j = 0 ; j < cohabitArray.length ; j++) { for(var i = 0 ; i < list.length ; i++){
if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { var exists = false;
exists = true; for(var j = 0 ; j < cohabitArray.length ; j++) {
break; 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) { reloadCohabit();
cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"});
}
} }
reloadCohabit();
} }
}); });
} }

View File

@ -800,22 +800,25 @@
title: '人员选择', title: '人员选择',
width: '80%', width: '80%',
height: '80%', height: '80%',
onClose: function(data) { onClose: function(data1) {
var list = top.dialog.dialogData.populationinfoQueryMultiple; var data = window.sessionStorage.getItem("tempQueryMultiplePopulationInfo");
// 判断是否已选择 if(data != null && data != undefined && data != 'null') {
for(var i = 0 ; i < list.length ; i++){ var list = eval("(" + data + ")");
var exists = false; // 判断是否已选择
for(var j = 0 ; j < cohabitArray.length ; j++) { for(var i = 0 ; i < list.length ; i++){
if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { var exists = false;
exists = true; for(var j = 0 ; j < cohabitArray.length ; j++) {
break; 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) { reloadCohabit();
cohabitArray.push({populationId: "", populationInfoId: list[i].populationInfoId, cardNum: list[i].idcard, phone: list[i].phone, name: list[i].name, outHouse: "0"});
}
} }
reloadCohabit();
} }
}); });
} }

View File

@ -223,33 +223,35 @@
title: '人员选择', title: '人员选择',
width: '80%', width: '80%',
height: '80%', height: '80%',
onClose: function(data) { onClose: function(data1) {
var cohabitArray = new Array(); var cohabitArray = new Array();
var list = top.dialog.dialogData.populationinfoQueryMultiple; var data = window.sessionStorage.getItem("tempQueryMultiplePopulationInfo");
// 判断是否已选择 if(data != null && data != undefined && data != 'null') {
for(var i = 0 ; i < list.length ; i++){ var list = eval("(" + data + ")");
var exists = false; // 判断是否已选择
for(var j = 0 ; j < cohabitArray.length ; j++) { for(var i = 0 ; i < list.length ; i++){
if(list[i].populationInfoId == cohabitArray[j].populationInfoId) { var exists = false;
exists = true; for(var j = 0 ; j < cohabitArray.length ; j++) {
break; 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') { } else if(layEvent === 'updateEvent') {