公
告
:
javascript oa 判断申请人是否与集团内同事重名(取字符串中特定字符串)
作者:confusion 日期:2010-05-28
程序代码//Select 判断是否存在此人
var s1 = "69";
var s2 = "73";
function Selectproper() //(关键域值,编号文档所在视图,目标域值,子表单文件名)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var u_name = '&name='+document.all.fldUser1.value;
var url = "http://oa.china-chigo.com/chigo/bluepage.nsf/agtManageMap?openagent"+u_name;
xmlHttp.open("post", url, false);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//xmlHttp.onreadystatechange = updatePage9;
xmlHttp.send(u_name);
var response = xmlHttp.responseText;
response = response.substring(response.indexOf("<body>")+6,response.indexOf("</body>"));
//response = response.substring(response.indexOf("<myreturn>")+10,response.indexOf("</myreturn>"));
respnse = response.replace(/\r\n/g,"");
//document.all.fldsapv4.value = response;
//alert(response);
document.all.fldsap4.value = response;
SubstringDemo(s1,s2);
//alert(SubstringDemo(s1,s2));
document.all.fldsap5.value = SubstringDemo(s1,s2);
if (document.all.fldsap5.value!="查无此人"){
alert("集团内已经有和申请人相同名字的同事,请查询公司通讯录,确实申请人是否为此人!");
}
}
function SubstringDemo(s1,s2)
{
var ss; // 声明变量。
var s = document.all.fldsap4.value;
ss = s.slice(s1,s2); // 取子字符串。
return(ss); // 返回子字符串。
}
var s1 = "69";
var s2 = "73";
function Selectproper() //(关键域值,编号文档所在视图,目标域值,子表单文件名)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var u_name = '&name='+document.all.fldUser1.value;
var url = "http://oa.china-chigo.com/chigo/bluepage.nsf/agtManageMap?openagent"+u_name;
xmlHttp.open("post", url, false);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//xmlHttp.onreadystatechange = updatePage9;
xmlHttp.send(u_name);
var response = xmlHttp.responseText;
response = response.substring(response.indexOf("<body>")+6,response.indexOf("</body>"));
//response = response.substring(response.indexOf("<myreturn>")+10,response.indexOf("</myreturn>"));
respnse = response.replace(/\r\n/g,"");
//document.all.fldsapv4.value = response;
//alert(response);
document.all.fldsap4.value = response;
SubstringDemo(s1,s2);
//alert(SubstringDemo(s1,s2));
document.all.fldsap5.value = SubstringDemo(s1,s2);
if (document.all.fldsap5.value!="查无此人"){
alert("集团内已经有和申请人相同名字的同事,请查询公司通讯录,确实申请人是否为此人!");
}
}
function SubstringDemo(s1,s2)
{
var ss; // 声明变量。
var s = document.all.fldsap4.value;
ss = s.slice(s1,s2); // 取子字符串。
return(ss); // 返回子字符串。
}
e.options[0].selected = 'selected'
如上经过运行1个月来,发现不少问题。继续做优化:
程序代码xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var u_name = '&name='+document.all.fldUser1.value;
var url = "http://oa.china-chigo.com/chigo/bluepage.nsf/agtManageMap?openagent"+u_name;
xmlHttp.open("post", url, false);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(u_name);
var response = xmlHttp.responseText;
var s = response;
var s1 = "查无此人" ;
var s2 = document.all.fldUser1.value + "/chigo";
var s3 = s.indexOf(s1);
var s4 = s.indexOf(s2);
if (s3 == -1&&s4 != -1){
if (confirm("集团内已经有和申请人相同名字的同事,请查询公司通讯录,确定是否为同一人!")){
}
else{
return false;
}
}
var u_name = '&name='+document.all.fldUser1.value;
var url = "http://oa.china-chigo.com/chigo/bluepage.nsf/agtManageMap?openagent"+u_name;
xmlHttp.open("post", url, false);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(u_name);
var response = xmlHttp.responseText;
var s = response;
var s1 = "查无此人" ;
var s2 = document.all.fldUser1.value + "/chigo";
var s3 = s.indexOf(s1);
var s4 = s.indexOf(s2);
if (s3 == -1&&s4 != -1){
if (confirm("集团内已经有和申请人相同名字的同事,请查询公司通讯录,确定是否为同一人!")){
}
else{
return false;
}
}
评论: 0 | 引用: 0 | 查看次数: 142
发表评论
上一篇
下一篇


文章来自:
Tags: