<%@ page language="C#" masterpagefile="~/Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_Stock_DepotListTotal, WebApp_deploy" title="存货报损单汇总表 " %>

<asp:Content ID="cphContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="sm" runat="server">
    </asp:ScriptManager>
    <div id="MainMenu">
        <div class="TabText">
            <table class="nick" id="table_item" runat="server">
                <tr>
                    <td class="tit left1">
                        &nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server"></asp:Literal>
                    </td>
                </tr>
            </table>
            <%--列表 begin--%>
            <asp:Panel ID="pnlManage" runat="server">
                <table class="nick">
                    <tr>
                        <td colspan="4" class="tit">
                            &nbsp;高级查询
                        </td>
                    </tr>
                    <tr>
                        <td class="ltd" style="width: 80px;">
                            &nbsp;时间：
                        </td>
                        <td class="rtd" style="width: 280px;">
                            &nbsp;<asp:TextBox ID="txtSearchBeginDate" runat="server" onfocus="WdatePicker()"
                                CssClass="Wdate" Width="100px"></asp:TextBox>
                            &nbsp;&nbsp;至&nbsp;&nbsp;<asp:TextBox ID="txtSearchEndDate" runat="server" onfocus="WdatePicker()"
                                CssClass="Wdate" Width="100px"></asp:TextBox>
                        </td>
                        <td class="ltd">
                            &nbsp;商品编号：
                        </td>
                        <td class="rtd">
                            &nbsp;<asp:TextBox ID="txtSearchInfoNumber" CausesValidation="false" runat="server"
                                Width="200px"></asp:TextBox>
                            &nbsp;<asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" />
                        </td>
                    </tr>
                </table>
                <asp:UpdatePanel ID="upList" runat="server">
                    <ContentTemplate>
                        <asp:Repeater ID="rptList" runat="server">
                            <HeaderTemplate>
                                <table class="adminlist" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <th>
                                            商品编号
                                        </th>
                                        <th>
                                            商品名称
                                        </th>
                                        <th>
                                            商品类型
                                        </th>
                                        <th>
                                            单位
                                        </th>
                                        <th>
                                            价格
                                        </th>
                                        <th>
                                            数量
                                        </th>
                                        <th>
                                            金额
                                        </th>
                                    </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr style="cursor: pointer" onclick="DetailFun('<%#Eval("ProductID") %>')" onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#E7EDFE'"
                                    onmouseout="this.style.backgroundColor=c;">
                                    <td>
                                        <asp:HiddenField ID="hfProductID" runat="server" Value='<%#Eval("ProductID") %>' />
                                        <asp:HyperLink ID="hlGoods_serial" runat="server" Text='<%# Eval("Goods_serial") %>'></asp:HyperLink>
                                    </td>
                                    <td align="left" style="padding: 0px 2px 0px 6px">
                                        <%# Eval("ProductName")%>
                                    </td>
                                    <td>
                                        <%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("ProductType").ToString())%>
                                    </td>
                                    <td>
                                        <%#Eval("Unit")%>
                                    </td>
                                    <td align="right">
                                        <%#Eval("Price")%>&nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                        <%#Eval("StockCount")%>&nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                        <asp:HiddenField ID="hfPrice" runat="server" Value='<%# Eval("Price") %>' />
                                        <asp:HiddenField ID="hfStockCount" runat="server" Value='<%# Eval("StockCount") %>' />
                                        <asp:Label ID="lblMoney" runat="server"></asp:Label>&nbsp;&nbsp;
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                <tr>
                                    <td>
                                        合计
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblFootCount" runat="server"></asp:Label>&nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblFootMoney" runat="server"></asp:Label>&nbsp;&nbsp;
                                    </td>
                                </tr>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </asp:Panel>
            <%--列表 end--%>
            <%--详细信息 begin--%>
            <asp:Panel ID="pnlDetail" runat="server">
                <asp:Repeater ID="rptItemInfo" runat="server">
                    <HeaderTemplate>
                        <table class="adminlist" cellspacing="0" cellpadding="0" width="100%">
                            <tr>
                                <th>
                                    日期
                                </th>
                                <th>
                                    单据编号
                                </th>
                                <th>
                                    商品编号
                                </th>
                                <th>
                                    商品名称
                                </th>
                                <th>
                                    单位
                                </th>
                                <th>
                                    数量
                                </th>
                                <th>
                                    价格
                                </th>
                                <th>
                                    金额
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#E7EDFE'"
                            onmouseout="this.style.backgroundColor=c;">
                            <td>
                                <%#Eval("StockDate")%>
                            </td>
                            <td>
                                <asp:HyperLink ID="hlInfoNumber" runat="server" Text='<%# Eval("InfoNumber") %>'
                                    NavigateUrl='<%# "Admin_Stock_DepotListManage.aspx?stockType="+Eval("StockOrderType")+"&action=checkinfo&infoOrderID="+ Eval("InfoOrderID")%>'></asp:HyperLink>
                            </td>
                            <td>
                                <%#Eval("Goods_serial") %>
                            </td>
                            <td>
                                <%#Eval("ProductName") %>
                            </td>
                            <td>
                                <%# Eval("Unit") %>
                            </td>
                            <td align="right" style="padding: 0px 6px 0px 2px">
                                <%# Eval("StockCount") %>
                            </td>
                            <td align="right" style="padding: 0px 6px 0px 2px">
                                <%# Eval("Price") %>
                            </td>
                            <td align="right" style="padding: 0px 6px 0px 2px">
                                <asp:HiddenField ID="hfItemPrice" runat="server" Value='<%#Eval("Price") %>' />
                                <asp:HiddenField ID="hfItemStockCount" runat="server" Value='<%#Eval("StockCount") %>' />
                                <asp:Label ID="lblItemMoney" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <tr>
                            <td>
                                合计
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td align="right" style="padding: 0px 6px 0px 2px">
                                <asp:Label ID="lblItemFootStockCount" runat="server"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td align="right" style="padding: 0px 6px 0px 2px">
                                <asp:Label ID="lblItemFootMoney" runat="server"></asp:Label>
                            </td>
                        </tr>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
                <asp:Literal ID="ltrPagePanel" runat="server"></asp:Literal>
            </asp:Panel>
            <%--详细信息 end--%>
        </div>
    </div>
    <script type="text/javascript">
        function DetailFun(id) {
            var linkHead = "<%=linkHead %>";
            var StockOrderType = "<%=StockOrderType %>";
            var url = "Admin_Stock_DepotListTotal.aspx?MenuID=5&MenuName=库存管理";
            if (StockOrderType == "bad") {
                url += "&FileName=报损单汇总表";
            } else if (StockOrderType == "baoyi") {

                url += "&FileName=报溢单汇总表";
            }
            window.location.href = url + linkHead + '&stockType=' + StockOrderType + '&action=checkinfo&ProductID=' + id;
        }
    </script>
</asp:Content>
