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

📄 madd.asp

📁 一个比较完整的企业erp系统
💻 ASP
字号:
<%@language="vbscript" codepage="936"%>
<%
response.buffer = true
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
Public HOME_PATH:HOME_PATH = "../"
%>
<!--#include file="../db.asp"-->
<!--#include file="../inc/function.asp"-->
<%Public title:title = "添加商品入库"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><%=title%></title><%
  if isLogin = false then
     Response.Write viewinfo("LoginC","","")
	 Response.end
  end if
%>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link href="<%=HOME_PATH%>css/style01.css" rel="stylesheet" type="text/css">
<style>
html{min-width: 776px;}
fieldset {padding:3px;}
.tempA { border-top:1px solid #848284;border-left:1px solid #848284;border-bottom:1px #ffffff solid;border-right:1px solid #ffffff;background-color: transparent;}
.tempH { background-color:#08246B;color:#ffffff;}
</style>
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/layer00.js'></script>
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/dateselect.js'></script>
<script type = 'text/javascript'>
<!--//
var a = null ;
function newm() {
    a = window.showModalDialog('<%=HOME_PATH%>supplier/selectsupplierlist.asp?identifyCode=1','','dialogWidth:750px;dialogHeight:400px;scroll:yes;help:no;status:no;center:yes;edge:raised;');
   if (a!=null) {
       document.form.supplierCode.value = a[0];
       document.form.supplierid.value = a[1];
       document.form.supplierName.value = a[2];
       document.form.Linkman.value = a[3] + " " + a[4];
	 }
 }



 function price() {
   var inprice_ = form.inprice.value ;
   var inhow_ = form.inhow.value ;
   var amount_ = form.amount.value ;
   var inpayment_ = form.inpayment.value;
   form.amount.value = '总¥'+ inprice_ * inhow_ ;
   form.nopayment.value = '欠¥'+ (inprice_ * inhow_ - inpayment_) ;
   }
 

rv = Array("returnValue","parent.right") ;
window.returnValue = rv[1] ;
  
//-->
</script>
<base target="_self">

</head>
<body style = 'border-style:none;margin:0px;background-color:buttonface;'>
<div style = 'text-align:center;'>
<fieldset style = 'width:398px;padding:8px;'><legend>商品入库</legend>
<table border = '0' style = 'width:100%;' cellspacing = '0' cellpadding = '2'>

 <form method='post' action="<%=THF%>" name = 'form' >
 <input name = 'Options' type = 'hidden' value = 'Add'/>
 <tr>
	 <td style = 'text-align:right;width:60px;'>代码</td>
	 <td style = 'text-align:left;width:auto;'><input type = 'text' name = 'Code' style = 'width:110px;'/> 入库日期 <input type = 'text' name ='thisDate'onfocus="setday(this)" style = 'width:134px;' maxlength="10" readonly/> </td>
 </tr>
 <tr>
	 <td style = 'text-align:right;'>名称</td>
	 <td style = 'text-align:left;width:auto;'><input type = 'text' name = 'cName' style = 'width:110px;'/> 型  号 <input type = 'text' name = 'model' style = 'width:134px;'/></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>英文名称</td>
	 <td style = 'text-align:left;width:auto;'><input type = 'text' name = 'eName' style = 'width:100%;'/></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>英文描述</td>
	 <td style = 'text-align:left;width:auto;'><textarea name="eRemark" style = 'width:100%;height:40px;overflow-x:hidden;overflow-y:auto;'></textarea></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>型号条码</td>
	 <td style = 'text-align:left;width:auto;'><input type = 'text' name = 'typeCode' style = 'width:100%;'/></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>商品种类</td>
	 <%SQL = "Select * from mtype where mTypeSelect = 0 Order by mtypeArray desc , mtypeid desc"%>
	 <td style = 'text-align:left;width:auto;'><%=mtypeSub(SQL,Rmtypeid,"auto","mTypeSelect",mTypeALL)%>
	 
	 <input type = 'checkbox' name = 'Quality_' style = 'border-style:none;' onclick = "javascript:if(!form.Quality_.checked){Quality.style.display='none';}else{Quality.style.display='';}"/>
	 <span id = 'Quality' style = 'display:none;'>性质:<input type = 'text' name = 'Quality' style = 'width:60px;' /></span>
	 </td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>所属商家</td>
	 <%SQL = "select * from usertype where uTypeSelect = 0 order by uTypeArray desc, utypeid desc"%>
	 <td style = 'text-align:left;width:auto;'>
	   <table style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
	     <tr>
		   <td style = 'width:80px;'><input type = 'text' name =  'supplierCode' style = 'width:50px;border-right-style:none;' readonly/><input type = 'button' name = 'opensupplier' value = '…' style = 'width:20px;border-left-style:none;' onclick = "javascript:newm();"/></td>
		   <td style = 'width:auto;'><input type = 'hidden' name = 'supplierid' readonly/><input type = 'text' name = 'Linkman' style = 'width:100%;' class = 'tempA' readonly/></td>
		 </tr>
	  </table></td>
  </tr>
  <tr>
    <td></td>
	<td>
	 <input type = 'text' name = 'supplierName' style = 'width:100%;' class = 'tempA' readonly/></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>进 价</td>
	 <td style = 'text-align:left;width:auto;'>
	  <table style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
	   <tr>
		<td style = 'width:120px;'><input type = 'text' name = 'inprice' style = 'width:100%;' onkeyup = "javascript:price();"/></td>
		<td style = 'width:65px; text-align:right;'>销 价&nbsp;</td>
		<td style = 'width:120px;'><input type = 'text' name = 'outprice' style = 'width:100%;' /></td>
	   </tr>
	  </table></td>


 </tr>

 <tr>

	 <td style = 'text-align:right;'>进货数量</td>
	 <td style = 'text-align:left;width:auto;'>
	  <table style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
	   <tr>
		<td style = 'width:120px;'><input type = 'text' name = 'inhow' style = 'width:40%;'onkeyup = "javascript:price();"/><input id = 'amount' name = 'amount' style = 'border-style:none;width:58%;background-color: transparent;' onmouseover = "javascript:price();"/></td>
		<td style = 'width:65px; text-align:right;'>已付商家&nbsp;</td>
		<td style = 'width:120px;'><input type = 'text' name = 'inpayment' style = 'width:40%;' onkeyup = "javascript:price();"/><input id = 'nopayment' name = 'nopayment' style = 'border-style:none;width:58%;background-color: transparent;' onmouseover = "javascript:price();"/></td>
	   </tr>
	  </table></td>


 </tr>


 <tr>

	 <td style = 'text-align:right;'>库存上限</td>
	 <td style = 'text-align:left;width:auto;'>
	  <table style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
	   <tr>
		<td style = 'width:120px;'><input type = 'text' name = 'stockMax' style = 'width:100%;'/></td>
		<td style = 'width:65px; text-align:right;'>库存下限&nbsp;</td>
		<td style = 'width:120px;'><input type = 'text' name = 'stockMin' style = 'width:100%;'/></td>
	   </tr>
	  </table></td>


 </tr>
 <tr>

	 <td style = 'text-align:right;'>单位</td>
	 <td style = 'text-align:left;width:auto;'>
	  <table style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
	   <tr>
		<td style = 'width:120px;'><input type = 'text' name = 'unit' style = 'width:100%;'/></td>
		<td style = 'width:65px; text-align:right;'>保修期&nbsp;</td>
		<td style = 'width:120px;'><input type = 'text' name = 'guarantyTime' style = 'width:100%;'/></td>
	   </tr>
	  </table></td>


 </tr>
 <tr>

	 <td style = 'text-align:right;'>保修描述</td>
	 <td style = 'text-align:left;width:auto;'><input type = 'text' style = 'width:100%;' name = 'guarantyRemark'/></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>中文描述</td>
	 <td style = 'text-align:left;width:auto;'><textarea name="cRemark" style = 'width:100%;height:40px;overflow-x:hidden;overflow-y:auto;'></textarea></td>
 </tr>
 <tr>

	 <td style = 'text-align:right;'>是否可用</td>
	 <td style = 'text-align:left;width:auto;'>
	     <select style = 'width:50px;' name = 'disabled'>
			<option value = '1'>可用</option>
			<option value = '0'>禁用</option>
		 </select>
		 <input type="checkbox" name="repetition" value = 'YES' style = 'border-style:none;' checked = 'checked'/>检查商品名是否重复</td>
 </tr>
 <tr>

	 <td style = 'text-align:center;' colspan = '2'><input type="submit" value = ' 提交 ' onclick = "javascript:if(document.form.mTypeSelect.value=='') {alert('请选好商品种类的小类!  ');form.mTypeSelect.focus();return false;}else if(document.form.supplierCode.value==''){alert('请选好所属商家!  ');form.supplierCode.focus();form.supplierCode.className='tempH';return false;}else{return true;}"/></td>
 </tr>

 </form>
</table></fieldset>


<script language="javascript">
function Check(){
} 
</script>


<%
Options = trim(Request.Form("Options"))
if Options = "Add" then
   
   thisDate__ = trim(Request.form("thisDate"))
   if not isDate(thisDate__)then thisDate__ = SELVAR("YY","0000") & "-" & SELVAR("MM","0000") & "-" & SELVAR("DD","0000")
   mtypeid_ = GetText("mTypeSelect","P","number",1,10,0)'
   mtypeid_ = SelectZD("select mtypeid from mtype where mtypeid = " & mtypeid_ & "",0)
   if mtypeid_ = 0 then
	  Response.Write viewinfo("alertBack","请选好商品子类别!","")
	  Response.end
   end if
  
   supplierid_ = GetText("supplierid","P","number",1,10,0)'
   supplierid_ = SelectZD("select uid from supplier where uid = " & supplierid_ & "",0)
   if supplierid_ = 0 then
	  Response.Write viewinfo("alertBack","请选好所属商家!","")
	  Response.end
   end if


   cName = htmlencode(GetText("cName","P","Str",1,250,"none"),"Y")
   if trim(Request.Form("repetition")) = "YES" then
      if not Conn.Execute("select cName from stock where cName = '" & cName & "'").eof then
	     Response.Write viewinfo("alertBack","已经存在(" & cName & ")这个商品名了!请起另一个商品名","")
	     Response.end
	  end if
   end if

   SQL = "select * from stock where (stockid is null)"
   Rs.Open(SQL),Conn,1,3
      Rs.addnew


	  inpayment_ = GetText("inpayment","P","number",1,10,0)
	  inprice_ = GetText("inprice","P","number",1,10,0)'参考进货价
	  inhow_ = GetText("inhow","P","number",1,10,0)'数量

	  stockNum = SELVAR("stockNum","00000000")
	  Conn.Execute("insert into stockm (stockNum , plNum , supplierid , totalmoney , inpayment , nopayment , intotime , updatetime , thisDate , intoaid , selectaid ) values ('" & stockNum & "' , ' ' , " & supplierid_ & " , " & inprice_ * inhow_ & " , " & inpayment_ & " , " & inprice_ * inhow_ - inpayment_ & " , '" & now() & "' , '" & now() & "' , '" & thisDate__ & "' , " & Seuid_inc & " , " & Seuid_inc & ")")
	  isstockid = SelectZD("select stockmid from stockm Order by stockmid Desc",0)

	  Rs("mtypeid") = mtypeid_
	  Rs("isstockid") = isstockid
	  Rs("stockNum") = stockNum'进货编号
	  Rs("supplierid") = supplierid_
      Rs("Code") = htmlencode(GetText("Code","P","Str",1,110,"none"),"Y")'代码
      Rs("cName") = cName'中文名
      Rs("model") = htmlencode(GetText("model","P","Str",1,250,"none"),"Y")'型号
      Rs("eName") = htmlencode(GetText("eName","P","Str",1,250,"none"),"Y")'英文名
      Rs("eRemark") = htmlencode(GetText("eRemark","P","Str",1,10000,"none"),"Y")'英文备注
      Rs("cRemark") = htmlencode(GetText("cRemark","P","Str",1,250,"none"),"Y")'中文备注
      Rs("typeCode") = htmlencode(GetText("typeCode","P","Str",1,250,"none"),"Y")'型号条码
      Rs("Quality") = htmlencode(GetText("Quality","P","Str",1,250,"none"),"Y")'性质-
      Rs("unit") = htmlencode(GetText("unit","P","Str",1,100,"none"),"Y")'单位-
      
      Rs("inprice") = inprice_
	  outprice_ = GetText("outprice","P","number",1,10,0)'参考预出售价
      Rs("outprice") = outprice_
      Rs("inhow") = inhow_
      Rs("total") = inprice_ * inhow_

      Rs("inpayment") = inpayment_'已支付给供应商
	  Rs("intotime") = now '进货时间
	  Rs("updatetime") = now '最后修改时间
	  Rs("guarantyTime") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期
	  Rs("guarantyRemark") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期备注
	  Rs("guarantyTime") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期
	  Rs("guarantyTime") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期

	  Rs("thisDate") = thisDate__

      Rs("stockMax") = GetText("stockMax","P","number",1,10,0)'库存上限
      Rs("stockMin") = GetText("stockMin","P","number",1,10,0)'库存下限

      Rs("disabled") = GetText("disabled","P","number",1,10,0)'是否可用
     


	  Rs("aid") = Seuid_inc'录入者id

	  Rs("inModel") = "直接录入" '入库模式-是直接录入或销售时同步录入
   Rs.update
      
      
	  Response.Write viewinfo("alertClose","商品添加成功!","")
   Rs.Close
end if
ConnClose()
%>

</div>
</body>
</html>

⌨️ 快捷键说明

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