<%@ Page Title="" Language="C#" MasterPageFile="~/StockIn/Site.Master" AutoEventWireup="true" CodeBehind="ModifyThirdPartTransnation.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.SignBox.ModifyThirdPartTransnation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <script language="javascript" src="../lodop/LodopFuncs.js"></script>
    <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
        height="0">
        <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="lodop/install_lodop.exe"></embed>
    </object>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <yee:PageTitle ID="ptTitle" runat="server">
        <ShortCuts>
               <!--  <a href="javascript:printTest()"><%=GetText("打印测试") %></a> -->
  </ShortCuts>
    </yee:PageTitle>
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0" class="table">
            <tr>
                <td class="tbpostheader">
                    <%=GetText("配送单号") %>
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtOrderNo" runat="server" Font-Size="XX-Large"></asp:TextBox>
                    <asp:Button ID="btnClick" runat="server" Text="扫描" CssClass="button"
                        Style="border: none" OnClick="btnClick_Click" />
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("发货类型") %>
                </td>
                <td class="tbpost">
                    <asp:RadioButtonList ID="rblType" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" OnSelectedIndexChanged="rblType_SelectedIndexChanged">
                        <asp:ListItem Value="1" Text="转第三方快递" Selected="True"></asp:ListItem>
                        <asp:ListItem Value="2" Text="转本土件"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr id="tr_third" runat="server">
                <td class="tbpostheader">
                    <%=GetText("第三方快递单号") %>
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtExpressNo" runat="server" Font-Size="XX-Large"></asp:TextBox>
                </td>
            </tr>

            <tr id="tr_express_ware" runat="server">
                <td class="tbpostheader">
                    <%=GetText("提货网点") %>
                </td>
                <td class="tbpost">
                   <asp:DropDownList ID="ddlUserWare" runat="server" data-live-search="true" CssClass="selectpicker"></asp:DropDownList>
                </td>
            </tr>
            <tr id="tr_express_name" runat="server">
                <td class="tbpostheader"><%=GetText("提货人") %>：</td>
                <td class="tbpost">
                    <asp:TextBox ID="txtReceiver" runat="server"></asp:TextBox></td>
            </tr>
            <tr id="tr_express_mobile" runat="server">
                <td class="tbpostheader"><%=GetText("电话") %>：</td>
                <td class="tbpost">
                    <asp:TextBox ID="txtReceMobile" runat="server"></asp:TextBox></td>
            </tr>
            <tr id="tr_express_address" runat="server">
                <td class="tbpostheader"><%=GetText("地址") %>：</td>
                <td class="tbpost">
                    <asp:TextBox ID="txtReceAddress" runat="server" TextMode="MultiLine" Width="150px" Height="80px"></asp:TextBox></td>
            </tr>
            <tr id="tr_express_type" runat="server">
                <td class="tbpostheader">
                    <%=GetText("支付方式") %>
                </td>
                <td class="tbpost">
                    <asp:RadioButtonList ID="rblPayType" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="1" Text="寄付" Selected="True"></asp:ListItem>
                        <asp:ListItem Value="5" Text="到付" ></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr id="tr_express_item" runat="server">
                <td class="tbpostheader" width="100px"><%=GetText("长宽高") %>(CM)
                </td>
                <td class="tbpost">
                    <asp:Repeater ID="rptPackage" runat="server" OnItemCommand="rptPackage_ItemCommand" ClientIDMode="Static" OnItemDataBound="rptPackage_ItemDataBound">
                        <ItemTemplate>
                            <%=GetText("包裹名称") %>：<asp:TextBox ID="txtPacName" runat="server" Width="80px" Text='<%#Eval("ItemName") %>' ClientIDMode="Static"></asp:TextBox>
                            <%=GetText("重量") %>(Kg)：<asp:TextBox ID="txtWeight" runat="server" Width="80px" Text='<%#Eval("TotalWeight") %>' ClientIDMode="Static" onchange="click_volume()"></asp:TextBox>
                            <%=GetText("包裹数") %>：<asp:TextBox ID="txtCount" runat="server" Width="80px" Text='<%#Eval("PackageCount") %>' CssClass="count" ClientIDMode="Static" onchange="click_volume()"></asp:TextBox>
                            <%=GetText("尺寸") %>(CM*CM*CM):<asp:TextBox ID="txtLength" runat="server" Width="80px" Text='<%#Eval("PackageLength") %>' ClientIDMode="Static" onchange="click_volume()" />-
                                <asp:TextBox ID="txtWidth" runat="server" Width="80px" Text='<%#Eval("PackageWidth") %>' ClientIDMode="Static" onchange="click_volume()"></asp:TextBox>-
                                <asp:TextBox ID="txtHeight" runat="server" Width="80px" Text='<%#Eval("PackageHeight") %>' ClientIDMode="Static" onchange="click_volume()"></asp:TextBox>
                            <asp:LinkButton ID="lbnAdd" runat="server" CommandArgument='<%#Eval("UniqueId") %>' CommandName="add"></asp:LinkButton>
                            <asp:LinkButton ID="lbnDelete" runat="server" CommandArgument='<%#Eval("UniqueId") %>' CommandName="delete"></asp:LinkButton>
                            <asp:HiddenField ID="hfUniqueId" runat="server" ClientIDMode="Static" Value='<%#Eval("UniqueId") %>' />
                            <br />
                        </ItemTemplate>
                    </asp:Repeater>
                    <br />
                </td>
            </tr>
            <tr id="tr_express_flag" runat="server">
                <td class="tbpostheader">
                    <%=GetText("标签") %>：
                </td>
                <td class="tbpost">
                    <asp:RadioButtonList ID="rblTag" runat="server" RepeatDirection="Horizontal">
                       
                        <asp:ListItem Value="2" Text="70*50" Selected="True"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader"></td>
                <td class="tbpost">
                    <asp:Button ID="btnSubmit" runat="server" CssClass="button" OnClick="btnSubmit_Click" />
                    <asp:Button ID="btnExpress" runat="server" CssClass="button" OnClick="btnExpress_Click" />
                </td>
            </tr>
        </table>
    </div>

    <div>
        <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="0" cellspacing="0" border="0" class="table" id="table" style="text-align: center;">
                    <thead>
                        <tr>

                            <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>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tbrow">

                    <td class="tbpost">
                        <%#Eval("SerialNo") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("CustomerCode") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("Name") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("Mobile") %>
                    </td>
                    <td class="tbpost" width="20%">
                        <%#Eval("Address") %>
                    </td>
                    <td class="tbpost">
                        <asp:LinkButton ID="lbnDelete" runat="server" CommandArgument='<%#Eval("ID") %>' CommandName="detail" Text="移除"></asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="altertbrow">
                    <td class="tbpost">
                        <%#Eval("SerialNo") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("CustomerCode") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("Name") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("Mobile") %>
                    </td>
                    <td class="tbpost" width="20%">
                        <%#Eval("Address") %>
                    </td>
                    <td class="tbpost">
                        <asp:LinkButton ID="lbnDelete" runat="server" CommandArgument='<%#Eval("ID") %>' CommandName="detail" Text="移除"></asp:LinkButton>
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <FooterTemplate>
                </tbody>
        </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>

    <script language="javascript" type="text/javascript">

        var LODOP; //声明为全局变量
function printTest()
{    

   

    PrintExpress2022("L02325051456820",
    "257276",
    "sender",
    "123123",
    "send address",
    "国际",
    "recer",
    "8798979",
    "rece address",
    "CC",
    "0.5",
    "0.0",
    "0.0",
    "0.0",
    "目标站",
    "到站自提",
    "P05142099", "SL", "1", "1") 
}
         
        
//70*50 打印 2022-06-30
function PrintExpress2022(expressNo,
    customerCode,
    shippingCode,
    shippingTel,
    shippingAddress,
    packageType,
    receCode,
    receTel,
    receAddress,
    shipType,
    shippingFee,
    premium,
    deliveryFee,
    collecOnDelivery,
    toWarehouse,
    pickupMethod,
    orderNo, image, totalIndex, index) {
  
            if (needCLodop()) {
 
                window.On_CLodop_Opened = function () {

                    PrintFirstExpressByNew2022(expressNo,
                    customerCode,
                    shippingCode,
                    shippingTel,
                    shippingAddress,
                    packageType,
                    receCode,
                    receTel,
                    receAddress,
                    shipType,
                    shippingFee,
                    premium,
                    deliveryFee,
                    collecOnDelivery,
                    toWarehouse,
                    pickupMethod,
                    orderNo, image, totalIndex, index);

                    window.On_CLodop_Opened = null;
                }

            }
            else {
 
                PrintFirstExpressByNew2022(expressNo,
                customerCode,
                shippingCode,
                shippingTel,
                shippingAddress,
                packageType,
                receCode,
                receTel,
                receAddress,
                shipType,
                shippingFee,
                premium,
                deliveryFee,
                collecOnDelivery,
                toWarehouse,
                pickupMethod,
                orderNo, image, totalIndex, index);

            }
        }

       


function PrintFirstExpressByNew2022(expressNo,
    customerCode,
    shippingCode,
    shippingTel,
    shippingAddress,
    packageType,
    receCode,
    receTel,
    receAddress,
    shipType,
    shippingFee,
    premium,
    deliveryFee,
    collecOnDelivery,
    toWarehouse,
    pickupMethod,
    orderNo, image, totalIndex, index)
{
 
    LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
    const no = expressNo.split("-");

    LODOP.PRINT_INITA(0, 0, 262, 203, "");
    LODOP.SET_PRINT_PAGESIZE(0, 700, 500, "A4");
    LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
    LODOP.ADD_PRINT_RECT(3, 3, 250, 183, 0, 1);
    if (no.length == 2 && no[1].length != 3) {
        LODOP.ADD_PRINT_BARCODE(7, 19, 200, 39, "128Auto", expressNo);
    }
    else {
        LODOP.ADD_PRINT_BARCODE(7, 9, 200, 39, "128Auto", expressNo);
    }

    
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);

    if (image.length > 4) {
        LODOP.ADD_PRINT_IMAGE(8, 209, 41, 37, image);
        LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
    }
    else {
        LODOP.ADD_PRINT_SHAPE(4, 8, 209, 41, 37, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(19, 209, 41, 30, image);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    }
    
       LODOP.ADD_PRINT_TEXT(149, 7, 85, 17, customerCode);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_RECT(50, 3, 250, 35, 0, 1);
    LODOP.ADD_PRINT_RECT(85, 3, 250, 29, 0, 1);
    LODOP.ADD_PRINT_RECT(144, 3, 90, 20, 0, 1);
    LODOP.ADD_PRINT_RECT(129, 83, 80, 15, 0, 1);
    LODOP.ADD_PRINT_RECT(129, 3, 80, 15, 0, 1);
    LODOP.ADD_PRINT_RECT(144, 93, 70, 20, 0, 1);
    LODOP.ADD_PRINT_RECT(114, 3, 80, 15, 0, 1);
    LODOP.ADD_PRINT_RECT(114, 83, 80, 15, 0, 1);
    LODOP.ADD_PRINT_SHAPE(4, 52, 3, 60, 30, 0, 1, "#000000");
    LODOP.ADD_PRINT_TEXT(57, 3, 60, 20, shippingCode);
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
    LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(52, 64, 95, 20, "寄：" + shippingTel);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(65, 64, 169, 20, "地址：" + shippingAddress);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
    LODOP.ADD_PRINT_ELLIPSE(58, 207, 45, 25, 0, 1);
    LODOP.ADD_PRINT_TEXT(52, 149, 77, 17, orderNo);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(62, 209, 40, 16, packageType);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_SHAPE(4, 84, 3, 60, 30, 0, 1, "#000000");
    LODOP.ADD_PRINT_TEXT(92, 3, 60, 20, receCode);
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
    LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(86, 64, 112, 17, "收：" + receTel);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(86, 196, 60, 17, index + "/" + totalIndex);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(99, 64, 190, 18, "地址：" + receAddress);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
    LODOP.ADD_PRINT_TEXT(117, 8, 70, 15, shipType + ":" + shippingFee);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(117, 87, 70, 15, "DDF:" + deliveryFee);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(132, 8, 70, 15, "CIF:" + premium);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(132, 87, 70, 15, "COD:" + collecOnDelivery);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(169, 21, 133, 17, toWarehouse);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_TEXT(151, 92, 70, 17, pickupMethod);
    LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
    LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
    LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    LODOP.ADD_PRINT_BARCODE(113, 168, 85, 78, "QRCode", "https://wap.loda.com.kh/parcel-detail?id=" + no[0]);
    LODOP.SET_PRINT_STYLEA(0, "DataCharset", "GB2312");
    LODOP.ADD_PRINT_RECT(164, 3, 160, 22, 0, 1);
    // 设置打印机
    LODOP.SET_PRINTER_INDEXA("outPrinterGK888t");

  //LODOP.PRINT_DESIGN();
  LODOP.PRINT();
}
    </script>
</asp:Content>