📄 spxsth.asp
字号:
<!--#include file="../conn/conn.asp"-->
<%
yf=0
wf=0
set conn=server.createobject("adodb.connection")
conn.open application("dsn")
%>
<%'显示商品信息
set rs_id=server.createobject("adodb.recordset")
sql="select * from tab_sell_main"
rs_id.open sql,conn,1,3
if request.QueryString("selectid")<>"" then
selid=request.QueryString("selectid")
else
selid=rs_id("sellid")
End if
set rs=server.createobject("adodb.recordset")
sql="select * from tab_sell_detail sell inner join tab_spinfo sp on sell.spid=sp.id where sell.id='"&selid&"'"
rs.open sql,conn,1,3
set rs_1=server.createobject("adodb.recordset")
sql="select * from tab_sell_main where sellid='"&selid&"'"
rs_1.open sql,conn,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品入库</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action="spxsth_deal.asp" method="post" name="myform">
<table width="97%" border="0" align="center" class="tableBorder" cellpadding="0" cellspacing="0">
<tr>
<td height="25" nowrap bgcolor="#FF9933" class="word_white"> 当前位置:商品销售> 商品销售退货> 商品销售退货登记单 >>></td>
</tr>
<tr>
<td height="10" nowrap bgcolor="#CCE3FF" class="word_white"></td>
</tr>
<tr align="center">
<td height="44" valign="top" nowrap bgcolor="#CCE3FF">
<table width="99%" height="34" border="0" cellpadding="-2" cellspacing="-2" bordercolor="#CCE3FF" bordercolorlight="#FFFFFF" bordercolordark="#CCE3FF" class="tableBorder">
<tr>
<td width="13%" height="32" align="center" nowrap>请选择销售单号:</td>
<script language="javascript">
function selxsID(para){
url="spxsth.asp?selectid="+para;
window.location.href=url;
}
</script>
<td width="37%" bgcolor="#CCE3FF" >
<select name="xsID" id="xsID" onChange="selxsID(this.value)">
<%for j=1 to rs_id.recordcount%>
<option value="<%=rs_id("sellid")%>" <%if rs_id("sellid")=selid then response.Write(" selected")%>><%=rs_id("sellid")%></option>
<%rs_id.movenext
next%>
</select></td>
<td width="9%" align="right" bgcolor="#CCE3FF" >操作员:</td>
<td width="13%" bgcolor="#CCE3FF" ><input type="text" name="czy" value="<%=session("name")%>" size="12" onKeyUp="k3()" readonly="yes"></td>
<td width="9%" align="right">退货时间:</td>
<td width="19%" ><input type="text" name="xsdate" readonly="yes"value="<%=now()%>" size="18"></td>
</tr>
</table></td>
</tr>
<tr align="center" valign="top"bgcolor="#CCE3FF">
<td height="100" nowrap><table width="99%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#9CA6C6" bordercolordark="#CCE3FF">
<tr align="center" bgcolor="#CCE3FF">
<td width="30%" height="24">商品名称</td>
<td width="21%">规格</td>
<td width="17%">单价</td>
<td width="14%">数量</td>
<td width="18%">退货数量</td>
</tr>
<%
pzs=rs.recordcount
for i=1 to rs.recordcount%>
<tr>
<td height="26" class="word_yellow" style="padding-left:5px;"><%=rs("spname")%><font color="#0099ff">
<input name="spid<%=i%>" type="hidden" id="spid<%=i%>" value="<%=rs("spid")%>">
</font></td>
<td class="word_yellow" style="padding-left:5px;"><%=rs("gg")%></td>
<td align="center" class="word_yellow"><%=rs("dj")%>(元)<font color="#0099ff">
<input name="dj<%=i%>" type="hidden" id="dj<%=i%>" value="<%=rs("dj")%>">
</font></td>
<td align="center" class="word_yellow"><%=rs("sl")%><font color="#0099ff"> [ <%=rs("dw")%>]
<input name="ysl<%=i%>" type="hidden" id="ysl<%=i%>" value="<%=rs("sl")%>">
</font></td>
<script language="javascript">
function deal(thsl,ysl,dj,pzs){
if(isNaN(thsl.value)){
alert("您输入的退货数量有误!");
thsl.focus();
return;
}
if(thsl.value-ysl.value>0){
alert("退货数量不能大于销售数量!");
thsl.focus();
return;
}
var yf=0; //获取应付金额
for(i=1;i<=pzs;i++){
sl=myform.elements["thsl"+i].value;
dj=myform.elements["dj"+i].value;
yf=yf+(dj*sl);
}
myform.yf.value=yf;
myform.wf.value=yf-myform.sf.value;
}
</script>
<td align="center" class="word_yellow"><input name="thsl<%=i%>" type="text" id="thsl" onBlur="deal(this.form.<%="thsl"&i%>,this.form.<%="ysl"&i%>,this.form.<%="dj"&i%>,<%=pzs%>)" onKeyUp="if(event.keyCode==13) myform.jsr.focus()" value="0" size="10">
<font color="#0099ff"> [ <%=rs("dw")%>]</font></td>
</tr>
<%rs.movenext
next%>
<tr>
<td height="26" colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="38%"class="word_yellow" style="padding-left:5px;">客户全称:<%=rs_1("khname")%><font color="#0099ff">
<input name="khname" type="hidden" value="<%=rs_1("khname")%>">
</font> </td>
<td width="15%"class="word_yellow">经手人:<%=rs_1("jsr")%></td>
<td width="16%"class="word_yellow"> 操作员:<%=rs_1("czy")%></td>
<td width="29%" align="right"class="word_yellow">销售日期:<%=rs_1("xsdate")%></td>
<td width="2%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCE3FF">
<td height="29" align="center" nowrap>
<table width="99%" border="0" cellpadding="-2" cellspacing="-2" class="tableBorder">
<tr>
<td width="12%" height="30" align="center" nowrap>结算方式:</td>
<td width="28%"><select name="jsfs">
<option value="现金" selected>现金 </option>
<option value="支票">支票 </option>
<option value="挂账">挂账 </option>
<option value="预付">预付 </option>
</select></td>
<script language="javascript">
function send(){
ifth=0;
for(i=1;i<=<%=pzs%>;i++){
sl=myform.elements["thsl"+i].value;
if (sl!=0){
ifth=1;
break;
}
}
if(ifth==0){
alert("请输入退货数量!");return;
}
if(myform.jsr.value==""){
alert("请输入经手人!");myform.jsr.focus();return;
}
if(myform.yf.value==0){
alert("请选择想要入库的商品!");return;
}
myform.submit();
}
</script>
<td width="7%">应付:</td>
<td width="26%"><input name="yf" type="text" readonly="yes" id="yf2" value="<%=yf%>" size="12">
(元) </td>
<td width="9%" align="center">未 付:</td>
<td width="18%" ><input name="wf" type="text" id="wf2" value="<%=wf%>" size="12" readonly="yes">
(元)</td>
</tr>
<tr>
<td height="30" align="center" nowrap> 实 付:</td>
<script language="javascript">
function calc_wf(){
if(isNaN(myform.wf.value)){
alert("您输入的实付金额有误!");
myform.sf.focus();
return;
}
myform.wf.value=myform.yf.value-myform.sf.value;
}
</script>
<td colspan="3"><input type="text" name="sf" size="12" value="0" onBlur="calc_wf()" onKeyUp="if(event.keyCode==13) myform.jsr.focus()">
(元)<font color="#FF0000">*</font> </td>
<td align="center">经手人:</td>
<td>
<input name="jsr" type="text" value="" size="12" onKeyUp="if(event.keyCode==13) myform.save.focus()">
<font color="#FF0000">*</font> </td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCE3FF">
<td nowrap align="center" height="37"> <input name="save" type="button" class="btn_grey" id="save" onClick="send()" value="确定退货">
<input name="cancel" type="reset" class="btn_grey" id="cancel" value="取消操作">
<input name="pzs" type="hidden" id="pzs" value="<%=rs_1("pzs")%>">
</td>
</tr>
</table>
</form>
<!--#include file="../Bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -