⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chu_tiaoma_action.asp

📁 1.多种查询方式
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<% 
response.buffer=true
Response.Expires = 0
Response.CacheControl = "Private"
%>
<!-- #include file=../data/username.inc-->
<!-- #include file=../data/connect.asp-->
<!--#include file=../data/myPrg.asp-->
<%
newcompanyid = request("companyid")
if newcompanyid = "" then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""请先选择公司再做此步操作!"");"
	Response.write "history.go(-1);"
	Response.Write "</script>"
	Response.End 
elseif not isnumeric(newcompanyid) then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""companyid必须为整数!"");history.go(-1);"
	Response.Write "</script>"
	Response.End
else
	newcompanyid = cint(newcompanyid) 
end if
arra = split(session("username"),";")
UserCompanyid = arra(0)
flag = arra(1)
User = arra(2)
userno = arra(4)
if flag = 5 then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""您无权对此数据进行操作!!!"");history.go(-1);"
	Response.Write "</script>"
	Response.End 
end if
%>
<%const title="条形码录入"%>
<html>
<head>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
<title><%=title%></title>
</head>
<body topmargin="0">
<%
id = request("id")
if not isnumeric(id) then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""id必须为整数!"");history.go(-1);"
	Response.Write "</script>"
	Response.End
end if
detail_id = request("detail_id")
if not isnumeric(detail_id) then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""detail_id必须为整数!"");history.go(-1);"
	Response.Write "</script>"
	Response.End
end if
tiaoma_no = trim(request("tiaoma_no"))
inwa_xianghao = trim(request("inwa_xianghao"))
if inwa_xianghao = "" then 
	inwa_xianghao = " "
else
	inwa_xianghao = replace(inwa_xianghao,"'","’")
end if
sql = "select elink_outw_date,elink_dc_id,elink_outw_id from outward_elink where elink_id = "&id&""
'Response.Write sql
'Response.End 
set rs_in = conn.execute(sql)
if not rs_in.eof then
	inwa_date = rs_in("elink_outw_date")
	dc_id = rs_in("elink_dc_id")
	outw_id = rs_in("elink_outw_id")
		iyear = year(inwa_date)
		imonth = month(inwa_date)
		if imonth < 10 then imonth = "0"&imonth 
		idata = "o"&iyear&imonth&newcompanyid
else
	rs_in.close
	set rs_in = nothing
	call closedatabase
	Response.Write "该记录可能已经被删除!请确认"
	Response.End 
end if
rs_in.close
set rs_in = nothing
sql = "select detail_no,detail_prod_id from outward_detail where detail_id = "&detail_id&""
set rs_in = conn.execute(sql)
if not rs_in.eof then
	detail_no = rs_in("detail_no")
	prod_id = rs_in("detail_prod_id")
else
	rs_in.close
	set rs_in = nothing
	call closedatabase
	Response.Write "该记录可能已经被删除!请确认"
	Response.End 
end if
rs_in.close
set rs_in = nothing
sql = "select count(out_info_id) as ko from "&idata&" where out_detail_id = "&detail_id&"" 
set rs_in = conn.execute(sql)
if not rs_in.eof then
	ko = rs_in("ko")		
else
	ko = 0
end if
rs_in.close
set rs_in = nothing
	if (clng(ko)+clng(tiaoma_no)) > clng(detail_no) then
		call closedatabase
		Response.Write "<script language=javascript>"
		Response.Write "alert(""数量不对,请确认!!!"");"
		Response.Write "history.go(-1);"
		Response.Write "</script>"
		Response.End 
	end if
	
		'需加检验(现未加) 本次录入是否有相同的条码
		for i = 1 to tiaoma_no
			code = trim(request("c"&i&""))
			if code = "" then
				call closedatabase
				Response.Write "<script language=javascript>"
				Response.Write "alert(""条码不得有空格,请确认!!!"");"
				Response.Write "history.go(-1);"
				Response.Write "</script>"
				Response.End
			else
				code = replace(code,"'","’")
			end if
			sql = "select out_info_id from " &idata &" where out_detail_id = "&request("detail_id")&" and out_info_code = '"&code&"'"
			set info = conn.execute(sql)
			if not info.eof then
				info.close
				set info = nothing
				call closedatabase
				Response.Write "<script language=javascript>"
				Response.Write "alert(""该条码 "&code&" 已经存在,请确认!!!"");"
				Response.Write "history.go(-1);"
				Response.Write "</script>"
				Response.End
			end if
		next
				
		for i = 1 to tiaoma_no
			code = trim(request("c"&i&""))
			code = replace(code,"'","’")
			sql = "select out_info_id from " &idata &" where out_detail_id = "&request("detail_id")&" and out_info_code = '"&code&"'"
			set info = conn.execute(sql)
			if info.eof then
				sql = "insert into " & idata &"(out_elink_id,out_detail_id,out_prod_id,out_dc_id,out_companyid,out_date,out_info_xianghao,out_info_code,out_outw_id) values("&id&","&detail_id&","&prod_id&","&dc_id&","&newcompanyid&",'"&inwa_date&"','"&inwa_xianghao&"','"&code&"',"&outw_id&")"
				conn.execute(sql)
			end if
			info.close
			set info = nothing
		next

	if (clng(ko)+clng(tiaoma_no)) = clng(detail_no) then
		sql = "update outward_detail set detail_io_flag = 1 where detail_id = "&request("detail_id")&""
		conn.execute(sql)
		sql = "select detail_id from outward_detail where detail_outw_id = "&outw_id&" and detail_io_flag = 0 "
		set rs_co = conn.execute(sql)
		if rs_co.eof then
			sql = "update outward set tiaoma_flag = 1 where outw_id = "&outw_id&""
			conn.execute(sql)
		end if
		rs_co.close
		set rs_co = nothing
		call closedatabase
		Response.Write "<script language=javascript>"
		Response.Write "opener.location.reload();"
		Response.Write "window.close();"
		Response.Write "</script>"
		Response.End 
	else
		call closedatabase
		Response.Write "<script language=javascript>"
		Response.Write "window.location.href=""chu_luru_tiaoma.asp?id="&id&"&detail_id="&detail_id&"&no="&detail_no&"&companyid="&newcompanyid&""";"
		Response.Write "</script>"
		Response.End
	end if
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -