<html>
<head>
<title>新添加产品包装物!</title>
<script language = "javascript">
var iNowRowIndex = -1
var var_rowindex = 0
function AddRow(obj)
{
if(iNowRowIndex != -1) iNowRowIndex ++
if(listtable.rows.length <= 2) iNowRowIndex = -1
var TheNewRow = listtable.insertRow(iNowRowIndex)
var_rowindex = TheNewRow.rowIndex
var theseltd = TheNewRow.insertCell()
theseltd.bgColor = "#ECE9D8"
theseltd.height="20"
theseltd.align = "center"
theseltd.title = "点击选择本行!"
theseltd.innerText = listtable.rows.length - 2
var stocknametd = TheNewRow.insertCell()
stocknametd.innerHTML = "<input type = 'text' name = 'stockname' size='20' title = '包装物名称,请点击选择包装物名称、库存数量!' style='width: 100%; height: 99%; font-size: 10pt'><input type = 'hidden' name = 'id'>"
var countstd = TheNewRow.insertCell()
countstd.innerHTML = "<input type = 'text' name = 'mount' size='20' title = '包装物库存数量,请点击选择包装物库存数量、名称!' value = '' style='text-align: right;width: 100%; height: 99%; font-size: 10pt'>"
var productnametd = TheNewRow.insertCell()
productnametd.innerHTML = "<input type = 'text' name = 'eachproductcounts' size='20' title = '每件产品所需数量,请输入每件产品所需的数量!' value = '' style='text-align: right;width: 100%; height: 99%; font-size: 10pt' onkeyup='getvalue(this)' onchange = 'GetCount(true)'>"
var productnametd = TheNewRow.insertCell()
productnametd.innerHTML = "<input type = 'text' name = 'stockcounts' size='20' title = '本产品所需包装总数量,请输入每件产品所需的包装总数量!' value = '' style='text-align: right;width: 100%; height: 99%; font-size: 10pt' >"
var productnametd = TheNewRow.insertCell()
productnametd.innerHTML = "<input type = 'text' name = 'stockcounts' size='20' title = '本产品所需包装总数量,请输入每件产品所需的包装总数量!' value = '' style='text-align: right;width: 100%; height: 99%; font-size: 10pt' >"
var productnametd = TheNewRow.insertCell()
productnametd.innerHTML = "<input type = 'text' name = 'stockcounts' size='20' title = '本产品所需包装总数量,请输入每件产品所需的包装总数量!' value = '' style='text-align: right;width: 100%; height: 99%; font-size: 10pt' >"
var productnametd = TheNewRow.insertCell()
productnametd.innerHTML = "<input type = 'text' name = 'stockcounts' size='20' title = '本产品所需包装总数量,请输入每件产品所需的包装总数量!' value = '' style='text-align: right;width: 100%; height: 99%; font-size: 10pt' >"
obj.disabled = false
}
function DelRow(obj)
{
//alert(iNowRowIndex)
if(listtable.rows.length > 2 && listtable.rows.length > iNowRowIndex) listtable.deleteRow(iNowRowIndex)
if(listtable.rows.lenght <=2) obj.disabled = true
}
function GetRow(e)
{
event.cancelBubble=true
var iNowIndex = -1
if(event.srcElement.tagName.toLowerCase() == "td")
{
iNowIndex = event.srcElement.parentElement.rowIndex
var_rowindex = 0
}
if(event.srcElement.tagName.toLowerCase() == "input")
{
iNowIndex = event.srcElement.parentElement.parentElement.rowIndex
var_rowindex = 0
}
if(var_rowindex !== 0) iNowIndex = var_rowindex
if(iNowIndex > 1 && listtable.rows.length > 2)
{
for(var i = 2; i < listtable.rows.length; i ++)
{
if(i % 2 == 0) listtable.rows[i].bgColor = "white"
else listtable.rows[i].bgColor = "#E8F3F4"
listtable.rows[i].cells[0].innerHTML = i - 1
listtable.rows[i].cells[0].bgColor = "#ECE9D8"
}
iNowRowIndex = iNowIndex
listtable.rows[iNowRowIndex].cells[0].innerHTML = "<font face='Arial'>►</font>"
listtable.rows[iNowRowIndex].cells[0].bgColor = "#33CCFF"
}
}
document.onclick = GetRow
</script>
</head>
<br>
<body topmargin="0" leftmargin="0"><form name = 'myform' action = 'stock_product.asp' method = 'post' onsubmit = "return checkallfrom()">
<input type = "hidden" name = "productid">
<table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse" width="90%">
<tr>
<td>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#bbbbbb" width="100%" id="listtable">
<tr align = "center">
<td > </td>
<td>书籍编号</td>
<td>进货数量</td>
<td>零售单价</td>
<td>出版社</td>
<td>进货时间</td>
<td>录入员</td>
<td>进货折扣</td>
</tr>
</table>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#bbbbbb" width="100%">
<tr align = "center">
<td> <input type = "button" value = "添加包装物" name = "addbut" onclick ="AddRow(delbut)">
<input type ="button" value="删除包装物" name="delbut" onclick="DelRow(this)" title ="删除选择的记录!">
<input type="submit" name="ok" value="确 定"><input type="reset" name="reset" value ="清 空">
</td>
</tr>
</table>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width = '100%' align='center'>
<tr align = 'center'><td height='31' width='6' background='../image/left-bottom.gif'></td>
<td background='../image/bottom-center.gif' align = 'center'>
<a href = '' onclick = 'window.history.back();return false'>返回</a></td>
<td height='31' width='8' background='../image/right-bottom.gif'></td></tr></table>
</td>
</tr>
</table></form>
</body>
</html>
<html>