📄 jhuodan_modi.asp
字号:
<!--#include file="../conn.asp"-->
<%
opendataconn
id=Trim(Request.QueryString("id"))
ckadd=Trim(Request.Form("ckadd"))
rowcount=Trim(Request.Form("rowcount"))
if ckadd<>"" then
mainid=Trim(Request.Form("mainid"))
maketabdate=Trim(Request.Form("thedate"))
bill_bh=Trim(Request.Form("bill_bh"))
gonghs=Trim(Request.Form("gonghs"))
jingsren=Trim(Request.Form("jingsren"))
storage=Trim(Request.Form("storage"))
memo=Trim(Request.Form("memo"))
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from yw_ingoodsbill where bill_bh='"&bill_bh&"' and id<>"&mainid&"",conn,1,1
if not (rs.eof and rs.bof) then
rs.close
set rs=nothing
response.write"<script>alert('出错!单据号不能修改成"&bill_bh&"\n因为此单据号已存在!');history.back();</script>"
response.end
end if
if ckadd="添加" then
conn.execute"update yw_ingoodsbill set maketabdate='"&maketabdate&"',bill_bh='"&bill_bh&"',gonghs='"&gonghs&"',jingsren='"&jingsren&"',storage='"&storage&"',memo='"&memo&"' where id="&mainid&""
for i=0 to rowcount
textname="r"&i
goods_bh=Trim(Request.Form(textname&"c1"))
goods_name=Trim(Request.Form(textname&"c2"))
danwei=Trim(Request.Form(textname&"c3"))
xinghao=Trim(Request.Form(textname&"c4"))
specs=Trim(Request.Form(textname&"c5"))
amount=Trim(Request.Form(textname&"c6"))
price=Trim(Request.Form(textname&"c7"))
th_amount=Trim(Request.Form(textname&"c9"))
subid=Trim(Request.Form("subid"&i))
memo2=Trim(Request.Form(textname&"c10"))
if goods_bh<>"" and goods_name<>"" and subid<>"" then
conn.execute"update yw_ingoodsbillinfo set goods_bh='"&goods_bh&"',bill_bh='"&bill_bh&"',goods_name='"&goods_name&"',danwei='"&danwei&"',xinghao='"&xinghao&"',specs='"&specs&"',amount="&amount&",price="&price&",th_amount='"&th_amount&"',memo='"&memo2&"' where id="&subid&""
elseif goods_bh<>"" and goods_name<>"" and subid="" then
conn.execute"insert into yw_ingoodsbillinfo(goods_bh,goods_name,danwei,xinghao,specs,amount,price,th_amount,bill_bh,memo) values ('"&goods_bh&"','"&goods_name&"','"&danwei&"','"&xinghao&"','"&specs&"',"&amount&","&price&",'"&th_amount&"','"&bill_bh&"','"&memo2&"')"
end if
next
response.write "<script language='javascript'>window.opener.location.href = window.opener.location.href;window.close();</script>"
elseif ckadd="新增" then
conn.execute"update yw_ingoodsbill set maketabdate='"&maketabdate&"',bill_bh='"&bill_bh&"',gonghs='"&gonghs&"',jingsren='"&jingsren&"',storage='"&storage&"',memo='"&memo&"' where id="&mainid&""
for i=0 to rowcount
textname="r"&i
goods_bh=Trim(Request.Form(textname&"c1"))
goods_name=Trim(Request.Form(textname&"c2"))
danwei=Trim(Request.Form(textname&"c3"))
xinghao=Trim(Request.Form(textname&"c4"))
specs=Trim(Request.Form(textname&"c5"))
amount=Trim(Request.Form(textname&"c6"))
price=Trim(Request.Form(textname&"c7"))
th_amount=Trim(Request.Form(textname&"c9"))
subid=Trim(Request.Form("subid"&i))
memo2=Trim(Request.Form(textname&"c10"))
if goods_bh<>"" and goods_name<>"" and subid<>"" then
conn.execute"update yw_ingoodsbillinfo set goods_bh='"&goods_bh&"',bill_bh='"&bill_bh&"',goods_name='"&goods_name&"',danwei='"&danwei&"',xinghao='"&xinghao&"',specs='"&specs&"',amount="&amount&",price="&price&",th_amount='"&th_amount&"' where id="&subid&""
elseif goods_bh<>"" and goods_name<>"" and subid="" then
conn.execute"insert into yw_ingoodsbillinfo(goods_bh,goods_name,danwei,xinghao,specs,amount,price,th_amount,bill_bh,memo) values ('"&goods_bh&"','"&goods_name&"','"&danwei&"','"&xinghao&"','"&specs&"',"&amount&","&price&",'"&th_amount&"','"&bill_bh&"','"&memo2&"')"
end if
next
response.write "<script language='javascript'>window.opener.location.href = window.opener.location.href;window.location='"&request.ServerVariables("SCRIPT_NAME")&"?id="&mainid&"';</script>"
end if
end if
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from yw_ingoodsbill where id="&id&"",conn,1,3
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>进货单修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../inc/body.css" rel="stylesheet" type="text/css">
<link href="jdingdan.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="../kuchun/ckNum.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function check(ckadd)
{
var result;
if(document.ck.thedate.value=="")
{
alert("请填写录单时间!");
document.ck.thedate.focus();
return false;
}
if(document.ck.bill_bh.value=="")
{
alert("请填写单据号!");
document.ck.bill_bh.focus();
return false;
}
if(document.ck.gonghs.value=="")
{
alert("请填写供货商!");
document.ck.gonghs.focus();
return false;
}
if(document.ck.jingsren.value=="")
{
alert("请填写经手人!");
document.ck.jingsren.focus();
return false;
}
if(document.ck. storage.value=="")
{
alert("请选择仓库!");
document.ck. storage.focus();
return false;
}
var n=table1.rows.length;
if(n<=1)
n=n+1;
for(var i=0;i<=n-2;i++)
{
for(var m=1;m<=table1.rows[0].cells.length-1;m++)
{
if(document.ck.elements['r'+i+'c'+m].value=="")
{
alert("请把信息填写完整!");
document.ck.elements['r'+i+'c'+m].focus();
return false
}
if(m==7)
{
if(checkFloatNum('ck','r'+i+'c'+m)==false)
{
return false;
}
}
if(m==6||m==9)
{
if(checkIntNum('ck','r'+i+'c'+m)==false)
{
return false;
}
}
}
}
document.ck.ckadd.value=ckadd;
document.ck.rowcount.value=table1.rows.length;
document.ck.submit();
return true;
}
function focusChange(fieldName)
{
document.forms['ck'].elements[fieldName].className="inputfield";
var rownum=parseFloat(fieldName.substring(fieldName.indexOf("r")+1,fieldName.indexOf("c")));
if(document.getElementById)
{
for(var i=0;i<table1.rows.length;i++)
{
table1.rows[i].cells[0].innerHTML="<div></div>";
}
table1.rows[rownum].cells[0].innerHTML="<div align='center'>*</div>";
}
if(document.ck.elements["subid"+rownum])
{
document.ck.subid.value=document.ck.elements["subid"+rownum].value;
}
else
{
document.ck.subid.value="new"+rownum;
}
}
function blurChange(fieldName)
{
document.forms['ck'].elements[fieldName].className="inputfield2";
var m=fieldName.substring(fieldName.indexOf("r")+1,fieldName.indexOf("c"));
if(document.forms['ck'].elements['r'+m+'c6'].value!="" && document.forms['ck'].elements['r'+m+'c7'].value!="")
{
document.forms['ck'].elements['r'+m+'c8'].value=document.forms['ck'].elements['r'+m+'c6'].value*document.forms['ck'].elements['r'+m+'c7'].value;
}
insertrows();
}
function insertrows()
{
for(var i=0;i<document.ck.elements.length-6;i++)
{
if(document.ck.elements[i].value=="")
{
break;
}
else if(document.ck.elements[i].value!=""&& i==document.ck.elements.length-7)
{
var theTable = document.getElementById("table1");
var rowNumber = parseFloat(theTable.rows.length);
theTable.insertRow(rowNumber);
for (var j=0;j<=theTable.rows[rowNumber-1].cells.length-1;j++)
{
var newValue="<input type='text' class='inputfield2' onFocus='focusChange(this.name)' onBlur='blurChange(this.name)' size='10' name='r"+rowNumber+"c"+j+"' id='r"+rowNumber+"c"+j+"'>";
theTable.rows[rowNumber].insertCell(j);
theTable.rows[rowNumber].cells[j].innerHTML = newValue;
theTable.rows[rowNumber].cells[0].innerHTML="<div align='center'></div>";
theTable.rows[rowNumber].cells[0].className="borderon2";
}
theTable.rows[rowNumber].cells[8].innerHTML="<input type='text' class='inputfield2' onFocus='focusChange(this.name)' onBlur='blurChange(this.name)' size='10' name='r"+rowNumber+"c8' id='r"+rowNumber+"c8' readonly='true'>";
}
}
}
function delRow()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -