// 该文件中包含客户端需要处理的函数和事件 var showInfo; window.onfocus=myonfocus; function myonfocus() { if(showInfo!=null) { try { showInfo.focus(); } catch(ex) { showInfo=null; } } } //提交,保存按钮对应操作 function submitForm() { if(verifyInput()==false || CertifyList.checkValue("CertifyList")==false){ return false; } CertifyList.delBlankLine("CertifyList"); var nmulLineCount = CertifyList.mulLineCount; if (nmulLineCount == null || nmulLineCount <= 0) { i18nAlert("请至少输入一个要发放的单证! ", "LIS-05830"); return false; } //已做过增领申请的单证给予提示 var ReceiveCom = fm.ReceiveCom.value; for(var i=1; i<=nmulLineCount; i++){ var certifyCode = CertifyList.getRowColData(i-1,1); //var strSql = "select StateFlag from lzcardapp a where OperateFlag='1' and a.certifycode='"+certifyCode+"' and a.receivecom='"+ReceiveCom+"'"; var strSql = wrapSql("certify.CertifyDestroyConfirmInputSql","querysqldes3",[certifyCode,ReceiveCom],"certification"); var arrResult = easyExecSql(strSql); if(arrResult!=null && arrResult[0][0]=='1'){ //1-申请待批复 if(!i18nConfirm("单证{0}已做过增领申请且处于待批复状态,是否继续申请?", "LIS-01099", certifyCode)) return false; } } if (i18nConfirm("您确认增领申请操作吗?", "LIS-01100")){ try { 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.getElementById("fm").submit(); //提交 fm.action = "../API/certification/certify/CertifySendOutApplySave/ADD"; ajaxSubmit2(document.getElementById("fm")); } catch(ex) { showInfo.close( ); alert(ex); } }else{ i18nAlert("您取消了增领申请操作!", "LIS-05831"); } } //提交后操作,服务器数据返回后执行的操作 function afterSubmit( FlagStr, content, TakeBackNo ) { showInfo.close(); fm.btnOp.disabled = false; 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 { content=i18nMessage("保存成功!", "LIS-04531"); 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(); } } //提交前的校验、计算 function beforeSubmit() { //添加操作 } function afterCodeSelect( cName, Filed) { if(cName=='DepartmentNo')//选择部门编码后 { if(fm.Department.value==null || fm.Department.value==""){ i18nAlert("请选择【部门来源】", "LIS-05667"); }else if(fm.Department.value=="1"){ fm.SendOutCom.value ="B" + fm.ComCode.value + fm.DepartmentNo.value fm.SendOutCom.readOnly = true; fm.ReceiveCom.value = ""; fm.ReceiveCom.readOnly = false; }else if(fm.Department.value=="2"){ fm.ReceiveCom.value ="B" + fm.ComCode.value + fm.DepartmentNo.value fm.ReceiveCom.readOnly = true; fm.SendOutCom.value = ""; fm.SendOutCom.readOnly = false; }else{ i18nAlert("选择【部门编码】有误", "LIS-05668"); fm.DepartmentNo.value=""; } } if(cName=='Department')//选择部门后 { if(fm.DepartmentNo.value!=null && fm.DepartmentNo.value!=""){ if(fm.Department.value=="1"){ fm.SendOutCom.value ="B" + fm.ComCode.value + fm.DepartmentNo.value fm.SendOutCom.readOnly = true; fm.ReceiveCom.value = ""; fm.ReceiveCom.readOnly = false; }else if(fm.Department.value=="2"){ fm.ReceiveCom.value ="B" + fm.ComCode.value + fm.DepartmentNo.value fm.ReceiveCom.readOnly = true; fm.SendOutCom.value = ""; fm.SendOutCom.readOnly = false; }else if(fm.Department.value=="3"){ fm.DepartmentNo.value = ""; fm.DepartmentNoName.value = ""; fm.SendOutCom.value = ""; fm.SendOutCom.readOnly = false; fm.ReceiveCom.value = ""; fm.ReceiveCom.readOnly = false; } } } if(cName=='CertifyCode')//选择单证编码后,自动查询发放者和接收者的库存并显示 { var SendOutCom = fm.SendOutCom.value; var ReceiveCom = fm.ReceiveCom.value; if(SendOutCom=="" || ReceiveCom==""){ i18nAlert("请先录入【发放者】和【接收者】后再选择单证代码!", "LIS-05669"); return false; } for(var i=0;i= 11) { var cAgentCode = receivecom.substring(1,11); //var strSql = "select AgentCode,Name from LAAgent where AgentCode='" + cAgentCode +"'"; var strSql = wrapSql("querysqldes4",[cAgentCode],"certification"); var arrResult = easyExecSql(strSql); if (arrResult != null) i18nAlert("查询结果: 代理人编码:[{0}] 代理人名称为:[{1}]", "LIS-00566", arrResult[0][0], arrResult[0][1]); else i18nAlert("编码为:[{0}]的代理人不存在,请确认!", "LIS-00576", cAgentCode); } } } /** mysql工厂,根据传入参数生成Sql字符串 sqlId:页面中某条sql的唯一标识 param:数组类型,sql中where条件里面的参数 **/ // function wrapSql(sqlId,param) // { // alert("b"); // var mysql=new SqlClass(); // mySql.setModule("certification"); // mysql.setResourceName("certify.CertifySendOutApplyInputSql"); // mysql.setSqlId(sqlId); // // for(i=0;i