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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title><%=GetText("集包签收") %> </title>

    <script language="javascript" src="../lodop/LodopFuncs.js?v=1"></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:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <yee:PageTitle ID="title" runat="server">
    </yee:PageTitle>
    <a href="javascript:prn3_preview()"><%=GetText("打印预览") %></a>
    <table id="tb" cellpadding="0" cellspacing="0" border="0" class="table">
        <tr>
            <td class="tbpostheader" style="width: 30%">
                <%=GetText("集包号") %>：
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtCollectSerialNo" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr class="tbpostheader">
            <td class="tbpostheader">
                <%=GetText("当前所在仓库") %>：
            </td>
            <td class="tbpost">

                <yee:UserWarehousesDropDownList ID="ddlWarehouse" runat="server" WarehouseType="海外仓储" OnSelectedIndexChanged="ddlWarehouse_SelectedIndexChanged" AutoPostBack="true">
                </yee:UserWarehousesDropDownList>
            </td>
        </tr>
        <tr class="tbpostheader">
            <td class="tbpostheader">
                <%=GetText("库区") %>：
            </td>
            <td class="tbpost">
                <asp:RadioButtonList ID="rblStorage" runat="server" RepeatDirection="Horizontal"></asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tbpostheader">
            <td class="tbpostheader">
                <%=GetText("标签格式") %>：
            </td>
            <td class="tbpost">
                <asp:RadioButtonList ID="rblTypeId" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="2" Text="70*50" Selected="True"></asp:ListItem>
                    <asp:ListItem Value="1" Text="100*60"></asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>

        <tr>
            <td class="tbfooter"></td>
            <td class="tbfooter">
                <yee:Button ID="btnScan" CssClass="button" runat="server" OnClick="btnScan_Click" />
            </td>
        </tr>
    </table>

    <asp:Repeater runat="server" ID="rptPackage" OnItemDataBound="rptPackage_ItemDataBound">
        <HeaderTemplate>
            <table class="table">
                <tr>
                    <td class="tbheader">序号</td>
                    <td class="tbheader">集包号</td>
                    <td class="tbheader">国际订单</td>
                    <td class="tbheader">箱子数</td>
                    <td class="tbheader">操作</td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <asp:Literal runat="server" ID="litNum"></asp:Literal></td>
                <td class="tbpost"><%# Eval("CollectSN") %></td>
                <td class="tbpost"><%# Eval("CtwOrderNO") %></td>
                <td class="tbpost"><%# Eval("BoxCount") %></td>
                <td class="tbpost"><a href='CollectBoxPrint.aspx?CollectSerialNo=<%# Eval("CollectSN") %>'>打印</a></td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="tbrowalter">
                <td class="tbpost">
                    <asp:Literal runat="server" ID="litNum"></asp:Literal></td>
                <td class="tbpost"><%# Eval("CollectSN") %></td>
                <td class="tbpost"><%# Eval("CtwOrderNO") %></td>
                <td class="tbpost"><%# Eval("BoxCount") %></td>
                <td class="tbpost"><a href='CollectBoxPrint.aspx?CollectSerialNo=<%# Eval("CollectSN") %>'>打印</a></td>
            </tr>
        </AlternatingItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <script language="javascript" type="text/javascript">

        var LODOP; //声明为全局变量
        function prn1_print(serialno, qty, dev_qty, storage_code, is_dev) {

            if (needCLodop()) {

                window.On_CLodop_Opened = function () {

                    if (is_dev == "1") {//有配送单
                        PrintSignCollect2022(serialno, qty, dev_qty, storage_code, dev_order_no);
                    }
                    else {
                        CreateOneFormPage(serialno, qty, dev_qty, storage_code);
                    }

                    window.On_CLodop_Opened = null;
                }

            }
            else {
                if (is_dev == "1") {//有配送单
                    PrintSignCollect2022(serialno, qty, dev_qty, storage_code, dev_order_no);
                }
                else {
                    CreateOneFormPage(serialno, qty, dev_qty, storage_code);
                }
            }

            //window.location.reload();
        };

        function prn3_preview() {
            CreateOneFormPage("GZ191031067", "100", "0", "B");
            //LODOP.PREVIEW();

        }

        function CreateOneFormPage(serialno, qty, dev_qty, storage_code) {

            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));

            LODOP.PRINT_INITA(0, 0, 265, 189, "");
            LODOP.SET_PRINT_PAGESIZE(0, 700, 500, "A4");
            //LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
            LODOP.ADD_PRINT_TEXT(32, 5, 205, 50, serialno);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 23);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(83, 71, 176, 51, qty + "件");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 31);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(94, 8, 64, 32, "入库");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(143, 4, 67, 35, "配送");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(136, 71, 180, 46, dev_qty + "件");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(28, 206, 58, 49, storage_code);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 34);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.SET_PRINTER_INDEXA("outPrinterGK888t");
            LODOP.PRINT();
            //LODOP.PRINT_DESIGN();
        };
        //集包中有配送单
        function PrintSignCollect2022(serialno, qty, dev_qty, storage_code, order_no) {

            LODOP.PRINT_INITA(0, 0, 265, 189, "");
            LODOP.SET_PRINT_PAGESIZE(0, 700, 500, "A4");
            //LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
            LODOP.ADD_PRINT_TEXT(73, 72, 184, 46, qty + "件");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_BARCODE(13, 22, 151, 55, "128A", order_no);
            LODOP.ADD_PRINT_TEXT(85, 6, 66, 32, "入库");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.ADD_PRINT_TEXT(126, 6, 65, 32, "配送");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.ADD_PRINT_TEXT(118, 72, 187, 41, dev_qty + "件");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(15, 184, 73, 59, storage_code);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线 Light");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 40);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(158, 27, 192, 31, serialno);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.SET_PRINTER_INDEXA("outPrinterGK888t");
            //LODOP.PRINT_DESIGN();
            LODOP.PRINT();
        }
    </script>
</asp:Content>