```<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html>
<%@ include file="/include/meta.jsp"%>
全员信息
.ztree {width:350px;margin-top: 10px;border: 1px solid #cfd9db; display:none;background: #f0f6e4;height:360px;overflow-y:scroll;overflow-x:auto;}
preview{width:260px;height:190px;border:1px solid #000;overflow:hidden;}
imghead {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);}
.img{
height: 140px;
width: 128px;
display: inline-block;
zoom:1;
}
$().ready(function() {
//对select进行切割
$("select").change(function(){
var v_sele = $(this).children("option:selected").val();
var _v = v_sele.split("-");
$(this).next().val(_v[0]);
$(this).next().next().val(_v[1]);
});
$(document).on("change","#gb016",(function(){
//根据婚姻状况和婚变日期自动添加对方的信息
getInfo();
}));
$('#gs943').blur(function(){
getInfo();
});
$("input[name='gb011']").blur(function(){
var year = $(this).val().substring(6,10);
var mouth = $(this).val().substring(10,12);
var day = $(this).val().substring(12,14);
var sex = $(this).val().substring(16,17);
var select = $("select[name='vgb002']").children("option").attr("disabled","disabled");
if($(this).val()!=""){
$("input[name='gb012']").val(year+"-"+mouth+"-"+day);
$("input[name='gb012']").removeAttr("onFocus");
var sexCode = 2;
//sex%2==1?sexCode=1:sexCode;
if(sex%2==1){
var s = select.eq(2).attr("selected","selected").removeAttr("disabled").val();
}else {
var s = select.eq(3).attr("selected","selected").removeAttr("disabled").val();
}
var ss = s.split("-");
$("input[name='gb002']").val(ss[0]);
$("input[name='hgb002']").val(ss[1]);
}else{
select.attr("selected","selected").removeAttr("disabled");
$("input[name='gb012']").attr("onFocus","WdatePicker({isShowClear:true,readOnly:true,maxDate: '%y-%M-%d'})");
}
});
$("input[name='gb012']").blur(function(){
var gb011_v = $("input[name='gb011']").val();
var year = gb011_v.substring(6,10);
var mouth = gb011_v.substring(10,12);
var day = gb011_v.substring(12,14);
if(gb011_v!=""){
$("input[name='gb012']").val(year+"-"+mouth+"-"+day);
$("input[name='gb012']").removeAttr("onFocus");
}else{
$("input[name='gb012']").attr("onFocus","WdatePicker({isShowClear:true,readOnly:true,maxDate: '%y-%M-%d'})");
}
});
//初始化将‘0’置灰
$("select[name=vgb016] option[value='20-已婚']").attr("disabled","disabled");
$("select[name=vgb016] option[value='20-已婚']").css("color","#999999");
$("select[name=vgs906] option[value='10-常住']").attr("disabled","disabled");
$("select[name=vgs906] option[value='10-常住']").css("color","#999999");
$("select[name=vgs906] option[value='20-暂住']").attr("disabled","disabled");
$("select[name=vgs906] option[value='20-暂住']").css("color","#999999");
$("select[name=vgs906] option[value='30-不住']").attr("disabled","disabled");
$("select[name=vgs906] option[value='30-不住']").css("color","#999999");
$("select[name=vgb021] option[value='10-配偶']").attr("disabled","disabled");
$("select[name=vgb021] option[value='10-配偶']").css("color","#999999");
$("select[name=vgb021] option[value='20-子']").attr("disabled","disabled");
$("select[name=vgb021] option[value='20-子']").css("color","#999999");
$("select[name=vgb021] option[value='30-女']").attr("disabled","disabled");
$("select[name=vgb021] option[value='30-女']").css("color","#999999");
$("select[name=vgb021] option[value='40-孙子、孙女或外孙子、外孙女']").attr("disabled","disabled");
$("select[name=vgb021] option[value='40-孙子、孙女或外孙子、外孙女']").css("color","#999999");
$("select[name=vgb021] option[value='50-父母']").attr("disabled","disabled");
$("select[name=vgb021] option[value='50-父母']").css("color","#999999");
$("select[name=vgb021] option[value='60-祖父母或外祖父母']").attr("disabled","disabled");
$("select[name=vgb021] option[value='60-祖父母或外祖父母']").css("color","#999999");
$("select[name=vgb021] option[value='70-兄弟姐妹']").attr("disabled","disabled");
$("select[name=vgb021] option[value='70-兄弟姐妹']").css("color","#999999");
$("select[name=vgb021] option[value='80-其他']").attr("disabled","disabled");
$("select[name=vgb021] option[value='80-其他']").css("color","#999999");
$("select[name=vgb021] option[value='90-姑母']").attr("disabled","disabled");
$("select[name=vgb021] option[value='90-姑母']").css("color","#999999");
//添加结束
var hgb103v='${hgb103v}';
$.fn. zTree.init($("#treeDemo4"), setting4, zNodes4);
//初始化户籍所在地
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
//初始化流出地
$.fn.zTree.init($("#treeDemo1"), setting1, zNodes1);
//初始化现居住地
$.fn.zTree.init($("#treeDemo2"), setting2, zNodes2);
$.fn.zTree.init($("#treeDemo5"), setting5, zNodes5);
$.fn.zTree.init($("#treeDemo6"), setting6, zNodes6);
$.fn.zTree.init($("#treeDemo7"), setting7, zNodes7);
//表单校验
$("#editForm").validate({
rules: {
gb001: {
required: true,
cnRangelength: [0,30]
},
vgb002: {
required: true
},
// gs190: {
// required: true,
// pinyin:true,
//cnRangelength: [0,30]
// },
gb011:{
id_card: true,
uniqueIdcard:true
},
gb012:{
required: true
},
vgb015:{
required: true
},
vgb013:{
required: true
},
// gs906:{
// required: true,
// },
// gs950:{
// required: true,
// },
gb103:{
required: true
},
vgs911:{
required: true
},
gs912:{
required: true
},
vgb016:{
required: true
},
vgb021:{
required: true
},
changeType:{
required: true
},
gs1603:{
mobile: true
},
gs923:{
isTel: true
},
gs914:{
cnRangelength: [0,30]
},
//配偶信息
gb022:{
cnRangelength: [0,30]
},
gs191:{
pinyin:true,
cnRangelength: [0,30]
},
gb023:{
id_card: true
},
//父亲信息
gb025:{
cnRangelength: [0,30]
},
gb026:{
id_card: true
},
//母亲信息
gb028:{
cnRangelength: [0,30]
},
gb029:{
id_card: true
},
gs181:{
cnRangelength: [0,32],
maxlength: 32
},
gb604:{
cnRangelength: [0,20],
maxlength: 20
},
gs183:{
cnRangelength: [0,32],
maxlength: 32
},
gs905:{
cnRangelength: [0,30],
maxlength: 30
},
gs406:{
maxlength: 30
},
gs999:{
cnRangelength: [0,100]
},
gb035:{
required: true
},
//补充校验
gs903:{
cnRangelength: [0,30]
},
gs904:{
cnRangelength: [0,30]
},
gs930:{
cnRangelength: [0,100]
}
},submitHandler:function(form){
var gb103=$("#gb103").val();
var dwdzType=$("#dwdzType").val();
var gb003=$("#gb003").val();
var xjzdType=$("#xjzdType").val();
var gb005=$("#gb005").val();
var hjszdType=$("#hjszdType").val();
if(gb103==''){
$.validator.errorShow($("#deptName4"),'单位地址不能为空');
return false;
}else if(gb103 !='' && dwdzType=='2'){
$.validator.errorShow($("#deptName4"),'请填写单位地址为社(组)级以下单位');
return false;
} else if(gb003==''){
$.validator.errorShow($("#deptName2"),'现居住地不能为空');
return false;
}else if(gb003 !='' && xjzdType=='2'){
$.validator.errorShow($("#deptName2"),'请填写现居住地为社(组)级以下单位');
return false;
}else if(gb005==''){
$.validator.errorShow($("#deptName"),'户籍所在地不能为空');
return false;
}else if(gb005 !='' && hjszdType=='2'){
$.validator.errorShow($("#deptName"),'请填写户籍所在地为社(组)级以下单位');
return false;
}
else{
$.showLoad({isMask:true});
$.ajax({
type: "POST",
url:"${ctx}/peoBase/peopleSave",
data:$('#editForm').serialize()+"&peopleHead="+$("input[name='peopleHead']").val(),
dataType : "json",
error: function(request) {
alert("Connection error");
},
success: function(data) {
$.hideLoad();
}
});
}
}
});
});
//户籍所在地组织机构
var gb103v='${gb103v}';
var hgb103v='${hgb103v}';
var isParentv='${isParentv}';
var setting = {
async: {
enable: true,
url:path+"/sys/departmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick
}
};
var zNodes =[{ id:gb103v, pId:1, name:hgb103v, isParent:isParentv,seq:1}];
function beforeClick(treeId, treeNode) {
var check = (treeNode && !treeNode.isParent);
if (!check) alert("只能选择城市...");
return check;
}
function onClick(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName");
//判断值超出23位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
if(cityId.length>=12){
$("#deptName").attr("title",v);
$("#deptId").val(nodes[0].tld);
$("#hgb005").val(v);
$("#gb005").val(cityId);
if(isParent==false){;
$("#hjszdType").val("1");
}else{
$("#hjszdType").val("2");
}
//收起下拉框
$('#treeDemo').slideUp('fast');
}
}
function showMenu() {
var cityObj = $("#deptName");
var cityOffset = $("#deptName").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown", onBodyDown);
}
function hideMenu() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown", onBodyDown);
}
function onBodyDown(event) {
if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu();
}
}
//流出地址组织机构
var setting1 = {
async: {
enable: true,
url:path+"/sys/departmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick1
}
};
var zNodes1 =[
{ id:62, pId:1, name:"甘肃省", isParent:true,seq:1}
];
function beforeClick(treeId, treeNode) {
var check = (treeNode && !treeNode.isParent);
if (!check) alert("只能选择城市...");
return check;
}
function onClick1(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo1"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName1");
//判断值超出11位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
$("#deptName1").attr("title",v);
$("#deptId1").val(nodes[0].tld);
$("#hgs920").val(v);
$("#gs920").val(cityId);
if(isParent==false){
$("#dwdzType").val("1");
}else{
$("#dwdzType").val("2");
}
//收起下拉框
$('#treeDemo1').slideUp('fast');
}
function showMenu1() {
var cityObj = $("#deptName1");
var cityOffset = $("#deptName1").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown1", onBodyDown1);
}
function hideMenu1() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown1", onBodyDown1);
}
function onBodyDown1(event) {
if (!(event.target.id == "menuBtn1" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu1();
}
}
//现居住地
var setting2 = {
async: {
enable: true,
url:path+"/sys/departmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick2
}
};
var zNodes2 =[{ id:gb103v, pId:1, name:hgb103v, isParent:isParentv,seq:1}];
function beforeClick(treeId, treeNode) {
var check = (treeNode && !treeNode.isParent);
if (!check) alert("只能选择城市...");
return check;
}
function onClick2(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo2"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName2");
//判断值超出11位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
$("#deptName2").attr("title",v);
$("#deptId2").val(nodes[0].tld);
$("#hgb003").val(v);
$("#gb003").val(cityId);
if(isParent==false){
$("#xjzdType").val("1");
}else{
$("#xjzdType").val("2");
}
//收起下拉框
$('#treeDemo2').slideUp('fast');
}
function showMenu2() {
var cityObj = $("#deptName2");
var cityOffset = $("#deptName2").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown2", onBodyDown2);
}
function hideMenu2() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown2", onBodyDown2);
}
function onBodyDown2(event) {
if (!(event.target.id == "menuBtn2" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu2();
}
}
//单位地址
var setting4 = {
async: {
enable: true,
url:path+"/sys/departmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick4
}
};
var zNodes4 = [{ id:gb103v, pId:1, name:hgb103v, isParent:isParentv,seq:1}];
function beforeClick(treeId, treeNode) {
var check = (treeNode && !treeNode.isParent);
if (!check) alert("只能选择城市...");
return check;
}
function onClick4(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo4"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName4");
//判断值超出11位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
$("#deptName4").attr("title",v);
$("#deptId4").val(nodes[0].tld);
$("#hgb103").val(v);
$("#gb103").val(cityId);
if(isParent==false){
$("#dwdzType").val("1");
}else{
$("#dwdzType").val("2");
}
//收起下拉框
$('#treeDemo4').slideUp('fast');
}
function showMenu4() {
var cityObj = $("#deptName4");
var cityOffset = $("#deptName4").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown4", onBodyDown4);
}
function hideMenu4() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown4", onBodyDown4);
}
function onBodyDown4(event) {
if (!(event.target.id == "menuBtn4" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu4();
}
}
//全国户籍地
var setting5 = {
async: {
enable: true,
url:path+"sys/allDepartmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick5
}
};
var zNodes5 =[
{ id:1, pId:1, name:"全国", isParent:true,seq:1}
];
function beforeClick(treeId, treeNode) {
var check = (treeNode && !treeNode.isParent);
if (!check) alert("只能选择城市...");
return check;
}
function onClick5(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo5"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName2");
//判断值超出11位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
$("#deptName2").attr("title",v);
$("#deptId2").val(nodes[0].tld);
$("#hgb003").val(v);
$("#gb003").val(cityId);
if(isParent==false){
$("#xjzdType").val("1");
}else{
$("#xjzdType").val("2");
}
//收起下拉框
$('#treeDemo5').slideUp('fast');
}
function showMenu5() {
var cityObj = $("#deptName2");
var cityOffset = $("#deptName2").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown5", onBodyDown5);
}
function hideMenu5() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown5", onBodyDown5);
}
function onBodyDown5(event) {
if (!(event.target.id == "menuBtn5" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu5();
}
}
//全国户籍地
var setting6 = {
async: {
enable: true,
url:path+"sys/allDepartmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick6
}
};
var zNodes6 =[
{ id:1, pId:1, name:"全国", isParent:true,seq:1}
];
function onClick6(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo6"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName");
//判断值超出11位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
$("#deptName").attr("title",v);
$("#deptId").val(nodes[0].tld);
$("#hgb005").val(v);
$("#gb005").val(cityId);
if(isParent==false){
$("#hjszdType").val("1");
}else{
$("#hjszdType").val("2");
}
//收起下拉框
$('#treeDemo6').slideUp('fast');
}
function showMenu6() {
var cityObj = $("#deptName");
var cityOffset = $("#deptName").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown6", onBodyDown6);
}
function hideMenu6() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown6", onBodyDown6);
}
function onBodyDown6(event) {
if (!(event.target.id == "menuBtn6" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu6();
}
}
//流出全国户籍地
var setting7 = {
async: {
enable: true,
url:path+"sys/allDepartmenttree",
autoParam:["id", "name"],
otherParam:{"otherParam":"zTreeAsyncTest"}
},
view: {
dblClickExpand: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
//beforeClick: beforeClick,
onClick: onClick7
}
};
var zNodes7 =[
{ id:1, pId:1, name:"全国", isParent:true,seq:1}
];
function onClick7(e, treeId, treeNode) {
$('.error-info-checkedbox').remove();
$('.erro').removeClass('erro');
var zTree = $.fn.zTree.getZTreeObj("treeDemo7"),
nodes = zTree.getSelectedNodes(),
v = "";
cityId = "";
isParent="";
nodes.sort(function compare(a,b){return a.id-b.id;});
//alert(nodes[0].id);
v=nodes[0].name;
cityId = nodes[0].id;
isParent = nodes[0].isParent;
//获取多个时
//for (var i=0, l=nodes.length; i<l; i++) {
// v += nodes[i].name + ",";
//}
//if (v.length > 0 ) v = v.substring(0, v.length-1);
var cityObj = $("#deptName1");
//判断值超出11位为...否则显示全部
if(v.length>22){
cityObj.html(v.substring(0,22)+"...");
}else{
cityObj.html(v);
}
$("#deptName1").attr("title",v);
$("#deptId1").val(nodes[0].tld);
$("#hgs920").val(v);
$("#gs920").val(cityId);
if(isParent==false){
$("#dwdzType").val("1");
}else{
$("#dwdzType").val("2");
}
//收起下拉框
$('#treeDemo7').slideUp('fast');
}
function showMenu7() {
var cityObj = $("#deptName1");
var cityOffset = $("#deptName1").offset();
$("#menuContent").slideDown("fast");
$("body").bind("mousedown7", onBodyDown7);
}
function hideMenu7() {
$("#menuContent").fadeOut("fast");
$("body").unbind("mousedown7", onBodyDown7);
}
function onBodyDown7(event) {
if (!(event.target.id == "menuBtn7" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
hideMenu7();
}
}
var maxsize = 120*1024;//2M
var errMsg = "上传的图片不能超过120k!!!";
var tipMsg = "您的浏览器暂不支持计算上传文件的大小,确保上传文件不要超过120k,建议使用IE、FireFox、Chrome浏览器。";
var browserCfg = {};
var ua = window.navigator.userAgent;
if (ua.indexOf("MSIE")>=1){
browserCfg.ie = true;
}else if(ua.indexOf("Firefox")>=1){
browserCfg.firefox = true;
}else if(ua.indexOf("Chrome")>=1){
browserCfg.chrome = true;
}
//图片上传预览 IE是用了滤镜。
function previewImage(file)
{
var MAXWIDTH = 128;
var MAXHEIGHT = 140;
var div = document.getElementById('img');
if (file.files && file.files[0])
{
div.innerHTML ='';
var img = document.getElementById('imghead');
img.onload = function(){
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
img.width = rect.width;
img.height = rect.height;
// img.style.marginLeft = rect.left+'px';
img.style.marginTop = rect.top+'px';
}
var reader = new FileReader();
reader.onload = function(evt){img.src = evt.target.result;}
reader.readAsDataURL(file.files[0]);
}
else //兼容IE
{
var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
file.select();
var src = document.selection.createRange().text;
div.innerHTML = '';
var img = document.getElementById('imghead');
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
div.innerHTML = "";
}
try{
if(file.value==""){
alert("请先选择上传文件");
file.value=""
return false;
}
var filesize = 0;
if(browserCfg.firefox || browserCfg.chrome ){
filesize = file.files[0].size;
}else if(browserCfg.ie){
var obj_img = document.getElementById('imghead');
obj_img.dynsrc=file.value;
filesize = obj_img.fileSize;
}else{
return true;
}
if(filesize==-1){
// alert(tipMsg);
file.value=""
return false;
}else if(filesize>maxsize){
alert(errMsg);
file.value=""
return false;
}else{
var filename = file.value;
var mime = filename.toLowerCase().substr(filename.lastIndexOf("."));
if(mime==".jpg"||mime==".png"||mime==".bmp")
{
return true;
} else
{
alert("图片格式不正确");
file.value=""
return false;
}
}
}catch(e){
//alert(e);
file.value=""
return false;
}
}
function clacImgZoomParam( maxWidth, maxHeight, width, height ){
var param = {top:0, left:0, width:width, height:height};
if( width>maxWidth || height>maxHeight )
{
rateWidth = width / maxWidth;
rateHeight = height / maxHeight;
if( rateWidth > rateHeight )
{
param.width = maxWidth;
param.height = Math.round(height / rateWidth);
}else
{
param.width = Math.round(width / rateHeight);
param.height = maxHeight;
}
}
param.left = Math.round((maxWidth - param.width) / 2);
param.top = Math.round((maxHeight - param.height) / 2);
return param;
}
$(".fancybox-effects-a").fancybox({
helpers: {
title : {
type : 'outside'
},
overlay : {
speedOut : 0
}
}
});
// Ajax重命名校验
$.uniqueValidate('uniqueIdcard', '${ctx}/peoBase/checkIdCard', ['gb011','gb011old'], '对不起,这个身份证号重复了');
//获得配偶信息
function getInfo(){
var gb016v = $("#gb016").children("option:selected").prop("value");
var gs943v = $("#gs943").prop("value");
if(gb016v=='21-初婚' && gs943v!=''){
var datas = {
gs943:gs943v,
gb000:$("#gb000").prop("value"),
};
$.ajax({
url:"${ctx}/peoBase/getInfo",
dataType:"JSON",
type:"POST",
data:datas,
success:function(data){
if(data.state==1){
$("#gb022").val("");
$("#gb023").val("");
}else{
$("#gb022").val(data.GB001);
$("#gb023").val(data.GB011);
}
}
});
}else{
$("#gb022").val("");
$("#gb023").val("");
}
}
首页>全员管理><c:if test="${empty peoBaseInfo.peoBaseId}"><c:if test="${empty peoBaseInfo.gb000}">新增一户</c:if><c:if test="${not empty peoBaseInfo.gb000}">同户新增</c:if></c:if><c:if test="${not empty peoBaseInfo.peoBaseId}">编辑</c:if>
<c:if test="${peoBaseInfo.photo!=null}">
<div class="peo-photo">
<div class="img" id="img">
<a class="fancybox-effects-a" href="${ctx}${peoBaseInfo.photo}" title="" id="pre"><img id="imghead" src='${ctx}${peoBaseInfo.photo}' width="128" height="140"></a></div>
<div class="peo-photo-input"><input type="file" onchange="previewImage(this)" name="peopleHead" id="peopleHead"/></div>
</div>
</c:if>
<c:if test="${peoBaseInfo.photo==null}">
<div class="peo-photo">
<div class="img" id="img">
<a class="fancybox-effects-a" href="${ctx}/res/skin/default/image/photo_img.jpg" title="" id="pre"><img id="imghead" src='${ctx}/res/skin/default/image/photo_img.jpg?t='+></a></div>
<div class="peo-photo-input"><input type="file" onchange="previewImage(this)" name="peopleHead"/></div>
</div>
</c:if>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b">*</b>姓名:</div>
<div class="peo-input"><input type = "text" id="gb001" name = "gb001" value="${peoBaseInfo.gb001}" />
<input type = "hidden" id="photo" name = "photo" value="${peoBaseInfo.photo}" />
</div>
</div>
<div class="peo-layout">
<div class="peo-title">身份证号:</div>
<div class="peo-input">
<input type = "text" id="gb011" name = "gb011" class="peo-input" value="${peoBaseInfo.gb011}"/>
<input type = "hidden" id="gb011old" name="gb011old" class="peo-input" value="${peoBaseInfo.gb011}"/>
</div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b">*</b>性别:</div>
<div class="peo-input"><gsww:cacheTag name="vgb002" type="select" tagKey="gb002"
value="${fn:trim(peoBaseInfo.gb002)}-${fn:trim(peoBaseInfo.hgb002)}" id="gb002"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gb002" value="${peoBaseInfo.gb002}">
<input type="hidden" name="hgb002" value="${peoBaseInfo.hgb002}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b">*</b>出生日期:</div>
<div class="peo-input"><input type = "text" id="gb012" name = "gb012" class="peo-input Wdate" value="${peoBaseInfo.gb012}" onfocus="WdatePicker({maxDate: '%y-%M-%d'})"/></div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b">*</b>民族:</div>
<div class="peo-input"><gsww:cacheTag name="vgb013" type="select" tagKey="gb013"
value="${fn:trim(peoBaseInfo.gb013)}-${fn:trim(peoBaseInfo.hgb013)}" id="gb013" style=""
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gb013" value="${peoBaseInfo.gb013}">
<input type="hidden" name="hgb013" value="${peoBaseInfo.hgb013}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b">*</b>进入系统日期:</div>
<div class="peo-input"><input type = "text" id="gb035" name = "gb035" class="peo-input Wdate" onFocus="WdatePicker({maxDate: '%y-%M-%d'})" value="${peoBaseInfo.gb035}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title">门牌号:</div>
<div class="peo-input"><input type = "text" id="gs914" name = "gs914" class="peo-input" value="${peoBaseInfo.gs914}"/>
</div>
</div>
<!-- 添加单位地址 -->
<div class="peo-layout">
<input type="hidden" id ="oldgb103" name="oldgb103" value="${peoBaseInfo.gb103}"/>
<input type="hidden" id ="gb103" name="gb103" value="${peoBaseInfo.gb103}"/>
<input type="hidden" id ="hgb103" name="hgb103" value="${peoBaseInfo.hgb103}"/>
<c:if test="${empty peoBaseInfo.peoBaseId && empty peoBaseInfo.gb000}"><input type="hidden" id ="dwdzType" name="dwdzType" value="2"/> </c:if>
<c:if test="${not empty peoBaseInfo.peoBaseId && not empty peoBaseInfo.gb000}"><input type="hidden" id ="dwdzType" name="dwdzType" value="1"/> </c:if>
<div class="peo-title"><b class="peo-b" >*</b>单位地址:</div>
<div class="peo-input">
<div class="form-treebox select-radio box" style="background: #ffffff;height: 25px;line-height: 25px;" id="menuBtn4" onclick="showMenu4(); return false;">
<div class="form-selectinput" style="color: #4C5155;font-size: 14px;" ><i class="from-selecticon" ></i>
<span id="deptName4" title="${peoBaseInfo.hgb103}">
<c:if test="${not empty peoBaseInfo.hgb103}">
<c:choose>
<c:when test="${fn:length(peoBaseInfo.hgb103) >22}">
<c:out
value="${fn:substring(peoBaseInfo.hgb103,0,22)}..." />
</c:when>
<c:otherwise>
<c:out value="${peoBaseInfo.hgb103}" />
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${empty peoBaseInfo.hgb103}">
--------请选择--------
</c:if>
</span>
</div>
<ul id="treeDemo4" class="ztree" style="margin-top:0; ;positon:relative; z-index:99999;"></ul>
</div>
</div>
</div>
<!-- 单位地址结束 -->
<div class="peo-layout">
<input type="hidden" id ="gb003" name="gb003" value="${peoBaseInfo.gb003}"/>
<input type="hidden" id ="hgb003" name="hgb003" value="${peoBaseInfo.hgb003}"/>
<c:if test="${empty peoBaseInfo.peoBaseId && empty peoBaseInfo.gb000}"><input type="hidden" id ="xjzdType" name="xjzdType" value="2"/> </c:if>
<c:if test="${not empty peoBaseInfo.peoBaseId || not empty peoBaseInfo.gb000}"><input type="hidden" id ="xjzdType" name="xjzdType" value="1"/> </c:if>
<div class="peo-title"><b class="peo-b" >*</b>现居住地:</div>
<div class="peo-input">
<div class="form-treebox select-radio box" style="background: #ffffff;height: 25px;line-height: 25px;width:80%;" id="menuBtn2" onclick="showMenu2(); return false;">
<div class="form-selectinput" id="ssss" style="color: #4C5155;font-size: 14px;" ><i class="from-selecticon" ></i>
<span id="deptName2" title="${peoBaseInfo.hgb003}">
<c:if test="${not empty peoBaseInfo.hgb003}">
<c:choose>
<c:when test="${fn:length(peoBaseInfo.hgb003) >22}">
<c:out
value="${fn:substring(peoBaseInfo.hgb003, 0, 22)}..." />
</c:when>
<c:otherwise>
<c:out value="${peoBaseInfo.hgb003}" />
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${empty peoBaseInfo.hgb003}">
--------请选择--------
</c:if>
</span>
</div>
<ul id="treeDemo2" class="ztree" style="margin-top:0; ;positon:relative; z-index:99999;"></ul>
</div>
<div class="form-treebox select-radio box" style="background: rgb(52, 152, 219);height: 25px;line-height: 25px;margin-left:81%;width:18%;right:0;text-align: center;float:right;" id="menuBtn5" href="#" onclick="showMenu5(); return false;">
<div class="form-selectinput" id="ssss" style="color: #fff;font-size: 14px;" >选择</div>
<ul id="treeDemo5" class="ztree" style="margin-top:0; ;positon:relative; z-index:99999;"></ul>
</div>
</div>
</div>
<div class="peo-layout">
<div class="peo-title">现居住地说明:</div>
<div class="peo-input"><input type = "text" id="gs903" name = "gs903" class="peo-input" value="${peoDetailInfo.gs903}"/></div>
</div>
<div class="peo-layout">
<input type="hidden" id ="gb005" name="gb005" value="${peoBaseInfo.gb005}"/>
<input type="hidden" id ="hgb005" name="hgb005" value="${peoBaseInfo.hgb005}"/>
<c:if test="${empty peoBaseInfo.peoBaseId && empty peoBaseInfo.gb000}"><input type="hidden" id ="hjszdType" name="hjszdType" value="2"/> </c:if>
<c:if test="${not empty peoBaseInfo.peoBaseId || not empty peoBaseInfo.gb000}"><input type="hidden" id ="hjszdType" name="hjszdType" value="1"/> </c:if>
<div class="peo-title"><b class="peo-b">*</b>户籍所在地:</div>
<div class="peo-input" title="">
<div class="form-treebox select-radio box" style="background: #ffffff;height: 25px;line-height: 25px;width: 80%" id="menuBtn" onclick="showMenu(); return false;">
<div class="form-selectinput" style="color: #4C5155;font-size: 14px"><i class="from-selecticon"></i>
<%--<c:if test="${not empty peoBaseInfo.hgb005}">--%>
<span id="deptName" title="${peoBaseInfo.hgb005}">
<c:if test="${not empty peoBaseInfo.hgb005}">
<c:choose>
<c:when test="${fn:length(peoBaseInfo.hgb005) >22}">
<c:out
value="${fn:substring(peoBaseInfo.hgb005, 0, 22)}..." />
</c:when>
<c:otherwise>
<c:out value="${peoBaseInfo.hgb005}" />
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${empty peoBaseInfo.hgb005}">
--------请选择--------
</c:if>
</span>
<%-- </c:if>--%>
<%--
<c:if test="${empty peoBaseInfo.hgb005}">
<span id="deptName" title="${hgb103v}">
<c:if test="${not empty hgb103v}">
<c:choose>
<c:when test="${fn:length(hgb103v) >22}">
<c:out
value="${fn:substring(hgb103v, 0, 22)}..." />
</c:when>
<c:otherwise>
<c:out value="${hgb103v}" />
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${empty hgb103v}">
--------请选择--------
</c:if>
</span>
</c:if>
--%>
</div>
<ul id="treeDemo" class="ztree" style="margin-top:0; ;positon:relative; z-index:99999;"></ul>
</div>
<div class="form-treebox select-radio box" style="background: rgb(52, 152, 219);height: 25px;line-height: 25px;margin-left:81%;width:18%;right:0;text-align: center;float:right;" id="menuBtn6" href="#" onclick="showMenu6(); return false;">
<div class="form-selectinput" id="ssss" style="color: #F5F6F7;;font-size: 14px;" >选择</div>
<ul id="treeDemo6" class="ztree" style="margin-top:0; ;positon:relative; z-index:99999top: 33px;"></ul>
</div>
</div>
</div>
<div class="peo-layout">
<div class="peo-title">户籍所在地说明:</div>
<div class="peo-input"><input type = "text" id="gs904" name = "gs904" class="peo-input" value="${peoDetailInfo.gs904}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b" >*</b>户口性质:</div>
<div class="peo-input"><gsww:cacheTag name="vgb015" type="select" tagKey="gb015"
value="${fn:trim(peoBaseInfo.gb015)}-${fn:trim(peoBaseInfo.hgb015)}" id="gb015"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gb015" value="${peoBaseInfo.gb015}">
<input type="hidden" name="hgb015" value="${peoBaseInfo.hgb015}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title">人户状态:</div>
<div class="peo-input"> <gsww:cacheTag name="vgs906" type="select" tagKey="gs906"
value="${fn:trim(peoBaseInfo.gs906)}-${fn:trim(peoBaseInfo.hgs906)}" id="gs906"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gs906" value="${peoBaseInfo.gs906}">
<input type="hidden" name="hgs906" value="${peoBaseInfo.hgs906}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title">人员状况:</div>
<div class="peo-input"><gsww:cacheTag name="vgs950" type="select" tagKey="gs950"
value="${fn:trim(peoBaseInfo.gs950)}-${fn:trim(peoBaseInfo.hgs950)}" id="gs950"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gs950" value="${peoBaseInfo.gs950}">
<input type="hidden" name="hgs950" value="${peoBaseInfo.hgs950}">
</div>
</div>
<!-- 户籍变动和户籍变动日期之前在流出地址上面 -->
<div class="peo-layout">
<div class="peo-title"><b class="peo-b" >*</b>户籍变动类型:</div>
<div class="peo-input"><gsww:cacheTag name="vgs911" type="select" tagKey="gs911"
value="${fn:trim(peoDetailInfo.gs911)}-${fn:trim(peoDetailInfo.hgs911)}" id="gs911"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gs911" value="${peoDetailInfo.gs911}">
<input type="hidden" name="hgs911" value="${peoDetailInfo.hgs911}">
</div>
</div>
<%-- 之前此处被注释,后修改时放开并提到户口性质和人户状态后面 王维燕--%>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b" >*</b>户籍变动日期:</div>
<div class="peo-input"><input type = "text" id="gs912" name = "gs912" class="peo-input Wdate" onFocus="WdatePicker({maxDate: '%y-%M-%d'})" value="${peoDetailInfo.gs912}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b" >*</b>婚姻状况:</div>
<div class="peo-input"><gsww:cacheTag name="vgb016" type="select" tagKey="gb016"
value="${fn:trim(peoBaseInfo.gb016)}-${fn:trim(peoBaseInfo.hgb016)}" id="gb016"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gb016" value="${peoBaseInfo.gb016}">
<input type="hidden" name="hgb016" value="${peoBaseInfo.hgb016}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title">婚变日期:</div>
<div class="peo-input"><input type = "text" id="gs943" class="gs943" name = "gs943" class="peo-input Wdate" onFocus="WdatePicker({maxDate: '%y-%M-%d'})" value="${peoBaseInfo.gs943}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title"><b class="peo-b" >*</b>与户主关系:</div>
<div class="peo-input"><gsww:cacheTag name="vgb021" type="select" tagKey="gb021"
value="${fn:trim(peoBaseInfo.gb021)}-${fn:trim(peoBaseInfo.hgb021)}" id="gb021"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gb021" value="${peoBaseInfo.gb021}">
<input type="hidden" name="hgb021" value="${peoBaseInfo.hgb021}">
</div>
</div>
<%--<div class="peo-layout">
<div class="peo-title"><b class="peo-b" >*</b>变更类型:</div>
<div class="peo-input"><gsww:cacheTag name="changeType" type="select" tagKey="changeType"
value="${fn:trim(peoBaseInfo.changeTypeCode)}-${fn:trim(peoBaseInfo.changeType)}" id="changeType"
validate="required:false" sortText="false" ></gsww:cacheTag></div>
</div>
--%><div class="peo-layout">
<div class="peo-title">政治面貌:</div>
<div class="peo-input"> <gsww:cacheTag name="vgs908" type="select" tagKey="gs908"
value="${fn:trim(peoDetailInfo.gs908)}-${fn:trim(peoDetailInfo.hgs908)}" id="gs908"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gs908" value="${peoDetailInfo.gs908}">
<input type="hidden" name="hgs908" value="${peoDetailInfo.hgs908}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title">文化程度:</div>
<div class="peo-input"> <gsww:cacheTag name="vgb014" type="select" tagKey="gb014"
value="${fn:trim(peoDetailInfo.gb014)}-${fn:trim(peoDetailInfo.hgb014)}" id="gb014"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gb014" value="${peoDetailInfo.gb014}">
<input type="hidden" name="hgb014" value="${peoDetailInfo.hgb014}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title">所属行业:</div>
<div class="peo-input"> <gsww:cacheTag name="vgs931" type="select" tagKey="gs931"
value="${fn:trim(peoDetailInfo.gs931)}-${fn:trim(peoDetailInfo.hgs931)}" id="gs931"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gs931" value="${peoDetailInfo.gs931}">
<input type="hidden" name="hgs931" value="${peoDetailInfo.hgs931}">
</div>
</div>
<div class="peo-layout">
<div class="peo-title">从事职业:</div>
<div class="peo-input"> <gsww:cacheTag name="vgs932" type="select" tagKey="gs932"
value="${fn:trim(peoDetailInfo.gs932)}-${fn:trim(peoDetailInfo.hgs932)}" id="gs932"
validate="required:false" sortText="false" ></gsww:cacheTag>
<input type="hidden" name="gs932" value="${peoDetailInfo.gs932}">
<input type="hidden" name="hgs932" value="${peoDetailInfo.hgs932}">
</div>
</div>
<%--<div class="peo-layout">
<div class="peo-title">职务:</div>
<div class="peo-input"> <gsww:cacheTag name="gs1612" type="select" tagKey="gs1612"
value="${fn:trim(peoDetailInfo.gs1612)}-${fn:trim(peoDetailInfo.hgs1612)}" id="gs1612"
validate="required:false" sortText="false" ></gsww:cacheTag></div>
</div>
--%><div class="peo-layout">
<div class="peo-title">现工作单位:</div>
<div class="peo-input"><input type = "text" id="gs930" name = "gs930" class="peo-input" value="${peoDetailInfo.gs930}"/></div>
</div>
<%--<div class="peo-layout">
<div class="peo-title">移动电话:</div>
<div class="peo-input"><input type = "text" id="gs1603" name = "gs1603" class="peo-input" value="${peoBaseInfo.gs1603}"/></div>
</div>
--%>
<div class="peo-layout">
<div class="peo-title">联系电话:</div>
<div class="peo-input"><input type = "text" id="gs923" name = "gs923" class="peo-input" value="${peoBaseInfo.gs923}"/></div>
</div>
<div class="peo-line"></div>
<div class="peo-layout">
<div class="peo-title">配偶姓名:</div>
<div class="peo-input"><input type = "text" id="gb022" name = "gb022" class="peo-input" value="${peoBaseInfo.gb022}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title">配偶身份证号:</div>
<div class="peo-input"><input type = "text" id="gb023" name = "gb023" class="peo-input" value="${peoBaseInfo.gb023}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title">父亲姓名:</div>
<div class="peo-input"><input type = "text" id="gb025" name = "gb025" class="peo-input" value="${peoBaseInfo.gb025}"/></div>
</div>
<div class="peo-layout">
<div class="peo-title">父亲身份证号:</div>
<div class="peo-input"><input type = "text" id="gb026" name = "gb026" class="peo-input" value="${peoBas```