/* \u6587\u4EF6\u540D\uFF1AJSTools * \u8BF4 \u660E\uFF1A\u8868\u5355\u9875\u9762\u4E2D\u6309\u94AE\u4F7F\u7528\u7684\u901A\u7528\u51FD\u6570 * \u7F16\u5199\u4EBA\uFF1Axqw * \u65E5 \u671F\uFF1A2003-7-9 */ /* -----------------\u5168\u5C40\u53D8\u91CF-------------------- * \u53D8\u91CF sDlgDbName \u5F39\u51FA\u5BF9\u8BDD\u6846\u8868\u5355\u8D44\u6E90\u7684\u6570\u636E\u5E93\u3002 */ var sDlgDbName = "/TJ_Map.nsf/"; //------------------\u63D0\u4EA4\u65F6\u4F7F\u7528\u7684\u51FD\u6570--------------------------- //function isCompelete(){ //return true; //} String.prototype.trim = function(){ return this.replace(/(^\s*)|(\s*$)/gi,""); } //+---------------------------------------------------------------------------- // \u7C7B\u6784\u9020\uFF1AcDialog // \u8BF4 \u660E\uFF1A\u5B8C\u6210\u6240\u6709\u5728\u8868\u5355\u4E2D\u5BF9\u8BDD\u6846\u7684\u7C7B\u578B\uFF0C\u5305\u62EC\u4EBA\u5458\u90E8\u95E8\u9009\u62E9\uFF0C\u589E\u52A0\uFF0C\u9009\u62E9\u5BF9\u8BDD\u6846\u7B49 // \u53C2 \u6570\uFF1AsType \u2014\u2014 \u5BF9\u8BDD\u6846\u7684\u7C7B\u578B //----------------------------------------------------------------------------- function cDialog(sType){ this.sFeature = ''; this.hSrcField = null; this.hDestField = null; this.hType = sType; if(sType == 'Department'){ this.iWidth = 365 ; this.iHeight = 370 ; this.sUrl = sDlgDbName + 'DlgSelectDepartment?OpenForm' ; this.isDestInput = true } else if(sType == 'Person'){ this.iWidth = 365 ; this.iHeight = 370 ; this.sUrl = sDlgDbName + 'DlgSelectPerson?OpenForm' ; this.isDestInput = true ; } else if(sType == 'DptPsnMulti'){ this.iWidth = 365 ; this.iHeight = 370 ; this.sUrl = sDlgDbName + 'DlgDptPsnMulti?OpenForm' this.isDestInput = true } else if(sType == 'AddEdit'){ this.iWidth = 365 ; this.iHeight = 200 ; this.sUrl = sDlgDbName + 'DlgAddEditElements?OpenForm' this.isDestInput = true } else if(sType == 'Modify'){ this.iWidth = 365 ; this.iHeight = 200 ; this.sUrl = sDlgDbName + 'DlgModifyElements?OpenForm' this.isDestInput = true } else if(sType == 'SelOne'){ this.iWidth = 480 ; this.iHeight = 400 ; this.sUrl = sDlgDbName + 'DlgSelectOneElement?OpenForm' this.isDestInput = true } else if(sType == 'SelMul'){ this.iWidth = 500 ; this.iHeight = 480 ; this.sUrl = sDlgDbName + 'DlgSelectMultiElement?OpenForm' this.isDestInput = true } else if(sType == 'SelectMulPerson'){ this.iWidth = 430 ; this.iHeight = 300 ; this.sUrl = sDlgDbName + 'DlgSelectMulPerson?OpenForm' this.isDestInput = true }else if(sType == 'SelectMulPer'){ this.iWidth = 365; this.iHeight = 250; this.sUrl = sDlgDbName + 'DlgSelectMultiPerson?OpenForm' } else if(sType == 'Date'){ //this.iWidth = 230 ; //this.iHeight = 200 ; this.iWidth = 360 ; this.iHeight = 340 ; this.sUrl = sDlgDbName + 'DlgCalendar?OpenForm' this.isDestInput = true } else if(sType == 'Activity'){ this.iWidth = 365 ; this.iHeight = 270 ; this.sUrl = sDlgDbName + 'DlgSelectMulti?OpenForm' this.isDestInput = true } else if(sType == 'ActSource'){ this.iWidth = 365 ; this.iHeight = 270 ; this.sUrl = sDlgDbName + 'DlgSelectMulti?OpenForm' this.isDestInput = true } else if(sType == 'Comment'){ this.iWidth = 490 ; this.iHeight = 370 ; this.sUrl = sDlgDbName + 'DlgSelectComment?OpenForm' this.isDestInput = true } else if(sType == 'AlertComment'){ this.iWidth = 365 ; this.iHeight = 270 ; this.sUrl = sDlgDbName + 'DlgAlertComment?OpenForm' this.isDestInput = true } else if(sType == 'Formula'){ this.iWidth = 520 ; this.iHeight = 550 ; this.sUrl = sDlgDbName + 'DlgFormulaList?OpenForm' this.isDestInput = true } else if(sType == 'RoleRelation'){ this.iWidth = 365 ; this.iHeight = 270 ; this.sUrl = sDlgDbName + 'DlgRoleRelation?OpenForm' this.isDestInput = true } else if(sType == 'ProcessType'){ this.iWidth = 365 ; this.iHeight = 270 ; this.sUrl = sDlgDbName + 'DlgProcessType?OpenForm' this.isDestInput = true } else if(sType == 'ActivityResource'){ this.iWidth = 365 ; this.iHeight = 270 ; this.sUrl = sDlgDbName + 'DlgActivityResource?OpenForm' this.isDestInput = true } else { this.iWidth = 0 ; this.iHeight = 0 ; this.sUrl = ''; this.isDestInput = true } } //+---------------------------------------------------------------------------- // \u51FD \u6570\uFF1A show // \u8BF4 \u660E\uFF1A // \u53C2 \u6570\uFF1A none // \u8FD4 \u56DE \u503C\uFF1A nothing //----------------------------------------------------------------------------- cDialog.prototype.show = function(){ var hParamObj = new Array(); if(this.hDestField != null){ hParamObj[0] = this.hDestField; if(this.hSrcField != null){ hParamObj[1] = this.hSrcField; } this.sFeature = "dialogHeight:"+this.iHeight+"px;dialogWidth:"+this.iWidth+"px;help:no;status:no;scroll:no"; if(this.hType!=null&&this.hType=='Comment'){ this.sFeature = "dialogHeight:"+this.iHeight+"px;dialogWidth:"+this.iWidth+"px;help:no;status:no;hscroll:no;vscroll:yes"; } return window.showModalDialog(this.sUrl,hParamObj,this.sFeature); } else { alert("\u76EE\u6807\u4F20\u9012\u57DF\u4E0D\u5B58\u5728\uFF01"); return false; } } cDialog.prototype.showPerson = function(){ var hParamObj = new Array(); var urlstr=""; if(this.hDestField != null){ hParamObj[0] = this.hDestField; if(this.hSrcField != null){ urlstr=this.sUrl+"&PARAM="+this.hSrcField.value; } this.sFeature = "dialogHeight:"+this.iHeight+"px;dialogWidth:"+this.iWidth+"px;help:no;status:no;scroll:no"; return window.showModalDialog(urlstr,hParamObj,this.sFeature); } else { alert("\u76EE\u6807\u4F20\u9012\u57DF\u4E0D\u5B58\u5728\uFF01"); return false; } } //+---------------------------------------------------------------------------- // \u51FD \u6570\uFF1A setSrcField // \u8BF4 \u660E\uFF1A // \u53C2 \u6570\uFF1A fieldName\u2014\u2014\u57DF\u540D\u79F0 // \u8FD4 \u56DE \u503C\uFF1A nothing //----------------------------------------------------------------------------- cDialog.prototype.setSrcField = function(fieldName){ var hField = document.all(fieldName); if(hField != null){ this.hSrcField = hField; } } //+---------------------------------------------------------------------------- // \u51FD \u6570\uFF1A setDestField // \u8BF4 \u660E\uFF1A // \u53C2 \u6570\uFF1A fieldName\u2014\u2014\u57DF\u540D\u79F0 // \u8FD4 \u56DE \u503C\uFF1A nothing //----------------------------------------------------------------------------- cDialog.prototype.setDestField = function(fieldName){ var hField = document.all(fieldName); if(hField != null){ this.hDestField = hField; } } //+---------------------------------------------------------------------------- // \u51FD \u6570\uFF1A onClickRemove // \u8BF4 \u660E\uFF1A // \u53C2 \u6570\uFF1A none // \u8FD4 \u56DE \u503C\uFF1A nothing //----------------------------------------------------------------------------- cDialog.prototype.onClickRemove = function(){ var list = this.hDestField; if(list.length != 0){ if(list.selectedIndex != -1){ for(var i = list.length-1;i >= 0;i--){ if(list.options[i].selected){ list.options[i] = null; } } } } } //+---------------------------------------------------------------------------- // \u51FD \u6570\uFF1A onClickMove // \u8BF4 \u660E\uFF1A // \u53C2 \u6570\uFF1A step\u2014\u2014 // \u8FD4 \u56DE \u503C\uFF1A nothing //----------------------------------------------------------------------------- cDialog.prototype.onClickMove = function(step){ var list = this.hDestField; var tempup,curtemp,selectnum; if(list.selectedIndex == -1) alert("\u8BF7\u9009\u62E9\u4E00\u4E2A\u8981\u79FB\u52A8\u7684\u9879\u76EE\uFF01"); else{ if(step < 0 && list.selectedIndex == 0) alert("\u8FD9\u4E2A\u9879\u76EE\u5DF2\u7ECF\u5728\u6700\u4E0A\u9762\uFF0C\u4E0D\u80FD\u79FB\u52A8\uFF01"); else{ if(step>0 && list.selectedIndex == list.length-1) alert("\u8FD9\u4E2A\u9879\u76EE\u5DF2\u7ECF\u5728\u6700\u4E0B\u9762\uFF0C\u4E0D\u80FD\u79FB\u52A8\uFF01"); else{ if(list.selectedIndex+step<0 && list.selectedIndex+step>list.length-1) alert("\u8FD9\u4E2A\u9879\u76EE\u79FB\u52A8\u8D85\u51FA\u8303\u56F4"); else{ temp = list.options[list.selectedIndex+step].value; curtemp = list.options[list.selectedIndex].value; selectnum = list.selectedIndex; list.options[selectnum+step] = new Option(curtemp,curtemp); list.options[selectnum] = new Option(temp,temp); list.options[selectnum+step].selected = true; } } } } } cDialog.prototype.gotoOnAir = function(sDisplayString){ //ADD BY TXB 20090601 //\u4E3A\u4E86\u628A\u8868\u5355\u7684\u4E0B\u62C9\u6846\u4E5F\u5728\u8FC7\u6E21\u9875\u9762\u91CC\u9690\u85CF var SelectTag=document.getElementsByTagName("select"); if(SelectTag.length>0) { for(var i=0;i"); var sHTML = "



"; sHTML += "" + sDisplayString + "" var iWidth = document.body.clientWidth; var iHeight = document.body.clientHeight; with(hPageDiv){ style.position = "absolute"; style.backgroundColor = "#FFFFFF"; style.top = 0; style.left = 0; style.width = iWidth; style.height = iHeight; style.zIndex = 5; innerHTML = sHTML; } document.body.insertBefore(hPageDiv); } //-------------------------------------\u58F0\u660E\u7C7B\u4F7F\u7528\u7684\u5168\u5C40\u53D8\u91CF----------------------------------------------- var hPerson = new cDialog('Person'); var hDepartment = new cDialog('Department'); var hDptPsnMul = new cDialog('DptPsnMulti') var hAddEdit = new cDialog('AddEdit'); var hModify = new cDialog('Modify'); var hSelectOne = new cDialog('SelOne'); var hSelectMul = new cDialog('SelMul'); var hDate = new cDialog('Date'); var hComment = new cDialog('Comment'); var hFormula = new cDialog('Formula'); var hRole = new cDialog('RoleRelation'); var hDialog = new cDialog(); //add by lzj 2006-10-25 var hSelectPer = new cDialog("SelectMulPer"); //add by txb 2008-12-09 var hSelectMulPerson = new cDialog("SelectMulPerson"); //+---------------------------------------------------------------------------- // \u51FD\u6570\uFF1AoutCheck // \u8BF4 \u660E\uFF1A\u68C0\u6D4B\u5916\u51FA\u4EBA\u5458 // \u53C2 \u6570\uFF1AobjStr \u2014\u2014 \u8981\u68C0\u6D4B\u7684\u4EBA\u5458\u5B57\u7B26\u4E32\uFF08\u7528\uFF0C\u5206\u5F00\u7684\u5B57\u7B26\u4E32\uFF09 // \u8FD4\u56DE\u503C\uFF1A\u5916\u51FA\u4EBA\u5458\u6E05\u5355\u5BF9\u8BDD\u6846 // \u7F16\u5199\u4EBA\uFF1A\u9648\u5FB7\u660E //----------------------------------------------------------------------------- function outCheck(objStr) { var form = document.forms[0]; if(objStr != ""){ obj = document.all(objStr); if(obj.value!=""){ //alert(form.SendTo.value); //window.open("/TJ_OutReg.nsf/PrintOutManList?openAgent&checkStr="+form.SendTo.value,"\u5916\u51FA\u4EBA\u5458\u5217\u8868",width=20,height=100,"_blank"); var url = "/TJ_OutReg.nsf/PrintOutManList?openAgent&checkStr="+obj.value; feature = "dialogHeight:350px;dialogWidth:200px;help:no;status:no;scroll:yes"; var win=window.showModalDialog(url,"",feature); }else{ alert("\u8981\u68C0\u6D4B\u7684\u4EBA\u5458\u5217\u8868\u4E3A\u7A7A\uFF01"); obj.focus(); } }else{ alert("\u53C2\u6570\u4F20\u9001\u4E0D\u6B63\u786E") } } //+---------------------------------------------------------------------------- // \u51FD\u6570\uFF1AstrToDate // \u8BF4 \u660E\uFF1A\u8BE5\u51FD\u6570\u5C06\u65E5\u671F\u5B57\u7B26\u4E32\u8F6C\u6362\u4E3A\u65E5\u671F\u5BF9\u8C61\u503C // \u4F5C \u7528\uFF1A\u53EF\u4EE5\u5728WEB\u9875\u9762\u4E0A\u68C0\u6D4B\u65E5\u671F\u503C\u662F\u5426\u6709\u6548\u4EE5\u53CA\u53EF\u4EE5\u6267\u884C\u65E5\u671F\u7684\u6BD4\u8F83\u7B49\u529F\u80FD // \u53C2 \u6570\uFF1AstrDate,\u5B57\u7B26\u4E32\u7684\u683C\u5F0F\u5FC5\u987B\u7B26\u5408\u683C\u5F0F\uFF1A2003-07-13 17:23 \u30012003-07-13\u30012003-7-3 // \u8FD4\u56DE\u503C\uFF1A\u65E5\u671F // \u7F16\u5199\u4EBA\uFF1A\u9648\u5FB7\u660E //----------------------------------------------------------------------------- function strToDate(strDate) { var strTmp=strDate; var returnDate=new Date(); //\u8BBE\u7F6E\u65E5\u671F\u7684\u5E74\u4EFD var posTmp=strTmp.indexOf("-"); if( isNaN( parseInt(strTmp.substring(0,posTmp)) ) ){ return false; }else{ var dateYear=parseInt(strTmp.substring(0,posTmp)); } if( ( dateYear>3000 )|( dateYear<1880 ) ){ return false; } returnDate.setYear(dateYear); //\u68C0\u67E5\u5E74\u4EFD\u5B57\u7B26\u4E32\u662F\u5426\u6B63\u786E\u53D6\u51FA //alert( strTmp.substring(0,posTmp) ); //\u5B57\u7B26\u4E32\u4E2D\u6E05\u9664\u6389\u5E74\u4EFD\u540E\u7684\u5B57\u7B26\u4E32\uFF0C\u5982 07-13 17:23 strTmp=strTmp.substring(posTmp+1,strTmp.length); //\u8BBE\u7F6E\u65E5\u671F\u7684\u6708\u4EFD posTmp=strTmp.indexOf("-"); var dateMonth = 1; if( isNaN( parseInt(strTmp.substring(0,posTmp)) ) ){ return false; }else{ //\u5904\u7406\u6708\u4EFD\u5B57\u7B26\u4E32\u8F6C\u6362\u6574\u6570\u7684\u7279\u6B8A\u60C5\u51B5\uFF0C\u598209\uFF0C\u8F6C\u6362\u6574\u6570\uFF1D0\uFF0C\u6240\u4EE5\u7279\u6B8A\u5904\u7406\uFF0C\u5982\u679C\u957F\u5EA6\u7B49\u4E8E2\u5E76\u4E14\u7B2C\u4E00\u4E2A\u5B57\u7B26\u4E32\u4E3A0\uFF0C\u5219\u53D6\u540E\u4E00\u4F4D\u3002 if( (posTmp==2)&&( strTmp.substring(0,1)=="0") ){ dateMonth=parseInt( strTmp.substring(1,posTmp) ); }else{ dateMonth=parseInt( strTmp.substring(0,posTmp) ); } //var dateMonth=parseInt(strTmp.substring(0,posTmp)); //alert(dateMonth+"\u6708\u4EFD"); } if( (dateMonth>12)|(dateMonth<1)){ return false; } returnDate.setMonth(dateMonth-1); //\u68C0\u67E5\u6708\u4EFD\u5B57\u7B26\u4E32\u662F\u5426\u6B63\u786E\u53D6\u51FA //alert( strTmp.substring(posTmp-2,posTmp) ); //\u5B57\u7B26\u4E32\u4E2D\u6E05\u9664\u6389\u5E74\u4EFD\u3001\u6708\u4EFD\u540E\u7684\u5B57\u7B26\u4E32\uFF0C\u5982 13 17:23 strTmp=strTmp.substring(posTmp+1,strTmp.length); //\u8BBE\u7F6E\u65E5\u671F\u7684\u5929\u6570 posTmp=strTmp.indexOf(" "); if(posTmp==-1){ posTmp=strTmp.length; } if( isNaN( parseInt(strTmp.substring(0,posTmp)) ) ) { return false; }else{ //\u5904\u7406\u5929\u6570\u5B57\u7B26\u4E32\u8F6C\u6362\u6574\u6570\u7684\u7279\u6B8A\u60C5\u51B5\uFF0C\u598209\uFF0C\u8F6C\u6362\u6574\u6570\uFF1D0\uFF0C\u6240\u4EE5\u7279\u6B8A\u5904\u7406\uFF0C\u5982\u679C\u957F\u5EA6\u7B49\u4E8E2\u5E76\u4E14\u7B2C\u4E00\u4E2A\u5B57\u7B26\u4E32\u4E3A0\uFF0C\u5219\u53D6\u540E\u4E00\u4F4D\u3002 if( (posTmp==2)&&( strTmp.substring(0,1)=="0") ){ var dateDay=parseInt( strTmp.substring(1,posTmp) ); }else{ var dateDay=parseInt( strTmp.substring(0,posTmp) ); } //var dateDay=parseInt(strTmp.substring(0,posTmp)); //alert(dateDay+"\u5929"); //alert(strTmp.substring(0,posTmp)); } if( (dateDay>31)|(dateDay<1)){ return false; } returnDate.setDate(dateDay); //\u68C0\u67E5\u5929\u6570\u5B57\u7B26\u4E32\u662F\u5426\u6B63\u786E\u53D6\u51FA //alert( strTmp.substring(0,2) ); //\u5B57\u7B26\u4E32\u4E2D\u6E05\u9664\u6389\u5E74\u4EFD\u3001\u6708\u4EFD\u3001\u5929\u6570\u540E\u7684\u5B57\u7B26\u4E32\uFF0C\u5982 17:23 strTmp=strTmp.substring(posTmp+1,strTmp.length); //\u8BBE\u7F6E\u65E5\u671F\u7684\u5C0F\u65F6 posTmp=strTmp.indexOf(":"); if(posTmp==-1){ //\u5982\u679C\u8BE5\u5B57\u7B26\u4E32\u662F\u53EA\u6709\u65E5\u671F\u90E8\u5206\uFF0C\u5219\u65F6\u95F4\u90E8\u5206\u4E3A\u7A7A\uFF0C\u7A7A\u65F6\uFF0C\u8FD4\u56DE\u65E5\u671F\uFF0C\u4E0D\u7A7A\u65F6\u5219\u65E5\u671F\u6709\u9519\u3002 if(strTmp.length==0){ return returnDate; }else{ return false; } }else{ if( isNaN( parseInt(strTmp.substring(0,posTmp)) ) ){ return false; }else{ //\u5904\u7406\u5C0F\u65F6\u5B57\u7B26\u4E32\u8F6C\u6362\u6574\u6570\u7684\u7279\u6B8A\u60C5\u51B5\uFF0C\u598209\uFF0C\u8F6C\u6362\u6574\u6570\uFF1D0\uFF0C\u6240\u4EE5\u7279\u6B8A\u5904\u7406\uFF0C\u5982\u679C\u957F\u5EA6\u7B49\u4E8E2\u5E76\u4E14\u7B2C\u4E00\u4E2A\u5B57\u7B26\u4E32\u4E3A0\uFF0C\u5219\u53D6\u540E\u4E00\u4F4D\u3002 if( (posTmp==2)&&( strTmp.substring(0,1)=="0") ){ var dateHours=parseInt( strTmp.substring(1,posTmp) ); }else{ var dateHours=parseInt( strTmp.substring(0,posTmp) ); } //alert(posTmp+"\u4F4D\u7F6E"); //alert( strTmp.substring(0,posTmp) ); //alert(strTmp.length+"\u957F\u5EA6"); //alert(dateHours+"\u5C0F\u65F6"); } if( (dateHours>24)|(dateHours<0)){ return false; } returnDate.setHours(dateHours); //\u68C0\u67E5\u5C0F\u65F6\u5B57\u7B26\u4E32\u662F\u5426\u6B63\u786E\u53D6\u51FA //alert( strTmp.substring(0,posTmp) ); //\u5B57\u7B26\u4E32\u4E2D\u6E05\u9664\u6389\u5E74\u4EFD\u3001\u6708\u4EFD\u3001\u5929\u6570\u3001\u5C0F\u65F6\u540E\u7684\u5B57\u7B26\u4E32\uFF0C\u5982 23 strTmp=strTmp.substring(posTmp+1,strTmp.length); //\u8BBE\u7F6E\u65E5\u671F\u7684\u5206\u949F if( isNaN(parseInt(strTmp)) ){ return false; }else{ posTmp=strTmp.length; //alert(posTmp); //\u5904\u7406\u5206\u949F\u5B57\u7B26\u4E32\u8F6C\u6362\u6574\u6570\u7684\u7279\u6B8A\u60C5\u51B5\uFF0C\u598209\uFF0C\u8F6C\u6362\u6574\u6570\uFF1D0\uFF0C\u6240\u4EE5\u7279\u6B8A\u5904\u7406\uFF0C\u5982\u679C\u957F\u5EA6\u7B49\u4E8E2\u5E76\u4E14\u7B2C\u4E00\u4E2A\u5B57\u7B26\u4E32\u4E3A0\uFF0C\u5219\u53D6\u540E\u4E00\u4F4D\u3002 if( (posTmp==2)&&( strTmp.substring(0,1)=="0") ){ var dateMin=parseInt( strTmp.substring(1,2) ); }else{ var dateMin=parseInt( strTmp ); } //var dateMin=parseInt(strTmp); //alert(dateMin+"\u5206\u949F"); } if( (dateMin>60)|(dateMin<0) ){ return false; } //alert(parseInt(strTmp)); returnDate.setMinutes(dateMin); return returnDate; } }