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

<%@ Register Src="../../Controls/Date.ascx" TagName="Date" TagPrefix="ucDate" %>
<%@ 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/My97DatePicker/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <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>
    <script src="../../js/myLib/jsHelper_Base.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="factory" /></dd>
            </dl>
            <dl>
                <dt>药品名称</dt>
                <dd><input type="text" name="name" /></dd>
            </dl>
            <dl>
                <dt>批号</dt>
                <dd><input type="text" name="batch" /></dd>
            </dl>
            <dl>
                <dt>盘点人</dt>
                <dd><input type="text" name="man" /></dd>
            </dl>
            <dl>
                <dt>盘点仓库</dt>
                <dd><input type="text" name="warehouse" /></dd>
            </dl>
            <ucDate:Date ID="ucDate" runat="server" />
        </form>
    </div>
    <div class="pt-panel pt-below">
        <strong>查询一览</strong>
        <div class="pt-grid_frame">
            <table class="pt-grid" id="grid" style="width:1500px">
                <thead>
                    <tr>
                        <th>药品编码</th>
                        <th>条码</th>
                        <th>药品名称</th>
                        <th>规格</th>
                        <th>包装单位</th>
                        <th>最小单位</th>
                        <th>剂型</th>
                        <th>材质</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 = "CheckRecordList.aspx",
            dialogUrl = "/MBusiness/SysCheckRecord/CheckRecordForm.aspx",
            dialogFormName = "CheckRecord_Form",
            grid = new Grid({ id: "grid", url: url, pager: new Pager("gridPager"), bindFun: bindData }),
            title = '<%=ModuleName %>';

            function init() {
                DateValidate(document.getElementById("startDate"), document.getElementById("endDate"));
                grid.search();
                bindEvents();
            }            
            function bindEvents() {
                $("#btnAdd").click(function() {
                    top.openDialog(dialogUrl, dialogFormName, title + ' - 添加', 750, 300, 50, 50);
                });
                $("#btnQuery").click(function() {
                    grid.search(true);
                });
            }
            function bindData(tr, data) {
                tr.append($("<td>").html(data.cCode))
                .append($("<td>").html(data.dBarcode))
                .append($("<td>").html(data.dName))
                .append($("<td>").html(data.dSpec))
                .append($("<td>").html(data.dSubsection))
                .append($("<td>").html(data.dUnit))
                .append($("<td>").html(data.dType))
                .append($("<td>").html(data.dMaterial))
                .append($("<td>").html(data.dFactory))
                .append($("<td>").html(data.cBatch))
                .append($("<td>").html(data.cPurchasePrice))
                .append($("<td>").html(data.cPrice))
                .append($("<td>").html(data.cAmount))
                .append($("<td>").html(data.cCheckAmount))
                .append($("<td>").html(data.cMoney))
                .append($("<td>").html(data.cMan))
                .append($("<td>").html(data.cWarehouse))
                .append($("<td>").html(data.cDate))
                .append($("<td>").html(data.cRemark));
            }
            init();
        })();
    </script>
</body>
</html>
