/*************************************************************** *
ProName:LLClaimReportAndCloseInput.js
*Title:报案关闭与调查界面
*Description:报案关闭与调查界面
*Copyright:Copyright (c) 2012
*Company:Sinosoft
* @author : nsk * @version : 8.0 * @date : 2024-10-29 ****************************************************************/ var showInfo; var turnPage = new turnPageClass();//系统使用 var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var turnPage3 = new turnPageClass(); var tQueryFlag = false; var tQueryResultFlag = false; var tMajorFlag;//标识是2-分公司回复还是3-总公司回复 var tPageNo = 1;//记录查询页码 var tIndexNo = 1;//记录查询序号 var submit = 0;//提交次数 /** * 初始化页面展示信息 */ function initMajorInfo() { document.all('RptNo').value = mRptNo; document.all('InputOperator').value.value = ""; document.all('InputDate').value = ""; document.all('InputCom').value = ""; document.all('InputComName').value = ""; document.all('InputRemarks').value = ""; var tArr; //查询是否存在已录入的上报信息 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql9"); tSQLInfo.addSubPara(mRptNo); tArr = null; tArr = easyExecSql(tSQLInfo.getString()); //判断是否查询成功 if (tArr==null || tArr.length==0) { i18nAlert("该报案未进行重大案件上报,请确认!", "LIS-04504"); return; } else { document.all('InputOperator').value = tArr[0][0]; document.all('InputDate').value = tArr[0][1]; document.all('InputCom').value = tArr[0][2]; document.all('InputComName').value = tArr[0][3]; document.all('InputRemarks').value = tArr[0][4]; } //校验录入机构级别 var tComGrade; tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql16"); tSQLInfo.addSubPara(mManageCom); tArr = null; tArr = easyExecSql(tSQLInfo.getString()); //判断是否查询成功 if (tArr==null || tArr.length==0) { i18nAlert("未查询到登录机构的机构级别!", "LIS-04499"); return false; } else { tComGrade = tArr[0][0]; } if (tComGrade!=null && tComGrade!="01" && tComGrade!="02") { return false; } //查询是否存在已录入的分公司回复信息 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql10"); tSQLInfo.addSubPara(mRptNo); tArr = null; tArr = easyExecSql(tSQLInfo.getString()); //判断是否查询成功 if (tArr==null || tArr.length==0) { if (tComGrade=="02") { $("#divReplyInfo").css("display",""); $("#divReplyInfo1").css("display","none"); document.all('RepInputOperator').value = mOperator; document.all('RepInputDate').value = mCurrentDate; document.all('RepInputCom').value = mManageCom; document.all('RepInputComName').value = ""; document.all('RepInputRemarks').value = ""; tMajorFlag=2; } } else { $("#divReplyInfo").css("display",""); document.all('RepInputOperator').value = tArr[0][0]; document.all('RepInputDate').value = tArr[0][1]; document.all('RepInputCom').value = tArr[0][2]; document.all('RepInputComName').value = tArr[0][3]; document.all('RepInputRemarks').value = tArr[0][4]; tMajorFlag=3; } //查询是否存在已录入的总公司回复信息 tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql11"); tSQLInfo.addSubPara(mRptNo); tArr = null; tArr = easyExecSql(tSQLInfo.getString()); //判断是否查询成功 if (tArr==null || tArr.length==0) { if (tComGrade=="01") { $("#divReplyInfo1").css("display",""); document.all('RepInputOperator1').value = mOperator; document.all('RepInputDate1').value = mCurrentDate; document.all('RepInputCom1').value = mManageCom; document.all('RepInputComName1').value = ""; document.all('RepInputRemarks1').value = ""; tMajorFlag=3; } } else { $("#divReplyInfo1").css("display",""); document.all('RepInputOperator1').value = tArr[0][0]; document.all('RepInputDate1').value = tArr[0][1]; document.all('RepInputCom1').value = tArr[0][2]; document.all('RepInputComName1').value = tArr[0][3]; document.all('RepInputRemarks1').value = tArr[0][4]; tMajorFlag=3; } } /** * 报案保存 */ function saveReport() { //系统的校验方法 if (!verifyInput2()) { return false; } var tRgtClass = fm.RgtClass.value; if (tRgtClass=="01") { if(!notNull(fm.AppntNo,"投保人名称")){return false;}; } //校验报案机构 var tComGrade; tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql16"); tSQLInfo.addSubPara(document.all('RptCom').value); tArr = null; tArr = easyExecSql(tSQLInfo.getString()); //判断是否查询成功 if (tArr==null || tArr.length==0) { i18nAlert("未查询到登录机构的机构级别!", "LIS-04499"); return false; } else { tComGrade = tArr[0][0]; } if (tComGrade==null || tComGrade=="01" || tComGrade=="02") { i18nAlert("报案机构不能是总公司或分公司,请下拉选择!", "LIS-04505"); fm.RptCom.focus(); fm.RptCom.className = "warnno"; return false; } var tRptDate = fm.RptDate.value; if (dateDiff(tRptDate,mCurrentDate,'D')<0) { i18nAlert("报案日期不能晚于当前日期!", "LIS-04506"); return false; } fm.Operate.value="REPORTINSERT"; submitForm(); } /** * 报案删除 */ function deleteReport() { var tRptNo = fm.RptNo.value; if (tRptNo==null || tRptNo=="") { i18nAlert("请先保存!", "LIS-04507"); return false; } if (i18nConfirm("确定删除该报案!", "LIS-01121")) { fm.Operate.value="REPORTDELETE"; submitForm(); } } /** * 查询报案信息 */ function queryReportInfo(tRptNo) { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql"); tSQLInfo.addSubPara(tRptNo); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr!=null && tArr.length==1) { fm.AppntNo.value = tArr[0][1]; fm.AppntName.value = tArr[0][2]; fm.RptName.value = tArr[0][3]; fm.RptPhone.value = tArr[0][4]; fm.RptMode.value = tArr[0][5]; fm.RptModeName.value = tArr[0][6]; fm.Relation.value = tArr[0][7]; fm.RelationName.value = tArr[0][8]; fm.RptDate.value = tArr[0][9]; fm.RptCom.value = tArr[0][10]; fm.RptComName.value = tArr[0][11]; fm.RptInputOperator.value = tArr[0][12]; } else { return false; } } /** * 查询选中的出险人信息,报案默认选中第一条 * 报案只允许存在一个出险人 */ function showSelectCustomerInfo() { var tSelNo = CustomerListGrid.getSelNo()-1; if (tSelNo<0) { return false; } var tCustomerNo = CustomerListGrid.getRowColData(tSelNo,1); if (tCustomerNo==null || tCustomerNo=="") { i18nAlert("请先查询出险人信息!", "LIS-04503"); return; } fm.CustomerNo.value = tCustomerNo; tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql2"); tSQLInfo.addSubPara(mRptNo); tSQLInfo.addSubPara(tCustomerNo); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr!=null && tArr.length==1) { initReportCustomerInfo(); disableCustomerInfo(); fm.CustomerNo.value = tArr[0][0]; fm.CustomerName.value = tArr[0][1]; fm.Birthday.value = tArr[0][2]; fm.IDNo.value = tArr[0][4]; fm.IDType.value = tArr[0][5]; fm.IDTypeName.value = tArr[0][6]; fm.Gender.value = tArr[0][7]; fm.GenderName.value = tArr[0][8]; fm.CustomerRemarks.value = tArr[0][9]; queryReportCaseInfo(); } else { return false; } } /*=================================客户操作===========================*/ /** * 新增客户 */ function addCustomer() { /* * 1、先进行非空字段校验 * 2、判断保存报案还是保存出险人 * 3、提交 */ //首先进行非空字段检验 // if (beforeSubmit() == true) // { //判断区分保存报案还是保存出险人 if (fm.RptNo.value == "" || fm.RptNo.value == null) { if(fm.RptName.value == "" || fm.RptName.value == null){ i18nAlert("请输入报案人姓名","LIS-01480"); return false; } if (fm.RptPhone.value == "" || fm.RptPhone.value == null){ i18nAlert("请输入报案人电话"); return false; } if(fm.RptPhone.value != null && fm.RptPhone.value != ""){ if (fm.RptPhone.value.length != 11){ i18nAlert("电话号码不是11位"); return false; } } if (fm.RptMode.value == null && fm.RptMode.value == ""){ i18nAlert("请输入报案方式"); return false; } if (fm.Relation.value == null && fm.Relation.value == ""){ i18nAlert("请选择报案人与出险人关系"); return false; } if (dateDiff(fm.RptDate.value,mCurrentDate,'D')<0){ i18nAlert("报案日期不能晚于当前日期!", "LIS-04506"); return false; } fm.Operate.value = "REPORTINSERT"; } else { if (fm.CustomerName.value == null && fm.CustomerName == ""){ i18nAlert("请输入出险人姓名"); return false } if (fm.Birthday.value == null && fm.Birthday == ""){ i18nAlert("请选择出生日期"); return false } if (fm.Gender.value == null && fm.Gender == ""){ i18nAlert("请选择性别"); return false } if (fm.IDNo.value == null && fm.IDNo == ""){ i18nAlert("请输入证件号码"); return false } if (fm.IDType.value == null && fm.IDType == ""){ i18nAlert("请选择证件类型"); return false } fm.Operate.value = "CUSTOMERINSERT"; // if(!checkCustomerInfo()) { // return false; // } } submitForm(); // } } /** * 影像件查询 * @returns {boolean} */ function queryEasyscan() { var tRgtNo = fm.RptNo.value; window.open("../es_common/ImageQueryGrpMain.jsp?BussType=G_CM&BussNo="+tRgtNo,null , 'width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0'); } /** * 校验客户信息--是否满足出险条件 */ function checkCustomerInfo() { //校验报案下只能有1个出险人 if (fm.Operate.value=="CUSTOMERINSERT") { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql3"); tSQLInfo.addSubPara(document.all('RptNo').value); var tExistsArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tExistsArr!=null && tExistsArr[0][0]==1 ) { i18nAlert("一次报案下只能有1个出险人!", "LIS-04621"); return false; } } if (fm.CustomerNo.value==null || fm.CustomerNo.value=="") { if(!notNull(fm.CustomerName,"[出险人姓名]")){return false;}; if(!notNull(fm.Birthday,"[出险人生日]")){return false;}; if(!notNull(fm.IDNo,"[证件号码]")){return false;}; if(!notNull(fm.IDType,"[证件类型]")){return false;}; if(!notNull(fm.Gender,"[性别]")){return false;}; } //校验根据录入的出险人信息是否能够获得被保人 queryCustomer(); if (!tQueryResultFlag) { i18nAlert("系统中不存在该出险人,请重新录入!", "LIS-04622"); return false; } return true; } /** * 根据录入信息选择系统被保人信息,并填充页面 * 被保险人检索条件:姓名+出生日期、姓名+员工号、证件号码,三种条件任选一种 */ function selectUser(tType) { var keycode = event.keyCode; if(tType == "1"){ keycode = "13"; } //回车的ascii码是13 if(keycode!="13" && keycode!="9") { return; } else { tQueryFlag = false; } var tRptNo = fm.RptNo.value; if (tRptNo==null || tRptNo=="" || tRptNo=="null") { i18nAlert("请先保存报案信息", "LIS-04620"); return false; } var tCustomerName = fm.CustomerName.value; var tBirthday = fm.Birthday.value; var tIDNo = fm.IDNo.value; if (tCustomerName!=null && tCustomerName!="") { if (tBirthday!=null && tBirthday!="") { if (dateDiff(tBirthday,mCurrentDate,'D')<0) { i18nAlert("出生日期不能晚于当前日期!", "LIS-04203"); return false; } //queryCustomer(1); } else { if (tEmployeNo!=null && tEmployeNo!="") { //queryCustomer(2); } else { if (tIDNo!=null && tIDNo!="") { //queryCustomer(3); } else { return; } } } } else { if (tIDNo!=null && tIDNo!="") { //queryCustomer(3); } else { i18nAlert("被保险人检索条件:姓名+出生日期、证件号码,两种条件任选至少满足一种!", ""); return false; } } queryCustomer(); if (!tQueryResultFlag) { i18nAlert("系统中不存在该出险人,请重新录入!", "LIS-04622"); return false; } } /** * 根据录入信息选择系统被保人信息,并填充页面 * 被保险人检索条件:姓名+出生日期、姓名+员工号、证件号码,三种条件任选一种 * tFlag 定义查询优先级,暂时不用--等待确认 */ function queryCustomer(tFlag) { tQueryResultFlag = false; tQueryFlag = true; tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql4"); tSQLInfo.addSubPara(document.all('RptNo').value); // 个单的情况下需重置查询 // var tContType = "02"; // if (tContType!=null && tContType=="02") { // tSQLInfo = new SqlClass(); // tSQLInfo.setModule("grp_claim"); // tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); // tSQLInfo.setSqlId("LLClaimReportSql15"); // tSQLInfo.addSubPara(document.all('AppntNo').value); // } if (tFlag==1) { tSQLInfo.addSubPara(document.all('CustomerName').value); tSQLInfo.addSubPara(document.all('Birthday').value); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(""); } else if (tFlag==2) { tSQLInfo.addSubPara(document.all('CustomerName').value); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(""); } else if (tFlag==3) { tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(document.all('IDNo').value); } else { tSQLInfo.addSubPara(fm.CustomerName.value); tSQLInfo.addSubPara(fm.Birthday.value); tSQLInfo.addSubPara(""); tSQLInfo.addSubPara(fm.IDNo.value); } if (document.all('CustomerNo').value !=null && document.all('CustomerNo').value!="") { tSQLInfo.addSubPara(document.all('CustomerNo').value); } else { tSQLInfo.addSubPara(""); } tSQLInfo.addSubPara(document.all('SelfRptCom').value); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr==null || tArr.length==0) { return false; } else { tQueryResultFlag = true; if (tArr.length==1) { fm.CustomerNo.value = tArr[0][0]; fm.CustomerName.value = tArr[0][1]; fm.Birthday.value = tArr[0][2]; fm.IDNo.value = tArr[0][6]; fm.IDType.value = tArr[0][4]; fm.IDTypeName.value = tArr[0][5]; fm.Gender.value = tArr[0][7]; fm.GenderName.value = tArr[0][8]; fm.SelfAppntNo.value = tArr[0][9]; fm.SelfAppntName.value = tArr[0][10]; } else { i18nAlert("根据录入信息可查询到多个被保人,请手动选择!", "LIS-04623"); showCustomerList(); } } } //展示客户列表--存在同一投保人下同名同生日或同名同员工号或同一证件号码 function showCustomerList() { var strUrl="./LLClaimQueryMain.jsp?AppntNo="+fm.AppntNo.value+"&CustomerName="+fm.CustomerName.value+"&Birthday="+fm.Birthday.value+"&EmpNo="+fm.EmpNo.value+"&IDNo="+fm.IDNo.value; var tWidth=800; var tHeight=600; var tTop=(window.screen.availHeight-30-tHeight)/2; //获得窗口的垂直位置; var tLeft=(window.screen.availWidth-10-tWidth)/2; //获得窗口的水平位置; window.open(strUrl,"用户信息查询",'width='+tWidth+',height='+tHeight+',top='+tTop+',left='+tLeft+',toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0'); } /** * 修改客户 */ function modifyCustomer() { var tRptNo = fm.RptNo.value; if (tRptNo==null || tRptNo=="" || tRptNo=="null") { i18nAlert("请先保存报案信息", "LIS-04620"); return false; } var tSelNo = CustomerListGrid.getSelNo()-1; if (tSelNo<0) { i18nAlert("请选择一条该出险人信息", "LIS-04204"); return false; } var tCustomerNoSel = CustomerListGrid.getRowColData(tSelNo,1); var tCustomerNo = fm.CustomerNo.value; if (tCustomerNo!=null && tCustomerNo!="") { if (tCustomerNoSel!=tCustomerNo) { i18nAlert("【修改】操作不可替换出险人", "LIS-04624"); return false; } } fm.CustomerNo.value = CustomerListGrid.getRowColData(tSelNo,1); fm.Operate.value="CUSTOMERUPDATE"; if(!checkCustomerInfo()) { return false; } submitForm(); } /** * delete客户 */ function deleteCustomer() { var tRptNo = fm.RptNo.value; if (tRptNo==null || tRptNo=="" || tRptNo=="null") { i18nAlert("请先保存报案信息", "LIS-04620"); return false;; } var tSelNo = CustomerListGrid.getSelNo()-1; if (tSelNo<0) { i18nAlert("请选择一条该出险人信息", "LIS-04204"); return false; } if (i18nConfirm("出险人删除操作将会删除该出险人下的所有相关的信息!确定删除吗?", "LIS-01125")) { fm.CustomerNo.value = CustomerListGrid.getRowColData(tSelNo,1); fm.Operate.value = "CUSTOMERDELETE"; submitForm(); } } /*======================事件操作========================*/ /** * 查询报案出险人事件信息 */ function queryReportCaseInfo() { tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql5"); tSQLInfo.addSubPara(document.all('RptNo').value); tSQLInfo.addSubPara(document.all('CustomerNo').value); turnPage2.queryModal(tSQLInfo.getString(),AccidentListGrid,2); } /** * 展示选中的报案出险人事件信息 */ function showSelReportCaseInfo() { var tSelNo = AccidentListGrid.getSelNo()-1; if (tSelNo<0) { i18nAlert("请先选择一条出险人信息", "LIS-04625"); return false; } var tAccNo = AccidentListGrid.getRowColData(tSelNo,1); if (tAccNo==null || tAccNo=="") { i18nAlert("请先查询出险人信息!", "LIS-04503"); return; } var tCustomerNo = AccidentListGrid.getRowColData(tSelNo,2); if (tCustomerNo==null || tCustomerNo=="") { i18nAlert("请先查询出险人信息!", "LIS-04503"); return; } fm.AccNo.value = tAccNo; fm.CustomerNo.value = tCustomerNo; tSQLInfo = new SqlClass(); tSQLInfo.setModule("grp_claim"); tSQLInfo.setResourceName("g_claim.LLClaimReportSql"); tSQLInfo.setSqlId("LLClaimReportSql6"); tSQLInfo.addSubPara(document.all('RptNo').value); tSQLInfo.addSubPara(tCustomerNo); tSQLInfo.addSubPara(tAccNo); var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if (tArr!=null && tArr.length==1) { initCustomerCaseInfo(); fm.AccidDate.value = tArr[0][1]; fm.AccDate.value = tArr[0][2]; fm.HospitalCode.value = tArr[0][3]; fm.HospitalName.value = tArr[0][4]; fm.AccReason.value = tArr[0][5]; fm.AccReasonName.value = tArr[0][6]; fm.AccidDetail.value = tArr[0][7]; fm.AccidDetailName.value = tArr[0][8]; fm.TreatResult.value = tArr[0][9]; fm.TreatResultName.value = tArr[0][10]; fm.AccidResult1.value = tArr[0][11]; fm.AccidResult1Name.value = tArr[0][12]; fm.AccidResult2.value = tArr[0][13]; fm.AccidResult2Name.value = tArr[0][14]; fm.AccDetailAddress.value = tArr[0][21]; fm.AccDesc.value = tArr[0][23]; fm.CaseRemark.value = tArr[0][24]; fm.EstAmount.value = tArr[0][25]; // fm.RptBackReason.value = tArr[0][26]; // fm.RptBackReasonName.value = tArr[0][27]; // fm.RptBackReasonDetail.value = tArr[0][28]; fm.AccidentNation.value = tArr[0][28]; fm.AccidentNationName.value = tArr[0][29]; if (fm.AccidentNation.value == "CHN" || fm.AccidentNation.value == ""){ fm.AccProvinceName.value = tArr[0][16]; fm.AccCityName.value = tArr[0][18]; fm.AccCountyName.value = tArr[0][20]; }else { fm.AccProvinceName.value = "其他"; fm.AccCityName.value = "其他"; fm.AccCountyName.value = "其他"; } var tClaimType = tArr[0][22]; var tClaimTypeArr = tClaimType.split(","); for (var i=0;i