?? rkth.asp
字號:
<!--#include file="cart_rt.asp"-->
<%
ys=0
ws=0
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open application("dsn")
sql="select * from tab_kucun"
rs.open sql,conn,1,3
if rs.eof then
response.write "<div align=center><font color=red>暫時沒有庫存!</font></div>"
response.End()
end if
%>
<%'顯示商品信息
set rs_sp=server.createobject("adodb.recordset")
sql="select spname from tab_kucun group by spname"
rs_sp.open sql,conn,1,3
defaultSP=trim(rs_sp("spname"))
rs_sp.movefirst
set rs_gg1=server.CreateObject("ADODB.RecordSet")
sql="select * from tab_kucun where spname='"&defaultSP&"'"
rs_gg1.open sql,conn,1,3
defaultGG=rs_gg1("gg")
defaultdj=rs_gg1("dj")
defaultdw=rs_gg1("dw")
%>
<% '得到供應商信息
set gysrs=server.CreateObject("adodb.recordset")
sql="select * from tab_gysinfo"
gysrs.open sql,conn,1,3
%>
<%
'保存到購物車
Q_spid=request.QueryString("SPID")
Q_DJ=request.QueryString("dj")
Q_SL=request.QueryString("SL")
if Q_spid<>"" and Q_DJ>=0 and Q_SL>=0 then
if isarray(session("arr_rt")) then
arr=session("arr_rt")
For I = 0 To ubound(arr,1)
flag=false '標記新添加的商品信息是否存在
if Q_spid=arr(I,0) then '當商品信息添加重復時
arr(I,2)=cint(arr(I,2))+cint(Q_SL) '累加商品數量
session("arr_rt")=arr
flag=true
exit for
end if
Next
if not flag then
call cart(Q_spid,Q_DJ,Q_SL) '將商品信息添加至購物車
end if
else
call cart(Q_spid,Q_DJ,Q_SL) '將商品信息添加至購物車
end if
end if
%>
<html>
<head>
<script language="javascript">
function changesp(value){
url="rkth.asp?SPname="+value;
window.location.href=url;
}
function changeGG(value){
url="rkth.asp?GG="+value+"&SPname="+myform.spname.value;
window.location.href=url;
}
function send(){
if(myform.jsr.value==""){
alert("請輸入經手人!");myform.jsr.focus();return;
}
if(myform.ys.value==0){
alert("請選擇想要入庫退貨的商品!");return;
}
myform.submit();
}
</script>
<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="rkth_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="14%" height="32" align="center" nowrap> 操 作 員:</td>
<td width="51%" bgcolor="#CCE3FF" >
<input type="text" name="czy" value="<%=session("name")%>" size="12" onKeyUp="k3()" readonly="yes">
<input name="flag" type="hidden" id="flag" value=<%=sell%>></td>
<td width="10%" align="center">退貨時間:</td>
<td width="25%" >
<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="42%" height="24">商品名稱</td>
<td width="21%">規格</td>
<td width="14%">單價</td>
<td width="16%">數量</td>
<td width="7%">操作</td>
</tr>
<%if isarray(session("arr_rt")) then
arr=session("arr_rt")
For I = 0 To ubound(arr,1)
arr_spid=arr(I, 0)
arr_dj=arr(I,1)
arr_sl=arr(I,2)
if arr_sl<=0 then
arr_sl=1
end if
set arr_rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from tab_kucun where id='"&arr_spid&"'"
arr_rs.open sql,conn,1,3
if arr_rs.eof and arr_rs.bof then
response.Write("<script>alert('您的操作有誤!');window.location.href='rkth.asp';</script>")
session("arr_rt")=""
response.End()
else
arr_spname=arr_rs("spname")
arr_gg=arr_rs("GG")
ys=ys+arr_dj*arr_sl
ws=ys
%>
<tr>
<td height="26" class="word_yellow"><%=arr_spname%></td>
<td class="word_yellow"><%=arr_GG%></td>
<td align="center" class="word_yellow"><%=arr_dj%></td>
<td align="center" class="word_yellow"><%=arr_sl%></td>
<td align="center"><img src="../images/move.gif" width="16" height="17" alt="刪除入庫退貨記錄" onClick="window.location.href='remove_rt.asp?spid=<%=arr_spid%>'"></td>
</tr>
<% end if
Next
end if%>
<tr>
<%spname=request.QueryString("SPname")
if spname="" then
spname=defaultSP
end if
%>
<td><select name="spname" id="select4" onChange="changesp(this.value)" style="width:256px;">
<% while not rs_sp.eof %>
<option value="<%=trim(rs_sp("spname"))%>" <%if trim(rs_sp("spname"))=spname then response.Write(" selected")%> ><%=rs_sp("spname")%></option>
<%
rs_sp.movenext
wend%>
</select></td>
<td><select name="GG" id="select5" onChange="changeGG(this.value)">
<%
GG_Q=request.QueryString("GG")
set rs_select=server.CreateObject("ADODB.RecordSet")
sql="select * from tab_kucun where spname='"&trim(spname)&"'"
rs_select.open sql,conn,1,3
while not rs_select.eof
gg=rs_select("gg")
if GG_Q="" then
GG_Q=gg
dw=defaultdw
dj=defaultdj
End if
%>
<option value="<%=gg%>" <%if GG_Q=gg then response.Write(" selected")%>><%=gg%></option>
<%
rs_select.movenext
wend%>
</select></td>
<%
set rs_GG=server.CreateObject("ADODB.RecordSet")
sql="select * from tab_kucun where spname='"&spname&"' and gg='"&GG_Q&"'"
rs_GG.open sql,conn,1,3
spID=trim(rs_GG("id"))
dj=rs_GG("dj")
dw=rs_GG("dw")
%>
<td align="center"><input name="dj" type="text" id="dj" value="<%=dj%>" size="12" ></td>
<td align="center"><input name="sl" type="text" id="sl" value="0" size="5" onKeyDown="if(event.keyCode==13) sell()">
<font color="#0099ff">[ <%=dw%>]
<input name="spid" type="hidden" id="spid" value="<%=spID%>">
</font></td>
<script language="javascript">
function sell(){
if (myform.dj.value==0){
alert("請輸入單價!");myform.dj.focus();return;
}
if (myform.sl.value==0){
alert("請輸入入庫退貨數量!");myform.sl.focus();return;
}
if (isNaN(myform.sl.value)){
alert("您輸入的入庫退貨數量有誤,請重新輸入!");
myform.sl.focus();myform.sl.value="";return;
}
FSPID=myform.spid.value;
FDJ=myform.dj.value;
FSL=myform.sl.value;
url="rkth.asp?SPID="+FSPID+"&DJ="+FDJ+"&SL="+FSL;
window.location.href=url;
}
</script>
<td align="center"><input name="Submit2" type="button" class="btn_grey" onClick="sell();" value="入庫退貨"></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCE3FF">
<td height="29" align="center" nowrap> <table width="99%" height="55" border="0" cellpadding="-2" cellspacing="-2" class="tableBorder">
<tr>
<td align="center" nowrap>供應商全稱:</td>
<td><select name="gysname">
<%while not gysrs.eof%>
<option value="<%=gysrs("name")%>"><%=gysrs("name")%></option>
<%
gysrs.movenext
wend%>
</select> </td>
<td align="center">結算方式:</td>
<td ><select name="jsfs">
<option value="現金" selected>現金 </option>
<option value="支票">支票 </option>
<option value="掛賬">掛賬 </option>
<option value="預付">預付 </option>
</select></td>
</tr>
<tr>
<td width="14%" height="29" align="center" nowrap> 應 收:</td>
<td width="49%"><input name="ys" type="text" readonly="yes" id="ys" value="<%=ys%>" size="12">
(元) </td>
<td width="14%" align="center">未 收:</td>
<td width="23%"><input type="text" name="ws" size="12" value="<%=ws%>" readonly="yes">
(元)</td>
</tr>
<tr>
<td height="30" align="center" nowrap> 實 收:</td>
<script language="javascript">
function calc_ws(){
if(isNaN(myform.ss.value)){
alert("您輸入的實收金額有誤!");
myform.ss.focus();
return;
}
myform.ws.value=myform.ys.value-myform.ss.value;
}
</script>
<td><input type="text" name="ss" size="12" value="0" onBlur="calc_ws()" 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="取消操作"> </td>
</tr>
</table>
</form>
<!--#include file="../Bottom.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -