/*************************************************************** *
ProName:LDUnderwritingInput.js
*Title:核保权限配置js
*Description:核保权限配置js
*Copyright:Copyright (c) 2024
*Company:Sinosoft
* @author : 揣龙 * @version : 8.0 * @date : 2024-10-25 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass(); var tSQLInfo = new SqlClass(); /** * 查询 */ function queryCustomer() { if (document.getElementById("PopedomType1").value == '' || document.getElementById("PopedomType1").value == null) { alert("请选择核保类型"); return false; } if (fm.PopedomType1.value == 4) { // document.getElementById("SetUnder").style.display = ''; // document.getElementById("Under").style.display = 'none'; // document.getElementById("tr001").style.display = 'none'; // document.getElementById("tr002").style.display = 'none'; // document.getElementById("SX").innerText = '个人寿险理赔金额'; // document.getElementById("YWX").innerText = '个人意外险理赔金额'; // document.getElementById("ZJX").innerText = '个人重疾理赔金额'; // document.getElementById("YLX").innerText = '个人医疗险理赔金额'; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_auxi.LDUWPopedomSql"); tSQLInfo.setModule("grp_authority"); tSQLInfo.setSqlId("LDUWPopedomSql1"); tSQLInfo.addSubPara(fm.PopedomLevel1.value); tSQLInfo.addSubPara(fm.PopedomType1.value); turnPage1.queryModal(tSQLInfo.getString(), SetUnderGrid, 0, 1); if (!turnPage1.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } else { // document.getElementById("SetUnder").style.display = 'none'; // document.getElementById("Under").style.display = ''; // document.getElementById("tr001").style.display = ''; // document.getElementById("tr002").style.display = ''; // document.getElementById("SX").innerText = '个人寿险保额'; // document.getElementById("YWX").innerText = '个人意外险保额'; // document.getElementById("ZJX").innerText = '个人重疾保额'; // document.getElementById("YLX").innerText = '个人医疗险保额'; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_auxi.LDUWPopedomSql"); tSQLInfo.setModule("grp_authority"); tSQLInfo.setSqlId("LDUWPopedomSql1"); tSQLInfo.addSubPara(fm.PopedomLevel1.value); tSQLInfo.addSubPara(fm.PopedomType1.value); turnPage.queryModal(tSQLInfo.getString(), UnderGrid, 0, 1); if (!turnPage.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } } /** * 展示用户信息 */ function showUWPopedomInfo() { var tRow = UnderGrid.getSelNo(); fm.PopedomLevel.value = UnderGrid.getRowColData(tRow - 1, 1); fm.PopedomTypeName.value = UnderGrid.getRowColData(tRow - 1, 2); fm.PopedomType.value = UnderGrid.getRowColData(tRow - 1, 3); fm.PopedomName.value = UnderGrid.getRowColData(tRow - 1, 4); fm.PerLifeAmnt.value = UnderGrid.getRowColData(tRow - 1, 5); fm.PerAcciAmnt.value = UnderGrid.getRowColData(tRow - 1, 6); fm.PerIllAmnt.value = UnderGrid.getRowColData(tRow - 1, 7); fm.PerMedAmnt.value = UnderGrid.getRowColData(tRow - 1, 8); fm.PremScale.value = UnderGrid.getRowColData(tRow - 1, 9); fm.MedPremRateFloat.value = UnderGrid.getRowColData(tRow - 1, 10); fm.DirectCostRate.value = UnderGrid.getRowColData(tRow - 1, 11); fm.ValDate.value = UnderGrid.getRowColData(tRow - 1, 12); fm.EndDate.value = UnderGrid.getRowColData(tRow - 1, 13) fm.MainPremRateFloat.value = UnderGrid.getRowColData(tRow - 1, 14); } /** * 展示用户信息 */ function showSetUWPopedomInfo() { var tRow = SetUnderGrid.getSelNo(); fm.PopedomLevel.value = SetUnderGrid.getRowColData(tRow - 1, 1); fm.PopedomTypeName.value = SetUnderGrid.getRowColData(tRow - 1, 2); fm.PopedomType.value = SetUnderGrid.getRowColData(tRow - 1, 3); fm.PopedomName.value = SetUnderGrid.getRowColData(tRow - 1, 4); fm.PerLifeAmnt.value = SetUnderGrid.getRowColData(tRow - 1, 5); fm.PerAcciAmnt.value = SetUnderGrid.getRowColData(tRow - 1, 6); fm.PerIllAmnt.value = SetUnderGrid.getRowColData(tRow - 1, 7); fm.PerMedAmnt.value = SetUnderGrid.getRowColData(tRow - 1, 8); fm.ValDate.value = SetUnderGrid.getRowColData(tRow - 1, 12); fm.EndDate.value = SetUnderGrid.getRowColData(tRow - 1, 13) } /** * 增加 */ function addSubmit() { if (!verifyInput2()) { return false; } mOperate = "INSERT"; if (!checkSubmit()) { return false; } //fm.action = "./LDUWPopedomSave.jsp?Operate="+ mOperate; fm.action = "../API/grp_authority/g_auxi/LDUWPopedomSave/ADD?Operate=" + mOperate; submitForm(fm); queryCustomer(); } /** * 修改 */ function modSubmit() { mOperate = "UPDATE"; if (!checkSubmit()) { return false; } if (fm.PopedomType1.value == 4) { var tRow = SetUnderGrid.getSelNo(); if (tRow == 0) { i18nAlert("请先选择一条信息!", "LIS-03483"); return false; } if (!checkSubmit()) { return false; } //fm.action = "./LDUWPopedomSave.jsp?Operate="+ mOperate; fm.action = "../API/grp_authority/g_auxi/LDUWPopedomSave/UPDATE?Operate=" + mOperate; submitForm(fm); queryCustomer(); } else { var tRow = UnderGrid.getSelNo(); if (tRow == 0) { i18nAlert("请先选择一条信息!", "LIS-03483"); return false; } if (!checkSubmit()) { return false; } //fm.action = "./LDUWPopedomSave.jsp?Operate="+ mOperate; fm.action = "../API/grp_authority/g_auxi/LDUWPopedomSave/UPDATE?Operate=" + mOperate; submitForm(fm); queryCustomer(); } } /** * 删除 */ function delSubmit() { if (fm.PopedomType1.value == 4) { var tRow = SetUnderGrid.getSelNo(); if (tRow == 0) { i18nAlert("请先选择一条信息!", "LIS-03483"); return false; } } else { var tRow = UnderGrid.getSelNo(); if (tRow == 0) { i18nAlert("请先选择一条信息!", "LIS-03483"); return false; } } if (!i18nConfirm("确定要删除选中信息吗?", "LIS-00693")) { return false; } // fm.PopedomLevel.value = UnderGrid.getRowColData(tRow-1,1); mOperate = "DELETE"; //fm.action = "./LDUWPopedomSave.jsp?Operate="+ mOperate; fm.action = "../API/grp_authority/g_auxi/LDUWPopedomSave/DELETE?Operate=" + mOperate; submitForm(fm); queryCustomer(); } function queryUpCustomer(customerno) { tPreSQLInfo = new SqlClass(); tPreSQLInfo.setResourceName("g_quot.LSQuotQueryCustomerSql"); tPreSQLInfo.setSqlId("LSQuotQueryCustomer4"); tPreSQLInfo.addSubPara(customerno); tPreSQLInfo.setModule("grp_quotation"); var tmBasicArr = easyExecSql(tPreSQLInfo.getString(), 1, 0, 1); var mprecustomerno = null; if (tmBasicArr == null) { return ""; } else { if (tmBasicArr[0][0] == null || tmBasicArr[0][0] == "") { return ""; } else { mprecustomerno = tmBasicArr[0][0]; } } return mprecustomerno + "," + queryUpCustomer(mprecustomerno); } /*** * 返回准客户名 */ function returnCustomer() { fm.Underlevel1.readOnly = true; fm.ManageComNo1.readOnly = true; var tSelNo = UnderGrid.getSelNo() - 1; // if (tSelNo<0) { // i18nAlert("请选中一条准客户信息记录!", "LIS-04274"); // return false; // } fm.Underlevel1.value = UnderGrid.getRowColData(tSelNo, 1); fm.ManageComNo1.value = UnderGrid.getRowColData(tSelNo, 2); } function selectEstimates() { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LDSafetySupervisionConfigSql"); tSQLInfo.setSqlId("LDSafetySupervisionConfigSql1"); tSQLInfo.setModule("grp_quotation"); initTaxCostEstimatesid(); turnPage.queryModal(tSQLInfo.getString(), TaxCostEstimatesid, 0, 1); if (!turnPage.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } function basicSubmit(Operate) { if (Operate == 'DELETE') { i18nAlert("这是删除!", ""); } if (Operate == 'INSERT') { i18nAlert("这是新增!", ""); } if (Operate == 'UPDATE') { i18nAlert("这是修改!", ""); } // if (!basicCheck) { // return false; // } // fm.action = "../API/grp_quotation/g_quot/LDManaComNoConfig/UPDATE?Operate=SAVEBASIC"; // submitForm(fm,true); // queryCustomer(); } /** * 提交前校验 */ function checkSubmit() { if (fm.PopedomType1.value == 4) { if (!basicCheck()) { return false; } } else { if (!basicCheck2()) { return false; } } // if (fm.ValDate.value > fm.EndDate.value) { // i18nAlert("生效日期应小于终止日期!", "LIS-05951"); // return false; // } if (mOperate == "INSERT") { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_auxi.LDUWPopedomSql"); tSQLInfo.setModule("grp_authority"); tSQLInfo.setSqlId("LDUWPopedomSql2"); tSQLInfo.addSubPara(fm.PopedomLevel.value); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr[0][0] != 0) { i18nAlert("该核保权限已存在!", "LIS-05952"); return false; } } if (mOperate == "UPDATE") { if (fm.PopedomType1.value == 4) { var tRow = SetUnderGrid.getSelNo(); var tPopedomLevel = SetUnderGrid.getRowColData(tRow - 1, 1); if (fm.PopedomLevel.value != tPopedomLevel) { i18nAlert("权限级别不可修改!", "LIS-05953"); return false; } } else { var tRow = UnderGrid.getSelNo(); var tPopedomLevel = UnderGrid.getRowColData(tRow - 1, 1); if (fm.PopedomLevel.value != tPopedomLevel) { i18nAlert("权限级别不可修改!", "LIS-05953"); return false; } } } return true; } function basicCheck() { if (isEmpty(fm.PopedomLevel)) { i18nAlert("核保级别不能为空!", ""); return false; } if (isEmpty(fm.PopedomName)) { i18nAlert("核保名称不能为空!", ""); return false; } if (isEmpty(fm.PopedomType)) { i18nAlert("核保类别不能为空!", ""); return false; } // if (isEmpty(fm.PerLifeAmnt)) { // i18nAlert("个人寿险保额不能为空!", ""); // return false; // } // if (isEmpty(fm.PerAcciAmnt)) { // i18nAlert("个人意外险保额不能为空!", ""); // return false; // } // if (isEmpty(fm.PerIllAmnt)) { // i18nAlert("个人重疾保额不能为空!", ""); // return false; // } if (isEmpty(fm.PerMedAmnt)) { i18nAlert("个人理赔金额不能为空!", ""); return false; } // if (isEmpty(fm.ValDate)) { // i18nAlert("生效日期不能为空!", ""); // return false; // } // if (isEmpty(fm.EndDate)) { // i18nAlert("终止日期不能为空!", ""); // return false; // } // if (!isDoubles(fm.PerLifeAmnt.value,2)) { // alert("个人寿险保额只能输入数字"); // return false; // } // if (!isDoubles(fm.PerAcciAmnt.value,2)) { // alert("个人意外险保额只能输入数字"); // return false; // } // if (!isDoubles(fm.PerIllAmnt.value,2)) { // alert("个人重疾保额只能输入数字"); // return false; // } if (!isDoubles(fm.PerMedAmnt.value,2)) { alert("个人理赔金额只能输入数字"); return false; } return true; } function basicCheck2() { if (isEmpty(fm.PopedomLevel)) { i18nAlert("核保级别不能为空!", ""); return false; } if (isEmpty(fm.PopedomName)) { i18nAlert("核保名称不能为空!", ""); return false; } if (isEmpty(fm.PopedomType)) { i18nAlert("核保类别不能为空!", ""); return false; } if (isEmpty(fm.PerLifeAmnt)) { i18nAlert("个人寿险保额不能为空!", ""); return false; } if (isEmpty(fm.PerAcciAmnt)) { i18nAlert("个人意外险保额不能为空!", ""); return false; } if (isEmpty(fm.PerIllAmnt)) { i18nAlert("个人重疾保额不能为空!", ""); return false; } if (isEmpty(fm.PerMedAmnt)) { i18nAlert("个人医疗险保额不能为空!", ""); return false; } // if (isEmpty(fm.ValDate)) { // i18nAlert("生效日期不能为空!", ""); // return false; // } // if (isEmpty(fm.EndDate)) { // i18nAlert("终止日期不能为空!", ""); // return false; // } if (isEmpty(fm.MedPremRateFloat)) { i18nAlert("医疗险费率浮动不能为空!", ""); return false; } if (isEmpty(fm.PremScale)) { i18nAlert("保费规模不能为空!", ""); return false; } if (isEmpty(fm.MainPremRateFloat)) { i18nAlert("主险费率浮动不能为空!", ""); return false; } if (isEmpty(fm.DirectCostRate)) { i18nAlert("直接成本率不能为空!", ""); return false; } if (!isDoubles(fm.PerLifeAmnt.value,2)) { alert("个人寿险保额只能输入两位小数的数字"); return false; } if (!isDoubles(fm.PerAcciAmnt.value,2)) { alert("个人意外险保额只能输入两位小数的数字"); return false; } if (!isDoubles(fm.PerIllAmnt.value,2)) { alert("个人重疾保额只能输入两位小数的数字"); return false; } if (!isDoubles(fm.PerMedAmnt.value,2)) { alert("个人医疗险保额只能输入两位小数的数字"); return false; } if (!isDoubles(fm.PremScale.value,2)) { alert("保费规模只能输入两位小数的数字"); return false; } if (!isDoubles(fm.MedPremRateFloat.value,2)) { alert("医疗险费率浮动只能输入两位小数的数字"); return false; } if (!isDoubles(fm.MainPremRateFloat.value,2)) { alert("主险费率浮动只能输入两位小数的数字"); return false; } if (!isDoubles(fm.DirectCostRate.value,2)) { alert("直接成本率只能输入两位小数的数字"); 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"); //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; //获得窗口的水平位置 var 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, cQuotNo, cQuotBatNo) { 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; //获得窗口的水平位置 var 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; //获得窗口的水平位置 var 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(); } } /** * 下拉后处理 */ function afterCodeSelect(CodeName, Field){ if(CodeName=='undertype'){ if ((fm.PopedomType1.value == 4 && Field.name == "PopedomType1") || (fm.PopedomType.value == 4 && Field.name == "PopedomType")) { document.getElementById("SetUnder").style.display = ''; document.getElementById("Under").style.display = 'none'; document.getElementById("tr001").style.display = 'none'; document.getElementById("tr002").style.display = 'none'; document.getElementById("tr003").style.display = 'none'; document.getElementById("PerLifeAmnt").value = ""; document.getElementById("PerAcciAmnt").value = ""; document.getElementById("PerIllAmnt").value = ""; document.getElementById("YLX").innerText = '个人理赔金额'; if(Field.name == "PopedomType1"){ document.getElementById("PopedomType").value = document.getElementById("PopedomType1").value; document.getElementById("PopedomTypeName").value = document.getElementById("UnderTypeName").value; } document.getElementById("PopedomLevel").value = ""; document.getElementById("PopedomName").value = ""; document.getElementById("PerLifeAmnt").value = ""; document.getElementById("PerAcciAmnt").value = ""; document.getElementById("PerIllAmnt").value = ""; document.getElementById("PerMedAmnt").value = ""; document.getElementById("ValDate").value = ""; document.getElementById("EndDate").value = ""; document.getElementById("MedPremRateFloat").value = ""; document.getElementById("PremScale").value = ""; document.getElementById("MainPremRateFloat").value = ""; document.getElementById("DirectCostRate").value = ""; } else { document.getElementById("SetUnder").style.display = 'none'; document.getElementById("Under").style.display = ''; document.getElementById("tr001").style.display = ''; document.getElementById("tr002").style.display = ''; document.getElementById("tr003").style.display = ''; document.getElementById("SX").innerText = '个人寿险保额'; document.getElementById("YWX").innerText = '个人意外险保额'; document.getElementById("ZJX").innerText = '个人重疾保额'; document.getElementById("YLX").innerText = '个人医疗险保额'; if(Field.name == "PopedomType1"){ document.getElementById("PopedomType").value = document.getElementById("PopedomType1").value; document.getElementById("PopedomTypeName").value = document.getElementById("UnderTypeName").value; } document.getElementById("PopedomLevel").value = ""; document.getElementById("PopedomName").value = ""; document.getElementById("PerLifeAmnt").value = ""; document.getElementById("PerAcciAmnt").value = ""; document.getElementById("PerIllAmnt").value = ""; document.getElementById("PerMedAmnt").value = ""; document.getElementById("ValDate").value = ""; document.getElementById("EndDate").value = ""; document.getElementById("MedPremRateFloat").value = ""; document.getElementById("PremScale").value = ""; document.getElementById("MainPremRateFloat").value = ""; document.getElementById("DirectCostRate").value = ""; } } }