📄 f_swhtedit.asp
字号:
<!--#include file="../include/Pubconn.asp"-->
<!--#include file="../include/PubCode.asp"-->
<!--#include file="../include/PubFun.asp"-->
<%
ywy=request("ywy")
username=Getuser()
userclass=TableVisitor("F_Tblcontract2",username)
if ywy<>Session("userID") and (userclass<3) then
response.write"<br>"
response.write"<br>"
response.write "<center><font size=2>抱歉,您没有此项操作权限!<a href=F_swhtbrow.asp>返回</a>"
response.end
end if
%>
<%
'**********该id号从超链接中传过来的
ID=request("ID")
set rsj=Server.Createobject("ADODB.recordset")
sql="select * from F_Tblcontract2 where ID="&cint(ID)
rsj.open sql,Pubconn,1,3
'******将此值赋给它,以便找出对的项
khxh=rsj("Clientnum")
if khxh<>"" then
'找出对应的客户名称电话及传真
set rskh=Server.Createobject("ADODB.recordset")
sql="select * from D_ClientInfo where ClientNum='"&khxh&"'"
rskh.open sql,Pubconn,1
if not rskh.eof then
khmc=rskh("ClientName")
telephone=rskh("Telophone")
fax=rskh("fax")
end if
end if
'在表中已存在的商品
spbm1=rsj("EquipType")
if spbm1<>"" then
'找出产品的有关的内容
set rssp1=Server.Createobject("ADODB.recordset")
sql="select * from A_ProductInfo where ProdCode='"&spbm1&"'"
rssp1.open sql,Pubconn,1
if not rssp1.eof then
spmc1=rssp1("ProdName")
ggxh1=rssp1("Model")+"-"+rssp1("stanDard")
jldw1=rssp1("Unit")
cbj1=rssp1("CostPrice")
end if
zcbj=cdbl(cbj1)*cdbl(rsj("Number"))
end if
'*****************************
'来自于产品选择表单
spbm=request("spxh")
if spbm<>"" then
'找出产品的有关的内容
set rssp=Server.Createobject("ADODB.recordset")
sql="select * from A_ProductInfo where ProdCode='"&spbm&"'"
rssp.open sql,Pubconn,1
if not rssp.eof then
spmc=rssp("ProdName")
ggxh=rssp("Model")+"-"+rssp("stanDard")
jldw=rssp("Unit")
cbj=rssp("CostPrice")
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link href="../cread.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript">
//商品名称响事件
var Pcount;
Pcount=0;
shang1 = new Array();
shang2 = new Array();
<%
'得出大类的代码与名称
count = 0
set rst=server.CreateObject("adodb.recordset")
mysql="select ProdName,left(prodcode,4) as code2,model,prodcode,standard,unit ,costprice from A_ProductInfo "
rst.open mysql,Pubconn,1,3
if rst.recordcount> 0 then
do while not rst.eof
%>
shang1[<%=count%>]=new Array("<%= trim(rst("code2"))%>","<%= trim(rst("model"))%>");
shang2[<%=count%>]=new Array("<%= trim(rst("prodcode"))%>","<%= trim(rst("standard"))%>","<%= trim(rst("unit"))%>","<%= trim(rst("ProdName"))%>","<%= trim(rst("CostPrice"))%>");
<%count = count + 1
rst.movenext
loop
end if
rst.close
set rst=nothing
%>
Pcount=<%=count%>;
function key2()
{
//取商品名称
for (l=0;l<Pcount;l++)
{
if(document.form1.spbm.value.substring(0,4)==shang1[l][0])
{
document.form1.ggxh.value=shang1[l][1];
break;
}
else
{
document.form1.ggxh.value="";
}
}
for (t=0;t<Pcount;t++)
{
if(document.form1.spbm.value==shang2[t][0])
{
document.form1.spmc.value=shang2[t][3];
document.form1.ggxh.value=shang1[l][1]+"-"+shang2[t][1];
document.form1.jldw.value=shang2[t][2];
document.form1.cbj.value=shang2[t][4];
// document.form1.swtk.value=shang2[t][4];
break;
}
else
{
document.form1.jldw.value="";
document.form1.spmc.value="";
}
}
} //key2事件响完成
</script>
<script language="vbscript">
sub cp_click()
ID=document.form1.ID.value
aa="F_CpInfo2.asp?ID="+ID
window.open aa,"产品信息","menubar=no,status=no,width=600,height=500,scrollbars=yes"
end sub
'以下判断只有为数字型才能输入
sub sl_onkeypress
window.event.keyCode=PublicKeyAscii(document.form1.sl.value,"Num",window.event.keyCode)
end sub
sub htzj_onkeypress
window.event.keyCode=PublicKeyAscii(document.form1.htzj.value,"Num",window.event.keyCode)
end sub
sub hmj_onkeypress
window.event.keyCode=PublicKeyAscii(document.form1.hmj.value,"Num",window.event.keyCode)
end sub
sub zbyear_onkeypress
window.event.keyCode=PublicKeyAscii(document.form1.zbyear.value,"Num",window.event.keyCode)
end sub
sub sl_onkeyup
if document.form1.spbm.value="" then
document.form1.sl.value=""
alert("请先选择商品!")
exit sub
end if
end sub
sub htzj_onkeyup
if document.form1.spbm.value="" then
document.form1.htzj.value=""
alert("请先选择商品!")
exit sub
end if
if document.form1.sl.value="" then
document.form1.htzj.value=""
alert("请先输入商品数量!")
exit sub
end if
if document.form1.htzj.value="" then
htzj=0
else
htzj=eval(document.form1.htzj.value)
end if
if document.form1.hmj.value="" then
hmj=0
else
hmj=eval(document.form1.hmj.value)
end if
if hmj<>0 then
if htzj=0 then
document.form1.hjxs.value=0
else
document.form1.hjxs.value=round(cdbl(htzj/hmj),2)
end if
else
document.form1.hjxs.value=""
end if
end sub
sub hmj_onkeyup
if document.form1.spbm.value="" then
document.form1.htzj.value=""
alert("请先选择商品!")
exit sub
end if
if document.form1.sl.value="" then
document.form1.htzj.value=""
alert("请先输入商品数量!")
exit sub
end if
if document.form1.htzj.value="" then
htzj=0
else
htzj=eval(document.form1.htzj.value)
end if
if document.form1.hmj.value="" then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -