⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newdeal.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")

if request("id")<>"" then
	objcheck.CheckUserFunction "deal","edit"
else
	objcheck.CheckUserFunction "deal","add"
end if
set objcheck=nothing

if request("id")<>"" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from deal where dealid="&request("id"),connq,2,3,1
	strdeal=rsq("deal")
	straccount=rsq("accountid")
	straccountname=getfieldvalue("account","accountid",rsq("accountid"),"account")
	strstatus=rsq("status")
	strContact=rsq("Contactid")
	strcontactname=getfieldvalue("contact","contactid",rsq("contactid"),"contact")
	strcurrencycode=rsq("CurrencyCode")
	strClosedDate=rsq("ClosedDate")
	stropendate=rsq("opendate")
	strOwner=rsq("Owner")
	strOwnername=getfieldvalue("usertable","loginid",rsq("owner"),"username")
	strTotalAmount=rsq("TotalAmount")
	strdescription=rsq("description")
	strdealsource=rsq("dealsource")
	strdealprocess=rsq("dealprocessid")
	strdealstage=rsq("dealstage")	
	strdealstagename=getfieldvalue("UserDefine","id",rsq("dealstage"),"name")
	strdealrate=cint(rsq("dealrate"))
	strlostreason=rsq("lostreason")
	strsubject=rsq("subject")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
else
	strdeal="自动生成"
	strdealrate=10
	strcontact=-1
	straccount=-1
	strowner=session("loginid")
	strownername=session("username")
	stropendate=date()
	strClosedDate=date()+10
	if Request.QueryString("accountid")<>"" then
		straccount=Request.QueryString("accountid")
		straccountname=Request.QueryString("accountname")
	end if
	if Request.QueryString("Contactid")<>"" then
		strContact=Request.QueryString("Contactid")
		strcontactname=Request.QueryString("contactname")
	end if
end if

if request("subject")<>"" then
	Dim objdeal
	Set objdeal=Server.CreateObject("SmartSales.Deal")
	objdeal.SaveDeal
	set objdeal=nothing
%>
<script language=javascript>
	window.opener.location.reload();
	window.close();
</script>
<%
end if
%>
<HTML><HEAD><TITLE>销售机会</TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language=javascript src="../tools/newcalendar.js"></script>
<script language="javascript">
function save(){
	if (form1.subject.value==''){
		alert('请输入主题!');
		form1.subject.focus();
		return;
	}
	if (form1.accountname.value==''){
		alert('请选择客户!');
		form1.accountname.focus();
		return;
	}
	if (form1.dealsource.value=='-1'){
		alert('请选择销售机会来源!');
		form1.dealsource.focus();
		return;
	}	
	if (form1.DealProcess.value=='-1'){
		alert('请选择销售流程!');
		form1.DealProcess.focus();
		return;
	}	
	if (form1.dealstagename.value==''){
		alert('请选择销售机会阶段!');
		form1.dealstagename.focus();
		return;
	}
	if (form1.totalamount.value==''){
		alert('请输入标的金额!');
		form1.totalamount.focus();
		return;
	}
	if (isNaN(form1.totalamount.value)){
		alert('请输入数字!');
		form1.totalamount.focus();
		return;
	}
form1.submit();
}
 function selectdealstage()
{
	if(form1.DealProcess.value!=-1){
		opensubwinwithsearch('../deal/Selectdealstage.asp','form1','dealstage','dealrate',form1.DealProcess.value);
		}
	else{
		alert('请先选择销售流程!');
		}
}

function clearcontact(){
	form1.contact.value=-1;
	form1.contactname.value="";	
}
function setdealstage(){
	form1.dealstage.value="";
	form1.dealstagename.value="";	
	form1.dealrate.value="";
}
</script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript">
function window_onload()
{
window.moveTo(-2,-2);
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
<body bgcolor="#ffffff">
<form name=form1  method="post"  id=form1>
<table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="25"><strong><font size="2" class=title><b> 
      <%if request("id")="" then%>
      新建销售机会 
      <%else%>
      编辑销售机会 
      <%end if%>
      </b></font></strong></td>
  </tr>
  <tr > 
    <td height="16" background="../images/title.gif">&nbsp;</td>
  </tr>
  <tr> 
    <td height=4></td>
  </tr>
    <tr><td><div align="center" style="cursor:hand">
		<a onclick="save();"><img src="../images/button_save.gif"></a>&nbsp;&nbsp;&nbsp;&nbsp;
		<a onclick="window.close();"><img src="../images/button_cancel.gif"></a></DIV></td>
    </tr>
</table>
  
<table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
  <tr bgcolor="white"> 
    <td width="15%" bgcolor="DEDFDE">
<div align="center">销售机会编号</div></td>
    <td width="35%" bgcolor="EFEFEF" >
<%if request("id")<>"" then%>
		<input name=deal type=hidden value="<%=strdeal%>" size="20" readonly>
		   <font color="#ff0000">&nbsp;<%response.write strdeal%></font>
<%else%>
		<input name=deal type=text value="<%=strdeal%>" size="20" readonly>
<%end if%>
     </td>
    <td width="15%" bgcolor="DEDFDE">
<div align="center">所有者</div></td>
    <td bgcolor="EFEFEF"><input name="owner" type="hidden" size="8" value="<%=strowner%>"> 
      <input name="ownername" type="text" size="8" value="<%=strownername%>" readonly> 
      <input type="button" name="bnowner" onClick="JavaScript:opensubwin2('form1','owner')"    value=...  class=black> 
    </td>
  </tr>
  <tr bgcolor="white"> 
    <td width="15%" bgcolor="DEDFDE"> <div align="center"><font color="#FF0000">*&nbsp;</font>主题</div></td>
    <td width="35%" bgcolor="EFEFEF" >
<%if request("id")<>"" then%>
		<input name=subject type=hidden value="<%=strsubject%>" size="30">
		   <font color="#ff0000">&nbsp;<%response.write strsubject%></font>
<%else%>
		<input name=subject type=text value="<%=strsubject%>" size="30">
<%end if%>
    </td>
    <td width="15%" bgcolor="DEDFDE"><div align="center"></div></td>
    <td width="35%" bgcolor="EFEFEF">&nbsp; </td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center">开始日期</div></td>
    <td width="35%" bgcolor="EFEFEF"> 
                <input type="text" name="opendate" size="14" language=javascript id=dupdatetime1 value="<%=stropendate%>" readonly>
                <% call AddImg("date1") %>
                <input type = hidden name=clicksource>
                <input type = hidden name=clickresult >
    </td>
    <td width="15%" bgcolor="DEDFDE"> <div align="center">完成日期</div></td>
    <td width="35%" bgcolor="EFEFEF">
                <input type="text" name="ClosedDate" size="14" language=javascript id=dupdatetime2 value="<%=strClosedDate%>" readonly>
                <% call AddImg("date2") %>
                <input type = hidden name=clicksource>
                <input type = hidden name=clickresult >
	  </td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center"><font color="#FF0000">*&nbsp;</font>客户</div></td>
    <td bgcolor="EFEFEF" width="35%">
<input name="account" type="hidden" size="8" value="<%=straccount%>"> 
      <input name="accountname" type="text" size="25" value="<%=straccountname%>" readonly> 
      <input type="button" name="bnaccount" onClick="JavaScript:opensubwin2('form1','account')"    value=...  class=black></td>
    <td bgcolor="DEDFDE" width="15%"><div align="center">联系人</div></td>
    <td bgcolor="EFEFEF" width="35%"><input name="contact" type="hidden" size="8" value="<%=strcontact%>"> 
      <input name="contactname" type="text" size="8" value="<%=strcontactname%>" readonly> 
      <!--   <input type="button" name="bncontact" onClick="JavaScript:opensubwin2('form1','contact')"    value=...  class=black>
	-->
      <input type="button" name="bncontact" onClick="JavaScript:if(form1.account.value!=-1){opensubwinwithsearch('../contact/SelectAccountContact.asp','form1','contact','accountid',form1.account.value)}else{alert('请先选择客户!')}"    value=...  class=black> 
      <input type="button" name="bnclrcontact" onClick="clearcontact();"    value=C  class=black></td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center"><font color="#FF0000">*&nbsp;</font>销售机会流程</div></td>
    <td width="35%" bgcolor="EFEFEF"> 
      <select name=DealProcess size=0 onchange="setdealstage();">
        <option value=-1>--选择销售流程--</option>
        <%getdealprocess strdealprocess%>
      </select></td>
    <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center"><font color="#FF0000">*&nbsp;</font>销售机会来源</div></td>
    <td width="35%" nowrap bgcolor="EFEFEF"> <select name=dealsource>
        <option value=-1>--选择销售来源--</option>
        <%getdefine "销售来源类型",strdealsource%>
      </select> </td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center"><font color="#FF0000">*&nbsp;</font>销售机会阶段</div></td>
    <td width="35%" bgcolor="EFEFEF"> 
      <input name="dealstage" type="hidden" size="8" value="<%=strdealstage%>"> 
      <input name="dealstagename" type="text" size="8" value="<%=strdealstagename%>" readonly> 
      <input type="button" name="bndealprocess" onClick="selectdealstage();"  value=...  class=black></td>
    <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center">成功几率</div></td>
    <td width="35%" nowrap bgcolor="EFEFEF"> <input name=dealrate type=text value="<%=strdealrate%>" size="12" readonly>
      %</td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" bgcolor="DEDFDE" > <div align="center">失败原因</div></td>
    <td width="35%" bgcolor="EFEFEF"> 
      <select name=lostreason>
        <option value=-1></option>
        <%getdefine "失败原因",strlostreason%>
      </select></td>
    <td width="15%" bgcolor="DEDFDE"> <div align="center">货币</div></td>
    <td width="35%" bgcolor="EFEFEF"> <select name=currencycode>
        <option value=-1>--请选择货币类型--</option>
        <%getdefine "货币",strcurrencycode%>
      </select></td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" bgcolor="DEDFDE" > <div align="center"><font color="#FF0000">*&nbsp;</font>标的</div></td>
    <td width="35%" bgcolor="EFEFEF">
<input name=totalamount type=text value="<%=strtotalamount%>" size="12"> 
      &nbsp;元</td>
    <td width="15%" bgcolor="DEDFDE"> <div align="center"></div></td>
    <td width="35%" bgcolor="EFEFEF"></td>
  </tr>
  <tr  bgcolor="white"> 
    <td width="15%" bgcolor="DEDFDE"> <div align="center">描述</div></td>
    <td colspan="3" bgcolor="EFEFEF" width="85%"> <textarea name="description" cols="50" rows="4"><%=strdescription%></textarea> 
      <div align="center"></div></td>
  </tr>
</table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -