You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

281 lines
7.7 KiB

// 该文件中包含客户端需要处理的函数和事件
var arrDataSet
var showInfo;
var mDebug="0";
var tArr;
var turnPage = new turnPageClass();
//提交,保存按钮对应操作
function submitForm()
{
var i = 0;
var showStr=i18nMessage("正在查询数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04528");
var urlStr="../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(showStr);
// showInfo=window.open(urlStr,"newwindow","height=250;width=550;top=0;left=0;toolbar=no;menubar=no;scrollbars=no;resizable=no;alwaysRaised:yes;");
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();
// initPolGrid();
//showSubmitFrame(mDebug);
document.getElementById("fm").submit(); //提交
}
//提交后操作,服务器数据返回后执行的操作
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: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: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();
//showDiv(operateButton,"true");
//showDiv(inputButton,"false");
//执行下一步操作
}
}
//重置按钮对应操作,Form的初始化函数在功能名+Init.jsp文件中实现,函数的名称为initForm()
function resetForm()
{
try
{
initForm();
}
catch(re)
{
i18nAlert("{0}函数中发生异常:初始化界面错误!", "LIS-01177", "OLDComQuery.js-->resetForm");
}
}
//取消按钮对应操作
function cancelForm()
{
showDiv(operateButton,"true");
showDiv(inputButton,"false");
}
//提交前的校验、计算
function beforeSubmit()
{
//添加操作
}
//Click事件,当点击增加图片时触发该函数
function addClick()
{
//下面增加相应的代码
showDiv(operateButton,"false");
showDiv(inputButton,"true");
}
//Click事件,当点击“修改”图片时触发该函数
function updateClick()
{
//下面增加相应的代码
alert("update click");
}
//Click事件,当点击“查询”图片时触发该函数
function queryClick()
{
//下面增加相应的代码
//window.showModalDialog("./ProposalQuery.jsp",window,"status:0;help:0;edge:sunken;dialogHide:0;dialogWidth=15cm;dialogHeight=12cm");
//查询命令单独弹出一个模态对话框,并提交,和其它命令是不同的
//因此,表单中的活动名称也可以不用赋值的
}
//Click事件,当点击“删除”图片时触发该函数
function deleteClick()
{
//下面增加相应的代码
alert("delete click");
}
//显示div,第一个参数为一个div的引用,第二个参数为是否显示,如果为"true"则显示,否则不显示
function showDiv(cDiv,cShow)
{
if (cShow=="true")
{
cDiv.style.display="";
}
else
{
cDiv.style.display="none";
}
}
//显示frmSubmit框架,用来调试
function showSubmitFrame(cDebug)
{
if(cDebug=="1")
{
parent.fraMain.rows = "0,0,50,82,*";
}
else {
parent.fraMain.rows = "0,0,0,82,*";
}
}
function returnParent()
{
var arrReturn = new Array();
var tSel = ComGrid.getSelNo();
if( tSel == 0 || tSel == null )
top.close();
//i18nAlert("请先选择一条记录,再点击返回按钮。", "LIS-01302");
else
{
try
{
//alert(tSel);
arrReturn = getQueryResult(tSel);
top.opener.afterQuery( arrReturn );
}
catch(ex)
{
i18nAlert("没有发现父窗口的afterQuery接口。{0}", "LIS-01303", ex);
}
top.close();
}
}
function returnParent1()
{
var arrReturn = new Array();
var tSel = ComGrid.getSelNo();
if( tSel == 0 || tSel == null ){
top.close();
}
else
{
try
{
arrReturn = ComGrid.getRowColData(tSel -1 , 1)
top.opener.afterQuery1( arrReturn );
}
catch(ex)
{
i18nAlert("没有发现父窗口的afterQuery接口。{0}", "LIS-01303", ex);
}
top.close();
}
}
function getQueryResult(tSel) {
var arrSelected = null;
tRow =tSel;
if( tRow == 0 || tRow == null ){
return arrSelected;
}
arrSelected = new Array();
var strSQL = "";
var sqlid1="ComQuerySql1";
var mySql1=new SqlClass();
mySql1.setModule("systemmanage");
mySql1.setResourceName("sys.ComQuerySql");
mySql1.setSqlId(sqlid1); //指定使用SQL的id
mySql1.addSubPara(ComGrid.getRowColData(tRow-1,1));//指定传入参数
strSQL = mySql1.getString();
turnPage.strQueryResult = easyQueryVer3(strSQL, 1, 0, 1);
//判断是否查询成功
if (!turnPage.strQueryResult) {
i18nAlert("查询失败!", "LIS-01301");
return false;
}
//查询成功则拆分字符串,返回二维数组
arrSelected = decodeEasyQueryResult(turnPage.strQueryResult);
return arrSelected;
}
// 查询按钮
function easyQueryClick()
{
// 初始化表格
initComGrid();
// 书写SQL语句
var strSQL = "";
var sqlid2="ComQuerySql2";
var mySql2=new SqlClass();
mySql2.setModule("systemmanage");
mySql2.setResourceName("sys.ComQuerySql");
mySql2.setSqlId(sqlid2); //指定使用SQL的id
mySql2.addSubPara(window.document.getElementsByName(trim("ComCode"))[0].value);//指定传入参数
mySql2.addSubPara(window.document.getElementsByName(trim("OutComCode"))[0].value);
//判断是否查询成功
turnPage.queryModal(mySql2.getString(), ComGrid);
}
// 查询按钮
function easyQueryClick1()
{
// 初始化表格
initComGrid();
// 书写SQL语句
var strSQL = "";
var sqlid2="ComQuerySql2";
var mySql2=new SqlClass();
mySql2.setModule("systemmanage");
mySql2.setResourceName("sys.ComQuerySql");
mySql2.setSqlId(sqlid2); //指定使用SQL的id
mySql2.addSubPara(window.document.getElementsByName(trim("ComCode"))[0].value);//指定传入参数
//判断是否查询成功
turnPage.queryModal(mySql2.getString(), ComGrid);
}