//该文件中包含客户端需要处理的函数和事件 var showInfo; var turnPage = new turnPageClass(); //使用翻页功能,必须建立为全局变量 var turnPage1 = new turnPageClass(); //使用翻页功能,必须建立为全局变量 var turnPage2 = new turnPageClass(); //使用翻页功能,必须建立为全局变量 /************************************************************************** * 初始化部分保全信息 * Transact: RP||INSERT ************************************************************************** */ function initInpBox() { var arrResultDate; tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorAKSql"); tSQLInfo.setSqlId("queryEdorAppDateAndEdorValiDate"); tSQLInfo.addSubPara(tEdorAppNo); try { arrResultDate = easyExecSql(tSQLInfo.getString(), 1, 0); } catch (ex) { alert("警告:初始化出现异常!"); return; } if (arrResultDate != null) { try { //文本框 document.getElementsByName("EdorAcceptNo")[0].value = tEdorAppNo; document.getElementsByName("EdorNo")[0].value = null; document.getElementsByName("EdorType")[0].value = tEdorType; document.getElementsByName("GrpContNo")[0].value = tGrpContNo; document.getElementsByName("EdorItemAppDate")[0].value = arrResultDate[0][0]; if (arrResultDate[0][1] != null && arrResultDate[0][1] != "") { document.getElementsByName("EdorValiDate")[0].value = arrResultDate[0][1]; } else { let dateObj = new Date(arrResultDate[0][0]); // 对Date对象进行日期加1操作 dateObj.setDate(dateObj.getDate() + 1); // 将操作后的Date对象转换回字符串格式(这里简单使用toISOString方法,可按需调整格式) let newStrDate = dateObj.toISOString().split('T')[0]; document.getElementsByName("EdorValiDate")[0].value = newStrDate; } fm.all('AllPolType').value = top.opener.fm.all('AllPolType').value; fm.all('ActivityID').value = tActivityID; fm.all('OrganComCode').value = ""; if (fm.all('AllPolType').value == '1' || fm.all('AllPolType').value == '2') { fm.all('OrganComCode').value = top.opener.fm.all('OrganComCode').value; } showOneCodeName('GEdorType', 'EdorType', 'EdorTypeName'); } catch (ex) { alert("在 GEdorSAInit.jsp --> initInputBox 函数中发生异常: 初始化界面错误!"); } } } /************************************************************************** * 保单不定期交费操作收费确认按钮 * Transact: RP||INSERT ************************************************************************** */ function edorTypeRPSave() { if (!verifyInput2()) { return false; } if (!checkInput(InsuredOldGrid, "保留账户")) { return; } if (fm.all('CurFeeStand').value == null || fm.all('CurFeeStand').value == "") { i18nAlert("请输入保留账户管理费标准!", ""); return; } if (!isNumeric(fm.all('CurFeeStand').value)) { i18nAlert("保留账户管理费标准不是有效的数字!", ""); return false; } var tCurFeeStand = fm.all('CurFeeStand').value; if (!checkDecimalFormat(tCurFeeStand, 2 , 2 )){ i18nAlert("保留账户管理费标准整数位不超过2位,小数位不超过2位!", ""); return false; } var showStr = "正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面"; var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + showStr; // showInfo=window.showModelessDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px"); var name = '提示'; //网页名称,可为空; var iWidth = 550; //弹出窗口的宽度; var iHeight = 350; //弹出窗口的高度; 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.all('fmtransact').value = "AK||INSERT"; // fm.action = "./GEdorTypeAKSubmit.jsp"; document.getElementById("fm").action = "../API/grp_pa/g_pos/EdorAKSave/AKINSERT"; ajaxSubmit2(document.getElementById("fm")); // fm.submit(); } /************************************************************************** * 撤销保单不定期交费操作保存按钮 * Transact: AK||DELETE ************************************************************************** */ function edorTypeRPDelete() { if (!checkInput(InsuredGrid, "撤销保留账户")) { return; } var showStr = "正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面"; var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + showStr; // showInfo=window.showModelessDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px"); var name = '提示'; //网页名称,可为空; var iWidth = 550; //弹出窗口的宽度; var iHeight = 350; //弹出窗口的高度; 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.all('fmtransact').value = "AK||DELETE"; document.getElementById("fm").action = "../API/grp_pa/g_pos/EdorAKSave/AKDELETE"; ajaxSubmit2(document.getElementById("fm")); // fm.action = "./GEdorTypeAKSubmit.jsp"; // fm.submit(); } //保存 function edorTypeRPFinish() { var showStr = "正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面"; var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + showStr; // showInfo=window.showModelessDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px"); var name = '提示'; //网页名称,可为空; var iWidth = 550; //弹出窗口的宽度; var iHeight = 350; //弹出窗口的高度; 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.all('fmtransact').value = "G&Finish"; document.getElementById("fm").action = "../API/grp_pa/g_pos/EdorAKSave/GFinish"; ajaxSubmit2(document.getElementById("fm")); } /** * 提交后操作, 服务器数据返回后执行的操作 */ function afterSubmit(DealFlag, MsgContent) { try { showInfo.close(); } catch (ex) { } DealFlag = DealFlag.toLowerCase(); var MsgPageURL = "../common/jsp/MessagePage.jsp?picture="; switch (DealFlag) { case "fail": MsgPageURL = MsgPageURL + "F&content=" + MsgContent; // showInfo = showModalDialog(MsgPageURL, window, "status=0; help=0; close=0; dialogWidth=550px; dialogHeight=250px"); var name = '提示'; //网页名称,可为空; var iWidth = 550; //弹出窗口的宽度; var iHeight = 350; //弹出窗口的高度; var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置 var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置 showInfo = window.open(MsgPageURL, 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(); break; case "succ": case "success": MsgPageURL = MsgPageURL + "S&content=" + MsgContent; // showInfo = showModalDialog(MsgPageURL, window, "status=0; help=0; close=0; dialogWidth=550px; dialogHeight=350px"); var name = '提示'; //网页名称,可为空; var iWidth = 550; //弹出窗口的宽度; var iHeight = 350; //弹出窗口的高度; var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置 var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置 showInfo = window.open(MsgPageURL, 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(); break; default: MsgPageURL = MsgPageURL + "C&content=" + MsgContent; // showInfo = showModalDialog(MsgPageURL, window, "status=0; help=0; close=0; dialogWidth=550px; dialogHeight=300px"); var name = '提示'; //网页名称,可为空; var iWidth = 550; //弹出窗口的宽度; var iHeight = 350; //弹出窗口的高度; var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置 var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置 showInfo = window.open(MsgPageURL, 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(); break; } //本文件的特殊处理 if (DealFlag == "succ" || DealFlag == "success") { try { queryClick(); queryClick2(); queryBackFee(); } catch (ex) { } } } function queryClick() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorAKSql"); tSQLInfo.setSqlId("queryLCInsuredInsuredInfoByGrpContNoiInfo"); tSQLInfo.addSubPara(fm.GrpContNo.value); tSQLInfo.addSubPara(fm.ContNo1.value); tSQLInfo.addSubPara(fm.CustomerNo1.value); tSQLInfo.addSubPara(fm.Name1.value); tSQLInfo.addSubPara(fm.Sex1.value); tSQLInfo.addSubPara(fm.Birthday1.value); tSQLInfo.addSubPara(fm.IDType1.value); tSQLInfo.addSubPara(fm.IDNo1.value); tSQLInfo.addSubPara(fm.all('EdorNo').value); tSQLInfo.addSubPara(fm.all('EdorAcceptNo').value); // var tNumPub = easyQueryVer3Modal(tSQLInfo.getString(), InsuredOldGrid); turnPage1.queryModal(tSQLInfo.getString(), InsuredOldGrid); //InsuredOldGrid.SortPage=turnPage1; //InsuredOldGrid.setPageMark(turnPage1); } function queryClick2() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorAKSql"); tSQLInfo.setSqlId("queryNewLPInsuredInsuredInfoByGrpContNoiInfo"); tSQLInfo.addSubPara(fm.GrpContNo.value); tSQLInfo.addSubPara(fm.ContNo2.value); tSQLInfo.addSubPara(fm.CustomerNo2.value); tSQLInfo.addSubPara(fm.Name2.value); tSQLInfo.addSubPara(fm.Sex2.value); tSQLInfo.addSubPara(fm.Birthday1.value); tSQLInfo.addSubPara(fm.IDType2.value); tSQLInfo.addSubPara(fm.IDNo2.value); tSQLInfo.addSubPara(fm.all('EdorAcceptNo').value); tSQLInfo.addSubPara(fm.all('EdorNo').value); turnPage2.queryModal(tSQLInfo.getString(), InsuredGrid); //按钮隐藏 var edorTypeRPSave = document.getElementById("edorTypeRPSave1"); var edorTypeRPDelete = document.getElementById("edorTypeRPDelete1"); var edorTypeRPFinish = document.getElementById("edorTypeRPFinish1"); if (tActivityID == null||tActivityID === "null"){ edorTypeRPSave.style.display = 'none'; edorTypeRPDelete.style.display = 'none'; edorTypeRPFinish.style.display = 'none'; }else { edorTypeRPSave.style.display = ''; edorTypeRPDelete.style.display = ''; edorTypeRPFinish.style.display = ''; } // if(InsuredGrid.mulLineCount<1) // { // alert(" 没有符合条件的数据,请重新设置查询条件进行查询"); // return; // } } function queryClickButton() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorAKSql"); tSQLInfo.setSqlId("queryLCInsuredInsuredInfoByGrpContNoiInfo"); tSQLInfo.addSubPara(fm.GrpContNo.value); tSQLInfo.addSubPara(fm.ContNo1.value); tSQLInfo.addSubPara(fm.CustomerNo1.value); tSQLInfo.addSubPara(fm.Name1.value); tSQLInfo.addSubPara(fm.Sex1.value); tSQLInfo.addSubPara(fm.Birthday1.value); tSQLInfo.addSubPara(fm.IDType1.value); tSQLInfo.addSubPara(fm.IDNo1.value); tSQLInfo.addSubPara(fm.all('EdorNo').value); tSQLInfo.addSubPara(fm.all('EdorAcceptNo').value); // var tNumPub = easyQueryVer3Modal(tSQLInfo.getString(), InsuredOldGrid); turnPage1.queryModal(tSQLInfo.getString(), InsuredOldGrid); // turnPage1.queryModal(strSQL, InsuredOldGrid); //InsuredOldGrid.SortPage=turnPage1; //InsuredOldGrid.setPageMark(turnPage1); if (InsuredOldGrid.mulLineCount < 1) { alert(" 没有符合条件的待操作被保人信息数据,请重新设置查询条件进行查询"); return; } } function queryClickButton2() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorAKSql"); tSQLInfo.setSqlId("queryNewLPInsuredInsuredInfoByGrpContNoiInfo"); tSQLInfo.addSubPara(fm.GrpContNo.value); tSQLInfo.addSubPara(fm.ContNo2.value); tSQLInfo.addSubPara(fm.CustomerNo2.value); tSQLInfo.addSubPara(fm.Name2.value); tSQLInfo.addSubPara(fm.Sex2.value); tSQLInfo.addSubPara(fm.Birthday1.value); tSQLInfo.addSubPara(fm.IDType2.value); tSQLInfo.addSubPara(fm.IDNo2.value); tSQLInfo.addSubPara(fm.all('EdorAcceptNo').value); tSQLInfo.addSubPara(fm.all('EdorNo').value); turnPage2.queryModal(tSQLInfo.getString(), InsuredGrid); if (InsuredGrid.mulLineCount < 1) { alert(" 没有符合条件的数据,请重新设置查询条件进行查询"); return; } } function checkInput(CheckGrid, Msg) { var checkAcount = 0; for (i = 0; i < CheckGrid.mulLineCount; i++) { if (CheckGrid.getChkNo(i)) { checkAcount++; break; } } if (checkAcount < 1) { alert("请至少选择一个被保人进行" + Msg + "操作!"); return false; } return true; } function initFeeRate() { var tNumPub //可能查询出两条记录,是因为个人账户和团体账户,但是两个账户的交费比例是一样的 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorAKSql"); tSQLInfo.setSqlId("queryLPGrpEdorItemStandbyFlag3ByGrpContNoEdorTpyeEdorNo"); tSQLInfo.addSubPara(tEdorAppNo); try { // tNumPub = easyExecSql(tSQLInfo.getString(), 1, 0); } catch (e) { } if (tNumPub) { if (parseFloat(tNumPub[0][0]) > 0) { var V1 = parseFloat(tNumPub[0][0]) * 100; fm.CurFeeStand.value = V1; } else { fm.CurFeeStand.value = '5'; } } else { fm.CurFeeStand.value = '5'; } } /** * 校验数据整数位于小数位长度 */ function checkDecimalFormat(cValue, cLen1, cLen2) { if (cValue == '' || cValue == null) {//为空, return true; } var tLen = ("" + cValue + "").length; var tLen1 = ("" + cValue + "").indexOf("."); var tLen2 = 0; if (tLen1 == -1) { tLen1 = tLen; } else { tLen2 = tLen - tLen1 - 1; } if (Number(tLen1) > Number(cLen1)) { return false; } if (Number(tLen2) > Number(cLen2)) { return false; } return true; } /** * 返回主界面 */ function returnbak() { top.opener.initForm(); top.close(); } //清单导入 function ListImport() { window.open("./EdorInsuredDealMain.jsp?MissionID=" + tMissionID + "&SubMissionID=" + tSubMissionID + "&ActivityID=" + tActivityID + "&EdorAppNo=" + tEdorAppNo, "人员清单处理", 'width=' + screen.availWidth + ',height=' + screen.availHeight + ',top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0'); // window.open("./GEdorDiskImport.jsp"); }