📄 dx_defective.asp
字号:
<!--#include file="Inc/Config.asp"-->
<!--#include file="inc/Dx_admin_check.asp"-->
<%
if request.Form.Count>0 then
sql="select*from dx_product where dx_product_id="&request("product1")&""
rs.open sql,conn,1,1
dx_ToDepot_product=rs("dx_product_id")
rs.close
if request("radiobutton")="0" then
sql="select*from dx_defective"
rs.open sql,conn,3,3
rs.addnew
rs("dx_defective_product")=dx_ToDepot_product '商品编号
rs("dx_defective_count")=request("number") '商品数量
rs("dx_defective_type")=0 '处理方式
rs("dx_defective_out")=request("price_de")*request("number") '退款金额
rs("dx_defective_user")=Session("Dx_Admin")
rs.update
call ShowErr("退款成功类!","1")
rs.close
else
if request("product2")="-1" or request("count2")="-1" then
call ShowErr("请选择商品或数量","1")
response.End()
end if
sql="select*from dx_defective "
rs.open sql,conn,3,3
rs.addnew
rs("dx_defective_product")=dx_ToDepot_product '商品编号
rs("dx_defective_toproduce1")=request("product2") '退换商品1
rs("dx_defective_tocount1")=request("count2") '退换商品1数量
if request("product3")="-1" or request("count3")="-1" then
rs("dx_defective_toproduce2")=0 '退换商品2
rs("dx_defective_tocount2")=0 '退换商品2数量
else
rs("dx_defective_toproduce2")=request("product3") '退换商品2
rs("dx_defective_tocount2")=request("count3") '退换商品2数量
end if
rs("dx_defective_type")=1 '次品处理 1换 0退款
rs("dx_defective_time")=now()
rs("dx_defective_user")=Session("Dx_Admin")
rs.update
rs.close
sql="select*from dx_ToDepot where dx_ToDepot_product="&request("product2")&" "
rs.open sql,conn,3,3
Dim de_num,b
b=0
de_num=Cint(request("count2"))
if not rs.eof then
while (not rs.eof) and de_num>b
b=b+rs("dx_ToDepot_now_count")
d=rs("dx_ToDepot_now_count")
id=rs("dx_ToDepot_id")
rs("dx_ToDepot_now_count")=0
rs.movenext
wend
end if
rs.close
sql="select*from dx_ToDepot where dx_ToDepot_id="&id
rs.open sql,conn,1,3
rs("dx_ToDepot_now_count")=b-de_num
rs.update
rs.close
if request("checkbox")<>"" then
if request("product3")="-1" or request("count3")="-1" then
call ShowErr("请选择商品或数量","1")
response.End()
end if
sql="select*from dx_ToDepot where dx_ToDepot_product="&request("product3")&" "
rs.open sql,conn,3,3
Dim de_num2,b2
b2=0
de_num2=Cint(request("count3"))
if not rs.eof then
while (not rs.eof) and de_num2>b2
b2=b2+rs("dx_ToDepot_now_count")
d2=rs("dx_ToDepot_now_count")
id2=rs("dx_ToDepot_id")
rs("dx_ToDepot_now_count")=0
rs.movenext
wend
end if
rs.close
sql="select*from dx_ToDepot where dx_ToDepot_id="&id2
rs.open sql,conn,1,3
rs("dx_ToDepot_now_count")=b2-de_num2
rs.update
rs.close
end if
response.Write("<script> alert('商品退换成功');location.href='Dx_defective.asp'</script>")
end if
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=WebName%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Css/style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="Js/Fun.js"></script>
<script language="javascript" src="Ajax/Ajax_func.js"></script>
<style>
body {
background-color:#FFFFFF;
}
</style>
</HEAD>
<BODY>
<script language="javascript">
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring (Count, Count+1);
if (RefString.indexOf (TempChar, 0)==-1)
return (false);
}
return (true);
}
opNum=-1;
function getNext(num,type){
opNum=num;
if (type=='1'){
var obj=document.getElementById("depot"+num);
var index=obj.selectedIndex; //序号,取当前选中选项的序号
var val = obj.options[index].value;//获取前一个select选中的值
send_request("GET","chosenProduct.asp?depot="+val+"&type="+type+"",null,"text",Feedback_1);
}
else if(type=='2'){
var obj=document.getElementById("depot"+num);
var index=obj.selectedIndex;
var val = obj.options[index].value;
var obj2=document.getElementById("class"+num);
var index2=obj2.selectedIndex;
var val2=obj2.options[index2].value;
send_request("GET","chosenProduct.asp?depot="+val+"&class="+val2+"&type="+type+"",null,"text",Feedback_2);
}
else if(type=='3'){
var obj=document.getElementById("depot"+num);
var index=obj.selectedIndex;
var val = obj.options[index].value;
var obj2=document.getElementById("class"+num);
var index2=obj2.selectedIndex;
var val2=obj2.options[index2].value;
var obj3=document.getElementById("brand"+num);
var index3=obj3.selectedIndex;
var val3=obj3.options[index3].value;
send_request("GET","chosenProduct.asp?depot="+val+"&class="+val2+"&brand="+val3+"&type="+type+"",null,"text",Feedback_3);
}
else if(type=='4'){
var obj4=document.getElementById("product"+num);
var index4=obj4.selectedIndex;
var val4=obj4.options[index4].value;
send_request("GET","chosenProduct.asp?product="+val4+"&type="+type+"",null,"text",Feedback_4);
}
}
function Feedback_1() {
if (http_request.readyState == 4) { // 判断对象状态
if (http_request.status == 200) { // 信息已经成功返回,开始处理信息
var obj=document.getElementById("class"+opNum);
obj.options.length=0;
var next=http_request.responseText;
next=next.split('&');
for (i=0;i<next.length;i++){
var next2=next[i].split('$');
obj.options.add(new Option(next2[0],next2[1]));
}
var obj=document.getElementById("brand"+opNum);//清空后面部分,防止返回重选的情况
obj.options.length=0;
obj.options.add(new Option('请选择','-1'));
var obj=document.getElementById("product"+opNum);
obj.options.length=0;
obj.options.add(new Option('请选择','-1'));
var obj=document.getElementById("count"+opNum);
obj.options.length=0;
obj.options.add(new Option('请选择','-1'));
document.getElementById("price"+opNum).value="";
}
else { //页面不正常
alert("您所请求的页面有异常。");
}
}
}
function Feedback_2() {
if (http_request.readyState == 4) { // 判断对象状态
if (http_request.status == 200) { // 信息已经成功返回,开始处理信息
var obj=document.getElementById("brand"+opNum);
obj.options.length=0;
var next=http_request.responseText;
next=next.split('&');
for (i=0;i<next.length;i++){
var next2=next[i].split('$');
obj.options.add(new Option(next2[0],next2[1]));
}
var obj=document.getElementById("product"+opNum);
obj.options.length=0;
obj.options.add(new Option('请选择','-1'));
var obj=document.getElementById("count"+opNum);
obj.options.length=0;
obj.options.add(new Option('请选择','-1'));
document.getElementById("price"+opNum).value="";
}
else { //页面不正常
alert("您所请求的页面有异常。");
}
}
}
function Feedback_3() {
if (http_request.readyState == 4) { // 判断对象状态
if (http_request.status == 200) { // 信息已经成功返回,开始处理信息
var obj=document.getElementById("product"+opNum);
obj.options.length=0;
var next=http_request.responseText;
next=next.split('&');
for (i=0;i<next.length;i++){
var next2=next[i].split('$');
obj.options.add(new Option(next2[0],next2[1]));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -