<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InventoryAlarmList.aspx.cs"
    Inherits="Medical.MBusiness.SysInventory.InventoryAlarmList" %>

<%@ Register Src="../../Controls/Pager.ascx" TagName="Pager" TagPrefix="ucPager" %>
<%@ Register Src="../../Controls/LoadButton.ascx" TagName="LoadButton" TagPrefix="ucLoadButton" %>
<!DOCTYPE html>
<html>
<head>
    <title><%=ModuleName%></title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../js/myLib/jsHelper_Form.js" type="text/javascript"></script>
    <script src="../../js/myLib/Pager.js" type="text/javascript"></script>
    <script src="../../js/myLib/Grid.js" type="text/javascript"></script>
</head>
<body>
    <div class="pt-panel">
        <strong><%=ModuleName%></strong>
        <form name="fCondition" class="pt-padding">
            <ucLoadButton:LoadButton ID="LoadButton1" runat="server"/>
             <dl>
                <dt>药品名称</dt>
                <dd><input type="text" name="name" /></dd>
            </dl>
        </form>
    </div>
    <div class="pt-panel pt-below">
        <strong>查询一览</strong>
        <div class="pt-grid_frame">
            <table class="pt-grid" id="grid">
                <thead>
                    <tr>
                         <th style="width:80px">操作</th>
                        <th>药品编码</th>
                        <th>条码</th>
                        <th>药品名称</th>
                        <th>规格</th>
                        <th>包装单位</th>
                        <th>类别</th>
                         <th>生产企业</th>
                        <th>剂型</th>
                        <th>材质</th>
                        <th>安全库存</th>
                        <th>库存数</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
        </div>
        <ucPager:Pager ID="gridPager" runat="server" />
    </div>
    <script>
        (function() {
            var url = "InventoryAlarmList.aspx",
            listbutton = '<%=Medical.MCommon.PageHelper.GetListButton() %>',
            grid = new Grid({ id: "grid", url: url, pager: new Pager("gridPager"), bindFun: bindData }),
            title = '<%=ModuleName%>',
            dialogUrl = "/MBusiness/SysInventory/InventoryAlarmForm.aspx",
            dialogFormName = "InventoryAlarm_Form";

            function init() {
                grid.search();
                bindEvents();
            }
            function bindEvents() {
                $("#btnQuery").click(function() {
                    grid.search(true);
                });
                grid.control.click(function(e) {
                    var target = $(e.target);
                    if (target.is("input")) {
                        var data = target.parent().parent().data("data");
                        switch (target.val()) {
                            case "详情":
                                top.openDialog(dialogUrl + "?key=" + data.Code, dialogFormName, title, 700, 450, 50, 50);
                                break;
                        }
                    }
                });
            }
            function bindData(tr, data) {
                tr.append($("<td>").html(listbutton))
                .append($("<td>").html(data.Code))
                .append($("<td>").html(data.Barcode))
                .append($("<td>").html(data.Name))
                .append($("<td>").html(data.Spec))
                .append($("<td>").html(data.Subsection))
                .append($("<td>").html(data.Category))
                .append($("<td>").html(data.Factory))
                .append($("<td>").html(data.Type))
                .append($("<td>").html(data.Material))
                .append($("<td>").html(data.SafetyStock))
                .append($("<td>").html(data.TotalAmount));
            }
           
            init();
        })();
    </script>
</body>
</html>
