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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
     <title>
        新增直发包裹明细界面
     </title>
<script language="javascript" src="../lodop/LodopFuncs.js"></script>
<script language="javascript" src="../lodop/CLodopfuncs.js"></script>
<script language="javascript" type="text/javascript" src="../Scripts/PrintTemplate.js"></script>
<style>
    @font-face {
        font-family: 'KhmerOSFont';
        src: url('../Scripts/KhmerOS.ttf') format('truetype');
    }
</style>
<script src="../Scripts/layer/layer.js"></script>
<link href="../Scripts/bootstrap_3.3.7_css_bootstrap.min[1].css" rel="stylesheet" />
<link href="../Scripts/bootstrap-select.min.css" rel="stylesheet" />
 
<script src="../Scripts/jquery-3.3.1.min.js"></script>
<script src="../Scripts/bootstrap_3.3.7_js_bootstrap.min.js"></script>
<script src="../Scripts/bootstrap-select.min.js"></script>

<script src="../Scripts/jquery-1.6.3.js"></script>
<script src="../Scripts/jqueryUI/ui/jquery-ui-1.8.24.custom.js"></script>

<script type="text/javascript">
 
    function getParameter(sProp) {
        var re = new RegExp(sProp + "=([^\&]*)", "i");
        var a = re.exec(document.location.search);
        if (a == null)
            return null;
        return a[1];
    };
    
    function changetwodecimal(x) {
        var f_x = parsefloat(x);
        if (isnan(f_x)) {
            alert('function:changetwodecimal->parameter error');
            return false;
        }
        var f_x = math.round(x * 10000) / 10000;
        return f_x;
    }

     // 加载客户的信息
 function LoadCustomerInfo(){
   var customerCode = $("#<%=txtCustomerCode.ClientID %>").val();
     if(customerCode!=null && customerCode!=''){
          // 执行按钮
          document.getElementById('<%= btnReturnBagList.ClientID %>').click();
     }
 }
 

</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <yee:PageTitle ID="pgTitle" runat="server">
        <ShortCuts>
          
        </ShortCuts>
    </yee:PageTitle>

    
    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0" class="table">
            
            <tr>
                <td class="tbpostheader" style="font-size: large;width:150px">
                   <%=GetText("快递单号") %>
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtExpressNo" runat="server" style ="width:220px;" ></asp:TextBox>
                    <asp:Button ID="btnExpressNo" CssClass="button" runat="server" OnClick="btnExpressNo_Click" Text="扫描"/>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("客户代号") %>KH
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtCustomerCode" runat="server" Width="220" Height="50" ForeColor="Red" Font-Size="XX-Large" Font-Bold="true" onblur="LoadCustomerInfo()">
                    </asp:TextBox>( <%=GetText("请勿输入前缀") %>)KH
                </td>
            </tr>
            <tr>
                 <td class="tbpostheader">
                     <%=GetText("寄货仓") %>
                 </td>
                 <td class="tbpost" style="font-size: large;">
                     <asp:Literal ID="litWarehouseName" runat="server" ></asp:Literal>
                 </td>
            </tr>

            <tr>
                <td class="tbpostheader"><%=GetText("提货方") %>
                </td>
                <td class="tbpost">
                    <table>
                      
                        <tr>
                            <td><%=GetText("提货网点") %>：</td>
                            <td>
                                 <asp:DropDownList ID="ddlUserWare" runat="server" data-live-search="true" CssClass="selectpicker"></asp:DropDownList> 
                                 
                            </td>
                        </tr>
                        <tr>
                            <td><%=GetText("提货人") %>：</td>
                            <td>
                                <asp:TextBox ID="txtReceiver" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td><%=GetText("电话") %>：</td>
                            <td>
                                <asp:TextBox ID="txtReceMobile" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td><%=GetText("地址") %>：</td>
                            <td>
                                <asp:TextBox ID="txtReceAddress" runat="server" TextMode="MultiLine" ClientIDMode="Static"  Width="150px" Height="80px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr> 
            <tr>
                <td class="tbpostheader" width="100px"><%=GetText("长") %><%=GetText("宽") %><%=GetText("高") %>(CM)
                </td>
                <td class="tbpost">
                            <%=GetText("包裹名称") %>：<asp:TextBox ID="txtPacName" runat="server" Width="80px"  ></asp:TextBox>
                            <%=GetText("重量") %>(Kg)：<asp:TextBox ID="txtWeight" runat="server" Width="80px" >  </asp:TextBox>
                            <%=GetText("包裹数") %>：<asp:TextBox ID="txtCount" runat="server" Width="80px"  CssClass="count"   ></asp:TextBox>
                            <%=GetText("尺寸") %>(CM*CM*CM):<asp:TextBox ID="txtLength" runat="server" Width="80px"   />-
                            <asp:TextBox ID="txtWidth" runat="server" Width="80px"  ></asp:TextBox>-
                            <asp:TextBox ID="txtHeight" runat="server" Width="80px"    ></asp:TextBox>
                            <br />
                </td>
            </tr>
            <tr>
                <td class="tbpostheader"></td>
                <td class="tbpost"  >
                    <asp:RadioButtonList ID="rblOperation" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblOperation_SelectedIndexChanged" AutoPostBack="true">
                       
                    </asp:RadioButtonList>
                </td>

            </tr>
            <tr>
                <td class="tbfooter" width="100px"></td>
                <td class="tbfooter">
                    <asp:Button ID="btSubmit" runat="server" CssClass="button" Text="" OnClick="btnSubmit_Click" />
                    <asp:Button ID="btnSaveCollect" CssClass="button" runat="server" ClientIDMode="Static" Text=""  OnClick="btnSaveCollect_Click" />
              </td>
            </tr>
        </table>
    </div>

    <div class="subheader">
        <div class="title">
            <%=GetText("已录入数据") %> 
        </div>
        <div style="clear: both">
        </div>
    </div>
    
    <div>
        <asp:Repeater ID="rptAddPackageList" runat="server">
            <HeaderTemplate>
                <table cellpadding="0" class="table" cellspacing="0" border="0" id="table2">
                    <tr>
                        <td class="tbheader" align="center" width="100px">
                            <%=GetText("直发包裹编号") %>
                        </td>
                        <td class="tbheader" align="center" width="100px">
                            <%=GetText("快递单号") %>
                        </td>
                        <td class="tbheader" align="center" width="100px">
                            <%=GetText("客户代号") %>
                        </td>
                        <td class="tbheader" align="center" width="200px">
                            <%=GetText("寄货仓") %>
                        </td>
                        <td class="tbheader" align="center" width="100px">
                            <%=GetText("提货仓") %>
                        </td>
                        <td class="tbheader" align="center" width="200px">
                            <%=GetText("包裹名称") %>
                        </td>

                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tbrow">
                    <td class="tbpost">
                        <%# Eval("BigBagNo")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("ExpressNo")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("CustomerCode")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("WarehouseName")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("TargetWarehouseName")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("PackageName")%>
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="tbrowalter">
                    <td class="tbpost">
                        <%# Eval("BigBagNo")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("ExpressNo")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("CustomerCode")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("WarehouseName")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("TargetWarehouseName")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("PackageName")%>
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <FooterTemplate>
        </table>
            </FooterTemplate>
        </asp:Repeater>
    </div> 
    <asp:Button ID="btnReturnBagList" runat="server" style="display: none;" CssClass="button" OnClick="btnReturnBagList_Click" Text="加载客户信息" />
   
    <script language="javascript" type="text/javascript">

        var LODOP; //声明为全局变量
        // 一键装箱打印
        function PrintBox2022(serialNo, customerCode, orderNo, printName, enprintName,freighttype, ware_group,wareKhName,wareTel){
            var printData = [{ 
                SerialNo:serialNo, 
                CustomerCode:customerCode, 
                OrderNo:orderNo, 
                WareName:printName, 
                WareEnName:enprintName,
                WareKhName:wareKhName,
                WareTel:wareTel,
                FreightType:freighttype, 
                WareGroup:ware_group 
            }];
            var pageSize = {IntOrient:0,PageWidth:700,PageHeight:500,StrPageName:'A4'};
            //PrintWithTemplate('outPrinterGK888t',['PrintBox2022New'],printData,true,pageSize);
            PrintWithTemplate('outPrinterGK888t',['PrintBox'],printData,true,pageSize);
        };

        // 一键集包打印
        function PrintCollect(serialNo, customerCode, orderNo, wareName, wareEnName,freightType, wareGroup,boxData,stockOutOn,coSerialNo,wareKhName,wareTel){
            var printData = [{ 
                SerialNo:serialNo, 
                CustomerCode:customerCode, 
                OrderNo:orderNo, 
                WareName:wareName, 
                WareEnName:wareEnName,
                WareKhName:wareKhName,
                WareTel:wareTel,
                FreightType:freightType, 
                WareGroup:wareGroup 
            },{
                Qty:boxData, 
                StockOutOn:stockOutOn, 
                WareName:wareName, 
                WareEnName:wareEnName,
                 WareKhName:wareKhName,
                 WareTel:wareTel,
                CoSerialNo:coSerialNo,
                WareGroup:wareGroup
            }];
            var pageSize = {IntOrient:0,PageWidth:700,PageHeight:500,StrPageName:'A4'};
            //PrintWithTemplate('outPrinterGK888t',['PrintBox2022New','PrintCollectBy2019'],printData,true,pageSize);
            PrintWithTemplate('outPrinterGK888t',['PrintBox','PrintCollect'],printData,true,pageSize);
        }
    </script>

</asp:Content>
