📄 newquote.asp
字号:
</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="addquoteline();"><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="15%" height="15" align=center>货号</td>
<td width="25%" height="15" align=center>型号和名称</td>
<td width="8%" height="15" align=center>单价</td>
<td width="8%" height="15" align=center>数量</td>
<td width="8%" height="15" align=center>折扣</td>
<td width="8%" height="15" align=center>折扣价</td>
<td width="8%" height="15" align=center>金额</td>
<td width="12%" height="15" align=center>货期</td>
<td width="4%" height="15" align=center>历史</td>
</table>
<table width=100% cellpadding="0" cellspacing="0">
<tr><td id=quoteline>
<%
if request("id")="" then
for k=1 to rspara("linenum")
%>
<table cellpadding=2 cellspacing=1 bgcolor=#FFFFFF width=100%>
<tr bgcolor=white>
<td width=4% align=center bgcolor="#CEDfDE"><%=k%></td>
<td width="15%" bgcolor="DEDFDE">
<input type=hidden name=product<%=k%>>
<input type=text name=code<%=k%> size=12 readonly>
<input type=button name=bproduct<%=k%> onClick="JavaScript:opensubwin8('form1','product<%=k%>','code<%=k%>','price<%=k%>',form1.account.value,'discount<%=k%>','discountprice<%=k%>')" value="..." class=black>
<input type=button name=cancel<%=k%> onClick="javascript:cancelcode(<%=k%>);" value="C" class=black>
</td>
<td width="25%" bgcolor="DEDFDE">
<div align="center">
<div name="product<%=k%>name" id="product<%=k%>name"></div>
</div></td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name="price<%=k%>" size=6 readonly>
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=qty<%=k%> size=6 onBlur="ChangeQtyCalculateAmount(<%=k%>);">
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=discount<%=k%> size=4 value=100 onBlur="calculateamount(<%=k%>);"> %</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=discountprice<%=k%> size=6 onBlur="recalculateamount(<%=k%>);">
</td>
<td width="8%" bgcolor="DEDFDE"><input type=text name=amount<%=k%> size=8 readonly></td>
<td width="12%" bgcolor="DEDFDE">
<input type="text" name="shipdate<%=k%>" size="9" language=javascript id="dupdatetime<%=k%>" value="" >
<% call AddImg("date"&k)%>
</td>
<td width="4%" bgcolor="DEDFDE"><div align="center">
<input name="button" type=button class=black onClick="JavaScript:if(form1.product<%=k%>.value==''){alert('请选择产品')}else {opensubwin6('form1','quoteandorder',form1.product<%=k%>.value,form1.account.value)}" value="H">
</div></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 quoteline where quoteid="&request("id"),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 bgcolor=white>
<td width=4% align=center bgcolor="#CEDfDE"><%=j%></td>
<td width="15%" bgcolor="DEDFDE">
<input type=hidden name=product<%=j%> value="<%=rsline("productid")%>">
<input type=text name=code<%=j%> size=12 value="<%=getfieldvalue("product","productid",rsline("productid"),"productcode")%>" readonly>
<input type=button name=bproduct<%=j%> onClick="JavaScript:opensubwin8('form1','product<%=j%>','code<%=j%>','price<%=j%>',form1.account.value,'discount<%=j%>','discountprice<%=j%>')" value="..." class=black>
<input type=button name=cancel<%=j%> onClick="javascript:cancelcode(<%=j%>);" value="C" class=black>
</td>
<td width="25%" bgcolor="DEDFDE" align="center">
<div name="product<%=j%>name" id="product<%=j%>name"><%=getfieldvalue("product","productid",rsline("productid"),"model")%></div></td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name="price<%=j%>" size=6 readonly value="<%=rsline("price")%>">
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=qty<%=j%> size=6 onBlur="ChangeQtyCalculateAmount(<%=j%>);" value="<%=rsline("qty")%>">
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=discount<%=j%> size=4 onBlur="calculateamount(<%=j%>);" value="<%=rsline("discount")%>"> %</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=discountprice<%=j%> size=6 onBlur="recalculateamount(<%=j%>);" value="<%=rsline("discountprice")%>">
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=amount<%=j%> size=8 value="<%=rsline("amount")%>" readonly>
</td>
<td width="12%" bgcolor="DEDFDE">
<input type="text" name="shipdate<%=j%>" size="9" language=javascript id="dupdatetime<%=j%>" value="<%=rsline("shipdate")%>">
<% call AddImg("date"&j)%>
</td>
<td width="4%" bgcolor="DEDFDE"><div align="center">
<input name="button2" type=button class=black onClick="JavaScript:if(form1.product<%=j%>.value==''){alert('请选择产品')}else {opensubwin6('form1','quoteandorder',form1.product<%=j%>.value,form1.account.value)}" value="H">
</div></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 bgcolor=white>
<td width=4% align=center bgcolor="#CEDfDE"><%=k%></td>
<td width="15%" bgcolor="DEDFDE">
<input type=hidden name=product<%=k%>>
<input type=text name=code<%=k%> size=12 readonly>
<input type=button name=bproduct<%=k%> onClick="JavaScript:opensubwin8('form1','product<%=k%>','code<%=k%>','price<%=k%>',form1.account.value,'discount<%=k%>','discountprice<%=k%>')" value="..." class=black>
<input type=button name=cancel<%=k%> onClick="javascript:cancelcode(<%=k%>);" value="C" class=black>
</td>
<td width="25%" bgcolor="DEDFDE">
<div align="center"><div name="product<%=k%>name" id="product<%=k%>name"></div></div></td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name="price<%=k%>" size=6 readonly>
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=qty<%=k%> size=6 onBlur="ChangeQtyCalculateAmount(<%=k%>);">
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=discount<%=k%> size=4 value=100 onBlur="calculateamount(<%=k%>);"> %</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=discountprice<%=k%> size=6 onBlur="recalculateamount(<%=k%>);">
</td>
<td width="8%" bgcolor="DEDFDE">
<input type=text name=amount<%=k%> size=8 readonly>
</td>
<td width="12%" bgcolor="DEDFDE">
<input type="text" size="9" language=javascript id="dupdatetime<%=k%>" value="">
<% call AddImg("date"&k)%>
</td>
<td width="4%" bgcolor="DEDFDE"><div align="center">
<input name="button3" type=button class=black onClick="JavaScript:if(form1.product<%=k%>.value==''){alert('请选择产品')}else {opensubwin6('form1','quoteandorder',form1.product<%=k%>.value,form1.account.value)}" value="H">
</div></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=bapprove name=bapprove>
<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 addquoteline(){
if (parseInt(form1.linecount.value)>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.quoteline.innerHTML;
window.quoteline.innerHTML='';
tempstr=tempstr+"<table cellpadding=2 cellspacing=1 bgcolor=#FFFFFF width=100%><tr bgcolor=white>";
tempstr=tempstr+"<td align=center width=4% bgcolor=#CEDfDE>"+i+"</td>";
tempstr=tempstr+"<td width=15% bgcolor=#DEDFDE><input type=hidden name=product"+i+"><input type=text name=code"+i+" size=12 readonly> <input type=button name=bproduct"+i+" onClick="+"JavaScript:opensubwin8('form1','product"+i+"','code"+i+"','price"+i+"',form1.account.value,'discount"+i+"','discountprice"+i+"')"+" value=... class=black> <input type=button name=cancel"+i+" onClick="+"javascript:cancelcode('"+i+"')"+"; value=C class=black></td>";
tempstr=tempstr+"<td width=25% bgcolor=#DEDFDE align=center><div name=product"+i+"name id=product"+i+"name></div></td>";
tempstr=tempstr+"<td width=8% bgcolor=#DEDFDE><input type=text name=price"+i+" size=6 readonly></td>";
tempstr=tempstr+"<td width=8% bgcolor=#DEDFDE><input type=text name=qty"+i+" size=6 onchange="+"ChangeQtyCalculateAmount("+i+");"+">";
tempstr=tempstr+"<td width=8% bgcolor=#DEDFDE><input type=text name=discount"+i+" size=4 onchange="+"calculateamount("+i+");"+" value=100>%</td>";
tempstr=tempstr+"<td width=8% bgcolor=#DEDFDE><input type=text name=discountprice"+i+" size=6 onchange="+"recalculateamount("+i+");"+">";
tempstr=tempstr+"<td width=8% bgcolor=#DEDFDE><input type=text name=amount"+i+" size=8 readonly></td>";
tempstr=tempstr+"<td width=12% bgcolor=#DEDFDE><input type=text name=shipdate"+i+" size=9 language=javascript id=dupdatetime"+i+" value=> <input type=hidden id=date"+i+"> <img width=16 height=16 src='../Images/show-calendar.gif' onClick="+"opencalendar_C('"+"date"+i+"')>";
tempstr=tempstr+"<td width=4% align=center bgcolor=DEDFDE><input type=button onClick="+"JavaScript:if(form1.product"+i+".value!=''){opensubwin6('form1','quoteandorder',form1.product"+i+".value,form1.account.value);}"+"else{alert('请选择产品');}"+" value=H class=black id=button3 name=button3></td>";
tempstr=tempstr+"</tr></table>";
window.quoteline.innerHTML=tempstr;
}
}
function cancelcode(i){
var code='code'+i;
var productname='product'+i+'name';
var discountprice='discountprice'+i;
var price='price'+i;
var discount='discount'+i;
var shipdate='shipdate'+i;
var amount='amount'+i;
var qty='qty'+i;
form1.item(code).value='';
window.document.all(productname).innerHTML='';
form1.item(price).value='';
form1.item(qty).value='';
form1.item(discount).value=100;
form1.item(discountprice).value='';
form1.item(amount).value='';
}
function calculateamount(i){
var discountprice="discountprice"+i;
var price="price"+i;
var discount="discount"+i;
var amount="amount"+i;
var qty="qty"+i;
form1.item(discountprice).value=floatRound(form1.item(price).value*form1.item(discount).value/100,2);
form1.item(amount).value=floatRound(form1.item(discountprice).value*form1.item(qty).value,2);
}
function ChangeQtyCalculateAmount(i){
var discountprice="discountprice"+i;
var price="price"+i;
var discount="discount"+i;
var amount="amount"+i;
var qty="qty"+i;
//form1.item(discountprice).value=floatRound(form1.item(price).value*form1.item(discount).value/100,2);
form1.item(amount).value=floatRound(form1.item(discountprice).value*form1.item(qty).value,2);
}
function recalculateamount(i){
var amount="amount"+i;
var discountprice="discountprice"+i;
var qty="qty"+i;
var discount='discount'+i;
var price='price'+i
form1.item(amount).value=floatRound(form1.item(discountprice).value*form1.item(qty).value,2);
form1.item(discount).value=100-(form1.item(price).value-form1.item(discountprice).value)/form1.item(price).value*100;
}
function floatRound(myFloat,mfNumber)
{
var cutNumber = Math.pow(100,mfNumber-1);
return Math.round(myFloat * cutNumber)/cutNumber;
}
</script>
<%set objcheck=nothing%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -