/*************************************************************** *
ProName:EdorBBInput.js
*Title:被保险人基本资料变更
*Description:被保险人基本资料变更
*Copyright:Copyright (c) 2012
*Company:Sinosoft
* @author : weigh * @version : 8.0 * @date : 2014-06-13 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var mOperate = "";//操作状态 var tSQLInfo = new SqlClass(); /** * 提交 */ 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(); document.all("Operate").value = mOperate; if(mOperate === "DELETE"){ document.getElementById("fm").action="../API/grp_pa/g_pos/EdorBBSave/DELETE"; }else if(mOperate == "INSERT||UPDATE"){ document.getElementById("fm").action="../API/grp_pa/g_pos/EdorBBSave/INSERTUPDATE"; } ajaxSubmit2(document.getElementById("fm")); } /** * 提交数据后返回操作 */ function afterSubmit(FlagStr, content) { if (typeof(showInfo)=="object" && typeof(showInfo)!="unknown") { showInfo.close(); } if (FlagStr=="Fail") { var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content="+ encodeURIComponent(content); //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(content); //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 == "DELETE"){ queryOldClick(); queryUpdateClick(); clearPage(); }else if(mOperate =="INSERT||UPDATE" ){ queryOldClick(); queryUpdateClick(); clearPage(); } } } /** * 人员清单校验 */ function insuredListCheck() { fm.Operate.value = "CHECKLIST"; tOperate = "CHECKLIST"; fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/ADD"; ajaxSubmit2(document.getElementById("fm")); initForm(); } /** * 调用保险方案的方法 */ function showContPlanCode(cObj,cObjName,cObjCode){ return showCodeList('contplan',[cObj,cObjName,cObjCode],[0,1,2],null,document.all("GrpPropNo").value,'GrpContNo',1,null); } function showContPlanCodeName(cObj1,cObjName1,cObjCode1){ return showCodeListKey('contplan',[cObj1,cObjName1,cObjCode1],[0,1,2],null,document.all("GrpPropNo").value,'GrpContNo',1,null); } /** * 根据前台页面进行下拉控制 **/ function returnShowCodeList (value1, value2, value3) { if (value1=='city') { if (isEmpty(fm.ProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } var tProvince = document.all("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 = document.all("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 = document.all("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 = document.all("CityCode").value; return showCodeList('district',value2,value3,null,tCity,'UpPlaceName','1',180); } } /** * 清空 市 和 区/县 */ 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 queryOldClick(){ tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorBBSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("EdorBBSql1"); tSQLInfo.addSubPara(document.all("GrpPropNo").value); tSQLInfo.addSubPara(document.all("OldInsuredName").value); tSQLInfo.addSubPara(document.all("OldInsuredIDNo").value); tSQLInfo.addSubPara(document.all("OldInsuredNo").value); tSQLInfo.addSubPara(document.all("ContPlanCodeOld").value); tSQLInfo.addSubPara(tEdorAppNo); initOldInsuredInfoGrid(); // initUpdateInsuredInfoGrid(); clearPage(); document.all("SerialNo").value=""; turnPage1.queryModal(tSQLInfo.getString(), OldInsuredInfoGrid, 1, 1,10); if (!turnPage1.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } /** * 展示原被保人信息 */ function showOldInsuredList(){ clearPage(); initUpdateInsuredInfoGrid(); queryUpdateClick(2); var tSelNo = OldInsuredInfoGrid.getSelNo(); var tContNo = OldInsuredInfoGrid.getRowColData(tSelNo-1,1); var tInsuredNo = OldInsuredInfoGrid.getRowColData(tSelNo-1,12); var tOldInsuredName = OldInsuredInfoGrid.getRowColData(tSelNo-1,2); var tOldIdno = OldInsuredInfoGrid.getRowColData(tSelNo-1,8); var tOldIdtype = OldInsuredInfoGrid.getRowColData(tSelNo-1,6); var tbirthday = OldInsuredInfoGrid.getRowColData(tSelNo-1,5); document.all("InsuredOldName").value = tOldInsuredName; document.all("IdOldNo").value = tOldIdno; document.all("IDType").value=tOldIdtype; document.all("InsuredBirthDay").value=tbirthday; var querySql = ""; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorBBSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("queryOldInsuredInfo"); tSQLInfo.addSubPara(tInsuredNo); tSQLInfo.addSubPara(document.all("GrpPropNo").value); tSQLInfo.addSubPara(tContNo); var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(arrResult !=null){ // document.all("relatomain").value = arrResult[0][0]; // document.all("relatomainName").value = arrResult[0][1]; document.all("ZipCode").value = arrResult[0][2]; document.all("EMail").value = arrResult[0][3]; document.all("MicroNo").value = arrResult[0][4]; document.all("Mobile").value = arrResult[0][5]; document.all("Phone").value = arrResult[0][6]; document.all("ProvinceCode").value = arrResult[0][7]; document.all("ProvinceName").value = arrResult[0][8]; document.all("CityCode").value = arrResult[0][9]; document.all("CityName").value = arrResult[0][10]; document.all("CountyCode").value = arrResult[0][11]; document.all("CountyName").value = arrResult[0][12]; document.all("DetailAddress").value = arrResult[0][13]; document.all("JoinCompDate").value = arrResult[0][14]; document.all("Seniority").value = arrResult[0][15]; document.all("WorkIDNo").value = arrResult[0][16]; document.all("ISLongValid").value = arrResult[0][17]; document.all("ISLongValidName").value = arrResult[0][18]; document.all("LiscenceValidDate").value = arrResult[0][19]; document.all("ComponyName").value = arrResult[0][20]; document.all("DeptCode").value = arrResult[0][21]; // document.all("InsureCode").value = arrResult[0][22]; document.all("WorkAddress").value = arrResult[0][23]; document.all("SocialAddress").value = arrResult[0][24]; document.all("LiscenceStartDate").value = arrResult[0][25]; document.all("NativePlace").value = arrResult[0][26]; document.all("NativePlaceName").value = arrResult[0][27]; // document.all("Social").value = arrResult[0][28]; // document.all("SocialName").value = arrResult[0][29]; document.all("OldZipCode").value = arrResult[0][2]; document.all("OldEMail").value = arrResult[0][3]; document.all("OldMicroNo").value = arrResult[0][4]; document.all("OldMobile").value = arrResult[0][5]; document.all("OldPhone").value = arrResult[0][6]; document.all("ProvinceCode").value = arrResult[0][7]; document.all("ProvinceOldName").value = arrResult[0][8]; document.all("CityCode").value = arrResult[0][9]; document.all("CityOldName").value = arrResult[0][10]; document.all("CountyCode").value = arrResult[0][11]; document.all("CountyOldName").value = arrResult[0][12]; document.all("DetailOldAddress").value = arrResult[0][13]; document.all("JoinOldCompDate").value = arrResult[0][14]; document.all("OldSeniority").value = arrResult[0][15]; document.all("WorkOldIDNo").value = arrResult[0][16]; document.all("OldISLongValid").value = arrResult[0][17]; document.all("oldISLongValidName").value = arrResult[0][18]; document.all("OldLiscenceValidDate").value = arrResult[0][19]; document.all("OldComponyName").value = arrResult[0][20]; document.all("OldDeptCode").value = arrResult[0][21]; // document.all("InsureCode").value = arrResult[0][22]; document.all("OldWorkAddress").value = arrResult[0][23]; document.all("OldSocialAddress").value = arrResult[0][24]; document.all("OldLiscenceStartDate").value = arrResult[0][25]; document.all("NativeOldPlace").value = arrResult[0][26]; document.all("NativeOldPlaceName").value = arrResult[0][27]; Hidrelatomain = arrResult[0][1]; } } function showOldInsuredList1(){ clearPage(); var tInsuredNo=""; var tContNo=""; var tSelNo = UpdateInsuredInfoGrid.getSelNo(); var tOldIdno = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,3); tSQLInfo1 = new SqlClass(); tSQLInfo1.setResourceName("g_pos.EdorBBSql"); tSQLInfo1.setModule("grp_pa"); tSQLInfo1.setSqlId("EdorBBSql8"); tSQLInfo1.addSubPara(document.all("GrpPropNo").value); tSQLInfo1.addSubPara(tOldIdno); var arrResult1 = easyExecSql(tSQLInfo1.getString(), 1, 0, 1); if (arrResult1 != null){ tInsuredNo = arrResult1[0][0]; tContNo = arrResult1[0][1]; } tSQLInfo0 = new SqlClass(); tSQLInfo0.setResourceName("g_pos.EdorBBSql"); tSQLInfo0.setModule("grp_pa"); tSQLInfo0.setSqlId("EdorBBSql9"); tSQLInfo0.addSubPara(document.all("EdorAppNo").value); var upArrResul1= easyExecSql(tSQLInfo0.getString()); if (upArrResul1== null){ var querySql = ""; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorBBSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("queryOldInsuredInfo"); tSQLInfo.addSubPara(tInsuredNo); tSQLInfo.addSubPara(document.all("GrpPropNo").value); tSQLInfo.addSubPara(tContNo); var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1); }else { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorBBSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("EdorBBSql10"); tSQLInfo.addSubPara(tInsuredNo); tSQLInfo.addSubPara(document.all("EdorNo").value); tSQLInfo.addSubPara(tContNo); var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1); } if(arrResult !=null){ // document.all("relatomain").value = arrResult[0][0]; // document.all("relatomainName").value = arrResult[0][1]; document.all("OldZipCode").value = arrResult[0][2]; document.all("OldEMail").value = arrResult[0][3]; document.all("OldMicroNo").value = arrResult[0][4]; document.all("OldMobile").value = arrResult[0][5]; document.all("OldPhone").value = arrResult[0][6]; document.all("ProvinceCode").value = arrResult[0][7]; document.all("ProvinceOldName").value = arrResult[0][8]; document.all("CityCode").value = arrResult[0][9]; document.all("CityOldName").value = arrResult[0][10]; document.all("CountyCode").value = arrResult[0][11]; document.all("CountyOldName").value = arrResult[0][12]; document.all("DetailOldAddress").value = arrResult[0][13]; document.all("JoinOldCompDate").value = arrResult[0][14]; document.all("OldSeniority").value = arrResult[0][15]; document.all("WorkOldIDNo").value = arrResult[0][16]; document.all("OldISLongValid").value = arrResult[0][17]; document.all("oldISLongValidName").value = arrResult[0][18]; document.all("OldLiscenceValidDate").value = arrResult[0][19]; document.all("OldComponyName").value = arrResult[0][20]; document.all("OldDeptCode").value = arrResult[0][21]; // document.all("InsureCode").value = arrResult[0][22]; document.all("OldWorkAddress").value = arrResult[0][23]; document.all("OldSocialAddress").value = arrResult[0][24]; document.all("OldLiscenceStartDate").value = arrResult[0][25]; document.all("NativeOldPlace").value = arrResult[0][26]; document.all("NativeOldPlaceName").value = arrResult[0][27]; // document.all("Social").value = arrResult[0][28]; // document.all("SocialName").value = arrResult[0][29]; Hidrelatomain = arrResult[0][1]; } } /** * 保存 */ function addRecord(){ if (!beforeSubmit()) { return false; } var tSelNoOld = OldInsuredInfoGrid.getSelNo(); var tSelNoUpdate = UpdateInsuredInfoGrid.getSelNo(); // document.all("InsuredNo").value = document.all("InsureCode").value; if(tSelNoOld=='0' && tSelNoUpdate=='0'){ i18nAlert("请选中一条原被保人信息或修改后的被保人信息进行保存!", "LIS-03325"); return false; } mOperate = "INSERT||UPDATE"; submitForm(); } /** * 撤销 */ function deleteRecord(){ var tSelNo = UpdateInsuredInfoGrid.getSelNo(); // document.all("InsuredNo").value = fm.InsureCode.value; if(tSelNo=='0'){ i18nAlert("请选择一条修改过的被保险人信息进行撤销!", "LIS-03326"); return false; } mOperate = "DELETE"; submitForm(); } /** * 操作前校验 */ function beforeSubmit(){ var tCurrentDate = document.all("CurrentDate").value; if(!verifyForm("fm")){ return false; } // 校验证件有效期 if(document.all("LiscenceValidDate").value !=""){ if(document.all("LiscenceValidDate").value