/*************************************************************** *

ProName:EdorIRInput.js

*

Title:替换被保险人

*

Description:替换被保险人

*

Copyright:Copyright (c) 2012

*

Company:Sinosoft

* @author : weigh * @version : 8.0 * @date : 2014-06-24 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var turnPage3 = new turnPageClass(); var turnPage4 = new turnPageClass(); var mOperate = "";//操作状态 var tSQLInfo = new SqlClass(); var tQuerFlag; var Hidrelatomain=null; /** * 提交数据后返回操作 */ function resultAfterSubmit(tFlagStr,tContent,result) { afterSubmit(tFlagStr,tContent,result.Insuredid); } function afterSubmit(tFlagStr, tContent,tInsuredid) { if (typeof(showInfo) == "object" && typeof(showInfo) != "unknown") { showInfo.close(); } if (tFlagStr == "Fail") { var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(tContent); //showModalDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px"); var name='提示'; //网页名称,可为空; var iWidth=550; //弹出窗口的宽度; var iHeight=250; //弹出窗口的高度; var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置 var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置 showInfo = window.open (urlStr,name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height="+ iHeight+",width="+iWidth+",innerHeight="+iHeight+",innerWidth=" +iWidth+",left="+iLeft+",top="+iTop,false); showInfo.focus(); } else { var urlStr = "../common/jsp/MessagePage.jsp?picture=S&content=" + encodeURIComponent(tContent); //showModalDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px"); var name='提示'; //网页名称,可为空; var iWidth=550; //弹出窗口的宽度; var iHeight=250; //弹出窗口的高度; var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置 var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置 showInfo = window.open (urlStr,name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height="+ iHeight+",width="+iWidth+",innerHeight="+iHeight+",innerWidth=" +iWidth+",left="+iLeft+",top="+iTop,false); showInfo.focus(); if(mOperate == "INSERT"){ clearPage(); queryOldClick(); initBnfGrid(); initQueryInfoGrid(); queryUpdateClick(2); }else if(mOperate == "UPDATE"){ clearPage(); initQueryInfoGrid(); initBnfGrid(); //queryBnf01(tInsuredid); queryUpdateClick(2); divQueryPage.style.display=""; divQuerybnf.style.display="none"; }else if(mOperate=="DELETE"){ queryOldClick(); queryUpdateClick(2); clearPage(); initQueryInfoGrid(); initBnfGrid(); } } } /** * 人员清单校验 */ function insuredListCheck() { fm.Operate.value = "CHECKLIST"; tOperate = "CHECKLIST"; fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/ADD"; ajaxSubmit2(document.getElementById("fm")); initForm(); fm.action ="../API/grp_pa/g_pos/EdorIRSave/ADD"; } /** * 提交 */ function submitForm() { var i = 0; var showStr = i18nMessage("正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04525"); var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(showStr); //showInfo = window.showModelessDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px"); var name='提示'; //网页名称,可为空; var iWidth=550; //弹出窗口的宽度; var iHeight=250; //弹出窗口的高度; var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置 var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置 showInfo = window.open (urlStr,name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height="+ iHeight+",width="+iWidth+",innerHeight="+iHeight+",innerWidth=" +iWidth+",left="+iLeft+",top="+iTop,false); showInfo.focus(); fm.Operate.value = mOperate; // fm.submit(); ajaxSubmit2(document.getElementById("fm"), resultAfterSubmit); } /** * 查询原被保人信息 */ function queryOldClick(){ tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql6"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.OldInsuredName.value); tSQLInfo.addSubPara(fm.OldInsuredIDNo.value); tSQLInfo.addSubPara(fm.ContPlanCodeOld.value); tSQLInfo.addSubPara(tEdorAppNo); tSQLInfo.setModule("grp_pa"); initOldInsuredInfoGrid(); initUpdateInsuredInfoGrid(); divQuerySpe.style.display="none"; fm.Serialno.value=""; turnPage1.queryModal(tSQLInfo.getString(), OldInsuredInfoGrid, 1, 1,10); if (!turnPage1.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } /** * 查询修改后被保人信息 */ function queryUpdateClick(o){ tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql12"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.EdorType.value); tSQLInfo.addSubPara(fm.EdorAppNo.value); tSQLInfo.addSubPara(NullToEmpty(fm.EdorNo.value)); tSQLInfo.addSubPara(fm.InsuredNameOld.value); tSQLInfo.addSubPara(fm.InsuredIDNoOld.value); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(fm.InsuredNameUp.value); tSQLInfo.addSubPara(fm.InsuredIDNoUp.value); tSQLInfo.setModule("grp_pa"); initOldInsuredInfoGrid(); initUpdateInsuredInfoGrid(); clearPage(); initBnfGrid(); divQuerySpe.style.display="none"; turnPage2.queryModal(tSQLInfo.getString(), UpdateInsuredInfoGrid, 1, 1,10); if(o=='1'){ if (!turnPage2.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } } /** * 新增 */ function addRecord() { var tSelNo = OldInsuredInfoGrid.getSelNo(); if(tSelNo=='0'){ i18nAlert("请选择一条原被保人信息进行保存!", "LIS-03829"); return false; } mOperate = "INSERT"; if (!beforeSubmit()) { return false; } submitForm(); } /** * 修改 */ function modifyRecord() { var tSelNo = UpdateInsuredInfoGrid.getSelNo(); if(tSelNo=='0'){ i18nAlert("请选择一条修改过的被保人信息进行修改!", "LIS-03830"); return false; } mOperate = "UPDATE"; if (!beforeSubmit()) { return false; } fm.action = "../API/grp_pa/g_pos/EdorIRSave/UPDATE"; submitForm(); } /** * 撤销 */ function deleteRecord(){ var tSelNo = UpdateInsuredInfoGrid.getSelNo(); if(tSelNo=='0'){ i18nAlert("请选择一条修改过的被保人信息进行删除!", "LIS-03831"); return false; } mOperate = "DELETE"; fm.action = "../API/grp_pa/g_pos/EdorIRSave/DELETE"; submitForm(); } /** * 根据前台页面进行下拉控制 **/ function returnShowCodeList (value1, value2, value3) { if (value1=='city') { if (isEmpty(fm.ProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } var tProvince = fm.ProvinceCode.value; return showCodeList('city',value2,value3,null,tProvince,'UpPlaceName','1',180); } else if (value1=='district') { if (isEmpty(fm.ProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } if (isEmpty(fm.CityName)) { i18nAlert("请选择市!", "LIS-00796"); return false; } var tCity = fm.CityCode.value; return showCodeList('district',value2,value3,null,tCity,'UpPlaceName','1',180); } } function returnShowCodeLisKey (value1, value2, value3) { if (value1=='city') { if (isEmpty(fm2.ProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } var tProvince = fm.ProvinceCode.value; return showCodeList('city',value2,value3,null,tProvince,'UpPlaceName','1',180); } else if (value1=='district') { if (isEmpty(fm.ProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } if (isEmpty(fm.CityName)) { i18nAlert("请选择市!", "LIS-00796"); return false; } var tCity = fm.CityCode.value; return showCodeList('district',value2,value3,null,tCity,'UpPlaceName','1',180); } } /** * 下拉框选择后处理 */ function afterCodeSelect(tSelectValue, tObj) { if(tSelectValue=='bnftype'){ if(tObj.value == "法定受益人"){ var rowNumber = BnfGrid.lastFocusRowNo; BnfGrid.setRowColData(rowNumber, 14, "1"); } } if(tSelectValue=='relation'){ if(Hidrelatomain !='00'){ if(fm.relatomain.value=='00'){ i18nAlert("附属被保险人不能替换为本人", "LIS-03832"); fm.relatomain.value =""; fm.relatomainName.value =""; return false; } } if (fm.relatomain.value!='00') { document.getElementById("mainname").style.display=""; document.getElementById("mainname1").style.display=""; document.getElementById("mainIDNo").style.display=""; document.getElementById("mainCustNo1").style.display=""; }else{ document.getElementById("mainname").style.display="none"; document.getElementById("mainname1").style.display="none"; document.getElementById("mainIDNo").style.display="none"; document.getElementById("mainCustNo1").style.display="none"; } } } /** * 清空 市 和 区/县 */ function clearCityAndCounty(){ document.all("CityName").value = ""; document.all("CityCode").value = ""; document.all("CountyName").value = ""; document.all("CountyCode").value = ""; } /** * 清空 区/县 */ function clearCounty(){ document.all("CountyName").value = ""; document.all("CountyCode").value = ""; } /** * 校验身份证以及返回出生日期和性别、年龄 */ function checkidtype(){ if(fm.IDNo.value.length>0 && fm.IDType.value=="") { i18nAlert("请先选择证件类型!", "LIS-00574"); return false; } if(fm.IDType.value=="0"&&fm.IDNo.value.length>0) { if((fm.IDNo.value.length!=18)){ i18nAlert("输入的身份证号位数错误", "LIS-00575"); document.all('IDNo').className = "warn"; return false; } if(!checkIdCard(fm.IDNo.value)) { // document.all('IDNo').value=""; document.all('IDNo').className = "warn"; return false; }else { fm.InsuredBirthDay.value =getBirthdatByIdNo(fm.IDNo.value); fm.InsuredGender.value = getSexByIDNo(fm.IDNo.value); if(fm.InsuredGender.value=='0'){ fm.InsuredGenderName.value ='男'; }else if(fm.InsuredGender.value=='1'){ fm.InsuredGenderName.value ='女'; } fm.InsuredAppAge.value = calAge(fm.InsuredBirthDay.value); document.all('IDNo').className = "common"; } } } /** * 选择城市前必须先选择省份 */ function checkProvince(){ if(fm.Province.value == ""){ i18nAlert("请先选择省份", "LIS-03010"); fm.City.value = ""; fm.CityName.value = ""; } } /** * 清空关联查询的项目 */ function clearInput(codeInput,nameInput) { codeInput.value = ""; nameInput.value = ""; } /** * 查询方案信息 */ function showContPlanCode(cObj,cObjName,cObjCode){ return showCodeList('contplan',[cObj,cObjName,cObjCode],[0,1,2],null, document.all('GrpPropNo').value ,'GrpContNo',1,null); } function showContPlanCodeName(cObj,cObjName,cObjCode){ return showCodeListKey('contplan',[cObj,cObjName,cObjCode],[0,1,2],null, document.all('GrpPropNo').value ,'GrpContNo',1,null); } //初始化职级的下拉内容 function initPosition(cObj,cName){ showCodeList('position',[cObj,cName], [0,1], null,document.all('GrpPropNo').value,'GrpContNo', 1,null); } // //职业类别 // function showOccupationCodeList(obj1,obj1Name,obj2,obj2Name){ // var keycode = event.keyCode; // //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } // showCodeList('occupationcode',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1); // } // // function showOccupationCodeListKey(obj1,obj1Name,obj2,obj2Name){ // var keycode = event.keyCode; // //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } // showCodeList('occupationcode',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1); // } //职业类别 function showOccupationNameList(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1); } function showOccupationNameListKey(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1); } //职业类别 function showOccupationCodeList(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCode.value,'OccupationCode',1); } function showOccupationCodeListKey(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCode.value,'OccupationCode',1); } /** * 选择主客户 --按回车键和Tab键时触发 */ function selectMainUser() { var keyCode = event.keyCode; if (keyCode=="13"|| keyCode=="9") { if (!selectMainUserInfo()) { return false; } } } /** * 选择主客户详细方法 */ function selectMainUserInfo(){ fm.mainCustNameTemp.value = fm.mainCustName.value; if(fm.mainCustNameTemp.value != fm.mainCustName.value.trim()){ i18nAlert("录入主被保人姓名不能带空格!", "LIS-03508"); return false; } if(fm.mainCustName.value !=null && fm.mainCustName.value !=''){ var arrResult = new Array(); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql4"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.mainCustName.value); tSQLInfo.addSubPara(fm.mainIDNo.value); tSQLInfo.addSubPara(fm.mainCustName.value); tSQLInfo.addSubPara(fm.mainIDNo.value); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.EdorType.value); tSQLInfo.addSubPara(fm.EdorAppNo.value); tSQLInfo.addSubPara(fm.BatchNo.value); tSQLInfo.setModule("grp_pa"); arrResult = easyExecSql(tSQLInfo.getString()); if(arrResult=='0'){ i18nAlert("没有查询到主被保人,请先录入主被保人信息!", "LIS-03833"); fm.mainInsuredNo.value=""; fm.mainCustName.value=""; fm.mainIDNo.value=""; return false; } var n=arrResult[0]; if (n>1) { showMainLCInsuredInfo();//主被保人查询 fm.mainInsuredNo.value=""; fm.mainCustName.value=""; fm.mainIDNo.value=""; }else if(n==1){ var arrResult = new Array(); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql7"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.mainCustName.value); tSQLInfo.addSubPara(fm.mainIDNo.value); tSQLInfo.addSubPara(fm.mainCustName.value); tSQLInfo.addSubPara(fm.mainIDNo.value); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.EdorType.value); tSQLInfo.addSubPara(fm.EdorAppNo.value); tSQLInfo.setModule("grp_pa"); fm.mainInsuredNo.value=""; fm.mainCustName.value=""; fm.mainIDNo.value=""; arrResult = new Array(); arrResult = easyExecSql(tSQLInfo.getString()); fm.mainInsuredNo.value = arrResult[0][1]; fm.mainCustName.value= arrResult[0][2]; fm.mainIDNo.value= arrResult[0][3]; } } } /** * 检查主被保人信息 */ function checkMain(){ if(fm.relatomain.value !='00'){ if(fm.mainCustName.value==''){ i18nAlert("请先录入主被保险人姓名!", "LIS-03510"); fm.InsuredName.value=""; return false; } } } /** * 选择客户 --按回车键和Tab键时触发 */ function selectUser() { var keyCode = event.keyCode; if (keyCode=="13"|| keyCode=="9") { if (!selectUserInfo()) { return false; } } } /** * 选择客户详细方法 */ function selectUserInfo() { fm.InsuredNameTemp.value = fm.InsuredName.value; if (fm.InsuredNameTemp.value != fm.InsuredName.value.trim()) { i18nAlert("录入被保人姓名不能带空格!", "LIS-03351"); return false; } if (fm.InsuredName.value!=null && fm.InsuredName.value!='') { var arrResult = new Array(); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql13"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.InsuredName.value); tSQLInfo.setModule("grp_pa"); arrResult = easyExecSql(tSQLInfo.getString()); if(arrResult==0){ emptyCustInfo(); return ; } var n=arrResult[0]; if (n>1) { showLCInsuredInfo();//客户查询 emptyCustInfo();//清空被保人客户页面信息 } else if(n==1) { var arrResult = new Array(); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql5"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.InsuredName.value); tSQLInfo.setModule("grp_pa"); emptyCustInfo(); arrResult = new Array(); arrResult = easyExecSql(tSQLInfo.getString()); fm.InsuredName.value = arrResult[0][0]; fm.IDType.value = arrResult[0][1]; fm.IDTypeName.value = arrResult[0][2]; fm.IDNo.value = arrResult[0][3]; fm.InsuredGender.value = arrResult[0][4]; fm.InsuredGenderName.value = arrResult[0][5]; fm.InsuredBirthDay.value = arrResult[0][6]; fm.InsuredAppAge.value = arrResult[0][7]; } else { return; } } } /** * 清空被保人基本信息 */ function emptyCustInfo(){ fm.IDType.value=""; fm.IDTypeName.value=""; fm.IDNo.value=""; fm.InsuredGender.value=""; fm.InsuredGenderName.value=""; fm.InsuredBirthDay.value=""; fm.InsuredAppAge.value=""; } /** * 客户姓名查出多条时,跳转到客户查询页面 */ function showLCInsuredInfo() { var tGrpPropNo=fm.GrpPropNo.value; var tInsuredName=fm.InsuredName.value; window.open("./EdorNIQueryMain.jsp?GrpPropNo="+tGrpPropNo+"&InsuredName="+tInsuredName+"&ManageCom="+tManageCom,"查询被保人信息",'width=950,height=520,top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0'); } /** * 主被保人客户姓名查出多条时,跳转到主被保人客户查询页面 */ function showMainLCInsuredInfo() { var tGrpPropNo=fm.GrpPropNo.value; var tmainCustName=fm.mainCustName.value; var tmainIDNO = fm.mainIDNo.value; window.open("./EdorMQueryMain.jsp?GrpPropNo="+tGrpPropNo+"&mainCustName="+tmainCustName+"&ManageCom="+tManageCom+"&MainIDNO="+tmainIDNO,"查询主被保人信息",'width=950,height=520,top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0'); } /** * 获取返回的客户数据 */ function showUserInfo(tArr) { if (tArr!=null) { var Result=new Array(); Result=tArr; fm.InsuredName.value = Result[0]; fm.InsuredGenderName.value = Result[1]; fm.InsuredGender.value = Result[6]; fm.InsuredBirthDay.value= Result[2]; fm.IDTypeName.value = Result[3]; fm.IDType.value = Result[5]; fm.IDNo.value = Result[4]; fm.InsuredNoS.value = Result[7]; } } /** * 获取返回的主客户数据 */ function showMainUserInfo(tArr){ if (tArr!=null) { var Result=new Array(); Result=tArr; fm.mainInsuredNo.value=Result[7]; fm.mainIDNo.value=Result[4]; fm.mainCustName.value=Result[0]; } } /** * 提交前的校验、计算 */ function beforeSubmit() { //不允许对附属被保险人进行替换 if(fm.relatomain.value!='00'){ // if(fm.mainCustName.value==''){ // i18nAlert("请先录入主被保人信息!", "LIS-03648"); // return false; // } i18nAlert("不允许对附属被保险人进行替换", "LIS-03834") ; return false ; } if(!verifyForm("fm")){ return false; } if(checkName(fm.InsuredName.value.replace(/\s+/g,""))){ document.getElementById("InsuredName").value=fm.InsuredName.value.trim().replace(/\./g,"·").replace(/\./g,"·").replace(/\ /g,"");//前中后去空格 }else{ i18nAlert("被保险人姓名录入有误,请确认!", "LIS-BQ-0084"); return false; } if(fm.IDType.value!="0"&&fm.IDNo.value.length>0){ var reg2=/^[\u4e00-\u9fa5a-zA-Z0-9_]+$/; var idstr = fm.IDNo.value; if(!reg2.test(idstr)){ i18nAlert("证件号码中不能含有特殊字符!", "LIS-BQ-0085"); return false; } } if(fm.ContPlanCode.value==""){ i18nAlert("方案编码不能为空!", "LIS-02724"); return false; } tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql10"); tSQLInfo.addSubPara(fm.GrpPropNo.value); tSQLInfo.addSubPara(fm.ContPlanCode.value); tSQLInfo.addSubPara(fm.sysPlanCode.value); tSQLInfo.setModule("grp_pa"); var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(arrResult !=null){ i18nAlert("被保险人方案月薪计算保额不允许替换!", "LIS-03835"); return false ; } if (mOperate=="INSERT" || mOperate=="UPDATE") { // if(fm.edorValDate.value ==''){ // i18nAlert("请录入保全生效日期!", "LIS-03650"); // return false ; // } if(fm.IDType.value == "0") { if (fm.IDNo.value != "" && fm.IDNo.value != null) { var tBirthday = getBirthdatByIdNo(fm.IDNo.value); var tsex = getSexByIDNo(fm.IDNo.value); if (tBirthday != fm.InsuredBirthDay.value) { i18nAlert("输入的出生日期与证件号码不一致!", ""); return false; } if (tsex != fm.InsuredGender.value) { i18nAlert("输入的性别与证件号码不一致!", ""); return false; } } var IDType = fm.all("IDType").value; var IDNo = fm.all("IDNo").value; var IDStartDate = fm.all("IDStartDate").value; var IDExpDate = fm.all("IDExpDate").value; var Birthday = fm.all("InsuredBirthDay").value; var InsuredAppAge = fm.all("InsuredAppAge").value; if (IDNo != "" && IDNo != null) { var tBirthday = getBirthdatByIdNo(IDNo); var tsex = getSexByIDNo(IDNo); if (tBirthday != Birthday) { i18nAlert("输入的出生日期与证件号码不一致!", ""); return false; } if (tsex != fm.all("InsuredGender").value) { i18nAlert("输入的性别与证件号码不一致!", ""); return false; } } //证件有效止期校验 if (IDStartDate != "") { var isLongValid = fm.IsLongValid.value; var YStartDate = IDStartDate.substring(0, 4); var YEndDate = IDExpDate.substring(0, 4); var MStartDate = IDStartDate.substring(5, 7); var MEndDate = IDExpDate.substring(5, 7); var DStartDate = IDStartDate.substring(8, 10); var DEndDate = IDExpDate.substring(8, 10); var YSub = YEndDate - YStartDate; var MSub = MEndDate - MStartDate; var DSub = DEndDate - DStartDate; var ttAppAge = calAgeNew(Birthday, IDStartDate); if (ttAppAge < 16) { if (YSub != 5 || MSub != 0 || DSub != 0) { i18nAlert("客户年龄范围为小于16周岁,起止年-起期年应等于5", "LIS-BQ-0079"); return false; } } else if (ttAppAge >= 16 && ttAppAge <= 25) { if (YSub != 10 || MSub != 0 || DSub != 0) { i18nAlert("客户年龄范围为大于等于16周岁并且小于等于25周岁,起止年-起期年应等于10", "LIS-BQ-0080"); return false; } } else if (ttAppAge >= 26 && ttAppAge <= 45) { if (YSub != 20 || MSub != 0 || DSub != 0) { i18nAlert("客户年龄范围为大于等于26周岁并且小于等于45周岁,起止年-起期年应等于20", "LIS-BQ-0081"); return false; } } else { if (isLongValid != "1") { i18nAlert("客户年龄范围为大于45周岁,证件是否长期应选择【是】", "LIS-BQ-0082"); return false; } } } } // 校验生效日期 var CurrentDate = fm.CurrentDate.value; var birthday = fm.InsuredBirthDay.value; var LiscenceValidDate = fm.IDExpDate.value;// 证件是否长期有效 if(birthday>CurrentDate){ i18nAlert("出生日期必须小于当前日期!", "LIS-03651"); return false ; } // 校验证件有效期 if(LiscenceValidDate !=""){ if(LiscenceValidDate0){ if(!BnfGrid.checkValue("BnfGrid")){ return false; } for (var i=0; iNumber(cLen1)) { return false; } if (Number(tLen2)>Number(cLen2)) { return false; } return true; } function calEndDate(code,type){ if (type == "IDType" && fm.IDType.value == '0'){ var tapage = calAgeNew(fm.InsuredBirthDay.value,fm.IDStartDate.value); if(tapage<16){ var tyear=caldateYear(fm.IDStartDate.value,5); fm.IDExpDate.value = tyear; } if(16<=tapage&&tapage<=25){ var tyear=caldateYear(fm.IDStartDate.value,10); fm.IDExpDate.value = tyear; } if(26<=tapage&&tapage<=45){ var tyear=caldateYear(fm.IDStartDate.value,20); fm.IDExpDate.value = tyear; } if(tapage>=46){ fm.IDExpDate.value = '9999-01-01'; fm.IsLongValid.value ='1'; fm.IsLongValidName.value ='是'; } } } function caldateYear(tdate,tyear){ tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIRSql"); tSQLInfo.setSqlId("EdorIRSql19"); tSQLInfo.setModule("grp_pa"); tSQLInfo.addSubPara(tdate); tSQLInfo.addSubPara(tyear); return easyExecSql(tSQLInfo.getString()); } function checkIDEndDate(){ if(fm.IsLongValid.value.length>0 && fm.IsLongValid.value=="1") { fm.IDExpDate.value ="9999-01-01"; } } /** * 校验详细地址信息 */ function checkCity(){ var ProvinceCode =document.all('ProvinceCode').value; var CityCode =document.all('CityCode').value; var CountyCode =document.all('CountyCode').value; if(ProvinceCode !=""){ if(CityCode ==''){ CityCode ='0'; } if(CountyCode ==''){ CountyCode ='0'; } tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorBBSql"); tSQLInfo.setSqlId("EdorBBSql4"); tSQLInfo.addSubPara(ProvinceCode); tSQLInfo.addSubPara(CityCode); tSQLInfo.addSubPara(CountyCode); tSQLInfo.setModule("grp_pa"); var arrResult = easyExecSql(tSQLInfo.getString()); if(arrResult =='0'){ i18nAlert("联系地址不存在或者关联不正确", "LIS-03657"); return false; } } return true; }