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

📄 xiaoshoudetail_add.asp

📁 下了就能用 不信你看一下 一定能用的
💻 ASP
字号:
<!--#include file="../conn.asp"-->
<%'mingxi=replace(replace(replace(now(),":",""),"-","")," ","")
 jindan=request("jindan")
fau=false
if request("action")="add" then
 if request("num")="" or request("xiaojia")="" then
 response.write"<script>alert('数量销售价不能为空');history.go(-1);</script>"
 response.End()
 end if 
   set rs=server.CreateObject("adodb.recordset")
    sql="select * from ht_Stockoutdetail"
	rs.open sql,conn,1,3
     rs.addnew()
    ' rs("number")=int(request("number"))
	' rs("stockhousename")=stockhousename
	' rs("type")=stocktype
	 rs("stockout_id")=jindan
	 rs("stockoutdetail_id")=request("mingxi")
	' rs("companyname")=companyname
	 rs("Goodstype")=request("pinzong")
	 rs("trademark")=request("pinpai") '品牌
	 rs("marktype")=request("xinhao")  '型号
	 rs("color")=trim(request("yanshe"))  '颜色
	 rs("appendant")=trim(request("kuansi"))
	
	' rs("inprice")=request("xiaojia") '销售价
	 rs("serial")=request("cuanhao2")
	 'rs("intotalprice")=request("xiaojia")*request("num") '总价
	 rs("quantity")=INT(request("num")) '数量
	 
     rs.update
     rs.close
     set rs=nothing
	
	 if trim(request("ckok"))="保存退出" then
	 response.write "<script language='javascript'>window.close();</script>"
	 end if 
	 if trim(request("ckok"))="保存新增" then
	 response.write "<script language='javascript'>window.location.href='xiaoshoudetail_add.asp?jindan="&request("jindan")&"';</script>"
	 end if 
	  
end if 
if request("action")="seacrh" then
    if request("cuanhao")<>"" then
        set rs=conn.execute("select stockdetail_number from ht_serial where serialnumber='"&trim(request("cuanhao"))&"'")
           if not rs.eof then
				set rs_de=conn.execute("select * from ht_stockdetail where stockdetail_number='"&rs(0)&"'")
				if not rs_de.eof then
				    fau=true
				    goodstype=rs_de("goodstype")
					trademark=rs_de("trademark")
					marktype=rs_de("marktype")
					appendant=rs_de("appendant")
					color=rs_de("color")
					saleprice=rs_de("saleprice")
				 else
				   fau=false
				end if 
				rs_de.close()
				set rs_de=nothing
           else
             response.write "<script>alert('此串号不存在');history.go(-1);</script>"
              response.end
           end if
		   rs.close
		   set rs=nothing
    else
       response.write "<script>alert('此串号不能为空');history.go(-1);</script>" 
       response.End()
    end if 
end if 
set rs1=conn.execute("select max(number) from ht_Stockoutdetail")
num1=rs1(0)+1
%>
<%set rs=server.createobject("adodb.recordset")
sql = "select * from ht_marktype ma,ht_Trademark tr where tr.Trademark_id=ma.Marktype_tr_id order by ma.marktype_name asc "
rs.open sql,conn,1,1
%>
<script language = "JavaScript">


function insertrows()
{
  
  
	if (document.form1.xiaojia.value==0||document.form1.xiaojia.value=="")
   {
       alert('销售价为空或者为0');
	   document.form1.xiaojia.focus();
       return false;
    }
if (window.opener.document.ck.wanchen.disabled)
{
window.opener.document.ck.wanchen.disabled=false;
}
	var theTable = window.opener.document.getElementById("table1");	
    var rowNumber = parseFloat(theTable.rows.length); //1
    var a=new Array()
	a[0]="";
	a[1]=document.form1.mingxi.value;
	a[2]=document.form1.pinzong.value;
	a[3]=document.form1.pinpainame.value;  
	a[4]=document.form1.cuanhao2.value;
	a[5]=document.form1.yanshe.value;
	a[6]=document.form1.xiaojia.value;
	a[7]=document.form1.num.value;
	a[8]=document.form1.xiaojia.value*document.form1.num.value;
	
	if (window.opener.document.ck.r0c1.value=="")
   {
      window.opener.document.ck.r0c1.value=a[1];
	  window.opener.document.ck.r0c2.value=a[2];
	  window.opener.document.ck.r0c3.value=a[3];
	  window.opener.document.ck.r0c4.value=a[4];
	  window.opener.document.ck.r0c5.value=a[5];
	  window.opener.document.ck.r0c6.value=a[6];
	  window.opener.document.ck.r0c7.value=a[7];
	  window.opener.document.ck.r0c8.value=a[8];
	  window.opener.document.ck.rowcount.value=rowNumber;
	}
	else
	{
	 window.opener.document.ck.rowcount.value=rowNumber+1;
	 theTable.insertRow(rowNumber);
	 for (var j=0;j<=theTable.rows[rowNumber-1].cells.length-1;j++)
	  {
	   var newValue="<input type='text' class='inputfield2' size='10' value='"+a[j]+"' name='r"+rowNumber+"c"+j+"' id=''r"+rowNumber+"c"+j+"' >r"+rowNumber+"c"+j;
       theTable.rows[rowNumber].insertCell(j);
	   theTable.rows[rowNumber].cells[j].innerHTML = newValue;
	   theTable.rows[rowNumber].cells[0].innerHTML="<div align='center'></div>";
	   theTable.rows[rowNumber].cells[0].className="borderon2";
	  }
	   //theTable.rows[rowNumber].cells[8].innerHTML="<input type='text' class='inputfield2' size='10' name='r"+rowNumber+"c8' id='r"+rowNumber+"c8'>";
	
	}
	//form1.submit();
}


	</script> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../css/body.css" rel="stylesheet" type="text/css">
<title>销售单明细表</title>
<style type="text/css">
<!--
.STYLE1 {
	font-size: 24px;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30"><span class="STYLE1">销售单明细商品</span></td>
  </tr>
</table>

<table width="100%" border="0">
<form name="form2" method="post" action="?action=seacrh&jindan=<%=jindan%>" >
  <tr>
    <td width="45%">串号:
      <input name="cuanhao" type="text" id="cuanhao" size="15"></td>
    <td width="55%"><input type="submit" name="Submit" value="检 索"></td>
  </tr>
  </form>
</table>
<%if fau then%>
<form name="form1" method="post" action="?action=add" >
<table width="518" border="1" align="center" cellpadding="0" cellspacing="2">
  <tr>
    <td width="78"><div align="right">销售单号:</div></td>
    <td width="168">
      <input name="jindan" type="text" disabled="disabled" id="jindan" value="<%=jindan%>" size="20">
      <input name="jindan" type="hidden" id="jindan" value="<%=jindan%>"></td>
    <td width="73"><div align="right">明细编号:</div></td>
    <td width="171">
	 <%
				 'mingxi=jindan
				 set rs1=conn.execute("select max(stockoutdetail_num) from ht_Stockoutdetail where Stockout_id='"&jindan&"'")
				 if rs1(0)>0 then
				 mingxi=jindan&"MX"&right("00"&rs1(0)+1,3)
				 stockoutdetail_num=rs1(0)+1
				
				 else
				 mingxi=jindan&"MX001"
				 stockoutdetail_num=1
				 end if 
				 rs1.close
				 set rs1=nothing
				 %>
	<input name="mingxi" type="text" id="mingxi" value="<%=mingxi%>">
	<input name="stockoutdetail_num" type="hidden" id="stockoutdetail_num" value="<%=stockoutdetail_num%>"></td>
  </tr>
  <tr>
    <td><div align="right">品种:</div></td>
    <td><input name="number" type="hidden" id="number" value="<%=num1%>">
      <input name="pinzong" type="text" id="pinzong" value="<%=goodstype%>" size="10"></td>
    <td><div align="right">串号:</div></td>
    <td><input name="cuanhao2" type="text" id="cuanhao2" value="<% =request("cuanhao")%>"></td>
  </tr>
  <tr>
    <td><div align="right">品牌:</div></td>
    <td><input name="pinpai" type="text" id="pinpai" value="<%=trademark%>" size="15"></td>
    <td><div align="right">款式:</div></td>
    <td><input name="kuansi" type="text" id="kuansi" value="<%=appendant%>" size="20"></td>
  </tr>
  <tr>
    <td><div align="right">型号</div></td>
    <td><input name="xinhao" type="text" id="xinhao" value="<%=marktype%>" size="15"></td>
    <td><div align="right">数量:</div></td>
    <td><input name="num" type="text" id="num" readonly="" onKeyUp="value=value.replace(/[^\d]/g,'') " value="1" size="8"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></td>
  </tr>
  <tr>
    <td><div align="right">颜色:</div></td>
    <td><input name="yanshe" type="text" id="yanshe" value="<%=color%>" size="15"></td>
    <td><div align="right">销售价:</div></td>
    <td><input name="xiaojia" type="text" id="xiaojia" onKeyUp="value=value.replace(/[^\d]/g,'') " value="<%=saleprice%>" size="15"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></td>
  </tr>
 
  
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
<table width="518" border="0" align="center" cellpadding="2" cellspacing="10">
  <tr>
    <td><div align="center">
      <input name="ckok" type="submit" id="ckok" onClick="javascript:return insertrows()" value="保存退出">
    </div></td>
    <td><div align="center">
      <input name="ckok" type="submit" id="ckok" value="保存新增" onClick="javascript:return insertrows()" >
    </div></td>
    <td><div align="center">
      <input type="button" name="Submit3" value="关  闭" onClick="javascript:window.close();">
    </div></td>
  </tr>
</table>
</form>
<% end if %>
</body> 
</html>

⌨️ 快捷键说明

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