62,272
社区成员
发帖
与我相关
我的任务
分享
<input id="btnAdd" onclick="AddBill_Client();" type="button" value="添 加" />
function AddBill_Client() {
//设置序号
var last = $("#BillItemsTable tr:last");
var count = 0;
$(".SeqNo").each(function(i) {
count = i + 1;
})
//检查上一行是否存在物品名称,存在才添加新行
// if ($("#txtNo").val() == undefined) {
//给Table添加一行,编号、数量、备注放置文本框
count = count + 1;
var row = "<tr>";
row = row + "<td class='SeqNo'>" + count + "</td>"; //序号
row = row + "<td class='No'><input id='txtCodeNo" + count + "' onfocus='InitTextBox(this);' onkeyup='mainLoop(this.value);' class='TextBoxShort' type='text' /></td>"; //编号
row = row + "<td class='ProductName'></td>"; //名称
row = row + "<td class='spec'></td>"; //规格
row = row + "<td class='unit'></td>"; //单位
row = row + "<td class='SourceID' style='display:none;'></td>";
row = row + "<td class='BillItemID' style='display:none;'></td>";
row = row + "<td class='quantity'><input onkeydown='myKeyDownIsNum();' class='TextBoxNum' type='text' /></td>"; //请领数量
row = row + "<td class='note'><input class='TextBoxLong' type='text' /></td>"; //备注
row = row + "<td><a href='#' onclick='deleteRow(this);'>删除</a></td>"; //操作
row = row + "</tr>";
$("#BillItemsTable").append(row);
}

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>
<asp:ContentPlaceHolder ID="TitleContent" runat="server" />
</title>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Scripts/jquery-1.3.1.js"></script>
</head>
<body>
<div class="page">
<div id="header">
<div id="title">
<h1>
库存管理系统</h1>
</div>
<div id="logindisplay">
<% Html.RenderPartial("LogOnUserControl"); %>
</div>
<div id="menucontainer">
<ul id="menu">
<li><%= Html.ActionLink("领用申请录入", "Index", "Home")%></li>
<li><%= Html.ActionLink("领用申请查询", "Query", "Home")%></li>
</ul>
</div>
</div>
<div id="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
<div id="footer">
</div>
</div>
</div>
</body>
</html>