/*************************************************************** *
ProName:LSQuotETBasicInput.js
*Title:一般询价基本信息录入
*Description:一般询价基本信息录入
*Copyright:Copyright (c) 2012
*Company:Sinosoft
* @author : 宋慎哲 * @version : 8.0 * @date : 2014-03-14 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass();//中介机构 initAgencyListGrid var turnPage2 = new turnPageClass();//其他准客户关联 initRelaCustListGrid var turnPage3 = new turnPageClass(); var turnPage4 = new turnPageClass(); var turnPage5 = new turnPageClass(); var turnPage6 = new turnPageClass(); var turnPage7 = new turnPageClass(); var turnPage8 = new turnPageClass(); var turnPage9 = new turnPageClass(); var mPreCustomerFlag = false;//准客户名称关联信息查询方式 /** * 初始化询价第一步信息 */ function initQuotStep1() { fm2.QuotNo.value = tQuotNo; fm2.QuotBatNo.value = tQuotBatNo; //初始化基础信息 initBasicInfo(); } /** * 初始化基础信息 */ function initBasicInfo() { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql5"); tSQLInfo.addSubPara(tQuotNo); tSQLInfo.addSubPara(tQuotBatNo); tSQLInfo.setModule("grp_quotation"); var tBasicArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tBasicArr == null) { return false; } else { fm2.QuotNo.value=tBasicArr[0][0]; //fm2.QuotBatNo.value=tBasicArr[0][1]; fm2.GrpName.value=tBasicArr[0][1]; fm2.GrpNature.value=tBasicArr[0][2]; fm2.GrpNatureName.value=tBasicArr[0][3]; fm2.IDType.value=tBasicArr[0][4]; fm2.IDTypeName.value=tBasicArr[0][5]; // if(tBasicArr[0][4] !=null && tBasicArr[0][4] != ""){ // fm2.IDType.value=tBasicArr[0][4]; // fm2.IDTypeName.value=tBasicArr[0][5]; // }else{ // fm2.IDType.value="6"; // fm2.IDTypeName.value="统一社会信用代码"; // } fm2.IDNo.value=tBasicArr[0][6]; fm2.BusiCategory.value=tBasicArr[0][7]; fm2.BusiCategoryName.value=tBasicArr[0][8]; fm2.Address.value=tBasicArr[0][9]; fm2.SaleChnl.value=tBasicArr[0][10]; fm2.SaleChnlName.value=tBasicArr[0][11]; fm2.AgentCom.value=tBasicArr[0][12]; fm2.AgentComName.value=tBasicArr[0][13]; fm2.AgentCode.value=tBasicArr[0][14]; fm2.AgentCodeName.value=tBasicArr[0][15]; fm2.OperSource.value=tBasicArr[0][16]; fm2.OperSourceName.value=tBasicArr[0][17]; fm2.ForceChkNum.value=tBasicArr[0][18]; fm2.ForceChkNumName.value=tBasicArr[0][19]; fm2.ProdType.value=tBasicArr[0][20]; fm2.ProdTypeName.value=tBasicArr[0][21]; fm2.ForceChkProfessRate.value=tBasicArr[0][22]; fm2.ForceChkProfessRateName.value=tBasicArr[0][23]; fm2.PrePrem.value=tBasicArr[0][24]; fm2.IsFreeRisk.value=tBasicArr[0][25]; fm2.IsFreeRiskName.value=tBasicArr[0][26]; fm2.IsAllowSubQuot.value=tBasicArr[0][27]; fm2.IsAllowSubQuotName.value=tBasicArr[0][28]; // fm2.PayIntv.value=tBasicArr[0][29]; // fm2.PayIntvName.value=tBasicArr[0][30]; fm2.PayIntv.value = '0'; fm2.PayIntvName.value = '趸交'; fm2.IsCoinsurance.value=tBasicArr[0][31]; fm2.IsCoinsuranceName.value=tBasicArr[0][32]; fm2.IsSubQuot.value=tBasicArr[0][33]; if(fm2.IsSubQuot.value == '1'){ document.getElementById("MainQuotNodiv").style.display=''; document.getElementById("SuperiorQuotNoButton").style.display=''; document.getElementById("MainQuotNo1").style.display=''; document.getElementById("MainQuotNo").style.display=''; fm2.IsSubQuotName.value=tBasicArr[0][34]; } fm2.BlanketFlag.value=tBasicArr[0][35]; fm2.BlanketFlagName.value=tBasicArr[0][36]; fm2.IsContinueInsure.value=tBasicArr[0][37]; if(fm2.IsContinueInsure.value =='1'){ document.getElementById("GrpContNo1").style.display=''; document.getElementById("GrpContNo2").style.display=''; fm2.GrpContNo.value=tBasicArr[0][39]; } fm2.IsContinueInsureName.value=tBasicArr[0][38]; fm2.MainQuotNo.value=tBasicArr[0][40]; fm2.CustomerIntro.value=tBasicArr[0][41]; fm2.IsWait.value=tBasicArr[0][42]; if (tBasicArr[0][42]=='1'){ fm2.IsWaitName.value='有等待期'; }else if (tBasicArr[0][42]=='0'){ fm2.IsWaitName.value='无等待期'; } } } /** * 询价导入 */ function impQuotSubmit() { if (tQuotNo == null || tQuotNo == "") { i18nAlert("获取询价号失败!", "LIS-04277"); return false; } if (tQuotBatNo == null || tQuotBatNo == "") { i18nAlert("获取批次号失败!", "LIS-04278"); return false; } if (tQuotType == null || tQuotType == "") { i18nAlert("获取询价类型失败!", "LIS-04279"); return false; } var filePath = fmupload.UploadPath.value; if(filePath == null || filePath == ""){ i18nAlert("请选择导入文件路径!", "LIS-03339"); return false; } var indexFirst = filePath.lastIndexOf("\\"); var indexLast = filePath.lastIndexOf(".xlsx"); if(indexFirst < 0 || indexLast < 0 || indexLast <= indexFirst) { i18nAlert("文件路径不合法或选择的文件格式不正确,请重新选择!", "LIS-03340"); return false; } var i = 0; var showStr = i18nMessage("正在导入,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04817"); 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(); fmPub.Operate.value = "UPLOAD"; fmupload.action="../API/grp_quotation/g_quot/LQuotPlanImpSave/UPLOAD1?Operate=UPLOAD&QuotType="+tQuotType+"&QuotNo="+tQuotNo+"&QuotBatNo="+tQuotBatNo+"&MissionID="+tMissionID+"&SubMissionID="+tSubMissionID+"&ActivityID="+tActivityID; ajaxSubmit2(document.getElementById("fmupload"), afterSubmit, true); } /** * 根据询价类型,产品类型选择下载模版 */ function downTemplateQuotExcel() { if (fmupload.TemplateType.value=="00" ) { document.all('downloadXLSX').href="../template/quot/QuotETImport_00.xlsx"; document.getElementById('downloadXLSX').click(); } else if (fmupload.TemplateType.value=="01") { document.all('downloadXLSX').href="../template/quot/QuotETImport_01.xlsx"; document.getElementById('downloadXLSX').click(); } else { alert("请选择模板类型!") } } /** * 提交处理 */ function basicSubmit() { //母询价不可以点击保存 tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql326"); tSQLInfo.addSubPara(tQuotNo); tSQLInfo.setModule("grp_quotation"); var result = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(result != null){ alert("该询价通过应用母询价数据生成,不可更改询价基本信息"); return false; } //暂时先注掉 if (!basicCheck()) { return false; } fm2.action = "../API/grp_quotation/g_quot/LSQuotETBasicSave/UPDATE?Operate=SAVEBASIC&QuotNo=" + tQuotNo + "&QuotBatNo=" + tQuotBatNo + "&QuotType=" + tQuotType + "&MissionID=" + tMissionID + "&SubMissionID=" + tSubMissionID + "&ActivityID=" + tActivityID+"&IsHealthy="+IsHealthy; submitForm(fm2, true); } /** * 询价信息提交 */ function quotoff() { if (confirm("您确实想关闭询价吗?")) { tProdType=fm2.ProdType.value; /*fm.action = "./LSQuotETQuerySave.jsp?Operate=APPLYET&QuotType="+tETQuotType;*/ fm.action = "../API/grp_quotation/g_quot/LSQuotQueryOffConfigSave/UPDATE?Operate=QUOTOFF&QuotNo=" + tQuotNo + "&QuotBatNo=" + tQuotBatNo + "&QuotType=" + tQuotType + "&ProdType=" + tProdType; submitForm1(fm); } } /** * 提交数据 */ function submitForm1(obj) { 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();*/ // ajaxSubmit(obj); ajaxSubmit(obj,resultAfterSubmitApply); } /** * 提交数据后返回操作 */ function resultAfterSubmitApply(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; //获得窗口的水平位置 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(); location.href = "./LSQuotETQueryInput.jsp?IsHealthy="+IsHealthy; } } function checkDecimalPoint_tx(cValue, cLen2) { if (cValue == '' || cValue == null) {//为空, return true; } var tLen = ("" + cValue + "").length; var tLen1 = ("" + cValue + "").indexOf("."); var tLen2 = 0; tLen2 = tLen - tLen1 - 1; if (Number(tLen2) > Number(cLen2)) { return false; } return true; } //!!!G_NB 子母询价 function applied(){ if (!confirm("应用母询价数据后将会覆盖当前询价相关信息,是否继续?")){ return false; } if (fm2.MainQuotNo.value == null || fm2.MainQuotNo.value == "" ) { alert("当是否是子询价为是时,母询价不能为空"); return false; } //必须是已经审批通过的 tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql314"); tSQLInfo.addSubPara(fm2.MainQuotNo.value); tSQLInfo.addSubPara("02"); tSQLInfo.addSubPara(tCurrentDate); tSQLInfo.setModule("grp_quotation"); var tBasicArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(tBasicArr==null){ alert("该询价已经失效或者未审批通过") return false; } tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql318"); tSQLInfo.addSubPara(fm2.MainQuotNo.value); tSQLInfo.setModule("grp_quotation"); var tIsAllow = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(tIsAllow!=null){ if (tIsAllow[0][0] == '0') { alert("当母询价选择【是否允许子询价】选择’否‘时不允许有子询价。") return false; } } fm2.action = "../API/grp_quotation/g_quot/LSQuotETBasicSave/APPLIEDMUMDATA?Operate=APPLIEDMUMDATA&QuotNo=" + tQuotNo + "&QuotBatNo=" + tQuotBatNo + "&QuotType=" + tQuotType + "&MissionID=" + tMissionID + "&SubMissionID=" + tSubMissionID + "&ActivityID=" + tActivityID+"&IsHealthy="+IsHealthy+"&MainQuotNo="+fm2.MainQuotNo.value; submitForm(fm2, true); } /** * 基础校验 */ function basicCheck() { if (isEmpty(fm2.ProdType)) { i18nAlert("产品类型不能为空!", "LIS-99999"); return false; } else { //对产品分类进行校验,产品类型不一致时,给出清空后续数据提示 var tProdType = getProdType(tQuotNo, tQuotBatNo); if (tProdType == null || tProdType == "") { //为空,表示没有查询到 } else { if (tProdType != fm2.ProdType.value) { //校验该询价批次是否提交过,提交过的不允许更改 var tMissionCount = getNotInputCount(tQuotNo, tQuotBatNo); if (tMissionCount == "0") { } else { i18nAlert("该询价已经提交过核保审核,不能再次变更产品类型!", "LIS-05001"); return false; } if (!i18nConfirm("产品类型发生了改变,确认后将清空除基本信息外的所有数据,是否确认?", "LIS-01008")) { return false; } } } } if (fm2.ProdType.value=='01') { if(fm2.IsFreeRisk.value !='0'){ alert("建工险不能选择赠险") return false; } } if (!verifyForm('fm2')) { return false; } var tPrePrem = fm2.PrePrem.value; if (isEmpty(fm2.PrePrem)) {//待添加校验?小数校验 i18nAlert("预计保费规模不能为空!", "LIS-05293"); return false; } if (isEmpty(fm2.GrpName)) { alert("询价名称/投保单位名称不能为空!"); return false; } if (fm2.IDType.value !=null &&fm2.IDType.value !="" ){ if (fm2.IDNo.value ==null || fm2.IDNo.value ==""){ alert("当证件类型不为空时,证件号必录"); return false; }else{ if (!isOnlyEnglishAndNumber(fm2.IDNo.value)){ alert("证件号码包含特殊字符或汉字") return false; } if (fm2.IDType.value == '6'){ if (!validateSocialCreditCode(fm2.IDNo.value)) { alert("统一社会信用代码格式不正确!"); return false; } } } } // if (fm2.Address.value !=null && fm2.Address.value!=""){ // if (!isValidInput(fm2.Address.value)){ // alert("地址包含特殊字符"); // return false; // } // } if (!isNumeric(tPrePrem)) { i18nAlert("预计保费规模不是有效数字!", "LIS-05294"); return false; } if (Number(tPrePrem) < 0) { i18nAlert("预计保费规模应大于等于0!", "LIS-05295"); return false; } if (!checkDecimalFormat(tPrePrem, 12, 2)) { i18nAlert("预计保费规模整数位不应超过12位,小数位不应超过2位!", "LIS-05296"); return false; } if (isEmpty(fm2.IsContinueInsure)) { i18nAlert("是否为续保业务不能为空!", "LIS-05297"); return false; } if (isEmpty(fm2.BlanketFlag)) { i18nAlert("是否为统括单不能为空!", "LIS-05298"); return false; } if (isEmpty(fm2.PayIntv)) { i18nAlert("缴费方式不能为空!", "LIS-03927"); return false; } if (isEmpty(fm2.IsCoinsurance)) { i18nAlert("是否共保不能为空!", "LIS-05301"); return false; } if(fm2.SaleChnl.value == "02" || fm2.SaleChnl.value == "03" || fm2.SaleChnl.value == "04"){ if (fm2.AgentCom.value=="") { alert("销售渠道选择中介时需录入中介机构"); return false; } }else { if (fm2.AgentCom.value!="") { alert("销售渠道选择非中介时,无需录入中介机构信息"); return false; } } //当子母询价选择是时母询价号不能为空 if (fm2.IsSubQuot.value == '1'){ if (fm2.MainQuotNo.value ==""){ alert("当【是否是子询价】选择'是'时 母询价号不能为空"); return false; } } tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql323"); tSQLInfo.addSubPara(tQuotNo); tSQLInfo.setModule("grp_quotation"); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr !=null){ if (tArr[0][0] !=''){ if ( tArr[0][0] !=fm2.IsWait.value){ if (!confirm("是否等待期发生发生了改变,确认后将清空除基本信息外的所有数据,是否确认?" )) { return false; } } } } return true; } /** 询价--第一步--结束*/ /** * 下拉后处理 */ function afterCodeSelect(cCodeType, Field) { if (cCodeType == 'IsSubQuot') { if (Field.value == '1') { document.getElementById("MainQuotNodiv").style.display=''; document.getElementById("SuperiorQuotNoButton").style.display=''; document.getElementById("MainQuotNo1").style.display=''; document.getElementById("MainQuotNo").style.display=''; }else{ document.getElementById("MainQuotNodiv").style.display='none'; document.getElementById("SuperiorQuotNoButton").style.display='none'; document.getElementById("MainQuotNo1").style.display='none'; document.getElementById("MainQuotNo").style.display='none'; } } if (cCodeType == 'IsContinueInsure') { if (Field.value == '1') { document.getElementById("GrpContNo1").style.display=''; document.getElementById("GrpContNo2").style.display=''; document.getElementById("GrpContNo").style.display=''; }else { document.getElementById("GrpContNo1").style.display='none'; fm2.GrpContNo.value= ""; document.getElementById("GrpContNo2").style.display='none'; document.getElementById("GrpContNo").style.display='none'; } } //销售渠道处了 02 03 04置空中介机构 if (cCodeType == 'salechannel') { if (Field.value == '02' ||Field.value == '03' ||Field.value == '04') { }else { $("#AgentCom").val(""); $("#AgentComName").val(""); } } // if (cCodeType == 'prodtype'){ // if (Field.value =='01'){ // document.getElementById("IsFreeRisk").style.display='none'; // document.getElementById("IsFreeRiskName").style.display='none'; // }else { // document.getElementById("IsFreeRisk").style.display=''; // document.getElementById("IsFreeRiskName").style.display=''; // } // } } /** * 提交数据 */ 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) { 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(); } initBasicInfo(); } /** * 下一步 */ function nextStep() { if (fm2.GrpName.value=="" || fm2.GrpName.value==null){ alert("请输入投保单位名称"); return false; } goToStep(2); } /** * 回目录 */ function returnLR() { goToStep(0); } /** * 查询准客户信息 */ function queryCustomer(tMark) { if ((tMark == "Page" || tMark == "Enter") && tQuotBatNo != 1) { i18nAlert("再次询价时不可修改准客户名称!", "LIS-05306"); return false; } var tPreCustomerNo = fm2.PreCustomerNo.value; var tPreCustomerName = fm2.PreCustomerName.value; var tSelNo = RelaCustListGrid.lastFocusRowNo;//行号从0开始 var strUrl = "LSQuotQueryCustomerMain.jsp?SelNo=" + tSelNo + "&Mark=" + tMark + "&PreCustomerNo=" + tPreCustomerNo + "&PreCustomerName=" + tPreCustomerName + "&QuotNo=" + tQuotNo; window.open(strUrl, "准客户名称查询", 'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); } //参考老核心代码 function querySalesmanAndMediator(tMark) { if (fm2.SaleChnl.value == null || fm2.SaleChnl.value == ""){ alert("请先选择销售渠道!") return false; } if (tMark == "salesman") { if(fm2.SaleChnl.value == '07'){ var strUrl = "LSQuotQuerySalesmanMain.jsp?QuotNo=" + tQuotNo+ "&AgentType=" + fm2.SaleChnl.value+"&AgentCom="+fm2.AgentCom.value +"&branchtype=perandgrp"+"&IsHealthy="+ IsHealthy; window.open(strUrl, "业务员查询", 'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); }else{ var strUrl = "LSQuotQuerySalesmanMain.jsp?QuotNo=" + tQuotNo+ "&AgentType=" + fm2.SaleChnl.value+"&AgentCom="+fm2.AgentCom.value +"&branchtype=2" +"&IsHealthy="+ IsHealthy; window.open(strUrl, "业务员查询", 'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); } } if (tMark == "mediator") { var strUrl = "LSQuotQueryMediatorMain.jsp?QuotNo=" + tQuotNo + "&AgentType=" + fm2.SaleChnl.value; window.open(strUrl, "中介机构查询", 'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); } } function queryr() { var strUrl = "LSQuotQueryTaxCostEstimatesMain.jsp"; window.open(strUrl, "业务员查询", 'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); } /** * 选择其他准客户时,校验主准客户是否改变 */ function checkPerCustomerNoChange(cCustNo) { if (fm2.PreCustomerNo.value != cCustNo) { i18nAlert("主准客户已改变,请重新选择关联准客户!", "LIS-05307"); initRelaCustListGrid(); return false; } } /** * 根据销售渠道值,展示中介信息 */ function showDivAgencyInfo(cField) { if (cField == null || cField == '') { document.getElementById("divAgencyInfo").style.display = 'none'; } else { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql6"); tSQLInfo.addSubPara(cField); tSQLInfo.setModule("grp_quotation"); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr != null) { if (tArr[0] != '0') {//为1,表示含有中介机构 document.getElementById("divAgencyInfo").style.display = ''; } else { document.getElementById("divAgencyInfo").style.display = 'none'; } } } } 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 == 'prodtype') { //var tSql = "prodtype|"+tQuotType; var tSql = "1 and codetype=#prodtype# and codeexp=#" + tQuotType + "#"; if (returnType == '0') { return showCodeList('queryexp', value2, value3, null, ['prodtype', tQuotType], ['CodeType', 'CodeExp'], '1', null); } else { return showCodeListKey('queryexp', value2, value3, null, ['prodtype', tQuotType], ['CodeType', 'CodeExp'], '1', null); } } else if (value1 == 'precustomerno') { var tPreCustomerName = fm2.PreCustomerName.value; if (tPreCustomerName == null || tPreCustomerName == "") { return false; } if (returnType == '0') { return showCodeList('precustomerno', value2, value3, null, [tOperator, tPreCustomerName], ['Operator', 'PreCustomerName'], '1', null); } else { return showCodeListKey('precustomerno', value2, value3, null, [tOperator, tPreCustomerName], ['Operator', 'PreCustomerName'], '1', null); } } } /** * 查询准客户 */ function selectPreCustomer(Filed, FildName) { if (tQuotBatNo != 1) { i18nAlert("再次询价时不可修改准客户名称!", "LIS-05306"); return false; } var objCodeName = FildName.value; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotSql"); tSQLInfo.setSqlId("LSQuotSql41"); tSQLInfo.addSubPara(objCodeName); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(tOperator); tSQLInfo.setModule("grp_quotation"); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr == null) { i18nAlert("不存在该准客户!", "LIS-05308"); return false; } else { if (tArr.length == 1) { Filed.value = tArr[0][0]; FildName.value = tArr[0][1]; fm2.IDType.value = tArr[0][2]; fm2.IDTypeName.value = tArr[0][3]; fm2.IDNo.value = tArr[0][4]; fm2.GrpNature.value = tArr[0][5]; fm2.GrpNatureName.value = tArr[0][6]; fm2.BusiCategory.value = tArr[0][7]; fm2.BusiCategoryName.value = tArr[0][8]; fm2.Address.value = tArr[0][9]; fm2.PrePrem.value = tArr[0][10]; fm2.CustomerIntro.value = tArr[0][11]; fm2.SaleChannel.value = tArr[0][12]; fm2.SaleChannelName.value = tArr[0][13]; showDivAgencyInfo(fm2.SaleChannel.value); } else if (tArr.length > 1 && tArr.length <= 10) { showCodeList('precustomerno', [Filed, FildName], [0, 1], null, [tOperator, objCodeName], ['Operator', 'PreCustomerName'], '1', null); mPreCustomerFlag = true; } else if (tArr.length > 10) { queryCustomer('Enter'); showDivAgencyInfo(fm2.SaleChannel.value); } } } /** * 准客户名称模糊查询 */ function fuzzyPreCustomerName(Filed, FildName) { if (window.event.keyCode == "13") { window.event.keyCode = 0; var objCodeName = FildName.value; if (objCodeName == "") { return false; } selectPreCustomer(Filed, FildName); } } function isOnlyEnglishAndNumber(input) { const pattern = /^[a-zA-Z0-9]+$/; return pattern.test(input); } function isValidInput(input) { // 只允许:中文、字母、数字、下划线 const pattern = /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/; return pattern.test(input); } function validateSocialCreditCode(uscc) { // 基础格式校验 if (!/^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/.test(uscc)) { return false; } // 字符-数值映射表 const charMap = { '0':0, '1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, 'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15, 'G':16, 'H':17, 'J':18, 'K':19, 'L':20, 'M':21, 'N':22, 'P':23, 'Q':24, 'R':25, 'T':26, 'U':27, 'W':28, 'X':29, 'Y':30 }; // 加权因子 const weights = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28]; // 前17位字符值 const values = []; for (let i = 0; i < 17; i++) { const char = uscc.charAt(i); values.push(charMap[char]); } // 加权求和 let total = 0; for (let i = 0; i < 17; i++) { total += values[i] * weights[i]; } // 计算校验码 const checkCodeIndex = (31 - (total % 31)) % 31; const checkCode = Object.keys(charMap)[checkCodeIndex]; // 比对校验码 return uscc.charAt(17) === checkCode; }