<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="chargeitem_stock_book.aspx.cs" Inherits="VA.Modules.JDingMember.goods.chargeitem_stockbook" %>

<%@ Import Namespace="System.Data"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>商品库存流水账</title>    
    <!--#include virtual="/include/css/editlist.aspx"-->
    <!--#include virtual="/include/js/editlist.aspx"--> 
    <script type="text/javascript">     
        
        function JTongSmartDropDownList_AfterTakeValue(JTongSmartDropDownList_inputObjID, selectedRow) {
            if (selectedRow != null) {
            
                if (JTongSmartDropDownList_inputObjID == "txtItemName") {

                    var itemCode = selectedRow.cells[1].innerHTML;
                    var itemName = selectedRow.cells[2].innerHTML;

                    $("#txtItemName").val(itemName);
                    $("#txtItemName_hiddenValue").val(itemCode);
                }
            }

            //返回true，继续取值；返回false，取消取值；
            return true;
        }

        $(function () {
            setLayout();
            JTongToolBarButton_init();

            //绑定窗体resize事件；
            $(window).resize(function () {
                JTongSmartListTable_resize();
                setLayout();
            });
        });
    </script>

</head>
<body>
 <script type="text/javascript">
     
    <% if (base.chargeItemInfo != null && base.chargeItemInfo.RID != 0) {%>
     $(function(){
                   
            //加载数据；
            initLoadData();                                                        
        });
    <% } %>

</script>

<form id="Form1" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div id="pageWrapper" class="pageWrapper">   
    
    <div id="toolBar">                                 
        <a href="javascript:refresh()" class="jtongui-toolbarbutton" icon="icon-reload">刷新</a>            
    </div><!--toolBar.END-->   

    <div id="noteBar">
        <p>说明：发生数量大于0表示库存增加，发生数量小于0表示库存减少。</p>
    </div>
                     
    <div id="searchBar">
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>        

        商品：

        <VACTL:TextBox runat="server" ID="txtItemName" 
            CssClass="input" 
            onfocus="JTongSmartDropDownList_OnfocusHandler(this, 'get_chargeitem_forstockin.aspx',true,true,310,180);"
            Width="200px"
            CanBeNull="No"
            FieldName="商品名称"
            MaxLength="10" />
        <asp:HiddenField runat="server" id="txtItemName_hiddenValue" />   

        &nbsp;
        日期：
        <VACTL:TextBox ID="txtBeginDate" Runat="server"
            CssClass="input"
            Width="80px"            
            onfocus="laydate()"
            MaxLength="20" />  
        -      
        <VACTL:TextBox ID="txtEndDate" Runat="server"
            CssClass="input"
            Width="80px"            
            onfocus="laydate()"
            MaxLength="20" />        
   
        <asp:Button ID="btnSearch" runat="server" 
             CssClass="simpleBtn"
             Text="查询" 
             Onclick="btnSearch_Click" />
        
        </ContentTemplate>
        </asp:UpdatePanel>

    </div><!--searchBar.END-->    

    <div id="dataBar">

    <!--MainList.Start-->    
    <div class="jtongui-smartlisttable" id="jtongui-smartlisttable">

    <table cellpadding="3" cellspacing="0" class="tableheader" id="tb1_header" >
    <thead>
    <tr>
<%--        <td style="width:30px;text-align:center;"><input type="checkbox" id="ckb_selectAll"/></td>--%>
        <td style="width:30px;text-align:center;">No.</td>
       <%-- <td style="width:120px;text-align:center;">商品名称</td>--%>
        <td style="width:120px;text-align:center;">业务发生时间</td>
        <td style="width:70px;text-align:center;">上期结存</td>
        <td style="width:70px;text-align:center;">发生数量</td>
        <td style="width:70px;text-align:center;">本期结存</td>        
        <td style="width:300px;text-align:center;">摘要</td>
        <td style="width:70px;text-align:center;">操作员</td>                
        <td style="width:100px;text-align:center;">门店</td>	    	       	    
        <td></td>
    </tr>    
    </thead>
    </table>

    <div id="dataBody">
    <asp:Repeater ID="myRepeater" Runat="server" EnableViewState="False"  >
    <HeaderTemplate>
    <div class="bodyContainer">
    <% = base.ShowNoRecordInfo() %>    
    <table cellpadding="3" cellspacing="0" class="tablebody" tbHeader="tb1_header">
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
        <%--<td style="text-align:center;"><input type="checkbox" name="ckb_dataItem" value="<%# Eval("RID")%>" /></td>--%>
        <td align="center"><%# (base.currPage - 1)*base.PageSize + Container.ItemIndex + 1%></td>
       <%-- <td align="center"><%# Eval("Item_Name")%></td>--%>
        <td align="center"><%# String.Format("{0:yyyy-MM-dd hh:mm}",Eval("Operate_Date"))%></td>
        <td align="right"><%# Eval("Pre_Quantity")%></td>
        <td align="right"><%# Eval("This_Quantity")%></td>
        <td align="right"><%# Eval("After_Quantity")%></td>        
        <td align="left"><%# Eval("Remark")%></td>
        <td align="center"><%# Eval("Operator_Name")%></td>        
        <td align="center"><%# Eval("Shop_Name")%></td>
        <td></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </div><!--bodyContainer.END-->        

    <div id="divPagerInfo" style="display:none">
        <%=base.pageInfo%>
    </div>

    <input type="hidden" id="hidden_pageCnt" value="<% = base.PageCnt%>" />
    <input type="hidden" id="hidden_rdCnt" value="<% = base.RdCnt%>" />
    <input type="hidden" name="chkNum" value="<%=chkNum%>" />

    </FooterTemplate>
    </asp:Repeater>    
    </div><!--dataBody.END-->

    </div><!--jtongui-smartlisttable.END-->        
    <!--MainList.End-->  

    </div><!--dataBar.END-->

    <div id="pagerBar">
       ……
    </div><!--pageNavBar.END-->
    
    <asp:HiddenField runat="server" ID="hfCurrPage" EnableViewState="true" />
    
</div>

<!--每个页面上只能有一个该控件实例-->
<VACTL:SmartDropDownList ID="SmartDropDownList1" runat="server"></VACTL:SmartDropDownList>  

<%
    string canEdit = Request.QueryString["canedit"];
    if (!String.IsNullOrEmpty(canEdit) && canEdit == "0") 
    {
        Response.Write("<script text=\"text/javascript\">$('#txtItemName').attr('disabled','disabled');</script>");
    }
%>

</form>
</body>
</html> 
