📄 newpo.asp
字号:
<td colspan="3" bgcolor="EFEFEF"><textarea name="termline" cols="45" rows="4"><%=strtermline%></textarea></td>
</tr>
</table>
<BR>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80" height="22"><strong><font size="2"><b><font class=title>采购明细</font></b></font></strong></td>
<td width="62" height="22" align="center" valign="middle">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td height="19" background="../images/button_bg.gif">
<div align="center" style="cursor:hand"><a onClick="addpoline();"><font color="#000000">新增</font><font color="#ff0000"><%=rspara("step")%></font><font color="#000000">行</font></a></div></td>
</tr></table></td>
<td height="22"></td>
</tr>
<tr>
<td height=2 colspan="6" bgcolor="#4A699C"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="DECFAD">
<tr valign="middle" bgcolor="efefef">
<td width="4%" height="15" align=center>序号</td>
<td width="18%" height="15" align=center>货号及型号</td>
<td width="6%" height="15" align=center>单价</td>
<td width="6%" align=center>不含税价</td>
<td width="8%" height="15" align=center>数量</td>
<td width="8%" height="15" align=center>金额</td>
<td width="11%" height="15" align=center>希望日期</td>
<td width="11%" height="15" align=center>确认日期</td>
<td width="8%" height="15" align=center>SLIP编号</td>
<td width="8%" height="15" align=center>特价编号</td>
<td width="8%" height="15" align=center>备注</td>
<td width="4%" height="15" align=center>历史</td>
</table>
<table width=100% cellpadding="0" cellspacing="0">
<tr><td id=poline>
<%
if request("id")="" then
for k=1 to rspara("linenum")
%>
<table cellpadding=2 cellspacing=1 bgcolor=#FFFFFF width=100%>
<tr>
<td width=4% align=center bgcolor="#CEDfDE"><%=k%></td>
<td width="18%" valign="top" bgcolor="DEDFDE"> <div align="left">
<input type=hidden name=product<%=k%>>
<input type=text name=code<%=k%> size=10 readonly>
<input type=button name=bproduct<%=k%> onClick="JavaScript:opensubwin5('form1','product<%=k%>','code<%=k%>','price<%=k%>','specialpriceno<%=k%>',form1.account.value)" value="..." class=black>
<input type=button name=bproduct<%=k%> onClick="JavaScript:opensubwinpoqty('form1','product<%=k%>','code<%=k%>','price<%=k%>','specialpriceno<%=k%>','qty<%=k%>',form1.account.value)" value="量购" class=black>
<input type=button name=cancel<%=k%> onClick="javascript:cancelcode(<%=k%>);" value="C" class=black>
</div>
<div name="product<%=k%>name" id="product<%=k%>name"></div></td>
<td width="6%" valign="top" bgcolor="DEDFDE"><input type=text name="price<%=k%>" size=6 onchange="calculateamount(<%=k%>);"></td>
<td width="6%" valign="top" bgcolor="DEDFDE"><input type=text name="pricex<%=k%>" size=6 onchange="calculateamount2(<%=k%>);"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name="qty<%=k%>" size=6 onchange="calculateamount(<%=k%>);"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=amount<%=k%> size=6 readonly></td>
<td width="11%" valign="top" bgcolor="DEDFDE"><input type=text name=expecteddate<%=k%> size=9 value="<%=date()+3%>"></td>
<td width="11%" valign="top" bgcolor="DEDFDE"><input type=text name=confirmeddate<%=k%> size=9 value="<%=date()+3%>"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=slipno<%=k%> size=6></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=specialpriceno<%=k%> size=6></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=description<%=k%> size=6></td>
<td width="4%" bgcolor="DEDFDE" align="center"><input type=button onClick="JavaScript:if(form1.product<%=k%>.value==''){alert('请选择产品')}else {opensubwin6('form1','po',form1.product<%=k%>.value,form1.account.value)}" value="H" class=black></td>
</tr>
</table>
<%
next
k=k-1
else
dim connline
dim rsline
set connline=server.CreateObject("adodb.connection")
set rsline=server.CreateObject("adodb.recordset")
connline.Open connstring
rsline.Open "select * from poline where poid="&request("id")&" order by lineid",connline,1,1
if not rsline.EOF then
dim j
j=1
do while not rsline.EOF
%>
<table cellpadding=2 cellspacing=1 bgcolor=#FFFFFF width=100%>
<tr>
<td width=4% align=center bgcolor="#CEDfDE"><%=j%></td>
<td width="18%" valign="top" bgcolor="DEDFDE"> <input type=hidden name=product<%=j%> value=<%=rsline("productid")%>><input type=hidden name=polineid<%=j%> value=<%=rsline("lineid")%>>
<input type=text name=code<%=j%> size=10 value="<%=getfieldvalue("product","productid",rsline("productid"),"productcode")%>" readonly>
<input type=button name=bproduct<%=j%> onClick="JavaScript:opensubwin5('form1','product<%=j%>','code<%=j%>','price<%=j%>','specialpriceno<%=j%>',form1.account.value)" value="..." class=black>
<input type=button name=bproduct<%=j%> onClick="JavaScript:opensubwinpoqty('form1','product<%=j%>','code<%=j%>','price<%=j%>','specialpriceno<%=j%>','qty<%=j%>',form1.account.value)" value="量购" class=black>
<input type=button name=cancel<%=j%> onClick="javascript:cancelcode(<%=j%>);" value="C" class=black>
<div name="product<%=j%>name" id="product<%=j%>name"><%=getfieldvalue("product","productid",rsline("productid"),"Model")%></div></td>
<td width="6%" valign="top" bgcolor="DEDFDE"><input type=text name="price<%=j%>" size=6 onchange="calculateamount(<%=j%>);" value="<%=rsline("price")%>"></td>
<td width="6%" valign="top" bgcolor="DEDFDE"><input type=text name="pricex<%=j%>" size=6 onchange="calculateamount2(<%=j%>);" value="<%=csng(rsline("price"))/1.17%>"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name="qty<%=j%>" size=6 onchange="calculateamount(<%=j%>);" value="<%=rsline("qty")%>"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=amount<%=j%> size=6 value="<%=rsline("amount")%>" readonly></td>
<td width="11%" valign="top" bgcolor="DEDFDE"> <input type=text name=expecteddate<%=j%> size=9 value="<%=rsline("expecteddate")%>">
</td>
<td width="11%" valign="top" bgcolor="DEDFDE"> <input type=text name=confirmeddate<%=j%> size=9 value="<%=rsline("confirmeddate")%>"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=slipno<%=j%> size=6 value=<%=rsline("slipno")%>></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=specialpriceno<%=j%> size=6 value="<%=rsline("specialpriceno")%>"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"> <input type=text name=description<%=j%> size=6 value="<%=rsline("description")%>"></td>
<td width="4%" bgcolor="DEDFDE" align="center"><input name="button" type=button class=black onClick="JavaScript:if(form1.product<%=j%>.value==''){alert('请选择产品')}else {opensubwin6('form1','po',form1.product<%=j%>.value,form1.account.value)}" value="H"></td>
</tr>
</table>
<%
j=j+1
rsline.MoveNext
loop
j=j-1
else
j=rspara("linenum")'编辑&无细目时设定默认行数
for k=1 to rspara("linenum")
%>
<table cellpadding=2 cellspacing=1 bgcolor=ffffff width=100%>
<tr>
<td width=4% align=center bgcolor="#CEDfDE"><%=k%></td>
<td width="18%" valign="top" bgcolor="DEDFDE"> <input type=hidden name=product<%=k%>>
<input type=text name=code<%=k%> size=10 readonly> <input type=button name=bproduct<%=k%> onClick="JavaScript:opensubwin5('form1','product<%=k%>','code<%=k%>','price<%=k%>','specialpriceno<%=k%>',form1.account.value)" value="..." class=black>
<input type=button name=bproduct<%=k%> onClick="JavaScript:opensubwinpoqty('form1','product<%=k%>','code<%=k%>','price<%=k%>','specialpriceno<%=k%>','qty<%=k%>',form1.account.value)" value="量购" class=black>
<input type=button name=cancel<%=k%> onClick="javascript:cancelcode(<%=k%>);" value="C" class=black>
<div name="product<%=k%>name" id="product<%=k%>name"></div></td>
<td width="6%" valign="top" bgcolor="DEDFDE"><input type=text name="price<%=k%>" size=6 onChange="calculateamount(<%=k%>);"></td>
<td width="6%" valign="top" bgcolor="DEDFDE"><input type=text name="pricex<%=k%>" size=6 onChange="calculateamount2(<%=k%>);"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name="qty<%=k%>" size=6 onChange="calculateamount(<%=k%>);"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=amount<%=k%> size=6 readonly></td>
<td width="11%" valign="top" bgcolor="DEDFDE"> <input type=text name=expecteddate<%=k%> size=9 value="<%=date()+3%>"></td>
<td width="11%" valign="top" bgcolor="DEDFDE"> <input type=text name=confirmeddate<%=k%> size=9 value="<%=date()+3%>"></td>
<td width="8%" valign="top" bgcolor="DEDFDE"> <input type=text name=slipno<%=k%>2 size=6></td>
<td width="8%" valign="top" bgcolor="DEDFDE"><input type=text name=specialpriceno<%=k%>2 size=6></td>
<td width="8%" valign="top" bgcolor="DEDFDE"> <input type=text name=description<%=k%> size=6>
</td>
<td width="4%" bgcolor="DEDFDE" align="center"> <input name="button2" type=button class=black onClick="JavaScript:if(form1.product<%=k%>.value==''){alert('请选择产品')}else {opensubwin6('form1','po',form1.product<%=k%>.value,form1.account.value)}" value="H"></td>
</tr>
</table>
<%
next
end if
rsline.Close
set rsline=nothing
connline.Close
set connline=nothing
end if
%>
</td></tr>
</table>
<input type=hidden id=linecount name=linecount value=<%if request("id")="" then Response.Write k else Response.Write j%>>
<input type=hidden id=maxlinenum name=maxlinenum value=<%=rspara("maxlinenum")%>>
</form>
</body>
<script language=javascript>
function addpoline(){
if (parseInt(form1.linecount.value)>parseInt(form1.maxlinenum.value)){
//alert(parseInt(form1.maxlinenum.value))
alert("已经到了最大行数,确实需要增加行数,请联系管理员重新设定最大行数!")
return false;
}
for(x=1;x<=<%=rspara("step")%>;x++){
form1.linecount.value=parseInt(form1.linecount.value)+1;
i=form1.linecount.value;
var tempstr=window.poline.innerHTML;
window.poline.innerHTML='';
tempstr=tempstr+"<table cellpadding=2 cellspacing=1 bgcolor=FFFFFFFF width=100%><tr bgcolor=white>";
tempstr=tempstr+"<td width=4% align=center bgcolor=#CEDfDE>"+i+"</td>";
tempstr=tempstr+"<td width=18% bgcolor=DEDFDE><input type=hidden name=product"+i+"><input type=text name=code"+i+" size=10> <input type=button name=bproduct"+i+" onClick="+"JavaScript:opensubwin5('form1','product"+i+"','code"+i+"','price"+i+"','specialpriceno"+i+"',form1.account.value)"+" value=... class=black> <input type=button name=bproduct"+i+" onClick="+"JavaScript:opensubwinpoqty('form1','product"+i+"','code"+i+"','price"+i+"','specialpriceno"+i+"','qty"+i+"',form1.account.value)"+" value=量购 class=black> <input type=button name=cancel"+i+" onClick="+"javascript:cancelcode('"+i+"')"+"; value=C class=black><div name=product"+i+"name id=product"+i+"name></div></td>";
tempstr=tempstr+"<td width=6% bgcolor=DEDFDE><input type=text name=price"+i+" size=6 onchange="+"calculateamount("+i+");"+"></td>";
tempstr=tempstr+"<td width=6% bgcolor=DEDFDE><input type=text name=pricex"+i+" size=6 onchange="+"calculateamount2("+i+");"+"></td>";
tempstr=tempstr+"<td width=8% bgcolor=DEDFDE><input type=text name=qty"+i+" size=6 onchange="+"calculateamount("+i+");"+"></td>";
tempstr=tempstr+"<td width=8% bgcolor=DEDFDE><input type=text name=amount"+i+" size=6 readonly></td>";
tempstr=tempstr+"<td width=11% bgcolor=DEDFDE><input type=text name=expecteddate"+i+" size=9 value="+"<%=date()+3%>"+"></td>";
tempstr=tempstr+"<td width=11% bgcolor=DEDFDE><input type=text name=confirmeddate"+i+" size=9 value="+"<%=date()+3%>"+"></td>";
tempstr=tempstr+"<td width=8% bgcolor=DEDFDE><input type=text name=slipno"+i+" size=6></td>";
tempstr=tempstr+"<td width=8% bgcolor=DEDFDE><input type=text name=specialpriceno"+i+" size=6></td>";
tempstr=tempstr+"<td width=8% bgcolor=DEDFDE><input type=text name=description"+i+" size=6></td>";
tempstr=tempstr+"<td width=4% align=center bgcolor=DEDFDE><input type=button onClick="+"JavaScript:if(form1.product"+i+".value!=''){opensubwin6('form1','po',form1.product"+i+".value,form1.account.value);}"+"else{alert('请选择产品');}"+" value=H class=black id=button3 name=button3></td>";
tempstr=tempstr+"</tr></table>";
window.poline.innerHTML=tempstr;
}
}
function cancelcode(i){
var code="code"+i;
var productname="product"+i+"name";
var expecteddate="expecteddate"+i;
var price="price"+i;
var confirmeddate="confirmeddate"+i;
var amount="amount"+i;
var qty="qty"+i;
var slipno="slipno"+i;
var specialpriceno="specialpriceno"+i;
var description="description"+i;
form1.item(code).value="";
window.document.all(productname).innerHTML="";
form1.item(price).value="";
form1.item(qty).value="";
form1.item(amount).value="";
form1.item(slipno).value="";
form1.item(specialpriceno).value="";
form1.item(description).value="";
}
function calculateamount(i){
var price="price"+i;
var pricex="pricex"+i;
var amount="amount"+i;
var qty="qty"+i;
form1.item(pricex).value=floatRound(form1.item(price).value/1.17,2)
form1.item(amount).value=floatRound(form1.item(qty).value*form1.item(price).value,2);
}
function calculateamount2(i){
var price="price"+i;
var pricex="pricex"+i;
var amount="amount"+i;
var qty="qty"+i;
form1.item(price).value=floatRound(form1.item(pricex).value*1.17,2)
form1.item(amount).value=floatRound(form1.item(qty).value*form1.item(price).value,2);
}
function floatRound(myFloat,mfNumber)
{
var cutNumber = Math.pow(100,mfNumber-1);
return Math.round(myFloat * cutNumber)/cutNumber;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -