<%@ page contentType="text/html; charset=gbk" language="java" %>
<%@ page import="mediastore.web.global.*"%>
<%@ page import="mediastore.web.form.*"%>
<%@ page import="mediastore.rule.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>

<body onload="document.form1.goodsid.focus()">
<script language="JavaScript">
//去掉空格
function Trim(str){
 if(str.charAt(0) == " "){
  str = str.slice(1);
  str = Trim(str); 
 }
 return str;
}

//判断是否是空
function isEmpty(pObj,errMsg){
 var obj = eval(pObj);
 if( obj == null || Trim(obj.value) == ""){
  if (errMsg == null || errMsg =="")
   alert("输入为空");
  else
   alert(errMsg); 
  obj.focus(); 
  return false;
 }
 return true;
}

//判断是否是整数
function isNumber(pObj,errMsg){
 var obj = eval(pObj);
 strRef = "1234567890";
 //if(!isEmpty(pObj,errMsg))return false;
 for (i=0;i<obj.value.length;i++) {
  tempChar= obj.value.substring(i,i+1);
  if (strRef.indexOf(tempChar,0)==-1) {
   if (errMsg == null || errMsg =="")
    alert("数据不符合要求，请检查");
   else
    alert(errMsg);
   if(obj.type=="text") 
    obj.focus(); 
   return false; 
  }
 }
 return true;
}

//判断是否是小数
function isFloat(pObj,errMsg){
 var obj = eval(pObj);
 strRef = "1234567890.";
 //if(!isEmpty(pObj,errMsg))return false;
 for (i=0;i<obj.value.length;i++) {
  tempChar= obj.value.substring(i,i+1);
  if (strRef.indexOf(tempChar,0)==-1) {
   if (errMsg == null || errMsg =="")
    alert("数据不符合要求，请检查");
   else
    alert(errMsg);
   if(obj.type=="text") 
    obj.focus(); 
   return false; 
  }
 }
 return true;
}



function mySubmit1(){

	if(isNumber(document.form1.repertoryamount1)==false)
	{}
	else if(isNumber(document.form1.repertoryamount2)==false)
	{}
	else if(isFloat(document.form1.importunitprice1)==false)
	{}
	else if(isFloat(document.form1.importunitprice2)==false)
	{}
	else if(isFloat(document.form1.purchaseunitprice1)==false)
	{}
	else if(isFloat(document.form1.purchaseunitprice2)==false)
	{}
	else
	{
		document.form1.start_rec_num.value = '1';
		document.form1.action="goodsSearch.do";
		document.form1.submit();
	}
}



function gotoPage(){
	
	//该值为要条转到的页面的起始记录号
	//alert(document.all.gotopagenum.value);

	document.form2.start_rec_num.value = document.all.gotopagenum.value;
	document.form2.action="goodsSearch.do";
	document.form2.submit();
	
}


function gotoPageByN(n){
	
	document.form2.start_rec_num.value = n;
	document.form2.action="goodsSearch.do";
	document.form2.submit();
	
}

function updateGoodsName(goodsid, newgoodsname, curStartRecNum)
{
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptGoodsName.do?updategoodsid="+goodsid+"&newgoodsname="+newgoodsname+"&";
	document.form2.submit();
}

function updateSubjectPersons(goodsid, newsubjectpersons, curStartRecNum)
{
	//alert(goodsid+"|"+newsubjectpersons+"|"+curStartRecNum);
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptSubjectPersons.do?updategoodsid="+goodsid+"&newsubjectpersons="+newsubjectpersons+"&";
	document.form2.submit();
}

function updateGoodsType(goodsid, newgoodstype, curStartRecNum)
{
	//alert(goodsid+" "+newgoodstype+" "+curStartRecNum);
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptGoodsType.do?updategoodsid="+goodsid+"&newgoodstype="+newgoodstype+"&";
	document.form2.submit();
}

function updateGoodsClass(goodsid, newgoodsclass, curStartRecNum)
{
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptGoodsClass.do?updategoodsid="+goodsid+"&newgoodsclass="+newgoodsclass+"&";
	document.form2.submit();
}

function updateGoodsShelfId(goodsid, newgoodsshelfid, curStartRecNum)
{
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptGoodsShelfId.do?updategoodsid="+goodsid+"&newgoodsshelfid="+newgoodsshelfid+"&";
	document.form2.submit();
}

function updatePurchaseUnitPrice(goodsid, newpurchaseunitprice, curStartRecNum)
{
	//用于数据校验的临时对象
	document.form2.obj4numbercheck.value = newpurchaseunitprice;
	
	if(isFloat(document.form2.obj4numbercheck)==false)
	{}
	else if(document.form2.obj4numbercheck.value == null || document.form2.obj4numbercheck.value == '')
	{
		alert("销售单价不可为空");
	}
	else
	{
		document.form2.start_rec_num.value = curStartRecNum;
		document.form2.action = "goodsSearchUptPurchaseUP.do?updategoodsid="+goodsid+"&newpurchaseunitprice="+newpurchaseunitprice+"&";
		document.form2.submit();
	}
}

function updateSpecialUnitPrice(goodsid, newspecialunitprice, curStartRecNum)
{
	//用于数据校验的临时对象
	document.form2.obj4numbercheck.value = newspecialunitprice;
	
	if(isFloat(document.form2.obj4numbercheck)==false)
	{}
	else if(document.form2.obj4numbercheck.value == null || document.form2.obj4numbercheck.value == '')
	{
		alert("货物特价不可为空");
	}
	else
	{
		document.form2.start_rec_num.value = curStartRecNum;
		document.form2.action = "goodsSearchUptSpecialUP.do?updategoodsid="+goodsid+"&newspecialunitprice="+newspecialunitprice+"&";
		document.form2.submit();
	}
}

function updateShelfLayerId(goodsid, newshelflayerid, curStartRecNum)
{
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptShelfLayerId.do?updategoodsid="+goodsid+"&newshelflayerid="+newshelflayerid+"&";
	document.form2.submit();
}
function updateLayerCellId(goodsid, newlayercellid, curStartRecNum)
{
	document.form2.start_rec_num.value = curStartRecNum;
	document.form2.action = "goodsSearchUptLayerCellId.do?updategoodsid="+goodsid+"&newlayercellid="+newlayercellid+"&";
	document.form2.submit();
}


function deleteGoods(goodsid, repertoryamount, curStartRecNum)
{
	if(repertoryamount>0)
	{
		alert("该货物库存不为零，不能删除该货物");
	}
	else if(confirm("确定要清除该货物的库存记录吗？")) 
	{
		document.form2.start_rec_num.value = curStartRecNum;
		document.form2.action = "goodsSearchDeleteGoods.do?deletegoodsid="+goodsid+"&";
		document.form2.submit();
	}
}


</script>




<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="5" rowspan="4" class="trtable"></td>
    <td width="6" bgcolor="#214984" height="1"></td>
    <td rowspan="4" bgcolor="#214984" width="1" height="1"></td>
    <td bgcolor="#214984" class="10p" colspan="2" height="1"></td>
    <td rowspan="4" width="1" bgcolor="#214984" height="1"></td>
    <td bgcolor="#214984" width="5" height="1"></td>
    <td width="5" rowspan="4" class="trtable"></td>
  </tr>
  <tr> 
    <td width="6"></td>
    <td width="379" height="20" class="mainhead">货物信息查询</td>
    <td class="mainhead" width="379" height="20">&nbsp;</td>
    <td width="5"></td>
  </tr>
<tr> 
    <td width="6"></td>
    <td valign="top" colspan="2"> 
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        
        <tr> 
          <td height="300" align="center" valign="top">   
          
<%////
	//---从页面对象中获取数据---
	GoodsSearchConFB gscfb = (GoodsSearchConFB)request.getAttribute(Globals.REQUEST_GOODSSEARCHCON);
	List goodsTypeList = gscfb.getGoodsTypeList();
	List goodsClassList = gscfb.getGoodsClassList();
	List goodsShelfList = gscfb.getGoodsShelfList();
	List goodsCreatorsList = gscfb.getGoodsCreatorsList();

	int curStartRecNum = gscfb.getStartRecNum();		//当前起始记录号
	int curPageRecNum = gscfb.getPageRecNum();		//页记录数
	GoodsSearchResultInfo gsri = gscfb.getGsri();		//检索结果可能为空
	GoodsSearchRule gsr = gscfb.getGsr();			//检索式可能为空
	
	List allGoodsTypeList = gscfb.getAllGoodsTypeList();
	List allGoodsClassList = gscfb.getAllGoodsClassList();
	List allGoodsShelfIdList = gscfb.getAllGoodsShelfIdList();
	//-------

	
	//组织与页、记录相关的信息
	List goodsList = new ArrayList();
	int totalItemNum = 0;
	if(gsri != null)
	{
		totalItemNum = gsri.getTotalRecNum();		//总记录数
		goodsList = gsri.getGoodsList();
	}
	int curPageIndex = curStartRecNum/curPageRecNum+1;	//当前页号
	int totalPageNum = 0;					//总页数
	if(totalItemNum%curPageRecNum==0)
	{
		totalPageNum = totalItemNum/curPageRecNum;
	}else{
		totalPageNum = totalItemNum/curPageRecNum+1;
	}
	int lastPageFirstRecNum = 0;				//最后一页的首记录号
	if(totalItemNum%curPageRecNum==0)
	{
		lastPageFirstRecNum = (totalItemNum/curPageRecNum-1)*(curPageRecNum)+1;
	}else{
		lastPageFirstRecNum = (totalItemNum/curPageRecNum)*(curPageRecNum)+1;
	}

	String lastOrderStr = "GoodsID";
	String lastGoodsId = "";
	String lastGoodsName = "";	
	String lastSubjectPersons = "";
	int lastRepertoryAmount1 = 0;
	int lastRepertoryAmount2 = 0;
	float lastImportUnitPrice1 = 0;
	float lastImportUnitPrice2 = 0;
	float lastPurchaseUnitPrice1 = 0;
	float lastPurchaseUnitPrice2 = 0;
	String lastGoodsType = "";
	String lastGoodsClass = "";
	String lastGoodsShelfId = "";
	String lastCreators = "";
	String lastConfirmFlage = "";
	String lastSpecialUnitPriceStatus = "";
	if(gsr!=null)
	{
		lastOrderStr = gsr.getOrderStr();
		lastGoodsId = gsr.getGoodsId();
		lastGoodsName = gsr.getGoodsName();
		lastSubjectPersons = gsr.getSubjectPersons();
		lastRepertoryAmount1 = gsr.getRepertoryAmount1();
		lastRepertoryAmount2 = gsr.getRepertoryAmount2();
		lastImportUnitPrice1 = gsr.getImportUnitPrice1();
		lastImportUnitPrice2 = gsr.getImportUnitPrice2();
		lastPurchaseUnitPrice1 = gsr.getPurchaseUnitPrice1();
		lastPurchaseUnitPrice2 = gsr.getPurchaseUnitPrice2();
		lastGoodsType = gsr.getGoodsType();
		lastGoodsClass = gsr.getGoodsClass();
		lastGoodsShelfId = gsr.getGoodsShelfId();
		lastCreators = gsr.getCreators();
		lastConfirmFlage = gsr.getConfirmFlage();
		lastSpecialUnitPriceStatus = gsr.getSpecialUnitPriceStatus();
	}
	
	
	String [] tmpStrBuf;
	String tmpStr;
%>

    	<form name="form1" method="post" action="" >
    	<font color=#215385><b>查询条件</b></font>
    	<IMG src="images/line1.gif" border=0>
    	<br>
    	<input type="hidden" name="start_rec_num"  value="1">
    	<TABLE width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" class="mailtable"> 
	  
	  <tr>
            <td  align="right"> 
                <b>货物标识:</b>
            </td>
            <td>
            	<input type=text name='goodsid' size="20" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">
            </td>
            <td  align="right"> 
                <b>货物类型:</b>
            </td>
            <td>
            	<SELECT size=1 name="goodstype">
            		<option value="0">请选择...</option>
            		<%
            			for(int i=0; i<goodsTypeList.size(); i++)
            			{
            				tmpStrBuf = (String [])goodsTypeList.get(i);
            		%>
            		<option value="<%=tmpStrBuf[0]%>"><%=tmpStrBuf[1]%></option>
			<%
				}
			%>
            	</SELECT>
            </td>
            <td width=20%>&nbsp;</td>
          </tr>
          
          <tr>
            <td  align="right"> 
                <b>货物名称:</b>
            </td>
            <td>
            	<input type=text name='goodsname' size="20" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">
            </td>
            <td  align="right"> 
                <b>分类属性:</b>
            </td>
            <td>
            	<SELECT size=1 name="goodsclass">
            		<option value="0">请选择...</option>
            		<%
            			for(int i=0; i<goodsClassList.size(); i++)
            			{
            				tmpStrBuf = (String [])goodsClassList.get(i);
            		%>
            		<option value="<%=tmpStrBuf[0]%>"><%=tmpStrBuf[1]%></option>
			<%//
				}
			%>
            	</SELECT>
            </td>
            <td>&nbsp;</td>
          </tr>
          
	  <tr>
            <td  align="right"> 
                <b>主题人名:</b>
            </td>
            <td>
            	<input type=text name='subjectpersons' size="20" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">
            </td>
            <td  align="right"> 
                <b>货架名称:</b>
            </td>
            <td>
            	<SELECT size=1 name="goodsshelfid">
            		<option value="0">请选择...</option>
            		<%//
            			for(int i=0; i<goodsShelfList.size(); i++)
            			{
            				tmpStrBuf = (String [])goodsShelfList.get(i);
            		%>
            		<option value="<%=tmpStrBuf[0]%>"><%=tmpStrBuf[1]%></option>
			<%//
				}
			%>
            	</SELECT>
            </td>
            <td>&nbsp;</td>
          </tr>

	  <tr>
            <td  align="right"> 
                <b>库存数量:</b>
            </td>
            <td>
            	大于等于<input type=text name='repertoryamount1' size="7" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">&nbsp;&nbsp;小于等于<input type=text name='repertoryamount2' size="7" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">
            </td>
            <td  align="right"> 
                <b>编辑人员:</b>
            </td>
            <td>
            	<SELECT size=1 name="creators">
            		<option value="0">请选择...</option>
            		<%//
            			for(int i=0; i<goodsCreatorsList.size(); i++)
            			{
            				tmpStr = (String)goodsCreatorsList.get(i);
            		%>
            		<option value="<%=tmpStr%>"><%=tmpStr%></option>
			<%//
				}
			%>
            	</SELECT>
            </td>
            <td>&nbsp;</td>
          </tr>

          <tr>
            <td  align="right"> 
                <b>库存单价:</b>
            </td>
            <td>
            	大于等于<input type=text name='importunitprice1' size="7" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">&nbsp;&nbsp;小于等于<input type=text name='importunitprice2' size="7" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">
            </td>
		<TD align="right"><b>货物状态:</b></TD>
		<TD>
			<SELECT name="confirmflage">
				<option value="">请选择...</option>
				<option value="1">正式入库</option>
				<option value="0">临时入库</option>
			</SELECT>
		</TD>
		<td>&nbsp;</td>
          </tr>
          <tr>
            <td  align="right"> 
                <b>销售单价:</b>
            </td>
            <td>
            	大于等于<input type=text name='purchaseunitprice1' size="7" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">&nbsp;&nbsp;小于等于<input type=text name='purchaseunitprice2' size="7" class="none" onKeyDown="if(event.keyCode==13) mySubmit1();">
            </td>
		<TD align="right"><b>特价状态:</b></TD>
		<TD>
			<SELECT name="specialunitpricestatus">
				<option value="">请选择...</option>
				<option value="1">普通货物</option>
				<option value="0">特价货物</option>
			</SELECT>
		</TD>
		<td>&nbsp;</td>
          </tr>
	</TABLE>
    	<TABLE width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" class="mailtable"> 

	  <tr>
		<TD align="right" width=12%><b>排序方式:</b></TD>
		<TD>
			<SELECT name="orderstr">
				<option value="GoodsID">货物标识升序</option>
				<option value="GoodsID DESC">货物标识降序</option>
				<option value="GoodsName">货物名称升序</option>
				<option value="GoodsName DESC">货物名称降序</option>
				<option value="SubjectPersons">主题人名升序</option>
				<option value="SubjectPersons DESC">主题人名降序</option>
				<option value="RepertoryAmount">库存数量升序</option>
				<option value="RepertoryAmount DESC">库存数量降序</option>
				<option value="ImportUnitPrice">库存单价升序</option>
				<option value="ImportUnitPrice DESC">库存单价降序</option>
				<option value="PurchaseUnitPrice">销售单价升序</option>
				<option value="PurchaseUnitPrice DESC">销售单价降序</option>
				<option value="ShelfLayerID">货架标识升序</option>
				<option value="ShelfLayerID DESC">货架标识降序</option>
				<option value="LastUpdateTime">更新时间升序</option>
				<option value="LastUpdateTime DESC">更新时间降序</option>
			</SELECT>
		</TD>
		<TD width=20%>
            		<input name=searchbutton type=button value="查询" onClick='mySubmit1()'>
		</TD>
          </tr>
	</TABLE>
	</form>

	
	<form name="form2" method="post" action="" >
	<font color=#215385><b>货物列表</b>（共 <font color="red"><%=totalItemNum%></font> 条货物信息）</font>

	<IMG src="images/line1.gif" border=0>
	
	<input type="hidden" name="start_rec_num"  value=""><!--提交的时候设置-->
	<input type="hidden" name="orderstr"  value="<%=lastOrderStr%>">
	<input type="hidden" name="goodsid"  value="<%=lastGoodsId%>">
	<input type="hidden" name="goodsname"  value="<%=lastGoodsName%>">
	<input type="hidden" name="subjectpersons"  value="<%=lastSubjectPersons%>">
	<input type="hidden" name="repertoryamount1"  value="<%=lastRepertoryAmount1%>">
	<input type="hidden" name="repertoryamount2"  value="<%=lastRepertoryAmount2%>">
	<input type="hidden" name="importunitprice1"  value="<%=lastImportUnitPrice1%>">
	<input type="hidden" name="importunitprice2"  value="<%=lastImportUnitPrice2%>">
	<input type="hidden" name="purchaseunitprice1"  value="<%=lastPurchaseUnitPrice1%>">
	<input type="hidden" name="purchaseunitprice2"  value="<%=lastPurchaseUnitPrice2%>">
	<input type="hidden" name="goodstype"  value="<%=lastGoodsType%>">
	<input type="hidden" name="goodsclass"  value="<%=lastGoodsClass%>">
	<input type="hidden" name="goodsshelfid"  value="<%=lastGoodsShelfId%>">
	<input type="hidden" name="creators"  value="<%=lastCreators%>">
	<input type="hidden" name="confirmflage"  value="<%=lastConfirmFlage%>">
	<input type="hidden" name="specialunitpricestatus"  value="<%=lastSpecialUnitPriceStatus%>">
	
	<!--由于数字和浮点数校验时，有一个参数是一个对象，所以这里提供一个临时对象，将要检查的数赋给它-->
	<input type="hidden" name="obj4numbercheck" value="">
	
	<TABLE width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" class="mailtable">  
		
		<%//
		NumberFormat nf = NumberFormat.getNumberInstance();
		nf.setMaximumFractionDigits(2);
		
		int index = 0;
	      	GoodsInfoObj tmpInfo = null;
	      	
	      	for (index=0; index<goodsList.size(); index++)
		{
	      		tmpInfo = (GoodsInfoObj)goodsList.get(index);
	      	%>

	        <tr <%if((index%2)==1){%>bgcolor="#CAE4F4"<%}else{%>bgcolor="#F9E4F2"<%}%> >
	        
		        <td><font color=#215385>货物标识:</font>
		        <a href="<%= request.getContextPath() + "/goodsInfoView.do?goodsid=" + tmpInfo.getGoodsId() %>" target='goodsinfo'><IMG src="images/goods.gif" border=0 alt='查看货物信息'></a><br>
		        <%= tmpInfo.getGoodsId() %>
		        </td>
		        
		        <td><font color=#215385>货物名称:</font>
			        <%
			        	if(tmpInfo.getGoodsName().equals("<font color=red>新进货</font>"))
			        	{
			        %>
			        	<INPUT name="newgoodsname" type="text" size=12 value="新进货" onChange="updateGoodsName('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
			        <%
			        	}
			        	else
			        	{
			        %>
			        	<INPUT name="newgoodsname" type="text" size=12 value="<%= tmpInfo.getGoodsName() %>" onChange="updateGoodsName('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
			        <%
			        	}
			        %>
		        </td>
			<td><font color=#215385>主题人名:</font>
				<%
					if(tmpInfo.getSubjectPersons() == null)
					{
				%>
					<INPUT name="newsubjectpersons" type="text" size=12 value="" onChange="updateSubjectPersons('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					}
					else
					{
				%>
					<INPUT name="newsubjectpersons" type="text" size=12 value="<%= tmpInfo.getSubjectPersons() %>" onChange="updateSubjectPersons('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					}
				%>
			</td>
			<td><font color=#215385>货物类型:</font>
				<SELECT size=1 name="allgoodstypelist"  onChange="updateGoodsType('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
		            		<%
		            			if(tmpInfo.getGoodsType()==null)
		            			{
		            				tmpInfo.setGoodsType("0");
		            		%>
		            			<option value='0' selected >请选择</option>
					<%
						}
		            			for(int i=0; i<allGoodsTypeList.size(); i++)
		            			{
		            				tmpStrBuf = (String [])allGoodsTypeList.get(i);
		            				
							
		            				if(tmpInfo.getGoodsType().equals(tmpStrBuf[0]))
		            				{
		            		%>
		            				<option value='<%=tmpStrBuf[0]%>' selected ><%=tmpStrBuf[1]%></option>
					<%
							}
							else
							{
					%>
							<option value='<%=tmpStrBuf[0]%>' ><%=tmpStrBuf[1]%></option>
					<%
							}
						}
					%>
		            	</SELECT>
			</td>
			<td><font color=#215385>分类属性:</font>
				<SELECT size=1 name="allgoodsclasslist"  onChange="updateGoodsClass('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
		            		<%
		            			if(tmpInfo.getGoodsClass()==null)
		            			{
		            				tmpInfo.setGoodsClass("0");
		            		%>
		            			<option value='0' selected >请选择</option>
					<%
						}
		            			for(int i=0; i<allGoodsClassList.size(); i++)
		            			{
		            				tmpStrBuf = (String [])allGoodsClassList.get(i);
		            				
							
		            				if(tmpInfo.getGoodsClass().equals(tmpStrBuf[0]))
		            				{
		            		%>
		            				<option value='<%=tmpStrBuf[0]%>' selected ><%=tmpStrBuf[1]%></option>
					<%
							}
							else
							{
					%>
							<option value='<%=tmpStrBuf[0]%>' ><%=tmpStrBuf[1]%></option>
					<%
							}
						}
					%>
		            	</SELECT>
			</td>
		</tr>
		
		<tr <%if((index%2)==1){%>bgcolor="#CAE4F4"<%}else{%>bgcolor="#F9E4F2"<%}%> >
			<td></td>
			<td><font color=#215385>库存数量:</font>&nbsp;<%= tmpInfo.getRepertoryAmount() %></td>
			<td><font color=#215385>库存单价:</font>&nbsp;<%= nf.format(tmpInfo.getImportUnitPrice()) %></td>
			<td><font color=#215385>销售单价:</font>
				<INPUT name="newpurchaseunitprice" type="text" size=5 value="<%= tmpInfo.getPurchaseUnitPrice() %>" onChange="updatePurchaseUnitPrice('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
			</td>
			<td><font color=#215385>货物特价:</font>
				<INPUT name="newspecialunitprice" type="text" size=5 value="<%= tmpInfo.getSpecialUnitPrice() %>" onChange="updateSpecialUnitPrice('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					if(tmpInfo.getSpecialUnitPrice()>0 && tmpInfo.getSpecialUnitPrice()<tmpInfo.getPurchaseUnitPrice())
					{
				%>
					<font color=red><b>特价</b></font>
				<%
					}
				%>
			</td>
	        </tr>
		<tr <%if((index%2)==1){%>bgcolor="#CAE4F4"<%}else{%>bgcolor="#F9E4F2"<%}%> >
			<td></td>
			<td><font color=#215385>货架名称:</font>
				<SELECT size=1 name="allgoodsshelfidlist"  onChange="updateGoodsShelfId('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
		            		<%
		            			if(tmpInfo.getGoodsShelfId()==null)
		            			{
		            				tmpInfo.setGoodsShelfId("0");
		            		%>
		            			<option value='0' selected >请选择</option>
					<%
						}
		            			for(int i=0; i<allGoodsShelfIdList.size(); i++)
		            			{
		            				tmpStrBuf = (String [])allGoodsShelfIdList.get(i);
		            				
							
		            				if(tmpInfo.getGoodsShelfId().equals(tmpStrBuf[0]))
		            				{
		            		%>
		            				<option value='<%=tmpStrBuf[0]%>' selected ><%=tmpStrBuf[1]%></option>
					<%
							}
							else
							{
					%>
							<option value='<%=tmpStrBuf[0]%>' ><%=tmpStrBuf[1]%></option>
					<%
							}
						}
					%>
		            	</SELECT>
			</td>
			<td><font color=#215385>货架层号:</font>
				<%
					if(tmpInfo.getShelfLayerId()==null)
					{
				%>
					<INPUT name="newshelflayerid" type="text" size=5 value="" onChange="updateShelfLayerId('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					}else{
				%>
					<INPUT name="newshelflayerid" type="text" size=5 value="<%= tmpInfo.getShelfLayerId() %>" onChange="updateShelfLayerId('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					}
				%>
			</td>
			<td><font color=#215385>层中格号:</font>
				<%
					if(tmpInfo.getLayerCellId()==null)
					{
				%>
					<INPUT name="newlayercellid" type="text" size=5 value="" onChange="updateLayerCellId('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					}else{
				%>
					<INPUT name="newlayercellid" type="text" size=5 value="<%= tmpInfo.getLayerCellId() %>" onChange="updateLayerCellId('<%= tmpInfo.getGoodsId() %>', this.value, '<%=curStartRecNum%>')">
				<%
					}
				%>
			</td>
			<td></td>
	        </tr>
		<tr <%if((index%2)==1){%>bgcolor="#CAE4F4"<%}else{%>bgcolor="#F9E4F2"<%}%> >
			<td></td>
			<td><font color=#215385>编辑人员:</font>&nbsp;<%= tmpInfo.getCreators() %></td>
			<td><font color=#215385>最近更新:</font>
			<%
				String tmptime = tmpInfo.getLastUpdateTime();
				if(tmptime==null)tmptime="";
				if(tmptime.length()>=19)
				{
			%>
					<%= tmptime.substring(0,19) %>
			<%
				}
			%>
			</td>
			<td><font color=#215385>货物状态:</font>
                                <%
					if(tmpInfo.getConfirmFlage().equals("0"))
					{
				%>
                                        <font color=#E61577>临时入库</font>
                                <%
					}
					else
					{
				%>
                                        <font color=#007168>正式入库</font>
                                <%
					}
				%>
			</td>
			<td>
				<!--删除货物是有条件的（1）库存小于等于0；（2）进货明细中未确认单不含该货物-->
				<font color=#215385>删除操作:</font>
				<%
					if("1".equals(tmpInfo.getDeleteAbleFlage()))
					{//可以删
				%>
					<a href="javascript:deleteGoods('<%= tmpInfo.getGoodsId() %>', '<%= tmpInfo.getRepertoryAmount() %>', '<%=curStartRecNum%>') "><IMG src="images/delto.gif" border=0></a>
				<%
					}else{
				%>
					<font color=#215385>不可删除</font>
				<%
					}
				%>
			</td>
	        </tr>
		<tr>
			<td></td>
			<td></td>
			<td></td>
		        <td></td>
		        <td></td>
	        </tr>
		<tr>
			<td></td>
			<td></td>
			<td></td>
		        <td></td>
		        <td></td>
	        </tr>
	        <%//
	
	      	}//--for
	        %>
	</TABLE>
	</form>

	<!--
	共 <font color="red"><%////=totalItemNum%></font> 条记录&nbsp;&nbsp;&nbsp;
	每页 <font color="red"><%////=curPageRecNum%></font> 条记录&nbsp;&nbsp;&nbsp;
	起始记录为 <font color="red"><%////=curStartRecNum%></font> &nbsp;&nbsp;&nbsp;
	共 <font color="red"><%////=totalPageNum%></font> 页&nbsp;&nbsp;&nbsp;
	当前为第 <font color="red"><%////=curPageIndex%></font> 页&nbsp;&nbsp;&nbsp;
	末页首记录号为 <font color="red"><%////=lastPageFirstRecNum%></font> &nbsp;&nbsp;&nbsp;
	-->
	<div align="right">
		<%
			if(curStartRecNum!=1)
			{
		%>
		<a href="javascript:gotoPageByN(1)"><IMG src="images/startpage.gif" border=0 alt='首页'></a>&nbsp;
		<%
			}
			else
			{
		%>
		<IMG src="images/startpage.gif" border=0 alt='首页'>&nbsp;
		<%	
			}
			
			if(curStartRecNum-curPageRecNum>=1)
			{
		%>
		<a href="javascript:gotoPageByN(<%=curStartRecNum-curPageRecNum%>)"><IMG src="images/lastpage.gif" border=0 alt='上一页'></a>&nbsp;&nbsp;
	    	<%
	    		}
			else
			{
		%>
		<IMG src="images/lastpage.gif" border=0 alt='上一页'>&nbsp;&nbsp;
		<%	
			}
			
	    		if(curStartRecNum+curPageRecNum<=lastPageFirstRecNum)
	    		{
	    	%>
	    	<a href="javascript:gotoPageByN(<%=curStartRecNum+curPageRecNum%>)"><IMG src="images/nextpage.gif" border=0 alt='下一页'></a>&nbsp;
	    	<%
	    		}
			else
			{
		%>
		<IMG src="images/nextpage.gif" border=0 alt='下一页'>&nbsp;
		<%	
			}
			
	    		if(curStartRecNum!=lastPageFirstRecNum && lastPageFirstRecNum>=1)
	    		{
	    	%>
	    	<a href="javascript:gotoPageByN(<%=lastPageFirstRecNum%>)"><IMG src="images/endpage.gif" border=0 alt='末页'></a>&nbsp;&nbsp;&nbsp;&nbsp;
	    	<%
	    		}
			else
			{
		%>
		<IMG src="images/endpage.gif" border=0 alt='末页'>&nbsp;&nbsp;&nbsp;&nbsp;
		<%	
			}
	    	%>
    	</div>
    	
    	<div align="center">
		第 <select name="gotopagenum" onChange="gotoPage()">
		<%for(int i=1; i<=totalPageNum; i++)
		  {%>
			<option value="<%=(i-1)*curPageRecNum+1%>" <%if(i==curPageIndex){%>selected<%}%>><%=i%></option>
		<%}%>
		</select> 页
	</div>


	</td>
        </tr>
        <tr> 
          <td valign="middle" align="center">&nbsp;</td>
        </tr>

      </table>
      
    </td>
    <td width="5"></td>
  </tr>
  <tr> 
    <td width="6"></td>
    <td colspan="2" class="mainhead">&nbsp;</td>
    <td width="5"></td>
  </tr>
  <tr> 
    <td colspan="8" bgcolor="#214984" height="2"></td>
  </tr>
</table>
</body>
