var turnPage = new turnPageClass(); var mOperate = ""; var showInfo; window.onfocus = myonfocus; function myonfocus() { if(showInfo != null) { try { showInfo.focus(); } catch (ex) { showInfo = null; } } } function submitForm() { if(verifyInput2() == false ) { return false; } var showStr = i18nMessage("正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04525"); var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(showStr); 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("fmtransact").value = mOperate; //document.getElementById("fm").submit(); if(mOperate == "INSERT||MAIN"){ fm.action = "../API/print/print/LPrtDefinitionSave/INSERTMAIN"; ajaxSubmit2(document.getElementById("fm"),handleInfo); }else if(mOperate == "UPDATE||MAIN"){ fm.action = "../API/print/print/LPrtDefinitionSave/UPDATEMAIN"; ajaxSubmit2(document.getElementById("fm"),handleInfo); } } function showSubmitFrame(cDebug) { if(cDebug == "1") { parent.fraMain.rows = "0,0,50,82,*"; } else { parent.fraMain.rows = "0,0,0,82,*"; } } function afterSubmit(FlagStr,content) { // 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:350px");/ var name='提示'; //网页名称,可为空; var iWidth=550; //弹出窗口的宽度; var iHeight=350; //弹出窗口的高度; 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=C&content="+ encodeURIComponent(content); //showModalDialog(urlStr, window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:350px"); var name='提示'; //网页名称,可为空; var iWidth=550; //弹出窗口的宽度; var iHeight=350; //弹出窗口的高度; 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(); } } function resetForm() { try { fm.reset(); initFormUp(); initFormDown(); } catch(ex) { i18nAlert("{0}函数中发生异常:初始化界面错误!", "LIS-01177", "-->InitForm"); } } function addClick() { mOperate = "INSERT||MAIN"; if(document.all("PrintID").value != "") { i18nAlert("已存在打印号码,请重置!", "LIS-04047"); return; } submitForm(); } function handleInfo(flagStr,content,result){ parent.fraInterface.fm.all("PrintID").value = result.tPrintID; parent.fraInterface.afterSubmit(result.FlagStr,result.Content); } function deleteClick() { if( verifyInput2() == false ) { return false; } if(document.getElementById("PrintID").value == ""||document.getElementById("PrintID").value == null) { i18nAlert("请先查询,点击确认后才能操作!", "LIS-04045"); return false; } if(i18nConfirm("您确实想删除该记录吗?", "LIS-00610")) { var i = 0; var showStr=i18nMessage("正在删除数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04527"); var urlStr="../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(showStr); 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(); fm.fmtransact.value = "DELETE||MAIN"; //document.getElementById("fm").submit(); //提交 fm.action = "../API/print/print/LPrtDefinitionSave/DELETEMAIN"; ajaxSubmit2(document.getElementById("fm"),handleInfo); initFormUp(); initFormDown(); } else { i18nAlert("您取消了删除操作!", "LIS-01292"); } } function updateClick() { if(verifyInput2() == false) { return false; } if(document.getElementById("PrintID").value == ""||document.getElementById("PrintID").value == null) { i18nAlert("请先查询,点击确认后才能操作!", "LIS-04045"); return false; } if(i18nConfirm("您确实想修改该记录吗?", "LIS-00765")) { mOperate = "UPDATE||MAIN"; submitForm(); } else { i18nAlert("您取消了修改操作!", "LIS-01291"); } } function queryClick() { mOperate = "QUERY||MAIN"; if (document.all("PrintName").value == "" ) { alert("请输入打印名称!") return ; } else { try { var sqlid1 = "LPrtDefinitionQueryInputSql1"; // var mySql1 = new SqlClass(); // mySql1.setModule("print"); // mySql1.setResourceName("print.LPrtDefinitionQueryInputSql"); // mySql1.setSqlId(sqlid1); // mySql1.addSubPara(document.all("PrintName").value); // mySql1.addSubPara(document.all("PrintObject").value); // mySql1.addSubPara(document.all("PrintType").value); var param = [ document.all("PrintName").value, document.all("PrintObject").value, document.all("PrintType").value ]; var mySql1 = wrapSql("print.LPrtDefinitionQueryInputSql", "LPrtDefinitionQueryInputSql1", param, "print"); turnPage.queryModal(mySql1, LPrtDefinitionGrid); } catch (ex) { i18nAlert("打印查询出错!{0}", "LIS-04046", ex.message); } } //showInfo = window.open("./LPrtDefinitionQuery.jsp"); //alert(showInfo); //location.href = "./LPrtDefinitionQuery.jsp"; } function afterQuery(arrQueryResult) { var arrResult = new Array(); if(arrQueryResult != null) { var sqlId1 = "LPrtDefinitionInputSql1"; //var mySql1 = new SqlClass(); // mySql1.setModule("print"); // mySql1.setResourceName("print.LPrtDefinitionInputSql");//指定使用的properties文件名 // mySql1.setSqlId(sqlId1); // mySql1.addSubPara(arrQueryResult[0][0]);//指定传入的参数 var mySql1 = wrapSql("print.LPrtDefinitionInputSql", "LPrtDefinitionInputSql1", [arrQueryResult[0][0]], "print"); arrResult = easyExecSql(mySql1); document.all('PrintID').value = arrResult[0][0]; document.all('PrintName').value = arrResult[0][1]; document.all('PrintObject').value = arrResult[0][2]; document.all('PrintObjectName').value = arrResult[0][3]; document.all('PrintType').value = arrResult[0][4]; document.all('PrintTypeName').value = arrResult[0][5]; document.all('LanguageType').value = arrResult[0][6]; document.all('LanguageTypeName').value = arrResult[0][7]; document.all('PrintID').readOnly = true; } } function getQueryResult() { var tRow; var arrSelected = null; tRow = LPrtDefinitionGrid.getSelNo(); // getSelNo()获取选中单选框的行数 if (tRow == null || tRow == 0) { return arrSelected; } arrSelected = new Array(); arrSelected[0] = new Array(); arrSelected[0] = LPrtDefinitionGrid.getRowData(tRow - 1); return arrSelected; } function fillBlanks() { var arrReturn = new Array(); var tSel = LPrtDefinitionGrid.getSelNo(); if (tSel == 0 || tSel == null) { i18nAlert("请选择一条记录,再点击确认按钮。", "LIS-04048"); } else { try { arrReturn = getQueryResult(); //top.opener.afterQuery(arrReturn); afterQuery(arrReturn); } catch (ex) { i18nAlert("没有发现窗口的afterQuery接口。{0}", "LIS-04049", ex.message); } //top.close(); } }