/*************************************************************** *
ProName:LSQuotProjBasicInput.js
*Title:项目询价基本信息录入
*Description:项目询价基本信息录入
*Copyright:Copyright (c) 2012
*Company:Sinosoft
* @author : 张成 * @version : 8.0 * @date : 2014-03-26 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var turnPage3 = new turnPageClass(); var turnPage4 = new turnPageClass(); var mLinkProNo = "0";//是否勾选关联其他项目询价号 0-未勾选 /** * 提交数据 */ 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(); initForm(); } } /** * 初始化询价第一步信息 */ function initQuotStep1() { fm2.QuotNo.value = tQuotNo; fm2.QuotBatNo.value = tQuotBatNo; //初始化基础信息 initBasicInfo(); // document.getElementById("divPlanDiv").innerHTML = showPlanDiv(); // document.getElementById("divPayIntvDiv").innerHTML = showPayIntvDiv(); // document.getElementById("divSaleChnlDiv").innerHTML = showSaleChnlDiv(); // pubShowAgencyInfoCheck(fm2); } /** * 项目询价--初始化基础信息 */ function initBasicInfo() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_quotation"); tSQLInfo.setResourceName("g_quot.LSQuotProjBasicSql"); tSQLInfo.setSqlId("LSQuotProjBasicSql1"); tSQLInfo.addSubPara(tQuotNo); tSQLInfo.addSubPara(tQuotBatNo); var tBasicArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tBasicArr==null) { return false; } else { $("#ProjName").val(tBasicArr[0][1]); $("#AgentCom").val(tBasicArr[0][2]); $("#AgentComName").val(tBasicArr[0][3]); $("#SaleChnl").val(tBasicArr[0][4]); $("#SaleChnlName").val(tBasicArr[0][5]); $("#OperSource").val(tBasicArr[0][6]); $("#OperSourceName").val(tBasicArr[0][7]); $("#ForceChkProfessRate").val(tBasicArr[0][8]); $("#ForceChkProfessRateName").val(tBasicArr[0][9]); $("#ProdType").val(tBasicArr[0][10]); $("#ProdTypeName").val(tBasicArr[0][11]); $("#IsCoinsurance").val(tBasicArr[0][12]); $("#IsCoinsuranceName").val(tBasicArr[0][13]); // $("#PayIntv").val(tBasicArr[0][14]); // $("#PayIntvName").val(tBasicArr[0][15]); $("#PayIntv").val("0"); $("#PayIntvName").val("趸交"); $("#BusinessReq").val(tBasicArr[0][16]); $("#IsContinueInsure").val(tBasicArr[0][17]); $("#IsContinueInsureName").val(tBasicArr[0][18]); $("#ForceChkNum").val(tBasicArr[0][20]); $("#ForceChkNumName").val(tBasicArr[0][21]); $("#IsWait").val(tBasicArr[0][22]); if (tBasicArr[0][22]=='1'){ $("#IsWaitName").val('有等待期'); }else if (tBasicArr[0][22]=='0'){ $("#IsWaitName").val('无等待期'); } if(tBasicArr[0][17] == '1'){ $("#GrpContNo1").css("display",'') $("#GrpContNo2").css("display",'') $("#GrpContNo").val(tBasicArr[0][19]); } } //关联适用机构 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_quotation"); tSQLInfo.setResourceName("g_quot.LSQuotProjBasicSql"); tSQLInfo.setSqlId("LSQuotProjBasicSql3"); tSQLInfo.addSubPara(tQuotNo); tSQLInfo.addSubPara(tQuotBatNo); if (!noDiv(turnPage2, AppOrgCodeGrid, tSQLInfo.getString())) { initAppOrgCodeGrid(); return false; } } /** * 展示中介机构名称 */ function showAgencyInfo() { //关联中介名称 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_quotation"); tSQLInfo.setResourceName("g_quot.LSQuotProjBasicSql"); tSQLInfo.setSqlId("LSQuotProjBasicSql5"); tSQLInfo.addSubPara(tQuotNo); tSQLInfo.addSubPara(tQuotBatNo); if (!noDiv(turnPage3, AgencyNameGrid, tSQLInfo.getString())) { initAgencyNameGrid(); return false; } } /** * 选中渠道后是否展示中介名称 */ function showIfAgencyName() { pubShowAgencyInfoCheck(fm2); } /** * 关联其他项目询价号既往信息 */ function showRelaQuot() { if (document.getElementById('LinkInquiryNo').checked) { //initLinkInquiryNoGrid(); mLinkProNo = "1";//已勾选--关联其他项目询价号既往信息 document.getElementById('divLinkInquiryNo').style.display = ''; } else { //initLinkInquiryNoGrid(); mLinkProNo = "0";////未勾选--关联其他项目询价号既往信息 document.getElementById('divLinkInquiryNo').style.display = 'none'; } } /** * 保存基本信息前校验 */ function basicCheck() { //校验基本信息是否录入完整 if (isEmpty(fm2.QuotNo)) { i18nAlert("询价号不能为空!", "LIS-04998"); return false; } if (isEmpty(fm2.QuotBatNo)) { i18nAlert("批次号不能为空!", "LIS-04999"); return false; } if (!verifyInput2()) { return false; } if (isEmpty(fm2.ProdType)) { i18nAlert("产品类型不能为空!", "LIS-05000"); 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.IsContinueInsure.value =='1'){ if (fm2.GrpContNo.value ==""){ alert("当是否连续投保选择是时,保单号不能为空"); return false; } } //校验适用机构 if (!checkAppCom()) { return false; } tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_quot.LSQuotProjBasicSql"); tSQLInfo.setSqlId("LSQuotProjBasicSql9"); 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 checkAppCom() { AppOrgCodeGrid.delBlankLine();//删除空行 if(AppOrgCodeGrid.mulLineCount<=0) { i18nAlert("适用机构不能为空!", "LIS-05005"); return false; } else { var vRow = AppOrgCodeGrid.mulLineCount; for (var i = 0; i < vRow; i++) { var mAppCom = AppOrgCodeGrid.getRowColData(i, 1); for (var j = 0; j < i; j++) { var nAppCom = AppOrgCodeGrid.getRowColData(j, 1); if (mAppCom == nAppCom) { i18nAlert("适用机构重复,请修改!", "LIS-05006"); return false; } } } } return true; } /** * 校验--关联其他项目询价号既往信息 */ function checkLinkInquiryNo() { if (document.getElementById('LinkInquiryNo').checked) { LinkInquiryNoGrid.delBlankLine();//删除空行 if(LinkInquiryNoGrid.mulLineCount<=0) { i18nAlert("关联询价号不能为空!", "LIS-05007"); return false; } else { var vRow = LinkInquiryNoGrid.mulLineCount; for (var i = 0; i < vRow; i++) { var mLinkNo = LinkInquiryNoGrid.getRowColData(i, 1); for (var j = 0; j < i; j++) { var nLinkNo = LinkInquiryNoGrid.getRowColData(j, 1); if (mLinkNo == nLinkNo) { i18nAlert("关联询价号重复,请修改!", "LIS-05008"); return false; } } } } } return true; } ///** // * 查询适用机构编码 // */ // //function queryCom() { // // var tSelNo = AppOrgCodeGrid.lastFocusRowNo;//行号从0开始 // var strUrl = "LSQuotQueryAppComMain.jsp?SelNo="+tSelNo; // window.open(strUrl,"适用机构查询",'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); //} /** * 基本信息保存 */ function basicSubmit() { if (!verifyForm("fm2")) { 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 (!basicCheck()) { return false; } //showRelaQuot();//防止刷新进入没点击 /*fm2.action = "./LSQuotProjBasicSave.jsp?QuotNo="+ tQuotNo +"&QuotBatNo="+ tQuotBatNo +"&QuotType="+ tQuotType +"&LinkProNo="+ mLinkProNo +"&MissionID="+ tMissionID +"&SubMissionID="+ tSubMissionID +"&ActivityID="+ tActivityID;*/ fm2.action = "../API/grp_quotation/g_quot/LSQuotProjBasicSave/UPDATE?QuotNo="+ tQuotNo +"&QuotBatNo="+ tQuotBatNo +"&QuotType="+ tQuotType +"&LinkProNo="+ mLinkProNo +"&MissionID="+ tMissionID +"&SubMissionID="+ tSubMissionID +"&ActivityID="+ tActivityID+"&IsHealthy="+IsHealthy; submitForm(fm2,true); } /** * 下一步 */ function nextStep() { goToStep(2); } /** * 回目录 */ function returnLR() { goToStep(0); } 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; 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 = "./LSQuotProjQueryInput.jsp?IsHealthy="+IsHealthy; } } 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') { 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); } } } /** * 下拉后处理 */ function afterCodeSelect(cCodeType, Field) { 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'; } } if (cCodeType == 'salechannel') { if (Field.value == '02' ||Field.value == '03' ||Field.value == '04') { }else { $("#AgentCom").val(""); $("#AgentComName").val(""); } } } function querySalesmanAndMediator(tMark) { if(tMark == "salesman") { var strUrl = "LSQuotQuerySalesmanMain.jsp?QuotNo="+tQuotNo; 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; window.open(strUrl,"中介机构查询",'height=600,width=600,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=no'); } } /** * 询价导入 */ function impQuotProjSubmit() { 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 downTemplate() { document.all('downloadXLSX').href="../template/quot/QuotProjImport_00.xlsx"; }