📄 sales_in_store.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp"-->
<html>
<head>
<title>∷企业生产管理信息系统∷</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/main.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="css/User_Info_Modify.js"></SCRIPT>
<SCRIPT language=javascript src="js/selectcity.js"></script>
<script language="JavaScript" src="js/validate.js" type="text/JavaScript"></script>
<SCRIPT language=javascript src="css/init.js"></SCRIPT>
<style type="text/css">
<!--
td { font-family: "宋体"; font-size: 9pt}
body { font-family: "宋体"; font-size: 9pt}
select { font-family: "宋体"; font-size: 9pt}
A {text-decoration: none; color: #336699; font-family: "宋体"; font-size: 9pt}
A:hover {text-decoration: underline; color: #FF0000; font-family: "宋体"; font-size: 9pt}
-->
</style>
<SCRIPT LANGUAGE=javascript>
<!--
function Juge(powersearch)
{
if (powersearch.zongliang.value == "")
{
alert("运输数量不能为空!");
powersearch.zongliang.focus();
return (false);
}
if (powersearch.yunjia.value == "")
{
alert("运价不能为空!");
powersearch.yunjia.focus();
return (false);
}
if (powersearch.yufukuan.value == "")
{
alert("预付运费不能为空!");
powersearch.yufukuan.focus();
return (false);
}
if (powersearch.chehao.value == "")
{
alert("车号不能为空!");
powersearch.chehao.focus();
return (false);
}
}
function SelectAll() {
for (var i=0;i<document.selform.selBigClass.length;i++) {
var e=document.selform.selBigClass[i];
e.checked=!e.checked;
}
}
//-->
</script>
</HEAD>
<BODY topMargin=0 rightMargin=0 leftMargin=0>
<!--#include file="top.asp"--><% dim sql,rs
select case request("action")
case "add"
call SaveAdd()
case "modify"
call SaveModify()
case "del"
call delCate()
case "edit"
isEdit=True
call myform(isEdit)
case "view"
isEdit=True
call myform(isview)
case else
isEdit=False
call myform(isEdit)
end select
sub SaveAdd
gouhuodanwei=trim(request.Form("yonghu"))
chehao=trim(request.Form("chehao"))
zongliang = request.Form("zongliang")
yunjia = request.Form("yunjia")
yunfei = zongliang * yunjia
yufukuan = request.Form("yufukuan")
shengyukuan = yunfei - yufukuan
bianhao1=trim(request.Form("bianhao"))
set rs1=server.createobject("adodb.recordset")
sql1="select * from yunshu where bianhao='"&bianhao1&"'"
rs1.open sql1,conn,1,3
if not rs1.eof and not rs1.bof then
rs1("yunfei")=rs1("yunfei")+shengyukuan
else
rs1.addnew
rs1("danwei") = gouhuodanwei
rs1("bianhao") = bianhao1
rs1("yunshu_name") = chehao
rs1("yunfei") = shengyukuan
rs1("yifuyunfei")=yufukuan
rs1("jiezhang_time")=request.Form("uptime")
end if
rs1.update
rs1.close
set rs1=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from sales_in_store"
rs.open sql,conn,1,3
rs.addnew
rs("bianhao") = trim(request.Form("bianhao"))
rs("uptime") = request.Form("uptime")
rs("yonghu") = trim(request.Form("yonghu"))
rs("baozhuang") = trim(request.Form("baozhuang"))
rs("chanpin") = trim(request.Form("chanpin"))
rs("zongliang") = request.Form("zongliang")
rs("shijishu") = request.Form("shijishu")
rs("kouchushu") = rs("zongliang") - rs("shijishu")
rs("kouchuyunfei") = request.Form("kouchuyunfei")
rs("yunjia") = request.Form("yunjia")
rs("yunfei") = rs("zongliang") * rs("yunjia")
rs("yufukuan") = request.Form("yufukuan")
rs("shengyukuan") = rs("yunfei") - rs("yufukuan") - rs("kouchuyunfei")
rs("chehao") = trim(request.Form("chehao"))
rs("end_time") = request.Form("end_time")
rs("content") = trim(request.Form("content"))
rs.update
response.Write "<script language=javascript>alert('添加成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=sales_in_store.asp"">"
response.end
rs.close
set rs=nothing
end sub
sub SaveModify
gouhuodanwei = trim(request.Form("yonghu"))
bianhao1=trim(request.Form("bianhao"))
chehao=trim(request.Form("chehao"))
zongliang = request.Form("zongliang")
yunjia = request.Form("yunjia")
yunfei = zongliang * yunjia
yufukuan = request.Form("yufukuan")
shengyukuan = yunfei - yufukuan
set rs1=server.createobject("adodb.recordset")
sql1="select * from yunshu where bianhao='"&bianhao1&"'"
rs1.open sql1,conn,1,3
if not rs1.eof and not rs1.bof then
rs1("yunfei")=rs1("yunfei")+shengyukuan
else
rs1.addnew
rs1("danwei") = gouhuodanwei
rs1("bianhao") = bianhao1
rs1("yunshu_name") = chehao
rs1("yunfei") = shengyukuan
rs1("jiezhang_time")=request.Form("uptime")
end if
rs1.update
rs1.close
set rs1=nothing
gouhuodanwei = trim(request.Form("yonghu"))
bianhao1=trim(request.Form("bianhao"))
chehao=trim(request.Form("chehao"))
zongliang = request.Form("zongliang")
shijishu = request.Form("shijishu")
yunjia = request.Form("yunjia")
if shijishu>zongliang then
yunfei = zongliang * yunjia
else
yunfei = shijishu * yunjia
end if
kouchuyunfei = request.Form("kouchuyunfei")
yufukuan = request.Form("yufukuan")
shengyukuan = yunfei - yufukuan - kouchuyunfei
set rs1=server.createobject("adodb.recordset")
sql1="select * from yunshu where bianhao='"&bianhao1&"'"
rs1.open sql1,conn,1,3
if not rs1.eof and not rs1.bof then
rs1("yifuyunfei")=yufukuan
rs1("yunfei")=shengyukuan
else
rs1.addnew
rs1("danwei") = gouhuodanwei
rs1("bianhao") = bianhao1
rs1("yunshu_name") = chehao
rs1("yifuyunfei") = yufukuan
rs1("yunfei") = shengyukuan
rs1("jiezhang_time")=request.Form("uptime")
end if
rs1.update
rs1.close
set rs1=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from sales_in_store where id="&request.Form("id")
rs.open sql,conn,1,3
rs("bianhao") = trim(request.Form("bianhao"))
rs("uptime") = request.Form("uptime")
rs("yonghu") = trim(request.Form("yonghu"))
rs("baozhuang") = trim(request.Form("baozhuang"))
rs("chanpin") = trim(request.Form("chanpin"))
rs("zongliang") = request.Form("zongliang")
rs("shijishu") = request.Form("shijishu")
rs("kouchushu") = rs("zongliang") - rs("shijishu")
rs("kouchuyunfei") = request.Form("kouchuyunfei")
rs("yunjia") = request.Form("yunjia")
if shijishu>zongliang then
rs("yunfei") = rs("zongliang") * rs("yunjia")
else
rs("yunfei") = rs("shijishu") * rs("yunjia")
end if
rs("yufukuan") = request.Form("yufukuan")
rs("shengyukuan") = rs("yunfei") - rs("yufukuan") - rs("kouchuyunfei")
rs("chehao") = trim(request.Form("chehao"))
rs("end_time") = request.Form("end_time")
rs("content") = trim(request.Form("content"))
rs.update
response.Write "<script language=javascript>alert('修改成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=sales_in_store.asp"">"
response.end
rs.close
set rs=nothing
end sub
sub delCate()
conn.execute("delete from sales_in_store where id in ("&Request.Form("selBigClass")&")")
response.Write "<script language=javascript>alert('删除成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=sales_in_store.asp"">"
response.end
end sub
%> <% sub myform(isEdit) %>
<TABLE width=800 align=center border="1" cellspacing="0" cellpadding="0" bordercolor="#0055E6">
<TBODY>
<TR>
<td align="center" valign="top">
<%if oskey="supper" or oskey="xiaoshou" then%>
<%
set rs=server.createobject("adodb.recordset")
if isedit then
rs.open "select * from sales_in_store where id=" & request("id"),conn,1,1
%>
<table width="800" border="0" cellpadding="0" cellspacing="0" >
<tr >
<td height=26 background="images/background.gif">
<b><font color="#ffffff">编辑供货单位信息</font></b>
</td>
</tr>
</table>
<%
else
%>
<table width="800" border="0" cellpadding="0" cellspacing="0" >
<tr >
<td height=26 background="images/background.gif">
<b><font color="#ffffff">添加供货单位信息</font></b>
</td>
</tr>
</table>
<%end if %>
<table width="800" border="0" cellpadding="0" cellspacing="0" bordercolor="#0055E6">
<tr class="but">
<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">销售日期</td>
<td width="15%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">购货单位</td>
<td width="5%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">产品等级</td>
<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">运输数量</td>
<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">包装</td>
<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">卸货重量</td>
<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">卸货短吨</td>
</tr>
<form name="reg" method="post" action="sales_in_store.asp" onSubmit="return Juge(this)" >
<tr> <input type="Hidden" name="action" value='<% If isedit then%>modify<% Else %>add<% End If %>'>
<% If isedit then%><input type="Hidden" name="id" value="<%=rs("id")%>"> <% End If %>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'">
<input name="uptime" onFocus="show_cele_date(uptime,'','',uptime)" type="text" size="10" value='<% if isedit then
response.write rs("uptime")
else
response.write date()
end if %>'></td>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><select name="yonghu" size="1" style='width:150'>
<% if isedit then%><option ><%=rs("yonghu")%></option><%end if%>
<%
set rs3=server.createobject("adodb.recordset")
rs3.open "select * from Owner",conn,1,1
if not rs3.eof then
do while not rs3.eof
%>
<option <% if isedit then
if trim(rs3("Owner_name"))=trim(rs("yonghu")) then
%> selected="selected"<%end if%><%end if%>><%=rs3("Owner_name")%></option>
<%
rs3.movenext
loop
end if
rs3.close
set rs3=nothing
%>
</select>
</td>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><select name="chanpin" size="1" style='width:100'>
<% if isedit then%><option ><%=rs("chanpin")%></option><%end if%>
<%
set rs3=server.createobject("adodb.recordset")
rs3.open "select * from dengji",conn,1,1
if not rs3.eof then
do while not rs3.eof
%>
<option <% if isedit then
if trim(rs3("dengjiname"))=trim(rs("chanpin")) then
%> selected="selected"<%end if%><%end if%>><%=rs3("dengjiname")%></option>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -