var curWwwPath = window.document.location.href; var ip = curWwwPath.substring(7, 20); var roleArray = []; var curCount; function SubmitUser() { ajaxLoading();// --遮罩-- if(!checkFrom()){ $.messager.defaults = { ok: "确定"}; $.messager.alert('提示信息',"
当前页面输入存在非法字符<\/div>"); ajaxLoadEnd(); return false; } if ($('#tb1').val() == "1") { SubmitOrgRegister(); } if ($('#tb2').val() == "1") { SubmitShipRegister(); } if ($('#tb3').val() == "1") { SubmitNaturalRegister(); } } function SetRemainTime2() { if (curCount == 0) { sms=""; window.clearInterval(InterValObj); $("#btnn2").removeAttr("disabled"); document.getElementById("btnn2").style.backgroundColor="#4F81BD"; $("#btnn2").val("重新发送验证码"); } else { curCount--; $("#btnn2").val("请在" + curCount + "秒内输入验证码"); } } function SetRemainTime3() { if (curCount == 0) { sms=""; window.clearInterval(InterValObj); $("#btnn3").removeAttr("disabled"); document.getElementById("btnn3").style.backgroundColor="#4F81BD"; $("#btnn3").val("重新发送验证码"); } else { curCount--; $("#btnn3").val("请在" + curCount + "秒内输入验证码"); } } function SetRemainTime1() { if (curCount == 0) { sms=""; window.clearInterval(InterValObj); $("#btnn1").removeAttr("disabled"); document.getElementById("btnn1").style.backgroundColor="#4F81BD"; $("#btnn1").val("重新发送验证码"); } else { curCount--; $("#btnn1").val("请在" + curCount + "秒内输入验证码"); } } function yzku(id) { var mobileId=''; if(id=='0'){ mobileId='mobile'; }else if(id=='1'){ mobileId='shipMobilePhone'; }else{ mobileId='mobileNatural'; } var logcode = $("#txt_yzm"+id).val(); if ($("#txt_yzm"+id).val().length == 4) { $.ajax({ type : "post", url : path + "/getcheck.jsp", dataType : "json", success : function(data) { $("#yzm_tip"+id).html(" "); if (data.code == logcode) { $("#yzm_tip"+id).html( ""); //$('#'+mobileId).removeAttr("disabled"); } else { $("#yzm_tip"+id).html( ""); //$('#'+mobileId).attr("disabled",true); $("#txt_yzm"+id).focus(); $("#txt_yzm"+id).click(); $("#txt_yzm"+id).onkeydown(); } } }); } else { $("#yzm_tip"+id).html( ""); //$('#'+mobileId).attr("disabled",true); } } var mobile=""; var infoid=""; function smss(id) { if(id=="btnn2"){mobile=$("#mobile").val();infoid="orginfo";} if(id=="btnn1"){mobile=$("#mobileNatural").val();infoid="naturalinfo";} if(id=="btnn3"){mobile=$("#shipMobilePhone").val();infoid="shipinfo";} var isMobile = /^(?:13\d|14\d|15\d|16\d|17\d|18\d|19\d)\d{5}(\d{3}|\*{3})$/; if (isMobile.test(mobile)) { $("#"+id+"").val("正在验证"); $.ajax({ type : "POST", url : projectName + "/verifyzcSms.do", dataType : 'json', data : { "mobile" : mobile }, success : function(result) { if(result.result==1){ $("#"+infoid+"").hide(); curCount =120; $("#"+id+"").attr("disabled", true); document.getElementById(""+id+"").style.backgroundColor = "#A4CBEB"; $("#"+id+"").val("请在" + curCount + "秒内输入验证码"); if(id=="btnn2"){InterValObj = window.setInterval(SetRemainTime2, 1000);} if(id=="btnn3"){InterValObj = window.setInterval(SetRemainTime3, 1000);} if(id=="btnn1"){InterValObj = window.setInterval(SetRemainTime1, 1000);} } if(result.result==0){ $("#"+id+"").val("请两分钟后重新获取验证码"); //$("#"+infoid+"").show(); } if(result.result==2){ $("#"+id+"").val("请求频繁两分钟后再试"); //$("#"+infoid+"").show(); } if(result.result==3){ $("#"+id+"").val("请求频繁10分钟内超过3次"); //$("#"+infoid+"").show(); } if(result.result==4){ $("#"+id+"").val("手机号格式错误!"); //$("#"+infoid+"").show(); } } }); }else{ $("#"+id+"").val("手机号格式错误"); } } var code=""; function CheckSms(id){ var yancode=""; if(id=="smsShip"){code=$("#shipVerifyCode").val();yancode="Shipyanzhengma";}; if(id=="smsOrg"){code=$("#verifyCode").val();yancode="Orgyanzhengma";}; if(id=="smsNatural"){code=$("#verifyCodeNatural").val();yancode="Naturalyanzhengma";}; if(curCount==0){ code=code+"#"; }; if(code.length==6){ $.ajax({ type : "POST", url : projectName + "/checkSms.do", dataType : 'json', data : { "verifyCode" : code }, success : function(result) { var bb ="bb"; if(result.result==1){ $("#"+yancode+"").hide(); }else{ $("#"+yancode+"").show(); }; } }); }else{ $("#"+yancode+"").show(); } }; //密码提交 $(function() { $(".tabct1 span").eq(0).css({ "background-color" : "#4F81BD", "color" : "white", "font-weight" : "600" }).siblings().css({ "background-color" : "#fff", "color" : "black", "font-weight" : "500" }); $("#tb1").css({ "display" : "block" }); $('#tb1').val("1"); $("#tb2").css({ "display" : "none" }); $('#tb2').val("0"); $("#tb3").css({ "display" : "none" }); $('#tb3').val("0"); $("#tb4").css({ "display" : "block" }); $("#tb5").css({ "display" : "none" }); $("#tb6").css({ "display" : "none" }); $(".tabct1 span").click(function() { var ckspan = $(this).index(); if(ckspan==1){ //window.open("http://180.169.34.36"); window.open("https://cspur.msa.gov.cn/ShipReportWeb/register/register.do"); //alert("系统暂未开放"); //alert("系统未开放"); return; } $(".tabct1 span").eq(ckspan).css({ "background-color" : "#4F81BD", "color" : "white", "font-weight" : "600" }).siblings().css({ "background-color" : "#fff", "color" : "black", "font-weight" : "500" }); switch (ckspan) { case 0: /*$("#tb1").css({ "display" : "block" }); $('#tb1').val("1"); $("#tb2").css({ "display" : "none" }); $('#tb2').val("0"); $("#tb3").css({ "display" : "none" }); $('#tb3').val("0"); $("#tb4").css({ "display" : "block" }); $("#tb5").css({ "display" : "none" }); $("#tb6").css({ "display" : "none" }); $("#term").empty();*/ //进入机构注册界面 // curWwwPath=base_path+"orgUser.do"; window.location.href=base_path+"/orgUserReg.do"; break; case 1: $("#tb1").css({ "display" : "none" }); $('#tb1').val("0"); $("#tb2").css({ "display" : "block" }); $('#tb2').val("1"); $("#tb3").css({ "display" : "none" }); $('#tb3').val("0"); $("#tb4").css({ "display" : "none" }); $("#tb5").css({ "display" : "none" }); $("#tb6").css({ "display" : "none" }); $("#term").empty(); break; case 2: /*$("#tb1").css({ "display" : "none" }); $('#tb1').val("0"); $("#tb2").css({ "display" : "none" }); $('#tb2').val("0"); $("#tb3").css({ "display" : "block" }); $('#tb3').val("1"); $("#tb4").css({ "display" : "none" }); $("#tb5").css({ "display" : "block" }); $("#tb6").css({ "display" : "block" }); $("#term").empty();*/ //进入到自然人注册界面 window.location.href=base_path+"/naturalReg.do"; break; } }); }); // 取出角色 var ra=0; function roleSelectValue(roleName, roleCode,isDefaultRole) { var html=""; roleArray[ra]=roleCode; if(isDefaultRole==""){ html = "" + "" + roleName + "<\/strong>" + "<\/span><\/a>"; }else{ html = "" + "" + roleName + "("+isDefaultRole+")<\/strong>" + "<\/span><\/a>"; } ra++; $(term).append(html); } function showRoleSelect(url) { document.getElementById('ff').src = ""; document.getElementById('ff').src = url; $('#winParent').show(); winStatus = true; } function Delete(obj) { $(obj).parent().remove(); } function closeWinParent() { $('#winParent').hide(); } function validateIdCard(obj) { var aCity = { 11 : "北京", 12 : "天津", 13 : "河北", 14 : "山西", 15 : "内蒙古", 21 : "辽宁", 22 : "吉林", 23 : "黑龙 江", 31 : "上海", 32 : "江苏", 33 : "浙江", 34 : "安徽", 35 : "福建", 36 : "江西", 37 : "山东", 41 : "河南", 42 : "湖 北", 43 : "湖南", 44 : "广东", 45 : "广西", 46 : "海南", 50 : "重庆", 51 : "四川", 52 : "贵州", 53 : "云南", 54 : "西 藏", 61 : "陕西", 62 : "甘肃", 63 : "青海", 64 : "宁夏", 65 : "新疆", 71 : "台湾", 81 : "香港", 82 : "澳门", 91 : "国 外" }; var iSum = 0; // var info = ""; var strIDno = obj; var idCardLength = strIDno.length; if (!/^\d{17}(\d|x)$/i.test(strIDno) && !/^\d{15}$/i.test(strIDno)) return false; if (aCity[parseInt(strIDno.substr(0, 2))] == null) return false; if (idCardLength == 15) { sBirthday = "19" + strIDno.substr(6, 2) + "-" + Number(strIDno.substr(8, 2)) + "-" + Number(strIDno.substr(10, 2)); var d = new Date(sBirthday.replace(/-/g, "/")); var dd = d.getFullYear().toString() + "-" + (d.getMonth() + 1) + "-" + d.getDate(); if (sBirthday != dd) return false; strIDno = strIDno.substring(0, 6) + "19" + strIDno.substring(6, 15); strIDno = strIDno + GetVerifyBit(strIDno); } var year = strIDno.substring(6, 10); if (year < 1900 || year > 2078) return false; strIDno = strIDno.replace(/x$/i, "a"); sBirthday = strIDno.substr(6, 4) + "-" + Number(strIDno.substr(10, 2)) + "-" + Number(strIDno.substr(12, 2)); var d = new Date(sBirthday.replace(/-/g, "/")); if (sBirthday != (d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d .getDate())) return false; for ( var i = 17; i >= 0; i--) iSum += (Math.pow(2, i) % 11) * parseInt(strIDno.charAt(17 - i), 11); if (iSum % 11 != 1) return false; var words = new Array(); words = new Array("11111119111111111", "12121219121212121"); for ( var k = 0; k < words.length; k++) { if (strIDno.indexOf(words[k]) != -1) { return false; } } return true; } var userType=""; function addRole() { app=""; i=0; ra=0; if ($('#tb1').val() == "1") { $('#slt_maritimeorg').val($('#slt_maritimeagency').attr("value")); if ($('#slt_maritimeorg').val() == "") { // alert($('#slt_maritimeorg').val()); alert("请选择海事机构!"); return; } $("#ttb4").val("ttb1"); $(term).html(""); userType="企业单位用户"; showRoleSelect(projectAllName + "/common/roleSelect.jsp"); } if ($('#tb2').val() == "1") { $('#slt_maritimeorg').val($('#slt_maritimeagencyShip').attr("value")); if ($('#slt_maritimeorg').val() == "") { alert("请选择海事机构!"); return; } $("#ttb4").val("ttb2"); $(term).html(""); userType="船舶用户"; showRoleSelect(projectAllName + "/common/roleSelect.jsp"); } if ($('#tb3').val() == "1") { $('#slt_maritimeorg') .val($('#slt_maritimeagencyNatural').attr("value")); if ($('#slt_maritimeorg').val() == "") { // alert($('#slt_maritimeorg').val()); alert("请选择海事机构!"); return; } $("#ttb4").val("ttb3"); // alert(HSJG); $(term).html(""); userType="自然人用户"; showRoleSelect(projectAllName + "/common/roleSelect.jsp"); } } function uploadFile() { openDialog(1); // alert(fileName); } function setFileName(fileName) { if ($('#tb1').val() == "1") { var arrFileName = fileName.split(","); if (arrFileName.length > 0) { $("#LicenseVlaue").tooltip('hide'); $("#License").empty(); } for ( var i = 0; i < arrFileName.length - 1; i++) { var arrFNTemp = arrFileName[i].split(";"); $("#License").append( '' + arrFNTemp[0] + '<\/a>'); $("#License").append(' '); } $("#License").append(' '); $("#License") .append( '重新上传附件<\/a>'); $("#orgbusinessLicense").val(fileName); } if ($('#tb3').val() == "1") { var arrFileName = fileName.split(","); if (arrFileName.length > 0) { $("#LicenseVlaueNatural").tooltip('hide'); $("#LicenseNatural").empty(); } for ( var i = 0; i < arrFileName.length - 1; i++) { var arrFNTemp = arrFileName[i].split(";"); $("#LicenseNatural").append( '' + arrFNTemp[0] + '<\/a>'); $("#LicenseNatural").append(' '); } $("#LicenseNatural").append(' '); $("#LicenseNatural") .append( '重新上传附件<\/a>'); $("#orgbusinessLicenseNatural").val(fileName); } } function openFile(obj) { var fileName = $(obj).attr("fileName"); var a = "http://192.168.0.24:7031/" + fileName; window.open(a); } /* * function CheckOrgCode(obj) { var orgCodeCheckUnique = $(obj).val(); $.ajax({ * async : false, type : "POST", url : projectName + * "/potal/userReg/orgCodeCheck.action", dataType : 'json', data : { * "orgCodeCheckUnique" : orgCodeCheckUnique }, success : function(result) { * * if (result.result == "1") { if ($("#orgCodeCheck").length > 0) { * $("#orgCodeCheck").remove(); } var html = "组织机构代码已存在!请重新输入<\/span>"; $(ZZJGDM).append(html); * document.getElementById("orgCodeCheck").style.opacity = "1"; * $("#orgCode").focus(); } if (result.result == "0") { if * ($("#orgCodeCheck").length > 0) { $("#orgCodeCheck").remove(); } * } } }); } */ function checkCBSBH() { var CBSBH = $("#shipIdNumber").val(); if (CBSBH != "" && CBSBH != "CN") { FindHSJGbyCBSBH(CBSBH); } } function checkMMSI(obj) { var mmsi = $(obj).val(); if (isNaN(mmsi)) { var html = "由9位非0开头数字组成!<\/span>"; $(MMSI).append(html); document.getElementById("shipMMSICheck").style.opacity = "1"; $("#shipMMSI").focus(); return false; } if (mmsi.length != 9) { var html = "由9位非0开头数字组成!<\/span>"; $(MMSI).append(html); document.getElementById("shipMMSICheck").style.opacity = "1"; $("#shipMMSI").focus(); return false; } if (mmsi < 100000000) { var html = "由9位非0开头数字组成!<\/span>"; $(MMSI).append(html); document.getElementById("shipMMSICheck").style.opacity = "1"; $("#shipMMSI").focus(); return false; } if ($('#shipMMSI').val() != "" && $("#shipMMSICheck").length > 0) { document.getElementById("shipMMSICheck").style.opacity = "0"; } return true; } //自然人身份证号唯一验证 function CheckNaturalIdNumber(obj) { if ($('#NaturalIdNumber').val() == "") { if ($("#NaturalIdNumberCheck").length > 0) { $("#NaturalIdNumberCheck").remove(); } var html = "身份证号码不能为空!<\/span>"; $(SFZHMNatural).append(html); document.getElementById("NaturalIdNumberCheck").style.opacity = "1"; $("#NaturalIdNumber").focus(); return; } if ($('#NaturalIdNumber').val() != "" && $("#NaturalIdNumberCheck").length > 0) { document.getElementById("NaturalIdNumberCheck").style.opacity = "0"; } var IdNumber = $('#NaturalIdNumber').val(); if (!validateIdCard(IdNumber)) { if ($("#NaturalIdNumberCheck").length > 0) { $("#NaturalIdNumberCheck").remove(); } var html = "身份证格式不正确!<\/span>"; $(SFZHMNatural).append(html); document.getElementById("NaturalIdNumberCheck").style.opacity = "1"; $("#NaturalIdNumber").focus(); return } var naturalIdNumberCheckUnique = $(obj).val(); $.ajax({ async : false, type : "POST", url : projectName + "/UserRegisterCheckUnique/CheckNaturalIdNumber.do", dataType : 'json', data : { "naturalIdNumberCheckUnique" : naturalIdNumberCheckUnique }, success : function(result) { if (result.result == "1") { if ($("#NaturalIdNumberCheck").length > 0) { $("#NaturalIdNumberCheck").remove(); } var html = "" + result.info + "<\/span>"; $(SFZHMNatural).append(html); document.getElementById("NaturalIdNumberCheck").style.opacity = "1"; $("#NaturalIdNumber").focus(); } if (result.result == "0") { if ($("#NaturalIdNumberCheck").length > 0) { $("#NaturalIdNumberCheck").remove(); } } }, error : function(result) { $.messager.alert('提示信息', "
" + result.info + "<\/div>"); } }); } //手机号验证 function CheckMobile(obj) { //非空验证 if ($(obj).val() == "") { if ($("#mobileCheck").length > 0) { $("#mobileCheck").remove(); } var html = "手机号码不能为空!<\/span>"; $(HM).append(html); document.getElementById("mobileCheck").style.opacity = "1"; $(obj).focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($(obj).val() != "" && $("#mobileCheck").length > 0) { document.getElementById("mobileCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } //格式验证 var isMobile = /^1[3|4|5|6|7|8|9]\d{9}$/; var mobile = $(obj).val(); if(!isMobile.test(mobile)){ if($("#mobileCheck").length > 0){ $("#mobileCheck").remove(); } var html = "手机号码格式不正确!<\/span>"; $(HM).append(html); document.getElementById("mobileCheck").style.opacity = "1"; $(obj).focus(); ajaxLoadEnd();//--移除遮罩-- return false; } //唯一验证 $.ajax({ async : false, type : "POST", url : projectName + "/UserRegisterCheckUnique/CheckMobile.do", dataType : 'json', data : { "mobile" : mobile }, success : function(result) { if (result.result == "1") { if ($("#mobilePhoneCheck").length > 0) { $("#mobilePhoneCheck").remove(); } var html = "手机号已存在<\/span>"; $(SFZHMNatural).append(html); document.getElementById("mobilePhoneCheck").style.opacity = "1"; $(obj).focus(); } if (result.result == "0") { if ($("#mobilePhoneCheck").length > 0) { $("#mobilePhoneCheck").remove(); } } }, error : function(result) { $.messager.alert('提示信息', "
" + result.info + "<\/div>"); } }); } function applySubmit(appid) { var index = 0; $('a.selected').each(function() { var this_ = this; var authcode = 'auth.code[' + index + ']'; var roleflow = 'role.flow[' + index + ']'; var authapp = 'auth.app[' + index + ']'; index = index + 1; $(this_).children().eq(1).attr('name', authcode); $(this_).children().eq(2).attr('name', roleflow); $(this_).children().eq(3).attr('name', authapp); }); if ($('#tb1').val() == "1") { $("#maritimeOrgCode").val($("#slt_maritimeorg").val()); $("#userTpye").val("01"); $("#applicant").val($("#orgCode").val()); $("#ipAddress").val(ip); $("#appid").val(appid); $("#userName").val($("#regName").val()); } if ($('#tb2').val() == "1") { $("#applicant").val($("#shipIdNumber").val()); $("#userTpye").val("02"); $("#ipAddress").val(ip); $("#appid").val(appid); $("#userName").val($("#ShipName").val()); } if ($('#tb3').val() == "1") { $("#maritimeOrgCode").val($("#slt_maritimeorgNatural").val()); $("#applicant").val($("#NaturalIdNumber").val()); $("#userTpye").val("03"); $("#ipAddress").val(ip); $("#appid").val(appid); $("#userName").val($("#NaturalName").val()); } } function hideMust(obj) { if (obj.checked == true) { document.getElementById("ShipZSBH").style.opacity = "1"; document.getElementById("ShipYXQZ").style.opacity = "1"; document.getElementById("ShipFZJGMC").style.opacity = "1"; document.getElementById("ShipBCHDDJYFW").style.opacity = "1"; } else { document.getElementById("ShipZSBH").style.opacity = "0"; document.getElementById("ShipYXQZ").style.opacity = "0"; document.getElementById("ShipFZJGMC").style.opacity = "0"; document.getElementById("ShipBCHDDJYFW").style.opacity = "0"; } } //中文验证 function zw() { var reg = /([\u4E00-\u9FA5])+/; if(reg.test($("#orgCode").val())){ var html = "机构代码不能输入汉字!<\/span>"; $("#ZZJGDM").append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); return false; //ajaxLoadEnd();//--移除遮罩-- } if ($('#orgCode').val() == "") { var html = "机构代码不能为空!<\/span>"; $(ZZJGDM).append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } var reg = /([\u4E00-\u9FA5])+/; if(reg.test($('#orgCode').val())){ var html = "机构代码不能输入汉字!<\/span>"; $(ZZJGDM).append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } var reg1 = /^[0-9a-zA-Z]{9}$|^[0-9a-zA-Z]{18}$/; if(!reg1.test($('#orgCode').val())){ var html = "请输入9或18位数字或英文字母!<\/span>"; $(ZZJGDM).append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#orgCode').val() != "" && $("#orgCodeCheck").length > 0) { document.getElementById("orgCodeCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } /*if ($('#regName').val() == "") { var html = "机构名称不能为空!<\/span>"; $(YYZZZCMC).append(html); document.getElementById("regNameCheck").style.opacity = "1"; $("#regName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#regName').val() != "" && $("#regNameCheck").length > 0) { document.getElementById("regNameCheck").style.opacity = "0"; } if ($('#regAddress').val() == "") { var html = "办公地址不能为空!<\/span>"; $(YYZZZCDZ).append(html); document.getElementById("regAddressCheck").style.opacity = "1"; $("#regAddress").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#regAddress').val() != "" && $("#regAddressCheck").length > 0) { document.getElementById("regAddressCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } if ($('#linkName').val() == "") { var html = "联系人姓名不能为空!<\/span>"; $(LXRXM).append(html); document.getElementById("linkNameCheck").style.opacity = "1"; $("#linkName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#linkName').val() != "" && $("#linkNameCheck").length > 0) { document.getElementById("linkNameCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- }*/ /*if ($('#mobile').val() == "") { if ($("#mobileCheck").length > 0) { $("#mobileCheck").remove(); } var html = "联系人手机不能为空!<\/span>"; $(HQ).append(html); document.getElementById("mobileCheck").style.opacity = "1"; $("#mobile").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#mobile').val() != "" && $("#mobileCheck").length > 0) { document.getElementById("mobileCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- }*/ /*var isMobile = /^1[3|4|5|6|7|8|9]\d{9}$/; var mobile = $("#mobile").val(); if(!isMobile.test(mobile)){ if($("#mobileCheck").length > 0){ $("#mobileCheck").remove(); } var html = "手机号码格式不正确!<\/span>"; $(HQ).append(html); document.getElementById("mobileCheck").style.opacity = "1"; $("#mobile").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#verifyCode').val() == "") { var html = "短信验证码不能为空!<\/span>"; $(YZM).append(html); document.getElementById("verifyCodeCheck").style.opacity = "1"; ajaxLoadEnd();//--移除遮罩-- $("#verifyCode").focus(); return false; } if ($('#verifyCode').val() != "" && $("#verifyCodeCheck").length > 0) { document.getElementById("verifyCodeCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } if ($('#email').val() == "") { if ($("#emailCheck").length > 0) { $("#emailCheck").remove(); } var html = "电子邮箱不能为空!<\/span>"; $(YJ).append(html); document.getElementById("emailCheck").style.opacity = "1"; $("#email").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#email').val() != "" && $("#emailCheck").length > 0) { document.getElementById("emailCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } var isEmail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// 验证邮箱的正则 var email = $('#email').val(); if (!isEmail.test(email)) { if ($("#emailCheck").length > 0) { $("#emailCheck").remove(); } var html = "邮箱格式不正确!<\/span>"; $(YJ).append(html); document.getElementById("emailCheck").style.opacity = "1"; $("#email").focus(); ajaxLoadEnd();//--移除遮罩-- return false; }*/ } function SubmitOrgRegister() { if ($('#orgCode').val() == "") { var html = "机构代码不能为空!<\/span>"; $(ZZJGDM).append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } var reg = /([\u4E00-\u9FA5])+/; if(reg.test($('#orgCode').val())){ var html = "机构代码不能输入汉字!<\/span>"; $(ZZJGDM).append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } var reg1 = /^[0-9a-zA-Z]{9}$|^[0-9a-zA-Z]{18}$/; if(!reg1.test($('#orgCode').val())){ var html = "请输入9或18位数字或英文字母!<\/span>"; $(ZZJGDM).append(html); document.getElementById("orgCodeCheck").style.opacity = "1"; $("#orgCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#orgCode').val() != "" && $("#orgCodeCheck").length > 0) { document.getElementById("orgCodeCheck").style.opacity = "0"; } if ($('#regName').val() == "") { var html = "机构名称不能为空!<\/span>"; $(YYZZZCMC).append(html); document.getElementById("regNameCheck").style.opacity = "1"; $("#regName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; }else{ var html = ""; $(YYZZZCMC).append(html); } if ($('#regName').val() != "" && $("#regNameCheck").length > 0) { document.getElementById("regNameCheck").style.opacity = "0"; } if ($('#regAddress').val() == "") { var html = "办公地址不能为空!<\/span>"; $(YYZZZCDZ).append(html); document.getElementById("regAddressCheck").style.opacity = "1"; $("#regAddress").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#regAddress').val() != "" && $("#regAddressCheck").length > 0) { document.getElementById("regAddressCheck").style.opacity = "0"; } if ($('#linkName').val() == "") { var html = "联系人姓名不能为空!<\/span>"; $(LXRXM).append(html); document.getElementById("linkNameCheck").style.opacity = "1"; $("#linkName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#linkName').val() != "" && $("#linkNameCheck").length > 0) { document.getElementById("linkNameCheck").style.opacity = "0"; } if ($('#txt_yzm').val() == ""||$('#txt_yzm').val() =="请输入验证码") { return false; } if ($('#mobile').val() == "") { if ($("#mobileCheck").length > 0) { $("#mobileCheck").remove(); } var html = "联系人手机不能为空!<\/span>"; $(HQ).append(html); document.getElementById("mobileCheck").style.opacity = "1"; $("#mobile").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#mobile').val() != "" && $("#mobileCheck").length > 0) { document.getElementById("mobileCheck").style.opacity = "0"; } var isMobile = /^1[3|4|5|6|7|8|9]\d{9}$/; var mobile = $("#mobile").val(); if(!isMobile.test(mobile)){ if($("#mobileCheck").length > 0){ $("#mobileCheck").remove(); } var html = "手机号码格式不正确!<\/span>"; $(HQ).append(html); document.getElementById("mobileCheck").style.opacity = "1"; $("#mobile").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#verifyCode').val() == "") { var html = "短信验证码不能为空!<\/span>"; $(YZM).append(html); document.getElementById("verifyCodeCheck").style.opacity = "1"; ajaxLoadEnd();//--移除遮罩-- $("#verifyCode").focus(); return false; } if ($('#verifyCode').val() != "" && $("#verifyCodeCheck").length > 0) { document.getElementById("verifyCodeCheck").style.opacity = "0"; } if ($('#email').val() == "") { if ($("#emailCheck").length > 0) { $("#emailCheck").remove(); } var html = "电子邮箱不能为空!<\/span>"; $(YJ).append(html); document.getElementById("emailCheck").style.opacity = "1"; $("#email").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#email').val() != "" && $("#emailCheck").length > 0) { document.getElementById("emailCheck").style.opacity = "0"; } var isEmail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// 验证邮箱的正则 var email = $('#email').val(); if (!isEmail.test(email)) { if ($("#emailCheck").length > 0) { $("#emailCheck").remove(); } var html = "邮箱格式不正确!<\/span>"; $(YJ).append(html); document.getElementById("emailCheck").style.opacity = "1"; $("#email").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } //使用form表单提交 $('#OrgReg').submit(); /*$.ajax({ type : "POST", url : projectAllName + "/orgUserReg.do", async : true, data : $('#OrgReg').serialize(), success : function(reults) { var result = JSON.parse(reults); if (result.result == "1") { $.messager.defaults = { ok: "确定"}; $.messager.alert('提示信息',"
注册成功!密码已发送手机<\/div>",'info',function(){ applySubmit(result.appid); ajaxLoadEnd();// --移除遮罩-- window.location.href = projectAllName+"/userReg/userRegister.jsp"; }); } else { $("#term a").remove(); $.messager.defaults = { ok: "确定"}; $.messager.alert('提示信息',"
"+result.info+"<\/div>",'info',function(){ ajaxLoadEnd();// --移除遮罩-- window.location.href = projectAllName+"/userReg/userRegister.jsp"; }); } ajaxLoadEnd();//--移除遮罩-- }, error : function(result) { $.messager.defaults = { ok: "确定"}; $.messager.alert('提示信息',"
系统错误,请联系管理员<\/div>"); ajaxLoadEnd();//--移除遮罩-- } });*/ } function SubmitShipRegister() { /*if ($('#slt_maritimeagencyShip').val() == "") { var html = "海事机构不能为空!<\/span>"; $(HSJGShip).append(html); document.getElementById("slt_maritimeagencyShipCheck").style.opacity = "1"; $("#slt_maritimeagencyShip").focus(); return false; } if ($('#slt_maritimeagencyShip').val() != "" && $("#slt_maritimeagencyShipCheck").length > 0) { document.getElementById("slt_maritimeagencyShipCheck").style.opacity = "0"; }*/ if ($('#ShipName').val() == "") { var html = "中文船名不能为空!<\/span>"; $(shipZWCM).append(html); document.getElementById("ShipNameCheck").style.opacity = "1"; $("#ShipName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#ShipName').val() != "" && $("#ShipNameCheck").length > 0) { document.getElementById("ShipNameCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } if ($('#shipIdNumber').val() == "" || $('#shipIdNumber').val() == "CN") { var html = "船舶识别号不能为空!<\/span>"; $(shipCBSBH).append(html); document.getElementById("shipIdNumberCheck").style.opacity = "1"; $("#shipIdNumber").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#shipIdNumber').val() != "" && $('#shipIdNumber').val() != "CN" && $("#shipIdNumberCheck").length > 0) { document.getElementById("shipIdNumberCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } /*if ($('#shipMMSI').val() == "") { var html = "MMSI不能为空!<\/span>"; $(MMSI).append(html); document.getElementById("shipMMSICheck").style.opacity = "1"; $("#shipMMSI").focus(); return false; } if ($('#shipMMSI').val() != "" && $("#shipMMSICheck").length > 0) { document.getElementById("shipMMSICheck").style.opacity = "0"; }*/ if ($('#shipLinkName').val() == "") { var html = "申办人名称不能为空!<\/span>"; $(shipSBRMC).append(html); document.getElementById("shipLinkNameCheck").style.opacity = "1"; $("#shipLinkName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#shipLinkName').val() != "" && $("#shipLinkNameCheck").length > 0) { document.getElementById("shipLinkNameCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } if ($('#ShipIdNumber').val() == "") { if ($("#ShipIdNumberCheck").length > 0) { $("#ShipIdNumberCheck").remove(); } var html = "身份证号码不能为空!<\/span>"; $(shipSFZHM).append(html); document.getElementById("ShipIdNumberCheck").style.opacity = "1"; $("#ShipIdNumber").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#ShipIdNumber').val() != "" && $("#ShipIdNumberCheck").length > 0) { document.getElementById("ShipIdNumberCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } var IdNumber = $('#ShipIdNumber').val(); if (!validateIdCard(IdNumber)) { if ($("#ShipIdNumberCheck").length > 0) { $("#ShipIdNumberCheck").remove(); } var html = "身份证格式不正确!<\/span>"; $(shipSFZHM).append(html); document.getElementById("ShipIdNumberCheck").style.opacity = "1"; $("#ShipIdNumber").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } /*if ($('#shipMail').val() == "") { if ($("#shipMailCheck").length > 0) { $("#shipMailCheck").remove(); } var html = "电子邮箱不能为空!<\/span>"; $(shipDZYX).append(html); document.getElementById("shipMailCheck").style.opacity = "1"; $("#shipMail").focus(); return false; } if ($('#shipMail').val() != "" && $("#shipMailCheck").length > 0) { document.getElementById("shipMailCheck").style.opacity = "0"; } var isEmail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// 验证邮箱的正则 var email = $('#shipMail').val(); if (!isEmail.test(email)) { if ($("#shipMailCheck").length > 0) { $("#shipMailCheck").remove(); } var html = "邮箱格式不正确!<\/span>"; $(shipDZYX).append(html); document.getElementById("shipMailCheck").style.opacity = "1"; $("#shipMail").focus(); return false; }*/ /*if ($('#shipApplyPassword').val() == "") { var html = "申报密码不能为空!<\/span>"; $(shipSBMM).append(html); document.getElementById("shipApplyPasswordCheck").style.opacity = "1"; $("#shipApplyPassword").focus(); return false; } if ($('#shipApplyPassword').val() != "" && $("#shipApplyPasswordCheck").length > 0) { document.getElementById("shipApplyPasswordCheck").style.opacity = "0"; }*/ if ($('#shipMobilePhone').val() == "") { if ($("#shipMobilePhoneCheck").length > 0) { $("#shipMobilePhoneCheck").remove(); } var html = "手机号码不能为空!<\/span>"; $(SJ).append(html); document.getElementById("shipMobilePhoneCheck").style.opacity = "1"; $("#shipMobilePhone").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#shipMobilePhone').val() != "" && $("#shipMobilePhoneCheck").length > 0) { document.getElementById("shipMobilePhoneCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } var isMobile = /^1[3|4|5|6|7|8|9]\d{9}$/; var mobile = $("#shipMobilePhone").val(); if(!isMobile.test(mobile)){ if($("#shipMobilePhoneCheck").length > 0){ $("#shipMobilePhoneCheck").remove(); } var html = "手机号码格式不正确!<\/span>"; $(SJ).append(html); document.getElementById("shipMobilePhoneCheck").style.opacity = "1"; $("#shipMobilePhone").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#shipVerifyCode').val() == "") { var html = "短信验证码不能为空!<\/span>"; $(shipYZM).append(html); document.getElementById("shipVerifyCodeCheck").style.opacity = "1"; $("#shipVerifyCode").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#shipVerifyCode').val() != "" && $("#shipVerifyCodeCheck").length > 0) { document.getElementById("shipVerifyCodeCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } /*if ($("#selectIsTransport").is(":checked")) { if ($('#shipCertificateNo').val() == "") { var html = "证书编号不能为空!<\/span>"; $(ShipZSBH).append(html); document.getElementById("shipCertificateNoCheck").style.opacity = "1"; $("#shipCertificateNo").focus(); return false; } if ($('#shipCertificateNo').val() != "" && $("#shipCertificateNoCheck").length > 0) { document.getElementById("shipCertificateNoCheck").style.opacity = "0"; } if ($('#txt_establishDate').val() == "") { var html = "有效期止不能为空!<\/span>"; $(ShipYXQZ).append(html); document.getElementById("txt_establishDateCheck").style.opacity = "1"; $("#txt_establishDate").focus(); return false; } if ($('#txt_establishDate').val() != "" && $("#txt_establishDateCheck").length > 0) { document.getElementById("txt_establishDateCheck").style.opacity = "0"; } if ($('#shipMaritimeOrgs').val() == "") { var html = "发证机关名称不能为空!<\/span>"; $(ShipFZJGMC).append(html); document.getElementById("shipMaritimeOrgsCheck").style.opacity = "1"; $("#shipMaritimeOrgs").focus(); return false; } if ($('#shipMaritimeOrgs').val() != "" && $("#shipMaritimeOrgsCheck").length > 0) { document.getElementById("shipMaritimeOrgsCheck").style.opacity = "0"; } if ($('#shipBusinessScope').val() == "") { var html = "本船核定的经营范围不能为空!<\/span>"; $(ShipBCHDDJYFW).append(html); document.getElementById("shipBusinessScopeCheck").style.opacity = "1"; $("#shipBusinessScope").focus(); return false; } if ($('#shipBusinessScope').val() != "" && $("#shipBusinessScopeCheck").length > 0) { document.getElementById("shipBusinessScopeCheck").style.opacity = "0"; } } if ($("#WYYDBTY").is(":checked")) { if ($("#WYYDBTYCheck").length > 0) { $("#WYYDBTYCheck").remove(); } } else { var html = "请阅读并勾选同意!<\/span>"; $(WYYDBTYtwo).append(html); document.getElementById("WYYDBTYCheck").style.opacity = "1"; $("#WYYDBTY").focus(); return false; } $('#ipShip').val(ip);*/ $("#ShipReg").submit(); /*if ($("#selectIsTransport").is(":checked")) { $('#isTransport').val("1"); } else { $('#isTransport').val("0"); } $.ajax({ type : "POST", url : projectAllName + "/potal/userReg/shipRegister.action?roleArray=" + roleArray+"&shipFile="+shipFile, async : false, data : $('#ShipReg').serialize(), // 要提交的表单 success : function(result) { if (result.result == "1") { $.messager.alert('提示信息',"
"+result.info+"<\/div>"); applySubmit(result.appid); ajaxLoadEnd();//--移除遮罩-- } else { arr.length = 0; $.messager.alert('提示信息',"
数据提交失败,请联系管理员<\/div>"); ajaxLoadEnd();//--移除遮罩-- } }, error : function(result) { alert(result.toString); arr.length = 0; alert("注册失败1"); ajaxLoadEnd();//--移除遮罩-- } });*/ } var i = 5; var intervalid; function SubmitNaturalRegister() { /*if ($('#slt_maritimeagencyNatural').val() == "") { var html = "海事机构不能为空!<\/span>"; $(HSJGNatural).append(html); document.getElementById("slt_maritimeagencyNaturalCheck").style.opacity = "1"; $("#slt_maritimeagencyNatural").focus(); return false; } if ($('#slt_maritimeagencyNatural').val() != "" && $("#slt_maritimeagencyNaturalCheck").length > 0) { document.getElementById("slt_maritimeagencyNaturalCheck").style.opacity = "0"; } */ if ($('#NaturalName').val() == "") { var html = "身份证姓名不能为空!<\/span>"; $(SFZXMNatural).append(html); document.getElementById("NaturalNameCheck").style.opacity = "1"; $("#NaturalName").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#NaturalName').val() != "" && $("#NaturalNameCheck").length > 0) { document.getElementById("NaturalNameCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } if ($('#NaturalIdNumber').val() == "") { if ($("#NaturalIdNumberCheck").length > 0) { $("#NaturalIdNumberCheck").remove(); } var html = "身份证号码不能为空!<\/span>"; $(SFZHMNatural).append(html); document.getElementById("NaturalIdNumberCheck").style.opacity = "1"; $("#NaturalIdNumber").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#NaturalIdNumber').val() != "" && $("#NaturalIdNumberCheck").length > 0) { document.getElementById("NaturalIdNumberCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } var IdNumber = $('#NaturalIdNumber').val(); if (!validateIdCard(IdNumber)) { if ($("#NaturalIdNumberCheck").length > 0) { $("#NaturalIdNumberCheck").remove(); } var html = "身份证格式不正确!<\/span>"; $(SFZHMNatural).append(html); document.getElementById("NaturalIdNumberCheck").style.opacity = "1"; $("#NaturalIdNumber").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } /*if ($('#orgbusinessLicenseNatural').val() != "" && $("#orgbusinessLicenseNaturalCheck").length > 0) { document.getElementById("orgbusinessLicenseNaturalCheck").style.opacity = "0"; } */ if ($('#mobileNatural').val() == "") { if ($("#mobileNaturalCheck").length > 0) { $("#mobileNaturalCheck").remove(); } var html = "手机号码不能为空!<\/span>"; $(HM).append(html); document.getElementById("mobileNaturalCheck").style.opacity = "1"; $("#mobileNatural").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#mobileNatural').val() != "" && $("#mobileNaturalCheck").length > 0) { document.getElementById("mobileNaturalCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } var isMobile = /^1[3|4|5|6|7|8|9]\d{9}$/; var mobile = $("#mobileNatural").val(); if(!isMobile.test(mobile)){ if($("#mobileNaturalCheck").length > 0){ $("#mobileNaturalCheck").remove(); } var html = "手机号码格式不正确!<\/span>"; $(HM).append(html); document.getElementById("mobileNaturalCheck").style.opacity = "1"; $("#mobileNatural").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#verifyCodeNatural').val() == "") { var html = "短信验证码不能为空!<\/span>"; $(YZMNatural).append(html); document.getElementById("verifyCodeNaturalCheck").style.opacity = "1"; $("#verifyCodeNatural").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#verifyCodeNatural').val() != "" && $("#verifyCodeNaturalCheck").length > 0) { document.getElementById("verifyCodeNaturalCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } if ($('#emailNatural').val() == "") { if ($("#emailNaturalCheck").length > 0) { $("#emailNaturalCheck").remove(); } var html = "电子邮箱不能为空!<\/span>"; $(DZYJNatural).append(html); document.getElementById("emailNaturalCheck").style.opacity = "1"; $("#emailNatural").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } if ($('#emailNatural').val() != "" && $("#emailNaturalCheck").length > 0) { document.getElementById("emailNaturalCheck").style.opacity = "0"; ajaxLoadEnd();//--移除遮罩-- } var isEmail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// 验证邮箱的正则 var email = $('#emailNatural').val(); if (!isEmail.test(email)) { if ($("#emailNaturalCheck").length > 0) { $("#emailNaturalCheck").remove(); } var html = "邮箱格式不正确!<\/span>"; $(DZYJNatural).append(html); document.getElementById("emailNaturalCheck").style.opacity = "1"; $("#emailNatural").focus(); ajaxLoadEnd();//--移除遮罩-- return false; } var checked =document.getElementById("WYYDBTY").checked; if(checked==false){ alert("请先阅读条款"); return false; } $.ajax({ type : "POST", url : projectAllName + "/naturalReg.do", async : true, data : $('#NaturalReg').serialize(), success : function(reults) { var result = JSON.parse(reults); if (result.result == "1") { $.messager.defaults = { ok: "确定"}; //SJ(); //$.messager.alert('提示信息',"
开户成功密码已发送到手机!

将在 5 秒钟跳转登录页面!

<\/div>",'info',function(){ $.messager.alert('提示信息',"
注册成功!密码已发送到手机!<\/div>",'info',function(){ applySubmit(result.appid); ajaxLoadEnd();// --移除遮罩-- window.location.href = projectAllName+"/userReg/userRegister.jsp"; }); } else { $("#term a").remove(); $.messager.defaults = { ok: "确定"}; $.messager.alert('提示信息',"
注册失败!请联系管理员<\/div>",'info',function(){ ajaxLoadEnd();// --移除遮罩-- window.location.href = projectAllName+"/userReg/userRegister.jsp"; }); } }, error : function(result) { $.messager.defaults = { ok: "确定"}; $.messager.alert('提示信息',"
系统错误,请联系管理员<\/div>"); ajaxLoadEnd();//--移除遮罩-- } }); } function SJ(){ intervalid = setInterval("fun()", 1000); } function fun() { if (i == 0) { window.location.href = "/UserReg/userReg/userRegister.jsp"; clearInterval(intervalid); } document.getElementById("mes").innerHTML = i; i--; }