📄 f_swshedit1.asp
字号:
<!--#include file="../include/Pubconn.asp"-->
<!--#include file="../include/PubFun.asp"-->
<% username=Getuser()%>
<%
'*******************************
'
'Author:Ruphi Update Time:2001-09-20
'功能说明:执行中审核输入处理
'
'* *****************************
%>
<%
'从另一个表单传来的值
ID=request("ID") '唯一ID号
xsdb=request("xsdb") '销售代表
khxh=request("khxh")
'信用额统计
set rec=server.createobject("adodb.recordset")
mystrxy="select * from d_clientinfo where clientnum='"&khxh&"' "
rec.open mystrxy,pubconn,1,3
if rec("credit")="" or isnull(rec("credit")) then
khxye=0
else
khxye=rec("credit")
end if
set rssh=server.createobject("ADODB.RecordSet")
sql="select * from F_Tblcontract21 where AsserNum='"&Session("UserID")&"' and ID="&cint(ID)
rssh.open sql,Pubconn,1,3
if rssh.eof then '表示该当前登录人还没有审核
sftg="N"
shpy=""
else
sftg=rssh("YN")
shpy=rssh("Remark")
end if
rssh.close
set rssh=nothing
txtremark=request("txtremark")
tgf=request("tgf")
'response.write txtshr&"+"
'response.write txtremark&"+"
'response.write tgf&"<br>"
if request("bc")="保存" then
'以下对子表的操作
set rssh=server.createobject("ADODB.RecordSet")
sql="select * from F_Tblcontract21 where AsserNum='"&Session("UserID")&"' and ID="&cint(ID)
rssh.open sql,Pubconn,1,3
if rssh.eof then
rssh.Addnew '新增一条审核
rssh("ID")=ID
rssh("AsserNum")=Session("UserID")
rssh("Remark")=txtremark
rssh("YN")=tgf
rssh.Update
else
rssh("Remark")=txtremark '修改该审核人的意见
rssh("YN")=tgf
rssh.Update
end if
rssh.close
set rssh=nothing
'统计有几个人对合同审核,并且是在合同通过审核的前提下
'该合同针对是三个人审核,若人数增多时需修改
mysql="select count(AsserNum) as total from F_Tblcontract21 where YN='Y' and ID="&cint(ID)
' response.write mysql
set rstj=Pubconn.execute(mysql)
sl=rstj("total")
' response.write "sl="&sl
'以下对主表的操作
set rst=server.createobject("ADODB.RecordSet")
sql="select * from F_Tblcontract2 where ID="&cint(ID)
rst.open sql,Pubconn,1,3
if sl=3 then '当全部通过审核时,该合同生效
rst("YesOrNo")=4
rst.update
end if
if (sl=1) or (sl=2) then
rst("YesOrNo")=3
rst.update
end if
if sl=0 then
rst("YesOrNo")=2
rst.Update
end if
rst.close
set rst=nothing
'以下修改客户属性与级别
str1="select count(*) as sl1 from f_tblorder where clientnum='"&khxh&"'"
str2="select count(*) as sl2 from f_tblcontract2 where clientnum='"&khxh&"' and yesorno='3'"
set slrs1=pubconn.execute(str1)
set slrs2=pubconn.execute(str2)
zsl=slrs1("sl1")+slrs2("sl2")
response.write sl2
' response.write zsl
khstr="select * from a_clientset where clientset='忠诚客户'"
set khrs=pubconn.execute(khstr)
if cdbl(zsl)=1 then
st3="update d_clientinfo set type='首次购买客户' where clientnum='"&khxh&"'"
pubconn.execute(st3)
end if
if cdbl(zsl)>1 and cdbl(zsl)<cdbl(khrs("firstdata")) then
st4="update d_clientinfo set type='重复购买客户' where clientnum='"&khxh&"'"
pubconn.execute(st4)
end if
if cdbl(zsl)>=cdbl(khrs("firstdata")) then
str3="update d_clientinfo set type='忠诚客户' where clientnum='"&khxh&"'"
pubconn.execute(str3)
end if
'end if
'判断级别
str4="select sum(money) as je from viewtzd where clientnum='"&khxh&"'"
set jers=pubconn.execute(str4)
if isnull(jers("je")) then
je=0
else
je=jers("je")
end if
'response.write je
'response.end
str5="select * from a_clientset where clientset='战略客户'"
str6="select * from a_clientset where clientset='价值客户'"
str7="select * from a_clientset where clientset='一般客户'"
set khrs1=pubconn.execute(str5)
set khrs2=pubconn.execute(str6)
set khrs3=pubconn.execute(str7)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -