<%@ Page Title="" Language="C#" MasterPageFile="~/Package/package.Master" AutoEventWireup="true" CodeBehind="TransportPackageList.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.Package.TransportPackageList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
      <title>
         <%=GetText("转运包裹列表") %>
     </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 collect_click() {


             if ($(".check:checked").length == 0) {
                 alert("请先选择数据行");
                 return false;
             }
             var uniqueIds = "";

             $(".check:checked").each(function () {
                 uniqueIds += $(this).val() + ",";
             });
             $("#iframeBox").dialog("open");
             $("#BoxIframe").attr("src", "CollectTransportBox.aspx?uniqueIds=" + uniqueIds);
             return false;

         }


         $(function () {
             $("#iframeBox").dialog({
                 title: '二次集包',
                 autoOpen: false,
                 resizable: false,
                 //height: 600,
                 width: $("#iframeBox").width() + 20,
                 modal: true
             });
         });

    </script>
    <style type="text/css">
        #BoxIframe
        {
            width: 1200px;
            height: 500px;
        }
   
    </style>
     <script type="text/javascript">
         function closeIframe() {
             $("#iframeBox").dialog("close");
             $("#hfFrom").val("1");

             $("#form1").submit();
         }
    </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>
    <asp:HiddenField ID="hfFrom" runat="server" ClientIDMode="Static" />
    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
               
                <td class="queryLeft">
                    <%=GetText("客户代号") %>：
                </td>
                <td class="queryRigth">
                    <asp:TextBox ID="txtCustomerCode" CssClass="input-small" runat="server"></asp:TextBox> 
                </td>
                <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="txtExpressNo" CssClass="input-big" runat="server"></asp:TextBox> 
                </td>
               
                <td class="queryLeft">
                    <%=GetText("出库状态") %>：
                </td>
                <td class="queryRigth">
                    <yee:DictionaryDropDownList ID="ddlPackageStatu"  Dictionary="TransportPackageStatus" runat="server" IsShowAllAtFirst="true"></yee:DictionaryDropDownList>
                </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>
        </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="15px" 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>
                        <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("PackageUniqueId") %>'/>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("CustomerName") %>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("CustomerCode") %>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("RankName") %>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("CreatedOn","{0:d}") %>
                </td>
                <td class="tbpost" style="text-align: center">
                  <%#Eval("ExpressNo")%>
                </td>
                <td class="tbpost" style="text-align: center">
                   <asp:Literal ID="litFreightType" runat="server" ></asp:Literal>
                </td>
                <td class="tbpost" style="text-align: center">
                   <asp:Literal ID="litCompayName" runat="server" Text='<%#Eval("CompanyName") %>' ></asp:Literal>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("TransportPackageStatus")%>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("ReceiverName")%>
                </td>
                <td class="tbpost" style="text-align: center; width:300px" >
                   <asp:Literal ID="litAddress" Text='<%#Eval("Address") %>' runat="server" ></asp:Literal>
                </td>
                <td class="tbpost" style="text-align: center">
                    <asp:LinkButton ID="lbnDetail" runat="server" CommandName="detail" CommandArgument='<%#Eval("PackageUniqueId") %>'  ><%=GetText("详情") %></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="tbrowalter">
                <td class="tbpost">
                     <input type="checkbox" runat="server" id="cbItem" class="check" value='<%#Eval("PackageUniqueId") %>'/>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("CustomerName") %>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("CustomerCode") %>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("RankName") %>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("CreatedOn","{0:d}") %>
                </td>
                <td class="tbpost" style="text-align: center">
                  <%#Eval("ExpressNo")%>
                </td>
                <td class="tbpost" style="text-align: center">
                   <asp:Literal ID="litFreightType" runat="server" ></asp:Literal>
                </td>
                <td class="tbpost" style="text-align: center">
                   <asp:Literal ID="litCompayName" runat="server" Text='<%#Eval("CompanyName") %>' ></asp:Literal>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("TransportPackageStatus")%>
                </td>
                <td class="tbpost" style="text-align: center">
                   <%#Eval("ReceiverName")%>
                </td>
                <td class="tbpost" style="text-align: center; width:300px" >
                   <asp:Literal ID="litAddress" Text='<%#Eval("Address") %>' runat="server" ></asp:Literal>
                </td>
                <td class="tbpost" style="text-align: center">
                    <asp:LinkButton ID="lbnDetail" runat="server" CommandName="detail" CommandArgument='<%#Eval("PackageUniqueId") %>'  ><%=GetText("详情") %></asp:LinkButton>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <asp:Button ID="btnCollect" runat="server" CssClass="button" Text="二次集包" OnClientClick='return collect_click()'/>
    <!--列表-->
    <yee:Pager ID="Pager1" runat="server" PageSize="10" PagerType="1" OnPageIndex_Changed="Pager1_PageIndex_Changed" />
    <div id="iframeBox" class="iframeBox">
        <iframe id="BoxIframe" frameborder="0" class="BoxIframe"></iframe>
    </div>
</asp:Content>
