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

ProName:EdorNCDetailInput.js

*

Title:方案明细信息录入

*

Description:方案明细信息录入

*

Copyright:Copyright (c) 2012

*

Company:Sinosoft

* @author : JingDian * @version : 8.0 * @date : 2014-07-14 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass();//方案信息 var tSQLInfo = new SqlClass(); function queryPlanDetail() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorNCSql"); tSQLInfo.setSqlId("EdorNCSql2"); tSQLInfo.addSubPara(tPolicyNo); tSQLInfo.addSubPara(tEdorNo); tSQLInfo.addSubPara(tEdorType); initPlanDetailInfoGrid(); turnPage1.queryModal(tSQLInfo.getString(), PlanDetailInfoGrid, 1, 1);//第三位表示使用大数据量 } /** * 模拟下拉操作 */ function returnShowCodeList(value1, value2, value3) { returnShowCode(value1, value2, value3, '0'); } function returnShowCodeListKey(value1, value2, value3) { returnShowCode(value1, value2, value3, '1'); } function returnShowCode(value1, value2, value3, returnType) { fmPub.all("HiddenCodeType").value = value1; if (value1=='edorplan') { if (returnType=='0') { return showCodeList('edorplan',value2,value3,null,[tPolicyNo,tEdorNo],['PolicyNo','EdorNo'],'1',null); } else { return showCodeListKey('edorplan',value2,value3,null,[tPolicyNo,tEdorNo],['PolicyNo','EdorNo'],'1',null); } } if (value1=='quotrisk') { if (isEmpty(fm2.PlanCode)) { i18nAlert("请先选择方案", "LIS-02717"); return false; } var tPlanType = fm2.PlanType.value; var tSql = "1"; if (tContPlanType=='00') {//如果是普通险种,看方案是否为公共保额方案,如果是,那么仅下拉出公共保额,如果不是,那么下拉出不含公共 保额的其他普通险种 if (tPlanType=="00") {//非公共保额 tSql = ['2',tCurrentDate,'00','00',tPolicyNo]; } else if (tPlanType=="01") { tSql = ['',tCurrentDate,'00','01','']; } else { return null; } } else if (tContPlanType=='01') {//建工险 tSql = ['',tCurrentDate,'01','','']; } else if (tContPlanType=='02') {//账户型 tSql = ['',tCurrentDate,'02','','']; } else if (tContPlanType=='03') {//个人产品 tSql = ['',tCurrentDate,'03','','']; } if (returnType=='0') { return showCodeList('quotrisk',value2,value3,null,tSql,['S1','CurrentDate','TranProdType','PlanType','PolicyNo'],'1',null); } else { return showCodeListKey('quotrisk',value2,value3,null,tSql,['S1','CurrentDate','TranProdType','PlanType','PolicyNo'],'1',null); } } if (value1=='quotduty') { if (isEmpty(fm2.RiskCode)) { i18nAlert("请先选择险种", "LIS-02718"); return false; } var tSql = [fm2.RiskCode.value,'']; if (fm2.PlanType.value=="02") {//个人账户 tSql = [fm2.RiskCode.value,'02']; } else if (fm2.PlanType.value=="03") {//团体账户 tSql = [fm2.RiskCode.value,'03']; } if (returnType=='0') { return showCodeList('quotduty',value2,value3,null,tSql,['RiskCode','PlanType'],'1',null); } else { return showCodeListKey('quotduty',value2,value3,null,tSql,['RiskCode','PlanType'],'1',null); } } if (value1=='amnttype') { if (tContPlanType=="00") {//普通险种,拓展编码为产品类型+方案类型 var tPlanType = fm2.PlanType.value; if (tPlanType==null || tPlanType=="") { i18nAlert("请选择方案!", "LIS-02719"); return false; } if (returnType=='0') { return showCodeList('queryexp',value2,value3,null,['amnttype',tContPlanType+tPlanType],['CodeType','CodeExp'],'1',null); } else { return showCodeListKey('queryexp',value2,value3,null,['amnttype',tContPlanType+tPlanType],['CodeType','CodeExp'],'1',null); } } else if (tContPlanType=="01") {//建工险,拓展编码为产品类型+保费计算方式 var tPremCalType = fm2.PremCalType.value; if (tPremCalType==null || tPremCalType=="") { i18nAlert("请选择方案!", "LIS-02719"); return false; } if (returnType=='0') { return showCodeList('queryexp',value2,value3,null,['amnttype',tContPlanType+tPremCalType],['CodeType','CodeExp'],'1',null); } else { return showCodeListKey('queryexp',value2,value3,null,['amnttype',tContPlanType+tPremCalType],['CodeType','CodeExp'],'1',null); } } else if (tContPlanType=="03") {//个人险种,拓展编码为产品类型+方案类型 var tPlanType = fm2.PlanType.value; if (tPlanType==null || tPlanType=="") { i18nAlert("请选择方案!", "LIS-02719"); return false; } if (returnType=='0') { return showCodeList('queryexp',value2,value3,null,['amnttype',tContPlanType+tPlanType],['CodeType','CodeExp'],'1',null); } else { return showCodeListKey('queryexp',value2,value3,null,['amnttype',tContPlanType+tPlanType],['CodeType','CodeExp'],'1',null); } } } if (value1=='exceptpremtype') { var tOccupTypeFlag = fm2.OccupTypeFlag.value; if (returnType=='0') { if (tOccupTypeFlag=="2") { return showCodeList('queryexp',value2,value3,null,['exceptpremtype','0'],['CodeType','CodeExp'],'1',null); } else { return showCodeList('queryexp',value2,value3,null,['exceptpremtype','0'],['CodeType','CodeExp'],'1',null); } } else { if (tOccupTypeFlag=="2") { return showCodeListKey('queryexp',value2,value3,null,['exceptpremtype','0'],['CodeType','CodeExp'],'1',null); } else { return showCodeListKey('queryexp',value2,value3,null,['exceptpremtype','0'],['CodeType','CodeExp'],'1',null); } } } } function afterCodeSelect(cCodeType, Field) { var tCodeType = fmPub.HiddenCodeType.value; fmPub.HiddenCodeType.value = ""; if (cCodeType=="edorplan") {//下拉方案后,如果方案信息与所选方案信息不一致,那么重置方案信息 var tPlanCode = fm2.PlanCode.value; var tPlanDesc = fm2.PlanDesc.value; var tSysPlanCode = fm2.SysPlanCode.value; var tPlanType = fm2.PlanType.value; var tPremCalType = fm2.PremCalType.value; var tPlanFlag = fm2.PlanFlag.value; var tOccupTypeFlag = fm2.OccupTypeFlag.value; var tOldPlanType = fm2.OldPlanType.value; var tOldPremCalType = fm2.OldPremCalType.value; var tOldOccupTypeFlag = fm2.OldOccupTypeFlag.value; fm2.OldPlanType.value = tPlanType; fm2.OldPremCalType.value = tPremCalType; fm2.OldOccupTypeFlag.value = tOccupTypeFlag; if (tContPlanType=="01") { if (tOldPremCalType==null || tOldPremCalType=="") { return; } if (tPremCalType!=tOldPremCalType) { fm2.RiskCode.value = ""; fm2.RiskName.value = ""; fm2.DutyCode.value = ""; fm2.DutyName.value = ""; dealShowDuty(fm2, "divDutyFactor"); document.getElementById("divInfo4").style.display = 'none'; } } else { if (tOldPlanType==null || tOldPlanType=="") { return; } if (tPlanType!=tOldPlanType) { fm2.RiskCode.value = ""; fm2.RiskName.value = ""; fm2.DutyCode.value = ""; fm2.DutyName.value = ""; dealShowDuty(fm2, "divDutyFactor"); document.getElementById("divInfo4").style.display = 'none'; } if (tContPlanType!="02") {//账户型产品不进行期望保费处理 if (tOldOccupTypeFlag=="1" && tOccupTypeFlag=="2") {//只有当单职业类别向多职业类别转变时,才进行才处理 fm2.ExceptPremType.value = ""; fm2.ExceptPremTypeName.value = ""; fm2.ExceptPrem.value = ""; } } } } else if (cCodeType=="quotrisk") {//选完险种后,清空责任及责任动态信息 dealShowDuty(fm2, "divDutyFactor"); } else if (cCodeType=="quotduty") {//选完责任后,处理责任动态域 var tRiskCode = fm2.RiskCode.value; var tDutyCode = fm2.DutyCode.value; var tFlag = 0; var tObj = fm2; var tDivID = "divDutyFactor"; var tSysPlanCode = fm2.SysPlanCode.value; var tPlanCode = fm2.PlanCode.value; var tPlanType = fm2.PlanType.value; dealRiskDuty(tRiskCode, tDutyCode, tFlag, tObj, tDivID, tSysPlanCode, tPlanCode, tPlanType);//再次增加个方案 } else if (cCodeType=="queryexp") {//选择保额类型后,处理保额动态展示 if (tCodeType=="amnttype") { dealAmntShow(fm2, Field.value); } } else if (cCodeType=="trueflag") { dealDutyLimitAmnt('Page'); } } /** * 选择保额后处理 */ function dealAmntShow(cObj, tFieldValue) { if (tFieldValue=="01") { document.getElementById("idFixedAmnt00").style.display = ""; document.getElementById("idFixedAmnt01").style.display = ""; document.getElementById("idSalaryMult00").style.display = "none"; document.getElementById("idSalaryMult01").style.display = "none"; document.getElementById("idMaxAmnt00").style.display = "none"; document.getElementById("idMaxAmnt01").style.display = "none"; document.getElementById("idMinAmnt00").style.display = "none"; document.getElementById("idMinAmnt01").style.display = "none"; document.getElementById("idAmnt00").style.display = "none"; document.getElementById("idAmnt01").style.display = "none"; document.getElementById("idAmnt02").style.display = ""; document.getElementById("idAmnt03").style.display = ""; } else if (tFieldValue=="02") { document.getElementById("idFixedAmnt00").style.display = "none"; document.getElementById("idFixedAmnt01").style.display = "none"; document.getElementById("idSalaryMult00").style.display = ""; document.getElementById("idSalaryMult01").style.display = ""; document.getElementById("idMaxAmnt00").style.display = "none"; document.getElementById("idMaxAmnt01").style.display = "none"; document.getElementById("idMinAmnt00").style.display = "none"; document.getElementById("idMinAmnt01").style.display = "none"; document.getElementById("idAmnt00").style.display = "none"; document.getElementById("idAmnt01").style.display = "none"; document.getElementById("idAmnt02").style.display = ""; document.getElementById("idAmnt03").style.display = ""; } else if (tFieldValue=="03") { document.getElementById("idFixedAmnt00").style.display = "none"; document.getElementById("idFixedAmnt01").style.display = "none"; document.getElementById("idSalaryMult00").style.display = ""; document.getElementById("idSalaryMult01").style.display = ""; document.getElementById("idMaxAmnt00").style.display = "none"; document.getElementById("idMaxAmnt01").style.display = "none"; document.getElementById("idMinAmnt00").style.display = ""; document.getElementById("idMinAmnt01").style.display = ""; document.getElementById("idAmnt00").style.display = "none"; document.getElementById("idAmnt01").style.display = "none"; document.getElementById("idAmnt02").style.display = "none"; document.getElementById("idAmnt03").style.display = "none"; } else if (tFieldValue=="04") { document.getElementById("idFixedAmnt00").style.display = "none"; document.getElementById("idFixedAmnt01").style.display = "none"; document.getElementById("idSalaryMult00").style.display = "none"; document.getElementById("idSalaryMult01").style.display = "none"; document.getElementById("idMaxAmnt00").style.display = ""; document.getElementById("idMaxAmnt01").style.display = ""; document.getElementById("idMinAmnt00").style.display = ""; document.getElementById("idMinAmnt01").style.display = ""; document.getElementById("idAmnt00").style.display = "none"; document.getElementById("idAmnt01").style.display = "none"; document.getElementById("idAmnt02").style.display = "none"; document.getElementById("idAmnt03").style.display = "none"; } } /** * 点击主附共用配置时处理 */ function setRelationFlag() { if (document.getElementById("divDutyFactorRelation").style.display=="") { fm2.RelaShareFlag.value = "0"; dealRelationShow(fm2, "0"); } else { fm2.RelaShareFlag.value = "1"; dealRelationShow(fm2, "1"); } } /** * 根据主副关联标记展示附属域 */ function dealRelationShow(cObj, tFieldValue) { if (tFieldValue=="1") { document.getElementById("SetRelation").checked = true; document.getElementById("trRelationRate").style.display = ""; document.getElementById("divDutyFactorRelation").style.display = ""; } else { document.getElementById("SetRelation").checked = false; document.getElementById("trRelationRate").style.display = "none"; document.getElementById("divDutyFactorRelation").style.display = "none"; } } /** * 点击方案明细,展示信息 */ function showPlanDetailInfo() { var tSelNo = PlanDetailInfoGrid.getSelNo()-1; var tSysPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 1); var tPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 2); var tRiskCode = PlanDetailInfoGrid.getRowColData(tSelNo, 12); var tDutyCode = PlanDetailInfoGrid.getRowColData(tSelNo, 14); var tFlag = 1; var tObj = fm2; var tDivID = "divDutyFactor"; var tPlanDesc = PlanDetailInfoGrid.getRowColData(tSelNo, 3); var tPlanType = PlanDetailInfoGrid.getRowColData(tSelNo, 4); var tPremCalType = PlanDetailInfoGrid.getRowColData(tSelNo, 6); var tPlanFlag = PlanDetailInfoGrid.getRowColData(tSelNo, 8); var tOccupTypeFlag = PlanDetailInfoGrid.getRowColData(tSelNo, 10); var tRiskName = PlanDetailInfoGrid.getRowColData(tSelNo, 13); var tDutyName = PlanDetailInfoGrid.getRowColData(tSelNo, 15); document.getElementById("SysPlanCode").value = tSysPlanCode; document.getElementById("PlanCode").value = tPlanCode; document.getElementById("PlanType").value = tPlanType; document.getElementById("PremCalType").value = tPremCalType; document.getElementById("PlanFlag").value = tPlanFlag; document.getElementById("OccupTypeFlag").value = tOccupTypeFlag; document.getElementById("OldOccupTypeFlag").value = tOccupTypeFlag; document.getElementById("PlanDesc").value = tPlanDesc; document.getElementById("RiskCode").value = tRiskCode; document.getElementById("RiskName").value = tRiskName; document.getElementById("DutyCode").value = tDutyCode; document.getElementById("DutyName").value = tDutyName; document.getElementById("OldPlanType").value = tPlanType; document.getElementById("OldPremCalType").value = tPremCalType; dealRiskDuty(tRiskCode, tDutyCode, tFlag, tObj, tDivID, tSysPlanCode, tPlanCode, tPlanType); if (tPlanType=="01") { document.getElementById("divInfo4").style.display = ""; queryPubAmntRelaPlanInfo(); initPubAmntRelaDutyGrid(); } else { document.getElementById("divInfo4").style.display = "none"; } if(tContPlanType=='02'){ divInfo6.style.display=''; initPayFeeGrid(); tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorNCSql"); tSQLInfo.setSqlId("EdorNCSql15"); tSQLInfo.addSubPara(tRiskCode); tSQLInfo.addSubPara(tDutyCode); tSQLInfo.addSubPara(tPolicyNo); tSQLInfo.addSubPara(tSysPlanCode); tSQLInfo.addSubPara(tPlanCode); tSQLInfo.addSubPara(tEdorNo); tSQLInfo.addSubPara(tEdorType); turnPage4.queryModal(tSQLInfo.getString(), PayFeeGrid, 1, 1); } } /** * 增加方案明细 */ function addPlanDetail() { if (!beforeSubmit(fm2, tContPlanType)) { return false; } dealRedundant(fm2, tContPlanType); if (!verifyForm('fm2')) { return false; } fmPub.Operate.value = "ADDPLANDETAIL"; fm2.action = "../API/grp_pa/g_pos/EdorNCDetailSave/ADDPLANDETAIL?Operate=ADDPLANDETAIL&PolicyNo="+ tPolicyNo +"&EdorNo="+ tEdorNo+"&EdorType="+ tEdorType +"&MissionID="+ tMissionID +"&SubMissionID="+ tSubMissionID +"&ActivityID="+ tActivityID +"&ContPlanType="+ tContPlanType; submitForm(fm2,true); } /** * 修改方案明细 */ function modifyPlanDetail() { fmPub.Operate.value = "MODIFYPLANDETAIL"; var tSelNo = PlanDetailInfoGrid.getSelNo()-1; if (tSelNo<0) { i18nAlert("请选择要操作的记录!", "LIS-02720"); return false; } if (!checkSame()) { return false; } dealRedundant(fm2, tContPlanType); if (!verifyForm('fm2')) { return false; } if (!beforeSubmit(fm2, tContPlanType)) { return false; } var tSysPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 1); var tPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 2); var tRiskCode = PlanDetailInfoGrid.getRowColData(tSelNo, 12); var tDutyCode = PlanDetailInfoGrid.getRowColData(tSelNo, 14); fm2.action = "../API/grp_pa/g_pos/EdorNCDetailSave/MODIFYPLANDETAIL?Operate=MODIFYPLANDETAIL&PolicyNo="+ tPolicyNo+"&EdorNo="+ tEdorNo+"&EdorType="+ tEdorType +"&MissionID="+ tMissionID +"&SubMissionID="+ tSubMissionID +"&ActivityID="+ tActivityID +"&OSysPlanCode="+ tSysPlanCode +"&OPlanCode="+ tPlanCode +"&ORiskCode="+ tRiskCode +"&ODutyCode="+ tDutyCode +"&ContPlanType="+ tContPlanType; submitForm(fm2,true); } /** * 删除方案明细,删除时,需校验所选方案,险种,责任是否一致 */ function delPlanDetail() { fmPub.Operate.value = "DELPLANDETAIL"; var tSelNo = PlanDetailInfoGrid.getSelNo()-1; if (tSelNo<0) { i18nAlert("请选择要操作的记录!", "LIS-02720"); return false; } if(!i18nConfirm("确定要删除选中信息吗?", "LIS-00693")){ return false; } if (!checkSame()) { return false; } var tSysPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 1); var tPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 2); var tRiskCode = PlanDetailInfoGrid.getRowColData(tSelNo, 12); var tDutyCode = PlanDetailInfoGrid.getRowColData(tSelNo, 14); fm2.action = "../API/grp_pa/g_pos/EdorNCDetailSave/DELPLANDETAIL?Operate=DELPLANDETAIL&PolicyNo=" + tPolicyNo + "&EdorNo="+ tEdorNo+"&EdorType="+ tEdorType +"&MissionID="+ tMissionID +"&SubMissionID="+ tSubMissionID +"&ActivityID="+ tActivityID +"&OSysPlanCode="+ tSysPlanCode +"&OPlanCode="+ tPlanCode +"&ORiskCode="+ tRiskCode +"&ODutyCode="+ tDutyCode +"&ContPlanType="+ tContPlanType; submitForm(fm2,true); } /** * 校验提交的数据是否为选中的记录 */ function checkSame() { var tSelNo = PlanDetailInfoGrid.getSelNo()-1; if (tSelNo<0) { i18nAlert("请选择要操作的方案明细记录!", "LIS-02721"); return false; } var tSysPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 1); var tPlanCode = PlanDetailInfoGrid.getRowColData(tSelNo, 2); var tRiskCode = PlanDetailInfoGrid.getRowColData(tSelNo, 12); var tDutyCode = PlanDetailInfoGrid.getRowColData(tSelNo, 14); var tSysPlanCode1 = document.getElementById("SysPlanCode").value; var tPlanCode1 = document.getElementById("PlanCode").value; var tRiskCode1 = document.getElementById("RiskCode").value; var tDutyCode1 = document.getElementById("DutyCode").value; if (tSysPlanCode!=tSysPlanCode1 || tPlanCode!=tPlanCode1 || tRiskCode!=tRiskCode1 || tDutyCode!=tDutyCode1) { i18nAlert("进行该操作时,不可改变方案、险种及责任信息!", "LIS-02722"); return false; } return true; } /** * 提交数据 */ function submitForm(obj, dynamic) { var showStr = i18nMessage("正在处理数据,请您稍候并且不要修改屏幕上的值或链接其他页面!", "LIS-04535"); 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(); //obj.submit(); if(dynamic != null && dynamic === true){ ajaxSubmit(obj); } else { ajaxSubmit2(obj); } } /** * 提交数据后返回操作 */ 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(); dealAfterSubmit(content); } } /** * 处理责任显示 */ function dealShowDuty(cObj, cDivID) { document.getElementById(cDivID).innerHTML= "
"; document.getElementById("DutyCode").value = ""; document.getElementById("DutyName").value = ""; document.getElementById("idAmnt").style.display = "none"; document.getElementById("idPrem").style.display = "none"; document.getElementById("idFeeRate").style.display = "none"; document.getElementById("tryCalButton").style.display = "none"; document.getElementById("AmntType").value = ""; document.getElementById("AmntTypeName").value = ""; document.getElementById("FixedAmnt").value = ""; document.getElementById("MinAmnt").value = ""; document.getElementById("ExceptPremType").value = ""; document.getElementById("ExceptPremTypeName").value = ""; document.getElementById("ExceptPrem").value = ""; document.getElementById("InitPrem").value = ""; document.getElementById("ExceptYield").value = ""; document.getElementById("Remark").value = ""; document.getElementById("trRelation").style.display = "none"; document.getElementById("SetRelation").checked = false; document.getElementById("RelaShareFlag").value = "0"; document.getElementById("trRelationRate").style.display = "none"; document.getElementById("RelaToMain").value = ""; document.getElementById("RelaToMainName").value = ""; document.getElementById("MainAmntRate").value = ""; document.getElementById("RelaAmntRate").value = ""; document.getElementById("divDutyFactorRelation").style.display = "none"; document.getElementById("divDutyFactorRelation").innerHTML= "
"; } /** * 处理产品责任要素展示 * cRiskCode:险种;cDutyCode:责任;cFlag:标识(0-下拉后处理,1-点击记录);obj:对应的FM;cDivID:需要展示的域; */ function dealRiskDuty(cRiskCode, cDutyCode, cFlag, cObj, cDivID, cSysPlanCode, cPlanCode, cPlanType) { document.getElementById(cDivID).innerHTML = "
"; document.getElementById(cDivID+"Relation").innerHTML = "
"; document.getElementById("AmntType").value = ""; document.getElementById("AmntTypeName").value = ""; document.getElementById("FixedAmnt").value = ""; document.getElementById("SalaryMult").value = ""; document.getElementById("MaxAmnt").value = ""; document.getElementById("MinAmnt").value = ""; document.getElementById("ExceptPremType").value = ""; document.getElementById("ExceptPremTypeName").value = ""; document.getElementById("ExceptPrem").value = ""; document.getElementById("InitPrem").value = ""; document.getElementById("ExceptYield").value = ""; document.getElementById("trRelation").style.display = "none"; document.getElementById("SetRelation").checked = false; document.getElementById("RelaShareFlag").value = "0"; document.getElementById("trRelationRate").style.display = "none"; document.getElementById("RelaToMain").value = ""; document.getElementById("RelaToMainName").value = ""; document.getElementById("MainAmntRate").value = ""; document.getElementById("RelaAmntRate").value = ""; document.getElementById("divDutyFactorRelation").style.display = "none"; if (cFlag=="0") { document.getElementById("idFixedAmnt00").style.display = "none"; document.getElementById("idFixedAmnt01").style.display = "none"; document.getElementById("idSalaryMult00").style.display = "none"; document.getElementById("idSalaryMult01").style.display = "none"; document.getElementById("idMaxAmnt00").style.display = "none"; document.getElementById("idMaxAmnt01").style.display = "none"; document.getElementById("idMinAmnt00").style.display = "none"; document.getElementById("idMinAmnt01").style.display = "none"; document.getElementById("idAmnt00").style.display = ""; document.getElementById("idAmnt01").style.display = ""; document.getElementById("idAmnt02").style.display = ""; document.getElementById("idAmnt03").style.display = ""; } //1.根据产品类型进行展示域处理 if (tContPlanType=="01") {//建工险 document.getElementById("idAmnt").style.display = ""; document.getElementById("idPrem").style.display = ""; document.getElementById("idFeeRate").style.display = "none"; document.getElementById("tryCalButton").style.display = ""; document.getElementById("trRelation").style.display = "none"; } else if (tContPlanType=="02") {//账户型险种 document.getElementById("idAmnt").style.display = "none"; document.getElementById("idPrem").style.display = "none"; document.getElementById("idFeeRate").style.display = ""; document.getElementById("tryCalButton").style.display = "none" document.getElementById("trRelation").style.display = "none"; } else if (tContPlanType=="03") {//个人险种 document.getElementById("idAmnt").style.display = ""; document.getElementById("idPrem").style.display = ""; document.getElementById("idFeeRate").style.display = "none"; document.getElementById("tryCalButton").style.display = ""; document.getElementById("trRelation").style.display = "none"; } else {//其余都默认为一般险种 document.getElementById("idAmnt").style.display = ""; document.getElementById("idPrem").style.display = ""; document.getElementById("idFeeRate").style.display = "none"; document.getElementById("tryCalButton").style.display = ""; if (cPlanType=="00") { document.getElementById("trRelation").style.display = ""; } else { document.getElementById("trRelation").style.display = "none"; } } //2.查询出需展示的因子并展示在界面上 var tArr = getDutyElementArr(cRiskCode, cDutyCode); if (tArr==null || tArr.length==0) { } else { document.getElementById(cDivID).innerHTML = getDutyElement(tArr, "0"); if (document.getElementById("trRelation").style.display=="") { document.getElementById(cDivID+"Relation").innerHTML = getDutyElement(tArr, "1"); } } if (cFlag=="0") { return; } // 先进行固定域的赋值以便处理附属被保险人方案 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorNCSql"); tSQLInfo.setSqlId("EdorNCSql7"); tSQLInfo.addSubPara(tPolicyNo); tSQLInfo.addSubPara(cSysPlanCode); tSQLInfo.addSubPara(cPlanCode); tSQLInfo.addSubPara(cRiskCode); tSQLInfo.addSubPara(cDutyCode); tSQLInfo.addSubPara(tEdorNo); tSQLInfo.addSubPara(tEdorType); // var tArr2 = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr2==null) { i18nAlert("获取所选记录信息失败!", "LIS-02723"); return false; } else {//赋值 var tFixedPlanInfo = new Array(); var i = 0; tFixedPlanInfo[i++] = "AmntType"; tFixedPlanInfo[i++] = "AmntTypeName"; tFixedPlanInfo[i++] = "FixedAmnt"; tFixedPlanInfo[i++] = "SalaryMult"; tFixedPlanInfo[i++] = "MaxAmnt"; tFixedPlanInfo[i++] = "MinAmnt"; tFixedPlanInfo[i++] = "ExceptPremType"; tFixedPlanInfo[i++] = "ExceptPremTypeName"; tFixedPlanInfo[i++] = "ExceptPrem"; tFixedPlanInfo[i++] = "InitPrem"; tFixedPlanInfo[i++] = "ExceptYield"; tFixedPlanInfo[i++] = "RelaShareFlag"; tFixedPlanInfo[i++] = "Remark"; for(var t=0; tNumber(tMaxAmnt)) { i18nAlert("最低保额不应大于最高保额!", "LIS-02868"); return false; } } var tExceptPremType = cObj.ExceptPremType.value; if (tExceptPremType==null || tExceptPremType=="") { i18nAlert("期望保费类型不能为空!", "LIS-02869"); return false; } if (fmPub.Operate.value!="TRYCAL") { var tExceptPrem = cObj.ExceptPrem.value; if (tExceptPrem==null || tExceptPrem=="") { i18nAlert("期望保费/期望费率/费率折扣不能为空!", "LIS-02870"); return false; } if (tExceptPremType=="01") {//保费,12,2 if (!checkDecimalFormat(tExceptPrem, 12, 2)) { i18nAlert("当期望保费类型为期望保费时,期望保费/期望费率/费率折扣整数位不应超过12位,小数位不应超过2位!", "LIS-02871"); return false; } } else if (tExceptPremType=="02") {//费率 if (!checkDecimalFormat(tExceptPrem, 4, 8)) { i18nAlert("当期望保费类型为期望费率时,期望保费/期望费率/费率折扣整数位不应超过4位,小数位不应超过6位!", "LIS-02872"); return false; } } else if (tExceptPremType=="03") {//折扣 if (!checkDecimalFormat(tExceptPrem, 2, 2)) { i18nAlert("当期望保费类型为费率折扣时,期望保费/期望费率/费率折扣整数位不应超过2位,小数位不应超过2位!", "LIS-02873"); return false; } } } } var tRiskCode = cObj.RiskCode.value; var tDutyCode = cObj.DutyCode.value; var tArr = getDutyElementArr(tRiskCode, tDutyCode); if (!checkDutyElement(cObj, tArr, "0")) { return false; } if (cContPlanType=="00" && fm2.RelaShareFlag.value=="1") { var tMainAmntRate = fm2.MainAmntRate.value; var tRelaAmntRate = fm2.RelaAmntRate.value; if (tMainAmntRate==null || tMainAmntRate=="") { i18nAlert("主被保险人保额占比不能为空!", "LIS-02874"); return false; } else { if (!checkDecimalFormat(tMainAmntRate, 1, 2)) { i18nAlert("主被保险人保额占比整数位不应超过1位,小数位不应超过2位!", "LIS-02875"); return false; } } if (tRelaAmntRate==null || tRelaAmntRate=="") { i18nAlert("附属被保人保额占比不能为空!", "LIS-02876"); return false; } else { if (!checkDecimalFormat(tRelaAmntRate, 1, 2)) { i18nAlert("附属被保人保额占比整数位不应超过1位,小数位不应超过2位!", "LIS-02877"); return false; } } if (!checkDutyElement(cObj, tArr, "1")) { return false; } } return true; } /** * 查询公共保额方案信息 */ function queryPubAmntRelaPlanInfo(){ tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorNCSql"); tSQLInfo.setSqlId("EdorNCSql10"); tSQLInfo.addSubPara(tPolicyNo); tSQLInfo.addSubPara(tEdorNo); tSQLInfo.addSubPara(tEdorType); initPubAmntRelaPlanGrid(); turnPage2.queryModal(tSQLInfo.getString(), PubAmntRelaPlanGrid, 1, 1);//第三位表示使用大数据量 } /** * 查询公共保额险种责任信息 */ function showRelaDuty(){ var tRow = PubAmntRelaPlanGrid.getSelNo(); var tSysPlanCode = PubAmntRelaPlanGrid.getRowColData(tRow-1,1); var tPlanCode = PubAmntRelaPlanGrid.getRowColData(tRow-1,2); tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_pa"); tSQLInfo.setResourceName("g_pos.EdorNCSql"); tSQLInfo.setSqlId("EdorNCSql11"); tSQLInfo.addSubPara(tPolicyNo); tSQLInfo.addSubPara(tSysPlanCode); tSQLInfo.addSubPara(tPlanCode); tSQLInfo.addSubPara(tEdorNo); tSQLInfo.addSubPara(tEdorType); initPubAmntRelaDutyGrid(); // noDiv(turnPage3, PubAmntRelaDutyGrid, tSQLInfo.getString()); var arrResult = turnPage3.arrDataCacheSet;//将MulLine的值转化为二维数组 for(var i=0;iNumber(tFixedAmnt)) { i18nAlert("个人限额不能大于公共保额!", "LIS-02884"); return false; } } //校验责任限额 for(var i=0;i < PubAmntRelaDutyGrid.mulLineCount;i++){ var tPubFlag = PubAmntRelaDutyGrid.getRowColData(i,5);//公共保额使用标志 var tDutyLimitAmnt = PubAmntRelaDutyGrid.getRowColData(i,7);//责任限额 if (tPubFlag==null || tPubFlag=="") { i18nAlert("第[{0}]行是否使用公共保额标志格式无效!", "LIS-02885", (i+1)); return false; } if (tPubFlag == "1") { if(tDutyLimitAmnt == null || tDutyLimitAmnt.trim() == "") {//未录入责任限额 i18nAlert("第[{0}]行责任限额不能为空!", "LIS-18107", (i+1)); return false; } else {//录入了责任限额 if (!isNumeric(tDutyLimitAmnt)) { i18nAlert("第[{0}]行责任限额不是有效的数字!", "LIS-02886", (i+1)); return false; } if (Number(tDutyLimitAmnt)<=0) { i18nAlert("第[{0}]行责任限额应大于0!", "LIS-02887", (i+1)); return false; } var tLimitAmntNew = PubAmntRelaPlanGrid.getRowColData(tPubAmntRow-1,5);//个人限额 if (tLimitAmntNew != null && tLimitAmntNew != "") { if (Number(tDutyLimitAmnt)>Number(tLimitAmntNew)) { i18nAlert("第[{0}]行责任限额不能大于个人限额!", "LIS-02888", (i+1)); return false; } } else { if (Number(tDutyLimitAmnt)>Number(tFixedAmnt)) { i18nAlert("第[{0}]行责任限额不能大于公共保额!", "LIS-02999", (i+1)); return false; } } } } } return true; } /** * 责任限额是否只读设置 */ function dealDutyLimitAmnt(cMark,cRow,cPubFlag) { var rowNumber; var tPubFlag; if (cMark == "Page") { rowNumber = PubAmntRelaDutyGrid.lastFocusRowNo; tPubFlag = PubAmntRelaDutyGrid.getRowColData(rowNumber, 5); } else if (cMark == "Query") { rowNumber = cRow; tPubFlag = cPubFlag; } if (tPubFlag == "1") { document.getElementById("spanPubAmntRelaDutyGrid"+rowNumber).all('PubAmntRelaDutyGrid7').readOnly = false; } else { document.getElementById("spanPubAmntRelaDutyGrid"+rowNumber).all('PubAmntRelaDutyGrid7').readOnly = true; PubAmntRelaDutyGrid.setRowColData(rowNumber,7,""); } } function dealRedundantRelaElement(cObj, tArr) { var tRelaFactor = "Relation"; if (tArr==null) { //未查询出数据,表示无动态因子 } else { for (var i=0; i1) { divInfoButton4.style.display = ""; } else { divInfoButton4.style.display = "none"; } } /** * 投资账户信息--保存 */ function saveAccClick(){ var tRow = TZFeeGrid.mulLineCount; for(var index=0;index1){ i18nAlert("个人投资分配比例应为大于等于0且小于等于1的数字!", "LIS-03003"); return false; } if(!beforeSub()){ return false; } } var num = PayFeeGrid.getSelNo(); var tSysPlanCode = PlanDetailInfoGrid.getRowColData(PlanDetailInfoGrid.getSelNo()-1,1);//系统方案编码 var tPlanCode = PlanDetailInfoGrid.getRowColData(PlanDetailInfoGrid.getSelNo()-1,2);//方案编码 var tRiskCode = PlanDetailInfoGrid.getRowColData(PlanDetailInfoGrid.getSelNo()-1,12);//险种编码 var tDutyCode = PayFeeGrid.getRowColData(num-1,1); var tPayPlanCode = PayFeeGrid.getRowColData(num-1,3); fmPub.Operate.value = "SAVEACC"; fm2.action = "../API/grp_pa/g_pos/EdorNCDetailSave/ADD?Operate=SAVEACC&GrpPropNo="+ tPolicyNo +"&SysPlanCode="+ tSysPlanCode +"&PlanCode="+ tPlanCode+"&RiskCode="+ tRiskCode+"&DutyCode="+tDutyCode+"&PayPlanCode="+tPayPlanCode; submitForm(fm2,true); } //校验缴费金额需等于初始保费 function beforeSub(){ var tInitPrem = fm2.InitPrem.value; var rowNum = PayFeeGrid.mulLineCount; var index=0; for(var i=0;i < rowNum;i++){ var k = new Number(PayFeeGrid.getRowColData(i,5)); index=index+k; } if(!(index==tInitPrem)){ i18nAlert("缴费金额之和应等于初始保费!", "LIS-03004"); return false; } return true; } //校验个人投资金额之和等于缴费金额 function beforeSubmiUl(){ var rowNum = PayFeeGrid.getSelNo(); var index = PayFeeGrid.getRowColData(rowNum-1,5); var tRowNum = TZFeeGrid.mulLineCount; var index1=0; for(var i=0;i < tRowNum;i++){ var k = new Number(TZFeeGrid.getRowColData(i,5)); index1=index1+k; } if(!(index==index1)){ i18nAlert("个人投资金额之和应等于缴费金额!", "LIS-03005"); return false; } var index2=0; for(var i=0;i < tRowNum;i++){ var k = new Number(TZFeeGrid.getRowColData(i,6)); index2=index2+k; } if(!(index2==1)){ i18nAlert("个人投资分配比例之和应等于1!", "LIS-03006"); return false; } return true; } /** * 试算 */ function tryCal() { fmPub.Operate.value = "TRYCAL"; var tExceptPremType = fm2.ExceptPremType.value; if (tExceptPremType==null || tExceptPremType=="") { i18nAlert("请先选择期望保费类型!", "LIS-03007"); return false; } if (tExceptPremType=="03") { i18nAlert("期望保费类型为费率折扣时,无参考值!", "LIS-03008"); return false; } //调用增加方案处理方式 dealRedundant(fm2, tContPlanType); if (!verifyForm('fm2')) { return false; } if (!beforeSubmit(fm2, tContPlanType)) { return false; } fm2.action = "../API/grp_pa/g_pos/EdorTryCalSave/ADD?Operate=TRYCAL&PolicyNo="+ tPolicyNo +"&MissionID="+ tMissionID +"&SubMissionID="+ tSubMissionID +"&ActivityID="+ tActivityID +"&ContPlanType="+ tContPlanType+"&EdorNo="+ tEdorNo+"&EdorType="+ tEdorType; submitForm(fm2,true); } function afterSubmitTryCal(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"); } else { dealAfterSubmit(content); } } /** * 提交后处理 */ function dealAfterSubmit(o) { var tOperate = fmPub.Operate.value; fmPub.Operate.value = ""; if (tOperate=="ADDPLANDETAIL" || tOperate=="MODIFYPLANDETAIL" || tOperate=="DELPLANDETAIL") { fm2.PlanType.value = ""; fm2.OldPlanType.value = ""; fm2.PremCalType.value = ""; fm2.OldPremCalType.value = ""; fm2.PlanFlag.value = ""; fm2.OccupTypeFlag.value = ""; fm2.OldOccupTypeFlag.value = ""; fm2.PlanCode.value = ""; fm2.PlanDesc.value = ""; fm2.SysPlanCode.value = ""; fm2.RiskCode.value = ""; fm2.RiskName.value = ""; fm2.DutyCode.value = ""; fm2.DutyName.value = ""; dealShowDuty(fm2, "divDutyFactor"); queryPlanDetail(); document.getElementById("divInfo4").style.display = "none"; document.getElementById("divInfo5").style.display = "none"; document.getElementById("divInfo6").style.display = "none"; document.getElementById("divInfo8").style.display = "none"; initPubAmntRelaDutyGrid(); initPubAmntRelaPlanGrid(); initPayFeeGrid(); initTZFeeGrid(); } else if (tOperate=="SAVEPUBAMNT" || tOperate=="DELETEPUBAMNT"){ queryPubAmntRelaPlanInfo(); initPubAmntRelaDutyGrid(); } else if (tOperate=="TRYCAL") { fm2.ExceptPrem.value = o; } else if(tOperate=="SAVEFEE" ){ showTZInfo(); } else if(tOperate=="SAVEACC"){ showTZInfo(); } }