<%@ Page Title="" Language="C#" MasterPageFile="~/StockOut/Site1.Master" AutoEventWireup="true" CodeBehind="StockOutNoticeList.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.StockOut.StockOutNoticeList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>出库通知列表
    </title>
    <script type="text/javascript">
        //使用checkbox当做全选反选
        function check_all_not() {
            var check = document.getElementById("checkboxAll").checked;
            //alert(check);
            if (check == true) {
                checkAll();
            }
            else {
                checkReverse();
            }

        }

        //选择
        function checkAll() {
            $(".check ").each(function () {
                $(this).attr("checked", true);
            });
        }
        //反选
        function checkReverse() {
            $(".check ").each(function () {
                $(this).attr("checked", !($(this).attr("checked")));
            });
        }
        function checkRemove() {
            $(".check ").each(function () {
                $(this).attr("checked", false);
            });
        }

        function Invoices() {
            if (check_customer()) {

                var ids = "";
                var cb = $(".check:checked").each(function () {
                    ids += $(this).next().val() + ",";
                });
                location.href = "CutStockOutNoticeFreight.aspx?ids=" + ids;
            }
            return false;
        }

        function PickUpGoods() {
            if (check_customer()) {

                var ids = "";
                var cb = $(".check:checked").each(function () {
                    ids += $(this).next().val() + ",";
                });
                location.href = "CustomerPickUpGoods.aspx?ids=" + ids;
            }
            return false;
        }

        function CustomerSelf() {
            if (check_customer()) {

                var ids = "";
                var cb = $(".check:checked").each(function () {
                    ids += $(this).next().val() + ",";

                });
                $("#iframeBox").dialog("open");
                $("#BoxIframe").attr("src", "CustomerTakedBySelf.aspx?ids=" + ids);
            }
            return false;
        }

        function delegate_express() {
            if (check_customer()) {

                var ids = "";
                var cb = $(".check:checked").each(function () {
                    ids += $(this).next().val() + ",";

                });
                $("#iframeEdit").dialog("open");
                $("#EditIframe").attr("src", "DelegateExpress.aspx?ids=" + ids);

            }
            return false;
        }

        //检查是否是同一个会员
        function check_customer() {
            var count = 0;
            var num = 0;
            var code = "";
            $(".check:checked").each(function () {
                count++;
                if (code == $(this).val()) {
                    num++;
                }
                code = $(this).val();
            });

            if (count == 0) {
                alert("请选择数据行");
                return false;
            }
            if (count - 1 != num) {
                alert("请选择同一个会员");
                return false;
            }
            return true;
        }

        $(function () {
            $("#iframeEdit").dialog({
                title: '<%=GetText("第三方快递") %>',
                autoOpen: false,
                resizable: false,
                //height: 600,
                width: $("#EditIframe").width() + 20,
                modal: true
            });
        });
        $(function () {
            $("#iframeBox").dialog({
                title: '<%=GetText("客户自提") %>',
                autoOpen: false,
                resizable: false,
                //height: 600,
                width: $("#BoxIframe").width() + 20,
                modal: true
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <yee:PageTitle ID="pgTitle" runat="server"></yee:PageTitle>
    <yee:MessageBox ID="msg" runat="server"></yee:MessageBox>
    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="queryLeft">
                    <%=GetText("通知日期") %>：
                </td>
                <td class="queryRigth">
                    <yee:DatePicker ID="dpFrom" runat="server" CssClass="input-small" IsRequired="false" />
                    -
                    <yee:DatePicker ID="dpTo" runat="server" CssClass="input-small" IsRequired="false" />
                </td>
                <td class="queryLeft">
                    <%=GetText("流水号") %>：
                </td>
                <td class="queryRigth">
                    <asp:TextBox ID="txtSerialNo" runat="server"></asp:TextBox>
                </td>
                <td class="queryLeft">
                    <%=GetText("订单号") %>：
                </td>
                <td class="queryRigth">
                    <asp:TextBox ID="txtOrderNo" runat="server"></asp:TextBox>
                </td>

                <td class="queryLeft">
                    <%=GetText("仓储中心") %>：
                </td>
                <td class="queryRigth">
                    <yee:UserWarehousesDropDownList ID="ddlWarehouse" runat="server" WarehouseType="海外仓储">
                    </yee:UserWarehousesDropDownList>
                </td>
                <td class="queryLeft">
                    <yee:Button ID="btnQuery" runat="server" CssClass="button" OnClick="btnQuery_Click" />
                </td>
            </tr>
            <tr>

                <td class="queryLeft">
                    <%=GetText("出库状态") %>：
                </td>
                <td class="queryRigth" colspan="2">
                    <asp:RadioButtonList ID="rblStockOut" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="0"> 全部</asp:ListItem>
                        <asp:ListItem Value="2" Selected="True"> 未出库</asp:ListItem>
                        <asp:ListItem Value="1"> 已出库</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        </table>
    </div>
    <asp:Repeater ID="rptMaster" runat="server" OnItemCommand="rptMaster_ItemCommand"
        OnItemDataBound="rptMaster_ItemDataBound">
        <HeaderTemplate>
            <table class="table" cellpadding="0" cellspacing="0" border="0">
                <thead>
                    <tr>
                        <td class="tbheader" width="10px" rowspan="2">
                            <input type="checkbox" id="checkboxAll" onclick="check_all_not()" />
                        </td>
                        <td class="tbheader">
                            <%=GetText("流水号") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("订单号") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("客户代号") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("客户名称") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("通知时间") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("出库时间") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("出库人") %>
                        </td>
                        <td class="tbheader">
                            <%=GetText("操作") %>
                        </td>
                    </tr>
                </thead>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <input type="checkbox" runat="server" id="cbItem" class="check" value='<%# Eval("NoticeId") %>' />
                    <asp:HiddenField ID="hfNoticeId" runat="server" Value='<%#Eval("NoticeId") %>' />
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("SerialNo") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("OrderNo") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("CustomerCode") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("CustomerName") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("CreatedOn","{0:d}") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("StockOutOn")%>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("StockOutByName")%>
                </td>
                <td class="tbpost" style="text-align: center">
                    <asp:LinkButton ID="lbnDetail" runat="server" CommandName="detail" CommandArgument='<%#Eval("NoticeId") %>'><%=GetText("详情") %></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="tbrowalter">
                <td class="tbpost">
                    <input type="checkbox" runat="server" id="cbItem" class="check" value='<%# Eval("NoticeId") %>' />
                    <asp:HiddenField ID="hfNoticeId" runat="server" Value='<%#Eval("NoticeId") %>' />
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("SerialNo") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("OrderNo") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("CustomerCode") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("CustomerName") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("CreatedOn","{0:d}") %>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("StockOutOn")%>
                </td>
                <td class="tbpost" style="text-align: center">
                    <%#Eval("StockOutByName")%>
                </td>
                <td class="tbpost" style="text-align: center">
                    <asp:LinkButton ID="lbnDetail" runat="server" CommandName="detail" CommandArgument='<%#Eval("NoticeId") %>'><%=GetText("详情") %></asp:LinkButton>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <asp:Button ID="btnStockOut" runat="server" OnClick="btnStockOut_Click" Text="海外出库" CssClass="button" />
    <!--列表-->
    <yee:Pager ID="Pager1" runat="server" PageSize="10" PagerType="1" OnPageIndex_Changed="Pager1_PageIndex_Changed" />
</asp:Content>