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

ProName:EdorIOInput.js

*

Title:被保险人职业类别变更

*

Description:被保险人职业类别变更

*

Copyright:Copyright (c) 2012

*

Company:Sinosoft

* @author : LIJIAN * @version : 1.0 * @date : 2025-01-20 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var mOperate = "";//操作状态 var tSQLInfo = new SqlClass(); /** * 提交 */ function submitForm() { var i = 0; var showStr = i18nMessage("正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04525"); 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(); document.all("Operate").value = mOperate; if (mOperate == "DELETE"){ document.getElementById("fm").action="../API/grp_pa/g_pos/EdorIOSave/ADD"; }else if (mOperate =="INSERT||UPDATE" ){ document.getElementById("fm").action="../API/grp_pa/g_pos/EdorIOSave/INSERTUPDATE"; } ajaxSubmit2(document.getElementById("fm")); } /** * 人员清单校验 */ function insuredListCheck() { fm.Operate.value = "CHECKLIST"; tOperate = "CHECKLIST"; fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/ADD"; ajaxSubmit2(document.getElementById("fm")); initForm(); } /** * 提交数据后返回操作 */ 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(); if(mOperate == "DELETE"){ queryOldClick(); queryUpdateClick(); clearPage(); }else if(mOperate =="INSERT||UPDATE" ){ queryOldClick(); queryUpdateClick(); clearPage(); } } } /** * 调用保险方案的方法 */ function showContPlanCode(cObj,cObjName,cObjCode){ return showCodeList('contplan',[cObj,cObjName,cObjCode],[0,1,2],null,document.all("GrpPropNo").value,'GrpContNo',1,null); } function showContPlanCodeName(cObj1,cObjName1,cObjCode1){ return showCodeListKey('contplan',[cObj1,cObjName1,cObjCode1],[0,1,2],null,document.all("GrpPropNo").value,'GrpContNo',1,null); } /** * 查询原被保人信息 */ function queryOldClick(){ tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIOSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("EdorIOSql1"); tSQLInfo.addSubPara(document.all("GrpPropNo").value); tSQLInfo.addSubPara(document.all("OldInsuredNameQ").value); tSQLInfo.addSubPara(document.all("OldInsuredIDNoQ").value); tSQLInfo.addSubPara(document.all("OldInsuredNoQ").value); tSQLInfo.addSubPara(document.all("ContPlanCodeOldQ").value); tSQLInfo.addSubPara(tEdorAppNo); initOldInsuredInfoGrid(); clearPage(); document.all("SerialNo").value=""; turnPage1.queryModal(tSQLInfo.getString(), OldInsuredInfoGrid, 1, 1,10); // if (!turnPage1.strQueryResult) { // i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); // } } /** * 展示原被保人信息 */ function showOldInsuredList(){ initUpdateInsuredInfoGrid(); queryUpdateClick(1); clearPage(); var tSelNo = OldInsuredInfoGrid.getSelNo(); var tOldInsuredName = OldInsuredInfoGrid.getRowColData(tSelNo-1,2); var tOldOccupationCode = OldInsuredInfoGrid.getRowColData(tSelNo-1,9); var tOldOccupationName = OldInsuredInfoGrid.getRowColData(tSelNo-1,10); var tOldOccupationType = OldInsuredInfoGrid.getRowColData(tSelNo-1,11); var tOldOccupationTypeName = OldInsuredInfoGrid.getRowColData(tSelNo-1,12); var tOldIdno = OldInsuredInfoGrid.getRowColData(tSelNo-1,8); var tInsuredno = OldInsuredInfoGrid.getRowColData(tSelNo-1,16); document.all("InsuredOldName").value =tOldInsuredName; document.all("OldOccupationCode").value = tOldOccupationCode; document.all("OldOccupationCodeName").value =tOldOccupationName; document.all("OldOccupationType").value =tOldOccupationType; document.all("OldOccupationTypeName").value =tOldOccupationTypeName; document.all("IdOldNo").value = tOldIdno; // document.all("OccupationCode").value = tOldOccupationCode; // document.all("OccupationCodeName").value =tOldOccupationName; // document.all("OccupationType").value =tOldOccupationType; // document.all("OccupationTypeName").value =tOldOccupationTypeName; document.all("edorValDate").value = tCurrentDate ; document.all("InsuredNO").value = tInsuredno ; } /** * 保存 */ function addRecord(){ if(!verifyForm("fm")){ return false; } if(fm.OccupationType.value == "7" || fm.OccupationType.value == "z"){ i18nAlert("职业类别为拒保不能保存!", null); return false; } var tSelNoOld = OldInsuredInfoGrid.getSelNo(); var tSelNoUpdate = UpdateInsuredInfoGrid.getSelNo(); if(tSelNoOld=='0' && tSelNoUpdate=='0'){ i18nAlert("请选中一条原被保人信息或修改后的被保人信息进行保存!", "LIS-03325"); return false; } mOperate = "INSERT||UPDATE"; submitForm(); } /** * 撤销 */ function deleteRecord(){ var tSelNo = UpdateInsuredInfoGrid.getSelNo(); if(tSelNo=='0'){ i18nAlert("请选择一条修改过的被保险人信息进行撤销!", "LIS-03326"); return false; } mOperate = "DELETE"; submitForm(); } /** * 查询修改后被保人信息 */ function queryUpdateClick(o){ tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIOSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("EdorIOSql4"); tSQLInfo.addSubPara(document.all("GrpPropNo").value); tSQLInfo.addSubPara(document.all("EdorAppNo").value); tSQLInfo.addSubPara(document.all("EdorType").value); tSQLInfo.addSubPara(NullToEmpty(document.all("EdorNo").value)); tSQLInfo.addSubPara(document.all("InsuredNameQ").value); tSQLInfo.addSubPara(document.all("InsuredIDNoQ").value); tSQLInfo.addSubPara(document.all("BatchNo").value); initUpdateInsuredInfoGrid(); clearPage(); turnPage2.queryModal(tSQLInfo.getString(), UpdateInsuredInfoGrid, 1, 1,10); // if(o=='1'){ // if (!turnPage2.strQueryResult) { // i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); // } // } } /** * 查询修改后被保人信息展示 */ function showUpdateInsuredList(){ initOldInsuredInfoGrid(); queryOldClick(); var tSelNo = UpdateInsuredInfoGrid.getSelNo(); var tSerialNo = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,1); var tOldInsuredName = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,2); var tOldIdno = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,3); document.all("InsuredOldName").value = tOldInsuredName; document.all("IdOldNo").value = tOldIdno; document.all("SerialNo").value = tSerialNo; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorIOSql"); tSQLInfo.setModule("grp_pa"); tSQLInfo.setSqlId("EdorIOSql6"); tSQLInfo.addSubPara(document.all("GrpPropNo").value); tSQLInfo.addSubPara(document.all("EdorType").value); tSQLInfo.addSubPara(document.all("EdorAppNo").value); tSQLInfo.addSubPara(tSerialNo); var upArrResul = easyExecSql(tSQLInfo.getString()); if (upArrResul != null) { document.all("edorValDate").value = upArrResul[0][0]; document.all("OccupationCode").value = upArrResul[0][1]; document.all("OccupationCodeName").value = upArrResul[0][2]; document.all("OccupationType").value = upArrResul[0][3]; document.all("OccupationTypeName").value = upArrResul[0][4]; document.all("InsuredNO").value = upArrResul[0][5]; } var mySql; if (tActivityID === "null" || tActivityID == null) { mySql = wrapSql("g_pos.EdorIOSql", "EdorIOSql8", [upArrResul[0][5], document.all("GrpPropNo").value, tEdorNo, tEdorType], "grp_pa"); } else { mySql = wrapSql("g_pos.EdorIOSql", "EdorIOSql7", [upArrResul[0][5], document.all("GrpPropNo").value], "grp_pa"); } var strTemp = easyExecSql(mySql); if (strTemp != null) { document.all("OldOccupationCode").value = strTemp[0][0]; document.all("OldOccupationCodeName").value = strTemp[0][1]; document.all("OldOccupationType").value = strTemp[0][2]; document.all("OldOccupationTypeName").value = strTemp[0][3]; } } /** * 清理页面 */ function clearPage(){ document.all("edorValDate").value =""; document.all("OccupationCode").value =""; document.all("OccupationCodeName").value =""; document.all("OccupationType").value =""; document.all("OccupationTypeName").value =""; } /** * 选择客户 --按回车键和Tab键时触发 */ /** * 客户姓名查出多条时,跳转到客户查询页面 */ // function showLCInsuredInfo() { // // var tGrpPropNo=document.all("GrpPropNo").value; // var tInsuredName=document.all("InsuredName").value; // window.open("./EdorNIQueryMain.jsp?GrpPropNo="+tGrpPropNo+"&InsuredName="+tInsuredName+"&ManageCom="+tManageCom,"查询被保人信息",'width=950,height=520,top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0'); // } /** * 清空被保人基本信息 */ // function emptyCustInfo(){ // // document.all("InsuredName").value=""; // document.all("IDType").value=""; // document.all("IDTypeName").value=""; // document.all("IDNo").value=""; // document.all("InsuredGender").value=""; // document.all("InsuredGenderName").value=""; // document.all("InsuredBirthDay").value=""; // document.all("InsuredAppAge").value=""; // document.all("InsuredNoS").value =""; // document.all("ContNoS").value =""; // } //职业类别 function showOccupationNameList(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1); } function showOccupationNameListKey(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1); } //职业类别 function showOccupationCodeList(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCode.value,'OccupationCode',1); } function showOccupationCodeListKey(obj1,obj1Name,obj2,obj2Name){ var keycode = event.keyCode; //回车的ascii码是13 // if(keycode!="13" && keycode!="9") { // return; // } showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCode.value,'OccupationCode',1); } /** * 清空关联查询的项目 */ function clearInput(codeInput,nameInput) { codeInput.value = ""; nameInput.value = ""; } // // document.addEventListener('DOMContentLoaded', function () { // const codeInput = document.getElementById('OccupationCode'); // const nameInput = document.querySelector('input[name="OccupationCodeName"]'); // // // ✅ 确保 fm 是你表单的引用(根据实际情况调整) // const fm = { // OccupationCode: codeInput, // OccupationCodeName: nameInput, // OccupationType: document.getElementById('OccupationType') || null, // OccupationTypeName: document.getElementById('OccupationTypeName') || null // }; // // // ✅ 双击事件绑定 // codeInput.ondblclick = function (e) { // e.preventDefault(); // // // ✅ 确保函数存在 // if (typeof showOccupationCodeList === 'function') { // showOccupationCodeList(fm.OccupationCode, fm.OccupationCodeName, fm.OccupationType, fm.OccupationTypeName); // } else { // alert('错误:showOccupationCodeList 函数未定义!'); // console.error('showOccupationCodeList is not defined'); // } // }; // // // ✅ 同样处理 keyup(可选) // codeInput.onkeyup = function () { // if (typeof showOccupationCodeListKey === 'function') { // showOccupationCodeListKey(fm.OccupationCode, fm.OccupationCodeName, fm.OccupationType, fm.OccupationTypeName); // return; // } // }; // // // ✅ codename 输入框事件 // nameInput.onkeydown = function () { // if (typeof showOccupationNameList === 'function') { // showOccupationNameList(fm.OccupationCode, fm.OccupationCodeName, fm.OccupationType, fm.OccupationTypeName); // return; // } // }; // // nameInput.onkeyup = function () { // if (typeof showOccupationNameListKey === 'function') { // showOccupationNameListKey(fm.OccupationCode, fm.OccupationCodeName, fm.OccupationType, fm.OccupationTypeName); // return; // } // }; // });